Merge "Add toString method for FakeFoldingFeature" into androidx-main
diff --git a/.github/workflows/presubmit.yml b/.github/workflows/presubmit.yml
index 73b0a20..4afe691 100644
--- a/.github/workflows/presubmit.yml
+++ b/.github/workflows/presubmit.yml
@@ -19,6 +19,7 @@
-Dorg.gradle.internal.http.socketTimeout=300000 \
-Dorg.gradle.internal.repository.max.retries=10 \
-Dorg.gradle.internal.repository.initial.backoff=500 \
+ -Dorg.gradle.jvmargs="-XX:MaxMetaspaceSize=512m" \
--stacktrace"
echo "::set-output name=gradlew_flags::$GRADLEW_FLAGS"
- name: "Compute actions/checkout arguments"
@@ -93,7 +94,7 @@
id: affected-file-args
run: |
set -x
- AFFECTED_FILES=`echo "${{ steps.changed-files.outputs.files_including_removals }}" | sed 's|[^ ]* *|--changedFilePath=&|g'`
+ AFFECTED_FILES=`echo "${{ steps.changed-files.outputs.files_including_removals }}" | sed 's|\([^ ]\+\)|--changedFilePath=\1|g'`
echo "::set-output name=files::$AFFECTED_FILES"
- name: "ktlint"
uses: eskatos/gradle-command-action@v1
@@ -112,10 +113,10 @@
fail-fast: false
matrix:
os: [ubuntu-latest]
- project: ["activity", "biometric", "compose-compiler", "datastore", "fragment", "lifecycle", "navigation", "paging", "room", "work"]
+ project: ["activity", "biometric", "compose-runtime", "datastore", "fragment", "lifecycle", "navigation", "paging", "room", "work"]
include:
- - project: "compose-compiler"
- project-root: "compose/compiler"
+ - project: "compose-runtime"
+ project-root: "compose/runtime"
- project: "navigation"
custom-os: "macos-latest" # run one of them on a mac to ensure mac setup works
runs-on: ${{ matrix.custom-os || matrix.os }}
@@ -155,6 +156,7 @@
echo "DIST_DIR=$HOME/dist" >> $GITHUB_ENV
- name: "./gradlew findAffectedModules"
id: find-affected-modules
+ if: ${{ needs.lint.outputs.affectedFileArgs != '' }}
uses: eskatos/gradle-command-action@v1
env:
JAVA_HOME: ${{ steps.setup-java.outputs.path }}
diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml
index a5ba0fa..8769836 100644
--- a/.idea/inspectionProfiles/Project_Default.xml
+++ b/.idea/inspectionProfiles/Project_Default.xml
@@ -5,10 +5,11 @@
<inspection_tool class="AndroidLintLambdaLast" enabled="true" level="WEAK WARNING" enabled_by_default="true" />
<inspection_tool class="AndroidLintNoHardKeywords" enabled="true" level="WEAK WARNING" enabled_by_default="true" />
<inspection_tool class="AndroidLintSyntheticAccessor" enabled="true" level="WARNING" enabled_by_default="true">
- <scope name="buildSrc" level="WARNING" enabled="false" />
<scope name="Compose" level="WARNING" enabled="false" />
+ <scope name="buildSrc" level="WARNING" enabled="false" />
</inspection_tool>
<inspection_tool class="AndroidLintUnknownNullness" enabled="true" level="WEAK WARNING" enabled_by_default="true" />
+ <inspection_tool class="DeprecatedIsStillUsed" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="Deprecation" enabled="true" level="WARNING" enabled_by_default="true">
<option name="IGNORE_IMPORT_STATEMENTS" value="false" />
</inspection_tool>
@@ -48,6 +49,9 @@
<option name="IGNORE_POINT_TO_ITSELF" value="false" />
<option name="myAdditionalJavadocTags" value="hide" />
</inspection_tool>
+ <inspection_tool class="JavadocReference" enabled="true" level="ERROR" enabled_by_default="true">
+ <option name="REPORT_INACCESSIBLE" value="false" />
+ </inspection_tool>
<inspection_tool class="KDocUnresolvedReference" enabled="true" level="ERROR" enabled_by_default="true" />
<inspection_tool class="MissingDeprecatedAnnotation" enabled="true" level="ERROR" enabled_by_default="true" />
<inspection_tool class="NullableProblems" enabled="true" level="ERROR" enabled_by_default="true">
@@ -59,6 +63,7 @@
<option name="REPORT_NOT_ANNOTATED_SETTER_PARAMETER" value="true" />
<option name="REPORT_ANNOTATION_NOT_PROPAGATED_TO_OVERRIDERS" value="true" />
<option name="REPORT_NULLS_PASSED_TO_NON_ANNOTATED_METHOD" value="true" />
+ <option name="REPORT_NULLS_PASSED_TO_NOT_NULL_PARAMETER" value="false" />
</inspection_tool>
<inspection_tool class="PrivatePropertyName" enabled="true" level="WEAK WARNING" enabled_by_default="true">
<scope name="Compose" level="WEAK WARNING" enabled="true">
@@ -78,5 +83,6 @@
<option name="namePattern" value="[A-Za-z_\d]+" />
</scope>
</inspection_tool>
+ <inspection_tool class="UnusedReturnValue" enabled="false" level="WARNING" enabled_by_default="false" />
</profile>
</component>
\ No newline at end of file
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 8af2df5..0e45536 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -12,6 +12,7 @@
- [Activity](https://developer.android.com/guide/components/activities/intro-activities)
- [Biometric](https://developer.android.com/training/sign-in/biometric-auth)
- [Compose Compiler](https://developer.android.com/jetpack/androidx/releases/compose-compiler)
+ - [Compose Runtime](https://developer.android.com/jetpack/androidx/releases/compose-runtime)
- [DataStore](https://developer.android.com/topic/libraries/architecture/datastore)
- [Fragment](https://developer.android.com/guide/components/fragments)
- [Lifecycle](https://developer.android.com/topic/libraries/architecture/lifecycle)
@@ -51,6 +52,7 @@
-- activity
-- biometric
-- compose/compiler
+ -- compose/runtime
-- datastore
-- fragment
-- lifecycle
diff --git a/README.md b/README.md
index 45920be..21a5938 100644
--- a/README.md
+++ b/README.md
@@ -16,6 +16,7 @@
* [Activity](activity)
* [Biometric](biometric)
* [Compose Compiler](compose/compiler)
+* [Compose Runtime](compose/runtime)
* [DataStore](datastore)
* [Fragment](fragment)
* [Lifecycle](lifecycle)
@@ -116,6 +117,8 @@
maven { url '/path/to/checkout/out/androidx/build/support_repo/' }
```
+**NOTE: In order to see your changes in the project, you might need to clean your build (`Build > Clean Project` in Android Studio or run `./gradlew clean`).**
+
### Continuous integration
[Our continuous integration system](https://ci.android.com/builds/branches/aosp-androidx-main/grid?) builds all in progress (and potentially unstable) libraries as new changes are merged. You can manually download these AARs and JARs for your experimentation.
diff --git a/activity/activity-lint/src/main/java/androidx/activity/lint/ActivityIssueRegistry.kt b/activity/activity-lint/src/main/java/androidx/activity/lint/ActivityIssueRegistry.kt
index 1a23b1a..8020e0b 100644
--- a/activity/activity-lint/src/main/java/androidx/activity/lint/ActivityIssueRegistry.kt
+++ b/activity/activity-lint/src/main/java/androidx/activity/lint/ActivityIssueRegistry.kt
@@ -24,7 +24,7 @@
*/
class ActivityIssueRegistry : IssueRegistry() {
// tests are run with this version. We ensure that with ApiLintVersionsTest
- override val api = 10
+ override val api = 11
override val minApi = CURRENT_API
override val issues get() = listOf(
ActivityResultFragmentVersionDetector.ISSUE
diff --git a/activity/buildSrc b/activity/buildSrc
new file mode 120000
index 0000000..053a423
--- /dev/null
+++ b/activity/buildSrc
@@ -0,0 +1 @@
+../buildSrc
\ No newline at end of file
diff --git a/ads/ads-identifier-benchmark/src/androidTest/AndroidManifest.xml b/ads/ads-identifier-benchmark/src/androidTest/AndroidManifest.xml
index a5b8f03..e50ddd3 100644
--- a/ads/ads-identifier-benchmark/src/androidTest/AndroidManifest.xml
+++ b/ads/ads-identifier-benchmark/src/androidTest/AndroidManifest.xml
@@ -16,15 +16,10 @@
-->
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:tools="http://schemas.android.com/tools"
package="androidx.ads.identifier.benchmark">
-
- <!-- Important: disable debuggable for accurate performance results -->
<application
- android:name=".AdsIdentifierBenchmarkApplication"
- android:debuggable="false">
- <!-- enable profileableByShell for non-intrusive profiling tools -->
- <!--suppress AndroidElementNotAllowed -->
+ android:name=".AdsIdentifierBenchmarkApplication">
+ <!-- enable profiling by shell for non-intrusive profiling tools -->
<profileable android:shell="true"/>
</application>
</manifest>
diff --git a/androidx-plugin/.idea/codeStyles/Project.xml b/androidx-plugin/.idea/codeStyles/Project.xml
deleted file mode 120000
index b52b28c..0000000
--- a/androidx-plugin/.idea/codeStyles/Project.xml
+++ /dev/null
@@ -1 +0,0 @@
-../../../.idea/codeStyles/Project.xml
\ No newline at end of file
diff --git a/androidx-plugin/.idea/codeStyles/codeStyleConfig.xml b/androidx-plugin/.idea/codeStyles/codeStyleConfig.xml
deleted file mode 120000
index 19c4848..0000000
--- a/androidx-plugin/.idea/codeStyles/codeStyleConfig.xml
+++ /dev/null
@@ -1 +0,0 @@
-../../../.idea/codeStyles/codeStyleConfig.xml
\ No newline at end of file
diff --git a/androidx-plugin/.idea/copyright/AndroidCopyright.xml b/androidx-plugin/.idea/copyright/AndroidCopyright.xml
deleted file mode 120000
index afbbd04..0000000
--- a/androidx-plugin/.idea/copyright/AndroidCopyright.xml
+++ /dev/null
@@ -1 +0,0 @@
-../../../.idea/copyright/AndroidCopyright.xml
\ No newline at end of file
diff --git a/androidx-plugin/.idea/copyright/profiles_settings.xml b/androidx-plugin/.idea/copyright/profiles_settings.xml
deleted file mode 120000
index 5996ccd..0000000
--- a/androidx-plugin/.idea/copyright/profiles_settings.xml
+++ /dev/null
@@ -1 +0,0 @@
-../../../.idea/copyright/profiles_settings.xml
\ No newline at end of file
diff --git a/androidx-plugin/.idea/inspectionProfiles/Project_Default.xml b/androidx-plugin/.idea/inspectionProfiles/Project_Default.xml
deleted file mode 120000
index a7481f4..0000000
--- a/androidx-plugin/.idea/inspectionProfiles/Project_Default.xml
+++ /dev/null
@@ -1 +0,0 @@
-../../../.idea/inspectionProfiles/Project_Default.xml
\ No newline at end of file
diff --git a/androidx-plugin/.idea/scopes/Ignore_API_Files.xml b/androidx-plugin/.idea/scopes/Ignore_API_Files.xml
deleted file mode 120000
index 3361ee1..0000000
--- a/androidx-plugin/.idea/scopes/Ignore_API_Files.xml
+++ /dev/null
@@ -1 +0,0 @@
-../../../.idea/scopes/Ignore_API_Files.xml
\ No newline at end of file
diff --git a/androidx-plugin/.idea/scopes/buildSrc.xml b/androidx-plugin/.idea/scopes/buildSrc.xml
deleted file mode 120000
index 25b7d3b..0000000
--- a/androidx-plugin/.idea/scopes/buildSrc.xml
+++ /dev/null
@@ -1 +0,0 @@
-../../../.idea/scopes/buildSrc.xml
\ No newline at end of file
diff --git a/androidx-plugin/README.md b/androidx-plugin/README.md
deleted file mode 100644
index 90435de..0000000
--- a/androidx-plugin/README.md
+++ /dev/null
@@ -1,18 +0,0 @@
-# AndroidX Gradle Plugin
-
-The AndroidX Gradle plugin is a repackaged version of the existing Gradle plugin in the `buildSrc` directory.
-
-This project helps decouple AndroidX project builds from having to use `buildSrc` and they can use the maven coordinates
-`androidx.build:gradle-plugin:<version>` instead.
-
-```groovy
-// in settings.gradle
-includeBuild("../androidx-plugin")
-
-// in build.gradle
-dependencies {
- //.. other dependencies
- classpath 'androidx.build:gradle-plugin:0.1.0'
-}
-```
-
diff --git a/androidx-plugin/build.gradle b/androidx-plugin/build.gradle
deleted file mode 100644
index 1b78748..0000000
--- a/androidx-plugin/build.gradle
+++ /dev/null
@@ -1,54 +0,0 @@
-import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
-
-buildscript {
- repositories {
- google()
- mavenCentral()
- maven {
- url("https://androidx.dev/dokka/builds/7299536/artifacts/repository")
- metadataSources {
- mavenPom()
- artifact()
- }
- }
- }
-
- dependencies {
- classpath(libs.androidGradlePluginz)
- classpath(libs.kotlinGradlePluginz)
- classpath(libs.dokkaGradlePluginz)
- }
-}
-
-allprojects {
- repositories {
- google()
- mavenCentral()
- gradlePluginPortal()
- maven {
- url("https://androidx.dev/metalava/builds/7610917/artifacts/repo/m2repository")
- metadataSources {
- mavenPom()
- artifact()
- }
- }
- maven {
- url("https://androidx.dev/dokka/builds/7472101/artifacts/repository")
- metadataSources {
- mavenPom()
- artifact()
- }
- }
- }
- tasks.withType(KotlinCompile).configureEach {
- kotlinOptions {
- jvmTarget = "1.8"
- freeCompilerArgs += [
- "-Werror",
- "-Xskip-runtime-version-check",
- // Allow `@OptIn` and `@UseExperimental`
- "-Xopt-in=kotlin.RequiresOptIn"
- ]
- }
- }
-}
diff --git a/androidx-plugin/gradle b/androidx-plugin/gradle
deleted file mode 120000
index 1c936b3..0000000
--- a/androidx-plugin/gradle
+++ /dev/null
@@ -1 +0,0 @@
-../playground-common/gradle
\ No newline at end of file
diff --git a/androidx-plugin/gradle-plugin/.gitignore b/androidx-plugin/gradle-plugin/.gitignore
deleted file mode 100644
index 42afabf..0000000
--- a/androidx-plugin/gradle-plugin/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-/build
\ No newline at end of file
diff --git a/androidx-plugin/gradle-plugin/build.gradle b/androidx-plugin/gradle-plugin/build.gradle
deleted file mode 100644
index 687e5c6..0000000
--- a/androidx-plugin/gradle-plugin/build.gradle
+++ /dev/null
@@ -1,75 +0,0 @@
-import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
-
-plugins {
- id "kotlin"
- id "java-gradle-plugin"
-}
-
-ext.supportRootFolder = project.projectDir.getParentFile().getParentFile()
-
-apply from: "../../buildSrc/kotlin-dsl-dependency.gradle"
-
-dependencies {
- implementation(project(":jetpad-integration"))
-
- compileOnly(findGradleKotlinDsl())
- implementation(gradleApi())
-
- implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:${libs.versions.kotlin.get()}")
-
- implementation(libs.androidGradlePluginz)
- implementation(libs.dexMemberList)
- implementation(libs.kotlinGradlePluginz)
- implementation(libs.kotlinPoet)
-
- implementation(libs.dokkaGradlePluginz)
- implementation(libs.gson)
-
- implementation(libs.androidLint)
-
- // Not really sure about these:
- implementation("com.googlecode.json-simple:json-simple:1.1")
- implementation("androidx.benchmark:benchmark-gradle-plugin:1.0.0")
- implementation(libs.protobufGradlePluginz)
- implementation(libs.shadow)
- implementation(libs.wireGradlePluginz)
- testImplementation(libs.junit)
-}
-
-sourceSets {
- ["public", "private", "plugins"].each { subdir ->
- main.java.srcDirs += "${supportRootFolder}/buildSrc/${subdir}/src/main/kotlin"
- }
-
- main.java.srcDirs += "${supportRootFolder}/inspection/inspection-gradle-plugin/src/main/kotlin"
- test.java.srcDirs += "${supportRootFolder}/buildSrc-tests/src/test/kotlin"
- main.resources.srcDirs += "${supportRootFolder}/inspection/inspection-gradle-plugin/src/main/resources"
-}
-
-version = "0.1.0"
-group = "androidx.build"
-
-java {
- sourceCompatibility = JavaVersion.VERSION_11
- targetCompatibility = JavaVersion.VERSION_11
-}
-
-tasks.withType(KotlinCompile).all {
- kotlinOptions {
- jvmTarget = "1.8"
- freeCompilerArgs += ["-Werror"]
- }
-}
-
-gradlePlugin {
- plugins {
- AndroidXPlugin {
- id = "AndroidXPlugin"
- implementationClass = "androidx.build.AndroidXPlugin"
- }
- AndroidXComposePlugin {
- id = "AndroidXComposePlugin"
- implementationClass = "androidx.build.AndroidXComposePlugin"
- }
- }
-}
diff --git a/androidx-plugin/gradle.properties b/androidx-plugin/gradle.properties
deleted file mode 120000
index d952fb0..0000000
--- a/androidx-plugin/gradle.properties
+++ /dev/null
@@ -1 +0,0 @@
-../playground-common/androidx-shared.properties
\ No newline at end of file
diff --git a/androidx-plugin/gradlew b/androidx-plugin/gradlew
deleted file mode 120000
index 05b75179..0000000
--- a/androidx-plugin/gradlew
+++ /dev/null
@@ -1 +0,0 @@
-../playground-common/gradlew
\ No newline at end of file
diff --git a/androidx-plugin/gradlew.bat b/androidx-plugin/gradlew.bat
deleted file mode 120000
index b20877e..0000000
--- a/androidx-plugin/gradlew.bat
+++ /dev/null
@@ -1 +0,0 @@
-../playground-common/gradlew.bat
\ No newline at end of file
diff --git a/androidx-plugin/settings.gradle b/androidx-plugin/settings.gradle
deleted file mode 100644
index 490f67f..0000000
--- a/androidx-plugin/settings.gradle
+++ /dev/null
@@ -1,13 +0,0 @@
-enableFeaturePreview("VERSION_CATALOGS")
-
-dependencyResolutionManagement {
- versionCatalogs {
- libs {
- from(files("../gradle/libs.versions.toml"))
- }
- }
-}
-
-include ":gradle-plugin"
-include ":jetpad-integration"
-project(":jetpad-integration").projectDir = file("../buildSrc/jetpad-integration")
\ No newline at end of file
diff --git a/annotation/annotation-experimental-lint/integration-tests/lint-baseline.xml b/annotation/annotation-experimental-lint/integration-tests/lint-baseline.xml
index 6e79778..20510a5 100644
--- a/annotation/annotation-experimental-lint/integration-tests/lint-baseline.xml
+++ b/annotation/annotation-experimental-lint/integration-tests/lint-baseline.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<issues format="6" by="lint 7.1.0-alpha03" type="baseline" client="gradle" name="AGP (7.1.0-alpha03)" variant="all" version="7.1.0-alpha03">
+<issues format="6" by="lint 7.1.0-dev" type="baseline" client="gradle" dependencies="false" name="AGP (7.1.0-dev)" variant="all" version="7.1.0-dev">
<issue
id="ExperimentalAnnotationRetention"
@@ -180,6 +180,17 @@
<issue
id="UnsafeOptInUsageError"
message="This declaration is opt-in and its usage should be marked with `@sample.optin.ExperimentalJavaAnnotation` or `@OptIn(markerClass = sample.optin.ExperimentalJavaAnnotation.class)`"
+ errorLine1=" return experimentalObject.field;"
+ errorLine2=" ~~~~~">
+ <location
+ file="src/main/java/sample/optin/UseJavaExperimentalClassFromJava.java"
+ line="32"
+ column="35"/>
+ </issue>
+
+ <issue
+ id="UnsafeOptInUsageError"
+ message="This declaration is opt-in and its usage should be marked with `@sample.optin.ExperimentalJavaAnnotation` or `@OptIn(markerClass = sample.optin.ExperimentalJavaAnnotation.class)`"
errorLine1=" AnnotatedJavaClass experimentalObject = new AnnotatedJavaClass();"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~">
<location
@@ -202,6 +213,17 @@
<issue
id="UnsafeOptInUsageError"
message="This declaration is opt-in and its usage should be marked with `@sample.optin.ExperimentalJavaAnnotation` or `@OptIn(markerClass = sample.optin.ExperimentalJavaAnnotation.class)`"
+ errorLine1=" return AnnotatedJavaClass.FIELD_STATIC;"
+ errorLine2=" ~~~~~~~~~~~~">
+ <location
+ file="src/main/java/sample/optin/UseJavaExperimentalClassFromJava.java"
+ line="47"
+ column="35"/>
+ </issue>
+
+ <issue
+ id="UnsafeOptInUsageError"
+ message="This declaration is opt-in and its usage should be marked with `@sample.optin.ExperimentalJavaAnnotation` or `@OptIn(markerClass = sample.optin.ExperimentalJavaAnnotation.class)`"
errorLine1=" return AnnotatedJavaClass.methodStatic();"
errorLine2=" ~~~~~~~~~~~~">
<location
@@ -278,6 +300,28 @@
<issue
id="UnsafeOptInUsageError"
+ message="This declaration is opt-in and its usage should be marked with `@sample.optin.ExperimentalJavaAnnotation` or `@OptIn(markerClass = sample.optin.ExperimentalJavaAnnotation.class)`"
+ errorLine1=" return experimentalObject.field"
+ errorLine2=" ~~~~~">
+ <location
+ file="src/main/java/sample/optin/UseJavaExperimentalFromKt.kt"
+ line="29"
+ column="35"/>
+ </issue>
+
+ <issue
+ id="UnsafeOptInUsageError"
+ message="This declaration is opt-in and its usage should be marked with `@sample.experimental.ExperimentalDateTime` or `@OptIn(markerClass = sample.experimental.ExperimentalDateTime.class)`"
+ errorLine1=" return dateProvider.date"
+ errorLine2=" ~~~~">
+ <location
+ file="src/main/java/sample/experimental/UseJavaExperimentalFromKt.kt"
+ line="30"
+ column="29"/>
+ </issue>
+
+ <issue
+ id="UnsafeOptInUsageError"
message="This declaration is opt-in and its usage should be marked with `@sample.experimental.ExperimentalDateTime` or `@OptIn(markerClass = sample.experimental.ExperimentalDateTime.class)`"
errorLine1=" return dateProvider.date"
errorLine2=" ~~~~">
@@ -312,6 +356,17 @@
<issue
id="UnsafeOptInUsageError"
message="This declaration is opt-in and its usage should be marked with `@sample.optin.ExperimentalJavaAnnotation` or `@OptIn(markerClass = sample.optin.ExperimentalJavaAnnotation.class)`"
+ errorLine1=" return AnnotatedJavaClass.FIELD_STATIC"
+ errorLine2=" ~~~~~~~~~~~~">
+ <location
+ file="src/main/java/sample/optin/UseJavaExperimentalFromKt.kt"
+ line="44"
+ column="35"/>
+ </issue>
+
+ <issue
+ id="UnsafeOptInUsageError"
+ message="This declaration is opt-in and its usage should be marked with `@sample.optin.ExperimentalJavaAnnotation` or `@OptIn(markerClass = sample.optin.ExperimentalJavaAnnotation.class)`"
errorLine1=" return AnnotatedJavaClass.methodStatic()"
errorLine2=" ~~~~~~~~~~~~">
<location
@@ -344,6 +399,17 @@
<issue
id="UnsafeOptInUsageError"
+ message="This declaration is opt-in and its usage should be marked with `@sample.experimental.ExperimentalLocation` or `@OptIn(markerClass = sample.experimental.ExperimentalLocation.class)`"
+ errorLine1=" return dateProvider.date + locationProvider.location"
+ errorLine2=" ~~~~~~~~">
+ <location
+ file="src/main/java/sample/experimental/UseJavaExperimentalFromKt.kt"
+ line="58"
+ column="53"/>
+ </issue>
+
+ <issue
+ id="UnsafeOptInUsageError"
message="This declaration is opt-in and its usage should be marked with `@sample.optin.ExperimentalJavaAnnotation` or `@OptIn(markerClass = sample.optin.ExperimentalJavaAnnotation.class)`"
errorLine1=" return stableObject.field"
errorLine2=" ~~~~~">
@@ -388,6 +454,17 @@
<issue
id="UnsafeOptInUsageError"
+ message="This declaration is opt-in and its usage should be marked with `@sample.optin.ExperimentalJavaAnnotation2` or `@OptIn(markerClass = sample.optin.ExperimentalJavaAnnotation2.class)`"
+ errorLine1=" return experimentalObject.method() + AnnotatedJavaClass2.FIELD_STATIC"
+ errorLine2=" ~~~~~~~~~~~~">
+ <location
+ file="src/main/java/sample/optin/UseJavaExperimentalFromKt.kt"
+ line="108"
+ column="66"/>
+ </issue>
+
+ <issue
+ id="UnsafeOptInUsageError"
message="This declaration is opt-in and its usage should be marked with `@sample.optin.ExperimentalJavaAnnotation` or `@OptIn(markerClass = sample.optin.ExperimentalJavaAnnotation.class)`"
errorLine1=" return stableObject.field;"
errorLine2=" ~~~~~">
@@ -443,6 +520,17 @@
<issue
id="UnsafeOptInUsageError"
+ message="This declaration is opt-in and its usage should be marked with `@sample.optin.ExperimentalJavaAnnotation2` or `@OptIn(markerClass = sample.optin.ExperimentalJavaAnnotation2.class)`"
+ errorLine1=" return experimentalObject.method() + experimentalObject2.field;"
+ errorLine2=" ~~~~~">
+ <location
+ file="src/main/java/sample/optin/UseJavaExperimentalMultipleMarkersFromJava.java"
+ line="34"
+ column="66"/>
+ </issue>
+
+ <issue
+ id="UnsafeOptInUsageError"
message="This declaration is opt-in and its usage should be marked with `@sample.experimental.foo.ExperimentalPackage` or `@OptIn(markerClass = sample.experimental.foo.ExperimentalPackage.class)`"
errorLine1=" callPackageExperimental();"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~">
@@ -553,6 +641,17 @@
<issue
id="UnsafeOptInUsageError"
+ message="This declaration is opt-in and its usage should be marked with `@sample.optin.ExperimentalKotlinAnnotation2` or `@OptIn(markerClass = sample.optin.ExperimentalKotlinAnnotation2.class)`"
+ errorLine1=" return experimentalObject.method() + AnnotatedKotlinClass2.fieldStatic;"
+ errorLine2=" ~~~~~~~~~~~">
+ <location
+ file="src/main/java/sample/optin/UseKtExperimentalFromJava.java"
+ line="56"
+ column="68"/>
+ </issue>
+
+ <issue
+ id="UnsafeOptInUsageError"
message="This declaration is opt-in and its usage should be marked with `@sample.experimental.ExperimentalDateTimeKt` or `@OptIn(markerClass = sample.experimental.ExperimentalDateTimeKt.class)`"
errorLine1=" TimeProviderKt.getTimeStatically();"
errorLine2=" ~~~~~~~~~~~~~~~~~">
diff --git a/annotation/annotation-experimental-lint/src/main/java/androidx/annotation/experimental/lint/ExperimentalIssueRegistry.kt b/annotation/annotation-experimental-lint/src/main/java/androidx/annotation/experimental/lint/ExperimentalIssueRegistry.kt
index 93cbde7..031b51f 100644
--- a/annotation/annotation-experimental-lint/src/main/java/androidx/annotation/experimental/lint/ExperimentalIssueRegistry.kt
+++ b/annotation/annotation-experimental-lint/src/main/java/androidx/annotation/experimental/lint/ExperimentalIssueRegistry.kt
@@ -21,6 +21,6 @@
class ExperimentalIssueRegistry : IssueRegistry() {
override val minApi = CURRENT_API
- override val api = 10
+ override val api = 11
override val issues get() = ExperimentalDetector.ISSUES + AnnotationRetentionDetector.ISSUE
}
diff --git a/annotation/annotation-experimental-lint/src/test/kotlin/androidx/annotation/experimental/lint/ExperimentalDetectorTest.kt b/annotation/annotation-experimental-lint/src/test/kotlin/androidx/annotation/experimental/lint/ExperimentalDetectorTest.kt
index 2018141..7746e3aa 100644
--- a/annotation/annotation-experimental-lint/src/test/kotlin/androidx/annotation/experimental/lint/ExperimentalDetectorTest.kt
+++ b/annotation/annotation-experimental-lint/src/test/kotlin/androidx/annotation/experimental/lint/ExperimentalDetectorTest.kt
@@ -24,6 +24,7 @@
import com.android.tools.lint.checks.infrastructure.TestFiles.xml
import com.android.tools.lint.checks.infrastructure.TestLintResult
import com.android.tools.lint.checks.infrastructure.TestLintTask.lint
+import org.junit.Ignore
import org.junit.Test
import org.junit.runner.RunWith
import org.junit.runners.JUnit4
@@ -140,6 +141,7 @@
check(*input).expect(expected)
}
+ @Ignore("b/196881523")
@Test
fun useKtExperimentalFromJava() {
val input = arrayOf(
diff --git a/appcompat/appcompat-benchmark/src/androidTest/AndroidManifest.xml b/appcompat/appcompat-benchmark/src/androidTest/AndroidManifest.xml
index 1c5fab4..295021a 100644
--- a/appcompat/appcompat-benchmark/src/androidTest/AndroidManifest.xml
+++ b/appcompat/appcompat-benchmark/src/androidTest/AndroidManifest.xml
@@ -16,15 +16,9 @@
-->
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:tools="http://schemas.android.com/tools"
package="androidx.appcompat.benchmark.test">
-
- <!-- Important: disable debuggable for accurate performance results -->
- <application
- android:debuggable="false"
- tools:replace="android:debuggable">
- <!-- enable profileableByShell for non-intrusive profiling tools -->
- <!--suppress AndroidElementNotAllowed -->
+ <application>
+ <!-- enable profiling by shell for non-intrusive profiling tools -->
<profileable android:shell="true"/>
<activity android:name="androidx.appcompat.app.AppCompatActivity"
android:theme="@style/Theme.AppCompat"/>
diff --git a/appcompat/appcompat-lint/src/main/kotlin/androidx/appcompat/AppCompatIssueRegistry.kt b/appcompat/appcompat-lint/src/main/kotlin/androidx/appcompat/AppCompatIssueRegistry.kt
index 056c0f17..7998e89 100644
--- a/appcompat/appcompat-lint/src/main/kotlin/androidx/appcompat/AppCompatIssueRegistry.kt
+++ b/appcompat/appcompat-lint/src/main/kotlin/androidx/appcompat/AppCompatIssueRegistry.kt
@@ -31,7 +31,7 @@
@Suppress("UnstableApiUsage")
class AppCompatIssueRegistry : IssueRegistry() {
override val minApi = 10 // Only compatible with the latest lint
- override val api = 10
+ override val api = 11
override val issues get() = listOf(
SetActionBarDetector.USING_CORE_ACTION_BAR,
ColorStateListAlphaDetector.NOT_USING_ANDROID_ALPHA,
diff --git a/appcompat/appcompat/src/androidTest/java/androidx/appcompat/widget/AppCompatBaseTextViewEmojiTest.java b/appcompat/appcompat/src/androidTest/java/androidx/appcompat/widget/AppCompatBaseTextViewEmojiTest.java
index da6fa86..c38de53 100644
--- a/appcompat/appcompat/src/androidTest/java/androidx/appcompat/widget/AppCompatBaseTextViewEmojiTest.java
+++ b/appcompat/appcompat/src/androidTest/java/androidx/appcompat/widget/AppCompatBaseTextViewEmojiTest.java
@@ -160,7 +160,7 @@
defaultEmoji.setFilters(defaultEmoji.getFilters());
defaultEmoji.setText("Some text");
// this is allowed, but all other interactions should not happen
- verify(mEmojiCompatMock, atLeast(0)).updateEditorInfoAttrs(
+ verify(mEmojiCompatMock, atLeast(0)).updateEditorInfo(
any(EditorInfo.class));
verifyNoMoreInteractions(mEmojiCompatMock);
});
diff --git a/appcompat/appcompat/src/main/java/androidx/appcompat/app/AppCompatDelegateImpl.java b/appcompat/appcompat/src/main/java/androidx/appcompat/app/AppCompatDelegateImpl.java
index 3541c73..976b220 100644
--- a/appcompat/appcompat/src/main/java/androidx/appcompat/app/AppCompatDelegateImpl.java
+++ b/appcompat/appcompat/src/main/java/androidx/appcompat/app/AppCompatDelegateImpl.java
@@ -1532,7 +1532,8 @@
mAppCompatViewInflater = new AppCompatViewInflater();
} else {
try {
- Class<?> viewInflaterClass = Class.forName(viewInflaterClassName);
+ Class<?> viewInflaterClass =
+ mContext.getClassLoader().loadClass(viewInflaterClassName);
mAppCompatViewInflater =
(AppCompatViewInflater) viewInflaterClass.getDeclaredConstructor()
.newInstance();
diff --git a/appcompat/appcompat/src/main/res/values-mr/strings.xml b/appcompat/appcompat/src/main/res/values-mr/strings.xml
index f4adb38..e259e30 100644
--- a/appcompat/appcompat/src/main/res/values-mr/strings.xml
+++ b/appcompat/appcompat/src/main/res/values-mr/strings.xml
@@ -28,7 +28,7 @@
<string name="abc_searchview_description_submit" msgid="1486535517437947103">"क्वेरी सबमिट करा"</string>
<string name="abc_searchview_description_voice" msgid="2293578557972875415">"व्हॉइस शोध"</string>
<string name="abc_activitychooserview_choose_application" msgid="2165779757652331008">"अॅप निवडा"</string>
- <string name="abc_activity_chooser_view_see_all" msgid="1189761859438369441">"सर्व पाहा"</string>
+ <string name="abc_activity_chooser_view_see_all" msgid="1189761859438369441">"सर्व पहा"</string>
<string name="abc_shareactionprovider_share_with_application" msgid="9055268688411532828">"<xliff:g id="APPLICATION_NAME">%s</xliff:g> सह शेअर करा"</string>
<string name="abc_shareactionprovider_share_with" msgid="8875138169939072951">"यांच्यासोबत शेअर करा"</string>
<string name="abc_capital_on" msgid="884982626291842264">"सुरू"</string>
diff --git a/appsearch/debug-view/api/current.txt b/appsearch/appsearch-debug-view/api/current.txt
similarity index 100%
rename from appsearch/debug-view/api/current.txt
rename to appsearch/appsearch-debug-view/api/current.txt
diff --git a/appsearch/debug-view/api/public_plus_experimental_current.txt b/appsearch/appsearch-debug-view/api/public_plus_experimental_current.txt
similarity index 100%
rename from appsearch/debug-view/api/public_plus_experimental_current.txt
rename to appsearch/appsearch-debug-view/api/public_plus_experimental_current.txt
diff --git a/appsearch/debug-view/api/res-current.txt b/appsearch/appsearch-debug-view/api/res-current.txt
similarity index 100%
rename from appsearch/debug-view/api/res-current.txt
rename to appsearch/appsearch-debug-view/api/res-current.txt
diff --git a/appsearch/debug-view/api/restricted_current.txt b/appsearch/appsearch-debug-view/api/restricted_current.txt
similarity index 100%
rename from appsearch/debug-view/api/restricted_current.txt
rename to appsearch/appsearch-debug-view/api/restricted_current.txt
diff --git a/appsearch/debug-view/build.gradle b/appsearch/appsearch-debug-view/build.gradle
similarity index 100%
rename from appsearch/debug-view/build.gradle
rename to appsearch/appsearch-debug-view/build.gradle
diff --git a/appsearch/debug-view/samples/build.gradle b/appsearch/appsearch-debug-view/samples/build.gradle
similarity index 100%
rename from appsearch/debug-view/samples/build.gradle
rename to appsearch/appsearch-debug-view/samples/build.gradle
diff --git a/appsearch/debug-view/samples/src/main/AndroidManifest.xml b/appsearch/appsearch-debug-view/samples/src/main/AndroidManifest.xml
similarity index 100%
rename from appsearch/debug-view/samples/src/main/AndroidManifest.xml
rename to appsearch/appsearch-debug-view/samples/src/main/AndroidManifest.xml
diff --git a/appsearch/debug-view/samples/src/main/assets/sample_notes.json b/appsearch/appsearch-debug-view/samples/src/main/assets/sample_notes.json
similarity index 100%
rename from appsearch/debug-view/samples/src/main/assets/sample_notes.json
rename to appsearch/appsearch-debug-view/samples/src/main/assets/sample_notes.json
diff --git a/appsearch/debug-view/samples/src/main/java/androidx/appsearch/debugview/samples/NotesActivity.java b/appsearch/appsearch-debug-view/samples/src/main/java/androidx/appsearch/debugview/samples/NotesActivity.java
similarity index 100%
rename from appsearch/debug-view/samples/src/main/java/androidx/appsearch/debugview/samples/NotesActivity.java
rename to appsearch/appsearch-debug-view/samples/src/main/java/androidx/appsearch/debugview/samples/NotesActivity.java
diff --git a/appsearch/debug-view/samples/src/main/java/androidx/appsearch/debugview/samples/NotesAppSearchManager.java b/appsearch/appsearch-debug-view/samples/src/main/java/androidx/appsearch/debugview/samples/NotesAppSearchManager.java
similarity index 100%
rename from appsearch/debug-view/samples/src/main/java/androidx/appsearch/debugview/samples/NotesAppSearchManager.java
rename to appsearch/appsearch-debug-view/samples/src/main/java/androidx/appsearch/debugview/samples/NotesAppSearchManager.java
diff --git a/appsearch/debug-view/samples/src/main/java/androidx/appsearch/debugview/samples/model/Note.java b/appsearch/appsearch-debug-view/samples/src/main/java/androidx/appsearch/debugview/samples/model/Note.java
similarity index 100%
rename from appsearch/debug-view/samples/src/main/java/androidx/appsearch/debugview/samples/model/Note.java
rename to appsearch/appsearch-debug-view/samples/src/main/java/androidx/appsearch/debugview/samples/model/Note.java
diff --git a/appsearch/debug-view/samples/src/main/res/drawable-v24/ic_launcher_foreground.xml b/appsearch/appsearch-debug-view/samples/src/main/res/drawable-v24/ic_launcher_foreground.xml
similarity index 100%
rename from appsearch/debug-view/samples/src/main/res/drawable-v24/ic_launcher_foreground.xml
rename to appsearch/appsearch-debug-view/samples/src/main/res/drawable-v24/ic_launcher_foreground.xml
diff --git a/appsearch/debug-view/samples/src/main/res/drawable/ic_launcher_background.xml b/appsearch/appsearch-debug-view/samples/src/main/res/drawable/ic_launcher_background.xml
similarity index 100%
rename from appsearch/debug-view/samples/src/main/res/drawable/ic_launcher_background.xml
rename to appsearch/appsearch-debug-view/samples/src/main/res/drawable/ic_launcher_background.xml
diff --git a/appsearch/debug-view/samples/src/main/res/layout/activity_notes.xml b/appsearch/appsearch-debug-view/samples/src/main/res/layout/activity_notes.xml
similarity index 100%
rename from appsearch/debug-view/samples/src/main/res/layout/activity_notes.xml
rename to appsearch/appsearch-debug-view/samples/src/main/res/layout/activity_notes.xml
diff --git a/appsearch/debug-view/samples/src/main/res/menu/debug_menu.xml b/appsearch/appsearch-debug-view/samples/src/main/res/menu/debug_menu.xml
similarity index 100%
rename from appsearch/debug-view/samples/src/main/res/menu/debug_menu.xml
rename to appsearch/appsearch-debug-view/samples/src/main/res/menu/debug_menu.xml
diff --git a/appsearch/debug-view/samples/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/appsearch/appsearch-debug-view/samples/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
similarity index 100%
rename from appsearch/debug-view/samples/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
rename to appsearch/appsearch-debug-view/samples/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
diff --git a/appsearch/debug-view/samples/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/appsearch/appsearch-debug-view/samples/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
similarity index 100%
rename from appsearch/debug-view/samples/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
rename to appsearch/appsearch-debug-view/samples/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
diff --git a/appsearch/debug-view/samples/src/main/res/mipmap-hdpi/ic_launcher.png b/appsearch/appsearch-debug-view/samples/src/main/res/mipmap-hdpi/ic_launcher.png
similarity index 100%
rename from appsearch/debug-view/samples/src/main/res/mipmap-hdpi/ic_launcher.png
rename to appsearch/appsearch-debug-view/samples/src/main/res/mipmap-hdpi/ic_launcher.png
Binary files differ
diff --git a/appsearch/debug-view/samples/src/main/res/mipmap-hdpi/ic_launcher_round.png b/appsearch/appsearch-debug-view/samples/src/main/res/mipmap-hdpi/ic_launcher_round.png
similarity index 100%
rename from appsearch/debug-view/samples/src/main/res/mipmap-hdpi/ic_launcher_round.png
rename to appsearch/appsearch-debug-view/samples/src/main/res/mipmap-hdpi/ic_launcher_round.png
Binary files differ
diff --git a/appsearch/debug-view/samples/src/main/res/mipmap-mdpi/ic_launcher.png b/appsearch/appsearch-debug-view/samples/src/main/res/mipmap-mdpi/ic_launcher.png
similarity index 100%
rename from appsearch/debug-view/samples/src/main/res/mipmap-mdpi/ic_launcher.png
rename to appsearch/appsearch-debug-view/samples/src/main/res/mipmap-mdpi/ic_launcher.png
Binary files differ
diff --git a/appsearch/debug-view/samples/src/main/res/mipmap-mdpi/ic_launcher_round.png b/appsearch/appsearch-debug-view/samples/src/main/res/mipmap-mdpi/ic_launcher_round.png
similarity index 100%
rename from appsearch/debug-view/samples/src/main/res/mipmap-mdpi/ic_launcher_round.png
rename to appsearch/appsearch-debug-view/samples/src/main/res/mipmap-mdpi/ic_launcher_round.png
Binary files differ
diff --git a/appsearch/debug-view/samples/src/main/res/mipmap-xhdpi/ic_launcher.png b/appsearch/appsearch-debug-view/samples/src/main/res/mipmap-xhdpi/ic_launcher.png
similarity index 100%
rename from appsearch/debug-view/samples/src/main/res/mipmap-xhdpi/ic_launcher.png
rename to appsearch/appsearch-debug-view/samples/src/main/res/mipmap-xhdpi/ic_launcher.png
Binary files differ
diff --git a/appsearch/debug-view/samples/src/main/res/mipmap-xhdpi/ic_launcher_round.png b/appsearch/appsearch-debug-view/samples/src/main/res/mipmap-xhdpi/ic_launcher_round.png
similarity index 100%
rename from appsearch/debug-view/samples/src/main/res/mipmap-xhdpi/ic_launcher_round.png
rename to appsearch/appsearch-debug-view/samples/src/main/res/mipmap-xhdpi/ic_launcher_round.png
Binary files differ
diff --git a/appsearch/debug-view/samples/src/main/res/mipmap-xxhdpi/ic_launcher.png b/appsearch/appsearch-debug-view/samples/src/main/res/mipmap-xxhdpi/ic_launcher.png
similarity index 100%
rename from appsearch/debug-view/samples/src/main/res/mipmap-xxhdpi/ic_launcher.png
rename to appsearch/appsearch-debug-view/samples/src/main/res/mipmap-xxhdpi/ic_launcher.png
Binary files differ
diff --git a/appsearch/debug-view/samples/src/main/res/mipmap-xxhdpi/ic_launcher_round.png b/appsearch/appsearch-debug-view/samples/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
similarity index 100%
rename from appsearch/debug-view/samples/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
rename to appsearch/appsearch-debug-view/samples/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
Binary files differ
diff --git a/appsearch/debug-view/samples/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/appsearch/appsearch-debug-view/samples/src/main/res/mipmap-xxxhdpi/ic_launcher.png
similarity index 100%
rename from appsearch/debug-view/samples/src/main/res/mipmap-xxxhdpi/ic_launcher.png
rename to appsearch/appsearch-debug-view/samples/src/main/res/mipmap-xxxhdpi/ic_launcher.png
Binary files differ
diff --git a/appsearch/debug-view/samples/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png b/appsearch/appsearch-debug-view/samples/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
similarity index 100%
rename from appsearch/debug-view/samples/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
rename to appsearch/appsearch-debug-view/samples/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
Binary files differ
diff --git a/appsearch/debug-view/samples/src/main/res/values/colors.xml b/appsearch/appsearch-debug-view/samples/src/main/res/values/colors.xml
similarity index 100%
rename from appsearch/debug-view/samples/src/main/res/values/colors.xml
rename to appsearch/appsearch-debug-view/samples/src/main/res/values/colors.xml
diff --git a/appsearch/debug-view/samples/src/main/res/values/strings.xml b/appsearch/appsearch-debug-view/samples/src/main/res/values/strings.xml
similarity index 100%
rename from appsearch/debug-view/samples/src/main/res/values/strings.xml
rename to appsearch/appsearch-debug-view/samples/src/main/res/values/strings.xml
diff --git a/appsearch/debug-view/src/main/AndroidManifest.xml b/appsearch/appsearch-debug-view/src/main/AndroidManifest.xml
similarity index 100%
rename from appsearch/debug-view/src/main/AndroidManifest.xml
rename to appsearch/appsearch-debug-view/src/main/AndroidManifest.xml
diff --git a/appsearch/debug-view/src/main/java/androidx/appsearch/debugview/DebugAppSearchManager.java b/appsearch/appsearch-debug-view/src/main/java/androidx/appsearch/debugview/DebugAppSearchManager.java
similarity index 100%
rename from appsearch/debug-view/src/main/java/androidx/appsearch/debugview/DebugAppSearchManager.java
rename to appsearch/appsearch-debug-view/src/main/java/androidx/appsearch/debugview/DebugAppSearchManager.java
diff --git a/appsearch/debug-view/src/main/java/androidx/appsearch/debugview/model/DocumentListModel.java b/appsearch/appsearch-debug-view/src/main/java/androidx/appsearch/debugview/model/DocumentListModel.java
similarity index 100%
rename from appsearch/debug-view/src/main/java/androidx/appsearch/debugview/model/DocumentListModel.java
rename to appsearch/appsearch-debug-view/src/main/java/androidx/appsearch/debugview/model/DocumentListModel.java
diff --git a/appsearch/debug-view/src/main/java/androidx/appsearch/debugview/model/DocumentModel.java b/appsearch/appsearch-debug-view/src/main/java/androidx/appsearch/debugview/model/DocumentModel.java
similarity index 100%
rename from appsearch/debug-view/src/main/java/androidx/appsearch/debugview/model/DocumentModel.java
rename to appsearch/appsearch-debug-view/src/main/java/androidx/appsearch/debugview/model/DocumentModel.java
diff --git a/appsearch/debug-view/src/main/java/androidx/appsearch/debugview/model/SchemaTypeListModel.java b/appsearch/appsearch-debug-view/src/main/java/androidx/appsearch/debugview/model/SchemaTypeListModel.java
similarity index 100%
rename from appsearch/debug-view/src/main/java/androidx/appsearch/debugview/model/SchemaTypeListModel.java
rename to appsearch/appsearch-debug-view/src/main/java/androidx/appsearch/debugview/model/SchemaTypeListModel.java
diff --git a/appsearch/debug-view/src/main/java/androidx/appsearch/debugview/view/AppSearchDebugActivity.java b/appsearch/appsearch-debug-view/src/main/java/androidx/appsearch/debugview/view/AppSearchDebugActivity.java
similarity index 100%
rename from appsearch/debug-view/src/main/java/androidx/appsearch/debugview/view/AppSearchDebugActivity.java
rename to appsearch/appsearch-debug-view/src/main/java/androidx/appsearch/debugview/view/AppSearchDebugActivity.java
diff --git a/appsearch/debug-view/src/main/java/androidx/appsearch/debugview/view/DocumentFragment.java b/appsearch/appsearch-debug-view/src/main/java/androidx/appsearch/debugview/view/DocumentFragment.java
similarity index 100%
rename from appsearch/debug-view/src/main/java/androidx/appsearch/debugview/view/DocumentFragment.java
rename to appsearch/appsearch-debug-view/src/main/java/androidx/appsearch/debugview/view/DocumentFragment.java
diff --git a/appsearch/debug-view/src/main/java/androidx/appsearch/debugview/view/DocumentListFragment.java b/appsearch/appsearch-debug-view/src/main/java/androidx/appsearch/debugview/view/DocumentListFragment.java
similarity index 100%
rename from appsearch/debug-view/src/main/java/androidx/appsearch/debugview/view/DocumentListFragment.java
rename to appsearch/appsearch-debug-view/src/main/java/androidx/appsearch/debugview/view/DocumentListFragment.java
diff --git a/appsearch/debug-view/src/main/java/androidx/appsearch/debugview/view/DocumentListItemAdapter.java b/appsearch/appsearch-debug-view/src/main/java/androidx/appsearch/debugview/view/DocumentListItemAdapter.java
similarity index 100%
rename from appsearch/debug-view/src/main/java/androidx/appsearch/debugview/view/DocumentListItemAdapter.java
rename to appsearch/appsearch-debug-view/src/main/java/androidx/appsearch/debugview/view/DocumentListItemAdapter.java
diff --git a/appsearch/debug-view/src/main/java/androidx/appsearch/debugview/view/MenuFragment.java b/appsearch/appsearch-debug-view/src/main/java/androidx/appsearch/debugview/view/MenuFragment.java
similarity index 100%
rename from appsearch/debug-view/src/main/java/androidx/appsearch/debugview/view/MenuFragment.java
rename to appsearch/appsearch-debug-view/src/main/java/androidx/appsearch/debugview/view/MenuFragment.java
diff --git a/appsearch/debug-view/src/main/java/androidx/appsearch/debugview/view/SchemaTypeListFragment.java b/appsearch/appsearch-debug-view/src/main/java/androidx/appsearch/debugview/view/SchemaTypeListFragment.java
similarity index 100%
rename from appsearch/debug-view/src/main/java/androidx/appsearch/debugview/view/SchemaTypeListFragment.java
rename to appsearch/appsearch-debug-view/src/main/java/androidx/appsearch/debugview/view/SchemaTypeListFragment.java
diff --git a/appsearch/debug-view/src/main/java/androidx/appsearch/debugview/view/SchemaTypeListItemAdapter.java b/appsearch/appsearch-debug-view/src/main/java/androidx/appsearch/debugview/view/SchemaTypeListItemAdapter.java
similarity index 100%
rename from appsearch/debug-view/src/main/java/androidx/appsearch/debugview/view/SchemaTypeListItemAdapter.java
rename to appsearch/appsearch-debug-view/src/main/java/androidx/appsearch/debugview/view/SchemaTypeListItemAdapter.java
diff --git a/appsearch/debug-view/src/main/java/androidx/appsearch/debugview/view/ScrollListener.java b/appsearch/appsearch-debug-view/src/main/java/androidx/appsearch/debugview/view/ScrollListener.java
similarity index 100%
rename from appsearch/debug-view/src/main/java/androidx/appsearch/debugview/view/ScrollListener.java
rename to appsearch/appsearch-debug-view/src/main/java/androidx/appsearch/debugview/view/ScrollListener.java
diff --git a/appsearch/debug-view/src/main/res/layout/activity_appsearchdebug.xml b/appsearch/appsearch-debug-view/src/main/res/layout/activity_appsearchdebug.xml
similarity index 100%
rename from appsearch/debug-view/src/main/res/layout/activity_appsearchdebug.xml
rename to appsearch/appsearch-debug-view/src/main/res/layout/activity_appsearchdebug.xml
diff --git a/appsearch/debug-view/src/main/res/layout/adapter_document_list_item.xml b/appsearch/appsearch-debug-view/src/main/res/layout/adapter_document_list_item.xml
similarity index 100%
rename from appsearch/debug-view/src/main/res/layout/adapter_document_list_item.xml
rename to appsearch/appsearch-debug-view/src/main/res/layout/adapter_document_list_item.xml
diff --git a/appsearch/debug-view/src/main/res/layout/adapter_schema_type_list_item.xml b/appsearch/appsearch-debug-view/src/main/res/layout/adapter_schema_type_list_item.xml
similarity index 100%
rename from appsearch/debug-view/src/main/res/layout/adapter_schema_type_list_item.xml
rename to appsearch/appsearch-debug-view/src/main/res/layout/adapter_schema_type_list_item.xml
diff --git a/appsearch/debug-view/src/main/res/layout/fragment_document.xml b/appsearch/appsearch-debug-view/src/main/res/layout/fragment_document.xml
similarity index 100%
rename from appsearch/debug-view/src/main/res/layout/fragment_document.xml
rename to appsearch/appsearch-debug-view/src/main/res/layout/fragment_document.xml
diff --git a/appsearch/debug-view/src/main/res/layout/fragment_document_list.xml b/appsearch/appsearch-debug-view/src/main/res/layout/fragment_document_list.xml
similarity index 100%
rename from appsearch/debug-view/src/main/res/layout/fragment_document_list.xml
rename to appsearch/appsearch-debug-view/src/main/res/layout/fragment_document_list.xml
diff --git a/appsearch/debug-view/src/main/res/layout/fragment_menu.xml b/appsearch/appsearch-debug-view/src/main/res/layout/fragment_menu.xml
similarity index 100%
rename from appsearch/debug-view/src/main/res/layout/fragment_menu.xml
rename to appsearch/appsearch-debug-view/src/main/res/layout/fragment_menu.xml
diff --git a/appsearch/debug-view/src/main/res/layout/fragment_schema_type_list.xml b/appsearch/appsearch-debug-view/src/main/res/layout/fragment_schema_type_list.xml
similarity index 100%
rename from appsearch/debug-view/src/main/res/layout/fragment_schema_type_list.xml
rename to appsearch/appsearch-debug-view/src/main/res/layout/fragment_schema_type_list.xml
diff --git a/appsearch/debug-view/src/main/res/values-af/strings.xml b/appsearch/appsearch-debug-view/src/main/res/values-af/strings.xml
similarity index 100%
rename from appsearch/debug-view/src/main/res/values-af/strings.xml
rename to appsearch/appsearch-debug-view/src/main/res/values-af/strings.xml
diff --git a/appsearch/debug-view/src/main/res/values-am/strings.xml b/appsearch/appsearch-debug-view/src/main/res/values-am/strings.xml
similarity index 100%
rename from appsearch/debug-view/src/main/res/values-am/strings.xml
rename to appsearch/appsearch-debug-view/src/main/res/values-am/strings.xml
diff --git a/appsearch/debug-view/src/main/res/values-ar/strings.xml b/appsearch/appsearch-debug-view/src/main/res/values-ar/strings.xml
similarity index 100%
rename from appsearch/debug-view/src/main/res/values-ar/strings.xml
rename to appsearch/appsearch-debug-view/src/main/res/values-ar/strings.xml
diff --git a/appsearch/debug-view/src/main/res/values-as/strings.xml b/appsearch/appsearch-debug-view/src/main/res/values-as/strings.xml
similarity index 100%
rename from appsearch/debug-view/src/main/res/values-as/strings.xml
rename to appsearch/appsearch-debug-view/src/main/res/values-as/strings.xml
diff --git a/appsearch/debug-view/src/main/res/values-az/strings.xml b/appsearch/appsearch-debug-view/src/main/res/values-az/strings.xml
similarity index 100%
rename from appsearch/debug-view/src/main/res/values-az/strings.xml
rename to appsearch/appsearch-debug-view/src/main/res/values-az/strings.xml
diff --git a/appsearch/debug-view/src/main/res/values-b+sr+Latn/strings.xml b/appsearch/appsearch-debug-view/src/main/res/values-b+sr+Latn/strings.xml
similarity index 100%
rename from appsearch/debug-view/src/main/res/values-b+sr+Latn/strings.xml
rename to appsearch/appsearch-debug-view/src/main/res/values-b+sr+Latn/strings.xml
diff --git a/appsearch/debug-view/src/main/res/values-be/strings.xml b/appsearch/appsearch-debug-view/src/main/res/values-be/strings.xml
similarity index 100%
rename from appsearch/debug-view/src/main/res/values-be/strings.xml
rename to appsearch/appsearch-debug-view/src/main/res/values-be/strings.xml
diff --git a/appsearch/debug-view/src/main/res/values-bg/strings.xml b/appsearch/appsearch-debug-view/src/main/res/values-bg/strings.xml
similarity index 100%
rename from appsearch/debug-view/src/main/res/values-bg/strings.xml
rename to appsearch/appsearch-debug-view/src/main/res/values-bg/strings.xml
diff --git a/appsearch/debug-view/src/main/res/values-bn/strings.xml b/appsearch/appsearch-debug-view/src/main/res/values-bn/strings.xml
similarity index 100%
rename from appsearch/debug-view/src/main/res/values-bn/strings.xml
rename to appsearch/appsearch-debug-view/src/main/res/values-bn/strings.xml
diff --git a/appsearch/debug-view/src/main/res/values-bs/strings.xml b/appsearch/appsearch-debug-view/src/main/res/values-bs/strings.xml
similarity index 100%
rename from appsearch/debug-view/src/main/res/values-bs/strings.xml
rename to appsearch/appsearch-debug-view/src/main/res/values-bs/strings.xml
diff --git a/appsearch/debug-view/src/main/res/values-ca/strings.xml b/appsearch/appsearch-debug-view/src/main/res/values-ca/strings.xml
similarity index 100%
rename from appsearch/debug-view/src/main/res/values-ca/strings.xml
rename to appsearch/appsearch-debug-view/src/main/res/values-ca/strings.xml
diff --git a/appsearch/debug-view/src/main/res/values-cs/strings.xml b/appsearch/appsearch-debug-view/src/main/res/values-cs/strings.xml
similarity index 100%
rename from appsearch/debug-view/src/main/res/values-cs/strings.xml
rename to appsearch/appsearch-debug-view/src/main/res/values-cs/strings.xml
diff --git a/appsearch/debug-view/src/main/res/values-da/strings.xml b/appsearch/appsearch-debug-view/src/main/res/values-da/strings.xml
similarity index 100%
rename from appsearch/debug-view/src/main/res/values-da/strings.xml
rename to appsearch/appsearch-debug-view/src/main/res/values-da/strings.xml
diff --git a/appsearch/debug-view/src/main/res/values-de/strings.xml b/appsearch/appsearch-debug-view/src/main/res/values-de/strings.xml
similarity index 100%
rename from appsearch/debug-view/src/main/res/values-de/strings.xml
rename to appsearch/appsearch-debug-view/src/main/res/values-de/strings.xml
diff --git a/appsearch/debug-view/src/main/res/values-el/strings.xml b/appsearch/appsearch-debug-view/src/main/res/values-el/strings.xml
similarity index 100%
rename from appsearch/debug-view/src/main/res/values-el/strings.xml
rename to appsearch/appsearch-debug-view/src/main/res/values-el/strings.xml
diff --git a/appsearch/debug-view/src/main/res/values-en-rAU/strings.xml b/appsearch/appsearch-debug-view/src/main/res/values-en-rAU/strings.xml
similarity index 100%
rename from appsearch/debug-view/src/main/res/values-en-rAU/strings.xml
rename to appsearch/appsearch-debug-view/src/main/res/values-en-rAU/strings.xml
diff --git a/appsearch/debug-view/src/main/res/values-en-rCA/strings.xml b/appsearch/appsearch-debug-view/src/main/res/values-en-rCA/strings.xml
similarity index 100%
rename from appsearch/debug-view/src/main/res/values-en-rCA/strings.xml
rename to appsearch/appsearch-debug-view/src/main/res/values-en-rCA/strings.xml
diff --git a/appsearch/debug-view/src/main/res/values-en-rGB/strings.xml b/appsearch/appsearch-debug-view/src/main/res/values-en-rGB/strings.xml
similarity index 100%
rename from appsearch/debug-view/src/main/res/values-en-rGB/strings.xml
rename to appsearch/appsearch-debug-view/src/main/res/values-en-rGB/strings.xml
diff --git a/appsearch/debug-view/src/main/res/values-en-rIN/strings.xml b/appsearch/appsearch-debug-view/src/main/res/values-en-rIN/strings.xml
similarity index 100%
rename from appsearch/debug-view/src/main/res/values-en-rIN/strings.xml
rename to appsearch/appsearch-debug-view/src/main/res/values-en-rIN/strings.xml
diff --git a/appsearch/debug-view/src/main/res/values-en-rXC/strings.xml b/appsearch/appsearch-debug-view/src/main/res/values-en-rXC/strings.xml
similarity index 100%
rename from appsearch/debug-view/src/main/res/values-en-rXC/strings.xml
rename to appsearch/appsearch-debug-view/src/main/res/values-en-rXC/strings.xml
diff --git a/appsearch/debug-view/src/main/res/values-es-rUS/strings.xml b/appsearch/appsearch-debug-view/src/main/res/values-es-rUS/strings.xml
similarity index 100%
rename from appsearch/debug-view/src/main/res/values-es-rUS/strings.xml
rename to appsearch/appsearch-debug-view/src/main/res/values-es-rUS/strings.xml
diff --git a/appsearch/debug-view/src/main/res/values-es/strings.xml b/appsearch/appsearch-debug-view/src/main/res/values-es/strings.xml
similarity index 100%
rename from appsearch/debug-view/src/main/res/values-es/strings.xml
rename to appsearch/appsearch-debug-view/src/main/res/values-es/strings.xml
diff --git a/appsearch/debug-view/src/main/res/values-et/strings.xml b/appsearch/appsearch-debug-view/src/main/res/values-et/strings.xml
similarity index 100%
rename from appsearch/debug-view/src/main/res/values-et/strings.xml
rename to appsearch/appsearch-debug-view/src/main/res/values-et/strings.xml
diff --git a/appsearch/debug-view/src/main/res/values-eu/strings.xml b/appsearch/appsearch-debug-view/src/main/res/values-eu/strings.xml
similarity index 100%
rename from appsearch/debug-view/src/main/res/values-eu/strings.xml
rename to appsearch/appsearch-debug-view/src/main/res/values-eu/strings.xml
diff --git a/appsearch/debug-view/src/main/res/values-fa/strings.xml b/appsearch/appsearch-debug-view/src/main/res/values-fa/strings.xml
similarity index 100%
rename from appsearch/debug-view/src/main/res/values-fa/strings.xml
rename to appsearch/appsearch-debug-view/src/main/res/values-fa/strings.xml
diff --git a/appsearch/debug-view/src/main/res/values-fi/strings.xml b/appsearch/appsearch-debug-view/src/main/res/values-fi/strings.xml
similarity index 100%
rename from appsearch/debug-view/src/main/res/values-fi/strings.xml
rename to appsearch/appsearch-debug-view/src/main/res/values-fi/strings.xml
diff --git a/appsearch/debug-view/src/main/res/values-fr-rCA/strings.xml b/appsearch/appsearch-debug-view/src/main/res/values-fr-rCA/strings.xml
similarity index 100%
rename from appsearch/debug-view/src/main/res/values-fr-rCA/strings.xml
rename to appsearch/appsearch-debug-view/src/main/res/values-fr-rCA/strings.xml
diff --git a/appsearch/debug-view/src/main/res/values-fr/strings.xml b/appsearch/appsearch-debug-view/src/main/res/values-fr/strings.xml
similarity index 100%
rename from appsearch/debug-view/src/main/res/values-fr/strings.xml
rename to appsearch/appsearch-debug-view/src/main/res/values-fr/strings.xml
diff --git a/appsearch/debug-view/src/main/res/values-gl/strings.xml b/appsearch/appsearch-debug-view/src/main/res/values-gl/strings.xml
similarity index 100%
rename from appsearch/debug-view/src/main/res/values-gl/strings.xml
rename to appsearch/appsearch-debug-view/src/main/res/values-gl/strings.xml
diff --git a/appsearch/debug-view/src/main/res/values-gu/strings.xml b/appsearch/appsearch-debug-view/src/main/res/values-gu/strings.xml
similarity index 100%
rename from appsearch/debug-view/src/main/res/values-gu/strings.xml
rename to appsearch/appsearch-debug-view/src/main/res/values-gu/strings.xml
diff --git a/appsearch/debug-view/src/main/res/values-hi/strings.xml b/appsearch/appsearch-debug-view/src/main/res/values-hi/strings.xml
similarity index 100%
rename from appsearch/debug-view/src/main/res/values-hi/strings.xml
rename to appsearch/appsearch-debug-view/src/main/res/values-hi/strings.xml
diff --git a/appsearch/debug-view/src/main/res/values-hr/strings.xml b/appsearch/appsearch-debug-view/src/main/res/values-hr/strings.xml
similarity index 100%
rename from appsearch/debug-view/src/main/res/values-hr/strings.xml
rename to appsearch/appsearch-debug-view/src/main/res/values-hr/strings.xml
diff --git a/appsearch/debug-view/src/main/res/values-hu/strings.xml b/appsearch/appsearch-debug-view/src/main/res/values-hu/strings.xml
similarity index 100%
rename from appsearch/debug-view/src/main/res/values-hu/strings.xml
rename to appsearch/appsearch-debug-view/src/main/res/values-hu/strings.xml
diff --git a/appsearch/debug-view/src/main/res/values-hy/strings.xml b/appsearch/appsearch-debug-view/src/main/res/values-hy/strings.xml
similarity index 100%
rename from appsearch/debug-view/src/main/res/values-hy/strings.xml
rename to appsearch/appsearch-debug-view/src/main/res/values-hy/strings.xml
diff --git a/appsearch/debug-view/src/main/res/values-in/strings.xml b/appsearch/appsearch-debug-view/src/main/res/values-in/strings.xml
similarity index 100%
rename from appsearch/debug-view/src/main/res/values-in/strings.xml
rename to appsearch/appsearch-debug-view/src/main/res/values-in/strings.xml
diff --git a/appsearch/debug-view/src/main/res/values-is/strings.xml b/appsearch/appsearch-debug-view/src/main/res/values-is/strings.xml
similarity index 100%
rename from appsearch/debug-view/src/main/res/values-is/strings.xml
rename to appsearch/appsearch-debug-view/src/main/res/values-is/strings.xml
diff --git a/appsearch/debug-view/src/main/res/values-it/strings.xml b/appsearch/appsearch-debug-view/src/main/res/values-it/strings.xml
similarity index 100%
rename from appsearch/debug-view/src/main/res/values-it/strings.xml
rename to appsearch/appsearch-debug-view/src/main/res/values-it/strings.xml
diff --git a/appsearch/debug-view/src/main/res/values-iw/strings.xml b/appsearch/appsearch-debug-view/src/main/res/values-iw/strings.xml
similarity index 100%
rename from appsearch/debug-view/src/main/res/values-iw/strings.xml
rename to appsearch/appsearch-debug-view/src/main/res/values-iw/strings.xml
diff --git a/appsearch/debug-view/src/main/res/values-ja/strings.xml b/appsearch/appsearch-debug-view/src/main/res/values-ja/strings.xml
similarity index 100%
rename from appsearch/debug-view/src/main/res/values-ja/strings.xml
rename to appsearch/appsearch-debug-view/src/main/res/values-ja/strings.xml
diff --git a/appsearch/debug-view/src/main/res/values-ka/strings.xml b/appsearch/appsearch-debug-view/src/main/res/values-ka/strings.xml
similarity index 100%
rename from appsearch/debug-view/src/main/res/values-ka/strings.xml
rename to appsearch/appsearch-debug-view/src/main/res/values-ka/strings.xml
diff --git a/appsearch/debug-view/src/main/res/values-kk/strings.xml b/appsearch/appsearch-debug-view/src/main/res/values-kk/strings.xml
similarity index 100%
rename from appsearch/debug-view/src/main/res/values-kk/strings.xml
rename to appsearch/appsearch-debug-view/src/main/res/values-kk/strings.xml
diff --git a/appsearch/debug-view/src/main/res/values-km/strings.xml b/appsearch/appsearch-debug-view/src/main/res/values-km/strings.xml
similarity index 100%
rename from appsearch/debug-view/src/main/res/values-km/strings.xml
rename to appsearch/appsearch-debug-view/src/main/res/values-km/strings.xml
diff --git a/appsearch/debug-view/src/main/res/values-kn/strings.xml b/appsearch/appsearch-debug-view/src/main/res/values-kn/strings.xml
similarity index 100%
rename from appsearch/debug-view/src/main/res/values-kn/strings.xml
rename to appsearch/appsearch-debug-view/src/main/res/values-kn/strings.xml
diff --git a/appsearch/debug-view/src/main/res/values-ko/strings.xml b/appsearch/appsearch-debug-view/src/main/res/values-ko/strings.xml
similarity index 100%
rename from appsearch/debug-view/src/main/res/values-ko/strings.xml
rename to appsearch/appsearch-debug-view/src/main/res/values-ko/strings.xml
diff --git a/appsearch/debug-view/src/main/res/values-ky/strings.xml b/appsearch/appsearch-debug-view/src/main/res/values-ky/strings.xml
similarity index 100%
rename from appsearch/debug-view/src/main/res/values-ky/strings.xml
rename to appsearch/appsearch-debug-view/src/main/res/values-ky/strings.xml
diff --git a/appsearch/debug-view/src/main/res/values-lo/strings.xml b/appsearch/appsearch-debug-view/src/main/res/values-lo/strings.xml
similarity index 100%
rename from appsearch/debug-view/src/main/res/values-lo/strings.xml
rename to appsearch/appsearch-debug-view/src/main/res/values-lo/strings.xml
diff --git a/appsearch/debug-view/src/main/res/values-lt/strings.xml b/appsearch/appsearch-debug-view/src/main/res/values-lt/strings.xml
similarity index 100%
rename from appsearch/debug-view/src/main/res/values-lt/strings.xml
rename to appsearch/appsearch-debug-view/src/main/res/values-lt/strings.xml
diff --git a/appsearch/debug-view/src/main/res/values-lv/strings.xml b/appsearch/appsearch-debug-view/src/main/res/values-lv/strings.xml
similarity index 100%
rename from appsearch/debug-view/src/main/res/values-lv/strings.xml
rename to appsearch/appsearch-debug-view/src/main/res/values-lv/strings.xml
diff --git a/appsearch/debug-view/src/main/res/values-mk/strings.xml b/appsearch/appsearch-debug-view/src/main/res/values-mk/strings.xml
similarity index 100%
rename from appsearch/debug-view/src/main/res/values-mk/strings.xml
rename to appsearch/appsearch-debug-view/src/main/res/values-mk/strings.xml
diff --git a/appsearch/debug-view/src/main/res/values-ml/strings.xml b/appsearch/appsearch-debug-view/src/main/res/values-ml/strings.xml
similarity index 100%
rename from appsearch/debug-view/src/main/res/values-ml/strings.xml
rename to appsearch/appsearch-debug-view/src/main/res/values-ml/strings.xml
diff --git a/appsearch/debug-view/src/main/res/values-mn/strings.xml b/appsearch/appsearch-debug-view/src/main/res/values-mn/strings.xml
similarity index 100%
rename from appsearch/debug-view/src/main/res/values-mn/strings.xml
rename to appsearch/appsearch-debug-view/src/main/res/values-mn/strings.xml
diff --git a/appsearch/debug-view/src/main/res/values-mr/strings.xml b/appsearch/appsearch-debug-view/src/main/res/values-mr/strings.xml
similarity index 100%
rename from appsearch/debug-view/src/main/res/values-mr/strings.xml
rename to appsearch/appsearch-debug-view/src/main/res/values-mr/strings.xml
diff --git a/appsearch/debug-view/src/main/res/values-ms/strings.xml b/appsearch/appsearch-debug-view/src/main/res/values-ms/strings.xml
similarity index 100%
rename from appsearch/debug-view/src/main/res/values-ms/strings.xml
rename to appsearch/appsearch-debug-view/src/main/res/values-ms/strings.xml
diff --git a/appsearch/debug-view/src/main/res/values-my/strings.xml b/appsearch/appsearch-debug-view/src/main/res/values-my/strings.xml
similarity index 100%
rename from appsearch/debug-view/src/main/res/values-my/strings.xml
rename to appsearch/appsearch-debug-view/src/main/res/values-my/strings.xml
diff --git a/appsearch/debug-view/src/main/res/values-nb/strings.xml b/appsearch/appsearch-debug-view/src/main/res/values-nb/strings.xml
similarity index 100%
rename from appsearch/debug-view/src/main/res/values-nb/strings.xml
rename to appsearch/appsearch-debug-view/src/main/res/values-nb/strings.xml
diff --git a/appsearch/debug-view/src/main/res/values-ne/strings.xml b/appsearch/appsearch-debug-view/src/main/res/values-ne/strings.xml
similarity index 100%
rename from appsearch/debug-view/src/main/res/values-ne/strings.xml
rename to appsearch/appsearch-debug-view/src/main/res/values-ne/strings.xml
diff --git a/appsearch/debug-view/src/main/res/values-nl/strings.xml b/appsearch/appsearch-debug-view/src/main/res/values-nl/strings.xml
similarity index 100%
rename from appsearch/debug-view/src/main/res/values-nl/strings.xml
rename to appsearch/appsearch-debug-view/src/main/res/values-nl/strings.xml
diff --git a/appsearch/debug-view/src/main/res/values-or/strings.xml b/appsearch/appsearch-debug-view/src/main/res/values-or/strings.xml
similarity index 100%
rename from appsearch/debug-view/src/main/res/values-or/strings.xml
rename to appsearch/appsearch-debug-view/src/main/res/values-or/strings.xml
diff --git a/appsearch/debug-view/src/main/res/values-pa/strings.xml b/appsearch/appsearch-debug-view/src/main/res/values-pa/strings.xml
similarity index 100%
rename from appsearch/debug-view/src/main/res/values-pa/strings.xml
rename to appsearch/appsearch-debug-view/src/main/res/values-pa/strings.xml
diff --git a/appsearch/debug-view/src/main/res/values-pl/strings.xml b/appsearch/appsearch-debug-view/src/main/res/values-pl/strings.xml
similarity index 100%
rename from appsearch/debug-view/src/main/res/values-pl/strings.xml
rename to appsearch/appsearch-debug-view/src/main/res/values-pl/strings.xml
diff --git a/appsearch/debug-view/src/main/res/values-pt-rBR/strings.xml b/appsearch/appsearch-debug-view/src/main/res/values-pt-rBR/strings.xml
similarity index 100%
rename from appsearch/debug-view/src/main/res/values-pt-rBR/strings.xml
rename to appsearch/appsearch-debug-view/src/main/res/values-pt-rBR/strings.xml
diff --git a/appsearch/debug-view/src/main/res/values-pt-rPT/strings.xml b/appsearch/appsearch-debug-view/src/main/res/values-pt-rPT/strings.xml
similarity index 100%
rename from appsearch/debug-view/src/main/res/values-pt-rPT/strings.xml
rename to appsearch/appsearch-debug-view/src/main/res/values-pt-rPT/strings.xml
diff --git a/appsearch/debug-view/src/main/res/values-pt/strings.xml b/appsearch/appsearch-debug-view/src/main/res/values-pt/strings.xml
similarity index 100%
rename from appsearch/debug-view/src/main/res/values-pt/strings.xml
rename to appsearch/appsearch-debug-view/src/main/res/values-pt/strings.xml
diff --git a/appsearch/debug-view/src/main/res/values-ro/strings.xml b/appsearch/appsearch-debug-view/src/main/res/values-ro/strings.xml
similarity index 100%
rename from appsearch/debug-view/src/main/res/values-ro/strings.xml
rename to appsearch/appsearch-debug-view/src/main/res/values-ro/strings.xml
diff --git a/appsearch/debug-view/src/main/res/values-ru/strings.xml b/appsearch/appsearch-debug-view/src/main/res/values-ru/strings.xml
similarity index 100%
rename from appsearch/debug-view/src/main/res/values-ru/strings.xml
rename to appsearch/appsearch-debug-view/src/main/res/values-ru/strings.xml
diff --git a/appsearch/debug-view/src/main/res/values-si/strings.xml b/appsearch/appsearch-debug-view/src/main/res/values-si/strings.xml
similarity index 100%
rename from appsearch/debug-view/src/main/res/values-si/strings.xml
rename to appsearch/appsearch-debug-view/src/main/res/values-si/strings.xml
diff --git a/appsearch/debug-view/src/main/res/values-sk/strings.xml b/appsearch/appsearch-debug-view/src/main/res/values-sk/strings.xml
similarity index 100%
rename from appsearch/debug-view/src/main/res/values-sk/strings.xml
rename to appsearch/appsearch-debug-view/src/main/res/values-sk/strings.xml
diff --git a/appsearch/debug-view/src/main/res/values-sl/strings.xml b/appsearch/appsearch-debug-view/src/main/res/values-sl/strings.xml
similarity index 100%
rename from appsearch/debug-view/src/main/res/values-sl/strings.xml
rename to appsearch/appsearch-debug-view/src/main/res/values-sl/strings.xml
diff --git a/appsearch/debug-view/src/main/res/values-sq/strings.xml b/appsearch/appsearch-debug-view/src/main/res/values-sq/strings.xml
similarity index 100%
rename from appsearch/debug-view/src/main/res/values-sq/strings.xml
rename to appsearch/appsearch-debug-view/src/main/res/values-sq/strings.xml
diff --git a/appsearch/debug-view/src/main/res/values-sr/strings.xml b/appsearch/appsearch-debug-view/src/main/res/values-sr/strings.xml
similarity index 100%
rename from appsearch/debug-view/src/main/res/values-sr/strings.xml
rename to appsearch/appsearch-debug-view/src/main/res/values-sr/strings.xml
diff --git a/appsearch/debug-view/src/main/res/values-sv/strings.xml b/appsearch/appsearch-debug-view/src/main/res/values-sv/strings.xml
similarity index 100%
rename from appsearch/debug-view/src/main/res/values-sv/strings.xml
rename to appsearch/appsearch-debug-view/src/main/res/values-sv/strings.xml
diff --git a/appsearch/debug-view/src/main/res/values-sw/strings.xml b/appsearch/appsearch-debug-view/src/main/res/values-sw/strings.xml
similarity index 100%
rename from appsearch/debug-view/src/main/res/values-sw/strings.xml
rename to appsearch/appsearch-debug-view/src/main/res/values-sw/strings.xml
diff --git a/appsearch/debug-view/src/main/res/values-ta/strings.xml b/appsearch/appsearch-debug-view/src/main/res/values-ta/strings.xml
similarity index 100%
rename from appsearch/debug-view/src/main/res/values-ta/strings.xml
rename to appsearch/appsearch-debug-view/src/main/res/values-ta/strings.xml
diff --git a/appsearch/debug-view/src/main/res/values-te/strings.xml b/appsearch/appsearch-debug-view/src/main/res/values-te/strings.xml
similarity index 100%
rename from appsearch/debug-view/src/main/res/values-te/strings.xml
rename to appsearch/appsearch-debug-view/src/main/res/values-te/strings.xml
diff --git a/appsearch/debug-view/src/main/res/values-th/strings.xml b/appsearch/appsearch-debug-view/src/main/res/values-th/strings.xml
similarity index 100%
rename from appsearch/debug-view/src/main/res/values-th/strings.xml
rename to appsearch/appsearch-debug-view/src/main/res/values-th/strings.xml
diff --git a/appsearch/debug-view/src/main/res/values-tl/strings.xml b/appsearch/appsearch-debug-view/src/main/res/values-tl/strings.xml
similarity index 100%
rename from appsearch/debug-view/src/main/res/values-tl/strings.xml
rename to appsearch/appsearch-debug-view/src/main/res/values-tl/strings.xml
diff --git a/appsearch/debug-view/src/main/res/values-tr/strings.xml b/appsearch/appsearch-debug-view/src/main/res/values-tr/strings.xml
similarity index 100%
rename from appsearch/debug-view/src/main/res/values-tr/strings.xml
rename to appsearch/appsearch-debug-view/src/main/res/values-tr/strings.xml
diff --git a/appsearch/debug-view/src/main/res/values-uk/strings.xml b/appsearch/appsearch-debug-view/src/main/res/values-uk/strings.xml
similarity index 100%
rename from appsearch/debug-view/src/main/res/values-uk/strings.xml
rename to appsearch/appsearch-debug-view/src/main/res/values-uk/strings.xml
diff --git a/appsearch/debug-view/src/main/res/values-ur/strings.xml b/appsearch/appsearch-debug-view/src/main/res/values-ur/strings.xml
similarity index 100%
rename from appsearch/debug-view/src/main/res/values-ur/strings.xml
rename to appsearch/appsearch-debug-view/src/main/res/values-ur/strings.xml
diff --git a/appsearch/debug-view/src/main/res/values-uz/strings.xml b/appsearch/appsearch-debug-view/src/main/res/values-uz/strings.xml
similarity index 100%
rename from appsearch/debug-view/src/main/res/values-uz/strings.xml
rename to appsearch/appsearch-debug-view/src/main/res/values-uz/strings.xml
diff --git a/appsearch/debug-view/src/main/res/values-vi/strings.xml b/appsearch/appsearch-debug-view/src/main/res/values-vi/strings.xml
similarity index 100%
rename from appsearch/debug-view/src/main/res/values-vi/strings.xml
rename to appsearch/appsearch-debug-view/src/main/res/values-vi/strings.xml
diff --git a/appsearch/debug-view/src/main/res/values-zh-rCN/strings.xml b/appsearch/appsearch-debug-view/src/main/res/values-zh-rCN/strings.xml
similarity index 100%
rename from appsearch/debug-view/src/main/res/values-zh-rCN/strings.xml
rename to appsearch/appsearch-debug-view/src/main/res/values-zh-rCN/strings.xml
diff --git a/appsearch/debug-view/src/main/res/values-zh-rHK/strings.xml b/appsearch/appsearch-debug-view/src/main/res/values-zh-rHK/strings.xml
similarity index 100%
rename from appsearch/debug-view/src/main/res/values-zh-rHK/strings.xml
rename to appsearch/appsearch-debug-view/src/main/res/values-zh-rHK/strings.xml
diff --git a/appsearch/debug-view/src/main/res/values-zh-rTW/strings.xml b/appsearch/appsearch-debug-view/src/main/res/values-zh-rTW/strings.xml
similarity index 100%
rename from appsearch/debug-view/src/main/res/values-zh-rTW/strings.xml
rename to appsearch/appsearch-debug-view/src/main/res/values-zh-rTW/strings.xml
diff --git a/appsearch/debug-view/src/main/res/values-zu/strings.xml b/appsearch/appsearch-debug-view/src/main/res/values-zu/strings.xml
similarity index 100%
rename from appsearch/debug-view/src/main/res/values-zu/strings.xml
rename to appsearch/appsearch-debug-view/src/main/res/values-zu/strings.xml
diff --git a/appsearch/debug-view/src/main/res/values/strings.xml b/appsearch/appsearch-debug-view/src/main/res/values/strings.xml
similarity index 100%
rename from appsearch/debug-view/src/main/res/values/strings.xml
rename to appsearch/appsearch-debug-view/src/main/res/values/strings.xml
diff --git a/appsearch/appsearch-ktx/build.gradle b/appsearch/appsearch-ktx/build.gradle
index 9675672..bcc5d0c 100644
--- a/appsearch/appsearch-ktx/build.gradle
+++ b/appsearch/appsearch-ktx/build.gradle
@@ -31,6 +31,7 @@
kaptAndroidTest project(':appsearch:appsearch-compiler')
androidTestImplementation project(':appsearch:appsearch')
androidTestImplementation project(':appsearch:appsearch-local-storage')
+ androidTestImplementation project(':appsearch:appsearch-test-util')
androidTestImplementation(libs.testCore)
androidTestImplementation(libs.testRules)
androidTestImplementation(libs.truth)
diff --git a/appsearch/appsearch-ktx/src/androidTest/java/AnnotationProcessorKtTest.kt b/appsearch/appsearch-ktx/src/androidTest/java/AnnotationProcessorKtTest.kt
index e5163dd..7636104 100644
--- a/appsearch/appsearch-ktx/src/androidTest/java/AnnotationProcessorKtTest.kt
+++ b/appsearch/appsearch-ktx/src/androidTest/java/AnnotationProcessorKtTest.kt
@@ -22,11 +22,11 @@
import androidx.appsearch.app.AppSearchSession
import androidx.appsearch.app.GenericDocument
import androidx.appsearch.app.PutDocumentsRequest
-import androidx.appsearch.app.SearchResult
-import androidx.appsearch.app.SearchResults
import androidx.appsearch.app.SearchSpec
import androidx.appsearch.app.SetSchemaRequest
import androidx.appsearch.localstorage.LocalStorage
+import androidx.appsearch.testutil.AppSearchTestUtils.checkIsBatchResultSuccess
+import androidx.appsearch.testutil.AppSearchTestUtils.convertSearchResultsToDocuments
import androidx.test.core.app.ApplicationProvider
import com.google.common.truth.Truth.assertThat
import org.junit.After
@@ -249,7 +249,7 @@
}
@Test
- public fun testAnnotationProcessor() {
+ fun testAnnotationProcessor() {
session.setSchema(
SetSchemaRequest.Builder()
.addDocumentClasses(Card::class.java, Gift::class.java).build()
@@ -259,8 +259,11 @@
val inputDocument = createPopulatedGift()
// Index the Gift document and query it.
- session.put(PutDocumentsRequest.Builder().addDocuments(inputDocument).build())
- .get().checkSuccess()
+ checkIsBatchResultSuccess(
+ session.put(
+ PutDocumentsRequest.Builder().addDocuments(inputDocument).build()
+ )
+ )
val searchResults = session.search("", SearchSpec.Builder().build())
val documents = convertSearchResultsToDocuments(searchResults)
assertThat(documents).hasSize(1)
@@ -271,7 +274,7 @@
}
@Test
- public fun testGenericDocumentConversion() {
+ fun testGenericDocumentConversion() {
val inGift = createPopulatedGift()
val genericDocument1 = GenericDocument.fromDocumentClass(inGift)
val genericDocument2 = GenericDocument.fromDocumentClass(inGift)
@@ -325,16 +328,4 @@
card = card1
)
}
-
- private fun convertSearchResultsToDocuments(
- searchResults: SearchResults
- ): List<GenericDocument> {
- var page = searchResults.nextPage.get()
- val results = mutableListOf<SearchResult>()
- while (page.isNotEmpty()) {
- results.addAll(page)
- page = searchResults.nextPage.get()
- }
- return results.map { it.genericDocument }
- }
}
diff --git a/appsearch/local-storage/api/current.txt b/appsearch/appsearch-local-storage/api/current.txt
similarity index 100%
rename from appsearch/local-storage/api/current.txt
rename to appsearch/appsearch-local-storage/api/current.txt
diff --git a/appsearch/local-storage/api/public_plus_experimental_current.txt b/appsearch/appsearch-local-storage/api/public_plus_experimental_current.txt
similarity index 100%
rename from appsearch/local-storage/api/public_plus_experimental_current.txt
rename to appsearch/appsearch-local-storage/api/public_plus_experimental_current.txt
diff --git a/appsearch/local-storage/api/res-current.txt b/appsearch/appsearch-local-storage/api/res-current.txt
similarity index 100%
rename from appsearch/local-storage/api/res-current.txt
rename to appsearch/appsearch-local-storage/api/res-current.txt
diff --git a/appsearch/local-storage/api/restricted_current.txt b/appsearch/appsearch-local-storage/api/restricted_current.txt
similarity index 100%
rename from appsearch/local-storage/api/restricted_current.txt
rename to appsearch/appsearch-local-storage/api/restricted_current.txt
diff --git a/appsearch/local-storage/build.gradle b/appsearch/appsearch-local-storage/build.gradle
similarity index 97%
rename from appsearch/local-storage/build.gradle
rename to appsearch/appsearch-local-storage/build.gradle
index 046289f..1c88fca 100644
--- a/appsearch/local-storage/build.gradle
+++ b/appsearch/appsearch-local-storage/build.gradle
@@ -76,6 +76,7 @@
implementation("androidx.concurrent:concurrent-futures:1.0.0")
implementation("androidx.core:core:1.2.0")
+ androidTestImplementation project(':appsearch:appsearch-test-util')
androidTestImplementation(libs.multidex)
androidTestImplementation(libs.testCore)
androidTestImplementation(libs.testRules)
diff --git a/appsearch/local-storage/proguard-rules.pro b/appsearch/appsearch-local-storage/proguard-rules.pro
similarity index 100%
rename from appsearch/local-storage/proguard-rules.pro
rename to appsearch/appsearch-local-storage/proguard-rules.pro
diff --git a/appsearch/local-storage/src/androidTest/AndroidManifest.xml b/appsearch/appsearch-local-storage/src/androidTest/AndroidManifest.xml
similarity index 100%
rename from appsearch/local-storage/src/androidTest/AndroidManifest.xml
rename to appsearch/appsearch-local-storage/src/androidTest/AndroidManifest.xml
diff --git a/appsearch/local-storage/src/androidTest/java/androidx/appsearch/localstorage/AppSearchImplTest.java b/appsearch/appsearch-local-storage/src/androidTest/java/androidx/appsearch/localstorage/AppSearchImplTest.java
similarity index 95%
rename from appsearch/local-storage/src/androidTest/java/androidx/appsearch/localstorage/AppSearchImplTest.java
rename to appsearch/appsearch-local-storage/src/androidTest/java/androidx/appsearch/localstorage/AppSearchImplTest.java
index 1662d16..733bc87 100644
--- a/appsearch/local-storage/src/androidTest/java/androidx/appsearch/localstorage/AppSearchImplTest.java
+++ b/appsearch/appsearch-local-storage/src/androidTest/java/androidx/appsearch/localstorage/AppSearchImplTest.java
@@ -62,6 +62,7 @@
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;
+import org.junit.After;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
@@ -81,16 +82,23 @@
private static final OptimizeStrategy ALWAYS_OPTIMIZE = optimizeInfo -> true;
@Rule
public TemporaryFolder mTemporaryFolder = new TemporaryFolder();
+ private File mAppSearchDir;
private AppSearchImpl mAppSearchImpl;
@Before
public void setUp() throws Exception {
+ mAppSearchDir = mTemporaryFolder.newFolder();
mAppSearchImpl = AppSearchImpl.create(
- mTemporaryFolder.newFolder(),
+ mAppSearchDir,
new UnlimitedLimitConfig(),
/*initStatsBuilder=*/ null, ALWAYS_OPTIMIZE);
}
+ @After
+ public void tearDown() {
+ mAppSearchImpl.close();
+ }
+
/**
* Ensure that we can rewrite an incoming schema type by adding the database as a prefix. While
* also keeping any other existing schema types that may already be part of Icing's persisted
@@ -403,20 +411,12 @@
@Test
public void testReset() throws Exception {
- // Setup the index
- Context context = ApplicationProvider.getApplicationContext();
- File appsearchDir = mTemporaryFolder.newFolder();
- AppSearchImpl appSearchImpl = AppSearchImpl.create(
- appsearchDir,
- new UnlimitedLimitConfig(),
- /*initStatsBuilder=*/ null,
- ALWAYS_OPTIMIZE);
-
// Insert schema
+ Context context = ApplicationProvider.getApplicationContext();
List<AppSearchSchema> schemas = ImmutableList.of(
new AppSearchSchema.Builder("Type1").build(),
new AppSearchSchema.Builder("Type2").build());
- appSearchImpl.setSchema(
+ mAppSearchImpl.setSchema(
context.getPackageName(),
"database1",
schemas,
@@ -430,7 +430,7 @@
// Insert a valid doc
GenericDocument validDoc =
new GenericDocument.Builder<>("namespace1", "id1", "Type1").build();
- appSearchImpl.putDocument(
+ mAppSearchImpl.putDocument(
context.getPackageName(),
"database1",
validDoc,
@@ -438,7 +438,7 @@
// Query it via global query. We use the same code again later so this is to make sure we
// have our global query configured right.
- SearchResultPage results = appSearchImpl.globalQuery(
+ SearchResultPage results = mAppSearchImpl.globalQuery(
/*queryExpression=*/ "",
new SearchSpec.Builder().addFilterSchemas("Type1").build(),
context.getPackageName(),
@@ -462,14 +462,14 @@
"The prefixed value \"invalidNamespace\" doesn't contain a valid database name");
// Insert the invalid doc with an invalid namespace right into icing
- PutResultProto putResultProto = appSearchImpl.mIcingSearchEngineLocked.put(invalidDoc);
+ PutResultProto putResultProto = mAppSearchImpl.mIcingSearchEngineLocked.put(invalidDoc);
assertThat(putResultProto.getStatus().getCode()).isEqualTo(StatusProto.Code.OK);
// Initialize AppSearchImpl. This should cause a reset.
InitializeStats.Builder initStatsBuilder = new InitializeStats.Builder();
- appSearchImpl.close();
- appSearchImpl = AppSearchImpl.create(
- appsearchDir, new UnlimitedLimitConfig(), initStatsBuilder, ALWAYS_OPTIMIZE);
+ mAppSearchImpl.close();
+ mAppSearchImpl = AppSearchImpl.create(
+ mAppSearchDir, new UnlimitedLimitConfig(), initStatsBuilder, ALWAYS_OPTIMIZE);
// Check recovery state
InitializeStats initStats = initStatsBuilder.build();
@@ -488,9 +488,9 @@
assertThat(initStats.getResetStatusCode()).isEqualTo(AppSearchResult.RESULT_OK);
// Make sure all our data is gone
- assertThat(appSearchImpl.getSchema(context.getPackageName(), "database1").getSchemas())
+ assertThat(mAppSearchImpl.getSchema(context.getPackageName(), "database1").getSchemas())
.isEmpty();
- results = appSearchImpl.globalQuery(
+ results = mAppSearchImpl.globalQuery(
/*queryExpression=*/ "",
new SearchSpec.Builder().addFilterSchemas("Type1").build(),
context.getPackageName(),
@@ -501,7 +501,7 @@
assertThat(results.getResults()).isEmpty();
// Make sure the index can now be used successfully
- appSearchImpl.setSchema(
+ mAppSearchImpl.setSchema(
context.getPackageName(),
"database1",
Collections.singletonList(new AppSearchSchema.Builder("Type1").build()),
@@ -513,14 +513,14 @@
/* setSchemaStatsBuilder= */ null);
// Insert a valid doc
- appSearchImpl.putDocument(
+ mAppSearchImpl.putDocument(
context.getPackageName(),
"database1",
validDoc,
/*logger=*/null);
// Query it via global query.
- results = appSearchImpl.globalQuery(
+ results = mAppSearchImpl.globalQuery(
/*queryExpression=*/ "",
new SearchSpec.Builder().addFilterSchemas("Type1").build(),
context.getPackageName(),
@@ -1947,16 +1947,10 @@
@Test
public void testThrowsExceptionIfClosed() throws Exception {
- AppSearchImpl appSearchImpl = AppSearchImpl.create(
- mTemporaryFolder.newFolder(),
- new UnlimitedLimitConfig(),
- /*initStatsBuilder=*/ null,
- ALWAYS_OPTIMIZE);
-
// Initial check that we could do something at first.
List<AppSearchSchema> schemas =
Collections.singletonList(new AppSearchSchema.Builder("type").build());
- appSearchImpl.setSchema(
+ mAppSearchImpl.setSchema(
"package",
"database",
schemas,
@@ -1967,10 +1961,10 @@
/*version=*/ 0,
/* setSchemaStatsBuilder= */ null);
- appSearchImpl.close();
+ mAppSearchImpl.close();
// Check all our public APIs
- assertThrows(IllegalStateException.class, () -> appSearchImpl.setSchema(
+ assertThrows(IllegalStateException.class, () -> mAppSearchImpl.setSchema(
"package",
"database",
schemas,
@@ -1981,26 +1975,26 @@
/*version=*/ 0,
/* setSchemaStatsBuilder= */ null));
- assertThrows(IllegalStateException.class, () -> appSearchImpl.getSchema(
+ assertThrows(IllegalStateException.class, () -> mAppSearchImpl.getSchema(
"package", "database"));
- assertThrows(IllegalStateException.class, () -> appSearchImpl.putDocument(
+ assertThrows(IllegalStateException.class, () -> mAppSearchImpl.putDocument(
"package",
"database",
new GenericDocument.Builder<>("namespace", "id", "type").build(),
/*logger=*/ null));
- assertThrows(IllegalStateException.class, () -> appSearchImpl.getDocument(
+ assertThrows(IllegalStateException.class, () -> mAppSearchImpl.getDocument(
"package", "database", "namespace", "id", Collections.emptyMap()));
- assertThrows(IllegalStateException.class, () -> appSearchImpl.query(
+ assertThrows(IllegalStateException.class, () -> mAppSearchImpl.query(
"package",
"database",
"query",
new SearchSpec.Builder().build(),
/*logger=*/ null));
- assertThrows(IllegalStateException.class, () -> appSearchImpl.globalQuery(
+ assertThrows(IllegalStateException.class, () -> mAppSearchImpl.globalQuery(
"query",
new SearchSpec.Builder().build(),
"package",
@@ -2009,50 +2003,42 @@
/*callerHasSystemAccess=*/ false,
/*logger=*/ null));
- assertThrows(IllegalStateException.class, () -> appSearchImpl.getNextPage("package",
+ assertThrows(IllegalStateException.class, () -> mAppSearchImpl.getNextPage("package",
/*nextPageToken=*/ 1L, /*statsBuilder=*/ null));
- assertThrows(IllegalStateException.class, () -> appSearchImpl.invalidateNextPageToken(
+ assertThrows(IllegalStateException.class, () -> mAppSearchImpl.invalidateNextPageToken(
"package",
/*nextPageToken=*/ 1L));
- assertThrows(IllegalStateException.class, () -> appSearchImpl.reportUsage(
+ assertThrows(IllegalStateException.class, () -> mAppSearchImpl.reportUsage(
"package", "database", "namespace", "id",
/*usageTimestampMillis=*/ 1000L, /*systemUsage=*/ false));
- assertThrows(IllegalStateException.class, () -> appSearchImpl.remove(
+ assertThrows(IllegalStateException.class, () -> mAppSearchImpl.remove(
"package", "database", "namespace", "id", /*removeStatsBuilder=*/ null));
- assertThrows(IllegalStateException.class, () -> appSearchImpl.removeByQuery(
+ assertThrows(IllegalStateException.class, () -> mAppSearchImpl.removeByQuery(
"package",
"database",
"query",
new SearchSpec.Builder().build(),
/*removeStatsBuilder=*/ null));
- assertThrows(IllegalStateException.class, () -> appSearchImpl.getStorageInfoForPackage(
+ assertThrows(IllegalStateException.class, () -> mAppSearchImpl.getStorageInfoForPackage(
"package"));
- assertThrows(IllegalStateException.class, () -> appSearchImpl.getStorageInfoForDatabase(
+ assertThrows(IllegalStateException.class, () -> mAppSearchImpl.getStorageInfoForDatabase(
"package", "database"));
- assertThrows(IllegalStateException.class, () -> appSearchImpl.persistToDisk(
+ assertThrows(IllegalStateException.class, () -> mAppSearchImpl.persistToDisk(
PersistType.Code.FULL));
}
@Test
public void testPutPersistsWithLiteFlush() throws Exception {
- // Setup the index
- File appsearchDir = mTemporaryFolder.newFolder();
- AppSearchImpl appSearchImpl = AppSearchImpl.create(
- appsearchDir,
- new UnlimitedLimitConfig(),
- /*initStatsBuilder=*/ null,
- ALWAYS_OPTIMIZE);
-
List<AppSearchSchema> schemas =
Collections.singletonList(new AppSearchSchema.Builder("type").build());
- appSearchImpl.setSchema(
+ mAppSearchImpl.setSchema(
"package",
"database",
schemas,
@@ -2066,17 +2052,17 @@
// Add a document and persist it.
GenericDocument document =
new GenericDocument.Builder<>("namespace1", "id1", "type").build();
- appSearchImpl.putDocument("package", "database", document, /*logger=*/null);
- appSearchImpl.persistToDisk(PersistType.Code.LITE);
+ mAppSearchImpl.putDocument("package", "database", document, /*logger=*/null);
+ mAppSearchImpl.persistToDisk(PersistType.Code.LITE);
- GenericDocument getResult = appSearchImpl.getDocument("package", "database", "namespace1",
+ GenericDocument getResult = mAppSearchImpl.getDocument("package", "database", "namespace1",
"id1",
Collections.emptyMap());
assertThat(getResult).isEqualTo(document);
// That document should be visible even from another instance.
AppSearchImpl appSearchImpl2 = AppSearchImpl.create(
- appsearchDir,
+ mAppSearchDir,
new UnlimitedLimitConfig(),
/*initStatsBuilder=*/ null,
ALWAYS_OPTIMIZE);
@@ -2084,21 +2070,14 @@
"id1",
Collections.emptyMap());
assertThat(getResult).isEqualTo(document);
+ appSearchImpl2.close();
}
@Test
public void testDeletePersistsWithLiteFlush() throws Exception {
- // Setup the index
- File appsearchDir = mTemporaryFolder.newFolder();
- AppSearchImpl appSearchImpl = AppSearchImpl.create(
- appsearchDir,
- new UnlimitedLimitConfig(),
- /*initStatsBuilder=*/ null,
- ALWAYS_OPTIMIZE);
-
List<AppSearchSchema> schemas =
Collections.singletonList(new AppSearchSchema.Builder("type").build());
- appSearchImpl.setSchema(
+ mAppSearchImpl.setSchema(
"package",
"database",
schemas,
@@ -2112,37 +2091,37 @@
// Add two documents and persist them.
GenericDocument document1 =
new GenericDocument.Builder<>("namespace1", "id1", "type").build();
- appSearchImpl.putDocument("package", "database", document1, /*logger=*/null);
+ mAppSearchImpl.putDocument("package", "database", document1, /*logger=*/null);
GenericDocument document2 =
new GenericDocument.Builder<>("namespace1", "id2", "type").build();
- appSearchImpl.putDocument("package", "database", document2, /*logger=*/null);
- appSearchImpl.persistToDisk(PersistType.Code.LITE);
+ mAppSearchImpl.putDocument("package", "database", document2, /*logger=*/null);
+ mAppSearchImpl.persistToDisk(PersistType.Code.LITE);
- GenericDocument getResult = appSearchImpl.getDocument("package", "database", "namespace1",
+ GenericDocument getResult = mAppSearchImpl.getDocument("package", "database", "namespace1",
"id1",
Collections.emptyMap());
assertThat(getResult).isEqualTo(document1);
- getResult = appSearchImpl.getDocument("package", "database", "namespace1",
+ getResult = mAppSearchImpl.getDocument("package", "database", "namespace1",
"id2",
Collections.emptyMap());
assertThat(getResult).isEqualTo(document2);
// Delete the first document
- appSearchImpl.remove("package", "database", "namespace1", "id1", /*statsBuilder=*/ null);
- appSearchImpl.persistToDisk(PersistType.Code.LITE);
- assertThrows(AppSearchException.class, () -> appSearchImpl.getDocument("package",
+ mAppSearchImpl.remove("package", "database", "namespace1", "id1", /*statsBuilder=*/ null);
+ mAppSearchImpl.persistToDisk(PersistType.Code.LITE);
+ assertThrows(AppSearchException.class, () -> mAppSearchImpl.getDocument("package",
"database",
"namespace1",
"id1",
Collections.emptyMap()));
- getResult = appSearchImpl.getDocument("package", "database", "namespace1",
+ getResult = mAppSearchImpl.getDocument("package", "database", "namespace1",
"id2",
Collections.emptyMap());
assertThat(getResult).isEqualTo(document2);
// Only the second document should be retrievable from another instance.
AppSearchImpl appSearchImpl2 = AppSearchImpl.create(
- appsearchDir,
+ mAppSearchDir,
new UnlimitedLimitConfig(),
/*initStatsBuilder=*/ null,
ALWAYS_OPTIMIZE);
@@ -2155,21 +2134,14 @@
"id2",
Collections.emptyMap());
assertThat(getResult).isEqualTo(document2);
+ appSearchImpl2.close();
}
@Test
public void testDeleteByQueryPersistsWithLiteFlush() throws Exception {
- // Setup the index
- File appsearchDir = mTemporaryFolder.newFolder();
- AppSearchImpl appSearchImpl = AppSearchImpl.create(
- appsearchDir,
- new UnlimitedLimitConfig(),
- /*initStatsBuilder=*/ null,
- ALWAYS_OPTIMIZE);
-
List<AppSearchSchema> schemas =
Collections.singletonList(new AppSearchSchema.Builder("type").build());
- appSearchImpl.setSchema(
+ mAppSearchImpl.setSchema(
"package",
"database",
schemas,
@@ -2183,39 +2155,39 @@
// Add two documents and persist them.
GenericDocument document1 =
new GenericDocument.Builder<>("namespace1", "id1", "type").build();
- appSearchImpl.putDocument("package", "database", document1, /*logger=*/null);
+ mAppSearchImpl.putDocument("package", "database", document1, /*logger=*/null);
GenericDocument document2 =
new GenericDocument.Builder<>("namespace2", "id2", "type").build();
- appSearchImpl.putDocument("package", "database", document2, /*logger=*/null);
- appSearchImpl.persistToDisk(PersistType.Code.LITE);
+ mAppSearchImpl.putDocument("package", "database", document2, /*logger=*/null);
+ mAppSearchImpl.persistToDisk(PersistType.Code.LITE);
- GenericDocument getResult = appSearchImpl.getDocument("package", "database", "namespace1",
+ GenericDocument getResult = mAppSearchImpl.getDocument("package", "database", "namespace1",
"id1",
Collections.emptyMap());
assertThat(getResult).isEqualTo(document1);
- getResult = appSearchImpl.getDocument("package", "database", "namespace2",
+ getResult = mAppSearchImpl.getDocument("package", "database", "namespace2",
"id2",
Collections.emptyMap());
assertThat(getResult).isEqualTo(document2);
// Delete the first document
- appSearchImpl.removeByQuery("package", "database", "",
+ mAppSearchImpl.removeByQuery("package", "database", "",
new SearchSpec.Builder().addFilterNamespaces("namespace1").setTermMatch(
SearchSpec.TERM_MATCH_EXACT_ONLY).build(), /*statsBuilder=*/ null);
- appSearchImpl.persistToDisk(PersistType.Code.LITE);
- assertThrows(AppSearchException.class, () -> appSearchImpl.getDocument("package",
+ mAppSearchImpl.persistToDisk(PersistType.Code.LITE);
+ assertThrows(AppSearchException.class, () -> mAppSearchImpl.getDocument("package",
"database",
"namespace1",
"id1",
Collections.emptyMap()));
- getResult = appSearchImpl.getDocument("package", "database", "namespace2",
+ getResult = mAppSearchImpl.getDocument("package", "database", "namespace2",
"id2",
Collections.emptyMap());
assertThat(getResult).isEqualTo(document2);
// Only the second document should be retrievable from another instance.
AppSearchImpl appSearchImpl2 = AppSearchImpl.create(
- appsearchDir,
+ mAppSearchDir,
new UnlimitedLimitConfig(),
/*initStatsBuilder=*/ null,
ALWAYS_OPTIMIZE);
@@ -2228,21 +2200,14 @@
"id2",
Collections.emptyMap());
assertThat(getResult).isEqualTo(document2);
+ appSearchImpl2.close();
}
@Test
public void testGetIcingSearchEngineStorageInfo() throws Exception {
- // Setup the index
- File appsearchDir = mTemporaryFolder.newFolder();
- AppSearchImpl appSearchImpl = AppSearchImpl.create(
- appsearchDir,
- new UnlimitedLimitConfig(),
- /*initStatsBuilder=*/ null,
- ALWAYS_OPTIMIZE);
-
List<AppSearchSchema> schemas =
Collections.singletonList(new AppSearchSchema.Builder("type").build());
- appSearchImpl.setSchema(
+ mAppSearchImpl.setSchema(
"package",
"database",
schemas,
@@ -2256,12 +2221,12 @@
// Add two documents
GenericDocument document1 =
new GenericDocument.Builder<>("namespace1", "id1", "type").build();
- appSearchImpl.putDocument("package", "database", document1, /*logger=*/null);
+ mAppSearchImpl.putDocument("package", "database", document1, /*logger=*/null);
GenericDocument document2 =
new GenericDocument.Builder<>("namespace1", "id2", "type").build();
- appSearchImpl.putDocument("package", "database", document2, /*logger=*/null);
+ mAppSearchImpl.putDocument("package", "database", document2, /*logger=*/null);
- StorageInfoProto storageInfo = appSearchImpl.getRawStorageInfoProto();
+ StorageInfoProto storageInfo = mAppSearchImpl.getRawStorageInfoProto();
// Simple checks to verify if we can get correct StorageInfoProto from IcingSearchEngine
// No need to cover all the fields
@@ -2639,7 +2604,7 @@
}
@Test
- public void testLimitConfig_RemoveByQyery() throws Exception {
+ public void testLimitConfig_RemoveByQuery() throws Exception {
// Create a new mAppSearchImpl with a lower limit
mAppSearchImpl.close();
mAppSearchImpl = AppSearchImpl.create(
diff --git a/appsearch/local-storage/src/androidTest/java/androidx/appsearch/localstorage/AppSearchLoggerTest.java b/appsearch/appsearch-local-storage/src/androidTest/java/androidx/appsearch/localstorage/AppSearchLoggerTest.java
similarity index 95%
rename from appsearch/local-storage/src/androidTest/java/androidx/appsearch/localstorage/AppSearchLoggerTest.java
rename to appsearch/appsearch-local-storage/src/androidTest/java/androidx/appsearch/localstorage/AppSearchLoggerTest.java
index a0dbd6c..6d82c68 100644
--- a/appsearch/local-storage/src/androidTest/java/androidx/appsearch/localstorage/AppSearchLoggerTest.java
+++ b/appsearch/appsearch-local-storage/src/androidTest/java/androidx/appsearch/localstorage/AppSearchLoggerTest.java
@@ -18,21 +18,19 @@
import static com.google.common.truth.Truth.assertThat;
-import androidx.annotation.NonNull;
-import androidx.annotation.Nullable;
import androidx.appsearch.app.AppSearchResult;
import androidx.appsearch.app.AppSearchSchema;
import androidx.appsearch.app.GenericDocument;
import androidx.appsearch.app.SearchResultPage;
import androidx.appsearch.app.SearchSpec;
import androidx.appsearch.exceptions.AppSearchException;
-import androidx.appsearch.localstorage.stats.CallStats;
import androidx.appsearch.localstorage.stats.InitializeStats;
import androidx.appsearch.localstorage.stats.OptimizeStats;
import androidx.appsearch.localstorage.stats.PutDocumentStats;
import androidx.appsearch.localstorage.stats.RemoveStats;
import androidx.appsearch.localstorage.stats.SearchStats;
import androidx.appsearch.localstorage.stats.SetSchemaStats;
+import androidx.appsearch.testutil.SimpleTestLogger;
import com.google.android.icing.proto.DeleteStatsProto;
import com.google.android.icing.proto.DocumentProto;
@@ -47,6 +45,7 @@
import com.google.android.icing.proto.TermMatchType;
import com.google.common.collect.ImmutableList;
+import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Rule;
@@ -67,7 +66,7 @@
@Rule
public TemporaryFolder mTemporaryFolder = new TemporaryFolder();
private AppSearchImpl mAppSearchImpl;
- private TestLogger mLogger;
+ private SimpleTestLogger mLogger;
@Before
public void setUp() throws Exception {
@@ -76,60 +75,12 @@
new UnlimitedLimitConfig(),
/*initStatsBuilder=*/ null,
ALWAYS_OPTIMIZE);
- mLogger = new TestLogger();
+ mLogger = new SimpleTestLogger();
}
- // Test only not thread safe.
- public static class TestLogger implements AppSearchLogger {
- @Nullable
- CallStats mCallStats;
- @Nullable
- PutDocumentStats mPutDocumentStats;
- @Nullable
- InitializeStats mInitializeStats;
- @Nullable
- SearchStats mSearchStats;
- @Nullable
- RemoveStats mRemoveStats;
- @Nullable
- OptimizeStats mOptimizeStats;
- @Nullable
- SetSchemaStats mSetSchemaStats;
-
- @Override
- public void logStats(@NonNull CallStats stats) {
- mCallStats = stats;
- }
-
- @Override
- public void logStats(@NonNull PutDocumentStats stats) {
- mPutDocumentStats = stats;
- }
-
- @Override
- public void logStats(@NonNull InitializeStats stats) {
- mInitializeStats = stats;
- }
-
- @Override
- public void logStats(@NonNull SearchStats stats) {
- mSearchStats = stats;
- }
-
- @Override
- public void logStats(@NonNull RemoveStats stats) {
- mRemoveStats = stats;
- }
-
- @Override
- public void logStats(@NonNull OptimizeStats stats) {
- mOptimizeStats = stats;
- }
-
- @Override
- public void logStats(@NonNull SetSchemaStats stats) {
- mSetSchemaStats = stats;
- }
+ @After
+ public void tearDown() {
+ mAppSearchImpl.close();
}
@Test
@@ -382,12 +333,13 @@
public void testLoggingStats_initializeWithoutDocuments_success() throws Exception {
// Create an unused AppSearchImpl to generated an InitializeStats.
InitializeStats.Builder initStatsBuilder = new InitializeStats.Builder();
- AppSearchImpl.create(
+ AppSearchImpl appSearchImpl = AppSearchImpl.create(
mTemporaryFolder.newFolder(),
new UnlimitedLimitConfig(),
initStatsBuilder,
ALWAYS_OPTIMIZE);
InitializeStats iStats = initStatsBuilder.build();
+ appSearchImpl.close();
assertThat(iStats).isNotNull();
assertThat(iStats.getStatusCode()).isEqualTo(AppSearchResult.RESULT_OK);
@@ -437,7 +389,8 @@
// Create another appsearchImpl on the same folder
InitializeStats.Builder initStatsBuilder = new InitializeStats.Builder();
- AppSearchImpl.create(folder, new UnlimitedLimitConfig(), initStatsBuilder, ALWAYS_OPTIMIZE);
+ appSearchImpl = AppSearchImpl.create(
+ folder, new UnlimitedLimitConfig(), initStatsBuilder, ALWAYS_OPTIMIZE);
InitializeStats iStats = initStatsBuilder.build();
assertThat(iStats).isNotNull();
@@ -452,6 +405,7 @@
assertThat(iStats.getSchemaTypeCount()).isEqualTo(2);
assertThat(iStats.hasReset()).isEqualTo(false);
assertThat(iStats.getResetStatusCode()).isEqualTo(AppSearchResult.RESULT_OK);
+ appSearchImpl.close();
}
@Test
@@ -494,13 +448,15 @@
// Create another appsearchImpl on the same folder
InitializeStats.Builder initStatsBuilder = new InitializeStats.Builder();
- AppSearchImpl.create(folder, new UnlimitedLimitConfig(), initStatsBuilder, ALWAYS_OPTIMIZE);
+ appSearchImpl = AppSearchImpl.create(
+ folder, new UnlimitedLimitConfig(), initStatsBuilder, ALWAYS_OPTIMIZE);
InitializeStats iStats = initStatsBuilder.build();
// Some of other fields are already covered by AppSearchImplTest#testReset()
assertThat(iStats).isNotNull();
assertThat(iStats.getStatusCode()).isEqualTo(AppSearchResult.RESULT_INTERNAL_ERROR);
assertThat(iStats.hasReset()).isTrue();
+ appSearchImpl.close();
}
@Test
diff --git a/appsearch/local-storage/src/androidTest/java/androidx/appsearch/localstorage/JetpackOptimizeStrategyTest.java b/appsearch/appsearch-local-storage/src/androidTest/java/androidx/appsearch/localstorage/JetpackOptimizeStrategyTest.java
similarity index 100%
rename from appsearch/local-storage/src/androidTest/java/androidx/appsearch/localstorage/JetpackOptimizeStrategyTest.java
rename to appsearch/appsearch-local-storage/src/androidTest/java/androidx/appsearch/localstorage/JetpackOptimizeStrategyTest.java
diff --git a/appsearch/local-storage/src/androidTest/java/androidx/appsearch/localstorage/LocalStorageTest.java b/appsearch/appsearch-local-storage/src/androidTest/java/androidx/appsearch/localstorage/LocalStorageTest.java
similarity index 100%
rename from appsearch/local-storage/src/androidTest/java/androidx/appsearch/localstorage/LocalStorageTest.java
rename to appsearch/appsearch-local-storage/src/androidTest/java/androidx/appsearch/localstorage/LocalStorageTest.java
diff --git a/appsearch/local-storage/src/androidTest/java/androidx/appsearch/localstorage/SearchResultsImplTest.java b/appsearch/appsearch-local-storage/src/androidTest/java/androidx/appsearch/localstorage/SearchResultsImplTest.java
similarity index 98%
rename from appsearch/local-storage/src/androidTest/java/androidx/appsearch/localstorage/SearchResultsImplTest.java
rename to appsearch/appsearch-local-storage/src/androidTest/java/androidx/appsearch/localstorage/SearchResultsImplTest.java
index fc15702..9df244e 100644
--- a/appsearch/local-storage/src/androidTest/java/androidx/appsearch/localstorage/SearchResultsImplTest.java
+++ b/appsearch/appsearch-local-storage/src/androidTest/java/androidx/appsearch/localstorage/SearchResultsImplTest.java
@@ -26,6 +26,7 @@
import com.google.android.icing.proto.TermMatchType;
import com.google.common.collect.ImmutableList;
+import org.junit.After;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
@@ -53,6 +54,11 @@
/*initStatsBuilder=*/ null, ALWAYS_OPTIMIZE);
}
+ @After
+ public void tearDown() {
+ mAppSearchImpl.close();
+ }
+
@Test
public void testGetEmptyNextPage() throws Exception {
// Insert package1 schema
diff --git a/appsearch/local-storage/src/androidTest/java/androidx/appsearch/localstorage/converter/GenericDocumentToProtoConverterTest.java b/appsearch/appsearch-local-storage/src/androidTest/java/androidx/appsearch/localstorage/converter/GenericDocumentToProtoConverterTest.java
similarity index 100%
rename from appsearch/local-storage/src/androidTest/java/androidx/appsearch/localstorage/converter/GenericDocumentToProtoConverterTest.java
rename to appsearch/appsearch-local-storage/src/androidTest/java/androidx/appsearch/localstorage/converter/GenericDocumentToProtoConverterTest.java
diff --git a/appsearch/local-storage/src/androidTest/java/androidx/appsearch/localstorage/converter/SchemaToProtoConverterTest.java b/appsearch/appsearch-local-storage/src/androidTest/java/androidx/appsearch/localstorage/converter/SchemaToProtoConverterTest.java
similarity index 100%
rename from appsearch/local-storage/src/androidTest/java/androidx/appsearch/localstorage/converter/SchemaToProtoConverterTest.java
rename to appsearch/appsearch-local-storage/src/androidTest/java/androidx/appsearch/localstorage/converter/SchemaToProtoConverterTest.java
diff --git a/appsearch/local-storage/src/androidTest/java/androidx/appsearch/localstorage/converter/SnippetTest.java b/appsearch/appsearch-local-storage/src/androidTest/java/androidx/appsearch/localstorage/converter/SnippetTest.java
similarity index 90%
rename from appsearch/local-storage/src/androidTest/java/androidx/appsearch/localstorage/converter/SnippetTest.java
rename to appsearch/appsearch-local-storage/src/androidTest/java/androidx/appsearch/localstorage/converter/SnippetTest.java
index c28e5af..1f33ff0 100644
--- a/appsearch/local-storage/src/androidTest/java/androidx/appsearch/localstorage/converter/SnippetTest.java
+++ b/appsearch/appsearch-local-storage/src/androidTest/java/androidx/appsearch/localstorage/converter/SnippetTest.java
@@ -74,6 +74,8 @@
.setExactMatchByteLength(3)
.setExactMatchUtf16Position(29)
.setExactMatchUtf16Length(3)
+ .setSubmatchByteLength(3)
+ .setSubmatchUtf16Length(3)
.setWindowBytePosition(26)
.setWindowByteLength(6)
.setWindowUtf16Position(26)
@@ -98,6 +100,9 @@
assertThat(match.getExactMatch()).isEqualTo(exactMatch);
assertThat(match.getExactMatchRange()).isEqualTo(
new SearchResult.MatchRange(/*lower=*/29, /*upper=*/32));
+ assertThat(match.getSubmatch()).isEqualTo("foo");
+ assertThat(match.getSubmatchRange()).isEqualTo(
+ new SearchResult.MatchRange(/*lower=*/29, /*upper=*/32));
assertThat(match.getFullText()).isEqualTo(propertyValueString);
assertThat(match.getSnippetRange()).isEqualTo(
new SearchResult.MatchRange(/*lower=*/26, /*upper=*/32));
@@ -154,6 +159,8 @@
.setExactMatchByteLength(4)
.setExactMatchUtf16Position(0)
.setExactMatchUtf16Length(4)
+ .setSubmatchByteLength(4)
+ .setSubmatchUtf16Length(4)
.setWindowBytePosition(0)
.setWindowByteLength(9)
.setWindowUtf16Position(0)
@@ -165,6 +172,8 @@
.setExactMatchByteLength(20)
.setExactMatchUtf16Position(0)
.setExactMatchUtf16Length(20)
+ .setSubmatchByteLength(4)
+ .setSubmatchUtf16Length(4)
.setWindowBytePosition(0)
.setWindowByteLength(20)
.setWindowUtf16Position(0)
@@ -189,6 +198,9 @@
assertThat(match1.getExactMatchRange()).isEqualTo(
new SearchResult.MatchRange(/*lower=*/0, /*upper=*/4));
assertThat(match1.getExactMatch()).isEqualTo("Test");
+ assertThat(match1.getSubmatchRange()).isEqualTo(
+ new SearchResult.MatchRange(/*lower=*/0, /*upper=*/4));
+ assertThat(match1.getSubmatch()).isEqualTo("Test");
assertThat(match1.getSnippetRange()).isEqualTo(
new SearchResult.MatchRange(/*lower=*/0, /*upper=*/9));
assertThat(match1.getSnippet()).isEqualTo("Test Name");
@@ -199,6 +211,9 @@
assertThat(match2.getExactMatchRange()).isEqualTo(
new SearchResult.MatchRange(/*lower=*/0, /*upper=*/20));
assertThat(match2.getExactMatch()).isEqualTo("TestNameJr@gmail.com");
+ assertThat(match2.getSubmatchRange()).isEqualTo(
+ new SearchResult.MatchRange(/*lower=*/0, /*upper=*/4));
+ assertThat(match2.getSubmatch()).isEqualTo("Test");
assertThat(match2.getSnippetRange()).isEqualTo(
new SearchResult.MatchRange(/*lower=*/0, /*upper=*/20));
assertThat(match2.getSnippet()).isEqualTo("TestNameJr@gmail.com");
@@ -229,6 +244,8 @@
.setExactMatchByteLength(4)
.setExactMatchUtf16Position(0)
.setExactMatchUtf16Length(4)
+ .setSubmatchByteLength(4)
+ .setSubmatchUtf16Length(4)
.setWindowBytePosition(0)
.setWindowByteLength(9)
.setWindowUtf16Position(0)
@@ -240,6 +257,8 @@
.setExactMatchByteLength(21)
.setExactMatchUtf16Position(0)
.setExactMatchUtf16Length(21)
+ .setSubmatchByteLength(4)
+ .setSubmatchUtf16Length(4)
.setWindowBytePosition(0)
.setWindowByteLength(21)
.setWindowUtf16Position(0)
@@ -264,6 +283,9 @@
assertThat(match1.getExactMatchRange()).isEqualTo(
new SearchResult.MatchRange(/*lower=*/0, /*upper=*/4));
assertThat(match1.getExactMatch()).isEqualTo("Test");
+ assertThat(match1.getSubmatchRange()).isEqualTo(
+ new SearchResult.MatchRange(/*lower=*/0, /*upper=*/4));
+ assertThat(match1.getSubmatch()).isEqualTo("Test");
assertThat(match1.getSnippetRange()).isEqualTo(
new SearchResult.MatchRange(/*lower=*/0, /*upper=*/9));
assertThat(match1.getSnippet()).isEqualTo("Test Name");
@@ -274,6 +296,9 @@
assertThat(match2.getExactMatchRange()).isEqualTo(
new SearchResult.MatchRange(/*lower=*/0, /*upper=*/21));
assertThat(match2.getExactMatch()).isEqualTo("TestNameJr2@gmail.com");
+ assertThat(match2.getSubmatchRange()).isEqualTo(
+ new SearchResult.MatchRange(/*lower=*/0, /*upper=*/4));
+ assertThat(match2.getSubmatch()).isEqualTo("Test");
assertThat(match2.getSnippetRange()).isEqualTo(
new SearchResult.MatchRange(/*lower=*/0, /*upper=*/21));
assertThat(match2.getSnippet()).isEqualTo("TestNameJr2@gmail.com");
diff --git a/appsearch/local-storage/src/androidTest/java/androidx/appsearch/localstorage/stats/AppSearchStatsTest.java b/appsearch/appsearch-local-storage/src/androidTest/java/androidx/appsearch/localstorage/stats/AppSearchStatsTest.java
similarity index 100%
rename from appsearch/local-storage/src/androidTest/java/androidx/appsearch/localstorage/stats/AppSearchStatsTest.java
rename to appsearch/appsearch-local-storage/src/androidTest/java/androidx/appsearch/localstorage/stats/AppSearchStatsTest.java
diff --git a/appsearch/local-storage/src/main/AndroidManifest.xml b/appsearch/appsearch-local-storage/src/main/AndroidManifest.xml
similarity index 100%
rename from appsearch/local-storage/src/main/AndroidManifest.xml
rename to appsearch/appsearch-local-storage/src/main/AndroidManifest.xml
diff --git a/appsearch/local-storage/src/main/java/androidx/appsearch/localstorage/AppSearchImpl.java b/appsearch/appsearch-local-storage/src/main/java/androidx/appsearch/localstorage/AppSearchImpl.java
similarity index 100%
rename from appsearch/local-storage/src/main/java/androidx/appsearch/localstorage/AppSearchImpl.java
rename to appsearch/appsearch-local-storage/src/main/java/androidx/appsearch/localstorage/AppSearchImpl.java
diff --git a/appsearch/local-storage/src/main/java/androidx/appsearch/localstorage/AppSearchLogger.java b/appsearch/appsearch-local-storage/src/main/java/androidx/appsearch/localstorage/AppSearchLogger.java
similarity index 100%
rename from appsearch/local-storage/src/main/java/androidx/appsearch/localstorage/AppSearchLogger.java
rename to appsearch/appsearch-local-storage/src/main/java/androidx/appsearch/localstorage/AppSearchLogger.java
diff --git a/appsearch/local-storage/src/main/java/androidx/appsearch/localstorage/AppSearchLoggerHelper.java b/appsearch/appsearch-local-storage/src/main/java/androidx/appsearch/localstorage/AppSearchLoggerHelper.java
similarity index 100%
rename from appsearch/local-storage/src/main/java/androidx/appsearch/localstorage/AppSearchLoggerHelper.java
rename to appsearch/appsearch-local-storage/src/main/java/androidx/appsearch/localstorage/AppSearchLoggerHelper.java
diff --git a/appsearch/local-storage/src/main/java/androidx/appsearch/localstorage/AppSearchMigrationHelper.java b/appsearch/appsearch-local-storage/src/main/java/androidx/appsearch/localstorage/AppSearchMigrationHelper.java
similarity index 100%
rename from appsearch/local-storage/src/main/java/androidx/appsearch/localstorage/AppSearchMigrationHelper.java
rename to appsearch/appsearch-local-storage/src/main/java/androidx/appsearch/localstorage/AppSearchMigrationHelper.java
diff --git a/appsearch/local-storage/src/main/java/androidx/appsearch/localstorage/GlobalSearchSessionImpl.java b/appsearch/appsearch-local-storage/src/main/java/androidx/appsearch/localstorage/GlobalSearchSessionImpl.java
similarity index 100%
rename from appsearch/local-storage/src/main/java/androidx/appsearch/localstorage/GlobalSearchSessionImpl.java
rename to appsearch/appsearch-local-storage/src/main/java/androidx/appsearch/localstorage/GlobalSearchSessionImpl.java
diff --git a/appsearch/local-storage/src/main/java/androidx/appsearch/localstorage/JetpackOptimizeStrategy.java b/appsearch/appsearch-local-storage/src/main/java/androidx/appsearch/localstorage/JetpackOptimizeStrategy.java
similarity index 100%
rename from appsearch/local-storage/src/main/java/androidx/appsearch/localstorage/JetpackOptimizeStrategy.java
rename to appsearch/appsearch-local-storage/src/main/java/androidx/appsearch/localstorage/JetpackOptimizeStrategy.java
diff --git a/appsearch/local-storage/src/main/java/androidx/appsearch/localstorage/LimitConfig.java b/appsearch/appsearch-local-storage/src/main/java/androidx/appsearch/localstorage/LimitConfig.java
similarity index 100%
rename from appsearch/local-storage/src/main/java/androidx/appsearch/localstorage/LimitConfig.java
rename to appsearch/appsearch-local-storage/src/main/java/androidx/appsearch/localstorage/LimitConfig.java
diff --git a/appsearch/local-storage/src/main/java/androidx/appsearch/localstorage/LocalStorage.java b/appsearch/appsearch-local-storage/src/main/java/androidx/appsearch/localstorage/LocalStorage.java
similarity index 100%
rename from appsearch/local-storage/src/main/java/androidx/appsearch/localstorage/LocalStorage.java
rename to appsearch/appsearch-local-storage/src/main/java/androidx/appsearch/localstorage/LocalStorage.java
diff --git a/appsearch/local-storage/src/main/java/androidx/appsearch/localstorage/OptimizeStrategy.java b/appsearch/appsearch-local-storage/src/main/java/androidx/appsearch/localstorage/OptimizeStrategy.java
similarity index 100%
rename from appsearch/local-storage/src/main/java/androidx/appsearch/localstorage/OptimizeStrategy.java
rename to appsearch/appsearch-local-storage/src/main/java/androidx/appsearch/localstorage/OptimizeStrategy.java
diff --git a/appsearch/local-storage/src/main/java/androidx/appsearch/localstorage/SearchResultsImpl.java b/appsearch/appsearch-local-storage/src/main/java/androidx/appsearch/localstorage/SearchResultsImpl.java
similarity index 100%
rename from appsearch/local-storage/src/main/java/androidx/appsearch/localstorage/SearchResultsImpl.java
rename to appsearch/appsearch-local-storage/src/main/java/androidx/appsearch/localstorage/SearchResultsImpl.java
diff --git a/appsearch/local-storage/src/main/java/androidx/appsearch/localstorage/SearchSessionImpl.java b/appsearch/appsearch-local-storage/src/main/java/androidx/appsearch/localstorage/SearchSessionImpl.java
similarity index 100%
rename from appsearch/local-storage/src/main/java/androidx/appsearch/localstorage/SearchSessionImpl.java
rename to appsearch/appsearch-local-storage/src/main/java/androidx/appsearch/localstorage/SearchSessionImpl.java
diff --git a/appsearch/local-storage/src/main/java/androidx/appsearch/localstorage/UnlimitedLimitConfig.java b/appsearch/appsearch-local-storage/src/main/java/androidx/appsearch/localstorage/UnlimitedLimitConfig.java
similarity index 100%
rename from appsearch/local-storage/src/main/java/androidx/appsearch/localstorage/UnlimitedLimitConfig.java
rename to appsearch/appsearch-local-storage/src/main/java/androidx/appsearch/localstorage/UnlimitedLimitConfig.java
diff --git a/appsearch/local-storage/src/main/java/androidx/appsearch/localstorage/converter/GenericDocumentToProtoConverter.java b/appsearch/appsearch-local-storage/src/main/java/androidx/appsearch/localstorage/converter/GenericDocumentToProtoConverter.java
similarity index 100%
rename from appsearch/local-storage/src/main/java/androidx/appsearch/localstorage/converter/GenericDocumentToProtoConverter.java
rename to appsearch/appsearch-local-storage/src/main/java/androidx/appsearch/localstorage/converter/GenericDocumentToProtoConverter.java
diff --git a/appsearch/local-storage/src/main/java/androidx/appsearch/localstorage/converter/ResultCodeToProtoConverter.java b/appsearch/appsearch-local-storage/src/main/java/androidx/appsearch/localstorage/converter/ResultCodeToProtoConverter.java
similarity index 100%
rename from appsearch/local-storage/src/main/java/androidx/appsearch/localstorage/converter/ResultCodeToProtoConverter.java
rename to appsearch/appsearch-local-storage/src/main/java/androidx/appsearch/localstorage/converter/ResultCodeToProtoConverter.java
diff --git a/appsearch/local-storage/src/main/java/androidx/appsearch/localstorage/converter/SchemaToProtoConverter.java b/appsearch/appsearch-local-storage/src/main/java/androidx/appsearch/localstorage/converter/SchemaToProtoConverter.java
similarity index 100%
rename from appsearch/local-storage/src/main/java/androidx/appsearch/localstorage/converter/SchemaToProtoConverter.java
rename to appsearch/appsearch-local-storage/src/main/java/androidx/appsearch/localstorage/converter/SchemaToProtoConverter.java
diff --git a/appsearch/local-storage/src/main/java/androidx/appsearch/localstorage/converter/SearchResultToProtoConverter.java b/appsearch/appsearch-local-storage/src/main/java/androidx/appsearch/localstorage/converter/SearchResultToProtoConverter.java
similarity index 93%
rename from appsearch/local-storage/src/main/java/androidx/appsearch/localstorage/converter/SearchResultToProtoConverter.java
rename to appsearch/appsearch-local-storage/src/main/java/androidx/appsearch/localstorage/converter/SearchResultToProtoConverter.java
index b3da971..a1842e9 100644
--- a/appsearch/local-storage/src/main/java/androidx/appsearch/localstorage/converter/SearchResultToProtoConverter.java
+++ b/appsearch/appsearch-local-storage/src/main/java/androidx/appsearch/localstorage/converter/SearchResultToProtoConverter.java
@@ -122,12 +122,16 @@
private static SearchResult.MatchInfo toMatchInfo(
@NonNull SnippetMatchProto snippetMatchProto, @NonNull String propertyPath) {
+ int exactMatchPosition = snippetMatchProto.getExactMatchUtf16Position();
return new SearchResult.MatchInfo.Builder(propertyPath)
.setExactMatchRange(
new SearchResult.MatchRange(
- snippetMatchProto.getExactMatchUtf16Position(),
- snippetMatchProto.getExactMatchUtf16Position()
- + snippetMatchProto.getExactMatchUtf16Length()))
+ exactMatchPosition,
+ exactMatchPosition + snippetMatchProto.getExactMatchUtf16Length()))
+ .setSubmatchRange(
+ new SearchResult.MatchRange(
+ exactMatchPosition,
+ exactMatchPosition + snippetMatchProto.getSubmatchUtf16Length()))
.setSnippetRange(
new SearchResult.MatchRange(
snippetMatchProto.getWindowUtf16Position(),
diff --git a/appsearch/local-storage/src/main/java/androidx/appsearch/localstorage/converter/SearchSpecToProtoConverter.java b/appsearch/appsearch-local-storage/src/main/java/androidx/appsearch/localstorage/converter/SearchSpecToProtoConverter.java
similarity index 100%
rename from appsearch/local-storage/src/main/java/androidx/appsearch/localstorage/converter/SearchSpecToProtoConverter.java
rename to appsearch/appsearch-local-storage/src/main/java/androidx/appsearch/localstorage/converter/SearchSpecToProtoConverter.java
diff --git a/appsearch/local-storage/src/main/java/androidx/appsearch/localstorage/converter/SetSchemaResponseToProtoConverter.java b/appsearch/appsearch-local-storage/src/main/java/androidx/appsearch/localstorage/converter/SetSchemaResponseToProtoConverter.java
similarity index 100%
rename from appsearch/local-storage/src/main/java/androidx/appsearch/localstorage/converter/SetSchemaResponseToProtoConverter.java
rename to appsearch/appsearch-local-storage/src/main/java/androidx/appsearch/localstorage/converter/SetSchemaResponseToProtoConverter.java
diff --git a/appsearch/local-storage/src/main/java/androidx/appsearch/localstorage/converter/TypePropertyPathToProtoConverter.java b/appsearch/appsearch-local-storage/src/main/java/androidx/appsearch/localstorage/converter/TypePropertyPathToProtoConverter.java
similarity index 100%
rename from appsearch/local-storage/src/main/java/androidx/appsearch/localstorage/converter/TypePropertyPathToProtoConverter.java
rename to appsearch/appsearch-local-storage/src/main/java/androidx/appsearch/localstorage/converter/TypePropertyPathToProtoConverter.java
diff --git a/appsearch/local-storage/src/main/java/androidx/appsearch/localstorage/stats/CallStats.java b/appsearch/appsearch-local-storage/src/main/java/androidx/appsearch/localstorage/stats/CallStats.java
similarity index 100%
rename from appsearch/local-storage/src/main/java/androidx/appsearch/localstorage/stats/CallStats.java
rename to appsearch/appsearch-local-storage/src/main/java/androidx/appsearch/localstorage/stats/CallStats.java
diff --git a/appsearch/local-storage/src/main/java/androidx/appsearch/localstorage/stats/InitializeStats.java b/appsearch/appsearch-local-storage/src/main/java/androidx/appsearch/localstorage/stats/InitializeStats.java
similarity index 100%
rename from appsearch/local-storage/src/main/java/androidx/appsearch/localstorage/stats/InitializeStats.java
rename to appsearch/appsearch-local-storage/src/main/java/androidx/appsearch/localstorage/stats/InitializeStats.java
diff --git a/appsearch/local-storage/src/main/java/androidx/appsearch/localstorage/stats/OptimizeStats.java b/appsearch/appsearch-local-storage/src/main/java/androidx/appsearch/localstorage/stats/OptimizeStats.java
similarity index 100%
rename from appsearch/local-storage/src/main/java/androidx/appsearch/localstorage/stats/OptimizeStats.java
rename to appsearch/appsearch-local-storage/src/main/java/androidx/appsearch/localstorage/stats/OptimizeStats.java
diff --git a/appsearch/local-storage/src/main/java/androidx/appsearch/localstorage/stats/PutDocumentStats.java b/appsearch/appsearch-local-storage/src/main/java/androidx/appsearch/localstorage/stats/PutDocumentStats.java
similarity index 100%
rename from appsearch/local-storage/src/main/java/androidx/appsearch/localstorage/stats/PutDocumentStats.java
rename to appsearch/appsearch-local-storage/src/main/java/androidx/appsearch/localstorage/stats/PutDocumentStats.java
diff --git a/appsearch/local-storage/src/main/java/androidx/appsearch/localstorage/stats/RemoveStats.java b/appsearch/appsearch-local-storage/src/main/java/androidx/appsearch/localstorage/stats/RemoveStats.java
similarity index 100%
rename from appsearch/local-storage/src/main/java/androidx/appsearch/localstorage/stats/RemoveStats.java
rename to appsearch/appsearch-local-storage/src/main/java/androidx/appsearch/localstorage/stats/RemoveStats.java
diff --git a/appsearch/local-storage/src/main/java/androidx/appsearch/localstorage/stats/SchemaMigrationStats.java b/appsearch/appsearch-local-storage/src/main/java/androidx/appsearch/localstorage/stats/SchemaMigrationStats.java
similarity index 100%
rename from appsearch/local-storage/src/main/java/androidx/appsearch/localstorage/stats/SchemaMigrationStats.java
rename to appsearch/appsearch-local-storage/src/main/java/androidx/appsearch/localstorage/stats/SchemaMigrationStats.java
diff --git a/appsearch/local-storage/src/main/java/androidx/appsearch/localstorage/stats/SearchStats.java b/appsearch/appsearch-local-storage/src/main/java/androidx/appsearch/localstorage/stats/SearchStats.java
similarity index 100%
rename from appsearch/local-storage/src/main/java/androidx/appsearch/localstorage/stats/SearchStats.java
rename to appsearch/appsearch-local-storage/src/main/java/androidx/appsearch/localstorage/stats/SearchStats.java
diff --git a/appsearch/local-storage/src/main/java/androidx/appsearch/localstorage/stats/SetSchemaStats.java b/appsearch/appsearch-local-storage/src/main/java/androidx/appsearch/localstorage/stats/SetSchemaStats.java
similarity index 100%
rename from appsearch/local-storage/src/main/java/androidx/appsearch/localstorage/stats/SetSchemaStats.java
rename to appsearch/appsearch-local-storage/src/main/java/androidx/appsearch/localstorage/stats/SetSchemaStats.java
diff --git a/appsearch/local-storage/src/main/java/androidx/appsearch/localstorage/util/FutureUtil.java b/appsearch/appsearch-local-storage/src/main/java/androidx/appsearch/localstorage/util/FutureUtil.java
similarity index 100%
rename from appsearch/local-storage/src/main/java/androidx/appsearch/localstorage/util/FutureUtil.java
rename to appsearch/appsearch-local-storage/src/main/java/androidx/appsearch/localstorage/util/FutureUtil.java
diff --git a/appsearch/local-storage/src/main/java/androidx/appsearch/localstorage/util/PrefixUtil.java b/appsearch/appsearch-local-storage/src/main/java/androidx/appsearch/localstorage/util/PrefixUtil.java
similarity index 100%
rename from appsearch/local-storage/src/main/java/androidx/appsearch/localstorage/util/PrefixUtil.java
rename to appsearch/appsearch-local-storage/src/main/java/androidx/appsearch/localstorage/util/PrefixUtil.java
diff --git a/appsearch/local-storage/src/main/java/androidx/appsearch/localstorage/visibilitystore/VisibilityStore.java b/appsearch/appsearch-local-storage/src/main/java/androidx/appsearch/localstorage/visibilitystore/VisibilityStore.java
similarity index 100%
rename from appsearch/local-storage/src/main/java/androidx/appsearch/localstorage/visibilitystore/VisibilityStore.java
rename to appsearch/appsearch-local-storage/src/main/java/androidx/appsearch/localstorage/visibilitystore/VisibilityStore.java
diff --git a/appsearch/platform-storage/api/current.txt b/appsearch/appsearch-platform-storage/api/current.txt
similarity index 100%
rename from appsearch/platform-storage/api/current.txt
rename to appsearch/appsearch-platform-storage/api/current.txt
diff --git a/appsearch/platform-storage/api/public_plus_experimental_current.txt b/appsearch/appsearch-platform-storage/api/public_plus_experimental_current.txt
similarity index 100%
rename from appsearch/platform-storage/api/public_plus_experimental_current.txt
rename to appsearch/appsearch-platform-storage/api/public_plus_experimental_current.txt
diff --git a/appsearch/platform-storage/api/res-current.txt b/appsearch/appsearch-platform-storage/api/res-current.txt
similarity index 100%
rename from appsearch/platform-storage/api/res-current.txt
rename to appsearch/appsearch-platform-storage/api/res-current.txt
diff --git a/appsearch/platform-storage/api/restricted_current.txt b/appsearch/appsearch-platform-storage/api/restricted_current.txt
similarity index 100%
rename from appsearch/platform-storage/api/restricted_current.txt
rename to appsearch/appsearch-platform-storage/api/restricted_current.txt
diff --git a/appsearch/platform-storage/build.gradle b/appsearch/appsearch-platform-storage/build.gradle
similarity index 100%
rename from appsearch/platform-storage/build.gradle
rename to appsearch/appsearch-platform-storage/build.gradle
diff --git a/appsearch/platform-storage/lint-baseline.xml b/appsearch/appsearch-platform-storage/lint-baseline.xml
similarity index 100%
rename from appsearch/platform-storage/lint-baseline.xml
rename to appsearch/appsearch-platform-storage/lint-baseline.xml
diff --git a/appsearch/platform-storage/src/androidTest/AndroidManifest.xml b/appsearch/appsearch-platform-storage/src/androidTest/AndroidManifest.xml
similarity index 100%
rename from appsearch/platform-storage/src/androidTest/AndroidManifest.xml
rename to appsearch/appsearch-platform-storage/src/androidTest/AndroidManifest.xml
diff --git a/appsearch/platform-storage/src/androidTest/java/androidx/appsearch/platformstorage/PlatformStorageTest.java b/appsearch/appsearch-platform-storage/src/androidTest/java/androidx/appsearch/platformstorage/PlatformStorageTest.java
similarity index 100%
rename from appsearch/platform-storage/src/androidTest/java/androidx/appsearch/platformstorage/PlatformStorageTest.java
rename to appsearch/appsearch-platform-storage/src/androidTest/java/androidx/appsearch/platformstorage/PlatformStorageTest.java
diff --git a/appsearch/platform-storage/src/main/AndroidManifest.xml b/appsearch/appsearch-platform-storage/src/main/AndroidManifest.xml
similarity index 100%
rename from appsearch/platform-storage/src/main/AndroidManifest.xml
rename to appsearch/appsearch-platform-storage/src/main/AndroidManifest.xml
diff --git a/appsearch/platform-storage/src/main/java/androidx/appsearch/platformstorage/GlobalSearchSessionImpl.java b/appsearch/appsearch-platform-storage/src/main/java/androidx/appsearch/platformstorage/GlobalSearchSessionImpl.java
similarity index 100%
rename from appsearch/platform-storage/src/main/java/androidx/appsearch/platformstorage/GlobalSearchSessionImpl.java
rename to appsearch/appsearch-platform-storage/src/main/java/androidx/appsearch/platformstorage/GlobalSearchSessionImpl.java
diff --git a/appsearch/platform-storage/src/main/java/androidx/appsearch/platformstorage/PlatformStorage.java b/appsearch/appsearch-platform-storage/src/main/java/androidx/appsearch/platformstorage/PlatformStorage.java
similarity index 100%
rename from appsearch/platform-storage/src/main/java/androidx/appsearch/platformstorage/PlatformStorage.java
rename to appsearch/appsearch-platform-storage/src/main/java/androidx/appsearch/platformstorage/PlatformStorage.java
diff --git a/appsearch/platform-storage/src/main/java/androidx/appsearch/platformstorage/SearchResultsImpl.java b/appsearch/appsearch-platform-storage/src/main/java/androidx/appsearch/platformstorage/SearchResultsImpl.java
similarity index 100%
rename from appsearch/platform-storage/src/main/java/androidx/appsearch/platformstorage/SearchResultsImpl.java
rename to appsearch/appsearch-platform-storage/src/main/java/androidx/appsearch/platformstorage/SearchResultsImpl.java
diff --git a/appsearch/platform-storage/src/main/java/androidx/appsearch/platformstorage/SearchSessionImpl.java b/appsearch/appsearch-platform-storage/src/main/java/androidx/appsearch/platformstorage/SearchSessionImpl.java
similarity index 100%
rename from appsearch/platform-storage/src/main/java/androidx/appsearch/platformstorage/SearchSessionImpl.java
rename to appsearch/appsearch-platform-storage/src/main/java/androidx/appsearch/platformstorage/SearchSessionImpl.java
diff --git a/appsearch/platform-storage/src/main/java/androidx/appsearch/platformstorage/converter/AppSearchResultToPlatformConverter.java b/appsearch/appsearch-platform-storage/src/main/java/androidx/appsearch/platformstorage/converter/AppSearchResultToPlatformConverter.java
similarity index 100%
rename from appsearch/platform-storage/src/main/java/androidx/appsearch/platformstorage/converter/AppSearchResultToPlatformConverter.java
rename to appsearch/appsearch-platform-storage/src/main/java/androidx/appsearch/platformstorage/converter/AppSearchResultToPlatformConverter.java
diff --git a/appsearch/platform-storage/src/main/java/androidx/appsearch/platformstorage/converter/GenericDocumentToPlatformConverter.java b/appsearch/appsearch-platform-storage/src/main/java/androidx/appsearch/platformstorage/converter/GenericDocumentToPlatformConverter.java
similarity index 100%
rename from appsearch/platform-storage/src/main/java/androidx/appsearch/platformstorage/converter/GenericDocumentToPlatformConverter.java
rename to appsearch/appsearch-platform-storage/src/main/java/androidx/appsearch/platformstorage/converter/GenericDocumentToPlatformConverter.java
diff --git a/appsearch/platform-storage/src/main/java/androidx/appsearch/platformstorage/converter/RequestToPlatformConverter.java b/appsearch/appsearch-platform-storage/src/main/java/androidx/appsearch/platformstorage/converter/RequestToPlatformConverter.java
similarity index 100%
rename from appsearch/platform-storage/src/main/java/androidx/appsearch/platformstorage/converter/RequestToPlatformConverter.java
rename to appsearch/appsearch-platform-storage/src/main/java/androidx/appsearch/platformstorage/converter/RequestToPlatformConverter.java
diff --git a/appsearch/platform-storage/src/main/java/androidx/appsearch/platformstorage/converter/ResponseToPlatformConverter.java b/appsearch/appsearch-platform-storage/src/main/java/androidx/appsearch/platformstorage/converter/ResponseToPlatformConverter.java
similarity index 100%
rename from appsearch/platform-storage/src/main/java/androidx/appsearch/platformstorage/converter/ResponseToPlatformConverter.java
rename to appsearch/appsearch-platform-storage/src/main/java/androidx/appsearch/platformstorage/converter/ResponseToPlatformConverter.java
diff --git a/appsearch/platform-storage/src/main/java/androidx/appsearch/platformstorage/converter/SchemaToPlatformConverter.java b/appsearch/appsearch-platform-storage/src/main/java/androidx/appsearch/platformstorage/converter/SchemaToPlatformConverter.java
similarity index 100%
rename from appsearch/platform-storage/src/main/java/androidx/appsearch/platformstorage/converter/SchemaToPlatformConverter.java
rename to appsearch/appsearch-platform-storage/src/main/java/androidx/appsearch/platformstorage/converter/SchemaToPlatformConverter.java
diff --git a/appsearch/platform-storage/src/main/java/androidx/appsearch/platformstorage/converter/SearchContextToPlatformConverter.java b/appsearch/appsearch-platform-storage/src/main/java/androidx/appsearch/platformstorage/converter/SearchContextToPlatformConverter.java
similarity index 100%
rename from appsearch/platform-storage/src/main/java/androidx/appsearch/platformstorage/converter/SearchContextToPlatformConverter.java
rename to appsearch/appsearch-platform-storage/src/main/java/androidx/appsearch/platformstorage/converter/SearchContextToPlatformConverter.java
diff --git a/appsearch/platform-storage/src/main/java/androidx/appsearch/platformstorage/converter/SearchResultToPlatformConverter.java b/appsearch/appsearch-platform-storage/src/main/java/androidx/appsearch/platformstorage/converter/SearchResultToPlatformConverter.java
similarity index 100%
rename from appsearch/platform-storage/src/main/java/androidx/appsearch/platformstorage/converter/SearchResultToPlatformConverter.java
rename to appsearch/appsearch-platform-storage/src/main/java/androidx/appsearch/platformstorage/converter/SearchResultToPlatformConverter.java
diff --git a/appsearch/platform-storage/src/main/java/androidx/appsearch/platformstorage/converter/SearchSpecToPlatformConverter.java b/appsearch/appsearch-platform-storage/src/main/java/androidx/appsearch/platformstorage/converter/SearchSpecToPlatformConverter.java
similarity index 100%
rename from appsearch/platform-storage/src/main/java/androidx/appsearch/platformstorage/converter/SearchSpecToPlatformConverter.java
rename to appsearch/appsearch-platform-storage/src/main/java/androidx/appsearch/platformstorage/converter/SearchSpecToPlatformConverter.java
diff --git a/appsearch/platform-storage/src/main/java/androidx/appsearch/platformstorage/converter/SetSchemaRequestToPlatformConverter.java b/appsearch/appsearch-platform-storage/src/main/java/androidx/appsearch/platformstorage/converter/SetSchemaRequestToPlatformConverter.java
similarity index 100%
rename from appsearch/platform-storage/src/main/java/androidx/appsearch/platformstorage/converter/SetSchemaRequestToPlatformConverter.java
rename to appsearch/appsearch-platform-storage/src/main/java/androidx/appsearch/platformstorage/converter/SetSchemaRequestToPlatformConverter.java
diff --git a/appsearch/platform-storage/src/main/java/androidx/appsearch/platformstorage/util/BatchResultCallbackAdapter.java b/appsearch/appsearch-platform-storage/src/main/java/androidx/appsearch/platformstorage/util/BatchResultCallbackAdapter.java
similarity index 100%
rename from appsearch/platform-storage/src/main/java/androidx/appsearch/platformstorage/util/BatchResultCallbackAdapter.java
rename to appsearch/appsearch-platform-storage/src/main/java/androidx/appsearch/platformstorage/util/BatchResultCallbackAdapter.java
diff --git a/appsearch/appsearch-test-util/build.gradle b/appsearch/appsearch-test-util/build.gradle
new file mode 100644
index 0000000..32abe05
--- /dev/null
+++ b/appsearch/appsearch-test-util/build.gradle
@@ -0,0 +1,45 @@
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * 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.
+ */
+import androidx.build.LibraryGroups
+import androidx.build.LibraryVersions
+import androidx.build.Publish
+
+plugins {
+ id('AndroidXPlugin')
+ id('com.android.library')
+}
+
+dependencies {
+ api('androidx.annotation:annotation:1.1.0')
+
+ implementation(project(":appsearch:appsearch"))
+ implementation(project(":appsearch:appsearch-local-storage"))
+ implementation(libs.truth)
+
+ androidTestImplementation(libs.testCore)
+ androidTestImplementation(libs.testRules)
+ androidTestImplementation(libs.truth)
+ androidTestImplementation("junit:junit:4.13")
+}
+
+androidx {
+ name = 'AppSearch Test Util'
+ publish = Publish.NONE
+ mavenGroup = LibraryGroups.APPSEARCH
+ mavenVersion = LibraryVersions.APPSEARCH
+ inceptionYear = '2021'
+ description = 'Test Utilities to be used by any test module for AppSearch'
+}
diff --git a/appsearch/appsearch-test-util/src/androidTest/AndroidManifest.xml b/appsearch/appsearch-test-util/src/androidTest/AndroidManifest.xml
new file mode 100644
index 0000000..36fe911c
--- /dev/null
+++ b/appsearch/appsearch-test-util/src/androidTest/AndroidManifest.xml
@@ -0,0 +1,18 @@
+<!--
+ Copyright (C) 2021 The Android Open Source Project
+
+ 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
+ -->
+
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="androidx.appsearch.testutil.test"></manifest>
\ No newline at end of file
diff --git a/appsearch/appsearch/src/androidTest/java/androidx/appsearch/app/AppSearchEmailTest.java b/appsearch/appsearch-test-util/src/androidTest/java/androidx/appsearch/testutil/AppSearchEmailTest.java
similarity index 95%
rename from appsearch/appsearch/src/androidTest/java/androidx/appsearch/app/AppSearchEmailTest.java
rename to appsearch/appsearch-test-util/src/androidTest/java/androidx/appsearch/testutil/AppSearchEmailTest.java
index ef88e46..c98c278 100644
--- a/appsearch/appsearch/src/androidTest/java/androidx/appsearch/app/AppSearchEmailTest.java
+++ b/appsearch/appsearch-test-util/src/androidTest/java/androidx/appsearch/testutil/AppSearchEmailTest.java
@@ -14,12 +14,10 @@
* limitations under the License.
*/
-package androidx.appsearch.app;
+package androidx.appsearch.testutil;
import static com.google.common.truth.Truth.assertThat;
-import androidx.appsearch.app.util.AppSearchEmail;
-
import org.junit.Test;
public class AppSearchEmailTest {
diff --git a/appsearch/appsearch-test-util/src/androidTest/java/androidx/appsearch/testutil/SimpleTestLoggerTest.java b/appsearch/appsearch-test-util/src/androidTest/java/androidx/appsearch/testutil/SimpleTestLoggerTest.java
new file mode 100644
index 0000000..c5514d5
--- /dev/null
+++ b/appsearch/appsearch-test-util/src/androidTest/java/androidx/appsearch/testutil/SimpleTestLoggerTest.java
@@ -0,0 +1,67 @@
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * 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.
+ */
+
+package androidx.appsearch.testutil;
+
+import static com.google.common.truth.Truth.assertThat;
+
+import androidx.appsearch.localstorage.stats.CallStats;
+import androidx.appsearch.localstorage.stats.InitializeStats;
+import androidx.appsearch.localstorage.stats.OptimizeStats;
+import androidx.appsearch.localstorage.stats.PutDocumentStats;
+import androidx.appsearch.localstorage.stats.RemoveStats;
+import androidx.appsearch.localstorage.stats.SearchStats;
+import androidx.appsearch.localstorage.stats.SetSchemaStats;
+
+import org.junit.Test;
+
+public class SimpleTestLoggerTest {
+ @Test
+ public void testLogger_fieldsAreNullByDefault() {
+ SimpleTestLogger logger = new SimpleTestLogger();
+
+ assertThat(logger.mCallStats).isNull();
+ assertThat(logger.mPutDocumentStats).isNull();
+ assertThat(logger.mInitializeStats).isNull();
+ assertThat(logger.mSearchStats).isNull();
+ assertThat(logger.mRemoveStats).isNull();
+ assertThat(logger.mOptimizeStats).isNull();
+ assertThat(logger.mSetSchemaStats).isNull();
+ }
+
+ @Test
+ public void testLogger_fieldsAreSetAfterLogging() {
+ SimpleTestLogger logger = new SimpleTestLogger();
+
+ logger.logStats(new CallStats.Builder().build());
+ logger.logStats(new PutDocumentStats.Builder("package", "db").build());
+ logger.logStats(new InitializeStats.Builder().build());
+ logger.logStats(
+ new SearchStats.Builder(SearchStats.VISIBILITY_SCOPE_UNKNOWN, "package").build());
+ logger.logStats(new RemoveStats.Builder("package", "db").build());
+ logger.logStats(new OptimizeStats.Builder().build());
+ logger.logStats(new SetSchemaStats.Builder("package", "db").build());
+
+
+ assertThat(logger.mCallStats).isNotNull();
+ assertThat(logger.mPutDocumentStats).isNotNull();
+ assertThat(logger.mInitializeStats).isNotNull();
+ assertThat(logger.mSearchStats).isNotNull();
+ assertThat(logger.mRemoveStats).isNotNull();
+ assertThat(logger.mOptimizeStats).isNotNull();
+ assertThat(logger.mSetSchemaStats).isNotNull();
+ }
+}
diff --git a/appsearch/appsearch-test-util/src/main/AndroidManifest.xml b/appsearch/appsearch-test-util/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..0c68288
--- /dev/null
+++ b/appsearch/appsearch-test-util/src/main/AndroidManifest.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright 2021 The Android Open Source Project
+
+ 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.
+ -->
+
+<manifest package="androidx.appsearch.testutil"/>
diff --git a/appsearch/appsearch/src/androidTest/java/androidx/appsearch/app/util/AppSearchEmail.java b/appsearch/appsearch-test-util/src/main/java/androidx/appsearch/testutil/AppSearchEmail.java
similarity index 97%
rename from appsearch/appsearch/src/androidTest/java/androidx/appsearch/app/util/AppSearchEmail.java
rename to appsearch/appsearch-test-util/src/main/java/androidx/appsearch/testutil/AppSearchEmail.java
index 651e6d3..5aec156 100644
--- a/appsearch/appsearch/src/androidTest/java/androidx/appsearch/app/util/AppSearchEmail.java
+++ b/appsearch/appsearch-test-util/src/main/java/androidx/appsearch/testutil/AppSearchEmail.java
@@ -14,10 +14,11 @@
* limitations under the License.
*/
-package androidx.appsearch.app.util;
+package androidx.appsearch.testutil;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
+import androidx.annotation.RestrictTo;
import androidx.appsearch.app.AppSearchSchema;
import androidx.appsearch.app.AppSearchSchema.PropertyConfig;
import androidx.appsearch.app.AppSearchSchema.StringPropertyConfig;
@@ -27,7 +28,10 @@
* Encapsulates a {@link GenericDocument} that represent an email.
*
* <p>This class is a higher level implement of {@link GenericDocument}.
+ *
+ * @hide
*/
+@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
public class AppSearchEmail extends GenericDocument {
/** The name of the schema type for {@link AppSearchEmail} documents.*/
public static final String SCHEMA_TYPE = "builtin:Email";
diff --git a/appsearch/appsearch-test-util/src/main/java/androidx/appsearch/testutil/AppSearchTestUtils.java b/appsearch/appsearch-test-util/src/main/java/androidx/appsearch/testutil/AppSearchTestUtils.java
new file mode 100644
index 0000000..f578822
--- /dev/null
+++ b/appsearch/appsearch-test-util/src/main/java/androidx/appsearch/testutil/AppSearchTestUtils.java
@@ -0,0 +1,115 @@
+/*
+ * Copyright 2020 The Android Open Source Project
+ *
+ * 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.
+ */
+
+package androidx.appsearch.testutil;
+
+import static com.google.common.truth.Truth.assertThat;
+import static com.google.common.truth.Truth.assertWithMessage;
+
+import androidx.annotation.NonNull;
+import androidx.annotation.RestrictTo;
+import androidx.appsearch.app.AppSearchBatchResult;
+import androidx.appsearch.app.AppSearchSession;
+import androidx.appsearch.app.GenericDocument;
+import androidx.appsearch.app.GetByDocumentIdRequest;
+import androidx.appsearch.app.SearchResult;
+import androidx.appsearch.app.SearchResults;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Set;
+import java.util.concurrent.Future;
+
+/**
+ * Class with helper functions for testing for AppSearch.
+ *
+ * @hide
+ */
+@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
+public class AppSearchTestUtils {
+ private AppSearchTestUtils() {
+ }
+
+ /** Checks batch result. */
+ @NonNull
+ public static <K, V> AppSearchBatchResult<K, V> checkIsBatchResultSuccess(
+ @NonNull Future<AppSearchBatchResult<K, V>> future) throws Exception {
+ AppSearchBatchResult<K, V> result = future.get();
+ assertWithMessage("AppSearchBatchResult not successful: " + result)
+ .that(result.isSuccess()).isTrue();
+ return result;
+ }
+
+ /** Gets documents from ids. */
+ @NonNull
+ public static List<GenericDocument> doGet(
+ @NonNull AppSearchSession session, @NonNull String namespace, @NonNull String... ids)
+ throws Exception {
+ AppSearchBatchResult<String, GenericDocument> result = checkIsBatchResultSuccess(
+ session.getByDocumentId(
+ new GetByDocumentIdRequest.Builder(namespace).addIds(ids).build()));
+ assertThat(result.getSuccesses()).hasSize(ids.length);
+ assertThat(result.getFailures()).isEmpty();
+ List<GenericDocument> list = new ArrayList<>(ids.length);
+ for (String id : ids) {
+ list.add(result.getSuccesses().get(id));
+ }
+ return list;
+ }
+
+ /** Gets documents from {@link GetByDocumentIdRequest}. */
+ @NonNull
+ public static List<GenericDocument> doGet(
+ @NonNull AppSearchSession session, @NonNull GetByDocumentIdRequest request)
+ throws Exception {
+ AppSearchBatchResult<String, GenericDocument> result = checkIsBatchResultSuccess(
+ session.getByDocumentId(request));
+ Set<String> ids = request.getIds();
+ assertThat(result.getSuccesses()).hasSize(ids.size());
+ assertThat(result.getFailures()).isEmpty();
+ List<GenericDocument> list = new ArrayList<>(ids.size());
+ for (String id : ids) {
+ list.add(result.getSuccesses().get(id));
+ }
+ return list;
+ }
+
+ /** Extracts documents from {@link SearchResults}. */
+ @NonNull
+ public static List<GenericDocument> convertSearchResultsToDocuments(
+ @NonNull SearchResults searchResults)
+ throws Exception {
+ List<SearchResult> results = retrieveAllSearchResults(searchResults);
+ List<GenericDocument> documents = new ArrayList<>(results.size());
+ for (SearchResult result : results) {
+ documents.add(result.getGenericDocument());
+ }
+ return documents;
+ }
+
+ /** Extracts all {@link SearchResult} from {@link SearchResults}. */
+ @NonNull
+ public static List<SearchResult> retrieveAllSearchResults(@NonNull SearchResults searchResults)
+ throws Exception {
+ List<SearchResult> page = searchResults.getNextPage().get();
+ List<SearchResult> results = new ArrayList<>();
+ while (!page.isEmpty()) {
+ results.addAll(page);
+ page = searchResults.getNextPage().get();
+ }
+ return results;
+ }
+}
diff --git a/appsearch/appsearch-test-util/src/main/java/androidx/appsearch/testutil/SimpleTestLogger.java b/appsearch/appsearch-test-util/src/main/java/androidx/appsearch/testutil/SimpleTestLogger.java
new file mode 100644
index 0000000..c2bc1f4
--- /dev/null
+++ b/appsearch/appsearch-test-util/src/main/java/androidx/appsearch/testutil/SimpleTestLogger.java
@@ -0,0 +1,94 @@
+/*
+ * Copyright 2020 The Android Open Source Project
+ *
+ * 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.
+ */
+
+package androidx.appsearch.testutil;
+
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+import androidx.annotation.RestrictTo;
+import androidx.appsearch.localstorage.AppSearchLogger;
+import androidx.appsearch.localstorage.stats.CallStats;
+import androidx.appsearch.localstorage.stats.InitializeStats;
+import androidx.appsearch.localstorage.stats.OptimizeStats;
+import androidx.appsearch.localstorage.stats.PutDocumentStats;
+import androidx.appsearch.localstorage.stats.RemoveStats;
+import androidx.appsearch.localstorage.stats.SearchStats;
+import androidx.appsearch.localstorage.stats.SetSchemaStats;
+
+/**
+ * Non-thread-safe simple logger implementation for testing.
+ *
+ * @hide
+ */
+@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
+public final class SimpleTestLogger implements AppSearchLogger {
+ /** Holds {@link CallStats} after logging. */
+ @Nullable
+ public CallStats mCallStats;
+ /** Holds {@link PutDocumentStats} after logging. */
+ @Nullable
+ public PutDocumentStats mPutDocumentStats;
+ /** Holds {@link InitializeStats} after logging. */
+ @Nullable
+ public InitializeStats mInitializeStats;
+ /** Holds {@link SearchStats} after logging. */
+ @Nullable
+ public SearchStats mSearchStats;
+ /** Holds {@link RemoveStats} after logging. */
+ @Nullable
+ public RemoveStats mRemoveStats;
+ /** Holds {@link OptimizeStats} after logging. */
+ @Nullable
+ public OptimizeStats mOptimizeStats;
+ /** Holds {@link SetSchemaStats} after logging. */
+ @Nullable
+ public SetSchemaStats mSetSchemaStats;
+
+ @Override
+ public void logStats(@NonNull CallStats stats) {
+ mCallStats = stats;
+ }
+
+ @Override
+ public void logStats(@NonNull PutDocumentStats stats) {
+ mPutDocumentStats = stats;
+ }
+
+ @Override
+ public void logStats(@NonNull InitializeStats stats) {
+ mInitializeStats = stats;
+ }
+
+ @Override
+ public void logStats(@NonNull SearchStats stats) {
+ mSearchStats = stats;
+ }
+
+ @Override
+ public void logStats(@NonNull RemoveStats stats) {
+ mRemoveStats = stats;
+ }
+
+ @Override
+ public void logStats(@NonNull OptimizeStats stats) {
+ mOptimizeStats = stats;
+ }
+
+ @Override
+ public void logStats(@NonNull SetSchemaStats stats) {
+ mSetSchemaStats = stats;
+ }
+}
diff --git a/appsearch/appsearch/api/current.txt b/appsearch/appsearch/api/current.txt
index b5282d0..d3583ab 100644
--- a/appsearch/appsearch/api/current.txt
+++ b/appsearch/appsearch/api/current.txt
@@ -365,6 +365,8 @@
method public String getPropertyPath();
method public CharSequence getSnippet();
method public androidx.appsearch.app.SearchResult.MatchRange getSnippetRange();
+ method public CharSequence getSubmatch();
+ method public androidx.appsearch.app.SearchResult.MatchRange getSubmatchRange();
}
public static final class SearchResult.MatchInfo.Builder {
@@ -372,6 +374,7 @@
method public androidx.appsearch.app.SearchResult.MatchInfo build();
method public androidx.appsearch.app.SearchResult.MatchInfo.Builder setExactMatchRange(androidx.appsearch.app.SearchResult.MatchRange);
method public androidx.appsearch.app.SearchResult.MatchInfo.Builder setSnippetRange(androidx.appsearch.app.SearchResult.MatchRange);
+ method public androidx.appsearch.app.SearchResult.MatchInfo.Builder setSubmatchRange(androidx.appsearch.app.SearchResult.MatchRange);
}
public static final class SearchResult.MatchRange {
diff --git a/appsearch/appsearch/api/public_plus_experimental_current.txt b/appsearch/appsearch/api/public_plus_experimental_current.txt
index b5282d0..d3583ab 100644
--- a/appsearch/appsearch/api/public_plus_experimental_current.txt
+++ b/appsearch/appsearch/api/public_plus_experimental_current.txt
@@ -365,6 +365,8 @@
method public String getPropertyPath();
method public CharSequence getSnippet();
method public androidx.appsearch.app.SearchResult.MatchRange getSnippetRange();
+ method public CharSequence getSubmatch();
+ method public androidx.appsearch.app.SearchResult.MatchRange getSubmatchRange();
}
public static final class SearchResult.MatchInfo.Builder {
@@ -372,6 +374,7 @@
method public androidx.appsearch.app.SearchResult.MatchInfo build();
method public androidx.appsearch.app.SearchResult.MatchInfo.Builder setExactMatchRange(androidx.appsearch.app.SearchResult.MatchRange);
method public androidx.appsearch.app.SearchResult.MatchInfo.Builder setSnippetRange(androidx.appsearch.app.SearchResult.MatchRange);
+ method public androidx.appsearch.app.SearchResult.MatchInfo.Builder setSubmatchRange(androidx.appsearch.app.SearchResult.MatchRange);
}
public static final class SearchResult.MatchRange {
diff --git a/appsearch/appsearch/api/restricted_current.txt b/appsearch/appsearch/api/restricted_current.txt
index b5282d0..d3583ab 100644
--- a/appsearch/appsearch/api/restricted_current.txt
+++ b/appsearch/appsearch/api/restricted_current.txt
@@ -365,6 +365,8 @@
method public String getPropertyPath();
method public CharSequence getSnippet();
method public androidx.appsearch.app.SearchResult.MatchRange getSnippetRange();
+ method public CharSequence getSubmatch();
+ method public androidx.appsearch.app.SearchResult.MatchRange getSubmatchRange();
}
public static final class SearchResult.MatchInfo.Builder {
@@ -372,6 +374,7 @@
method public androidx.appsearch.app.SearchResult.MatchInfo build();
method public androidx.appsearch.app.SearchResult.MatchInfo.Builder setExactMatchRange(androidx.appsearch.app.SearchResult.MatchRange);
method public androidx.appsearch.app.SearchResult.MatchInfo.Builder setSnippetRange(androidx.appsearch.app.SearchResult.MatchRange);
+ method public androidx.appsearch.app.SearchResult.MatchInfo.Builder setSubmatchRange(androidx.appsearch.app.SearchResult.MatchRange);
}
public static final class SearchResult.MatchRange {
diff --git a/appsearch/appsearch/build.gradle b/appsearch/appsearch/build.gradle
index 05033bec..e148fa3 100644
--- a/appsearch/appsearch/build.gradle
+++ b/appsearch/appsearch/build.gradle
@@ -38,6 +38,7 @@
androidTestAnnotationProcessor project(':appsearch:appsearch-compiler')
androidTestImplementation project(':appsearch:appsearch-local-storage')
androidTestImplementation project(':appsearch:appsearch-platform-storage')
+ androidTestImplementation project(':appsearch:appsearch-test-util')
androidTestImplementation(libs.testCore)
androidTestImplementation(libs.testRules)
androidTestImplementation(libs.truth)
diff --git a/appsearch/appsearch/src/androidTest/java/androidx/appsearch/app/AnnotationProcessorTestBase.java b/appsearch/appsearch/src/androidTest/java/androidx/appsearch/app/AnnotationProcessorTestBase.java
index 012565b..684e51f 100644
--- a/appsearch/appsearch/src/androidTest/java/androidx/appsearch/app/AnnotationProcessorTestBase.java
+++ b/appsearch/appsearch/src/androidTest/java/androidx/appsearch/app/AnnotationProcessorTestBase.java
@@ -18,14 +18,14 @@
import static androidx.appsearch.app.AppSearchSchema.StringPropertyConfig.INDEXING_TYPE_PREFIXES;
import static androidx.appsearch.app.AppSearchSchema.StringPropertyConfig.TOKENIZER_TYPE_PLAIN;
-import static androidx.appsearch.app.util.AppSearchTestUtils.checkIsBatchResultSuccess;
-import static androidx.appsearch.app.util.AppSearchTestUtils.convertSearchResultsToDocuments;
+import static androidx.appsearch.testutil.AppSearchTestUtils.checkIsBatchResultSuccess;
+import static androidx.appsearch.testutil.AppSearchTestUtils.convertSearchResultsToDocuments;
import static com.google.common.truth.Truth.assertThat;
import androidx.annotation.NonNull;
import androidx.appsearch.annotation.Document;
-import androidx.appsearch.app.util.AppSearchEmail;
+import androidx.appsearch.testutil.AppSearchEmail;
import com.google.common.util.concurrent.ListenableFuture;
diff --git a/appsearch/appsearch/src/androidTest/java/androidx/appsearch/app/util/AppSearchTestUtils.java b/appsearch/appsearch/src/androidTest/java/androidx/appsearch/app/util/AppSearchTestUtils.java
deleted file mode 100644
index 1d25d24..0000000
--- a/appsearch/appsearch/src/androidTest/java/androidx/appsearch/app/util/AppSearchTestUtils.java
+++ /dev/null
@@ -1,154 +0,0 @@
-/*
- * Copyright 2020 The Android Open Source Project
- *
- * 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.
- */
-
-package androidx.appsearch.app.util;
-
-import static com.google.common.truth.Truth.assertThat;
-import static com.google.common.truth.Truth.assertWithMessage;
-
-import androidx.annotation.NonNull;
-import androidx.annotation.Nullable;
-import androidx.appsearch.app.AppSearchBatchResult;
-import androidx.appsearch.app.AppSearchSession;
-import androidx.appsearch.app.GenericDocument;
-import androidx.appsearch.app.GetByDocumentIdRequest;
-import androidx.appsearch.app.SearchResult;
-import androidx.appsearch.app.SearchResults;
-import androidx.appsearch.localstorage.AppSearchLogger;
-import androidx.appsearch.localstorage.stats.CallStats;
-import androidx.appsearch.localstorage.stats.InitializeStats;
-import androidx.appsearch.localstorage.stats.OptimizeStats;
-import androidx.appsearch.localstorage.stats.PutDocumentStats;
-import androidx.appsearch.localstorage.stats.RemoveStats;
-import androidx.appsearch.localstorage.stats.SearchStats;
-import androidx.appsearch.localstorage.stats.SetSchemaStats;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Set;
-import java.util.concurrent.Future;
-
-public class AppSearchTestUtils {
- // Non-thread-safe logger implementation for testing
- public static class TestLogger implements AppSearchLogger {
- @Nullable
- public CallStats mCallStats;
- @Nullable
- public PutDocumentStats mPutDocumentStats;
- @Nullable
- public InitializeStats mInitializeStats;
- @Nullable
- public SearchStats mSearchStats;
- @Nullable
- public RemoveStats mRemoveStats;
- @Nullable
- public OptimizeStats mOptimizeStats;
- @Nullable
- public SetSchemaStats mSetSchemaStats;
-
- @Override
- public void logStats(@NonNull CallStats stats) {
- mCallStats = stats;
- }
-
- @Override
- public void logStats(@NonNull PutDocumentStats stats) {
- mPutDocumentStats = stats;
- }
-
- @Override
- public void logStats(@NonNull InitializeStats stats) {
- mInitializeStats = stats;
- }
-
- @Override
- public void logStats(@NonNull SearchStats stats) {
- mSearchStats = stats;
- }
-
- @Override
- public void logStats(@NonNull RemoveStats stats) {
- mRemoveStats = stats;
- }
-
- @Override
- public void logStats(@NonNull OptimizeStats stats) {
- mOptimizeStats = stats;
- }
-
- @Override
- public void logStats(@NonNull SetSchemaStats stats) {
- mSetSchemaStats = stats;
- }
- }
-
- public static <K, V> AppSearchBatchResult<K, V> checkIsBatchResultSuccess(
- Future<AppSearchBatchResult<K, V>> future) throws Exception {
- AppSearchBatchResult<K, V> result = future.get();
- assertWithMessage("AppSearchBatchResult not successful: " + result)
- .that(result.isSuccess()).isTrue();
- return result;
- }
-
- public static List<GenericDocument> doGet(
- AppSearchSession session, String namespace, String... ids) throws Exception {
- AppSearchBatchResult<String, GenericDocument> result = checkIsBatchResultSuccess(
- session.getByDocumentId(
- new GetByDocumentIdRequest.Builder(namespace).addIds(ids).build()));
- assertThat(result.getSuccesses()).hasSize(ids.length);
- assertThat(result.getFailures()).isEmpty();
- List<GenericDocument> list = new ArrayList<>(ids.length);
- for (String id : ids) {
- list.add(result.getSuccesses().get(id));
- }
- return list;
- }
-
- public static List<GenericDocument> doGet(
- AppSearchSession session, GetByDocumentIdRequest request) throws Exception {
- AppSearchBatchResult<String, GenericDocument> result = checkIsBatchResultSuccess(
- session.getByDocumentId(request));
- Set<String> ids = request.getIds();
- assertThat(result.getSuccesses()).hasSize(ids.size());
- assertThat(result.getFailures()).isEmpty();
- List<GenericDocument> list = new ArrayList<>(ids.size());
- for (String id : ids) {
- list.add(result.getSuccesses().get(id));
- }
- return list;
- }
-
- public static List<GenericDocument> convertSearchResultsToDocuments(SearchResults searchResults)
- throws Exception {
- List<SearchResult> results = retrieveAllSearchResults(searchResults);
- List<GenericDocument> documents = new ArrayList<>(results.size());
- for (SearchResult result : results) {
- documents.add(result.getGenericDocument());
- }
- return documents;
- }
-
- public static List<SearchResult> retrieveAllSearchResults(SearchResults searchResults)
- throws Exception {
- List<SearchResult> page = searchResults.getNextPage().get();
- List<SearchResult> results = new ArrayList<>();
- while (!page.isEmpty()) {
- results.addAll(page);
- page = searchResults.getNextPage().get();
- }
- return results;
- }
-}
diff --git a/appsearch/appsearch/src/androidTest/java/androidx/appsearch/cts/app/AppSearchSchemaCtsTest.java b/appsearch/appsearch/src/androidTest/java/androidx/appsearch/cts/app/AppSearchSchemaCtsTest.java
index 2ae353a..1417929 100644
--- a/appsearch/appsearch/src/androidTest/java/androidx/appsearch/cts/app/AppSearchSchemaCtsTest.java
+++ b/appsearch/appsearch/src/androidTest/java/androidx/appsearch/cts/app/AppSearchSchemaCtsTest.java
@@ -24,7 +24,7 @@
import androidx.appsearch.app.AppSearchSchema;
import androidx.appsearch.app.AppSearchSchema.PropertyConfig;
import androidx.appsearch.app.AppSearchSchema.StringPropertyConfig;
-import androidx.appsearch.app.util.AppSearchEmail;
+import androidx.appsearch.testutil.AppSearchEmail;
import org.junit.Test;
diff --git a/appsearch/appsearch/src/androidTest/java/androidx/appsearch/cts/app/AppSearchSchemaMigrationCtsTestBase.java b/appsearch/appsearch/src/androidTest/java/androidx/appsearch/cts/app/AppSearchSchemaMigrationCtsTestBase.java
index ddcae47..a980a60 100644
--- a/appsearch/appsearch/src/androidTest/java/androidx/appsearch/cts/app/AppSearchSchemaMigrationCtsTestBase.java
+++ b/appsearch/appsearch/src/androidTest/java/androidx/appsearch/cts/app/AppSearchSchemaMigrationCtsTestBase.java
@@ -17,9 +17,9 @@
package androidx.appsearch.cts.app;
import static androidx.appsearch.app.AppSearchResult.RESULT_NOT_FOUND;
-import static androidx.appsearch.app.util.AppSearchTestUtils.checkIsBatchResultSuccess;
-import static androidx.appsearch.app.util.AppSearchTestUtils.convertSearchResultsToDocuments;
-import static androidx.appsearch.app.util.AppSearchTestUtils.doGet;
+import static androidx.appsearch.testutil.AppSearchTestUtils.checkIsBatchResultSuccess;
+import static androidx.appsearch.testutil.AppSearchTestUtils.convertSearchResultsToDocuments;
+import static androidx.appsearch.testutil.AppSearchTestUtils.doGet;
import static com.google.common.truth.Truth.assertThat;
diff --git a/appsearch/appsearch/src/androidTest/java/androidx/appsearch/cts/app/AppSearchSessionCtsTestBase.java b/appsearch/appsearch/src/androidTest/java/androidx/appsearch/cts/app/AppSearchSessionCtsTestBase.java
index 325c432..06a54f0 100644
--- a/appsearch/appsearch/src/androidTest/java/androidx/appsearch/cts/app/AppSearchSessionCtsTestBase.java
+++ b/appsearch/appsearch/src/androidTest/java/androidx/appsearch/cts/app/AppSearchSessionCtsTestBase.java
@@ -16,12 +16,14 @@
package androidx.appsearch.cts.app;
+import static android.os.Build.VERSION_CODES;
+
import static androidx.appsearch.app.AppSearchResult.RESULT_INVALID_SCHEMA;
import static androidx.appsearch.app.AppSearchResult.RESULT_NOT_FOUND;
-import static androidx.appsearch.app.util.AppSearchTestUtils.checkIsBatchResultSuccess;
-import static androidx.appsearch.app.util.AppSearchTestUtils.convertSearchResultsToDocuments;
-import static androidx.appsearch.app.util.AppSearchTestUtils.doGet;
-import static androidx.appsearch.app.util.AppSearchTestUtils.retrieveAllSearchResults;
+import static androidx.appsearch.testutil.AppSearchTestUtils.checkIsBatchResultSuccess;
+import static androidx.appsearch.testutil.AppSearchTestUtils.convertSearchResultsToDocuments;
+import static androidx.appsearch.testutil.AppSearchTestUtils.doGet;
+import static androidx.appsearch.testutil.AppSearchTestUtils.retrieveAllSearchResults;
import static com.google.common.truth.Truth.assertThat;
@@ -47,9 +49,9 @@
import androidx.appsearch.app.SearchSpec;
import androidx.appsearch.app.SetSchemaRequest;
import androidx.appsearch.app.StorageInfo;
-import androidx.appsearch.app.util.AppSearchEmail;
import androidx.appsearch.cts.app.customer.EmailDocument;
import androidx.appsearch.exceptions.AppSearchException;
+import androidx.appsearch.testutil.AppSearchEmail;
import androidx.test.core.app.ApplicationProvider;
import com.google.common.collect.ImmutableList;
@@ -81,6 +83,9 @@
protected abstract ListenableFuture<AppSearchSession> createSearchSession(
@NonNull String dbName, @NonNull ExecutorService executor);
+ // Returns the Android version that the current instance of AppSearchSession is based on.
+ protected abstract int getAppSearchApiTarget();
+
@Before
public void setUp() throws Exception {
Context context = ApplicationProvider.getApplicationContext();
@@ -1860,7 +1865,7 @@
new PutDocumentsRequest.Builder().addGenericDocuments(document).build()));
// Query for the document
- SearchResults searchResults = mDb1.search("foo",
+ SearchResults searchResults = mDb1.search("fo",
new SearchSpec.Builder()
.addFilterSchemas("Generic")
.setSnippetCount(1)
@@ -1883,6 +1888,18 @@
assertThat(matchInfo.getSnippetRange()).isEqualTo(
new SearchResult.MatchRange(/*lower=*/26, /*upper=*/33));
assertThat(matchInfo.getSnippet()).isEqualTo("is foo.");
+
+ if (getAppSearchApiTarget() <= VERSION_CODES.S) {
+ // Submatch is not support on any backend that targets a platform S or lower.
+ assertThat(matchInfo.getSubmatchRange()).isEqualTo(
+ new SearchResult.MatchRange(/*lower=*/0, /*upper=*/0));
+ assertThat(matchInfo.getSubmatch().length()).isEqualTo(0);
+ } else {
+ // Submatch is enabled on any backend that targets a platform beyond S.
+ assertThat(matchInfo.getSubmatchRange()).isEqualTo(
+ new SearchResult.MatchRange(/*lower=*/29, /*upper=*/31));
+ assertThat(matchInfo.getSubmatch()).isEqualTo("fo");
+ }
}
@Test
@@ -2005,6 +2022,18 @@
assertThat(matchInfo.getExactMatchRange()).isEqualTo(
new SearchResult.MatchRange(/*lower=*/44, /*upper=*/45));
assertThat(matchInfo.getExactMatch()).isEqualTo("は");
+
+ if (getAppSearchApiTarget() <= VERSION_CODES.S) {
+ // Submatch is not support on any backend that targets a platform S or lower.
+ assertThat(matchInfo.getSubmatchRange()).isEqualTo(
+ new SearchResult.MatchRange(/*lower=*/0, /*upper=*/0));
+ assertThat(matchInfo.getSubmatch().length()).isEqualTo(0);
+ } else {
+ // Submatch is enabled on any backend that targets a platform beyond S.
+ assertThat(matchInfo.getSubmatchRange()).isEqualTo(
+ new SearchResult.MatchRange(/*lower=*/44, /*upper=*/45));
+ assertThat(matchInfo.getSubmatch()).isEqualTo("は");
+ }
}
@Test
diff --git a/appsearch/appsearch/src/androidTest/java/androidx/appsearch/cts/app/AppSearchSessionLocalCtsTest.java b/appsearch/appsearch/src/androidTest/java/androidx/appsearch/cts/app/AppSearchSessionLocalCtsTest.java
index 0a05aeb..f675483 100644
--- a/appsearch/appsearch/src/androidTest/java/androidx/appsearch/cts/app/AppSearchSessionLocalCtsTest.java
+++ b/appsearch/appsearch/src/androidTest/java/androidx/appsearch/cts/app/AppSearchSessionLocalCtsTest.java
@@ -16,8 +16,8 @@
// @exportToFramework:skipFile()
package androidx.appsearch.cts.app;
-import static androidx.appsearch.app.util.AppSearchTestUtils.checkIsBatchResultSuccess;
-import static androidx.appsearch.app.util.AppSearchTestUtils.convertSearchResultsToDocuments;
+import static androidx.appsearch.testutil.AppSearchTestUtils.checkIsBatchResultSuccess;
+import static androidx.appsearch.testutil.AppSearchTestUtils.convertSearchResultsToDocuments;
import static com.google.common.truth.Truth.assertThat;
@@ -26,17 +26,20 @@
import androidx.annotation.NonNull;
import androidx.appsearch.app.AppSearchBatchResult;
import androidx.appsearch.app.AppSearchResult;
+import androidx.appsearch.app.AppSearchSchema;
import androidx.appsearch.app.AppSearchSession;
import androidx.appsearch.app.GenericDocument;
+import androidx.appsearch.app.Migrator;
import androidx.appsearch.app.PutDocumentsRequest;
import androidx.appsearch.app.SearchResult;
import androidx.appsearch.app.SearchResults;
import androidx.appsearch.app.SearchSpec;
import androidx.appsearch.app.SetSchemaRequest;
-import androidx.appsearch.app.util.AppSearchEmail;
-import androidx.appsearch.app.util.AppSearchTestUtils;
import androidx.appsearch.localstorage.LocalStorage;
+import androidx.appsearch.localstorage.stats.SchemaMigrationStats;
import androidx.appsearch.localstorage.stats.SearchStats;
+import androidx.appsearch.testutil.AppSearchEmail;
+import androidx.appsearch.testutil.SimpleTestLogger;
import androidx.test.core.app.ApplicationProvider;
import com.google.common.util.concurrent.ListenableFuture;
@@ -64,11 +67,17 @@
.setWorkerExecutor(executor).build());
}
- // TODO(b/194207451) Following test can be moved to CtsTestBase if customized logger is
+ @Override
+ protected int getAppSearchApiTarget() {
+ // Any feature available in AppSearchSession is always available in the local backend.
+ return Integer.MAX_VALUE;
+ }
+
+ // TODO(b/194207451) This test can be moved to CtsTestBase if customized logger is
// supported for platform backend.
@Test
public void testLogger_searchStatsLogged_forEmptyFirstPage() throws Exception {
- AppSearchTestUtils.TestLogger logger = new AppSearchTestUtils.TestLogger();
+ SimpleTestLogger logger = new SimpleTestLogger();
Context context = ApplicationProvider.getApplicationContext();
AppSearchSession db2 = LocalStorage.createSearchSession(
new LocalStorage.SearchContext.Builder(context, DB_NAME_2)
@@ -123,9 +132,11 @@
0);
}
+ // TODO(b/194207451) This test can be moved to CtsTestBase if customized logger is
+ // supported for platform backend.
@Test
public void testLogger_searchStatsLogged_forNonEmptyFirstPage() throws Exception {
- AppSearchTestUtils.TestLogger logger = new AppSearchTestUtils.TestLogger();
+ SimpleTestLogger logger = new SimpleTestLogger();
Context context = ApplicationProvider.getApplicationContext();
AppSearchSession db2 = LocalStorage.createSearchSession(
new LocalStorage.SearchContext.Builder(context, DB_NAME_2)
@@ -180,9 +191,11 @@
2);
}
+ // TODO(b/194207451) This test can be moved to CtsTestBase if customized logger is
+ // supported for platform backend.
@Test
public void testLogger_searchStatsLogged_forEmptySecondPage() throws Exception {
- AppSearchTestUtils.TestLogger logger = new AppSearchTestUtils.TestLogger();
+ SimpleTestLogger logger = new SimpleTestLogger();
Context context = ApplicationProvider.getApplicationContext();
AppSearchSession db2 = LocalStorage.createSearchSession(
new LocalStorage.SearchContext.Builder(context, DB_NAME_2)
@@ -241,9 +254,11 @@
assertThat(logger.mSearchStats.getCurrentPageReturnedResultCount()).isEqualTo(0);
}
+ // TODO(b/194207451) This test can be moved to CtsTestBase if customized logger is
+ // supported for platform backend.
@Test
public void testLogger_searchStatsLogged_forNonEmptySecondPage() throws Exception {
- AppSearchTestUtils.TestLogger logger = new AppSearchTestUtils.TestLogger();
+ SimpleTestLogger logger = new SimpleTestLogger();
Context context = ApplicationProvider.getApplicationContext();
AppSearchSession db2 = LocalStorage.createSearchSession(
new LocalStorage.SearchContext.Builder(context, DB_NAME_2)
@@ -302,15 +317,124 @@
assertThat(logger.mSearchStats.getCurrentPageReturnedResultCount()).isEqualTo(1);
}
+ // TODO(b/194207451) This test can be moved to CtsTestBase if customized logger is
+ // supported for platform backend.
+ @Test
+ public void testSetSchemaStats_withoutSchemaMigration() throws Exception {
+ SimpleTestLogger logger = new SimpleTestLogger();
+ Context context = ApplicationProvider.getApplicationContext();
+ AppSearchSession db2 = LocalStorage.createSearchSession(
+ new LocalStorage.SearchContext.Builder(context, DB_NAME_2)
+ .setLogger(logger).build()).get();
+ AppSearchSchema appSearchSchema = new AppSearchSchema.Builder("testSchema")
+ .addProperty(new AppSearchSchema.StringPropertyConfig.Builder("subject")
+ .setCardinality(AppSearchSchema.PropertyConfig.CARDINALITY_REQUIRED)
+ .setIndexingType(
+ AppSearchSchema.StringPropertyConfig.INDEXING_TYPE_PREFIXES)
+ .setTokenizerType(AppSearchSchema.StringPropertyConfig.TOKENIZER_TYPE_PLAIN)
+ .build())
+ .build();
+
+ db2.setSchema(
+ new SetSchemaRequest.Builder().addSchemas(appSearchSchema).build()).get();
+
+ assertThat(logger.mSetSchemaStats).isNotNull();
+ assertThat(logger.mSetSchemaStats.getPackageName()).isEqualTo(context.getPackageName());
+ assertThat(logger.mSetSchemaStats.getDatabase()).isEqualTo(DB_NAME_2);
+ assertThat(logger.mSetSchemaStats.getSchemaMigrationStats()).isNull();
+ assertThat(logger.mSetSchemaStats.getNewTypeCount()).isEqualTo(1);
+ assertThat(logger.mSetSchemaStats.getDeletedTypeCount()).isEqualTo(0);
+ assertThat(logger.mSetSchemaStats.getIndexIncompatibleTypeChangeCount())
+ .isEqualTo(0);
+ assertThat(logger.mSetSchemaStats.getBackwardsIncompatibleTypeChangeCount())
+ .isEqualTo(0);
+ assertThat(logger.mSetSchemaStats.getCompatibleTypeChangeCount()).isEqualTo(0);
+ }
+
+ // TODO(b/194207451) This test can be moved to CtsTestBase if customized logger is
+ // supported for platform backend.
+ @Test
+ public void testSetSchemaStats_withSchemaMigration() throws Exception {
+ SimpleTestLogger logger = new SimpleTestLogger();
+ Context context = ApplicationProvider.getApplicationContext();
+ AppSearchSession db2 = LocalStorage.createSearchSession(
+ new LocalStorage.SearchContext.Builder(context, DB_NAME_2)
+ .setLogger(logger).build()).get();
+ AppSearchSchema schema = new AppSearchSchema.Builder("testSchema")
+ .addProperty(new AppSearchSchema.StringPropertyConfig.Builder("subject")
+ .setCardinality(AppSearchSchema.PropertyConfig.CARDINALITY_REQUIRED)
+ .setIndexingType(
+ AppSearchSchema.StringPropertyConfig.INDEXING_TYPE_PREFIXES)
+ .setTokenizerType(AppSearchSchema.StringPropertyConfig.TOKENIZER_TYPE_PLAIN)
+ .build())
+ .addProperty(new AppSearchSchema.StringPropertyConfig.Builder("To")
+ .setCardinality(AppSearchSchema.PropertyConfig.CARDINALITY_REQUIRED)
+ .setIndexingType(
+ AppSearchSchema.StringPropertyConfig.INDEXING_TYPE_PREFIXES)
+ .setTokenizerType(AppSearchSchema.StringPropertyConfig.TOKENIZER_TYPE_PLAIN)
+ .build())
+ .build();
+ AppSearchSchema newSchema = new AppSearchSchema.Builder("testSchema")
+ .addProperty(new AppSearchSchema.StringPropertyConfig.Builder("subject")
+ .setCardinality(AppSearchSchema.PropertyConfig.CARDINALITY_OPTIONAL)
+ .setIndexingType(
+ AppSearchSchema.StringPropertyConfig.INDEXING_TYPE_PREFIXES)
+ .setTokenizerType(AppSearchSchema.StringPropertyConfig.TOKENIZER_TYPE_PLAIN)
+ .build())
+ .build();
+ GenericDocument doc = new GenericDocument.Builder<>("namespace", "id", "testSchema")
+ .setPropertyString("subject", "testPut example")
+ .setPropertyString("To", "testTo example")
+ .build();
+ long documentCreationTime = 12345L;
+ Migrator migrator = new Migrator() {
+ @Override
+ public boolean shouldMigrate(int currentVersion, int finalVersion) {
+ return currentVersion != finalVersion;
+ }
+
+ @NonNull
+ @Override
+ public GenericDocument onUpgrade(int currentVersion, int finalVersion,
+ @NonNull GenericDocument document) {
+ return new GenericDocument.Builder<>(document.getNamespace(), document.getId(),
+ document.getSchemaType())
+ .setPropertyString("subject", "testPut example migrated")
+ .setCreationTimestampMillis(documentCreationTime)
+ .build();
+ }
+
+ @NonNull
+ @Override
+ public GenericDocument onDowngrade(int currentVersion, int finalVersion,
+ @NonNull GenericDocument document) {
+ throw new IllegalStateException("Downgrade should not be triggered for this test");
+ }
+ };
+
+ db2.setSchema(new SetSchemaRequest.Builder().addSchemas(
+ schema).setForceOverride(true).build()).get();
+ db2.put(new PutDocumentsRequest.Builder().addGenericDocuments(doc).build());
+ db2.setSchema(new SetSchemaRequest.Builder().addSchemas(newSchema)
+ .setMigrator("testSchema", migrator)
+ .setVersion(2) // upgrade version
+ .build()).get();
+
+ assertThat(logger.mSetSchemaStats).isNotNull();
+ assertThat(logger.mSetSchemaStats.getSchemaMigrationStats()).isNotNull();
+ SchemaMigrationStats schemaMigrationStats =
+ logger.mSetSchemaStats.getSchemaMigrationStats();
+ assertThat(schemaMigrationStats.getMigratedDocumentCount()).isEqualTo(1);
+ assertThat(schemaMigrationStats.getSavedDocumentCount()).isEqualTo(1);
+ }
+
// TODO(b/185441119) Following test can be moved to CtsTestBase if we fix the binder
// transaction limit in framework.
@Test
public void testPutLargeDocument() throws Exception {
Context context = ApplicationProvider.getApplicationContext();
- AppSearchTestUtils.TestLogger logger = new AppSearchTestUtils.TestLogger();
AppSearchSession db2 = LocalStorage.createSearchSession(
- new LocalStorage.SearchContext.Builder(context, DB_NAME_2)
- .setLogger(logger).build()).get();
+ new LocalStorage.SearchContext.Builder(context, DB_NAME_2).build()).get();
// Schema registration
db2.setSchema(
@@ -345,10 +469,8 @@
@Test
public void testPutLargeDocument_exceedLimit() throws Exception {
Context context = ApplicationProvider.getApplicationContext();
- AppSearchTestUtils.TestLogger logger = new AppSearchTestUtils.TestLogger();
AppSearchSession db2 = LocalStorage.createSearchSession(
- new LocalStorage.SearchContext.Builder(context, DB_NAME_2)
- .setLogger(logger).build()).get();
+ new LocalStorage.SearchContext.Builder(context, DB_NAME_2).build()).get();
// Schema registration
db2.setSchema(
diff --git a/appsearch/appsearch/src/androidTest/java/androidx/appsearch/cts/app/AppSearchSessionPlatformCtsTest.java b/appsearch/appsearch/src/androidTest/java/androidx/appsearch/cts/app/AppSearchSessionPlatformCtsTest.java
index f467c77..e3f4770 100644
--- a/appsearch/appsearch/src/androidTest/java/androidx/appsearch/cts/app/AppSearchSessionPlatformCtsTest.java
+++ b/appsearch/appsearch/src/androidTest/java/androidx/appsearch/cts/app/AppSearchSessionPlatformCtsTest.java
@@ -16,6 +16,8 @@
// @exportToFramework:skipFile()
package androidx.appsearch.cts.app;
+import static android.os.Build.VERSION;
+
import android.content.Context;
import android.os.Build;
@@ -46,4 +48,10 @@
new PlatformStorage.SearchContext.Builder(context, dbName)
.setWorkerExecutor(executor).build());
}
+
+ @Override
+ protected int getAppSearchApiTarget() {
+ // Feature availability in the platform backend depends on the device's API level.
+ return VERSION.SDK_INT;
+ }
}
diff --git a/appsearch/appsearch/src/androidTest/java/androidx/appsearch/cts/app/GlobalSearchSessionCtsTestBase.java b/appsearch/appsearch/src/androidTest/java/androidx/appsearch/cts/app/GlobalSearchSessionCtsTestBase.java
index 04a48dd..ad6fcb7 100644
--- a/appsearch/appsearch/src/androidTest/java/androidx/appsearch/cts/app/GlobalSearchSessionCtsTestBase.java
+++ b/appsearch/appsearch/src/androidTest/java/androidx/appsearch/cts/app/GlobalSearchSessionCtsTestBase.java
@@ -16,8 +16,8 @@
package androidx.appsearch.cts.app;
-import static androidx.appsearch.app.util.AppSearchTestUtils.checkIsBatchResultSuccess;
-import static androidx.appsearch.app.util.AppSearchTestUtils.convertSearchResultsToDocuments;
+import static androidx.appsearch.testutil.AppSearchTestUtils.checkIsBatchResultSuccess;
+import static androidx.appsearch.testutil.AppSearchTestUtils.convertSearchResultsToDocuments;
import static com.google.common.truth.Truth.assertThat;
@@ -38,8 +38,8 @@
import androidx.appsearch.app.SearchResults;
import androidx.appsearch.app.SearchSpec;
import androidx.appsearch.app.SetSchemaRequest;
-import androidx.appsearch.app.util.AppSearchEmail;
import androidx.appsearch.exceptions.AppSearchException;
+import androidx.appsearch.testutil.AppSearchEmail;
import androidx.test.core.app.ApplicationProvider;
import com.google.common.collect.ImmutableList;
diff --git a/appsearch/appsearch/src/androidTest/java/androidx/appsearch/cts/app/GlobalSearchSessionLocalCtsTest.java b/appsearch/appsearch/src/androidTest/java/androidx/appsearch/cts/app/GlobalSearchSessionLocalCtsTest.java
index eedb926..07fb993 100644
--- a/appsearch/appsearch/src/androidTest/java/androidx/appsearch/cts/app/GlobalSearchSessionLocalCtsTest.java
+++ b/appsearch/appsearch/src/androidTest/java/androidx/appsearch/cts/app/GlobalSearchSessionLocalCtsTest.java
@@ -16,7 +16,7 @@
// @exportToFramework:skipFile()
package androidx.appsearch.cts.app;
-import static androidx.appsearch.app.util.AppSearchTestUtils.checkIsBatchResultSuccess;
+import static androidx.appsearch.testutil.AppSearchTestUtils.checkIsBatchResultSuccess;
import static com.google.common.truth.Truth.assertThat;
@@ -31,10 +31,10 @@
import androidx.appsearch.app.SearchResults;
import androidx.appsearch.app.SearchSpec;
import androidx.appsearch.app.SetSchemaRequest;
-import androidx.appsearch.app.util.AppSearchEmail;
-import androidx.appsearch.app.util.AppSearchTestUtils;
import androidx.appsearch.localstorage.LocalStorage;
import androidx.appsearch.localstorage.stats.SearchStats;
+import androidx.appsearch.testutil.AppSearchEmail;
+import androidx.appsearch.testutil.SimpleTestLogger;
import androidx.test.core.app.ApplicationProvider;
import com.google.common.util.concurrent.ListenableFuture;
@@ -58,12 +58,11 @@
new LocalStorage.GlobalSearchContext.Builder(context).build());
}
- // TODO(b/194207451) Following tests can be moved to CtsTestBase if customized logger is
+ // TODO(b/194207451) This test can be moved to CtsTestBase if customized logger is
// supported for platform backend.
@Test
public void testLogger_searchStatsLogged_forEmptyFirstPage() throws Exception {
- AppSearchTestUtils.TestLogger logger =
- new AppSearchTestUtils.TestLogger();
+ SimpleTestLogger logger = new SimpleTestLogger();
Context context = ApplicationProvider.getApplicationContext();
AppSearchSession db2 = LocalStorage.createSearchSession(
new LocalStorage.SearchContext.Builder(context, DB_NAME_2)
@@ -120,10 +119,11 @@
assertThat(logger.mSearchStats.getCurrentPageReturnedResultCount()).isEqualTo(0);
}
+ // TODO(b/194207451) This test can be moved to CtsTestBase if customized logger is
+ // supported for platform backend.
@Test
public void testLogger_searchStatsLogged_forNonEmptyFirstPage() throws Exception {
- AppSearchTestUtils.TestLogger logger =
- new AppSearchTestUtils.TestLogger();
+ SimpleTestLogger logger = new SimpleTestLogger();
Context context = ApplicationProvider.getApplicationContext();
AppSearchSession db2 = LocalStorage.createSearchSession(
new LocalStorage.SearchContext.Builder(context, DB_NAME_2)
@@ -180,10 +180,11 @@
assertThat(logger.mSearchStats.getCurrentPageReturnedResultCount()).isEqualTo(1);
}
+ // TODO(b/194207451) This test can be moved to CtsTestBase if customized logger is
+ // supported for platform backend.
@Test
public void testLogger_searchStatsLogged_forEmptySecondPage() throws Exception {
- AppSearchTestUtils.TestLogger logger =
- new AppSearchTestUtils.TestLogger();
+ SimpleTestLogger logger = new SimpleTestLogger();
Context context = ApplicationProvider.getApplicationContext();
AppSearchSession db2 = LocalStorage.createSearchSession(
new LocalStorage.SearchContext.Builder(context, DB_NAME_2)
@@ -245,10 +246,11 @@
assertThat(logger.mSearchStats.getCurrentPageReturnedResultCount()).isEqualTo(0);
}
+ // TODO(b/194207451) This test can be moved to CtsTestBase if customized logger is
+ // supported for platform backend.
@Test
public void testLogger_searchStatsLogged_forNonEmptySecondPage() throws Exception {
- AppSearchTestUtils.TestLogger logger =
- new AppSearchTestUtils.TestLogger();
+ SimpleTestLogger logger = new SimpleTestLogger();
Context context = ApplicationProvider.getApplicationContext();
AppSearchSession db2 = LocalStorage.createSearchSession(
new LocalStorage.SearchContext.Builder(context, DB_NAME_2)
diff --git a/appsearch/appsearch/src/androidTest/java/androidx/appsearch/cts/app/PutDocumentsRequestCtsTest.java b/appsearch/appsearch/src/androidTest/java/androidx/appsearch/cts/app/PutDocumentsRequestCtsTest.java
index 7753e15..372a090 100644
--- a/appsearch/appsearch/src/androidTest/java/androidx/appsearch/cts/app/PutDocumentsRequestCtsTest.java
+++ b/appsearch/appsearch/src/androidTest/java/androidx/appsearch/cts/app/PutDocumentsRequestCtsTest.java
@@ -26,8 +26,8 @@
import androidx.appsearch.app.AppSearchSession;
import androidx.appsearch.app.PutDocumentsRequest;
import androidx.appsearch.app.SetSchemaRequest;
-import androidx.appsearch.app.util.AppSearchEmail;
import androidx.appsearch.localstorage.LocalStorage;
+import androidx.appsearch.testutil.AppSearchEmail;
import androidx.test.core.app.ApplicationProvider;
import com.google.common.collect.ImmutableSet;
diff --git a/appsearch/appsearch/src/androidTest/java/androidx/appsearch/cts/app/SearchResultCtsTest.java b/appsearch/appsearch/src/androidTest/java/androidx/appsearch/cts/app/SearchResultCtsTest.java
index ea3efe8..2db5a7a 100644
--- a/appsearch/appsearch/src/androidTest/java/androidx/appsearch/cts/app/SearchResultCtsTest.java
+++ b/appsearch/appsearch/src/androidTest/java/androidx/appsearch/cts/app/SearchResultCtsTest.java
@@ -19,7 +19,7 @@
import static com.google.common.truth.Truth.assertThat;
import androidx.appsearch.app.SearchResult;
-import androidx.appsearch.app.util.AppSearchEmail;
+import androidx.appsearch.testutil.AppSearchEmail;
import org.junit.Test;
@@ -28,10 +28,12 @@
@Test
public void testBuildSearchResult() {
SearchResult.MatchRange exactMatchRange = new SearchResult.MatchRange(3, 8);
+ SearchResult.MatchRange submatchRange = new SearchResult.MatchRange(3, 5);
SearchResult.MatchRange snippetMatchRange = new SearchResult.MatchRange(1, 10);
SearchResult.MatchInfo matchInfo =
new SearchResult.MatchInfo.Builder("body")
.setExactMatchRange(exactMatchRange)
+ .setSubmatchRange(submatchRange)
.setSnippetRange(snippetMatchRange).build();
AppSearchEmail email = new AppSearchEmail.Builder("namespace1", "id1")
@@ -51,8 +53,10 @@
SearchResult.MatchInfo actualMatchInfo = searchResult.getMatchInfos().get(0);
assertThat(actualMatchInfo.getPropertyPath()).isEqualTo("body");
assertThat(actualMatchInfo.getExactMatchRange()).isEqualTo(exactMatchRange);
+ assertThat(actualMatchInfo.getSubmatchRange()).isEqualTo(submatchRange);
assertThat(actualMatchInfo.getSnippetRange()).isEqualTo(snippetMatchRange);
assertThat(actualMatchInfo.getExactMatch()).isEqualTo("lo Wo");
+ assertThat(actualMatchInfo.getSubmatch()).isEqualTo("lo");
assertThat(actualMatchInfo.getSnippet()).isEqualTo("ello Worl");
assertThat(actualMatchInfo.getFullText()).isEqualTo("Hello World.");
}
diff --git a/appsearch/appsearch/src/androidTest/java/androidx/appsearch/cts/app/SetSchemaRequestCtsTest.java b/appsearch/appsearch/src/androidTest/java/androidx/appsearch/cts/app/SetSchemaRequestCtsTest.java
index d00bf30..a965ef6 100644
--- a/appsearch/appsearch/src/androidTest/java/androidx/appsearch/cts/app/SetSchemaRequestCtsTest.java
+++ b/appsearch/appsearch/src/androidTest/java/androidx/appsearch/cts/app/SetSchemaRequestCtsTest.java
@@ -30,7 +30,7 @@
import androidx.appsearch.app.Migrator;
import androidx.appsearch.app.PackageIdentifier;
import androidx.appsearch.app.SetSchemaRequest;
-import androidx.appsearch.app.util.AppSearchEmail;
+import androidx.appsearch.testutil.AppSearchEmail;
import androidx.collection.ArrayMap;
import com.google.common.collect.ImmutableSet;
diff --git a/appsearch/appsearch/src/main/java/androidx/appsearch/app/SearchResult.java b/appsearch/appsearch/src/main/java/androidx/appsearch/app/SearchResult.java
index 0ce8f77..556c9b0 100644
--- a/appsearch/appsearch/src/main/java/androidx/appsearch/app/SearchResult.java
+++ b/appsearch/appsearch/src/main/java/androidx/appsearch/app/SearchResult.java
@@ -281,6 +281,8 @@
* nonsense word that’s used a lot is bar."
* <p>{@link MatchInfo#getExactMatchRange()} returns [29, 32]
* <p>{@link MatchInfo#getExactMatch()} returns "foo"
+ * <p>{@link MatchInfo#getSubmatchRange()} returns [29, 32]
+ * <p>{@link MatchInfo#getSubmatch()} returns "foo"
* <p>{@link MatchInfo#getSnippetRange()} returns [26, 33]
* <p>{@link MatchInfo#getSnippet()} returns "is foo."
* <p>
@@ -297,6 +299,8 @@
* <p>{@link MatchInfo#getFullText()} returns "Test Name Jr."
* <p>{@link MatchInfo#getExactMatchRange()} returns [0, 4]
* <p>{@link MatchInfo#getExactMatch()} returns "Test"
+ * <p>{@link MatchInfo#getSubmatchRange()} returns [0, 4]
+ * <p>{@link MatchInfo#getSubmatch()} returns "Test"
* <p>{@link MatchInfo#getSnippetRange()} returns [0, 9]
* <p>{@link MatchInfo#getSnippet()} returns "Test Name"
* <p> Match-2
@@ -304,6 +308,8 @@
* <p>{@link MatchInfo#getFullText()} returns "TestNameJr@gmail.com"
* <p>{@link MatchInfo#getExactMatchRange()} returns [0, 20]
* <p>{@link MatchInfo#getExactMatch()} returns "TestNameJr@gmail.com"
+ * <p>{@link MatchInfo#getSubmatchRange()} returns [0, 4]
+ * <p>{@link MatchInfo#getSubmatch()} returns "Test"
* <p>{@link MatchInfo#getSnippetRange()} returns [0, 20]
* <p>{@link MatchInfo#getSnippet()} returns "TestNameJr@gmail.com"
*/
@@ -312,6 +318,8 @@
private static final String PROPERTY_PATH_FIELD = "propertyPath";
private static final String EXACT_MATCH_RANGE_LOWER_FIELD = "exactMatchRangeLower";
private static final String EXACT_MATCH_RANGE_UPPER_FIELD = "exactMatchRangeUpper";
+ private static final String SUBMATCH_RANGE_LOWER_FIELD = "submatchRangeLower";
+ private static final String SUBMATCH_RANGE_UPPER_FIELD = "submatchRangeUpper";
private static final String SNIPPET_RANGE_LOWER_FIELD = "snippetRangeLower";
private static final String SNIPPET_RANGE_UPPER_FIELD = "snippetRangeUpper";
@@ -335,6 +343,13 @@
@Nullable
private MatchRange mExactMatchRange;
+ /**
+ * Range of property that corresponds to the subsequence of the exact match that directly
+ * matches a query term. Populated on first use.
+ */
+ @Nullable
+ private MatchRange mSubmatchRange;
+
/** Range of some reasonable amount of context around the query. Populated on first use. */
@Nullable
private MatchRange mWindowRange;
@@ -376,8 +391,10 @@
}
/**
- * Gets the exact {@link MatchRange} corresponding to the given entry.
- * <p>For class example 1 this returns [29, 32]
+ * Gets the {@link MatchRange} of the exact term of the given entry that matched the query.
+ * <p>Class example 1: this returns [29, 32].
+ * <p>Class example 2: for the first {@link MatchInfo}, this returns [0, 4] and, for the
+ * second {@link MatchInfo}, this returns [0, 20].
*/
@NonNull
public MatchRange getExactMatchRange() {
@@ -390,8 +407,10 @@
}
/**
- * Gets the {@link MatchRange} corresponding to the given entry.
- * <p>For class example 1 this returns "foo"
+ * Gets the exact term of the given entry that matched the query.
+ * <p>Class example 1: this returns "foo".
+ * <p>Class example 2: for the first {@link MatchInfo}, this returns "Test" and, for the
+ * second {@link MatchInfo}, this returns "TestNameJr@gmail.com".
*/
@NonNull
public CharSequence getExactMatch() {
@@ -399,10 +418,40 @@
}
/**
+ * Gets the {@link MatchRange} of the exact term subsequence of the given entry that matched
+ * the query.
+ * <p>Class example 1: this returns [29, 32].
+ * <p>Class example 2: for the first {@link MatchInfo}, this returns [0, 4] and, for the
+ * second {@link MatchInfo}, this returns [0, 4].
+ */
+ @NonNull
+ public MatchRange getSubmatchRange() {
+ if (mSubmatchRange == null) {
+ mSubmatchRange = new MatchRange(
+ mBundle.getInt(SUBMATCH_RANGE_LOWER_FIELD),
+ mBundle.getInt(SUBMATCH_RANGE_UPPER_FIELD));
+ }
+ return mSubmatchRange;
+ }
+
+ /**
+ * Gets the exact term subsequence of the given entry that matched the query.
+ * <p>Class example 1: this returns "foo".
+ * <p>Class example 2: for the first {@link MatchInfo}, this returns "Test" and, for the
+ * second {@link MatchInfo}, this returns "Test".
+ */
+ @NonNull
+ public CharSequence getSubmatch() {
+ return getSubstring(getSubmatchRange());
+ }
+
+ /**
* Gets the snippet {@link MatchRange} corresponding to the given entry.
* <p>Only populated when set maxSnippetSize > 0 in
* {@link SearchSpec.Builder#setMaxSnippetSize}.
- * <p>For class example 1 this returns [29, 41].
+ * <p>Class example 1: this returns [29, 41].
+ * <p>Class example 2: for the first {@link MatchInfo}, this returns [0, 9] and, for the
+ * second {@link MatchInfo}, this returns [0, 20].
*/
@NonNull
public MatchRange getSnippetRange() {
@@ -420,7 +469,9 @@
* maxSnippetSize > 0. The size of this content can be changed by
* {@link SearchSpec.Builder#setMaxSnippetSize}. Windowing is centered around the middle of
* the matched token with content on either side clipped to token boundaries.
- * <p>For class example 1 this returns "foo. Another"
+ * <p>Class example 1: this returns "foo. Another".
+ * <p>Class example 2: for the first {@link MatchInfo}, this returns "Test Name" and, for
+ * the second {@link MatchInfo}, this returns "TestNameJr@gmail.com".
*/
@NonNull
public CharSequence getSnippet() {
@@ -448,6 +499,7 @@
public static final class Builder {
private final String mPropertyPath;
private MatchRange mExactMatchRange = new MatchRange(0, 0);
+ private MatchRange mSubmatchRange = new MatchRange(0, 0);
private MatchRange mSnippetRange = new MatchRange(0, 0);
/**
@@ -474,6 +526,14 @@
return this;
}
+
+ /** Sets the submatch {@link MatchRange} corresponding to the given entry. */
+ @NonNull
+ public Builder setSubmatchRange(@NonNull MatchRange matchRange) {
+ mSubmatchRange = Preconditions.checkNotNull(matchRange);
+ return this;
+ }
+
/** Sets the snippet {@link MatchRange} corresponding to the given entry. */
@NonNull
public Builder setSnippetRange(@NonNull MatchRange matchRange) {
@@ -488,6 +548,8 @@
bundle.putString(SearchResult.MatchInfo.PROPERTY_PATH_FIELD, mPropertyPath);
bundle.putInt(MatchInfo.EXACT_MATCH_RANGE_LOWER_FIELD, mExactMatchRange.getStart());
bundle.putInt(MatchInfo.EXACT_MATCH_RANGE_UPPER_FIELD, mExactMatchRange.getEnd());
+ bundle.putInt(MatchInfo.SUBMATCH_RANGE_LOWER_FIELD, mSubmatchRange.getStart());
+ bundle.putInt(MatchInfo.SUBMATCH_RANGE_UPPER_FIELD, mSubmatchRange.getEnd());
bundle.putInt(MatchInfo.SNIPPET_RANGE_LOWER_FIELD, mSnippetRange.getStart());
bundle.putInt(MatchInfo.SNIPPET_RANGE_UPPER_FIELD, mSnippetRange.getEnd());
return new MatchInfo(bundle, /*document=*/ null);
diff --git a/appsearch/local-storage/src/androidTest/java/androidx/appsearch/localstorage/SearchSessionImplTest.java b/appsearch/local-storage/src/androidTest/java/androidx/appsearch/localstorage/SearchSessionImplTest.java
deleted file mode 100644
index 8e2e2bd..0000000
--- a/appsearch/local-storage/src/androidTest/java/androidx/appsearch/localstorage/SearchSessionImplTest.java
+++ /dev/null
@@ -1,157 +0,0 @@
-/*
- * Copyright 2021 The Android Open Source Project
- *
- * 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.
- */
-
-package androidx.appsearch.localstorage;
-
-import static com.google.common.truth.Truth.assertThat;
-
-import android.content.Context;
-
-import androidx.annotation.NonNull;
-import androidx.appsearch.app.AppSearchSchema;
-import androidx.appsearch.app.GenericDocument;
-import androidx.appsearch.app.Migrator;
-import androidx.appsearch.app.PutDocumentsRequest;
-import androidx.appsearch.app.SetSchemaRequest;
-import androidx.appsearch.localstorage.stats.SchemaMigrationStats;
-import androidx.test.core.app.ApplicationProvider;
-
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.rules.TemporaryFolder;
-
-// TODO(b/173532925): Move unit tests to cts tests when logger is available in framework.
-public class SearchSessionImplTest {
- private static final String PACKAGE_NAME = "packageName";
- private static final String DATABASE_NAME = "dbName";
- private static final long DOCUMENT_CREATION_TIME = 12345L;
- private static final OptimizeStrategy ALWAYS_OPTIMIZE = optimizeInfo -> true;
- @Rule
- public TemporaryFolder mTemporaryFolder = new TemporaryFolder();
- private AppSearchLoggerTest.TestLogger mAppSearchLogger;
- private SearchSessionImpl mSearchSessionImpl;
-
- @Before
- public void setUp() throws Exception {
- Context context = ApplicationProvider.getApplicationContext();
- LocalStorage.SearchContext searchContext =
- new LocalStorage.SearchContext.Builder(context, DATABASE_NAME).build();
- mAppSearchLogger = new AppSearchLoggerTest.TestLogger();
- AppSearchImpl appSearchImpl = AppSearchImpl.create(
- mTemporaryFolder.newFolder(),
- new UnlimitedLimitConfig(),
- /*initStatsBuilder=*/ null, ALWAYS_OPTIMIZE);
- mSearchSessionImpl = new SearchSessionImpl(appSearchImpl,
- searchContext.mExecutor, PACKAGE_NAME, DATABASE_NAME, mAppSearchLogger);
- }
-
- @Test
- public void testSetSchemaStats_withoutSchemaMigration() throws Exception {
- AppSearchSchema appSearchSchema = new AppSearchSchema.Builder("testSchema")
- .addProperty(new AppSearchSchema.StringPropertyConfig.Builder("subject")
- .setCardinality(AppSearchSchema.PropertyConfig.CARDINALITY_REQUIRED)
- .setIndexingType(
- AppSearchSchema.StringPropertyConfig.INDEXING_TYPE_PREFIXES)
- .setTokenizerType(AppSearchSchema.StringPropertyConfig.TOKENIZER_TYPE_PLAIN)
- .build())
- .build();
-
- mSearchSessionImpl.setSchema(
- new SetSchemaRequest.Builder().addSchemas(appSearchSchema).build()).get();
-
- assertThat(mAppSearchLogger.mSetSchemaStats).isNotNull();
- assertThat(mAppSearchLogger.mSetSchemaStats.getPackageName()).isEqualTo(PACKAGE_NAME);
- assertThat(mAppSearchLogger.mSetSchemaStats.getDatabase()).isEqualTo(DATABASE_NAME);
- assertThat(mAppSearchLogger.mSetSchemaStats.getSchemaMigrationStats()).isNull();
- assertThat(mAppSearchLogger.mSetSchemaStats.getNewTypeCount()).isEqualTo(1);
- assertThat(mAppSearchLogger.mSetSchemaStats.getDeletedTypeCount()).isEqualTo(0);
- assertThat(mAppSearchLogger.mSetSchemaStats.getIndexIncompatibleTypeChangeCount())
- .isEqualTo(0);
- assertThat(mAppSearchLogger.mSetSchemaStats.getBackwardsIncompatibleTypeChangeCount())
- .isEqualTo(0);
- assertThat(mAppSearchLogger.mSetSchemaStats.getCompatibleTypeChangeCount()).isEqualTo(0);
- }
-
- @Test
- public void testSetSchemaStats_withSchemaMigration() throws Exception {
- AppSearchSchema schema = new AppSearchSchema.Builder("testSchema")
- .addProperty(new AppSearchSchema.StringPropertyConfig.Builder("subject")
- .setCardinality(AppSearchSchema.PropertyConfig.CARDINALITY_REQUIRED)
- .setIndexingType(
- AppSearchSchema.StringPropertyConfig.INDEXING_TYPE_PREFIXES)
- .setTokenizerType(AppSearchSchema.StringPropertyConfig.TOKENIZER_TYPE_PLAIN)
- .build())
- .addProperty(new AppSearchSchema.StringPropertyConfig.Builder("To")
- .setCardinality(AppSearchSchema.PropertyConfig.CARDINALITY_REQUIRED)
- .setIndexingType(
- AppSearchSchema.StringPropertyConfig.INDEXING_TYPE_PREFIXES)
- .setTokenizerType(AppSearchSchema.StringPropertyConfig.TOKENIZER_TYPE_PLAIN)
- .build())
- .build();
- AppSearchSchema newSchema = new AppSearchSchema.Builder("testSchema")
- .addProperty(new AppSearchSchema.StringPropertyConfig.Builder("subject")
- .setCardinality(AppSearchSchema.PropertyConfig.CARDINALITY_OPTIONAL)
- .setIndexingType(
- AppSearchSchema.StringPropertyConfig.INDEXING_TYPE_PREFIXES)
- .setTokenizerType(AppSearchSchema.StringPropertyConfig.TOKENIZER_TYPE_PLAIN)
- .build())
- .build();
- GenericDocument doc = new GenericDocument.Builder<>("namespace", "id", "testSchema")
- .setPropertyString("subject", "testPut example")
- .setPropertyString("To", "testTo example")
- .build();
- Migrator migrator = new Migrator() {
- @Override
- public boolean shouldMigrate(int currentVersion, int finalVersion) {
- return currentVersion != finalVersion;
- }
-
- @NonNull
- @Override
- public GenericDocument onUpgrade(int currentVersion, int finalVersion,
- @NonNull GenericDocument document) {
- return new GenericDocument.Builder<>(document.getNamespace(), document.getId(),
- document.getSchemaType())
- .setPropertyString("subject", "testPut example migrated")
- .setCreationTimestampMillis(DOCUMENT_CREATION_TIME)
- .build();
- }
-
- @NonNull
- @Override
- public GenericDocument onDowngrade(int currentVersion, int finalVersion,
- @NonNull GenericDocument document) {
- throw new IllegalStateException("Downgrade should not be triggered for this test");
- }
- };
-
- mSearchSessionImpl.setSchema(new SetSchemaRequest.Builder().addSchemas(
- schema).setForceOverride(true).build()).get();
- mSearchSessionImpl.put(new PutDocumentsRequest.Builder().addGenericDocuments(doc).build());
- mSearchSessionImpl.setSchema(new SetSchemaRequest.Builder().addSchemas(newSchema)
- .setMigrator("testSchema", migrator)
- .setVersion(2) // upgrade version
- .build()).get();
-
- assertThat(mAppSearchLogger.mSetSchemaStats).isNotNull();
- assertThat(mAppSearchLogger.mSetSchemaStats.getSchemaMigrationStats()).isNotNull();
- SchemaMigrationStats schemaMigrationStats =
- mAppSearchLogger.mSetSchemaStats.getSchemaMigrationStats();
- assertThat(schemaMigrationStats.getMigratedDocumentCount()).isEqualTo(1);
- assertThat(schemaMigrationStats.getSavedDocumentCount()).isEqualTo(1);
- }
-}
diff --git a/benchmark/benchmark-common/api/current.txt b/benchmark/benchmark-common/api/current.txt
index 1874053..7410e3f 100644
--- a/benchmark/benchmark-common/api/current.txt
+++ b/benchmark/benchmark-common/api/current.txt
@@ -29,11 +29,27 @@
public static final class BenchmarkState.Companion {
}
+ public final class ConfigurationErrorKt {
+ }
+
public final class MetricNameUtilsKt {
}
public final class ProfilerKt {
}
+ public final class UserspaceTracingKt {
+ }
+
+}
+
+package androidx.benchmark.perfetto {
+
+ public final class PerfettoConfigKt {
+ }
+
+ public final class UiStateKt {
+ }
+
}
diff --git a/benchmark/benchmark-common/api/public_plus_experimental_current.txt b/benchmark/benchmark-common/api/public_plus_experimental_current.txt
index 39d1008..db914e9 100644
--- a/benchmark/benchmark-common/api/public_plus_experimental_current.txt
+++ b/benchmark/benchmark-common/api/public_plus_experimental_current.txt
@@ -34,11 +34,27 @@
@kotlin.Experimental @kotlin.annotation.Retention(kotlin.annotation.AnnotationRetention) @kotlin.annotation.Target(allowedTargets=kotlin.annotation.AnnotationTarget) public static @interface BenchmarkState.Companion.ExperimentalExternalReport {
}
+ public final class ConfigurationErrorKt {
+ }
+
public final class MetricNameUtilsKt {
}
public final class ProfilerKt {
}
+ public final class UserspaceTracingKt {
+ }
+
+}
+
+package androidx.benchmark.perfetto {
+
+ public final class PerfettoConfigKt {
+ }
+
+ public final class UiStateKt {
+ }
+
}
diff --git a/benchmark/benchmark-common/api/restricted_current.txt b/benchmark/benchmark-common/api/restricted_current.txt
index 39bcc5a..ac28e4c 100644
--- a/benchmark/benchmark-common/api/restricted_current.txt
+++ b/benchmark/benchmark-common/api/restricted_current.txt
@@ -31,11 +31,27 @@
public static final class BenchmarkState.Companion {
}
+ public final class ConfigurationErrorKt {
+ }
+
public final class MetricNameUtilsKt {
}
public final class ProfilerKt {
}
+ public final class UserspaceTracingKt {
+ }
+
+}
+
+package androidx.benchmark.perfetto {
+
+ public final class PerfettoConfigKt {
+ }
+
+ public final class UiStateKt {
+ }
+
}
diff --git a/benchmark/benchmark-common/build.gradle b/benchmark/benchmark-common/build.gradle
index 6d47166..97d492f 100644
--- a/benchmark/benchmark-common/build.gradle
+++ b/benchmark/benchmark-common/build.gradle
@@ -16,12 +16,47 @@
import androidx.build.LibraryGroups
import androidx.build.Publish
+import androidx.build.SupportConfigKt
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
id("AndroidXPlugin")
id("com.android.library")
id("kotlin-android")
+ id("com.squareup.wire")
+}
+
+android {
+ sourceSets {
+ main.assets.srcDirs += new File(
+ SupportConfigKt.getPrebuiltsRoot(project),
+ "androidx/traceprocessor/perfetto"
+ )
+ main.assets.srcDirs += new File(
+ SupportConfigKt.getPrebuiltsRoot(project),
+ "androidx/traceprocessor/traced"
+ )
+ main.assets.srcDirs += new File(
+ SupportConfigKt.getPrebuiltsRoot(project),
+ "androidx/traceprocessor/traced_probes"
+ )
+ androidTest.assets.srcDirs += new File(
+ SupportConfigKt.getPrebuiltsRoot(project),
+ "androidx/traceprocessor/testdata"
+ )
+ }
+}
+
+wire {
+ kotlin {}
+
+ // prune unused config components which have deprecated fields
+ prune 'perfetto.protos.TraceConfig.IncidentReportConfig'
+ prune 'perfetto.protos.ProcessStatsConfig.Quirks'
+
+ sourcePath {
+ srcDir 'src/main/proto'
+ }
}
dependencies {
@@ -30,6 +65,7 @@
api("androidx.annotation:annotation-experimental:1.0.0")
implementation("androidx.tracing:tracing-ktx:1.0.0")
implementation(libs.testMonitor)
+ implementation(libs.wireRuntime)
androidTestImplementation(libs.testRules)
androidTestImplementation(libs.testExtJunit)
diff --git a/benchmark/benchmark-common/src/androidTest/java/androidx/benchmark/BenchmarkStateTest.kt b/benchmark/benchmark-common/src/androidTest/java/androidx/benchmark/BenchmarkStateTest.kt
index f05047f..7698f60 100644
--- a/benchmark/benchmark-common/src/androidTest/java/androidx/benchmark/BenchmarkStateTest.kt
+++ b/benchmark/benchmark-common/src/androidTest/java/androidx/benchmark/BenchmarkStateTest.kt
@@ -209,11 +209,6 @@
// check attribute presence and naming
val prefix = Errors.PREFIX
- // legacy - before metric name was included
- assertNotNull(bundle.get("${prefix}min"))
- assertNotNull(bundle.get("${prefix}median"))
- assertNotNull(bundle.get("${prefix}standardDeviation"))
-
// including metric name
assertNotNull(bundle.get("${prefix}time_nanos_min"))
assertNotNull(bundle.get("${prefix}time_nanos_median"))
diff --git a/benchmark/benchmark-macro/src/androidTest/java/androidx/benchmark/macro/ConfigurationErrorTest.kt b/benchmark/benchmark-common/src/androidTest/java/androidx/benchmark/ConfigurationErrorTest.kt
similarity index 98%
rename from benchmark/benchmark-macro/src/androidTest/java/androidx/benchmark/macro/ConfigurationErrorTest.kt
rename to benchmark/benchmark-common/src/androidTest/java/androidx/benchmark/ConfigurationErrorTest.kt
index 0889c6a..7342c236 100644
--- a/benchmark/benchmark-macro/src/androidTest/java/androidx/benchmark/macro/ConfigurationErrorTest.kt
+++ b/benchmark/benchmark-common/src/androidTest/java/androidx/benchmark/ConfigurationErrorTest.kt
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package androidx.benchmark.macro
+package androidx.benchmark
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
diff --git a/benchmark/benchmark-common/src/androidTest/java/androidx/benchmark/OutputsTest.kt b/benchmark/benchmark-common/src/androidTest/java/androidx/benchmark/OutputsTest.kt
index d04202b..952d3c4 100644
--- a/benchmark/benchmark-common/src/androidTest/java/androidx/benchmark/OutputsTest.kt
+++ b/benchmark/benchmark-common/src/androidTest/java/androidx/benchmark/OutputsTest.kt
@@ -19,6 +19,7 @@
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SdkSuppress
import androidx.test.filters.SmallTest
+import org.junit.Assert
import org.junit.Before
import org.junit.Test
import org.junit.runner.RunWith
@@ -86,4 +87,32 @@
assertEquals(path, relativePath, "$path != $relativePath")
}
}
-}
+
+ @Test
+ public fun dirUsableByAppAndShell_writeAppReadApp() {
+ val dir = Outputs.dirUsableByAppAndShell
+ val file = File.createTempFile("testFile", null, dir)
+ try {
+ file.writeText(file.name) // use name, as it's fairly unique
+ Assert.assertEquals(file.name, file.readText())
+ } finally {
+ file.delete()
+ }
+ }
+
+ @Test
+ @SdkSuppress(minSdkVersion = 21)
+ public fun dirUsableByAppAndShell_writeAppReadShell() {
+ val dir = Outputs.dirUsableByAppAndShell
+ val file = File.createTempFile("testFile", null, dir)
+ try {
+ file.writeText(file.name) // use name, as it's fairly unique
+ Assert.assertEquals(
+ file.name,
+ Shell.executeCommand("cat ${file.absolutePath}")
+ )
+ } finally {
+ file.delete()
+ }
+ }
+}
\ No newline at end of file
diff --git a/compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/window/OwnerWindowScope.kt b/benchmark/benchmark-common/src/androidTest/java/androidx/benchmark/Packages.kt
similarity index 67%
copy from compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/window/OwnerWindowScope.kt
copy to benchmark/benchmark-common/src/androidTest/java/androidx/benchmark/Packages.kt
index b641fea..28585a6 100644
--- a/compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/window/OwnerWindowScope.kt
+++ b/benchmark/benchmark-common/src/androidTest/java/androidx/benchmark/Packages.kt
@@ -14,17 +14,12 @@
* limitations under the License.
*/
-package androidx.compose.ui.window
+package androidx.benchmark
-import java.awt.Window
+import androidx.test.platform.app.InstrumentationRegistry
-/**
- * Scope that is created by [application], [Window] or [Dialog] and provides an owner window of
- * this scope
- */
-interface OwnerWindowScope {
- /**
- * Owner window of this scope
- */
- val ownerWindow: Window?
-}
\ No newline at end of file
+object Packages {
+ val TEST: String = InstrumentationRegistry.getInstrumentation()
+ .context
+ .packageName
+}
diff --git a/benchmark/benchmark-common/src/androidTest/java/androidx/benchmark/ShellBehaviorTest.kt b/benchmark/benchmark-common/src/androidTest/java/androidx/benchmark/ShellBehaviorTest.kt
index 3285e4c..5f4ccbc 100644
--- a/benchmark/benchmark-common/src/androidTest/java/androidx/benchmark/ShellBehaviorTest.kt
+++ b/benchmark/benchmark-common/src/androidTest/java/androidx/benchmark/ShellBehaviorTest.kt
@@ -20,7 +20,6 @@
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.MediumTest
import androidx.test.filters.SdkSuppress
-import androidx.test.platform.app.InstrumentationRegistry
import org.junit.Test
import org.junit.runner.RunWith
import kotlin.test.assertEquals
@@ -35,12 +34,10 @@
@SdkSuppress(minSdkVersion = 21)
@RunWith(AndroidJUnit4::class)
class ShellBehaviorTest {
- private val packageName = InstrumentationRegistry.getInstrumentation().context.packageName
-
@Test
fun pidof() {
// Should only be one process - this one!
- val pidofString = Shell.executeCommand("pidof $packageName").trim()
+ val pidofString = Shell.executeCommand("pidof ${Packages.TEST}").trim()
when {
Build.VERSION.SDK_INT < 23 -> {
@@ -76,7 +73,7 @@
// ps -A should work - expect several processes including this one
val processes = output.split("\n")
assertTrue(processes.size > 5)
- assertTrue(processes.any { it.endsWith(packageName) })
+ assertTrue(processes.any { it.endsWith(Packages.TEST) })
}
}
}
diff --git a/benchmark/benchmark-common/src/androidTest/java/androidx/benchmark/ShellTest.kt b/benchmark/benchmark-common/src/androidTest/java/androidx/benchmark/ShellTest.kt
index b603559..d02717f 100644
--- a/benchmark/benchmark-common/src/androidTest/java/androidx/benchmark/ShellTest.kt
+++ b/benchmark/benchmark-common/src/androidTest/java/androidx/benchmark/ShellTest.kt
@@ -20,7 +20,6 @@
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SdkSuppress
import androidx.test.filters.SmallTest
-import androidx.test.platform.app.InstrumentationRegistry
import org.junit.Assert
import org.junit.Assume.assumeTrue
import org.junit.Test
@@ -211,8 +210,7 @@
@Test
fun isPackageAlive() {
// this package is certainly alive...
- val packageName = InstrumentationRegistry.getInstrumentation().context.packageName
- assertNotNull(Shell.isPackageAlive(packageName))
+ assertNotNull(Shell.isPackageAlive(Packages.TEST))
// this made up one shouldn't be
assertNotNull(Shell.isPackageAlive("com.notalive.package.notarealapp"))
diff --git a/benchmark/benchmark-macro/src/androidTest/java/androidx/benchmark/macro/UserspaceTracingTest.kt b/benchmark/benchmark-common/src/androidTest/java/androidx/benchmark/UserspaceTracingTest.kt
similarity index 88%
rename from benchmark/benchmark-macro/src/androidTest/java/androidx/benchmark/macro/UserspaceTracingTest.kt
rename to benchmark/benchmark-common/src/androidTest/java/androidx/benchmark/UserspaceTracingTest.kt
index d1d5423..73f5067 100644
--- a/benchmark/benchmark-macro/src/androidTest/java/androidx/benchmark/macro/UserspaceTracingTest.kt
+++ b/benchmark/benchmark-common/src/androidTest/java/androidx/benchmark/UserspaceTracingTest.kt
@@ -14,10 +14,11 @@
* limitations under the License.
*/
-package androidx.benchmark.macro
+package androidx.benchmark
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
+import androidx.test.platform.app.InstrumentationRegistry
import org.junit.After
import org.junit.Assert.assertEquals
import org.junit.Assert.assertTrue
@@ -27,6 +28,7 @@
import perfetto.protos.TracePacket
import perfetto.protos.TrackDescriptor
import perfetto.protos.TrackEvent
+import java.io.File
import kotlin.test.assertNotNull
@RunWith(AndroidJUnit4::class)
@@ -111,3 +113,15 @@
}
}
}
+
+@Suppress("SameParameterValue")
+internal fun createTempFileFromAsset(prefix: String, suffix: String): File {
+ val file = File.createTempFile(prefix, suffix, Outputs.dirUsableByAppAndShell)
+ InstrumentationRegistry
+ .getInstrumentation()
+ .context
+ .assets
+ .open(prefix + suffix)
+ .copyTo(file.outputStream())
+ return file
+}
\ No newline at end of file
diff --git a/benchmark/benchmark-macro/src/androidTest/java/androidx/benchmark/macro/perfetto/AtraceTagTest.kt b/benchmark/benchmark-common/src/androidTest/java/androidx/benchmark/perfetto/AtraceTagTest.kt
similarity index 87%
rename from benchmark/benchmark-macro/src/androidTest/java/androidx/benchmark/macro/perfetto/AtraceTagTest.kt
rename to benchmark/benchmark-common/src/androidTest/java/androidx/benchmark/perfetto/AtraceTagTest.kt
index 3f91f11..88f8578 100644
--- a/benchmark/benchmark-macro/src/androidTest/java/androidx/benchmark/macro/perfetto/AtraceTagTest.kt
+++ b/benchmark/benchmark-common/src/androidTest/java/androidx/benchmark/perfetto/AtraceTagTest.kt
@@ -14,14 +14,12 @@
* limitations under the License.
*/
-package androidx.benchmark.macro.perfetto
+package androidx.benchmark.perfetto
import androidx.benchmark.Shell
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SdkSuppress
import androidx.test.filters.SmallTest
-import androidx.test.platform.app.InstrumentationRegistry
-import androidx.test.uiautomator.UiDevice
import org.junit.Assume
import org.junit.Test
import org.junit.runner.RunWith
@@ -33,17 +31,16 @@
@SdkSuppress(minSdkVersion = 21)
@SmallTest
class AtraceTagTest {
- private val device = UiDevice.getInstance(InstrumentationRegistry.getInstrumentation())
private val shellSessionRooted = Shell.isSessionRooted()
@Test
fun atraceListCategories_readable() {
- val results = device.executeShellCommand("atrace --list_categories")
+ val results = Shell.executeCommand("atrace --list_categories")
assertNotEquals("", results)
}
private fun getActualSupportedTags(): Set<String> {
- val results = device.executeShellCommand("atrace --list_categories")
+ val results = Shell.executeCommand("atrace --list_categories")
assertNotEquals("", results)
val actualSupportedTags = results
diff --git a/benchmark/benchmark-macro/src/androidTest/java/androidx/benchmark/macro/perfetto/PerfettoConfigTest.kt b/benchmark/benchmark-common/src/androidTest/java/androidx/benchmark/perfetto/PerfettoConfigTest.kt
similarity index 97%
rename from benchmark/benchmark-macro/src/androidTest/java/androidx/benchmark/macro/perfetto/PerfettoConfigTest.kt
rename to benchmark/benchmark-common/src/androidTest/java/androidx/benchmark/perfetto/PerfettoConfigTest.kt
index 365cf76..45f983d 100644
--- a/benchmark/benchmark-macro/src/androidTest/java/androidx/benchmark/macro/perfetto/PerfettoConfigTest.kt
+++ b/benchmark/benchmark-common/src/androidTest/java/androidx/benchmark/perfetto/PerfettoConfigTest.kt
@@ -14,9 +14,9 @@
* limitations under the License.
*/
-package androidx.benchmark.macro.perfetto
+package androidx.benchmark.perfetto
-import androidx.benchmark.macro.Packages
+import androidx.benchmark.Packages
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SdkSuppress
import androidx.test.filters.SmallTest
diff --git a/benchmark/benchmark-macro/src/androidTest/java/androidx/benchmark/macro/perfetto/UiStateTest.kt b/benchmark/benchmark-common/src/androidTest/java/androidx/benchmark/perfetto/UiStateTest.kt
similarity index 87%
rename from benchmark/benchmark-macro/src/androidTest/java/androidx/benchmark/macro/perfetto/UiStateTest.kt
rename to benchmark/benchmark-common/src/androidTest/java/androidx/benchmark/perfetto/UiStateTest.kt
index 9d582fd..5199c56 100644
--- a/benchmark/benchmark-macro/src/androidTest/java/androidx/benchmark/macro/perfetto/UiStateTest.kt
+++ b/benchmark/benchmark-common/src/androidTest/java/androidx/benchmark/perfetto/UiStateTest.kt
@@ -14,12 +14,11 @@
* limitations under the License.
*/
-package androidx.benchmark.macro.perfetto
+package androidx.benchmark.perfetto
-import androidx.benchmark.Outputs
+import androidx.benchmark.createTempFileFromAsset
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
-import androidx.test.platform.app.InstrumentationRegistry
import okio.ByteString
import org.junit.Assert.assertTrue
import org.junit.Test
@@ -118,15 +117,3 @@
assertTrue(finalSize > initialSize * 0.95f)
}
}
-
-@Suppress("SameParameterValue")
-internal fun createTempFileFromAsset(prefix: String, suffix: String): File {
- val file = File.createTempFile(prefix, suffix, Outputs.dirUsableByAppAndShell)
- InstrumentationRegistry
- .getInstrumentation()
- .context
- .assets
- .open(prefix + suffix)
- .copyTo(file.outputStream())
- return file
-}
\ No newline at end of file
diff --git a/benchmark/benchmark-macro/src/main/java/androidx/benchmark/macro/ConfigurationError.kt b/benchmark/benchmark-common/src/main/java/androidx/benchmark/ConfigurationError.kt
similarity index 91%
rename from benchmark/benchmark-macro/src/main/java/androidx/benchmark/macro/ConfigurationError.kt
rename to benchmark/benchmark-common/src/main/java/androidx/benchmark/ConfigurationError.kt
index 0758048..ab498d3 100644
--- a/benchmark/benchmark-macro/src/main/java/androidx/benchmark/macro/ConfigurationError.kt
+++ b/benchmark/benchmark-common/src/main/java/androidx/benchmark/ConfigurationError.kt
@@ -14,12 +14,17 @@
* limitations under the License.
*/
-package androidx.benchmark.macro
+package androidx.benchmark
+
+import androidx.annotation.RestrictTo
/**
* Represents an error in configuration of a benchmark.
+ *
+ * @suppress
*/
-internal data class ConfigurationError(
+@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
+data class ConfigurationError(
/**
* All-caps, publicly visible ID for the error.
*
@@ -74,7 +79,9 @@
)
}
-internal fun conditionalError(
+/** @suppress */
+@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
+fun conditionalError(
hasError: Boolean,
id: String,
summary: String,
@@ -96,8 +103,11 @@
/**
* Throw an AssertionError if the list contains an unsuppressed error, and return either a
* SuppressionState if errors are suppressed, or null otherwise.
+ *
+ * @suppress
*/
-internal fun List<ConfigurationError>.checkAndGetSuppressionState(
+@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
+fun List<ConfigurationError>.checkAndGetSuppressionState(
suppressedErrorIds: Set<String>,
): ConfigurationError.SuppressionState? {
val (suppressed, unsuppressed) = partition {
diff --git a/benchmark/benchmark-macro/src/main/java/androidx/benchmark/macro/DeviceInfo.kt b/benchmark/benchmark-common/src/main/java/androidx/benchmark/DeviceInfo.kt
similarity index 97%
rename from benchmark/benchmark-macro/src/main/java/androidx/benchmark/macro/DeviceInfo.kt
rename to benchmark/benchmark-common/src/main/java/androidx/benchmark/DeviceInfo.kt
index a93a8b7..1378bad 100644
--- a/benchmark/benchmark-macro/src/main/java/androidx/benchmark/macro/DeviceInfo.kt
+++ b/benchmark/benchmark-common/src/main/java/androidx/benchmark/DeviceInfo.kt
@@ -14,16 +14,18 @@
* limitations under the License.
*/
-package androidx.benchmark.macro
+package androidx.benchmark
import android.content.Intent
import android.content.IntentFilter
import android.os.BatteryManager
import android.os.Build
+import androidx.annotation.RestrictTo
import androidx.test.platform.app.InstrumentationRegistry
import java.io.File
-internal object DeviceInfo {
+@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
+object DeviceInfo {
val isEmulator = Build.FINGERPRINT.startsWith("generic") ||
Build.FINGERPRINT.startsWith("unknown") ||
Build.MODEL.contains("google_sdk") ||
diff --git a/benchmark/benchmark-common/src/main/java/androidx/benchmark/Stats.kt b/benchmark/benchmark-common/src/main/java/androidx/benchmark/Stats.kt
index 7f0ca9c..763e96c 100644
--- a/benchmark/benchmark-common/src/main/java/androidx/benchmark/Stats.kt
+++ b/benchmark/benchmark-common/src/main/java/androidx/benchmark/Stats.kt
@@ -65,14 +65,6 @@
}
public fun putInBundle(status: Bundle, prefix: String) {
- if (name == "timeNs") {
- // compatibility naming scheme.
- // should be removed, once we timeNs_min has been in dashboard for several weeks
- status.putLong("${prefix}min", min)
- status.putLong("${prefix}median", median)
- status.putLong("${prefix}standardDeviation", standardDeviation.toLong())
- }
-
// format string to be in instrumentation results format
val bundleName = name.toOutputMetricName()
diff --git a/benchmark/benchmark-macro/src/main/java/androidx/benchmark/macro/UserspaceTracing.kt b/benchmark/benchmark-common/src/main/java/androidx/benchmark/UserspaceTracing.kt
similarity index 89%
rename from benchmark/benchmark-macro/src/main/java/androidx/benchmark/macro/UserspaceTracing.kt
rename to benchmark/benchmark-common/src/main/java/androidx/benchmark/UserspaceTracing.kt
index 17f03b2..b27c1ed 100644
--- a/benchmark/benchmark-macro/src/main/java/androidx/benchmark/macro/UserspaceTracing.kt
+++ b/benchmark/benchmark-common/src/main/java/androidx/benchmark/UserspaceTracing.kt
@@ -14,8 +14,9 @@
* limitations under the License.
*/
-package androidx.benchmark.macro
+package androidx.benchmark
+import androidx.annotation.RestrictTo
import perfetto.protos.Trace
import perfetto.protos.TracePacket
import perfetto.protos.TrackDescriptor
@@ -30,8 +31,11 @@
* After trace processing, the extra events (before _and_ after the measureBlock section of a
* benchmark) can be added to the trace by calling [commitToTrace], and appending that to the
* trace on-disk.
+ *
+ * @suppress
*/
-internal object UserspaceTracing {
+@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
+object UserspaceTracing {
/**
* All events emitted by the benchmark annotation should have the same value.
* the value needs to not conflict with any sequence id emitted in the trace.
@@ -90,7 +94,7 @@
return Trace(capturedEvents)
}
- private fun startSection(label: String) {
+ fun startSection(label: String) {
events.add(
TracePacket(
timestamp = System.nanoTime(),
@@ -106,7 +110,7 @@
)
}
- private fun endSection() {
+ fun endSection() {
events.add(
TracePacket(
timestamp = System.nanoTime(),
@@ -119,17 +123,15 @@
)
)
}
-
- inline fun <T> trace(label: String, block: () -> T): T {
- startSection(label)
- return try {
- block()
- } finally {
- endSection()
- }
- }
}
-internal inline fun <T> userspaceTrace(label: String, block: () -> T): T {
- return UserspaceTracing.trace(label, block)
+/** @suppress */
+@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
+inline fun <T> userspaceTrace(label: String, block: () -> T): T {
+ UserspaceTracing.startSection(label)
+ return try {
+ block()
+ } finally {
+ UserspaceTracing.endSection()
+ }
}
diff --git a/benchmark/benchmark-macro/src/main/java/androidx/benchmark/macro/perfetto/AtraceTag.kt b/benchmark/benchmark-common/src/main/java/androidx/benchmark/perfetto/AtraceTag.kt
similarity index 97%
rename from benchmark/benchmark-macro/src/main/java/androidx/benchmark/macro/perfetto/AtraceTag.kt
rename to benchmark/benchmark-common/src/main/java/androidx/benchmark/perfetto/AtraceTag.kt
index ef21283..31e6a21 100644
--- a/benchmark/benchmark-macro/src/main/java/androidx/benchmark/macro/perfetto/AtraceTag.kt
+++ b/benchmark/benchmark-common/src/main/java/androidx/benchmark/perfetto/AtraceTag.kt
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package androidx.benchmark.macro.perfetto
+package androidx.benchmark.perfetto
import android.os.Build
diff --git a/benchmark/benchmark-macro/src/main/java/androidx/benchmark/macro/perfetto/PerfettoCapture.kt b/benchmark/benchmark-common/src/main/java/androidx/benchmark/perfetto/PerfettoCapture.kt
similarity index 95%
rename from benchmark/benchmark-macro/src/main/java/androidx/benchmark/macro/perfetto/PerfettoCapture.kt
rename to benchmark/benchmark-common/src/main/java/androidx/benchmark/perfetto/PerfettoCapture.kt
index c286b81..b8c6474 100644
--- a/benchmark/benchmark-macro/src/main/java/androidx/benchmark/macro/perfetto/PerfettoCapture.kt
+++ b/benchmark/benchmark-common/src/main/java/androidx/benchmark/perfetto/PerfettoCapture.kt
@@ -1,5 +1,5 @@
/*
- * Copyright 2020 The Android Open Source Project
+ * Copyright 2021 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -14,13 +14,13 @@
* limitations under the License.
*/
-package androidx.benchmark.macro.perfetto
+package androidx.benchmark.perfetto
import android.os.Build
import androidx.annotation.RequiresApi
import androidx.annotation.RestrictTo
import androidx.benchmark.Outputs
-import androidx.benchmark.macro.userspaceTrace
+import androidx.benchmark.userspaceTrace
import java.io.File
/**
diff --git a/benchmark/benchmark-macro/src/main/java/androidx/benchmark/macro/perfetto/PerfettoCaptureWrapper.kt b/benchmark/benchmark-common/src/main/java/androidx/benchmark/perfetto/PerfettoCaptureWrapper.kt
similarity index 94%
rename from benchmark/benchmark-macro/src/main/java/androidx/benchmark/macro/perfetto/PerfettoCaptureWrapper.kt
rename to benchmark/benchmark-common/src/main/java/androidx/benchmark/perfetto/PerfettoCaptureWrapper.kt
index 4c63fb6a..11ebeb0 100644
--- a/benchmark/benchmark-macro/src/main/java/androidx/benchmark/macro/perfetto/PerfettoCaptureWrapper.kt
+++ b/benchmark/benchmark-common/src/main/java/androidx/benchmark/perfetto/PerfettoCaptureWrapper.kt
@@ -14,11 +14,12 @@
* limitations under the License.
*/
-package androidx.benchmark.macro.perfetto
+package androidx.benchmark.perfetto
import android.os.Build
import android.util.Log
import androidx.annotation.RequiresApi
+import androidx.annotation.RestrictTo
import androidx.benchmark.Outputs
import androidx.benchmark.Outputs.dateToFileName
import androidx.benchmark.PropOverride
@@ -26,7 +27,8 @@
/**
* Wrapper for [PerfettoCapture] which does nothing below L.
*/
-internal class PerfettoCaptureWrapper {
+@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
+class PerfettoCaptureWrapper {
private var capture: PerfettoCapture? = null
private val TRACE_ENABLE_PROP = "persist.traced.enable"
diff --git a/benchmark/benchmark-macro/src/main/java/androidx/benchmark/macro/perfetto/PerfettoConfig.kt b/benchmark/benchmark-common/src/main/java/androidx/benchmark/perfetto/PerfettoConfig.kt
similarity index 96%
rename from benchmark/benchmark-macro/src/main/java/androidx/benchmark/macro/perfetto/PerfettoConfig.kt
rename to benchmark/benchmark-common/src/main/java/androidx/benchmark/perfetto/PerfettoConfig.kt
index 747e58f..34adfb4 100644
--- a/benchmark/benchmark-macro/src/main/java/androidx/benchmark/macro/perfetto/PerfettoConfig.kt
+++ b/benchmark/benchmark-common/src/main/java/androidx/benchmark/perfetto/PerfettoConfig.kt
@@ -14,10 +14,11 @@
* limitations under the License.
*/
-package androidx.benchmark.macro.perfetto
+package androidx.benchmark.perfetto
import android.os.Build
import androidx.annotation.RequiresApi
+import androidx.annotation.RestrictTo
import androidx.benchmark.Shell
import perfetto.protos.DataSourceConfig
import perfetto.protos.FtraceConfig
@@ -134,9 +135,12 @@
/**
* Global config for perfetto.
*
- * Eventually, this should be configurable.
+ * Eventually, this should be more configurable.
+ *
+ * @suppress
*/
-internal fun perfettoConfig(
+@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
+fun perfettoConfig(
atraceApps: List<String>
) = TraceConfig(
buffers = listOf(
diff --git a/benchmark/benchmark-macro/src/main/java/androidx/benchmark/macro/perfetto/PerfettoHelper.kt b/benchmark/benchmark-common/src/main/java/androidx/benchmark/perfetto/PerfettoHelper.kt
similarity index 98%
rename from benchmark/benchmark-macro/src/main/java/androidx/benchmark/macro/perfetto/PerfettoHelper.kt
rename to benchmark/benchmark-common/src/main/java/androidx/benchmark/perfetto/PerfettoHelper.kt
index 4606a25..4cee2fc 100644
--- a/benchmark/benchmark-macro/src/main/java/androidx/benchmark/macro/perfetto/PerfettoHelper.kt
+++ b/benchmark/benchmark-common/src/main/java/androidx/benchmark/perfetto/PerfettoHelper.kt
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package androidx.benchmark.macro.perfetto
+package androidx.benchmark.perfetto
import android.os.Build
import android.os.SystemClock
@@ -22,8 +22,8 @@
import androidx.annotation.RequiresApi
import androidx.annotation.RestrictTo
import androidx.benchmark.Shell
-import androidx.benchmark.macro.DeviceInfo.deviceSummaryString
-import androidx.benchmark.macro.userspaceTrace
+import androidx.benchmark.DeviceInfo.deviceSummaryString
+import androidx.benchmark.userspaceTrace
import androidx.test.platform.app.InstrumentationRegistry
import org.jetbrains.annotations.TestOnly
import java.io.File
@@ -348,7 +348,7 @@
return true
}
- internal companion object {
+ companion object {
internal const val LOG_TAG = "PerfettoCapture"
const val LOWEST_BUNDLED_VERSION_SUPPORTED = 29
@@ -418,7 +418,7 @@
createExecutable(PERFETTO)
}
- internal fun createExecutable(tool: String): String {
+ fun createExecutable(tool: String): String {
userspaceTrace("create executable: $tool") {
if (!isAbiSupported()) {
throw IllegalStateException(
diff --git a/benchmark/benchmark-macro/src/main/java/androidx/benchmark/macro/perfetto/UiState.kt b/benchmark/benchmark-common/src/main/java/androidx/benchmark/perfetto/UiState.kt
similarity index 85%
rename from benchmark/benchmark-macro/src/main/java/androidx/benchmark/macro/perfetto/UiState.kt
rename to benchmark/benchmark-common/src/main/java/androidx/benchmark/perfetto/UiState.kt
index 33bf7de..bcd94d2 100644
--- a/benchmark/benchmark-macro/src/main/java/androidx/benchmark/macro/perfetto/UiState.kt
+++ b/benchmark/benchmark-common/src/main/java/androidx/benchmark/perfetto/UiState.kt
@@ -14,8 +14,9 @@
* limitations under the License.
*/
-package androidx.benchmark.macro.perfetto
+package androidx.benchmark.perfetto
+import androidx.annotation.RestrictTo
import perfetto.protos.Trace
import perfetto.protos.TracePacket
import perfetto.protos.UiState
@@ -25,7 +26,8 @@
* Convenience for UiState construction with specified package
*/
@Suppress("FunctionName") // constructor convenience
-internal fun UiState(
+@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
+fun UiState(
timelineStart: Long?,
timelineEnd: Long?,
highlightPackage: String?
@@ -37,7 +39,8 @@
}
)
-internal fun File.appendUiState(state: UiState) {
+@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
+fun File.appendUiState(state: UiState) {
val traceToAppend = Trace(packet = listOf(TracePacket(ui_state = state)))
appendBytes(traceToAppend.encode())
}
diff --git a/benchmark/benchmark-macro/src/main/java/perfetto/protos/package-info.java b/benchmark/benchmark-common/src/main/java/perfetto/protos/package-info.java
similarity index 84%
rename from benchmark/benchmark-macro/src/main/java/perfetto/protos/package-info.java
rename to benchmark/benchmark-common/src/main/java/perfetto/protos/package-info.java
index 4654d20..fd5614d 100644
--- a/benchmark/benchmark-macro/src/main/java/perfetto/protos/package-info.java
+++ b/benchmark/benchmark-common/src/main/java/perfetto/protos/package-info.java
@@ -15,14 +15,14 @@
*/
/**
- * Hide the perfetto.protos package, as it's an implementation detail of benchmark.macro
+ * Hide the perfetto.protos package, as it's an implementation detail of benchmark
*
- * Note: other attempts to use these protos in the macrobench process will clash with our
+ * Note: other attempts to use these protos in a benchmark process may clash with our
* definitions. If this becomes an issue, we can move ours to a separate, internal package.
*
* @hide
*/
-@RestrictTo(RestrictTo.Scope.LIBRARY)
+@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
package perfetto.protos;
import androidx.annotation.RestrictTo;
diff --git a/benchmark/benchmark-macro/src/main/proto/perfetto_config.proto b/benchmark/benchmark-common/src/main/proto/perfetto_config.proto
similarity index 100%
rename from benchmark/benchmark-macro/src/main/proto/perfetto_config.proto
rename to benchmark/benchmark-common/src/main/proto/perfetto_config.proto
diff --git a/benchmark/benchmark-macro/src/main/proto/perfetto_trace.proto b/benchmark/benchmark-common/src/main/proto/perfetto_trace.proto
similarity index 100%
rename from benchmark/benchmark-macro/src/main/proto/perfetto_trace.proto
rename to benchmark/benchmark-common/src/main/proto/perfetto_trace.proto
diff --git a/benchmark/benchmark-junit4/api/current.txt b/benchmark/benchmark-junit4/api/current.txt
index 873f105..bb78174 100644
--- a/benchmark/benchmark-junit4/api/current.txt
+++ b/benchmark/benchmark-junit4/api/current.txt
@@ -19,5 +19,8 @@
method public static inline void measureRepeated(androidx.benchmark.junit4.BenchmarkRule, kotlin.jvm.functions.Function1<? super androidx.benchmark.junit4.BenchmarkRule.Scope,kotlin.Unit> block);
}
+ public final class PerfettoRuleKt {
+ }
+
}
diff --git a/benchmark/benchmark-junit4/api/public_plus_experimental_current.txt b/benchmark/benchmark-junit4/api/public_plus_experimental_current.txt
index 873f105..bb78174 100644
--- a/benchmark/benchmark-junit4/api/public_plus_experimental_current.txt
+++ b/benchmark/benchmark-junit4/api/public_plus_experimental_current.txt
@@ -19,5 +19,8 @@
method public static inline void measureRepeated(androidx.benchmark.junit4.BenchmarkRule, kotlin.jvm.functions.Function1<? super androidx.benchmark.junit4.BenchmarkRule.Scope,kotlin.Unit> block);
}
+ public final class PerfettoRuleKt {
+ }
+
}
diff --git a/benchmark/benchmark-junit4/api/restricted_current.txt b/benchmark/benchmark-junit4/api/restricted_current.txt
index c2d8056..8ffdd9b 100644
--- a/benchmark/benchmark-junit4/api/restricted_current.txt
+++ b/benchmark/benchmark-junit4/api/restricted_current.txt
@@ -20,5 +20,13 @@
method public static inline void measureRepeated(androidx.benchmark.junit4.BenchmarkRule, kotlin.jvm.functions.Function1<? super androidx.benchmark.junit4.BenchmarkRule.Scope,kotlin.Unit> block);
}
+ @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public final class PerfettoRule implements org.junit.rules.TestRule {
+ ctor public PerfettoRule();
+ method public org.junit.runners.model.Statement apply(org.junit.runners.model.Statement base, org.junit.runner.Description description);
+ }
+
+ public final class PerfettoRuleKt {
+ }
+
}
diff --git a/benchmark/benchmark-junit4/build.gradle b/benchmark/benchmark-junit4/build.gradle
index 11d54c0..cd30ba8 100644
--- a/benchmark/benchmark-junit4/build.gradle
+++ b/benchmark/benchmark-junit4/build.gradle
@@ -40,6 +40,7 @@
implementation("androidx.tracing:tracing-ktx:1.0.0")
api("androidx.annotation:annotation:1.1.0")
+ androidTestImplementation(project(":internal-testutils-ktx"))
androidTestImplementation(libs.testCore)
androidTestImplementation(libs.testExtJunit)
}
diff --git a/benchmark/benchmark-macro-junit4/src/androidTest/java/androidx/benchmark/macro/test/PerfettoRuleTest.kt b/benchmark/benchmark-junit4/src/androidTest/java/androidx/benchmark/junit4/PerfettoRuleTest.kt
similarity index 95%
rename from benchmark/benchmark-macro-junit4/src/androidTest/java/androidx/benchmark/macro/test/PerfettoRuleTest.kt
rename to benchmark/benchmark-junit4/src/androidTest/java/androidx/benchmark/junit4/PerfettoRuleTest.kt
index cb58a02..ab6003a 100644
--- a/benchmark/benchmark-macro-junit4/src/androidTest/java/androidx/benchmark/macro/test/PerfettoRuleTest.kt
+++ b/benchmark/benchmark-junit4/src/androidTest/java/androidx/benchmark/junit4/PerfettoRuleTest.kt
@@ -14,10 +14,9 @@
* limitations under the License.
*/
-package androidx.benchmark.macro.test
+package androidx.benchmark.junit4
import android.os.Build
-import androidx.benchmark.macro.junit4.PerfettoRule
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.LargeTest
import androidx.test.filters.SmallTest
diff --git a/benchmark/benchmark-macro-junit4/src/main/java/androidx/benchmark/macro/junit4/PerfettoRule.kt b/benchmark/benchmark-junit4/src/main/java/androidx/benchmark/junit4/PerfettoRule.kt
similarity index 91%
rename from benchmark/benchmark-macro-junit4/src/main/java/androidx/benchmark/macro/junit4/PerfettoRule.kt
rename to benchmark/benchmark-junit4/src/main/java/androidx/benchmark/junit4/PerfettoRule.kt
index fc36ac4..1c900ee 100644
--- a/benchmark/benchmark-macro-junit4/src/main/java/androidx/benchmark/macro/junit4/PerfettoRule.kt
+++ b/benchmark/benchmark-junit4/src/main/java/androidx/benchmark/junit4/PerfettoRule.kt
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package androidx.benchmark.macro.junit4
+package androidx.benchmark.junit4
import android.os.Build
import android.util.Log
@@ -22,7 +22,8 @@
import androidx.annotation.RestrictTo
import androidx.benchmark.Outputs
import androidx.benchmark.Outputs.dateToFileName
-import androidx.benchmark.macro.perfetto.PerfettoCapture
+import androidx.benchmark.perfetto.PerfettoCapture
+import androidx.benchmark.perfetto.PerfettoHelper
import androidx.test.platform.app.InstrumentationRegistry
import org.junit.rules.TestRule
import org.junit.runner.Description
@@ -57,11 +58,11 @@
description: Description
): Statement = object : Statement() {
override fun evaluate() {
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
+ if (Build.VERSION.SDK_INT >= PerfettoHelper.LOWEST_BUNDLED_VERSION_SUPPORTED) {
val prefix = "${description.className}_${description.methodName}"
val suffix = dateToFileName()
val traceName = "${prefix}_$suffix.perfetto-trace"
- PerfettoCapture().recordAndReportFile(traceName) {
+ PerfettoCapture(unbundled = false).recordAndReportFile(traceName) {
base.evaluate()
}
} else {
diff --git a/benchmark/benchmark-macro-junit4/api/current.txt b/benchmark/benchmark-macro-junit4/api/current.txt
index 5d2528d..1c277c8 100644
--- a/benchmark/benchmark-macro-junit4/api/current.txt
+++ b/benchmark/benchmark-macro-junit4/api/current.txt
@@ -10,8 +10,5 @@
method public void measureRepeated(String packageName, java.util.List<? extends androidx.benchmark.macro.Metric> metrics, @IntRange(from=1) int iterations, kotlin.jvm.functions.Function1<? super androidx.benchmark.macro.MacrobenchmarkScope,kotlin.Unit> measureBlock);
}
- public final class PerfettoRuleKt {
- }
-
}
diff --git a/benchmark/benchmark-macro-junit4/api/public_plus_experimental_current.txt b/benchmark/benchmark-macro-junit4/api/public_plus_experimental_current.txt
index 5d2528d..1c277c8 100644
--- a/benchmark/benchmark-macro-junit4/api/public_plus_experimental_current.txt
+++ b/benchmark/benchmark-macro-junit4/api/public_plus_experimental_current.txt
@@ -10,8 +10,5 @@
method public void measureRepeated(String packageName, java.util.List<? extends androidx.benchmark.macro.Metric> metrics, @IntRange(from=1) int iterations, kotlin.jvm.functions.Function1<? super androidx.benchmark.macro.MacrobenchmarkScope,kotlin.Unit> measureBlock);
}
- public final class PerfettoRuleKt {
- }
-
}
diff --git a/benchmark/benchmark-macro-junit4/api/restricted_current.txt b/benchmark/benchmark-macro-junit4/api/restricted_current.txt
index 431728d..1c277c8 100644
--- a/benchmark/benchmark-macro-junit4/api/restricted_current.txt
+++ b/benchmark/benchmark-macro-junit4/api/restricted_current.txt
@@ -10,13 +10,5 @@
method public void measureRepeated(String packageName, java.util.List<? extends androidx.benchmark.macro.Metric> metrics, @IntRange(from=1) int iterations, kotlin.jvm.functions.Function1<? super androidx.benchmark.macro.MacrobenchmarkScope,kotlin.Unit> measureBlock);
}
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public final class PerfettoRule implements org.junit.rules.TestRule {
- ctor public PerfettoRule();
- method public org.junit.runners.model.Statement apply(org.junit.runners.model.Statement base, org.junit.runner.Description description);
- }
-
- public final class PerfettoRuleKt {
- }
-
}
diff --git a/benchmark/benchmark-macro-junit4/build.gradle b/benchmark/benchmark-macro-junit4/build.gradle
index 8f3927e..410e04e 100644
--- a/benchmark/benchmark-macro-junit4/build.gradle
+++ b/benchmark/benchmark-macro-junit4/build.gradle
@@ -25,9 +25,8 @@
android {
defaultConfig {
- // 18 needed for UI automator. While 28 is a theoretical minimum for Perfetto, we
- // currently leave this lower currently to enable optional usage.
- minSdkVersion 18
+ // 21 is perfetto min API, and required for shell commands
+ minSdkVersion 21
multiDexEnabled true
}
}
diff --git a/benchmark/benchmark-macro/api/current.txt b/benchmark/benchmark-macro/api/current.txt
index 5482016..ab04416 100644
--- a/benchmark/benchmark-macro/api/current.txt
+++ b/benchmark/benchmark-macro/api/current.txt
@@ -4,7 +4,7 @@
@RequiresApi(29) public final class Api29Kt {
}
- @RequiresApi(21) public abstract sealed class CompilationMode {
+ public abstract sealed class CompilationMode {
}
public static final class CompilationMode.BaselineProfile extends androidx.benchmark.macro.CompilationMode {
@@ -28,10 +28,7 @@
public final class CompilationModeKt {
}
- public final class ConfigurationErrorKt {
- }
-
- @RequiresApi(21) public final class FrameTimingMetric extends androidx.benchmark.macro.Metric {
+ public final class FrameTimingMetric extends androidx.benchmark.macro.Metric {
ctor public FrameTimingMetric();
}
@@ -41,7 +38,7 @@
public final class MacrobenchmarkKt {
}
- @RequiresApi(21) public final class MacrobenchmarkScope {
+ public final class MacrobenchmarkScope {
ctor public MacrobenchmarkScope(String packageName, boolean launchWithClearTask);
method public void dropKernelPageCache();
method public void killProcess();
@@ -50,7 +47,7 @@
method public void startActivityAndWait(android.content.Intent intent);
}
- @RequiresApi(21) public abstract sealed class Metric {
+ public abstract sealed class Metric {
}
public final class MetricKt {
@@ -72,18 +69,5 @@
public final class TagKt {
}
- public final class UserspaceTracingKt {
- }
-
-}
-
-package androidx.benchmark.macro.perfetto {
-
- public final class PerfettoConfigKt {
- }
-
- public final class UiStateKt {
- }
-
}
diff --git a/benchmark/benchmark-macro/api/public_plus_experimental_current.txt b/benchmark/benchmark-macro/api/public_plus_experimental_current.txt
index 5482016..ab04416 100644
--- a/benchmark/benchmark-macro/api/public_plus_experimental_current.txt
+++ b/benchmark/benchmark-macro/api/public_plus_experimental_current.txt
@@ -4,7 +4,7 @@
@RequiresApi(29) public final class Api29Kt {
}
- @RequiresApi(21) public abstract sealed class CompilationMode {
+ public abstract sealed class CompilationMode {
}
public static final class CompilationMode.BaselineProfile extends androidx.benchmark.macro.CompilationMode {
@@ -28,10 +28,7 @@
public final class CompilationModeKt {
}
- public final class ConfigurationErrorKt {
- }
-
- @RequiresApi(21) public final class FrameTimingMetric extends androidx.benchmark.macro.Metric {
+ public final class FrameTimingMetric extends androidx.benchmark.macro.Metric {
ctor public FrameTimingMetric();
}
@@ -41,7 +38,7 @@
public final class MacrobenchmarkKt {
}
- @RequiresApi(21) public final class MacrobenchmarkScope {
+ public final class MacrobenchmarkScope {
ctor public MacrobenchmarkScope(String packageName, boolean launchWithClearTask);
method public void dropKernelPageCache();
method public void killProcess();
@@ -50,7 +47,7 @@
method public void startActivityAndWait(android.content.Intent intent);
}
- @RequiresApi(21) public abstract sealed class Metric {
+ public abstract sealed class Metric {
}
public final class MetricKt {
@@ -72,18 +69,5 @@
public final class TagKt {
}
- public final class UserspaceTracingKt {
- }
-
-}
-
-package androidx.benchmark.macro.perfetto {
-
- public final class PerfettoConfigKt {
- }
-
- public final class UiStateKt {
- }
-
}
diff --git a/benchmark/benchmark-macro/api/restricted_current.txt b/benchmark/benchmark-macro/api/restricted_current.txt
index 21bddb9..a15f30d 100644
--- a/benchmark/benchmark-macro/api/restricted_current.txt
+++ b/benchmark/benchmark-macro/api/restricted_current.txt
@@ -4,7 +4,7 @@
@RequiresApi(29) public final class Api29Kt {
}
- @RequiresApi(21) public abstract sealed class CompilationMode {
+ public abstract sealed class CompilationMode {
}
public static final class CompilationMode.BaselineProfile extends androidx.benchmark.macro.CompilationMode {
@@ -29,13 +29,10 @@
}
public final class CompilationModeKt {
- method @RequiresApi(21) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static boolean isSupportedWithVmSettings(androidx.benchmark.macro.CompilationMode);
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static boolean isSupportedWithVmSettings(androidx.benchmark.macro.CompilationMode);
}
- public final class ConfigurationErrorKt {
- }
-
- @RequiresApi(21) public final class FrameTimingMetric extends androidx.benchmark.macro.Metric {
+ public final class FrameTimingMetric extends androidx.benchmark.macro.Metric {
ctor public FrameTimingMetric();
}
@@ -45,7 +42,7 @@
public final class MacrobenchmarkKt {
}
- @RequiresApi(21) public final class MacrobenchmarkScope {
+ public final class MacrobenchmarkScope {
ctor public MacrobenchmarkScope(String packageName, boolean launchWithClearTask);
method public void dropKernelPageCache();
method public void killProcess();
@@ -54,7 +51,7 @@
method public void startActivityAndWait(android.content.Intent intent);
}
- @RequiresApi(21) public abstract sealed class Metric {
+ public abstract sealed class Metric {
}
public final class MetricKt {
@@ -76,18 +73,5 @@
public final class TagKt {
}
- public final class UserspaceTracingKt {
- }
-
-}
-
-package androidx.benchmark.macro.perfetto {
-
- public final class PerfettoConfigKt {
- }
-
- public final class UiStateKt {
- }
-
}
diff --git a/benchmark/benchmark-macro/build.gradle b/benchmark/benchmark-macro/build.gradle
index 640b7cf0..335bccf 100644
--- a/benchmark/benchmark-macro/build.gradle
+++ b/benchmark/benchmark-macro/build.gradle
@@ -22,32 +22,18 @@
id("AndroidXPlugin")
id("com.android.library")
id("kotlin-android")
- id("com.squareup.wire")
}
android {
defaultConfig {
- // 18 needed for UI automator. While 21 is a theoretical minimum for Perfetto and shell
- // commands, we currently leave this lower currently to enable optional usage.
- minSdkVersion 18
+ // 21 is perfetto min API, and required for shell commands
+ minSdkVersion 21
}
sourceSets {
main.assets.srcDirs += new File(
SupportConfigKt.getPrebuiltsRoot(project),
"androidx/traceprocessor/trace_processor_shell"
)
- main.assets.srcDirs += new File(
- SupportConfigKt.getPrebuiltsRoot(project),
- "androidx/traceprocessor/perfetto"
- )
- main.assets.srcDirs += new File(
- SupportConfigKt.getPrebuiltsRoot(project),
- "androidx/traceprocessor/traced"
- )
- main.assets.srcDirs += new File(
- SupportConfigKt.getPrebuiltsRoot(project),
- "androidx/traceprocessor/traced_probes"
- )
androidTest.assets.srcDirs += new File(
SupportConfigKt.getPrebuiltsRoot(project),
"androidx/traceprocessor/testdata"
@@ -55,18 +41,6 @@
}
}
-wire {
- kotlin {}
-
- // prune unused config components which have deprecated fields
- prune 'perfetto.protos.TraceConfig.IncidentReportConfig'
- prune 'perfetto.protos.ProcessStatsConfig.Quirks'
-
- sourcePath {
- srcDir 'src/main/proto'
- }
-}
-
dependencies {
api(libs.junit)
api(libs.kotlinStdlib)
@@ -77,7 +51,6 @@
implementation("androidx.tracing:tracing-ktx:1.0.0")
implementation(libs.testCore)
implementation(libs.testUiautomator)
- implementation(libs.wireRuntime)
androidTestImplementation(project(":internal-testutils-ktx"))
androidTestImplementation(project(":activity:activity-ktx"))
diff --git a/benchmark/benchmark-macro/src/androidTest/java/androidx/benchmark/macro/CompilationModeTest.kt b/benchmark/benchmark-macro/src/androidTest/java/androidx/benchmark/macro/CompilationModeTest.kt
index f74887b..a09cfeb 100644
--- a/benchmark/benchmark-macro/src/androidTest/java/androidx/benchmark/macro/CompilationModeTest.kt
+++ b/benchmark/benchmark-macro/src/androidTest/java/androidx/benchmark/macro/CompilationModeTest.kt
@@ -18,7 +18,6 @@
import androidx.benchmark.Shell
import androidx.test.ext.junit.runners.AndroidJUnit4
-import androidx.test.filters.SdkSuppress
import androidx.test.filters.SmallTest
import org.junit.Assert.assertEquals
import org.junit.Assert.assertFalse
@@ -30,7 +29,6 @@
@RunWith(AndroidJUnit4::class)
@SmallTest
-@SdkSuppress(minSdkVersion = 21)
public class CompilationModeTest {
private val vmRunningInterpretedOnly: Boolean
diff --git a/benchmark/benchmark-macro/src/androidTest/java/androidx/benchmark/macro/FileLinkingRule.kt b/benchmark/benchmark-macro/src/androidTest/java/androidx/benchmark/macro/FileLinkingRule.kt
index 8214ab4..bfe4fb6 100644
--- a/benchmark/benchmark-macro/src/androidTest/java/androidx/benchmark/macro/FileLinkingRule.kt
+++ b/benchmark/benchmark-macro/src/androidTest/java/androidx/benchmark/macro/FileLinkingRule.kt
@@ -18,8 +18,8 @@
import androidx.benchmark.InstrumentationResults
import androidx.benchmark.Outputs
-import androidx.benchmark.macro.perfetto.UiState
-import androidx.benchmark.macro.perfetto.appendUiState
+import androidx.benchmark.perfetto.UiState
+import androidx.benchmark.perfetto.appendUiState
import org.junit.rules.RuleChain
import org.junit.rules.TestRule
import org.junit.runner.Description
diff --git a/benchmark/benchmark-macro/src/androidTest/java/androidx/benchmark/macro/MacrobenchmarkScopeTest.kt b/benchmark/benchmark-macro/src/androidTest/java/androidx/benchmark/macro/MacrobenchmarkScopeTest.kt
index b02abfd..d60f101 100644
--- a/benchmark/benchmark-macro/src/androidTest/java/androidx/benchmark/macro/MacrobenchmarkScopeTest.kt
+++ b/benchmark/benchmark-macro/src/androidTest/java/androidx/benchmark/macro/MacrobenchmarkScopeTest.kt
@@ -36,7 +36,6 @@
import kotlin.test.assertNotNull
import kotlin.test.assertTrue
-@SdkSuppress(minSdkVersion = 21)
@RunWith(AndroidJUnit4::class)
@LargeTest
class MacrobenchmarkScopeTest {
diff --git a/benchmark/benchmark-macro/src/androidTest/java/androidx/benchmark/macro/MacrobenchmarkTest.kt b/benchmark/benchmark-macro/src/androidTest/java/androidx/benchmark/macro/MacrobenchmarkTest.kt
index 114cafd..8efef1c 100644
--- a/benchmark/benchmark-macro/src/androidTest/java/androidx/benchmark/macro/MacrobenchmarkTest.kt
+++ b/benchmark/benchmark-macro/src/androidTest/java/androidx/benchmark/macro/MacrobenchmarkTest.kt
@@ -25,7 +25,6 @@
import kotlin.test.assertTrue
@RunWith(AndroidJUnit4::class)
-@SdkSuppress(minSdkVersion = 21)
@SmallTest
class MacrobenchmarkTest {
@Test
diff --git a/benchmark/benchmark-macro/src/androidTest/java/androidx/benchmark/macro/OutputsTest.kt b/benchmark/benchmark-macro/src/androidTest/java/androidx/benchmark/macro/OutputsTest.kt
deleted file mode 100644
index a56635d7..0000000
--- a/benchmark/benchmark-macro/src/androidTest/java/androidx/benchmark/macro/OutputsTest.kt
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Copyright 2021 The Android Open Source Project
- *
- * 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.
- */
-
-package androidx.benchmark.macro
-
-import androidx.benchmark.Outputs
-import androidx.test.ext.junit.runners.AndroidJUnit4
-import androidx.test.filters.SdkSuppress
-import androidx.test.filters.SmallTest
-import androidx.test.platform.app.InstrumentationRegistry
-import androidx.test.uiautomator.UiDevice
-import org.junit.Assert.assertEquals
-import org.junit.Test
-import org.junit.runner.RunWith
-import java.io.File
-
-/**
- * Note - These tests are in benchmark-macro so we can access UiAutomator for shell access.
- * UiAutomator is minApi 18, lower than minApi of benchmark-common where Outputs resides
- */
-@SmallTest
-@RunWith(AndroidJUnit4::class)
-public class OutputsTest {
- @Test
- public fun dirUsableByAppAndShell_writeAppReadApp() {
- val dir = Outputs.dirUsableByAppAndShell
- val file = File.createTempFile("testFile", null, dir)
- try {
- file.writeText(file.name) // use name, as it's fairly unique
- assertEquals(file.name, file.readText())
- } finally {
- file.delete()
- }
- }
-
- @Test
- @SdkSuppress(minSdkVersion = 21) // executeShellCommand
- public fun dirUsableByAppAndShell_writeAppReadShell() {
- val device = UiDevice.getInstance(InstrumentationRegistry.getInstrumentation())
- val dir = Outputs.dirUsableByAppAndShell
- val file = File.createTempFile("testFile", null, dir)
- try {
- file.writeText(file.name) // use name, as it's fairly unique
- assertEquals(
- file.name,
- device.executeShellCommand("cat ${file.absolutePath}")
- )
- } finally {
- file.delete()
- }
- }
-}
\ No newline at end of file
diff --git a/benchmark/benchmark-macro/src/androidTest/java/androidx/benchmark/macro/StartupTimingMetricTest.kt b/benchmark/benchmark-macro/src/androidTest/java/androidx/benchmark/macro/StartupTimingMetricTest.kt
index c5d3ca2..cfb5e4e 100644
--- a/benchmark/benchmark-macro/src/androidTest/java/androidx/benchmark/macro/StartupTimingMetricTest.kt
+++ b/benchmark/benchmark-macro/src/androidTest/java/androidx/benchmark/macro/StartupTimingMetricTest.kt
@@ -18,9 +18,9 @@
import android.content.Intent
import androidx.annotation.RequiresApi
-import androidx.benchmark.macro.perfetto.PerfettoCaptureWrapper
-import androidx.benchmark.macro.perfetto.PerfettoHelper.Companion.isAbiSupported
-import androidx.benchmark.macro.perfetto.createTempFileFromAsset
+import androidx.benchmark.Outputs
+import androidx.benchmark.perfetto.PerfettoCaptureWrapper
+import androidx.benchmark.perfetto.PerfettoHelper.Companion.isAbiSupported
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.LargeTest
import androidx.test.filters.MediumTest
@@ -32,6 +32,7 @@
import org.junit.Assume.assumeTrue
import org.junit.Test
import org.junit.runner.RunWith
+import java.io.File
import kotlin.test.assertEquals
import kotlin.test.assertNotNull
import kotlin.test.assertTrue
@@ -153,3 +154,15 @@
)!!
return metric.getMetrics(packageName, tracePath)
}
+
+@Suppress("SameParameterValue")
+internal fun createTempFileFromAsset(prefix: String, suffix: String): File {
+ val file = File.createTempFile(prefix, suffix, Outputs.dirUsableByAppAndShell)
+ InstrumentationRegistry
+ .getInstrumentation()
+ .context
+ .assets
+ .open(prefix + suffix)
+ .copyTo(file.outputStream())
+ return file
+}
diff --git a/benchmark/benchmark-macro/src/androidTest/java/androidx/benchmark/macro/perfetto/PerfettoCaptureTest.kt b/benchmark/benchmark-macro/src/androidTest/java/androidx/benchmark/macro/perfetto/PerfettoCaptureTest.kt
index 083add8..13ba705 100644
--- a/benchmark/benchmark-macro/src/androidTest/java/androidx/benchmark/macro/perfetto/PerfettoCaptureTest.kt
+++ b/benchmark/benchmark-macro/src/androidTest/java/androidx/benchmark/macro/perfetto/PerfettoCaptureTest.kt
@@ -1,5 +1,5 @@
/*
- * Copyright 2020 The Android Open Source Project
+ * Copyright 2021 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -20,8 +20,9 @@
import android.os.Build
import androidx.benchmark.macro.FileLinkingRule
import androidx.benchmark.macro.Packages
-import androidx.benchmark.macro.perfetto.PerfettoHelper.Companion.LOWEST_BUNDLED_VERSION_SUPPORTED
-import androidx.benchmark.macro.perfetto.PerfettoHelper.Companion.isAbiSupported
+import androidx.benchmark.perfetto.PerfettoCapture
+import androidx.benchmark.perfetto.PerfettoHelper.Companion.LOWEST_BUNDLED_VERSION_SUPPORTED
+import androidx.benchmark.perfetto.PerfettoHelper.Companion.isAbiSupported
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.LargeTest
import androidx.test.filters.SdkSuppress
@@ -40,6 +41,12 @@
import kotlin.test.assertEquals
import kotlin.test.assertFailsWith
+/**
+ * Tests for PerfettoCapture
+ *
+ * Note: this test is defined in benchmark-macro instead of benchmark-common so that it can
+ * validate trace contents with PerfettoTraceProcessor
+ */
@SdkSuppress(minSdkVersion = 28) // Lowering blocked by b/131359446
@RunWith(AndroidJUnit4::class)
class PerfettoCaptureTest {
diff --git a/benchmark/benchmark-macro/src/androidTest/java/androidx/benchmark/macro/perfetto/PerfettoTraceProcessorTest.kt b/benchmark/benchmark-macro/src/androidTest/java/androidx/benchmark/macro/perfetto/PerfettoTraceProcessorTest.kt
index f42d72cb..cf75adf 100644
--- a/benchmark/benchmark-macro/src/androidTest/java/androidx/benchmark/macro/perfetto/PerfettoTraceProcessorTest.kt
+++ b/benchmark/benchmark-macro/src/androidTest/java/androidx/benchmark/macro/perfetto/PerfettoTraceProcessorTest.kt
@@ -17,9 +17,9 @@
package androidx.benchmark.macro.perfetto
import androidx.benchmark.Shell
-import androidx.benchmark.macro.perfetto.PerfettoHelper.Companion.isAbiSupported
+import androidx.benchmark.macro.createTempFileFromAsset
+import androidx.benchmark.perfetto.PerfettoHelper.Companion.isAbiSupported
import androidx.test.ext.junit.runners.AndroidJUnit4
-import androidx.test.filters.SdkSuppress
import androidx.test.filters.SmallTest
import androidx.test.platform.app.InstrumentationRegistry
import org.junit.Assert.assertTrue
@@ -31,7 +31,6 @@
import kotlin.test.assertFailsWith
@SmallTest
-@SdkSuppress(minSdkVersion = 21)
@RunWith(AndroidJUnit4::class)
class PerfettoTraceProcessorTest {
@Test
@@ -120,4 +119,4 @@
assets.toSet().containsAll(entries)
)
}
-}
+}
\ No newline at end of file
diff --git a/benchmark/benchmark-macro/src/main/java/androidx/benchmark/macro/CompilationMode.kt b/benchmark/benchmark-macro/src/main/java/androidx/benchmark/macro/CompilationMode.kt
index d7dd831..7189521 100644
--- a/benchmark/benchmark-macro/src/main/java/androidx/benchmark/macro/CompilationMode.kt
+++ b/benchmark/benchmark-macro/src/main/java/androidx/benchmark/macro/CompilationMode.kt
@@ -17,8 +17,8 @@
package androidx.benchmark.macro
import android.util.Log
-import androidx.annotation.RequiresApi
import androidx.annotation.RestrictTo
+import androidx.benchmark.DeviceInfo
import androidx.benchmark.Shell
import androidx.benchmark.macro.CompilationMode.SpeedProfile
import androidx.profileinstaller.ProfileInstallReceiver
@@ -31,7 +31,6 @@
* For example, [SpeedProfile] will run a configurable number of profiling iterations to generate
* a profile, and use that to compile the target app.
*/
-@RequiresApi(21)
public sealed class CompilationMode(
// for modes other than [None], is argument passed `cmd package compile`
private val compileArgument: String?
@@ -95,7 +94,6 @@
*
* For more information: https://source.android.com/devices/tech/dalvik/jit-compiler
*/
-@RequiresApi(21)
internal fun CompilationMode.compile(packageName: String, block: () -> Unit) {
// Clear profile between runs.
Log.d(TAG, "Clearing profiles for $packageName")
@@ -181,7 +179,6 @@
* @suppress
*/
@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
-@RequiresApi(21)
public fun CompilationMode.isSupportedWithVmSettings(): Boolean {
val getProp = Shell.executeCommand("getprop dalvik.vm.extra-opts")
val vmRunningInterpretedOnly = getProp.contains("-Xusejit:false")
@@ -191,7 +188,6 @@
return vmRunningInterpretedOnly == interpreted
}
-@RequiresApi(21)
internal fun CompilationMode.assumeSupportedWithVmSettings() {
if (!isSupportedWithVmSettings()) {
throw AssumptionViolatedException(
@@ -219,7 +215,6 @@
/**
* Compiles the application.
*/
-@RequiresApi(21)
internal fun CompilationMode.compilePackage(packageName: String) {
Log.d(TAG, "Compiling $packageName ($this)")
val response = Shell.executeCommand(
diff --git a/benchmark/benchmark-macro/src/main/java/androidx/benchmark/macro/Macrobenchmark.kt b/benchmark/benchmark-macro/src/main/java/androidx/benchmark/macro/Macrobenchmark.kt
index b4fd16c..f8c16c0 100644
--- a/benchmark/benchmark-macro/src/main/java/androidx/benchmark/macro/Macrobenchmark.kt
+++ b/benchmark/benchmark-macro/src/main/java/androidx/benchmark/macro/Macrobenchmark.kt
@@ -20,15 +20,20 @@
import android.content.pm.PackageManager
import android.os.Build
import android.util.Log
-import androidx.annotation.RequiresApi
import androidx.annotation.RestrictTo
import androidx.benchmark.Arguments
import androidx.benchmark.BenchmarkResult
+import androidx.benchmark.ConfigurationError
+import androidx.benchmark.DeviceInfo
import androidx.benchmark.InstrumentationResults
import androidx.benchmark.ResultWriter
-import androidx.benchmark.macro.perfetto.PerfettoCaptureWrapper
-import androidx.benchmark.macro.perfetto.UiState
-import androidx.benchmark.macro.perfetto.appendUiState
+import androidx.benchmark.UserspaceTracing
+import androidx.benchmark.checkAndGetSuppressionState
+import androidx.benchmark.conditionalError
+import androidx.benchmark.perfetto.PerfettoCaptureWrapper
+import androidx.benchmark.perfetto.UiState
+import androidx.benchmark.perfetto.appendUiState
+import androidx.benchmark.userspaceTrace
import androidx.test.platform.app.InstrumentationRegistry
import java.io.File
@@ -93,7 +98,6 @@
*
* This function is a building block for public testing APIs
*/
-@RequiresApi(21)
private fun macrobenchmark(
uniqueName: String,
className: String,
@@ -249,7 +253,6 @@
*
* @suppress
*/
-@RequiresApi(21)
@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
public fun macrobenchmarkWithStartupMode(
uniqueName: String,
diff --git a/benchmark/benchmark-macro/src/main/java/androidx/benchmark/macro/MacrobenchmarkScope.kt b/benchmark/benchmark-macro/src/main/java/androidx/benchmark/macro/MacrobenchmarkScope.kt
index 939b9ce..471d8ea 100644
--- a/benchmark/benchmark-macro/src/main/java/androidx/benchmark/macro/MacrobenchmarkScope.kt
+++ b/benchmark/benchmark-macro/src/main/java/androidx/benchmark/macro/MacrobenchmarkScope.kt
@@ -18,7 +18,6 @@
import android.content.Intent
import android.util.Log
-import androidx.annotation.RequiresApi
import androidx.benchmark.Shell
import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.uiautomator.UiDevice
@@ -28,7 +27,6 @@
* Provides access to common operations in app automation, such as killing the app,
* or navigating home.
*/
-@RequiresApi(21)
public class MacrobenchmarkScope(
private val packageName: String,
/**
diff --git a/benchmark/benchmark-macro/src/main/java/androidx/benchmark/macro/Metric.kt b/benchmark/benchmark-macro/src/main/java/androidx/benchmark/macro/Metric.kt
index 374e6d0..21b784d 100644
--- a/benchmark/benchmark-macro/src/main/java/androidx/benchmark/macro/Metric.kt
+++ b/benchmark/benchmark-macro/src/main/java/androidx/benchmark/macro/Metric.kt
@@ -25,7 +25,6 @@
/**
* Metric interface.
*/
-@RequiresApi(21)
public sealed class Metric {
internal abstract fun configure(packageName: String)
@@ -41,7 +40,6 @@
internal abstract fun getMetrics(packageName: String, tracePath: String): MetricsWithUiState
}
-@RequiresApi(21)
public class FrameTimingMetric : Metric() {
private lateinit var packageName: String
private val helper = JankCollectionHelper()
diff --git a/benchmark/benchmark-macro/src/main/java/androidx/benchmark/macro/perfetto/PerfettoTraceProcessor.kt b/benchmark/benchmark-macro/src/main/java/androidx/benchmark/macro/perfetto/PerfettoTraceProcessor.kt
index 281155e..1c37f26 100644
--- a/benchmark/benchmark-macro/src/main/java/androidx/benchmark/macro/perfetto/PerfettoTraceProcessor.kt
+++ b/benchmark/benchmark-macro/src/main/java/androidx/benchmark/macro/perfetto/PerfettoTraceProcessor.kt
@@ -17,17 +17,16 @@
package androidx.benchmark.macro.perfetto
import android.util.Log
-import androidx.annotation.RequiresApi
import androidx.benchmark.Outputs
import androidx.benchmark.Shell
-import androidx.benchmark.macro.userspaceTrace
+import androidx.benchmark.perfetto.PerfettoHelper
+import androidx.benchmark.userspaceTrace
import org.jetbrains.annotations.TestOnly
import java.io.File
/**
* Enables parsing perfetto traces on-device
*/
-@RequiresApi(21)
internal object PerfettoTraceProcessor {
private const val TAG = "PerfettoTraceProcessor"
diff --git a/benchmark/benchmark/build.gradle b/benchmark/benchmark/build.gradle
index 09799ac..a69a0a3 100644
--- a/benchmark/benchmark/build.gradle
+++ b/benchmark/benchmark/build.gradle
@@ -21,16 +21,8 @@
id("androidx.benchmark")
}
-android {
- defaultConfig {
- // 18 needed for UI automator dependency, via benchmark-macro-junit4
- minSdkVersion 18
- }
-}
-
dependencies {
androidTestImplementation(project(":benchmark:benchmark-junit4"))
- androidTestImplementation(project(":benchmark:benchmark-macro-junit4"))
androidTestImplementation(project(":tracing:tracing-ktx"))
androidTestImplementation(libs.testRunner)
androidTestImplementation(libs.testRules)
diff --git a/benchmark/benchmark/src/androidTest/AndroidManifest.xml b/benchmark/benchmark/src/androidTest/AndroidManifest.xml
index b20d8c1..573a5bd 100644
--- a/benchmark/benchmark/src/androidTest/AndroidManifest.xml
+++ b/benchmark/benchmark/src/androidTest/AndroidManifest.xml
@@ -16,15 +16,9 @@
-->
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:tools="http://schemas.android.com/tools"
package="androidx.benchmark.benchmark.test">
-
- <!-- Important: disable debuggable for accurate performance results -->
- <application
- android:debuggable="false"
- tools:replace="android:debuggable">
- <!-- enable profileableByShell for non-intrusive profiling tools -->
- <!--suppress AndroidElementNotAllowed -->
+ <application>
+ <!-- enable profiling by shell for non-intrusive profiling tools -->
<profileable android:shell="true"/>
</application>
</manifest>
diff --git a/benchmark/benchmark/src/androidTest/java/androidx/benchmark/benchmark/PerfettoOverheadBenchmark.kt b/benchmark/benchmark/src/androidTest/java/androidx/benchmark/benchmark/PerfettoOverheadBenchmark.kt
index 0b09e96..f2bfd74 100644
--- a/benchmark/benchmark/src/androidTest/java/androidx/benchmark/benchmark/PerfettoOverheadBenchmark.kt
+++ b/benchmark/benchmark/src/androidTest/java/androidx/benchmark/benchmark/PerfettoOverheadBenchmark.kt
@@ -17,8 +17,8 @@
package androidx.benchmark.benchmark
import androidx.benchmark.junit4.BenchmarkRule
+import androidx.benchmark.junit4.PerfettoRule
import androidx.benchmark.junit4.measureRepeated
-import androidx.benchmark.macro.junit4.PerfettoRule
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.LargeTest
import androidx.tracing.Trace
diff --git a/benchmark/integration-tests/macrobenchmark-target/src/main/AndroidManifest.xml b/benchmark/integration-tests/macrobenchmark-target/src/main/AndroidManifest.xml
index 45da2fe..3126a21 100644
--- a/benchmark/integration-tests/macrobenchmark-target/src/main/AndroidManifest.xml
+++ b/benchmark/integration-tests/macrobenchmark-target/src/main/AndroidManifest.xml
@@ -26,7 +26,6 @@
tools:ignore="MissingApplicationIcon">
<!-- Profileable to enable macrobenchmark profiling -->
- <!--suppress AndroidElementNotAllowed -->
<profileable android:shell="true"/>
<!--
diff --git a/benchmark/integration-tests/startup-benchmark/src/androidTest/AndroidManifest.xml b/benchmark/integration-tests/startup-benchmark/src/androidTest/AndroidManifest.xml
index 3362f60..ffa7768 100644
--- a/benchmark/integration-tests/startup-benchmark/src/androidTest/AndroidManifest.xml
+++ b/benchmark/integration-tests/startup-benchmark/src/androidTest/AndroidManifest.xml
@@ -16,15 +16,10 @@
-->
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:tools="http://schemas.android.com/tools"
package="androidx.benchmark.integration.startup.benchmark.test">
<application
- android:name="androidx.benchmark.integration.startup.benchmark.ArgumentInjectingApplication"
- android:debuggable="false"
- tools:ignore="HardcodedDebugMode"
- tools:replace="android:debuggable">
- <!-- enable profileableByShell for non-intrusive profiling tools -->
- <!--suppress AndroidElementNotAllowed -->
- <profileable shell="true"/>
+ android:name="androidx.benchmark.integration.startup.benchmark.ArgumentInjectingApplication">
+ <!-- enable profiling by shell for non-intrusive profiling tools -->
+ <profileable android:shell="true"/>
</application>
</manifest>
diff --git a/biometric/biometric/src/main/res/values-te/strings.xml b/biometric/biometric/src/main/res/values-te/strings.xml
index bf81e43..07712d5 100644
--- a/biometric/biometric/src/main/res/values-te/strings.xml
+++ b/biometric/biometric/src/main/res/values-te/strings.xml
@@ -22,8 +22,8 @@
<string name="fingerprint_error_hw_not_available" msgid="8216738333501875566">"వేలిముద్ర హార్డ్వేర్ అందుబాటులో లేదు."</string>
<string name="fingerprint_error_no_fingerprints" msgid="7520712796891883488">"వేలిముద్రలు నమోదు చేయబడలేదు."</string>
<string name="fingerprint_error_hw_not_present" msgid="6306988885793029438">"ఈ పరికరంలో వేలిముద్ర సెన్సార్ లేదు"</string>
- <string name="fingerprint_error_user_canceled" msgid="7627716295344353987">"వేలిముద్ర చర్యని వినియోగదారు రద్దు చేసారు."</string>
- <string name="fingerprint_error_lockout" msgid="7291787166416782245">"చాలా ఎక్కువ ప్రయత్నాలు చేసారు. దయచేసి తర్వాత మళ్లీ ప్రయత్నించండి."</string>
+ <string name="fingerprint_error_user_canceled" msgid="7627716295344353987">"వేలిముద్ర చర్యని వినియోగదారు రద్దు చేశారు."</string>
+ <string name="fingerprint_error_lockout" msgid="7291787166416782245">"చాలా ఎక్కువ ప్రయత్నాలు చేశారు. దయచేసి తర్వాత మళ్లీ ప్రయత్నించండి."</string>
<string name="default_error_msg" msgid="4776854077120974966">"తెలియని ఎర్రర్"</string>
<string name="generic_error_user_canceled" msgid="7309881387583143581">"వినియోగదారు ద్వారా ప్రామాణీకరణ రద్దు చేయబడింది"</string>
<string name="confirm_device_credential_password" msgid="5912733858573823945">"పాస్వర్డ్ను ఉపయోగించు"</string>
diff --git a/biometric/buildSrc b/biometric/buildSrc
new file mode 120000
index 0000000..053a423
--- /dev/null
+++ b/biometric/buildSrc
@@ -0,0 +1 @@
+../buildSrc
\ No newline at end of file
diff --git a/browser/browser/src/androidTest/java/androidx/browser/browseractions/BrowserActionsIntentTest.java b/browser/browser/src/androidTest/java/androidx/browser/browseractions/BrowserActionsIntentTest.java
index 7dae296..c2f93fa 100644
--- a/browser/browser/src/androidTest/java/androidx/browser/browseractions/BrowserActionsIntentTest.java
+++ b/browser/browser/src/androidTest/java/androidx/browser/browseractions/BrowserActionsIntentTest.java
@@ -105,6 +105,6 @@
static PendingIntent createCustomItemAction(String url) {
Context context = ApplicationProvider.getApplicationContext();
Intent customIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
- return PendingIntent.getActivity(context, 0, customIntent, 0);
+ return PendingIntent.getActivity(context, 0, customIntent, PendingIntent.FLAG_IMMUTABLE);
}
}
diff --git a/buildSrc-tests/max-dep-versions/buildSrc-tests-max-dep-versions-dep/build.gradle b/buildSrc-tests/max-dep-versions/buildSrc-tests-max-dep-versions-dep/build.gradle
index f835c39..5acb938 100644
--- a/buildSrc-tests/max-dep-versions/buildSrc-tests-max-dep-versions-dep/build.gradle
+++ b/buildSrc-tests/max-dep-versions/buildSrc-tests-max-dep-versions-dep/build.gradle
@@ -1,4 +1,5 @@
import androidx.build.LibraryGroups
+import androidx.build.LibraryType
import androidx.build.Publish
plugins {
@@ -10,6 +11,7 @@
name = "Sample Library"
publish = Publish.SNAPSHOT_AND_RELEASE
mavenGroup = LibraryGroups.BUILDSRC_TESTS
+ type = LibraryType.SAMPLES
inceptionYear = "2020"
description = "This is a sample library for confirming that maxDepVersions builds work correctly"
}
diff --git a/buildSrc-tests/max-dep-versions/buildSrc-tests-max-dep-versions-main/build.gradle b/buildSrc-tests/max-dep-versions/buildSrc-tests-max-dep-versions-main/build.gradle
index 56d1cc00..fa6e75cb 100644
--- a/buildSrc-tests/max-dep-versions/buildSrc-tests-max-dep-versions-main/build.gradle
+++ b/buildSrc-tests/max-dep-versions/buildSrc-tests-max-dep-versions-main/build.gradle
@@ -1,4 +1,5 @@
import androidx.build.LibraryGroups
+import androidx.build.LibraryType
plugins {
id("AndroidXPlugin")
@@ -12,6 +13,7 @@
androidx {
name = "Sample Dependent library"
mavenGroup = LibraryGroups.BUILDSRC_TESTS
+ type = LibraryType.SAMPLES
inceptionYear = "2020"
description = "This is a sample library for confirming that maxDepVersions builds work correctly"
}
diff --git a/buildSrc/out.gradle b/buildSrc/out.gradle
index 36a2b69..c0cac65 100644
--- a/buildSrc/out.gradle
+++ b/buildSrc/out.gradle
@@ -23,7 +23,11 @@
*/
def outDir = System.env.OUT_DIR
if (outDir == null) {
- outDir = new File("${buildscript.sourceFile.parent}/../../../out${subdir}")
+ def checkoutRoot = System.getProperty("CHECKOUT_ROOT")
+ if (checkoutRoot == null) {
+ checkoutRoot = new File("${buildscript.sourceFile.parent}/../../..")
+ }
+ outDir = new File("${checkoutRoot}/out${subdir}")
} else {
outDir = new File(outDir)
}
diff --git a/buildSrc/plugins/src/main/kotlin/androidx/build/AndroidXComposePlugin.kt b/buildSrc/plugins/src/main/kotlin/androidx/build/AndroidXComposePlugin.kt
index 4085989..2f869d4 100644
--- a/buildSrc/plugins/src/main/kotlin/androidx/build/AndroidXComposePlugin.kt
+++ b/buildSrc/plugins/src/main/kotlin/androidx/build/AndroidXComposePlugin.kt
@@ -22,15 +22,24 @@
import com.android.build.gradle.LibraryExtension
import com.android.build.gradle.LibraryPlugin
import com.android.build.gradle.TestedExtension
+import com.android.build.gradle.internal.lint.AndroidLintAnalysisTask
+import com.android.build.gradle.internal.lint.AndroidLintTask
+import com.android.build.gradle.internal.lint.LintModelWriterTask
+import com.android.build.gradle.internal.lint.VariantInputs
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.api.artifacts.type.ArtifactTypeDefinition
import org.gradle.api.attributes.Attribute
+import org.gradle.api.file.ConfigurableFileCollection
import org.gradle.api.tasks.ClasspathNormalizer
import org.gradle.kotlin.dsl.apply
import org.gradle.kotlin.dsl.findByType
+import org.gradle.kotlin.dsl.withType
+import org.jetbrains.kotlin.commonizer.util.transitiveClosure
+import org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension
import org.jetbrains.kotlin.gradle.plugin.KotlinBasePluginWrapper
import org.jetbrains.kotlin.gradle.plugin.KotlinMultiplatformPluginWrapper
+import org.jetbrains.kotlin.gradle.plugin.KotlinSourceSet
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
const val composeSourceOption =
@@ -67,9 +76,11 @@
}
companion object {
+
@JvmStatic
fun Project.isMultiplatformEnabled(): Boolean {
- return properties.get(COMPOSE_MPP_ENABLED)?.toString()?.toBoolean() ?: false
+ return properties.get(COMPOSE_MPP_ENABLED)?.toString()?.toBoolean()
+ ?: androidxExtension()?.multiplatform ?: false
}
/**
@@ -100,13 +111,16 @@
}
}
+ private fun Project.androidxExtension(): AndroidXExtension? {
+ return extensions.findByType(AndroidXExtension::class.java)
+ }
+
private fun Project.configureAndroidCommonOptions(testedExtension: TestedExtension) {
testedExtension.defaultConfig.minSdk = 21
@Suppress("UnstableApiUsage")
extensions.findByType(AndroidComponentsExtension::class.java)!!.finalizeDsl {
- val isPublished = extensions.findByType(AndroidXExtension::class.java)
- ?.type == LibraryType.PUBLISHED_LIBRARY
+ val isPublished = androidxExtension()?.type == LibraryType.PUBLISHED_LIBRARY
@Suppress("DEPRECATION") // lintOptions methods
testedExtension.lintOptions.apply {
@@ -268,6 +282,8 @@
}
}
+ configureLintForMultiplatformLibrary(multiplatformExtension)
+
afterEvaluate {
if (multiplatformExtension.targets.findByName("jvm") != null) {
tasks.named("jvmTestClasses").also(::addToBuildOnServer)
@@ -324,3 +340,76 @@
}
}
}
+
+/**
+ * Adds missing MPP sourcesets (such as commonMain) to the Lint tasks
+ *
+ * TODO: b/195329463
+ * Lint is not aware of MPP, and MPP doesn't configure Lint. There is no built-in
+ * API to adjust the default Lint task's sources, so we use this hack to manually
+ * add sources for MPP source sets. In the future with the new Kotlin Project Model
+ * (https://youtrack.jetbrains.com/issue/KT-42572) and an AGP / MPP integration
+ * plugin this will no longer be needed.
+ */
+private fun Project.configureLintForMultiplatformLibrary(
+ multiplatformExtension: KotlinMultiplatformExtension
+) {
+ afterEvaluate {
+ // This workaround only works for libraries (apps would require changes to a different
+ // task). Given that we currently do not have any MPP app projects, this should never
+ // happen.
+ project.extensions.findByType<LibraryExtension>()
+ ?: return@afterEvaluate
+ val androidMain = multiplatformExtension.sourceSets.findByName("androidMain")
+ ?: return@afterEvaluate
+ // Get all the sourcesets androidMain transitively / directly depends on
+ val dependencies = transitiveClosure(androidMain, KotlinSourceSet::dependsOn)
+
+ /**
+ * Helper function to add the missing sourcesets to this [VariantInputs]
+ */
+ fun VariantInputs.addSourceSets() {
+ // Each variant has a source provider for the variant (such as debug) and the 'main'
+ // variant. The actual files that Lint will run on is both of these providers
+ // combined - so we can just add the dependencies to the first we see.
+ val sourceProvider = sourceProviders.get().firstOrNull() ?: return
+ dependencies.forEach { sourceSet ->
+ sourceProvider.javaDirectories.withChangesAllowed {
+ from(sourceSet.kotlin.sourceDirectories)
+ }
+ }
+ }
+
+ // Lint for libraries is split into two tasks - analysis, and reporting. We need to
+ // add the new sources to both, so all parts of the pipeline are aware.
+ project.tasks.withType<AndroidLintAnalysisTask>().configureEach {
+ it.variantInputs.addSourceSets()
+ }
+
+ project.tasks.withType<AndroidLintTask>().configureEach {
+ it.variantInputs.addSourceSets()
+ }
+
+ // Also configure the model writing task, so that we don't run into mismatches between
+ // analyzed sources in one module and a downstream module
+ project.tasks.withType<LintModelWriterTask>().configureEach {
+ it.variantInputs.addSourceSets()
+ }
+ }
+}
+
+/**
+ * Lint uses [ConfigurableFileCollection.disallowChanges] during initialization, which prevents
+ * modifying the file collection separately (there is no time to configure it before AGP has
+ * initialized and disallowed changes). This uses reflection to temporarily allow changes, and
+ * apply [block].
+ */
+private fun ConfigurableFileCollection.withChangesAllowed(
+ block: ConfigurableFileCollection.() -> Unit
+) {
+ val disallowChanges = this::class.java.getDeclaredField("disallowChanges")
+ disallowChanges.isAccessible = true
+ disallowChanges.set(this, false)
+ block()
+ disallowChanges.set(this, true)
+}
diff --git a/buildSrc/plugins/src/main/kotlin/androidx/build/AndroidXPlugin.kt b/buildSrc/plugins/src/main/kotlin/androidx/build/AndroidXPlugin.kt
index a065882..bf2dfb4 100644
--- a/buildSrc/plugins/src/main/kotlin/androidx/build/AndroidXPlugin.kt
+++ b/buildSrc/plugins/src/main/kotlin/androidx/build/AndroidXPlugin.kt
@@ -153,22 +153,23 @@
// (which is higher than the current maximum granularity that Gradle offers (3))
minGranularity = 1000
}
- val htmlReport = task.reports.html
+ val testTaskName = task.name
+ val capitalizedTestTaskName = testTaskName.replaceFirstChar {
+ if (it.isLowerCase()) it.titlecase(Locale.getDefault()) else it.toString()
+ }
val zipHtmlTask = project.tasks.register(
- "zipHtmlResultsOf${task.name.replaceFirstChar {
- if (it.isLowerCase()) it.titlecase(Locale.getDefault()) else it.toString()
- }}",
+ "zipHtmlResultsOf$capitalizedTestTaskName",
Zip::class.java
) {
val destinationDirectory = File("$xmlReportDestDir-html")
it.destinationDirectory.set(destinationDirectory)
it.archiveFileName.set(archiveName)
- it.doLast {
+ it.doLast { zip ->
// If the test itself didn't display output, then the report task should
// remind the user where to find its output
- project.logger.lifecycle(
- "Html results of ${task.name} zipped into " +
+ zip.logger.lifecycle(
+ "Html results of $testTaskName zipped into " +
"$destinationDirectory/$archiveName"
)
}
@@ -176,15 +177,13 @@
task.finalizedBy(zipHtmlTask)
task.doFirst {
zipHtmlTask.configure {
- it.from(htmlReport.outputLocation)
+ it.from(task.reports.html.outputLocation)
}
}
val xmlReport = task.reports.junitXml
if (xmlReport.required.get()) {
val zipXmlTask = project.tasks.register(
- "zipXmlResultsOf${task.name.replaceFirstChar {
- if (it.isLowerCase()) it.titlecase(Locale.getDefault()) else it.toString()
- }}",
+ "zipXmlResultsOf$capitalizedTestTaskName",
Zip::class.java
) {
it.destinationDirectory.set(xmlReportDestDir)
@@ -393,18 +392,13 @@
private fun Project.configureProjectStructureValidation(
extension: AndroidXExtension
) {
- val validateProjectStructure = tasks.register(
- "validateProjectStructure",
- ValidateProjectStructureTask::class.java,
- )
-
// AndroidXExtension.mavenGroup is not readable until afterEvaluate.
afterEvaluate {
- validateProjectStructure.configure { task ->
- val type = extension.type
- task.enabled = extension.mavenGroup != null &&
- (type == LibraryType.PUBLISHED_LIBRARY || type == LibraryType.UNSET)
- task.libraryGroup.set(extension.mavenGroup)
+ val mavenGroup = extension.mavenGroup
+ val isProbablyPublished = extension.type == LibraryType.PUBLISHED_LIBRARY ||
+ extension.type == LibraryType.UNSET
+ if (mavenGroup != null && isProbablyPublished) {
+ validateProjectStructure(mavenGroup.group)
}
}
}
@@ -880,3 +874,42 @@
return false
}
+
+private const val GROUP_PREFIX = "androidx."
+
+/**
+ * Validates the project structure against Jetpack guidelines.
+ */
+fun Project.validateProjectStructure(groupId: String) {
+ // TODO(b/197253160): Re-enable this check for playground. For unknown reasons in playground
+ // builds, automatically generated parent projects such as :activity are incorrectly
+ // inheriting their children's build file which causes the AndroidXPlugin to get applied.
+ if (studioType() == StudioType.PLAYGROUND) {
+ return
+ }
+
+ val shortGroupId = if (groupId.startsWith(GROUP_PREFIX)) {
+ groupId.substring(GROUP_PREFIX.length)
+ } else {
+ groupId
+ }
+
+ // Fully-qualified Gradle project name should match the Maven coordinate.
+ val expectName = ":${shortGroupId.replace(".",":")}:${project.name}"
+ val actualName = project.path
+ if (expectName != actualName) {
+ throw GradleException(
+ "Invalid project structure! Expected $expectName as project name, found $actualName"
+ )
+ }
+
+ // Project directory should match the Maven coordinate.
+ val expectDir = shortGroupId.replace(".", File.separator) +
+ "${File.separator}${project.name}"
+ val actualDir = project.projectDir.toRelativeString(project.getSupportRootFolder())
+ if (expectDir != actualDir) {
+ throw GradleException(
+ "Invalid project structure! Expected $expectDir as project directory, found $actualDir"
+ )
+ }
+}
diff --git a/buildSrc/plugins/src/main/kotlin/androidx/build/AndroidXRootPlugin.kt b/buildSrc/plugins/src/main/kotlin/androidx/build/AndroidXRootPlugin.kt
index 2e1a200..0c2e98f 100644
--- a/buildSrc/plugins/src/main/kotlin/androidx/build/AndroidXRootPlugin.kt
+++ b/buildSrc/plugins/src/main/kotlin/androidx/build/AndroidXRootPlugin.kt
@@ -94,7 +94,7 @@
val createArchiveTask = Release.getGlobalFullZipTask(this)
buildOnServerTask.dependsOn(createArchiveTask)
val partiallyDejetifyArchiveTask = partiallyDejetifyArchiveTask(
- createArchiveTask.get().archiveFile
+ createArchiveTask.flatMap { it.archiveFile }
)
if (partiallyDejetifyArchiveTask != null)
buildOnServerTask.dependsOn(partiallyDejetifyArchiveTask)
diff --git a/buildSrc/private/src/main/kotlin/androidx/build/AndroidXExtension.kt b/buildSrc/private/src/main/kotlin/androidx/build/AndroidXExtension.kt
index 35cbbb7..841c8d4 100644
--- a/buildSrc/private/src/main/kotlin/androidx/build/AndroidXExtension.kt
+++ b/buildSrc/private/src/main/kotlin/androidx/build/AndroidXExtension.kt
@@ -159,6 +159,8 @@
var benchmarkRunAlsoInterpreted = false
+ var multiplatform = false
+
fun shouldEnforceKotlinStrictApiMode(): Boolean {
return !legacyDisableKotlinStrictApiMode &&
shouldConfigureApiTasks()
diff --git a/buildSrc/private/src/main/kotlin/androidx/build/Jetify.kt b/buildSrc/private/src/main/kotlin/androidx/build/Jetify.kt
index f2e5dde..85faa23 100644
--- a/buildSrc/private/src/main/kotlin/androidx/build/Jetify.kt
+++ b/buildSrc/private/src/main/kotlin/androidx/build/Jetify.kt
@@ -96,7 +96,9 @@
"m2repository/androidx/sharetarget/**"
)
-fun Project.partiallyDejetifyArchiveTask(archiveFile: Provider<RegularFile>): TaskProvider<Exec>? {
+fun Project.partiallyDejetifyArchiveTask(
+ archiveFile: Provider<RegularFile>
+): TaskProvider<Exec>? {
return findProject(":jetifier:jetifier-standalone")?.let { standaloneProject ->
val stripTask = stripArchiveForPartialDejetificationTask(archiveFile)
@@ -105,10 +107,10 @@
"top-of-tree-m2repository-partially-dejetified-${getBuildId()}.zip"
val jetifierBin = "${standaloneProject.buildDir}/install/jetifier-standalone/bin/" +
"jetifier-standalone"
- val migrationConfig = "${standaloneProject.projectDir.getParentFile()}/migration.config"
+ val migrationConfig = "${standaloneProject.projectDir.parentFile}/migration.config"
it.dependsOn(stripTask)
- it.inputs.file(stripTask.get().archiveFile)
+ it.inputs.file(stripTask.flatMap { it.archiveFile })
it.outputs.file(outputFileName)
it.commandLine = listOf(
@@ -124,13 +126,14 @@
}
}
-fun Project.stripArchiveForPartialDejetificationTask(archiveFile: Provider<RegularFile>):
- TaskProvider<Zip> {
- return tasks.register("stripArchiveForPartialDejetification", Zip::class.java) {
- it.dependsOn(rootProject.tasks.named(Release.FULL_ARCHIVE_TASK_NAME))
- it.from(zipTree(archiveFile))
- it.destinationDirectory.set(rootProject.buildDir)
- it.archiveFileName.set("stripped_archive_partial.zip")
- it.include(archivesToDejetify)
- }
+fun Project.stripArchiveForPartialDejetificationTask(
+ archiveFile: Provider<RegularFile>
+): TaskProvider<Zip> {
+ return tasks.register("stripArchiveForPartialDejetification", Zip::class.java) {
+ it.dependsOn(rootProject.tasks.named(Release.FULL_ARCHIVE_TASK_NAME))
+ it.from(zipTree(archiveFile))
+ it.destinationDirectory.set(rootProject.buildDir)
+ it.archiveFileName.set("stripped_archive_partial.zip")
+ it.include(archivesToDejetify)
}
+}
diff --git a/buildSrc/private/src/main/kotlin/androidx/build/MavenUploadHelper.kt b/buildSrc/private/src/main/kotlin/androidx/build/MavenUploadHelper.kt
index 9bc6e49..a891f0b 100644
--- a/buildSrc/private/src/main/kotlin/androidx/build/MavenUploadHelper.kt
+++ b/buildSrc/private/src/main/kotlin/androidx/build/MavenUploadHelper.kt
@@ -23,8 +23,8 @@
import org.gradle.api.Project
import org.gradle.api.XmlProvider
import org.gradle.api.artifacts.Dependency
-import org.gradle.api.artifacts.ProjectDependency
import org.gradle.api.component.SoftwareComponent
+import org.gradle.api.provider.Provider
import org.gradle.api.publish.PublishingExtension
import org.gradle.api.publish.maven.MavenPom
import org.gradle.api.publish.maven.MavenPublication
@@ -57,6 +57,27 @@
"${androidxGroup.group.replace('.', '/')}/$name"
)
group = androidxGroup.group
+
+ /*
+ * Provides a set of maven coordinates (groupId:artifactId) of artifacts in AndroidX
+ * that are Android Libraries.
+ */
+ val androidLibrariesSetProvider: Provider<Set<String>> = provider {
+ val androidxAndroidProjects = mutableSetOf<String>()
+ // Check every project is the project map to see if they are an Android Library
+ val projectModules = project.getProjectsMap()
+ for ((mavenCoordinates, projectPath) in projectModules) {
+ project.findProject(projectPath)?.plugins?.hasPlugin(
+ LibraryPlugin::class.java
+ )?.let { hasLibraryPlugin ->
+ if (hasLibraryPlugin) {
+ androidxAndroidProjects.add(mavenCoordinates)
+ }
+ }
+ }
+ androidxAndroidProjects
+ }
+
configure<PublishingExtension> {
repositories {
it.maven { repo ->
@@ -82,7 +103,7 @@
publications.withType(MavenPublication::class.java).all {
it.pom { pom ->
addInformativeMetadata(extension, pom)
- tweakDependenciesMetadata(androidxGroup, pom)
+ tweakDependenciesMetadata(androidxGroup, pom, androidLibrariesSetProvider)
}
}
}
@@ -185,9 +206,10 @@
}
}
-private fun Project.tweakDependenciesMetadata(
+private fun tweakDependenciesMetadata(
mavenGroup: LibraryGroup,
- pom: MavenPom
+ pom: MavenPom,
+ androidLibrariesSetProvider: Provider<Set<String>>
) {
pom.withXml { xml ->
// The following code depends on getProjectsMap which is only available late in
@@ -196,18 +218,16 @@
// For more context see:
// https://android-review.googlesource.com/c/platform/frameworks/support/+/1144664/8/buildSrc/src/main/kotlin/androidx/build/MavenUploadHelper.kt#177
assignSingleVersionDependenciesInGroupForPom(xml, mavenGroup)
- assignAarTypes(xml)
+ assignAarTypes(xml, androidLibrariesSetProvider)
}
}
// TODO(aurimas): remove this when Gradle bug is fixed.
// https://github.com/gradle/gradle/issues/3170
-private fun Project.assignAarTypes(xml: XmlProvider) {
- val androidxDependencies = HashSet<Dependency>()
- collectDependenciesForConfiguration(androidxDependencies, "api")
- collectDependenciesForConfiguration(androidxDependencies, "implementation")
- collectDependenciesForConfiguration(androidxDependencies, "compile")
-
+private fun assignAarTypes(
+ xml: XmlProvider,
+ androidLibrariesSetProvider: Provider<Set<String>>
+) {
val dependencies = xml.asNode().children().find {
it is Node && it.name().toString().endsWith("dependencies")
} as Node?
@@ -222,9 +242,8 @@
val artifactId = dep.children().first {
it is Node && it.name().toString().endsWith("artifactId")
} as Node
- if (isAndroidProject(
- groupId.children()[0] as String,
- artifactId.children()[0] as String, androidxDependencies
+ if (androidLibrariesSetProvider.get().contains(
+ "${groupId.children()[0] as String}:${artifactId.children()[0] as String}"
)
) {
dep.appendNode("type", "aar")
@@ -295,25 +314,6 @@
}
}
-private fun Project.isAndroidProject(
- groupId: String,
- artifactId: String,
- deps: Set<Dependency>
-): Boolean {
- for (dep in deps) {
- if (dep is ProjectDependency) {
- if (dep.group == groupId && dep.name == artifactId) {
- return dep.dependencyProject.plugins.hasPlugin(LibraryPlugin::class.java)
- }
- }
- }
- val projectModules = project.getProjectsMap()
- projectModules["$groupId:$artifactId"]?.let { module ->
- return project.findProject(module)?.plugins?.hasPlugin(LibraryPlugin::class.java) ?: false
- }
- return false
-}
-
private fun Project.appliesJavaGradlePluginPlugin() = pluginManager.hasPlugin("java-gradle-plugin")
private const val ANDROID_GIT_URL =
diff --git a/buildSrc/private/src/main/kotlin/androidx/build/SaveSystemStatsTask.kt b/buildSrc/private/src/main/kotlin/androidx/build/SaveSystemStatsTask.kt
index dfd3315..d0ec1c1 100644
--- a/buildSrc/private/src/main/kotlin/androidx/build/SaveSystemStatsTask.kt
+++ b/buildSrc/private/src/main/kotlin/androidx/build/SaveSystemStatsTask.kt
@@ -46,7 +46,12 @@
val outputFile: Property<File> = project.objects.property(File::class.java)
@TaskAction
fun exec() {
+ val outputFile = outputFile.get()
+ if (outputFile.exists()) {
+ // b/196115864 : make backup of file so we can know what changed
+ outputFile.copyTo(File(outputFile.path + ".prev"))
+ }
val statsText = "num processors = ${getNumProcessors()}, total memory = ${getTotalMemory()}"
- outputFile.get().writeText(statsText)
+ outputFile.writeText(statsText)
}
}
diff --git a/buildSrc/private/src/main/kotlin/androidx/build/ValidateProjectStructureTask.kt b/buildSrc/private/src/main/kotlin/androidx/build/ValidateProjectStructureTask.kt
deleted file mode 100644
index 3e4548f..0000000
--- a/buildSrc/private/src/main/kotlin/androidx/build/ValidateProjectStructureTask.kt
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Copyright 2021 The Android Open Source Project
- *
- * 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.
- */
-
-package androidx.build
-
-import androidx.build.uptodatedness.cacheEvenIfNoOutputs
-import org.gradle.api.DefaultTask
-import org.gradle.api.GradleException
-import org.gradle.api.provider.Property
-import org.gradle.api.tasks.Input
-import org.gradle.api.tasks.Optional
-import org.gradle.api.tasks.TaskAction
-import java.io.File
-
-/**
- * Task that validates a Jetpack library's Gradle project structure, including the fully-qualified
- * Gradle project name and project directory.
- */
-abstract class ValidateProjectStructureTask : DefaultTask() {
-
- init {
- group = "Verification"
- description = "Task for verifying Jetpack library Gradle project structure"
-
- cacheEvenIfNoOutputs()
- }
-
- @get:Input
- @get:Optional
- abstract val libraryGroup: Property<LibraryGroup>
-
- @TaskAction
- fun validateProjectStructure() {
- val groupId = libraryGroup.orNull?.group ?: return
- val shortGroupId = if (groupId.startsWith(GROUP_PREFIX)) {
- groupId.substring(GROUP_PREFIX.length)
- } else {
- groupId
- }
-
- // Fully-qualified Gradle project name should match the Maven coordinate.
- val expectedName = ":${shortGroupId.replace(".",":")}:${project.name}"
- val actualName = project.path
- if (expectedName != actualName) {
- throw GradleException("Expected $expectedName as project name, found $actualName")
- }
-
- // Project directory should match the Maven coordinate.
- val expectedDir = shortGroupId.replace(".", File.separator) +
- "${File.separator}${project.name}"
- val actualDir = project.projectDir.toRelativeString(project.rootDir)
- if (expectedDir != actualDir) {
- throw GradleException("Expected $expectedDir as project directory, found $actualDir")
- }
- }
-}
-
-private const val GROUP_PREFIX = "androidx."
diff --git a/buildSrc/private/src/main/kotlin/androidx/build/dackka/DackkaTask.kt b/buildSrc/private/src/main/kotlin/androidx/build/dackka/DackkaTask.kt
index 23cb360..535ee88 100644
--- a/buildSrc/private/src/main/kotlin/androidx/build/dackka/DackkaTask.kt
+++ b/buildSrc/private/src/main/kotlin/androidx/build/dackka/DackkaTask.kt
@@ -21,10 +21,13 @@
import org.gradle.api.file.FileCollection
import org.gradle.api.provider.ListProperty
import org.gradle.api.provider.SetProperty
+import org.gradle.api.tasks.CacheableTask
import org.gradle.api.tasks.Classpath
import org.gradle.api.tasks.Input
import org.gradle.api.tasks.InputFiles
import org.gradle.api.tasks.OutputDirectory
+import org.gradle.api.tasks.PathSensitive
+import org.gradle.api.tasks.PathSensitivity
import org.gradle.api.tasks.TaskAction
import org.gradle.process.ExecOperations
import org.gradle.workers.WorkAction
@@ -33,6 +36,7 @@
import java.io.File
import javax.inject.Inject
+@CacheableTask
abstract class DackkaTask @Inject constructor(
private val workerExecutor: WorkerExecutor
) : DefaultTask() {
@@ -42,27 +46,27 @@
abstract val dackkaClasspath: ConfigurableFileCollection
// Classpath containing dependencys of libraries needed to resolve types in docs
- @InputFiles
+ @get:[InputFiles Classpath]
lateinit var dependenciesClasspath: FileCollection
// Directory containing the code samples from framework
- @InputFiles
+ @get:[InputFiles PathSensitive(PathSensitivity.RELATIVE)]
lateinit var frameworkSamplesDir: File
// Directory containing the code samples
- @InputFiles
+ @get:[InputFiles PathSensitive(PathSensitivity.RELATIVE)]
lateinit var samplesDir: File
// Directory containing the source code for Dackka to process
- @InputFiles
+ @get:[InputFiles PathSensitive(PathSensitivity.RELATIVE)]
lateinit var sourcesDir: File
// Directory containing the docs project and package-lists
- @InputFiles
+ @get:[InputFiles PathSensitive(PathSensitivity.RELATIVE)]
lateinit var docsProjectDir: File
// Location of generated reference docs
- @OutputDirectory
+ @get:OutputDirectory
lateinit var destinationDir: File
// Set of packages to exclude for refdoc generation for all languages
diff --git a/buildSrc/private/src/main/kotlin/androidx/build/studio/StudioTask.kt b/buildSrc/private/src/main/kotlin/androidx/build/studio/StudioTask.kt
index 9d4dede..15910c1 100644
--- a/buildSrc/private/src/main/kotlin/androidx/build/studio/StudioTask.kt
+++ b/buildSrc/private/src/main/kotlin/androidx/build/studio/StudioTask.kt
@@ -128,6 +128,12 @@
@get:Internal
protected abstract val studioArchiveCreator: StudioArchiveCreator
+ /**
+ * List of additional environment variables to pass into the Studio application.
+ */
+ @get:Internal
+ open val additionalEnvironmentProperties: Map<String, String> = emptyMap()
+
private val licenseAcceptedFile: File by lazy {
File("$studioInstallationDir/STUDIOW_LICENSE_ACCEPTED")
}
@@ -199,7 +205,7 @@
// Studio-initiated Gradle tasks are run against the same version of AGP that was
// used to start Studio, which prevents version mismatch after repo sync.
"EXPECTED_AGP_VERSION" to ANDROID_GRADLE_PLUGIN_VERSION
- )
+ ) + additionalEnvironmentProperties
// Append to the existing environment variables set by gradlew and the user.
environment().putAll(additionalStudioEnvironmentProperties)
@@ -268,6 +274,8 @@
*/
override val requiresProjectList get() = false
override val installParentDir get() = supportRootFolder
+ override val additionalEnvironmentProperties: Map<String, String>
+ get() = mapOf("ALLOW_PUBLIC_REPOS" to "true")
override val ideaProperties
get() = supportRootFolder.resolve("../playground-common/idea.properties")
override val vmOptions
diff --git a/buildSrc/private/src/main/kotlin/androidx/build/uptodatedness/TaskUpToDateValidator.kt b/buildSrc/private/src/main/kotlin/androidx/build/uptodatedness/TaskUpToDateValidator.kt
index 5bfa736..d360c47 100644
--- a/buildSrc/private/src/main/kotlin/androidx/build/uptodatedness/TaskUpToDateValidator.kt
+++ b/buildSrc/private/src/main/kotlin/androidx/build/uptodatedness/TaskUpToDateValidator.kt
@@ -157,18 +157,18 @@
"validateProperties",
"tasks",
- ":benchmark:benchmark-macro:generateReleaseProtos",
- ":benchmark:benchmark-macro:generateDebugProtos",
- ":benchmark:benchmark-macro:compileReleaseKotlin",
- ":benchmark:benchmark-macro:compileDebugKotlin",
- ":benchmark:benchmark-macro:compileReleaseJavaWithJavac",
- ":benchmark:benchmark-macro:compileDebugJavaWithJavac",
- ":benchmark:benchmark-macro:extractReleaseAnnotations",
- ":benchmark:benchmark-macro:extractDebugAnnotations",
- ":benchmark:benchmark-macro:generateApi",
- ":benchmark:benchmark-macro:runErrorProne",
- ":benchmark:benchmark-macro:lintAnalyzeDebug",
- ":benchmark:benchmark-macro:lintDebug",
+ ":benchmark:benchmark-common:generateReleaseProtos",
+ ":benchmark:benchmark-common:generateDebugProtos",
+ ":benchmark:benchmark-common:compileReleaseKotlin",
+ ":benchmark:benchmark-common:compileDebugKotlin",
+ ":benchmark:benchmark-common:compileReleaseJavaWithJavac",
+ ":benchmark:benchmark-common:compileDebugJavaWithJavac",
+ ":benchmark:benchmark-common:extractReleaseAnnotations",
+ ":benchmark:benchmark-common:extractDebugAnnotations",
+ ":benchmark:benchmark-common:generateApi",
+ ":benchmark:benchmark-common:runErrorProne",
+ ":benchmark:benchmark-common:lintAnalyzeDebug",
+ ":benchmark:benchmark-common:lintDebug",
// More information about the fact that these dokka tasks rerun can be found at b/167569304
"dokkaKotlinDocs",
@@ -185,6 +185,8 @@
"lintVitalRelease",
"lintWithExpandProjectionDebug",
"lintWithoutExpandProjectionDebug",
+ "lintWithKaptDebug",
+ "lintWithKspDebug",
)
abstract class TaskUpToDateValidator :
diff --git a/buildSrc/public/src/main/kotlin/androidx/build/BuildServerConfiguration.kt b/buildSrc/public/src/main/kotlin/androidx/build/BuildServerConfiguration.kt
index 0ce7c24..da9cc69 100644
--- a/buildSrc/public/src/main/kotlin/androidx/build/BuildServerConfiguration.kt
+++ b/buildSrc/public/src/main/kotlin/androidx/build/BuildServerConfiguration.kt
@@ -58,6 +58,8 @@
} else {
val subdir = System.getenv("DIST_SUBDIR") ?: ""
File(getRootOutDirectory(), "dist$subdir")
+ }.also { distDir ->
+ distDir.mkdirs()
}
}
diff --git a/buildSrc/public/src/main/kotlin/androidx/build/LibraryGroups.kt b/buildSrc/public/src/main/kotlin/androidx/build/LibraryGroups.kt
index d84d2ed..2015165 100644
--- a/buildSrc/public/src/main/kotlin/androidx/build/LibraryGroups.kt
+++ b/buildSrc/public/src/main/kotlin/androidx/build/LibraryGroups.kt
@@ -37,6 +37,7 @@
val CARDVIEW = LibraryGroup("androidx.cardview", LibraryVersions.CARDVIEW)
val CAR_APP = LibraryGroup("androidx.car.app", LibraryVersions.CAR_APP)
val COLLECTION = LibraryGroup("androidx.collection", LibraryVersions.COLLECTION)
+ val COLLECTION2 = LibraryGroup("androidx.collection2", LibraryVersions.COLLECTION2)
val CONCURRENT = LibraryGroup("androidx.concurrent", LibraryVersions.FUTURES)
val CONTENTPAGER = LibraryGroup("androidx.contentpager", LibraryVersions.CONTENTPAGER)
val COORDINATORLAYOUT = LibraryGroup("androidx.coordinatorlayout", LibraryVersions.COORDINATORLAYOUT)
@@ -45,6 +46,7 @@
val CUSTOMVIEW = LibraryGroup("androidx.customview", LibraryVersions.CUSTOMVIEW)
val DATASTORE = LibraryGroup("androidx.datastore", LibraryVersions.DATASTORE)
val DOCUMENTFILE = LibraryGroup("androidx.documentfile", LibraryVersions.DOCUMENTFILE)
+ val DRAGANDDROP = LibraryGroup("androidx.draganddrop", LibraryVersions.DRAGANDDROP)
val DRAWERLAYOUT = LibraryGroup("androidx.drawerlayout", LibraryVersions.DRAWERLAYOUT)
val DYNAMICANIMATION = LibraryGroup("androidx.dynamicanimation", null)
val EMOJI = LibraryGroup("androidx.emoji", null)
diff --git a/buildSrc/public/src/main/kotlin/androidx/build/LibraryVersions.kt b/buildSrc/public/src/main/kotlin/androidx/build/LibraryVersions.kt
index 1a53e8c..0db3ae7 100644
--- a/buildSrc/public/src/main/kotlin/androidx/build/LibraryVersions.kt
+++ b/buildSrc/public/src/main/kotlin/androidx/build/LibraryVersions.kt
@@ -24,26 +24,27 @@
val ADS_IDENTIFIER = Version("1.0.0-alpha05")
val ANNOTATION = Version("1.3.0-alpha01")
val ANNOTATION_EXPERIMENTAL = Version("1.2.0-alpha01")
- val APPCOMPAT = Version("1.4.0-alpha03")
+ val APPCOMPAT = Version("1.4.0-alpha04")
val APPSEARCH = Version("1.0.0-alpha03")
val ARCH_CORE = Version("2.2.0-alpha01")
val ASYNCLAYOUTINFLATER = Version("1.1.0-alpha01")
val AUTOFILL = Version("1.2.0-beta02")
- val BENCHMARK = Version("1.1.0-alpha06")
+ val BENCHMARK = Version("1.1.0-alpha07")
val BIOMETRIC = Version("1.2.0-alpha03")
val BROWSER = Version("1.4.0-alpha01")
val BUILDSRC_TESTS = Version("1.0.0-alpha01")
- val CAMERA = Version("1.1.0-alpha08")
- val CAMERA_EXTENSIONS = Version("1.0.0-alpha28")
+ val CAMERA = Version("1.1.0-alpha09")
+ val CAMERA_EXTENSIONS = Version("1.0.0-alpha29")
val CAMERA_PIPE = Version("1.0.0-alpha01")
val CAMERA_VIDEO = Version("1.0.0-alpha01")
- val CAMERA_VIEW = Version("1.0.0-alpha28")
+ val CAMERA_VIEW = Version("1.0.0-alpha29")
val CARDVIEW = Version("1.1.0-alpha01")
- val CAR_APP = Version("1.1.0-alpha03")
+ val CAR_APP = Version("1.1.0-beta01")
val COLLECTION = Version("1.2.0-alpha02")
+ val COLLECTION2 = Version("1.2.0-alpha02")
val CONTENTPAGER = Version("1.1.0-alpha01")
val COMPOSE_MATERIAL3 = Version(System.getenv("COMPOSE_CUSTOM_VERSION") ?: "1.1.0-alpha01")
- val COMPOSE = Version(System.getenv("COMPOSE_CUSTOM_VERSION") ?: "1.1.0-alpha02")
+ val COMPOSE = Version(System.getenv("COMPOSE_CUSTOM_VERSION") ?: "1.1.0-alpha03")
val COORDINATORLAYOUT = Version("1.2.0-alpha01")
val CORE = Version("1.7.0-alpha01")
val CORE_ANIMATION = Version("1.0.0-alpha03")
@@ -55,7 +56,8 @@
val CURSORADAPTER = Version("1.1.0-alpha01")
val CUSTOMVIEW = Version("1.2.0-alpha01")
val DATASTORE = Version("1.1.0-alpha01")
- val DOCUMENTFILE = Version("1.1.0-alpha01")
+ val DOCUMENTFILE = Version("1.1.0-alpha02")
+ val DRAGANDDROP = Version("1.0.0-alpha01")
val DRAWERLAYOUT = Version("1.2.0-alpha01")
val DYNAMICANIMATION = Version("1.1.0-alpha04")
val DYNAMICANIMATION_KTX = Version("1.0.0-alpha04")
@@ -63,7 +65,7 @@
val EMOJI2 = Version("1.0.0-alpha03")
val ENTERPRISE = Version("1.1.0-rc01")
val EXIFINTERFACE = Version("1.4.0-alpha01")
- val FRAGMENT = Version("1.4.0-alpha07")
+ val FRAGMENT = Version("1.4.0-alpha08")
val FUTURES = Version("1.2.0-alpha01")
val GLANCE = Version("1.0.0-alpha01")
val GRIDLAYOUT = Version("1.1.0-alpha01")
@@ -87,14 +89,14 @@
val MEDIA = Version("1.5.0-alpha01")
val MEDIA2 = Version("1.2.0-beta01")
val MEDIAROUTER = Version("1.3.0-alpha01")
- val NAVIGATION = Version("2.4.0-alpha07")
+ val NAVIGATION = Version("2.4.0-alpha08")
val PAGING = Version("3.1.0-alpha04")
val PAGING_COMPOSE = Version("1.0.0-alpha13")
val PALETTE = Version("1.1.0-alpha01")
val PRINT = Version("1.1.0-beta01")
val PERCENTLAYOUT = Version("1.1.0-alpha01")
val PREFERENCE = Version("1.2.0-alpha01")
- val PROFILEINSTALLER = Version("1.1.0-alpha03")
+ val PROFILEINSTALLER = Version("1.1.0-alpha04")
val RECOMMENDATION = Version("1.1.0-alpha01")
val RECYCLERVIEW = Version("1.3.0-alpha01")
val RECYCLERVIEW_SELECTION = Version("1.2.0-alpha02")
@@ -106,13 +108,13 @@
val SECURITY_APP_AUTHENTICATOR = Version("1.0.0-alpha03")
val SECURITY_APP_AUTHENTICATOR_TESTING = Version("1.0.0-alpha02")
val SECURITY_BIOMETRIC = Version("1.0.0-alpha01")
- val SECURITY_IDENTITY_CREDENTIAL = Version("1.0.0-alpha02")
- val SHARETARGET = Version("1.2.0-alpha02")
+ val SECURITY_IDENTITY_CREDENTIAL = Version("1.0.0-alpha03")
+ val SHARETARGET = Version("1.2.0-beta01")
val SLICE = Version("1.1.0-alpha02")
val SLICE_BENCHMARK = Version("1.1.0-alpha02")
val SLICE_BUILDERS_KTX = Version("1.0.0-alpha08")
val SLICE_REMOTECALLBACK = Version("1.0.0-alpha01")
- val SLIDINGPANELAYOUT = Version("1.2.0-alpha04")
+ val SLIDINGPANELAYOUT = Version("1.2.0-alpha05")
val STARTUP = Version("1.2.0-alpha01")
val SQLITE = Version("2.2.0-alpha03")
val SQLITE_INSPECTOR = Version("2.1.0-alpha01")
@@ -129,28 +131,28 @@
val VERSIONED_PARCELABLE = Version("1.2.0-alpha01")
val VIEWPAGER = Version("1.1.0-alpha01")
val VIEWPAGER2 = Version("1.1.0-beta02")
- val WEAR = Version("1.2.0-beta01")
- val WEAR_COMPLICATIONS_DATA = Version("1.0.0-alpha20")
- val WEAR_COMPLICATIONS_DATA_SOURCE = Version("1.0.0-alpha20")
- val WEAR_COMPLICATIONS_DATA_SOURCE_KTX = Version("1.0.0-alpha20")
- val WEAR_COMPOSE = Version("1.0.0-alpha04")
+ val WEAR = Version("1.2.0-beta02")
+ val WEAR_COMPLICATIONS_DATA = Version("1.0.0-alpha21")
+ val WEAR_COMPLICATIONS_DATA_SOURCE = Version("1.0.0-alpha21")
+ val WEAR_COMPLICATIONS_DATA_SOURCE_KTX = Version("1.0.0-alpha21")
+ val WEAR_COMPOSE = Version("1.0.0-alpha05")
val WEAR_INPUT = Version("1.2.0-alpha01")
val WEAR_INPUT_TESTING = WEAR_INPUT
- val WEAR_ONGOING = Version("1.0.0-rc01")
- val WEAR_PHONE_INTERACTIONS = Version("1.0.0-beta01")
- val WEAR_REMOTE_INTERACTIONS = Version("1.0.0-beta01")
- val WEAR_TILES = Version("1.0.0-alpha10")
- val WEAR_WATCHFACE = Version("1.0.0-alpha20")
- val WEAR_WATCHFACE_CLIENT = Version("1.0.0-alpha20")
+ val WEAR_ONGOING = Version("1.1.0-alpha01")
+ val WEAR_PHONE_INTERACTIONS = Version("1.0.0-beta02")
+ val WEAR_REMOTE_INTERACTIONS = Version("1.0.0-beta02")
+ val WEAR_TILES = Version("1.0.0-alpha11")
+ val WEAR_WATCHFACE = Version("1.0.0-alpha21")
+ val WEAR_WATCHFACE_CLIENT = Version("1.0.0-alpha21")
val WEAR_WATCHFACE_CLIENT_GUAVA = WEAR_WATCHFACE_CLIENT
- val WEAR_WATCHFACE_COMPLICATIONS_RENDERING = Version("1.0.0-alpha20")
- val WEAR_WATCHFACE_DATA = Version("1.0.0-alpha20")
- val WEAR_WATCHFACE_EDITOR = Version("1.0.0-alpha20")
+ val WEAR_WATCHFACE_COMPLICATIONS_RENDERING = Version("1.0.0-alpha21")
+ val WEAR_WATCHFACE_DATA = Version("1.0.0-alpha21")
+ val WEAR_WATCHFACE_EDITOR = Version("1.0.0-alpha21")
val WEAR_WATCHFACE_EDITOR_GUAVA = WEAR_WATCHFACE_EDITOR
- val WEAR_WATCHFACE_STYLE = Version("1.0.0-alpha20")
+ val WEAR_WATCHFACE_STYLE = Version("1.0.0-alpha21")
val WEBKIT = Version("1.5.0-alpha01")
val WINDOW = Version("1.0.0-beta01")
val WINDOW_EXTENSIONS = Version("1.0.0-alpha01")
val WINDOW_SIDECAR = Version("0.1.0-beta01")
- val WORK = Version("2.7.0-alpha05")
+ val WORK = Version("2.7.0-beta01")
}
diff --git a/buildSrc/repos.gradle b/buildSrc/repos.gradle
index 6d95d8b..19b2cdc 100644
--- a/buildSrc/repos.gradle
+++ b/buildSrc/repos.gradle
@@ -63,7 +63,7 @@
artifact()
}
}
- if (System.getenv("ALLOW_PUBLIC_REPOS") != null) {
+ if (System.getenv("ALLOW_PUBLIC_REPOS") != null || System.getProperty("ALLOW_PUBLIC_REPOS") != null) {
handler.mavenCentral()
handler.jcenter()
handler.google()
diff --git a/busytown/androidx_incremental.sh b/busytown/androidx_incremental.sh
index 328cc6e..c6e659b 100755
--- a/busytown/androidx_incremental.sh
+++ b/busytown/androidx_incremental.sh
@@ -40,7 +40,7 @@
# Run Gradle
EXIT_VALUE=0
-if impl/build.sh --diagnose buildOnServer checkExternalLicenses listTaskOutputs validateAllProperties \
+if impl/build.sh buildOnServer checkExternalLicenses listTaskOutputs validateAllProperties \
--profile "$@"; then
echo build succeeded
EXIT_VALUE=0
diff --git a/busytown/impl/build.sh b/busytown/impl/build.sh
index 068d474..e7056bf 100755
--- a/busytown/impl/build.sh
+++ b/busytown/impl/build.sh
@@ -50,7 +50,6 @@
# Put each argument on its own line because some arguments may be long.
# Also put "\" at the end of non-final lines so the command can be copy-pasted
echo "$*" | sed 's/ / \\\n/g' | sed 's/^/ /' >&2
- showDiskStats
return 1
fi
}
diff --git a/camera/camera-camera2-pipe-integration/src/androidTest/java/androidx/camera/camera2/pipe/integration/Camera2CameraControlDeviceTest.kt b/camera/camera-camera2-pipe-integration/src/androidTest/java/androidx/camera/camera2/pipe/integration/Camera2CameraControlDeviceTest.kt
new file mode 100644
index 0000000..9eb856e
--- /dev/null
+++ b/camera/camera-camera2-pipe-integration/src/androidTest/java/androidx/camera/camera2/pipe/integration/Camera2CameraControlDeviceTest.kt
@@ -0,0 +1,467 @@
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * 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.
+ */
+
+package androidx.camera.camera2.pipe.integration
+
+import android.content.Context
+import android.graphics.Rect
+import android.hardware.camera2.CameraCharacteristics
+import android.hardware.camera2.CameraManager
+import android.hardware.camera2.CameraMetadata
+import android.hardware.camera2.CaptureFailure
+import android.hardware.camera2.CaptureRequest
+import android.hardware.camera2.params.MeteringRectangle
+import androidx.camera.camera2.pipe.FrameInfo
+import androidx.camera.camera2.pipe.FrameNumber
+import androidx.camera.camera2.pipe.Request
+import androidx.camera.camera2.pipe.RequestMetadata
+import androidx.camera.camera2.pipe.integration.adapter.CameraControlAdapter
+import androidx.camera.camera2.pipe.integration.impl.ComboRequestListener
+import androidx.camera.camera2.pipe.integration.interop.Camera2CameraControl
+import androidx.camera.camera2.pipe.integration.interop.CaptureRequestOptions
+import androidx.camera.camera2.pipe.integration.interop.ExperimentalCamera2Interop
+import androidx.camera.core.CameraControl
+import androidx.camera.core.CameraSelector
+import androidx.camera.core.CameraX
+import androidx.camera.core.ImageAnalysis
+import androidx.camera.core.impl.CameraInfoInternal
+import androidx.camera.core.internal.CameraUseCaseAdapter
+import androidx.camera.testing.CameraUtil
+import androidx.test.core.app.ApplicationProvider
+import androidx.test.ext.junit.runners.AndroidJUnit4
+import androidx.test.filters.LargeTest
+import androidx.test.platform.app.InstrumentationRegistry
+import com.google.common.truth.Truth
+import com.google.common.util.concurrent.ListenableFuture
+import kotlinx.coroutines.Dispatchers
+import kotlinx.coroutines.asExecutor
+import kotlinx.coroutines.runBlocking
+import kotlinx.coroutines.withTimeout
+import org.junit.After
+import org.junit.Assert
+import org.junit.Assume
+import org.junit.Before
+import org.junit.Rule
+import org.junit.Test
+import org.junit.runner.RunWith
+import java.util.concurrent.CountDownLatch
+import java.util.concurrent.ExecutionException
+import java.util.concurrent.TimeUnit
+
+@LargeTest
+@RunWith(AndroidJUnit4::class)
+@OptIn(ExperimentalCamera2Interop::class)
+class Camera2CameraControlDeviceTest {
+ private lateinit var cameraSelector: CameraSelector
+ private lateinit var context: Context
+ private lateinit var camera: CameraUseCaseAdapter
+ private lateinit var camera2CameraControl: Camera2CameraControl
+ private lateinit var cameraControl: CameraControlAdapter
+ private lateinit var comboListener: ComboRequestListener
+
+ @get:Rule
+ val useCamera = CameraUtil.grantCameraPermissionAndPreTest()
+
+ @Before
+ fun setUp() {
+ Assume.assumeTrue(CameraUtil.hasCameraWithLensFacing(CameraSelector.LENS_FACING_BACK))
+
+ context = ApplicationProvider.getApplicationContext()
+ CameraX.initialize(context, CameraPipeConfig.defaultConfig())
+ cameraSelector = CameraSelector.Builder().requireLensFacing(
+ CameraSelector.LENS_FACING_BACK
+ ).build()
+ camera = CameraUtil.createCameraUseCaseAdapter(context, cameraSelector)
+ cameraControl = camera.cameraControl as CameraControlAdapter
+ camera2CameraControl = cameraControl.camera2cameraControl
+ comboListener = camera2CameraControl.requestListener
+ }
+
+ @After
+ fun tearDown() {
+ if (::camera.isInitialized) {
+ camera.detachUseCases()
+ }
+
+ CameraX.shutdown()[10000, TimeUnit.MILLISECONDS]
+ }
+
+ @Test
+ fun canGetInteropApi() {
+ Truth.assertThat(
+ Camera2CameraControl.from(cameraControl)
+ ).isSameInstanceAs(camera2CameraControl)
+ }
+
+ @Test
+ fun canSetAndRetrieveCaptureRequestOptions() {
+ // Arrange.
+ bindUseCase()
+ val builder: CaptureRequestOptions.Builder =
+ CaptureRequestOptions.Builder()
+ .setCaptureRequestOption<Int>(
+ CaptureRequest.CONTROL_CAPTURE_INTENT,
+ CaptureRequest.CONTROL_CAPTURE_INTENT_MANUAL
+ )
+ .setCaptureRequestOption<Int>(
+ CaptureRequest.COLOR_CORRECTION_MODE,
+ CameraMetadata.COLOR_CORRECTION_MODE_FAST
+ )
+ // Act.
+ camera2CameraControl.setCaptureRequestOptions(builder.build())
+
+ // Assert.
+ Truth.assertThat(
+ camera2CameraControl.getCaptureRequestOptions().getCaptureRequestOption(
+ CaptureRequest.CONTROL_CAPTURE_INTENT, null
+ )
+ ).isEqualTo(
+ CaptureRequest.CONTROL_CAPTURE_INTENT_MANUAL
+ )
+ Truth.assertThat(
+ camera2CameraControl.getCaptureRequestOptions().getCaptureRequestOption(
+ CaptureRequest.COLOR_CORRECTION_MODE, null
+ )
+ ).isEqualTo(
+ CameraMetadata.COLOR_CORRECTION_MODE_FAST
+ )
+ }
+
+ @Test
+ fun canSubmitCaptureRequestOptions_beforeBinding() = runBlocking {
+ val future = updateCamera2Option<Int>(
+ CaptureRequest.CONTROL_CAPTURE_INTENT,
+ CaptureRequest.CONTROL_CAPTURE_INTENT_MANUAL
+ )
+ bindUseCase()
+ assertFutureCompletes(future)
+
+ // Assert.
+ registerListener().verifyCaptureRequestParameter(
+ CaptureRequest.CONTROL_CAPTURE_INTENT,
+ CaptureRequest.CONTROL_CAPTURE_INTENT_MANUAL
+ )
+ }
+
+ @Test
+ fun canSubmitCaptureRequestOptions_afterBinding() = runBlocking {
+ // Arrange.
+ bindUseCase()
+
+ // Act.
+ val future = updateCamera2Option(
+ CaptureRequest.CONTROL_CAPTURE_INTENT,
+ CaptureRequest.CONTROL_CAPTURE_INTENT_MANUAL
+ )
+ assertFutureCompletes(future)
+
+ // Assert.
+ registerListener().verifyCaptureRequestParameter(
+ CaptureRequest.CONTROL_CAPTURE_INTENT,
+ CaptureRequest.CONTROL_CAPTURE_INTENT_MANUAL
+ )
+ }
+
+ @Test
+ fun canClearCaptureRequestOptions() = runBlocking {
+ // Arrange.
+ bindUseCase()
+ val builder: CaptureRequestOptions.Builder =
+ CaptureRequestOptions.Builder()
+ .setCaptureRequestOption<Int>(
+ CaptureRequest.CONTROL_CAPTURE_INTENT,
+ CaptureRequest.CONTROL_CAPTURE_INTENT_MANUAL
+ )
+ .setCaptureRequestOption<Int>(
+ CaptureRequest.COLOR_CORRECTION_MODE,
+ CameraMetadata.COLOR_CORRECTION_ABERRATION_MODE_OFF
+ )
+ assertFutureCompletes(camera2CameraControl.setCaptureRequestOptions(builder.build()))
+
+ // Act.
+ builder.clearCaptureRequestOption<Int>(CaptureRequest.COLOR_CORRECTION_MODE)
+ assertFutureCompletes(camera2CameraControl.setCaptureRequestOptions(builder.build()))
+
+ // Assert.
+ Truth.assertThat(
+ camera2CameraControl.getCaptureRequestOptions().getCaptureRequestOption(
+ CaptureRequest.CONTROL_CAPTURE_INTENT, null
+ )
+ ).isEqualTo(
+ CaptureRequest.CONTROL_CAPTURE_INTENT_MANUAL
+ )
+ Truth.assertThat(
+ camera2CameraControl.getCaptureRequestOptions().getCaptureRequestOption(
+ CaptureRequest.COLOR_CORRECTION_MODE, null
+ )
+ ).isEqualTo(null)
+
+ registerListener().verify({
+ Truth.assertThat(it.last().request[CaptureRequest.CONTROL_CAPTURE_INTENT])
+ .isEqualTo(CaptureRequest.CONTROL_CAPTURE_INTENT_MANUAL)
+ Truth.assertThat(it.last().request[CaptureRequest.COLOR_CORRECTION_MODE])
+ .isNotEqualTo(CaptureRequest.COLOR_CORRECTION_ABERRATION_MODE_OFF)
+ })
+ }
+
+ @Test
+ fun canOverrideAfMode() = runBlocking {
+ updateCamera2Option(
+ CaptureRequest.CONTROL_AF_MODE,
+ CaptureRequest.CONTROL_AF_MODE_OFF
+ )
+ bindUseCase()
+
+ // Assert.
+ registerListener().verifyCaptureRequestParameter(
+ CaptureRequest.CONTROL_AF_MODE,
+ CaptureRequest.CONTROL_AF_MODE_OFF
+ )
+ }
+
+ @Test
+ fun canOverrideAeMode() = runBlocking {
+ updateCamera2Option(
+ CaptureRequest.CONTROL_AE_MODE,
+ CaptureRequest.CONTROL_AE_MODE_OFF
+ )
+ bindUseCase()
+
+ // Assert.
+ registerListener().verifyCaptureRequestParameter(
+ CaptureRequest.CONTROL_AE_MODE,
+ CaptureRequest.CONTROL_AE_MODE_OFF
+ )
+ }
+
+ @Test
+ fun canOverrideAwbMode() = runBlocking {
+ updateCamera2Option(
+ CaptureRequest.CONTROL_AWB_MODE,
+ CaptureRequest.CONTROL_AWB_MODE_OFF
+ )
+ bindUseCase()
+
+ // Assert.
+ registerListener().verifyCaptureRequestParameter(
+ CaptureRequest.CONTROL_AWB_MODE,
+ CaptureRequest.CONTROL_AWB_MODE_OFF
+ )
+ }
+
+ @Test
+ fun canOverrideScalarCropRegion() = runBlocking {
+ // scalar crop region must be larger than the region defined
+ // by SCALER_AVAILABLE_MAX_DIGITAL_ZOOM otherwise it could cause a crash on some devices.
+ // Thus we cannot simply specify some random crop region.
+
+ // Arrange.
+ val cropRegion = getZoom2XCropRegion()
+
+ // Act.
+ updateCamera2Option(CaptureRequest.SCALER_CROP_REGION, cropRegion)
+ bindUseCase()
+
+ // Assert.
+ registerListener().verifyCaptureRequestParameter(
+ CaptureRequest.SCALER_CROP_REGION,
+ cropRegion
+ )
+ }
+
+ @Test
+ fun canOverrideAfRegion() = runBlocking {
+ // Arrange.
+ val meteringRectangles = arrayOf(
+ MeteringRectangle(0, 0, 100, 100, MeteringRectangle.METERING_WEIGHT_MAX)
+ )
+
+ // Act.
+ updateCamera2Option(CaptureRequest.CONTROL_AF_REGIONS, meteringRectangles)
+ bindUseCase()
+
+ // Assert.
+ registerListener().verifyCaptureRequestParameter(
+ CaptureRequest.CONTROL_AF_REGIONS,
+ meteringRectangles
+ )
+ }
+
+ @Test
+ fun canOverrideAeRegion() = runBlocking {
+ // Arrange.
+ val meteringRectangles = arrayOf(
+ MeteringRectangle(0, 0, 100, 100, MeteringRectangle.METERING_WEIGHT_MAX)
+ )
+
+ // Act.
+ updateCamera2Option(CaptureRequest.CONTROL_AE_REGIONS, meteringRectangles)
+ bindUseCase()
+
+ // Assert.
+ registerListener().verifyCaptureRequestParameter(
+ CaptureRequest.CONTROL_AE_REGIONS,
+ meteringRectangles
+ )
+ }
+
+ @Test
+ fun canOverrideAwbRegion() = runBlocking {
+ // Arrange.
+ val meteringRectangles = arrayOf(
+ MeteringRectangle(0, 0, 100, 100, MeteringRectangle.METERING_WEIGHT_MAX)
+ )
+
+ // Act.
+ updateCamera2Option(CaptureRequest.CONTROL_AWB_REGIONS, meteringRectangles)
+ bindUseCase()
+
+ // Assert.
+ registerListener().verifyCaptureRequestParameter(
+ CaptureRequest.CONTROL_AWB_REGIONS,
+ meteringRectangles
+ )
+ }
+
+ @Test
+ fun cancelPendingFuture_whenInactive() {
+ // Arrange.
+ val future = updateCamera2Option(
+ CaptureRequest.CONTROL_CAPTURE_INTENT,
+ CaptureRequest.CONTROL_CAPTURE_INTENT_MANUAL
+ )
+
+ // Act.
+ camera.detachUseCases()
+
+ // Assert.
+ try {
+ future.get()
+ } catch (e: ExecutionException) {
+ Truth.assertThat(e.cause)
+ .isInstanceOf(CameraControl.OperationCanceledException::class.java)
+ }
+ }
+
+ private fun getZoom2XCropRegion(): Rect {
+ val cameraManager =
+ InstrumentationRegistry.getInstrumentation().context.getSystemService(
+ Context.CAMERA_SERVICE
+ ) as CameraManager
+ val characteristics = cameraManager.getCameraCharacteristics(
+ (camera.cameraInfo as CameraInfoInternal).cameraId
+ )
+
+ val maxDigitalZoom = characteristics.get(
+ CameraCharacteristics.SCALER_AVAILABLE_MAX_DIGITAL_ZOOM
+ )
+
+ Assume.assumeTrue(maxDigitalZoom != null && maxDigitalZoom >= 2)
+
+ return characteristics.get(CameraCharacteristics.SENSOR_INFO_ACTIVE_ARRAY_SIZE)
+ .let { sensorRect ->
+ Rect(
+ sensorRect!!.centerX() - sensorRect.width() / 4,
+ sensorRect.centerY() - sensorRect.height() / 4,
+ sensorRect.centerX() + sensorRect.width() / 4,
+ sensorRect.centerY() + sensorRect.height() / 4
+ )
+ }
+ }
+
+ private fun registerListener(capturesCount: Int = 1): VerifyResultListener =
+ VerifyResultListener(capturesCount).also {
+ comboListener.addListener(it, Dispatchers.Default.asExecutor())
+ }
+
+ private class VerifyResultListener(capturesCount: Int) : Request.Listener {
+ private val captureRequests = mutableListOf<RequestMetadata>()
+ private val latch = CountDownLatch(capturesCount)
+
+ override fun onAborted(request: Request) {
+ latch.countDown()
+ }
+
+ override fun onComplete(
+ requestMetadata: RequestMetadata,
+ frameNumber: FrameNumber,
+ result: FrameInfo
+ ) {
+ captureRequests.add(requestMetadata)
+ latch.countDown()
+ }
+
+ override fun onFailed(
+ requestMetadata: RequestMetadata,
+ frameNumber: FrameNumber,
+ captureFailure: CaptureFailure
+ ) {
+ latch.countDown()
+ }
+
+ suspend fun <T> verifyCaptureRequestParameter(
+ key: CaptureRequest.Key<T>,
+ value: T,
+ timeout: Long = 5_000.toLong(), // 5 seconds
+ ) {
+ verify(
+ {
+ Truth.assertThat(it.last().request[key]).isEqualTo(value)
+ },
+ timeout
+ )
+ }
+
+ suspend fun verify(
+ verifyBlock: (captureRequests: List<RequestMetadata>) -> Unit,
+ timeout: Long = 5_000.toLong(), // 5 second
+ ) {
+ withTimeout(timeout) {
+ latch.await()
+ verifyBlock(captureRequests)
+ }
+ }
+ }
+
+ private fun <T> updateCamera2Option(key: CaptureRequest.Key<T>, value: T) =
+ camera2CameraControl.setCaptureRequestOptions(
+ CaptureRequestOptions.Builder().setCaptureRequestOption(key, value).build()
+ )
+
+ private fun <T> assertFutureCompletes(future: ListenableFuture<T?>): T? {
+ var result: T? = null
+ try {
+ result = future[5, TimeUnit.SECONDS]
+ } catch (e: Exception) {
+ Assert.fail("future fail:$e")
+ }
+ return result
+ }
+
+ private fun bindUseCase() {
+ camera = CameraUtil.createCameraAndAttachUseCase(
+ context,
+ cameraSelector,
+ ImageAnalysis.Builder().build().apply {
+ // set analyzer to make it active.
+ setAnalyzer(Dispatchers.Default.asExecutor()) {
+ // Fake analyzer, do nothing.
+ }
+ },
+ )
+ camera2CameraControl = Camera2CameraControl.from(camera.cameraControl)
+ }
+}
\ No newline at end of file
diff --git a/camera/camera-camera2-pipe-integration/src/main/java/androidx/camera/camera2/pipe/integration/adapter/CameraControlAdapter.kt b/camera/camera-camera2-pipe-integration/src/main/java/androidx/camera/camera2/pipe/integration/adapter/CameraControlAdapter.kt
index f37aeea..d35c0e0 100644
--- a/camera/camera-camera2-pipe-integration/src/main/java/androidx/camera/camera2/pipe/integration/adapter/CameraControlAdapter.kt
+++ b/camera/camera-camera2-pipe-integration/src/main/java/androidx/camera/camera2/pipe/integration/adapter/CameraControlAdapter.kt
@@ -30,6 +30,9 @@
import androidx.camera.camera2.pipe.integration.impl.UseCaseManager
import androidx.camera.camera2.pipe.integration.impl.UseCaseThreads
import androidx.camera.camera2.pipe.integration.impl.ZoomControl
+import androidx.camera.camera2.pipe.integration.interop.Camera2CameraControl
+import androidx.camera.camera2.pipe.integration.interop.CaptureRequestOptions
+import androidx.camera.camera2.pipe.integration.interop.ExperimentalCamera2Interop
import androidx.camera.core.FocusMeteringAction
import androidx.camera.core.FocusMeteringResult
import androidx.camera.core.ImageCapture
@@ -38,7 +41,6 @@
import androidx.camera.core.impl.CameraControlInternal
import androidx.camera.core.impl.CaptureConfig
import androidx.camera.core.impl.Config
-import androidx.camera.core.impl.MutableOptionsBundle
import androidx.camera.core.impl.SessionConfig
import androidx.camera.core.impl.utils.futures.Futures
import com.google.common.util.concurrent.ListenableFuture
@@ -57,16 +59,16 @@
*/
@SuppressLint("UnsafeOptInUsageError")
@CameraScope
-@OptIn(ExperimentalCoroutinesApi::class)
+@OptIn(ExperimentalCoroutinesApi::class, ExperimentalCamera2Interop::class)
class CameraControlAdapter @Inject constructor(
private val cameraProperties: CameraProperties,
private val threads: UseCaseThreads,
private val useCaseManager: UseCaseManager,
private val cameraStateAdapter: CameraStateAdapter,
private val zoomControl: ZoomControl,
- private val evCompControl: EvCompControl
+ private val evCompControl: EvCompControl,
+ val camera2cameraControl: Camera2CameraControl,
) : CameraControlInternal {
- private var interopConfig: Config = MutableOptionsBundle.create()
private var imageCaptureFlashMode: Int = ImageCapture.FLASH_MODE_OFF
private val focusMeteringControl = FocusMeteringControl(
@@ -80,15 +82,17 @@
}
override fun addInteropConfig(config: Config) {
- interopConfig = Config.mergeConfigs(config, interopConfig)
+ camera2cameraControl.addCaptureRequestOptions(
+ CaptureRequestOptions.Builder.from(config).build()
+ )
}
override fun clearInteropConfig() {
- interopConfig = MutableOptionsBundle.create()
+ camera2cameraControl.clearCaptureRequestOptions()
}
override fun getInteropConfig(): Config {
- return interopConfig
+ return camera2cameraControl.getCaptureRequestOptions()
}
override fun enableTorch(torch: Boolean): ListenableFuture<Void> {
diff --git a/camera/camera-camera2-pipe-integration/src/main/java/androidx/camera/camera2/pipe/integration/compat/Camera2CameraControlCompat.kt b/camera/camera-camera2-pipe-integration/src/main/java/androidx/camera/camera2/pipe/integration/compat/Camera2CameraControlCompat.kt
new file mode 100644
index 0000000..1dc95c2
--- /dev/null
+++ b/camera/camera-camera2-pipe-integration/src/main/java/androidx/camera/camera2/pipe/integration/compat/Camera2CameraControlCompat.kt
@@ -0,0 +1,175 @@
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * 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.
+ */
+
+package androidx.camera.camera2.pipe.integration.compat
+
+import androidx.annotation.GuardedBy
+import androidx.camera.camera2.pipe.FrameInfo
+import androidx.camera.camera2.pipe.FrameNumber
+import androidx.camera.camera2.pipe.Request
+import androidx.camera.camera2.pipe.RequestMetadata
+import androidx.camera.camera2.pipe.integration.config.CameraScope
+import androidx.camera.camera2.pipe.integration.impl.CAMERAX_TAG_BUNDLE
+import androidx.camera.camera2.pipe.integration.impl.Camera2ImplConfig
+import androidx.camera.camera2.pipe.integration.impl.UseCaseCamera
+import androidx.camera.camera2.pipe.integration.impl.UseCaseCameraRequestControl
+import androidx.camera.camera2.pipe.integration.impl.UseCaseThreads
+import androidx.camera.camera2.pipe.integration.interop.CaptureRequestOptions
+import androidx.camera.camera2.pipe.integration.interop.ExperimentalCamera2Interop
+import androidx.camera.core.CameraControl
+import androidx.camera.core.impl.Config
+import androidx.camera.core.impl.TagBundle
+import androidx.camera.core.impl.annotation.ExecutedBy
+import dagger.Binds
+import dagger.Module
+import kotlinx.coroutines.CompletableDeferred
+import kotlinx.coroutines.Deferred
+import kotlinx.coroutines.launch
+import javax.inject.Inject
+
+private const val TAG_KEY = "Camera2CameraControl.tag"
+
+@ExperimentalCamera2Interop
+interface Camera2CameraControlCompat : Request.Listener {
+ fun addRequestOption(bundle: CaptureRequestOptions)
+ fun getRequestOption(): CaptureRequestOptions
+ fun clearRequestOption()
+ fun cancelCurrentTask()
+
+ fun applyAsync(camera: UseCaseCamera?): Deferred<Void?>
+
+ @Module
+ abstract class Bindings {
+ @Binds
+ abstract fun bindCamera2CameraControlCompImpl(
+ impl: Camera2CameraControlCompatImpl
+ ): Camera2CameraControlCompat
+ }
+}
+
+@CameraScope
+@ExperimentalCamera2Interop
+class Camera2CameraControlCompatImpl @Inject constructor(
+ private val threads: UseCaseThreads,
+) : Camera2CameraControlCompat {
+
+ private val lock = Any()
+
+ @GuardedBy("lock")
+ private var configBuilder = Camera2ImplConfig.Builder()
+
+ private var updateSignal: CompletableDeferred<Void?>? = null
+ private var pendingSignal: CompletableDeferred<Void?>? = null
+
+ override fun addRequestOption(bundle: CaptureRequestOptions) {
+ synchronized(lock) {
+ for (option in bundle.listOptions()) {
+ @Suppress("UNCHECKED_CAST")
+ val objectOpt = option as Config.Option<Any>
+ configBuilder.mutableConfig.insertOption(
+ objectOpt,
+ Config.OptionPriority.ALWAYS_OVERRIDE,
+ bundle.retrieveOption(objectOpt)
+ )
+ }
+ }
+ }
+
+ override fun getRequestOption(): CaptureRequestOptions =
+ synchronized(lock) {
+ CaptureRequestOptions.Builder.from(
+ configBuilder.build()
+ ).build()
+ }
+
+ override fun clearRequestOption() {
+ synchronized(lock) {
+ configBuilder = Camera2ImplConfig.Builder()
+ }
+ }
+
+ override fun cancelCurrentTask() {
+ threads.sequentialScope.launch {
+ updateSignal?.also {
+ updateSignal = null
+ }?.cancelSignal("The camera control has became inactive.")
+ pendingSignal?.also {
+ pendingSignal = null
+ }?.cancelSignal("The camera control has became inactive.")
+ }
+ }
+
+ override fun applyAsync(camera: UseCaseCamera?): Deferred<Void?> {
+ val signal: CompletableDeferred<Void?> = CompletableDeferred()
+ val config = synchronized(lock) {
+ configBuilder.build()
+ }
+ threads.sequentialScope.launch {
+ if (camera != null) {
+ // Cancel the previous request signal if exist.
+ updateSignal?.cancelSignal()
+ updateSignal = signal
+ camera.requestControl.setConfigAsync(
+ type = UseCaseCameraRequestControl.Type.CAMERA2_CAMERA_CONTROL,
+ config = config,
+ tags = mapOf(TAG_KEY to signal.hashCode())
+ )
+ } else {
+ // If there is no camera for the parameter update, the signal would be treated as a
+ // pending signal, and the pending signal would be completed after the camera
+ // applied the parameter.
+
+ // Cancel the previous request signal if it exists. Only keep the latest signal.
+ pendingSignal?.cancelSignal()
+ pendingSignal = signal
+ }
+ }
+
+ return signal
+ }
+
+ private fun CompletableDeferred<Void?>.cancelSignal(
+ msg: String = "Camera2CameraControl was updated with new options."
+ ) = this.apply {
+ completeExceptionally(CameraControl.OperationCanceledException(msg))
+ }
+
+ @ExecutedBy("UseCaseThreads")
+ override fun onComplete(
+ requestMetadata: RequestMetadata,
+ frameNumber: FrameNumber,
+ result: FrameInfo
+ ) {
+ updateSignal?.apply {
+ val repeatingTagValue = requestMetadata.getOrDefault(
+ CAMERAX_TAG_BUNDLE,
+ TagBundle.emptyBundle()
+ ).getTag(TAG_KEY)
+
+ if (repeatingTagValue == hashCode()) {
+ // Going to complete the [updateSignal] if the result contains the [TAG_KEY]
+ complete(null)
+ updateSignal = null
+
+ // Also complete the [pendingSignal] if it exists.
+ pendingSignal?.also {
+ it.complete(null)
+ pendingSignal = null
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/development/project-creator/compose-template/groupId/artifactId/src/main/groupId/package-info.java b/camera/camera-camera2-pipe-integration/src/main/java/androidx/camera/camera2/pipe/integration/compat/package-info.java
similarity index 74%
copy from development/project-creator/compose-template/groupId/artifactId/src/main/groupId/package-info.java
copy to camera/camera-camera2-pipe-integration/src/main/java/androidx/camera/camera2/pipe/integration/compat/package-info.java
index a51e68c..878a4d8 100644
--- a/development/project-creator/compose-template/groupId/artifactId/src/main/groupId/package-info.java
+++ b/camera/camera-camera2-pipe-integration/src/main/java/androidx/camera/camera2/pipe/integration/compat/package-info.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) <YEAR> The Android Open Source Project
+ * Copyright 2021 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,6 +15,9 @@
*/
/**
- * Insert package level documentation here
+ * @hide
*/
-package <PACKAGE>;
+@RestrictTo(RestrictTo.Scope.LIBRARY)
+package androidx.camera.camera2.pipe.integration.compat;
+
+import androidx.annotation.RestrictTo;
diff --git a/camera/camera-camera2-pipe-integration/src/main/java/androidx/camera/camera2/pipe/integration/config/CameraConfig.kt b/camera/camera-camera2-pipe-integration/src/main/java/androidx/camera/camera2/pipe/integration/config/CameraConfig.kt
index 04d26e5..8ea050a 100644
--- a/camera/camera-camera2-pipe-integration/src/main/java/androidx/camera/camera2/pipe/integration/config/CameraConfig.kt
+++ b/camera/camera-camera2-pipe-integration/src/main/java/androidx/camera/camera2/pipe/integration/config/CameraConfig.kt
@@ -22,6 +22,7 @@
import androidx.camera.camera2.pipe.integration.adapter.CameraControlAdapter
import androidx.camera.camera2.pipe.integration.adapter.CameraInfoAdapter
import androidx.camera.camera2.pipe.integration.adapter.CameraInternalAdapter
+import androidx.camera.camera2.pipe.integration.compat.Camera2CameraControlCompat
import androidx.camera.camera2.pipe.integration.compat.EvCompCompat
import androidx.camera.camera2.pipe.integration.compat.ZoomCompat
import androidx.camera.camera2.pipe.integration.impl.CameraPipeCameraProperties
@@ -29,6 +30,8 @@
import androidx.camera.camera2.pipe.integration.impl.EvCompControl
import androidx.camera.camera2.pipe.integration.impl.UseCaseThreads
import androidx.camera.camera2.pipe.integration.impl.ZoomControl
+import androidx.camera.camera2.pipe.integration.interop.Camera2CameraControl
+import androidx.camera.camera2.pipe.integration.interop.ExperimentalCamera2Interop
import androidx.camera.core.impl.CameraControlInternal
import androidx.camera.core.impl.CameraInfoInternal
import androidx.camera.core.impl.CameraInternal
@@ -47,12 +50,15 @@
annotation class CameraScope
/** Dependency bindings for adapting an individual [CameraInternal] instance to [CameraPipe] */
+@OptIn(ExperimentalCamera2Interop::class)
@Module(
includes = [
ZoomCompat.Bindings::class,
ZoomControl.Bindings::class,
EvCompCompat.Bindings::class,
- EvCompControl.Bindings::class
+ EvCompControl.Bindings::class,
+ Camera2CameraControl.Bindings::class,
+ Camera2CameraControlCompat.Bindings::class,
],
subcomponents = [UseCaseCameraComponent::class]
)
diff --git a/camera/camera-camera2-pipe-integration/src/main/java/androidx/camera/camera2/pipe/integration/interop/Camera2CameraControl.kt b/camera/camera-camera2-pipe-integration/src/main/java/androidx/camera/camera2/pipe/integration/interop/Camera2CameraControl.kt
new file mode 100644
index 0000000..480c7cc
--- /dev/null
+++ b/camera/camera-camera2-pipe-integration/src/main/java/androidx/camera/camera2/pipe/integration/interop/Camera2CameraControl.kt
@@ -0,0 +1,205 @@
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * 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.
+ */
+
+package androidx.camera.camera2.pipe.integration.interop
+
+import androidx.annotation.RestrictTo
+import androidx.annotation.VisibleForTesting
+import androidx.camera.camera2.pipe.integration.adapter.CameraControlAdapter
+import androidx.camera.camera2.pipe.integration.adapter.asListenableFuture
+import androidx.camera.camera2.pipe.integration.compat.Camera2CameraControlCompat
+import androidx.camera.camera2.pipe.integration.config.CameraScope
+import androidx.camera.camera2.pipe.integration.impl.ComboRequestListener
+import androidx.camera.camera2.pipe.integration.impl.UseCaseCamera
+import androidx.camera.camera2.pipe.integration.impl.UseCaseCameraControl
+import androidx.camera.camera2.pipe.integration.impl.UseCaseThreads
+import androidx.camera.core.CameraControl
+import androidx.camera.core.impl.utils.futures.Futures
+import androidx.core.util.Preconditions
+import com.google.common.util.concurrent.ListenableFuture
+import dagger.Binds
+import dagger.Module
+import dagger.multibindings.IntoSet
+import javax.inject.Inject
+
+/**
+ * An class that provides ability to interoperate with the [android.hardware.camera2] APIs.
+ *
+ * Camera2 specific controls, like capture request options, can be applied through this class.
+ * A Camera2CameraControl can be created from a general [CameraControl] which is associated
+ * to a camera. Then the controls will affect all use cases that are using that camera.
+ *
+ * If any option applied by Camera2CameraControl conflicts with the options required by
+ * CameraX internally. The options from Camera2CameraControl will override, which may result in
+ * unexpected behavior depends on the options being applied.
+ */
+@CameraScope
+@ExperimentalCamera2Interop
+class Camera2CameraControl @Inject constructor(
+ private val compat: Camera2CameraControlCompat,
+ private val threads: UseCaseThreads,
+ @VisibleForTesting
+ internal val requestListener: ComboRequestListener,
+) : UseCaseCameraControl {
+
+ private var _useCaseCamera: UseCaseCamera? = null
+ override var useCaseCamera
+ /**
+ * @hide
+ */
+ @RestrictTo(RestrictTo.Scope.LIBRARY)
+ get() = _useCaseCamera
+ /**
+ * @hide
+ */
+ @RestrictTo(RestrictTo.Scope.LIBRARY)
+ set(value) {
+ _useCaseCamera = value
+ _useCaseCamera?.also {
+ requestListener.removeListener(compat)
+ requestListener.addListener(compat, threads.sequentialExecutor)
+ compat.applyAsync(it)
+ } ?: reset() // reset when _useCaseCamera == null
+ }
+
+ /**
+ * @hide
+ */
+ @RestrictTo(RestrictTo.Scope.LIBRARY)
+ override fun reset() {
+ // Clear the current task, but don't clear the CaptureRequestOptions. Camera2CameraControl
+ // will store the CaptureRequestOptions while use case is detached.
+ compat.cancelCurrentTask()
+ requestListener.removeListener(compat)
+ }
+
+ /**
+ * Sets a [CaptureRequestOptions] and updates the session with the options it contains.
+ *
+ * This will first clear all options that have already been set, then apply the new options.
+ *
+ * Any values which are in conflict with values already set by CameraX, such as by
+ * [androidx.camera.core.CameraControl], will overwrite the existing values. The
+ * values will be submitted with every repeating and single capture requests issued by
+ * CameraX, which may result in unexpected behavior depending on the values being applied.
+ *
+ * @param bundle The [CaptureRequestOptions] which will be set.
+ * @return a [ListenableFuture] which completes when the repeating
+ * [android.hardware.camera2.CaptureResult] shows the options have be submitted
+ * completely. The future fails with [CameraControl.OperationCanceledException] if newer
+ * options are set or camera is closed before the current request completes.
+ * Cancelling the ListenableFuture is a no-op.
+ */
+ fun setCaptureRequestOptions(bundle: CaptureRequestOptions): ListenableFuture<Void?> {
+ compat.clearRequestOption()
+ compat.addRequestOption(bundle)
+ return updateAsync("setCaptureRequestOptions")
+ }
+
+ /**
+ * Adds a [CaptureRequestOptions] updates the session with the options it contains.
+ *
+ * The options will be merged with the existing options. If one option is set with a
+ * different value, it will overwrite the existing value.
+ *
+ * Any values which are in conflict with values already set by CameraX, such as by
+ * [androidx.camera.core.CameraControl], will overwrite the existing values. The
+ * values will be submitted with every repeating and single capture requests issued by
+ * CameraX, which may result in unexpected behavior depends on the values being applied.
+ *
+ * @param bundle The [CaptureRequestOptions] which will be set.
+ * @return a [ListenableFuture] which completes when the repeating
+ * [android.hardware.camera2.CaptureResult] shows the options have be submitted
+ * completely. The future fails with [CameraControl.OperationCanceledException] if newer
+ * options are set or camera is closed before the current request completes.
+ */
+ fun addCaptureRequestOptions(
+ bundle: CaptureRequestOptions
+ ): ListenableFuture<Void?> {
+ compat.addRequestOption(bundle)
+ return updateAsync("addCaptureRequestOptions")
+ }
+
+ /**
+ * Gets all the capture request options that is currently applied by the [Camera2CameraControl].
+ *
+ * It doesn't include the capture request options applied by
+ * the [android.hardware.camera2.CameraDevice] templates or by CameraX.
+ *
+ * @return The [CaptureRequestOptions].
+ */
+ fun getCaptureRequestOptions(): CaptureRequestOptions = compat.getRequestOption()
+
+ /**
+ * Clears all capture request options.
+ *
+ * @return a [ListenableFuture] which completes when the repeating
+ * [android.hardware.camera2.CaptureResult] shows the options have be submitted
+ * completely. The future fails with [CameraControl.OperationCanceledException] if newer
+ * options are set or camera is closed before the current request completes.
+ * @hide
+ */
+ @RestrictTo(RestrictTo.Scope.LIBRARY)
+ fun clearCaptureRequestOptions(): ListenableFuture<Void?> {
+ compat.clearRequestOption()
+ return updateAsync("clearCaptureRequestOptions")
+ }
+
+ private fun updateAsync(tag: String): ListenableFuture<Void?> =
+ Futures.nonCancellationPropagating(
+ compat.applyAsync(useCaseCamera).asListenableFuture(tag)
+ )
+
+ /**
+ * @hide
+ */
+ @RestrictTo(RestrictTo.Scope.LIBRARY)
+ @Module
+ abstract class Bindings {
+ @Binds
+ @IntoSet
+ abstract fun provideControls(control: Camera2CameraControl): UseCaseCameraControl
+ }
+
+ companion object {
+
+ /**
+ * Gets the [Camera2CameraControl] from a [CameraControl].
+ *
+ * The [CameraControl] is still usable after a [Camera2CameraControl] is
+ * obtained from it. Note that the [Camera2CameraControl] has higher priority than the
+ * [CameraControl]. For example, if
+ * [android.hardware.camera2.CaptureRequest.FLASH_MODE] is set through the
+ * [Camera2CameraControl]. All [CameraControl] features that required
+ * [android.hardware.camera2.CaptureRequest.FLASH_MODE] internally like torch may not
+ * work properly.
+ *
+ * @param cameraControl The [CameraControl] to get from.
+ * @return The camera control with Camera2 implementation.
+ * @throws IllegalArgumentException if the camera control does not contain the camera2
+ * information (e.g., if CameraX was not initialized with a
+ * [androidx.camera.camera2.pipe.integration.CameraPipeConfig]).
+ */
+ @JvmStatic
+ fun from(cameraControl: CameraControl): Camera2CameraControl {
+ Preconditions.checkArgument(
+ cameraControl is CameraControlAdapter,
+ "CameraControl doesn't contain Camera2 implementation."
+ )
+ return (cameraControl as CameraControlAdapter).camera2cameraControl
+ }
+ }
+}
\ No newline at end of file
diff --git a/camera/camera-camera2-pipe-integration/src/test/java/androidx/camera/camera2/pipe/integration/interop/Camera2CameraControlTest.kt b/camera/camera-camera2-pipe-integration/src/test/java/androidx/camera/camera2/pipe/integration/interop/Camera2CameraControlTest.kt
new file mode 100644
index 0000000..5bcde30
--- /dev/null
+++ b/camera/camera-camera2-pipe-integration/src/test/java/androidx/camera/camera2/pipe/integration/interop/Camera2CameraControlTest.kt
@@ -0,0 +1,37 @@
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * 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.
+ */
+
+package androidx.camera.camera2.pipe.integration.interop
+
+import android.os.Build
+import androidx.camera.camera2.pipe.integration.adapter.RobolectricCameraPipeTestRunner
+import androidx.camera.core.impl.CameraControlInternal
+import org.junit.Test
+import org.junit.runner.RunWith
+import org.robolectric.annotation.Config
+
+@RunWith(RobolectricCameraPipeTestRunner::class)
+@Config(minSdk = Build.VERSION_CODES.LOLLIPOP)
+@OptIn(ExperimentalCamera2Interop::class)
+class Camera2CameraControlTest {
+
+ @Test(expected = IllegalArgumentException::class)
+ fun fromCameraControlThrows_whenNotCamera2Impl() {
+ val wrongCameraControl =
+ CameraControlInternal.DEFAULT_EMPTY_INSTANCE
+ Camera2CameraControl.from(wrongCameraControl)
+ }
+}
\ No newline at end of file
diff --git a/camera/camera-camera2/lint-baseline.xml b/camera/camera-camera2/lint-baseline.xml
index 3c8a8b9..9212724 100644
--- a/camera/camera-camera2/lint-baseline.xml
+++ b/camera/camera-camera2/lint-baseline.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<issues format="6" by="lint 7.1.0-dev" type="baseline" client="gradle" name="AGP (7.1.0-dev)" variant="all" version="7.1.0-dev">
+<issues format="6" by="lint 7.1.0-dev" type="baseline" client="gradle" dependencies="false" name="AGP (7.1.0-dev)" variant="all" version="7.1.0-dev">
<issue
id="NewApi"
@@ -52,7 +52,7 @@
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="src/test/java/androidx/camera/camera2/internal/compat/CameraDeviceCompatTest.java"
- line="104"
+ line="105"
column="41"/>
</issue>
@@ -63,7 +63,7 @@
errorLine2=" ~~~~~~~~~~~~~~~~~~~~">
<location
file="src/test/java/androidx/camera/camera2/internal/compat/CameraDeviceCompatTest.java"
- line="123"
+ line="124"
column="41"/>
</issue>
@@ -74,7 +74,7 @@
errorLine2=" ~~~~~~~~~~~~~~~~~~~~">
<location
file="src/test/java/androidx/camera/camera2/internal/compat/CameraDeviceCompatTest.java"
- line="124"
+ line="125"
column="21"/>
</issue>
@@ -85,7 +85,7 @@
errorLine2=" ~~~~~~~~~~~~~~~~~~">
<location
file="src/test/java/androidx/camera/camera2/internal/compat/CameraDeviceCompatTest.java"
- line="167"
+ line="168"
column="52"/>
</issue>
@@ -96,7 +96,7 @@
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="src/test/java/androidx/camera/camera2/internal/compat/CameraDeviceCompatTest.java"
- line="172"
+ line="173"
column="41"/>
</issue>
@@ -107,7 +107,7 @@
errorLine2=" ~~~~~~~~~~~~~~~~~~">
<location
file="src/test/java/androidx/camera/camera2/internal/compat/CameraDeviceCompatTest.java"
- line="173"
+ line="174"
column="21"/>
</issue>
@@ -118,7 +118,7 @@
errorLine2=" ~~~~~~~~~~~~~~~~~~">
<location
file="src/test/java/androidx/camera/camera2/internal/compat/CameraDeviceCompatTest.java"
- line="192"
+ line="193"
column="52"/>
</issue>
@@ -129,7 +129,7 @@
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="src/test/java/androidx/camera/camera2/internal/compat/CameraDeviceCompatTest.java"
- line="197"
+ line="198"
column="41"/>
</issue>
@@ -140,7 +140,7 @@
errorLine2=" ~~~~~~~~~~~~~~~~~~">
<location
file="src/test/java/androidx/camera/camera2/internal/compat/CameraDeviceCompatTest.java"
- line="198"
+ line="199"
column="21"/>
</issue>
@@ -151,7 +151,7 @@
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="src/test/java/androidx/camera/camera2/internal/compat/CameraDeviceCompatTest.java"
- line="217"
+ line="218"
column="41"/>
</issue>
@@ -426,7 +426,7 @@
errorLine2=" ~~~~~~~~~~~~~~~~~~~">
<location
file="src/test/java/androidx/camera/camera2/internal/SynchronizedCaptureSessionBaseTest.java"
- line="118"
+ line="119"
column="55"/>
</issue>
@@ -437,7 +437,7 @@
errorLine2=" ~~~~~~~~~~~~~~~~~~~">
<location
file="src/test/java/androidx/camera/camera2/internal/SynchronizedCaptureSessionBaseTest.java"
- line="120"
+ line="121"
column="36"/>
</issue>
@@ -448,7 +448,7 @@
errorLine2=" ~~~~~~~~~~~~~~~~~">
<location
file="src/test/java/androidx/camera/camera2/internal/SynchronizedCaptureSessionBaseTest.java"
- line="132"
+ line="133"
column="55"/>
</issue>
@@ -459,7 +459,7 @@
errorLine2=" ~~~~~~~~~~~~~~~~~">
<location
file="src/test/java/androidx/camera/camera2/internal/SynchronizedCaptureSessionBaseTest.java"
- line="135"
+ line="136"
column="36"/>
</issue>
@@ -541,39 +541,6 @@
</issue>
<issue
- id="SoonBlockedPrivateApi"
- message="Reflective access to MAX_SURFACES_COUNT will throw an exception when targeting API 30 and above"
- errorLine1=" Field maxSurfacesCountField = OutputConfiguration.class.getDeclaredField("
- errorLine2=" ^">
- <location
- file="src/main/java/androidx/camera/camera2/internal/compat/params/OutputConfigurationCompatApi26Impl.java"
- line="62"
- column="39"/>
- </issue>
-
- <issue
- id="SoonBlockedPrivateApi"
- message="Reflective access to mSurfaces will throw an exception when targeting API 30 and above"
- errorLine1=" Field surfacesField = OutputConfiguration.class.getDeclaredField(SURFACES_FIELD);"
- errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
- <location
- file="src/main/java/androidx/camera/camera2/internal/compat/params/OutputConfigurationCompatApi26Impl.java"
- line="71"
- column="31"/>
- </issue>
-
- <issue
- id="WrongConstant"
- message="Must be one of: SessionConfigurationCompat.SESSION_REGULAR, SessionConfigurationCompat.SESSION_HIGH_SPEED"
- errorLine1=" return mObject.getSessionType();"
- errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~">
- <location
- file="src/main/java/androidx/camera/camera2/internal/compat/params/SessionConfigurationCompat.java"
- line="427"
- column="20"/>
- </issue>
-
- <issue
id="BanUncheckedReflection"
message="Calling `Method.invoke` without an SDK check"
errorLine1=" return (Size) getSurfaceSize.invoke(null, surface);"
@@ -607,6 +574,281 @@
</issue>
<issue
+ id="UnsafeOptInUsageError"
+ message="This declaration is opt-in and its usage should be marked with
'@androidx.camera.camera2.interop.ExperimentalCamera2Interop' or '@OptIn(markerClass = androidx.camera.camera2.interop.ExperimentalCamera2Interop.class)'"
+ errorLine1=" configBuilder.setCaptureRequestOption(CaptureRequest.CONTROL_AE_TARGET_FPS_RANGE,"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/java/androidx/camera/camera2/internal/compat/workaround/AeFpsRange.java"
+ line="54"
+ column="27"/>
+ </issue>
+
+ <issue
+ id="UnsafeOptInUsageError"
+ message="This declaration is opt-in and its usage should be marked with
'@androidx.camera.camera2.interop.ExperimentalCamera2Interop' or '@OptIn(markerClass = androidx.camera.camera2.interop.ExperimentalCamera2Interop.class)'"
+ errorLine1=" builder.setCaptureRequestOption(CaptureRequest.CONTROL_ZOOM_RATIO, mCurrentZoomRatio);"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/java/androidx/camera/camera2/internal/AndroidRZoomImpl.java"
+ line="60"
+ column="17"/>
+ </issue>
+
+ <issue
+ id="UnsafeOptInUsageError"
+ message="This declaration is opt-in and its usage should be marked with
'@androidx.camera.camera2.interop.ExperimentalCamera2Interop' or '@OptIn(markerClass = androidx.camera.camera2.interop.ExperimentalCamera2Interop.class)'"
+ errorLine1=" builder.setCaptureRequestOption(CaptureRequest.SCALER_CROP_REGION,"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/java/androidx/camera/camera2/internal/CropRegionZoomImpl.java"
+ line="65"
+ column="21"/>
+ </issue>
+
+ <issue
+ id="UnsafeOptInUsageError"
+ message="This declaration is opt-in and its usage should be marked with
'@androidx.camera.camera2.interop.ExperimentalCamera2Interop' or '@OptIn(markerClass = androidx.camera.camera2.interop.ExperimentalCamera2Interop.class)'"
+ errorLine1=" configBuilder.setCaptureRequestOption(CaptureRequest.CONTROL_AE_EXPOSURE_COMPENSATION,"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/java/androidx/camera/camera2/internal/ExposureControl.java"
+ line="127"
+ column="23"/>
+ </issue>
+
+ <issue
+ id="UnsafeOptInUsageError"
+ message="This declaration is opt-in and its usage should be marked with
'@androidx.camera.camera2.interop.ExperimentalCamera2Interop' or '@OptIn(markerClass = androidx.camera.camera2.interop.ExperimentalCamera2Interop.class)'"
+ errorLine1=" configBuilder.setCaptureRequestOption("
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/java/androidx/camera/camera2/internal/FocusMeteringControl.java"
+ line="181"
+ column="23"/>
+ </issue>
+
+ <issue
+ id="UnsafeOptInUsageError"
+ message="This declaration is opt-in and its usage should be marked with
'@androidx.camera.camera2.interop.ExperimentalCamera2Interop' or '@OptIn(markerClass = androidx.camera.camera2.interop.ExperimentalCamera2Interop.class)'"
+ errorLine1=" configBuilder.setCaptureRequestOption("
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/java/androidx/camera/camera2/internal/FocusMeteringControl.java"
+ line="185"
+ column="27"/>
+ </issue>
+
+ <issue
+ id="UnsafeOptInUsageError"
+ message="This declaration is opt-in and its usage should be marked with
'@androidx.camera.camera2.interop.ExperimentalCamera2Interop' or '@OptIn(markerClass = androidx.camera.camera2.interop.ExperimentalCamera2Interop.class)'"
+ errorLine1=" configBuilder.setCaptureRequestOption("
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/java/androidx/camera/camera2/internal/FocusMeteringControl.java"
+ line="189"
+ column="27"/>
+ </issue>
+
+ <issue
+ id="UnsafeOptInUsageError"
+ message="This declaration is opt-in and its usage should be marked with
'@androidx.camera.camera2.interop.ExperimentalCamera2Interop' or '@OptIn(markerClass = androidx.camera.camera2.interop.ExperimentalCamera2Interop.class)'"
+ errorLine1=" configBuilder.setCaptureRequestOption("
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/java/androidx/camera/camera2/internal/FocusMeteringControl.java"
+ line="193"
+ column="27"/>
+ </issue>
+
+ <issue
+ id="UnsafeOptInUsageError"
+ message="This declaration is opt-in and its usage should be marked with
'@androidx.camera.camera2.interop.ExperimentalCamera2Interop' or '@OptIn(markerClass = androidx.camera.camera2.interop.ExperimentalCamera2Interop.class)'"
+ errorLine1=" Camera2ImplConfig.Builder configBuilder = new Camera2ImplConfig.Builder();"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/java/androidx/camera/camera2/internal/FocusMeteringControl.java"
+ line="366"
+ column="51"/>
+ </issue>
+
+ <issue
+ id="UnsafeOptInUsageError"
+ message="This declaration is opt-in and its usage should be marked with
'@androidx.camera.camera2.interop.ExperimentalCamera2Interop' or '@OptIn(markerClass = androidx.camera.camera2.interop.ExperimentalCamera2Interop.class)'"
+ errorLine1=" configBuilder.setCaptureRequestOption(CaptureRequest.CONTROL_AF_TRIGGER,"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/java/androidx/camera/camera2/internal/FocusMeteringControl.java"
+ line="367"
+ column="23"/>
+ </issue>
+
+ <issue
+ id="UnsafeOptInUsageError"
+ message="This declaration is opt-in and its usage should be marked with
'@androidx.camera.camera2.interop.ExperimentalCamera2Interop' or '@OptIn(markerClass = androidx.camera.camera2.interop.ExperimentalCamera2Interop.class)'"
+ errorLine1=" builder.addImplementationOptions(configBuilder.build());"
+ errorLine2=" ~~~~~">
+ <location
+ file="src/main/java/androidx/camera/camera2/internal/FocusMeteringControl.java"
+ line="369"
+ column="56"/>
+ </issue>
+
+ <issue
+ id="UnsafeOptInUsageError"
+ message="This declaration is opt-in and its usage should be marked with
'@androidx.camera.camera2.interop.ExperimentalCamera2Interop' or '@OptIn(markerClass = androidx.camera.camera2.interop.ExperimentalCamera2Interop.class)'"
+ errorLine1=" Camera2ImplConfig.Builder configBuilder = new Camera2ImplConfig.Builder();"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/java/androidx/camera/camera2/internal/FocusMeteringControl.java"
+ line="417"
+ column="51"/>
+ </issue>
+
+ <issue
+ id="UnsafeOptInUsageError"
+ message="This declaration is opt-in and its usage should be marked with
'@androidx.camera.camera2.interop.ExperimentalCamera2Interop' or '@OptIn(markerClass = androidx.camera.camera2.interop.ExperimentalCamera2Interop.class)'"
+ errorLine1=" configBuilder.setCaptureRequestOption(CaptureRequest.CONTROL_AE_PRECAPTURE_TRIGGER,"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/java/androidx/camera/camera2/internal/FocusMeteringControl.java"
+ line="418"
+ column="23"/>
+ </issue>
+
+ <issue
+ id="UnsafeOptInUsageError"
+ message="This declaration is opt-in and its usage should be marked with
'@androidx.camera.camera2.interop.ExperimentalCamera2Interop' or '@OptIn(markerClass = androidx.camera.camera2.interop.ExperimentalCamera2Interop.class)'"
+ errorLine1=" builder.addImplementationOptions(configBuilder.build());"
+ errorLine2=" ~~~~~">
+ <location
+ file="src/main/java/androidx/camera/camera2/internal/FocusMeteringControl.java"
+ line="420"
+ column="56"/>
+ </issue>
+
+ <issue
+ id="UnsafeOptInUsageError"
+ message="This declaration is opt-in and its usage should be marked with
'@androidx.camera.camera2.interop.ExperimentalCamera2Interop' or '@OptIn(markerClass = androidx.camera.camera2.interop.ExperimentalCamera2Interop.class)'"
+ errorLine1=" Camera2ImplConfig.Builder configBuilder = new Camera2ImplConfig.Builder();"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/java/androidx/camera/camera2/internal/FocusMeteringControl.java"
+ line="459"
+ column="51"/>
+ </issue>
+
+ <issue
+ id="UnsafeOptInUsageError"
+ message="This declaration is opt-in and its usage should be marked with
'@androidx.camera.camera2.interop.ExperimentalCamera2Interop' or '@OptIn(markerClass = androidx.camera.camera2.interop.ExperimentalCamera2Interop.class)'"
+ errorLine1=" configBuilder.setCaptureRequestOption(CaptureRequest.CONTROL_AF_TRIGGER,"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/java/androidx/camera/camera2/internal/FocusMeteringControl.java"
+ line="461"
+ column="27"/>
+ </issue>
+
+ <issue
+ id="UnsafeOptInUsageError"
+ message="This declaration is opt-in and its usage should be marked with
'@androidx.camera.camera2.interop.ExperimentalCamera2Interop' or '@OptIn(markerClass = androidx.camera.camera2.interop.ExperimentalCamera2Interop.class)'"
+ errorLine1=" configBuilder.setCaptureRequestOption(CaptureRequest.CONTROL_AE_PRECAPTURE_TRIGGER,"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/java/androidx/camera/camera2/internal/FocusMeteringControl.java"
+ line="465"
+ column="27"/>
+ </issue>
+
+ <issue
+ id="UnsafeOptInUsageError"
+ message="This declaration is opt-in and its usage should be marked with
'@androidx.camera.camera2.interop.ExperimentalCamera2Interop' or '@OptIn(markerClass = androidx.camera.camera2.interop.ExperimentalCamera2Interop.class)'"
+ errorLine1=" builder.addImplementationOptions(configBuilder.build());"
+ errorLine2=" ~~~~~">
+ <location
+ file="src/main/java/androidx/camera/camera2/internal/FocusMeteringControl.java"
+ line="468"
+ column="56"/>
+ </issue>
+
+ <issue
+ id="UnsafeOptInUsageError"
+ message="This declaration is opt-in and its usage should be marked with
'@androidx.camera.camera2.interop.ExperimentalCamera2Interop' or '@OptIn(markerClass = androidx.camera.camera2.interop.ExperimentalCamera2Interop.class)'"
+ errorLine1=" Camera2ImplConfig.Builder camera2ConfigBuilder = new Camera2ImplConfig.Builder();"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/java/androidx/camera/camera2/internal/ImageCaptureOptionUnpacker.java"
+ line="52"
+ column="58"/>
+ </issue>
+
+ <issue
+ id="UnsafeOptInUsageError"
+ message="This declaration is opt-in and its usage should be marked with
'@androidx.camera.camera2.interop.ExperimentalCamera2Interop' or '@OptIn(markerClass = androidx.camera.camera2.interop.ExperimentalCamera2Interop.class)'"
+ errorLine1=" builder.addImplementationOptions(camera2ConfigBuilder.build());"
+ errorLine2=" ~~~~~">
+ <location
+ file="src/main/java/androidx/camera/camera2/internal/ImageCaptureOptionUnpacker.java"
+ line="59"
+ column="63"/>
+ </issue>
+
+ <issue
+ id="UnsafeOptInUsageError"
+ message="This declaration is opt-in and its usage should be marked with
'@androidx.camera.camera2.interop.ExperimentalCamera2Interop' or '@OptIn(markerClass = androidx.camera.camera2.interop.ExperimentalCamera2Interop.class)'"
+ errorLine1=" builder.setCaptureRequestOption(CaptureRequest.CONTROL_ENABLE_ZSL, true);"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/java/androidx/camera/camera2/internal/compat/workaround/ImageCapturePixelHDRPlus.java"
+ line="53"
+ column="25"/>
+ </issue>
+
+ <issue
+ id="UnsafeOptInUsageError"
+ message="This declaration is opt-in and its usage should be marked with
'@androidx.camera.camera2.interop.ExperimentalCamera2Interop' or '@OptIn(markerClass = androidx.camera.camera2.interop.ExperimentalCamera2Interop.class)'"
+ errorLine1=" builder.setCaptureRequestOption(CaptureRequest.CONTROL_ENABLE_ZSL, false);"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/java/androidx/camera/camera2/internal/compat/workaround/ImageCapturePixelHDRPlus.java"
+ line="57"
+ column="25"/>
+ </issue>
+
+ <issue
+ id="UnsafeOptInUsageError"
+ message="This declaration is opt-in and its usage should be marked with
'@androidx.camera.camera2.interop.ExperimentalCamera2Interop' or '@OptIn(markerClass = androidx.camera.camera2.interop.ExperimentalCamera2Interop.class)'"
+ errorLine1=" Camera2ImplConfig.Builder camera2ConfigBuilder = new Camera2ImplConfig.Builder();"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/java/androidx/camera/camera2/internal/compat/workaround/PreviewPixelHDRnet.java"
+ line="46"
+ column="58"/>
+ </issue>
+
+ <issue
+ id="UnsafeOptInUsageError"
+ message="This declaration is opt-in and its usage should be marked with
'@androidx.camera.camera2.interop.ExperimentalCamera2Interop' or '@OptIn(markerClass = androidx.camera.camera2.interop.ExperimentalCamera2Interop.class)'"
+ errorLine1=" camera2ConfigBuilder.setCaptureRequestOption(CaptureRequest.TONEMAP_MODE,"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/java/androidx/camera/camera2/internal/compat/workaround/PreviewPixelHDRnet.java"
+ line="47"
+ column="30"/>
+ </issue>
+
+ <issue
+ id="UnsafeOptInUsageError"
+ message="This declaration is opt-in and its usage should be marked with
'@androidx.camera.camera2.interop.ExperimentalCamera2Interop' or '@OptIn(markerClass = androidx.camera.camera2.interop.ExperimentalCamera2Interop.class)'"
+ errorLine1=" sessionBuilder.addImplementationOptions(camera2ConfigBuilder.build());"
+ errorLine2=" ~~~~~">
+ <location
+ file="src/main/java/androidx/camera/camera2/internal/compat/workaround/PreviewPixelHDRnet.java"
+ line="49"
+ column="70"/>
+ </issue>
+
+ <issue
id="UnknownNullness"
message="Unknown nullability; explicitly declare as `@Nullable` or `@NonNull` to improve Kotlin interoperability; see https://android.github.io/kotlin-guides/interop.html#nullability-annotations"
errorLine1=" public static List<OutputConfiguration> transformFromCompat("
diff --git a/camera/camera-camera2/src/androidTest/java/androidx/camera/camera2/internal/compat/workaround/ExtraSupportedSurfaceCombinationsContainerDeviceTest.kt b/camera/camera-camera2/src/androidTest/java/androidx/camera/camera2/internal/compat/workaround/ExtraSupportedSurfaceCombinationsContainerDeviceTest.kt
new file mode 100644
index 0000000..29a2661
--- /dev/null
+++ b/camera/camera-camera2/src/androidTest/java/androidx/camera/camera2/internal/compat/workaround/ExtraSupportedSurfaceCombinationsContainerDeviceTest.kt
@@ -0,0 +1,355 @@
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * 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.
+ */
+
+package androidx.camera.camera2.internal.compat.workaround
+
+import android.content.Context
+import android.graphics.ImageFormat
+import android.graphics.SurfaceTexture
+import android.hardware.camera2.CameraCharacteristics
+import android.hardware.camera2.CameraManager
+import android.util.Size
+import android.view.Surface
+import androidx.camera.camera2.Camera2Config
+import androidx.camera.camera2.internal.compat.quirk.DeviceQuirks
+import androidx.camera.camera2.internal.compat.quirk.ExtraSupportedSurfaceCombinationsQuirk
+import androidx.camera.camera2.interop.Camera2CameraInfo
+import androidx.camera.core.CameraInfo
+import androidx.camera.core.CameraSelector
+import androidx.camera.core.CameraX
+import androidx.camera.core.ImageAnalysis
+import androidx.camera.core.ImageCapture
+import androidx.camera.core.ImageCaptureException
+import androidx.camera.core.ImageProxy
+import androidx.camera.core.Preview
+import androidx.camera.core.impl.CameraInfoInternal
+import androidx.camera.core.impl.CaptureProcessor
+import androidx.camera.core.impl.ImageProxyBundle
+import androidx.camera.core.impl.SurfaceCombination
+import androidx.camera.core.impl.SurfaceConfig
+import androidx.camera.core.impl.utils.executor.CameraXExecutors
+import androidx.camera.core.internal.CameraUseCaseAdapter
+import androidx.camera.testing.CameraUtil
+import androidx.camera.testing.SurfaceTextureProvider
+import androidx.test.core.app.ApplicationProvider
+import androidx.test.filters.LargeTest
+import com.google.common.truth.Truth.assertThat
+import kotlinx.coroutines.Dispatchers
+import kotlinx.coroutines.runBlocking
+import kotlinx.coroutines.withContext
+import org.junit.After
+import org.junit.Assume.assumeNotNull
+import org.junit.Assume.assumeTrue
+import org.junit.Before
+import org.junit.Rule
+import org.junit.Test
+import org.junit.rules.TestRule
+import org.junit.runner.RunWith
+import org.junit.runners.Parameterized
+import java.util.Arrays
+import java.util.concurrent.CountDownLatch
+import java.util.concurrent.TimeUnit
+
+private const val CAPTURE_TIMEOUT = 10_000.toLong() // 10 seconds
+
+@LargeTest
+@RunWith(Parameterized::class)
+class ExtraSupportedSurfaceCombinationsContainerDeviceTest(val cameraId: String) {
+
+ @get:Rule
+ val useCamera: TestRule = CameraUtil.grantCameraPermissionAndPreTest()
+
+ private val context = ApplicationProvider.getApplicationContext<Context>()
+
+ companion object {
+ @JvmStatic
+ @Parameterized.Parameters(name = "cameraId = {0}")
+ fun initParameters(): List<String> = getCameraIds()
+
+ private fun getCameraIds(): List<String> {
+ val cameraManager = ApplicationProvider.getApplicationContext<Context>()
+ .getSystemService(Context.CAMERA_SERVICE) as CameraManager
+
+ return cameraManager.cameraIdList.asList()
+ }
+ }
+
+ private lateinit var cameraUseCaseAdapter: CameraUseCaseAdapter
+
+ private val extraConfigurationQuirk = ExtraSupportedSurfaceCombinationsContainer()
+
+ @Before
+ fun setUp() {
+ assumeTrue(CameraUtil.deviceHasCamera())
+ CameraX.initialize(context, Camera2Config.defaultConfig()).get()
+
+ // Only runs the test when the ExtraSupportedSurfaceCombinationsQuirk is applied for the
+ // device.
+ assumeNotNull(DeviceQuirks.get(ExtraSupportedSurfaceCombinationsQuirk::class.java))
+ }
+
+ @After
+ fun tearDown() {
+ CameraX.shutdown().get(10000, TimeUnit.MILLISECONDS)
+ }
+
+ @Test
+ fun successCaptureImage_whenExtraYuvPrivYuvConfigurationSupported() = runBlocking {
+ var cameraSelector = createCameraSelectorById(cameraId)
+ cameraUseCaseAdapter = CameraUtil.createCameraUseCaseAdapter(context, cameraSelector)
+ var camera2CameraInfo = Camera2CameraInfo.from(cameraUseCaseAdapter.cameraInfo)
+
+ var hardwareLevel: Int? = camera2CameraInfo.getCameraCharacteristic(
+ CameraCharacteristics
+ .INFO_SUPPORTED_HARDWARE_LEVEL
+ )
+
+ val capabilities = camera2CameraInfo
+ .getCameraCharacteristic(CameraCharacteristics.REQUEST_AVAILABLE_CAPABILITIES)
+
+ assumeTrue(
+ capabilities != null &&
+ capabilities.contains(
+ CameraCharacteristics.REQUEST_AVAILABLE_CAPABILITIES_BACKWARD_COMPATIBLE
+ )
+ )
+
+ // Only runs the test when the YUV + PRIV + YUV configuration is included in the extra
+ // supported configurations list.
+ assumeTrue(
+ supportExtraFullYuvPrivYuvConfiguration(
+ camera2CameraInfo.cameraId,
+ hardwareLevel!!
+ )
+ )
+
+ // Image analysis use a YUV stream by default
+ var imageAnalysis = ImageAnalysis.Builder().build()
+
+ // Preview use a PRIV stream by default
+ var preview = Preview.Builder().build()
+
+ // Forces the image capture to use a YUV stream
+ var imageCapture =
+ ImageCapture.Builder().setBufferFormat(ImageFormat.YUV_420_888).build()
+
+ withContext(Dispatchers.Main) {
+ preview.setSurfaceProvider(getSurfaceProvider())
+ cameraUseCaseAdapter.addUseCases(Arrays.asList(imageAnalysis, preview, imageCapture))
+ }
+
+ // Checks whether a picture can be captured successfully in the YUV + PRIV + YUV
+ // configuration. This means that a capture session can be created successfully in the
+ // configuration.
+ val callback = FakeImageCaptureCallback()
+ imageCapture.takePicture(CameraXExecutors.directExecutor(), callback)
+ callback.awaitCapturesAndAssert()
+ }
+
+ @Test
+ fun successCaptureImage_whenExtraYuvYuvYuvConfigurationSupported() = runBlocking {
+ var cameraSelector = createCameraSelectorById(cameraId)
+ cameraUseCaseAdapter = CameraUtil.createCameraUseCaseAdapter(context, cameraSelector)
+ var camera2CameraInfo = Camera2CameraInfo.from(cameraUseCaseAdapter.cameraInfo)
+
+ var hardwareLevel: Int? = camera2CameraInfo.getCameraCharacteristic(
+ CameraCharacteristics
+ .INFO_SUPPORTED_HARDWARE_LEVEL
+ )
+
+ val capabilities = camera2CameraInfo
+ .getCameraCharacteristic(CameraCharacteristics.REQUEST_AVAILABLE_CAPABILITIES)
+
+ assumeTrue(
+ capabilities != null &&
+ capabilities.contains(
+ CameraCharacteristics.REQUEST_AVAILABLE_CAPABILITIES_BACKWARD_COMPATIBLE
+ )
+ )
+
+ // Only runs the test when the YUV + YUV + YUV configuration is included in the extra
+ // supported configurations list.
+ assumeTrue(
+ supportExtraFullYuvYuvYuvConfiguration(
+ camera2CameraInfo.cameraId,
+ hardwareLevel!!
+ )
+ )
+
+ // Image analysis use a YUV stream by default
+ var imageAnalysis = ImageAnalysis.Builder().build()
+
+ // Sets a CaptureProcessor to make the preview use a YUV stream
+ var preview = Preview.Builder()
+ .setCaptureProcessor(FakePreviewCaptureProcessor()).build()
+
+ // Forces the image capture to use a YUV stream
+ var imageCapture =
+ ImageCapture.Builder().setBufferFormat(ImageFormat.YUV_420_888).build()
+
+ withContext(Dispatchers.Main) {
+ preview.setSurfaceProvider(getSurfaceProvider())
+ cameraUseCaseAdapter.addUseCases(Arrays.asList(imageAnalysis, preview, imageCapture))
+ }
+
+ // Checks whether a picture can be captured successfully in the YUV + YUV + YUV
+ // configuration. This means that a capture session can be created successfully in the
+ // configuration.
+ val callback = FakeImageCaptureCallback()
+ imageCapture.takePicture(CameraXExecutors.directExecutor(), callback)
+ callback.awaitCapturesAndAssert()
+ }
+
+ private fun createCameraSelectorById(id: String): CameraSelector {
+ var builder = CameraSelector.Builder()
+
+ builder.addCameraFilter { cameraInfos: List<CameraInfo> ->
+ val output: MutableList<CameraInfo> = ArrayList()
+
+ cameraInfos.forEach {
+ if ((it as CameraInfoInternal).cameraId.equals(id)) {
+ output.add(it)
+ return@addCameraFilter output
+ }
+ }
+
+ throw IllegalArgumentException("No camera can be find for id: " + id)
+ }
+
+ return builder.build()
+ }
+
+ private fun getSurfaceProvider(): Preview.SurfaceProvider {
+ return SurfaceTextureProvider.createSurfaceTextureProvider(object :
+ SurfaceTextureProvider.SurfaceTextureCallback {
+ override fun onSurfaceTextureReady(
+ surfaceTexture: SurfaceTexture,
+ resolution: Size
+ ) {
+ // No-op
+ }
+
+ override fun onSafeToRelease(surfaceTexture: SurfaceTexture) {
+ surfaceTexture.release()
+ }
+ })
+ }
+
+ /**
+ * Checks whether the device supports the extra (YUV, ANALYSIS) + (PRIV, PREVIEW) + (YUV,
+ * MAXIMUM) configuration.
+ */
+ fun supportExtraFullYuvPrivYuvConfiguration(cameraId: String, hardwareLevel: Int): Boolean {
+ // (YUV, ANALYSIS) + (PRIV, PREVIEW) + (YUV, MAXIMUM)
+ val surfaceCombinationYuvPrivYuv = SurfaceCombination()
+ surfaceCombinationYuvPrivYuv.addSurfaceConfig(
+ SurfaceConfig.create(
+ SurfaceConfig.ConfigType.YUV,
+ SurfaceConfig.ConfigSize.ANALYSIS
+ )
+ )
+ surfaceCombinationYuvPrivYuv.addSurfaceConfig(
+ SurfaceConfig.create(
+ SurfaceConfig.ConfigType.PRIV,
+ SurfaceConfig.ConfigSize.PREVIEW
+ )
+ )
+ surfaceCombinationYuvPrivYuv.addSurfaceConfig(
+ SurfaceConfig.create(
+ SurfaceConfig.ConfigType.YUV,
+ SurfaceConfig.ConfigSize.MAXIMUM
+ )
+ )
+
+ extraConfigurationQuirk.get(cameraId, hardwareLevel).forEach { surfaceCombination ->
+ if (surfaceCombination.isSupported(surfaceCombinationYuvPrivYuv.surfaceConfigList)) {
+ return true
+ }
+ }
+
+ return false
+ }
+
+ /**
+ * Checks whether the device supports the extra (YUV, ANALYSIS) + (YUV, PREVIEW) + (YUV,
+ * MAXIMUM) configuration.
+ */
+ fun supportExtraFullYuvYuvYuvConfiguration(cameraId: String, hardwareLevel: Int): Boolean {
+ // (YUV, ANALYSIS) + (YUV, PREVIEW) + (YUV, MAXIMUM)
+ val surfaceCombinationYuvYuvYuv = SurfaceCombination()
+ surfaceCombinationYuvYuvYuv.addSurfaceConfig(
+ SurfaceConfig.create(
+ SurfaceConfig.ConfigType.YUV,
+ SurfaceConfig.ConfigSize.ANALYSIS
+ )
+ )
+ surfaceCombinationYuvYuvYuv.addSurfaceConfig(
+ SurfaceConfig.create(
+ SurfaceConfig.ConfigType.YUV,
+ SurfaceConfig.ConfigSize.PREVIEW
+ )
+ )
+ surfaceCombinationYuvYuvYuv.addSurfaceConfig(
+ SurfaceConfig.create(
+ SurfaceConfig.ConfigType.YUV,
+ SurfaceConfig.ConfigSize.MAXIMUM
+ )
+ )
+
+ extraConfigurationQuirk.get(cameraId, hardwareLevel).forEach { surfaceCombination ->
+ if (surfaceCombination.isSupported(surfaceCombinationYuvYuvYuv.surfaceConfigList)) {
+ return true
+ }
+ }
+
+ return false
+ }
+
+ private class FakeImageCaptureCallback() : ImageCapture.OnImageCapturedCallback() {
+
+ private val latch = CountDownLatch(1)
+
+ override fun onCaptureSuccess(image: ImageProxy) {
+ image.close()
+ latch.countDown()
+ }
+
+ override fun onError(exception: ImageCaptureException) {
+ throw exception
+ }
+
+ fun awaitCapturesAndAssert(timeout: Long = CAPTURE_TIMEOUT) {
+ assertThat(latch.await(timeout, TimeUnit.MILLISECONDS)).isTrue()
+ }
+ }
+
+ private class FakePreviewCaptureProcessor() : CaptureProcessor {
+ override fun onOutputSurface(surface: Surface?, imageFormat: Int) {
+ // No-op
+ }
+
+ override fun process(bundle: ImageProxyBundle?) {
+ bundle!!.captureIds.forEach {
+ val image = bundle.getImageProxy(it).get()
+ image.close()
+ }
+ }
+
+ override fun onResolutionUpdate(size: Size?) {
+ // No-op
+ }
+ }
+}
\ No newline at end of file
diff --git a/camera/camera-camera2/src/main/java/androidx/camera/camera2/internal/SupportedSurfaceCombination.java b/camera/camera-camera2/src/main/java/androidx/camera/camera2/internal/SupportedSurfaceCombination.java
index 7d968fc..dc284e6 100644
--- a/camera/camera-camera2/src/main/java/androidx/camera/camera2/internal/SupportedSurfaceCombination.java
+++ b/camera/camera-camera2/src/main/java/androidx/camera/camera2/internal/SupportedSurfaceCombination.java
@@ -109,7 +109,7 @@
(WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
mExcludedSupportedSizesContainer = new ExcludedSupportedSizesContainer(cameraId);
mExtraSupportedSurfaceCombinationsContainer =
- new ExtraSupportedSurfaceCombinationsContainer(cameraId);
+ new ExtraSupportedSurfaceCombinationsContainer();
try {
mCharacteristics = cameraManagerCompat.getCameraCharacteristicsCompat(mCameraId);
@@ -1159,7 +1159,8 @@
mSurfaceCombinations.addAll(getLevel3SupportedCombinationList());
}
- mSurfaceCombinations.addAll(mExtraSupportedSurfaceCombinationsContainer.get());
+ mSurfaceCombinations.addAll(
+ mExtraSupportedSurfaceCombinationsContainer.get(mCameraId, mHardwareLevel));
}
private void checkCustomization() {
diff --git a/camera/camera-camera2/src/main/java/androidx/camera/camera2/internal/compat/quirk/ExtraSupportedSurfaceCombinationsQuirk.java b/camera/camera-camera2/src/main/java/androidx/camera/camera2/internal/compat/quirk/ExtraSupportedSurfaceCombinationsQuirk.java
index c7418df..66f15e9 100644
--- a/camera/camera-camera2/src/main/java/androidx/camera/camera2/internal/compat/quirk/ExtraSupportedSurfaceCombinationsQuirk.java
+++ b/camera/camera-camera2/src/main/java/androidx/camera/camera2/internal/compat/quirk/ExtraSupportedSurfaceCombinationsQuirk.java
@@ -16,30 +16,193 @@
package androidx.camera.camera2.internal.compat.quirk;
+import android.hardware.camera2.CameraCharacteristics;
import android.os.Build;
import androidx.annotation.NonNull;
-import androidx.camera.core.Logger;
import androidx.camera.core.impl.Quirk;
import androidx.camera.core.impl.SurfaceCombination;
import androidx.camera.core.impl.SurfaceConfig;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.Collections;
+import java.util.HashSet;
import java.util.List;
+import java.util.Locale;
+import java.util.Set;
/**
* Quirk required to include extra supported surface combinations which are additional to the
* guaranteed supported configurations.
*
- * <p>An example is the Samsung S7 device can support additional YUV/640x480 + PRIV/PREVIEW +
- * YUV/MAXIMUM combination.
+ * <p>An example is the Samsung S7's LIMITED-level camera device can support additional
+ * YUV/640x480 + PRIV/PREVIEW + YUV/MAXIMUM combination. Some other Samsung devices can support
+ * additional YUV/640x480 + PRIV/PREVIEW + YUV/MAXIMUM and YUV/640x480 + YUV/PREVIEW +
+ * YUV/MAXIMUM configutations (See b/194149215).
*/
public class ExtraSupportedSurfaceCombinationsQuirk implements Quirk {
private static final String TAG = "ExtraSupportedSurfaceCombinationsQuirk";
+ private static final SurfaceCombination FULL_LEVEL_YUV_PRIV_YUV_CONFIGURATION =
+ createFullYuvPrivYuvConfiguration();
+
+ private static final SurfaceCombination FULL_LEVEL_YUV_YUV_YUV_CONFIGURATION =
+ createFullYuvYuvYuvConfiguration();
+
+ private static final Set<String> SUPPORT_EXTRA_FULL_CONFIGURATIONS_SAMSUNG_MODELS =
+ new HashSet<>(Arrays.asList(
+ "SM-A515F", // Galaxy A51
+ "SM-A515U", // Galaxy A51
+ "SM-A515U1", // Galaxy A51
+ "SM-A515W", // Galaxy A51
+ "SM-S515DL", // Galaxy A51
+ "SC-54A", // Galaxy A51 5G
+ "SCG07", // Galaxy A51 5G
+ "SM-A5160", // Galaxy A51 5G
+ "SM-A516B", // Galaxy A51 5G
+ "SM-A516N", // Galaxy A51 5G
+ "SM-A516U", // Galaxy A51 5G
+ "SM-A516U1", // Galaxy A51 5G
+ "SM-A516V", // Galaxy A51 5G
+ "SM-A715F", // Galaxy A71
+ "SM-A715W", // Galaxy A71
+ "SM-A7160", // Galaxy A71 5G
+ "SM-A716B", // Galaxy A71 5G
+ "SM-A716U", // Galaxy A71 5G
+ "SM-A716U1", // Galaxy A71 5G
+ "SM-A716V", // Galaxy A71 5G
+ "SM-A8050", // Galaxy A80
+ "SM-A805F", // Galaxy A80
+ "SM-A805N", // Galaxy A80
+ "SCV44", // Galaxy Fold
+ "SM-F9000", // Galaxy Fold
+ "SM-F900F", // Galaxy Fold
+ "SM-F900U", // Galaxy Fold
+ "SM-F900U1", // Galaxy Fold
+ "SM-F900W", // Galaxy Fold
+ "SM-F907B", // Galaxy Fold 5G
+ "SM-F907N", // Galaxy Fold 5G
+ "SM-N970F", // Galaxy Note10
+ "SM-N9700", // Galaxy Note10
+ "SM-N970U", // Galaxy Note10
+ "SM-N970U1", // Galaxy Note10
+ "SM-N970W", // Galaxy Note10
+ "SM-N971N", // Galaxy Note10 5G
+ "SM-N770F", // Galaxy Note10 Lite
+ "SC-01M", // Galaxy Note10+
+ "SCV45", // Galaxy Note10+
+ "SM-N9750", // Galaxy Note10+
+ "SM-N975C", // Galaxy Note10+
+ "SM-N975U", // Galaxy Note10+
+ "SM-N975U1", // Galaxy Note10+
+ "SM-N975W", // Galaxy Note10+
+ "SM-N975F", // Galaxy Note10+
+ "SM-N976B", // Galaxy Note10+ 5G
+ "SM-N976N", // Galaxy Note10+ 5G
+ "SM-N9760", // Galaxy Note10+ 5G
+ "SM-N976Q", // Galaxy Note10+ 5G
+ "SM-N976V", // Galaxy Note10+ 5G
+ "SM-N976U", // Galaxy Note10+ 5G
+ "SM-N9810", // Galaxy Note20 5G
+ "SM-N981N", // Galaxy Note20 5G
+ "SM-N981U", // Galaxy Note20 5G
+ "SM-N981U1", // Galaxy Note20 5G
+ "SM-N981W", // Galaxy Note20 5G
+ "SM-N981B", // Galaxy Note20 5G
+ "SC-53A", // Galaxy Note20 Ultra 5G
+ "SCG06", // Galaxy Note20 Ultra 5G
+ "SM-N9860", // Galaxy Note20 Ultra 5G
+ "SM-N986N", // Galaxy Note20 Ultra 5G
+ "SM-N986U", // Galaxy Note20 Ultra 5G
+ "SM-N986U1", // Galaxy Note20 Ultra 5G
+ "SM-N986W", // Galaxy Note20 Ultra 5G
+ "SM-N986B", // Galaxy Note20 Ultra 5G
+ "SC-03L", // Galaxy S10
+ "SCV41", // Galaxy S10
+ "SM-G973F", // Galaxy S10
+ "SM-G973N", // Galaxy S10
+ "SM-G9730", // Galaxy S10
+ "SM-G9738", // Galaxy S10
+ "SM-G973C", // Galaxy S10
+ "SM-G973U", // Galaxy S10
+ "SM-G973U1", // Galaxy S10
+ "SM-G973W", // Galaxy S10
+ "SM-G977B", // Galaxy S10 5G
+ "SM-G977N", // Galaxy S10 5G
+ "SM-G977P", // Galaxy S10 5G
+ "SM-G977T", // Galaxy S10 5G
+ "SM-G977U", // Galaxy S10 5G
+ "SM-G770F", // Galaxy S10 Lite
+ "SM-G770U1", // Galaxy S10 Lite
+ "SC-04L", // Galaxy S10+
+ "SCV42", // Galaxy S10+
+ "SM-G975F", // Galaxy S10+
+ "SM-G975N", // Galaxy S10+
+ "SM-G9750", // Galaxy S10+
+ "SM-G9758", // Galaxy S10+
+ "SM-G975U", // Galaxy S10+
+ "SM-G975U1", // Galaxy S10+
+ "SM-G975W", // Galaxy S10+
+ "SC-05L", // Galaxy S10+ Olympic Games Edition
+ "SM-G970F", // Galaxy S10e
+ "SM-G970N", // Galaxy S10e
+ "SM-G9700", // Galaxy S10e
+ "SM-G9708", // Galaxy S10e
+ "SM-G970U", // Galaxy S10e
+ "SM-G970U1", // Galaxy S10e
+ "SM-G970W", // Galaxy S10e
+ "SC-51A", // Galaxy S20 5G
+ "SC51Aa", // Galaxy S20 5G
+ "SCG01", // Galaxy S20 5G
+ "SM-G9810", // Galaxy S20 5G
+ "SM-G981N", // Galaxy S20 5G
+ "SM-G981U", // Galaxy S20 5G
+ "SM-G981U1", // Galaxy S20 5G
+ "SM-G981V", // Galaxy S20 5G
+ "SM-G981W", // Galaxy S20 5G
+ "SM-G981B", // Galaxy S20 5G
+ "SCG03", // Galaxy S20 Ultra 5G
+ "SM-G9880", // Galaxy S20 Ultra 5G
+ "SM-G988N", // Galaxy S20 Ultra 5G
+ "SM-G988Q", // Galaxy S20 Ultra 5G
+ "SM-G988U", // Galaxy S20 Ultra 5G
+ "SM-G988U1", // Galaxy S20 Ultra 5G
+ "SM-G988W", // Galaxy S20 Ultra 5G
+ "SM-G988B", // Galaxy S20 Ultra 5G
+ "SC-52A", // Galaxy S20+ 5G
+ "SCG02", // Galaxy S20+ 5G
+ "SM-G9860", // Galaxy S20+ 5G
+ "SM-G986N", // Galaxy S20+ 5G
+ "SM-G986U", // Galaxy S20+ 5G
+ "SM-G986U1", // Galaxy S20+ 5G
+ "SM-G986W", // Galaxy S20+ 5G
+ "SM-G986B", // Galaxy S20+ 5G
+ "SCV47", // Galaxy Z Flip
+ "SM-F7000", // Galaxy Z Flip
+ "SM-F700F", // Galaxy Z Flip
+ "SM-F700N", // Galaxy Z Flip
+ "SM-F700U", // Galaxy Z Flip
+ "SM-F700U1", // Galaxy Z Flip
+ "SM-F700W", // Galaxy Z Flip
+ "SCG04", // Galaxy Z Flip 5G
+ "SM-F7070", // Galaxy Z Flip 5G
+ "SM-F707B", // Galaxy Z Flip 5G
+ "SM-F707N", // Galaxy Z Flip 5G
+ "SM-F707U", // Galaxy Z Flip 5G
+ "SM-F707U1", // Galaxy Z Flip 5G
+ "SM-F707W", // Galaxy Z Flip 5G
+ "SM-F9160", // Galaxy Z Fold2 5G
+ "SM-F916B", // Galaxy Z Fold2 5G
+ "SM-F916N", // Galaxy Z Fold2 5G
+ "SM-F916Q", // Galaxy Z Fold2 5G
+ "SM-F916U", // Galaxy Z Fold2 5G
+ "SM-F916U1", // Galaxy Z Fold2 5G
+ "SM-F916W"// Galaxy Z Fold2 5G
+ ));
+
static boolean load() {
- return isSamsungS7();
+ return isSamsungS7() || supportExtraFullConfigurationsSamsungDevice();
}
private static boolean isSamsungS7() {
@@ -47,17 +210,30 @@
Build.DEVICE);
}
+ private static boolean supportExtraFullConfigurationsSamsungDevice() {
+ if (!"samsung".equalsIgnoreCase(Build.BRAND)) {
+ return false;
+ }
+
+ String capitalModelName = Build.MODEL.toUpperCase(Locale.US);
+
+ return SUPPORT_EXTRA_FULL_CONFIGURATIONS_SAMSUNG_MODELS.contains(capitalModelName);
+ }
+
/**
* Returns the extra supported surface combinations for specific camera on the device.
*/
@NonNull
- public List<SurfaceCombination> getExtraSupportedSurfaceCombinations(@NonNull String cameraId) {
+ public List<SurfaceCombination> getExtraSupportedSurfaceCombinations(@NonNull String cameraId,
+ int hardwareLevel) {
if (isSamsungS7()) {
return getSamsungS7ExtraCombinations(cameraId);
}
- Logger.w(TAG,
- "Cannot retrieve list of extra supported surface combinations on this device.");
+ if (supportExtraFullConfigurationsSamsungDevice()) {
+ return getLimitedDeviceExtraSupportedFullConfigurations(hardwareLevel);
+ }
+
return Collections.emptyList();
}
@@ -67,16 +243,52 @@
if (cameraId.equals("1")) {
// (YUV, ANALYSIS) + (PRIV, PREVIEW) + (YUV, MAXIMUM)
- SurfaceCombination surfaceCombination = new SurfaceCombination();
- surfaceCombination.addSurfaceConfig(SurfaceConfig.create(SurfaceConfig.ConfigType.YUV,
- SurfaceConfig.ConfigSize.ANALYSIS));
- surfaceCombination.addSurfaceConfig(SurfaceConfig.create(SurfaceConfig.ConfigType.PRIV,
- SurfaceConfig.ConfigSize.PREVIEW));
- surfaceCombination.addSurfaceConfig(SurfaceConfig.create(SurfaceConfig.ConfigType.YUV,
- SurfaceConfig.ConfigSize.MAXIMUM));
- extraCombinations.add(surfaceCombination);
+ extraCombinations.add(FULL_LEVEL_YUV_PRIV_YUV_CONFIGURATION);
}
return extraCombinations;
}
+
+ @NonNull
+ private List<SurfaceCombination> getLimitedDeviceExtraSupportedFullConfigurations(
+ int hardwareLevel) {
+ List<SurfaceCombination> extraCombinations = new ArrayList<>();
+
+ if (hardwareLevel == CameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED) {
+ // (YUV, ANALYSIS) + (PRIV, PREVIEW) + (YUV, MAXIMUM)
+ extraCombinations.add(FULL_LEVEL_YUV_PRIV_YUV_CONFIGURATION);
+ // (YUV, ANALYSIS) + (YUV, PREVIEW) + (YUV, MAXIMUM)
+ extraCombinations.add(FULL_LEVEL_YUV_YUV_YUV_CONFIGURATION);
+ }
+
+ return extraCombinations;
+ }
+
+ @NonNull
+ private static SurfaceCombination createFullYuvPrivYuvConfiguration() {
+ // (YUV, ANALYSIS) + (PRIV, PREVIEW) + (YUV, MAXIMUM)
+ SurfaceCombination surfaceCombination = new SurfaceCombination();
+ surfaceCombination.addSurfaceConfig(SurfaceConfig.create(SurfaceConfig.ConfigType.YUV,
+ SurfaceConfig.ConfigSize.ANALYSIS));
+ surfaceCombination.addSurfaceConfig(SurfaceConfig.create(SurfaceConfig.ConfigType.PRIV,
+ SurfaceConfig.ConfigSize.PREVIEW));
+ surfaceCombination.addSurfaceConfig(SurfaceConfig.create(SurfaceConfig.ConfigType.YUV,
+ SurfaceConfig.ConfigSize.MAXIMUM));
+
+ return surfaceCombination;
+ }
+
+ @NonNull
+ private static SurfaceCombination createFullYuvYuvYuvConfiguration() {
+ // (YUV, ANALYSIS) + (YUV, PREVIEW) + (YUV, MAXIMUM)
+ SurfaceCombination surfaceCombination = new SurfaceCombination();
+ surfaceCombination.addSurfaceConfig(SurfaceConfig.create(SurfaceConfig.ConfigType.YUV,
+ SurfaceConfig.ConfigSize.ANALYSIS));
+ surfaceCombination.addSurfaceConfig(SurfaceConfig.create(SurfaceConfig.ConfigType.YUV,
+ SurfaceConfig.ConfigSize.PREVIEW));
+ surfaceCombination.addSurfaceConfig(SurfaceConfig.create(SurfaceConfig.ConfigType.YUV,
+ SurfaceConfig.ConfigSize.MAXIMUM));
+
+ return surfaceCombination;
+ }
}
diff --git a/camera/camera-camera2/src/main/java/androidx/camera/camera2/internal/compat/workaround/ExtraSupportedSurfaceCombinationsContainer.java b/camera/camera-camera2/src/main/java/androidx/camera/camera2/internal/compat/workaround/ExtraSupportedSurfaceCombinationsContainer.java
index cafe58f73..42364de 100644
--- a/camera/camera-camera2/src/main/java/androidx/camera/camera2/internal/compat/workaround/ExtraSupportedSurfaceCombinationsContainer.java
+++ b/camera/camera-camera2/src/main/java/androidx/camera/camera2/internal/compat/workaround/ExtraSupportedSurfaceCombinationsContainer.java
@@ -29,30 +29,25 @@
* configurations.
*/
public class ExtraSupportedSurfaceCombinationsContainer {
-
- @NonNull
- private final String mCameraId;
+ private final ExtraSupportedSurfaceCombinationsQuirk mQuirk;
/**
* Constructs an instance of {@link ExtraSupportedSurfaceCombinationsContainer} to provide
* the extra surface combinations.
*/
- public ExtraSupportedSurfaceCombinationsContainer(@NonNull String cameraId) {
- mCameraId = cameraId;
+ public ExtraSupportedSurfaceCombinationsContainer() {
+ mQuirk = DeviceQuirks.get(ExtraSupportedSurfaceCombinationsQuirk.class);
}
/**
* Retrieves the extra surface combinations which can be supported on the device.
*/
@NonNull
- public List<SurfaceCombination> get() {
- final ExtraSupportedSurfaceCombinationsQuirk quirk =
- DeviceQuirks.get(ExtraSupportedSurfaceCombinationsQuirk.class);
-
- if (quirk == null) {
+ public List<SurfaceCombination> get(@NonNull String cameraId, int hardwareLevel) {
+ if (mQuirk == null) {
return new ArrayList<>();
}
- return quirk.getExtraSupportedSurfaceCombinations(mCameraId);
+ return mQuirk.getExtraSupportedSurfaceCombinations(cameraId, hardwareLevel);
}
}
diff --git a/camera/camera-camera2/src/test/java/androidx/camera/camera2/internal/compat/workaround/ExtraSupportedSurfaceCombinationsContainerTest.java b/camera/camera-camera2/src/test/java/androidx/camera/camera2/internal/compat/workaround/ExtraSupportedSurfaceCombinationsContainerTest.java
index 7325925..20a0527 100644
--- a/camera/camera-camera2/src/test/java/androidx/camera/camera2/internal/compat/workaround/ExtraSupportedSurfaceCombinationsContainerTest.java
+++ b/camera/camera-camera2/src/test/java/androidx/camera/camera2/internal/compat/workaround/ExtraSupportedSurfaceCombinationsContainerTest.java
@@ -19,6 +19,7 @@
import static com.google.common.truth.Truth.assertThat;
+import android.hardware.camera2.CameraCharacteristics;
import android.os.Build;
import androidx.annotation.NonNull;
@@ -48,13 +49,28 @@
@ParameterizedRobolectricTestRunner.Parameters
public static Collection<Object[]> data() {
final List<Object[]> data = new ArrayList<>();
- data.add(new Object[]{new Config("heroqltevzw", "0")});
- data.add(new Object[]{new Config("heroqltevzw", "1",
- getExpectedSupportedCombinations())});
- data.add(new Object[]{new Config("heroqltetmo", "0")});
- data.add(new Object[]{new Config("heroqltetmo", "1",
- getExpectedSupportedCombinations())});
- data.add(new Object[]{new Config(null, "0")});
+ // Tests for Samsung S7 case
+ data.add(new Object[]{new Config(null, "heroqltevzw", null, "0",
+ CameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL_FULL)});
+ data.add(new Object[]{new Config(null, "heroqltevzw", null, "1",
+ CameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED,
+ createFullLevelYPYSupportedCombinations())});
+ data.add(new Object[]{new Config(null, "heroqltetmo", null, "0",
+ CameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL_FULL)});
+ data.add(new Object[]{new Config(null, "heroqltetmo", null, "1",
+ CameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED,
+ createFullLevelYPYSupportedCombinations())});
+
+ // Tests for Samsung limited device case
+ data.add(new Object[]{new Config("samsung", null, "sm-g9860", "0",
+ CameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL_FULL)});
+ data.add(new Object[]{new Config("samsung", null, "sm-g9860", "1",
+ CameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED,
+ createFullLevelYPYAndYYYSupportedCombinations())});
+
+ // Other cases
+ data.add(new Object[]{new Config(null, null, null, "0",
+ CameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED)});
return data;
}
@@ -68,19 +84,30 @@
@Test
public void checkExtraSupportedSurfaceCombinations() {
+ // Set up brand properties
+ if (mConfig.mBrand != null) {
+ ReflectionHelpers.setStaticField(Build.class, "BRAND", mConfig.mBrand);
+ }
+
// Set up device properties
if (mConfig.mDevice != null) {
ReflectionHelpers.setStaticField(Build.class, "DEVICE", mConfig.mDevice);
}
+ // Set up model properties
+ if (mConfig.mModel != null) {
+ ReflectionHelpers.setStaticField(Build.class, "MODEL", mConfig.mModel);
+ }
+
// Initializes ExtraSupportedSurfaceCombinationsContainer instance with camera id
final ExtraSupportedSurfaceCombinationsContainer
extraSupportedSurfaceCombinationsContainer =
- new ExtraSupportedSurfaceCombinationsContainer(mConfig.mCameraId);
+ new ExtraSupportedSurfaceCombinationsContainer();
// Gets the extra supported surface combinations on the device
List<SurfaceCombination> extraSurfaceCombinations =
- extraSupportedSurfaceCombinationsContainer.get();
+ extraSupportedSurfaceCombinationsContainer.get(mConfig.mCameraId,
+ mConfig.mHardwareLevel);
for (SurfaceCombination expectedSupportedSurfaceCombination :
mConfig.mExpectedSupportedSurfaceCombinations) {
@@ -100,7 +127,7 @@
}
}
- private static SurfaceCombination[] getExpectedSupportedCombinations() {
+ private static SurfaceCombination[] createFullLevelYPYSupportedCombinations() {
// (YUV, ANALYSIS) + (PRIV, PREVIEW) + (YUV, MAXIMUM)
SurfaceCombination surfaceCombination = new SurfaceCombination();
surfaceCombination.addSurfaceConfig(SurfaceConfig.create(SurfaceConfig.ConfigType.YUV,
@@ -112,18 +139,48 @@
return new SurfaceCombination[]{surfaceCombination};
}
+ private static SurfaceCombination[] createFullLevelYPYAndYYYSupportedCombinations() {
+ // (YUV, ANALYSIS) + (PRIV, PREVIEW) + (YUV, MAXIMUM)
+ SurfaceCombination surfaceCombination1 = new SurfaceCombination();
+ surfaceCombination1.addSurfaceConfig(SurfaceConfig.create(SurfaceConfig.ConfigType.YUV,
+ SurfaceConfig.ConfigSize.ANALYSIS));
+ surfaceCombination1.addSurfaceConfig(SurfaceConfig.create(SurfaceConfig.ConfigType.PRIV,
+ SurfaceConfig.ConfigSize.PREVIEW));
+ surfaceCombination1.addSurfaceConfig(SurfaceConfig.create(SurfaceConfig.ConfigType.YUV,
+ SurfaceConfig.ConfigSize.MAXIMUM));
+
+ // (YUV, ANALYSIS) + (YUV, PREVIEW) + (YUV, MAXIMUM)
+ SurfaceCombination surfaceCombination2 = new SurfaceCombination();
+ surfaceCombination2.addSurfaceConfig(SurfaceConfig.create(SurfaceConfig.ConfigType.YUV,
+ SurfaceConfig.ConfigSize.ANALYSIS));
+ surfaceCombination2.addSurfaceConfig(SurfaceConfig.create(SurfaceConfig.ConfigType.YUV,
+ SurfaceConfig.ConfigSize.PREVIEW));
+ surfaceCombination2.addSurfaceConfig(SurfaceConfig.create(SurfaceConfig.ConfigType.YUV,
+ SurfaceConfig.ConfigSize.MAXIMUM));
+ return new SurfaceCombination[]{surfaceCombination1, surfaceCombination2};
+ }
+
static class Config {
@Nullable
+ final String mBrand;
+ @Nullable
final String mDevice;
+ @Nullable
+ final String mModel;
@NonNull
final String mCameraId;
+ final int mHardwareLevel;
@NonNull
final SurfaceCombination[] mExpectedSupportedSurfaceCombinations;
- Config(@Nullable String device, @NonNull String cameraId,
+ Config(@Nullable String brand, @Nullable String device, @Nullable String model,
+ @NonNull String cameraId, int hardwareLevel,
@NonNull SurfaceCombination... expectedSupportedSurfaceCombinations) {
+ mBrand = brand;
mDevice = device;
+ mModel = model;
mCameraId = cameraId;
+ mHardwareLevel = hardwareLevel;
mExpectedSupportedSurfaceCombinations = expectedSupportedSurfaceCombinations;
}
}
diff --git a/camera/camera-core/src/androidTest/java/androidx/camera/core/ImageAnalysisAbstractAnalyzerTest.java b/camera/camera-core/src/androidTest/java/androidx/camera/core/ImageAnalysisAbstractAnalyzerTest.java
index de6fcfc..880191d 100644
--- a/camera/camera-core/src/androidTest/java/androidx/camera/core/ImageAnalysisAbstractAnalyzerTest.java
+++ b/camera/camera-core/src/androidTest/java/androidx/camera/core/ImageAnalysisAbstractAnalyzerTest.java
@@ -74,8 +74,13 @@
mImageProxy.setWidth(WIDTH);
mImageProxy.setHeight(HEIGHT);
mImageProxy.setFormat(YUV_420_888);
- mImageProxy.setPlanes(createYUV420ImagePlanes(WIDTH, HEIGHT, PIXEL_STRIDE_Y,
- PIXEL_STRIDE_UV, true));
+ mImageProxy.setPlanes(createYUV420ImagePlanes(
+ WIDTH,
+ HEIGHT,
+ PIXEL_STRIDE_Y,
+ PIXEL_STRIDE_UV,
+ /*flipUV=*/true,
+ /*incrementValue=*/true));
mYUVImageReaderProxy = mock(ImageReaderProxy.class);
when(mYUVImageReaderProxy.getWidth()).thenReturn(WIDTH);
@@ -140,6 +145,62 @@
assertThat(imageProxyArgumentCaptor.getValue().getPlanes().length).isEqualTo(1);
}
+ @Test
+ public void applyPixelShiftForYUVWhenOnePixelShiftEnabled() throws ExecutionException,
+ InterruptedException {
+ // Arrange.
+ mImageAnalysisAbstractAnalyzer.setOutputImageFormat(OUTPUT_IMAGE_FORMAT_YUV_420_888);
+ mImageAnalysisAbstractAnalyzer.setRGBImageReaderProxy(mRGBImageReaderProxy);
+ mImageAnalysisAbstractAnalyzer.setOnePixelShiftEnabled(true);
+
+ // Act.
+ ListenableFuture<Void> result =
+ mImageAnalysisAbstractAnalyzer.analyzeImage(mImageProxy);
+ result.get();
+
+ // Assert.
+ ArgumentCaptor<ImageProxy> imageProxyArgumentCaptor =
+ ArgumentCaptor.forClass(ImageProxy.class);
+ verify(mAnalyzer).analyze(imageProxyArgumentCaptor.capture());
+ assertThat(imageProxyArgumentCaptor.getValue().getFormat()).isEqualTo(YUV_420_888);
+ assertThat(imageProxyArgumentCaptor.getValue().getPlanes().length).isEqualTo(3);
+
+ assertThat(imageProxyArgumentCaptor.getValue().getPlanes()[0].getBuffer().get(0))
+ .isEqualTo(2);
+ assertThat(imageProxyArgumentCaptor.getValue().getPlanes()[1].getBuffer().get(0))
+ .isEqualTo(2);
+ assertThat(imageProxyArgumentCaptor.getValue().getPlanes()[2].getBuffer().get(0))
+ .isEqualTo(2);
+ }
+
+ @Test
+ public void notApplyPixelShiftForYUVWhenOnePixelShiftDisabled() throws ExecutionException,
+ InterruptedException {
+ // Arrange.
+ mImageAnalysisAbstractAnalyzer.setOutputImageFormat(OUTPUT_IMAGE_FORMAT_YUV_420_888);
+ mImageAnalysisAbstractAnalyzer.setRGBImageReaderProxy(mRGBImageReaderProxy);
+ mImageAnalysisAbstractAnalyzer.setOnePixelShiftEnabled(false);
+
+ // Act.
+ ListenableFuture<Void> result =
+ mImageAnalysisAbstractAnalyzer.analyzeImage(mImageProxy);
+ result.get();
+
+ // Assert.
+ ArgumentCaptor<ImageProxy> imageProxyArgumentCaptor =
+ ArgumentCaptor.forClass(ImageProxy.class);
+ verify(mAnalyzer).analyze(imageProxyArgumentCaptor.capture());
+ assertThat(imageProxyArgumentCaptor.getValue().getFormat()).isEqualTo(YUV_420_888);
+ assertThat(imageProxyArgumentCaptor.getValue().getPlanes().length).isEqualTo(3);
+
+ assertThat(imageProxyArgumentCaptor.getValue().getPlanes()[0].getBuffer().get(0))
+ .isEqualTo(1);
+ assertThat(imageProxyArgumentCaptor.getValue().getPlanes()[1].getBuffer().get(0))
+ .isEqualTo(1);
+ assertThat(imageProxyArgumentCaptor.getValue().getPlanes()[2].getBuffer().get(0))
+ .isEqualTo(1);
+ }
+
/**
* Faked image analysis analyzer to verify YUV to RGB convert is working as expected or not.
*
@@ -196,5 +257,10 @@
ListenableFuture<Void> analyzeImage(@NonNull ImageProxy imageProxy) {
return mImageAnalysisNonBlockingAnalyzer.analyzeImage(imageProxy);
}
+
+ @Override
+ void setOnePixelShiftEnabled(boolean onePixelShiftEnabled) {
+ mImageAnalysisNonBlockingAnalyzer.setOnePixelShiftEnabled(onePixelShiftEnabled);
+ }
}
}
diff --git a/camera/camera-core/src/androidTest/java/androidx/camera/core/ImageYuvToRgbConverterTest.java b/camera/camera-core/src/androidTest/java/androidx/camera/core/ImageYuvToRgbConverterTest.java
index 98d03e3..d3d6615 100644
--- a/camera/camera-core/src/androidTest/java/androidx/camera/core/ImageYuvToRgbConverterTest.java
+++ b/camera/camera-core/src/androidTest/java/androidx/camera/core/ImageYuvToRgbConverterTest.java
@@ -72,8 +72,13 @@
@Test
public void convertYUVToRGBWhenNotFlipUV() {
// Arrange.
- mYUVImageProxy.setPlanes(createYUV420ImagePlanes(WIDTH, HEIGHT, PIXEL_STRIDE_Y,
- PIXEL_STRIDE_UV, false));
+ mYUVImageProxy.setPlanes(createYUV420ImagePlanes(
+ WIDTH,
+ HEIGHT,
+ PIXEL_STRIDE_Y,
+ PIXEL_STRIDE_UV,
+ /*flipUV=*/false,
+ /*incrementValue=*/false));
// Act.
ImageProxy rgbImageProxy = ImageYuvToRgbConverter.convertYUVToRGB(mYUVImageProxy,
@@ -87,8 +92,13 @@
@Test
public void convertYUVToRGBWhenFlipUV() {
// Arrange.
- mYUVImageProxy.setPlanes(createYUV420ImagePlanes(WIDTH, HEIGHT, PIXEL_STRIDE_Y,
- PIXEL_STRIDE_UV, true));
+ mYUVImageProxy.setPlanes(createYUV420ImagePlanes(
+ WIDTH,
+ HEIGHT,
+ PIXEL_STRIDE_Y,
+ PIXEL_STRIDE_UV,
+ /*flipUV=*/true,
+ /*incrementValue=*/false));
// Act.
ImageProxy rgbImageProxy = ImageYuvToRgbConverter.convertYUVToRGB(mYUVImageProxy,
@@ -106,7 +116,9 @@
WIDTH,
HEIGHT,
PIXEL_STRIDE_Y_UNSUPPORTED,
- PIXEL_STRIDE_UV_UNSUPPORTED, true));
+ PIXEL_STRIDE_UV_UNSUPPORTED,
+ /*flipUV=*/true,
+ /*incrementValue=*/false));
// Act.
ImageProxy rgbImageProxy = ImageYuvToRgbConverter.convertYUVToRGB(mYUVImageProxy,
@@ -116,4 +128,55 @@
assertThat(rgbImageProxy.getFormat()).isEqualTo(PixelFormat.RGBA_8888);
assertThat(rgbImageProxy.getPlanes().length).isEqualTo(1);
}
+
+ @Test
+ public void applyPixelShiftForYUVWhenOnePixelShiftEnabled() {
+ // Arrange.
+ mYUVImageProxy.setPlanes(createYUV420ImagePlanes(
+ WIDTH,
+ HEIGHT,
+ PIXEL_STRIDE_Y,
+ PIXEL_STRIDE_UV,
+ /*flipUV=*/false,
+ /*incrementValue=*/true));
+
+ // Assert.
+ assertThat(mYUVImageProxy.getPlanes()[0].getBuffer().get(0)).isEqualTo(1);
+ assertThat(mYUVImageProxy.getPlanes()[1].getBuffer().get(0)).isEqualTo(1);
+ assertThat(mYUVImageProxy.getPlanes()[2].getBuffer().get(0)).isEqualTo(1);
+
+ // Act.
+ boolean result = ImageYuvToRgbConverter.applyPixelShiftForYUV(mYUVImageProxy);
+
+ // Assert.
+ assertThat(result).isTrue();
+ assertThat(mYUVImageProxy.getPlanes()[0].getBuffer().get(0)).isEqualTo(2);
+ assertThat(mYUVImageProxy.getPlanes()[1].getBuffer().get(0)).isEqualTo(2);
+ assertThat(mYUVImageProxy.getPlanes()[2].getBuffer().get(0)).isEqualTo(2);
+ }
+
+ @Test
+ public void closeYUVImageProxyWhenRGBImageProxyClosed() {
+ // Arrange.
+ mYUVImageProxy.setPlanes(createYUV420ImagePlanes(
+ WIDTH,
+ HEIGHT,
+ PIXEL_STRIDE_Y,
+ PIXEL_STRIDE_UV,
+ /*flipUV=*/false,
+ /*incrementValue=*/false));
+
+ // Act.
+ ImageProxy rgbImageProxy = ImageYuvToRgbConverter.convertYUVToRGB(mYUVImageProxy,
+ mRGBImageReaderProxy, /*onePixelShiftRequested=*/false);
+
+ // Assert.
+ assertThat(rgbImageProxy.getFormat()).isEqualTo(PixelFormat.RGBA_8888);
+ assertThat(rgbImageProxy.getPlanes().length).isEqualTo(1);
+ assertThat(mYUVImageProxy.isClosed()).isFalse();
+
+ rgbImageProxy.close();
+
+ assertThat(mYUVImageProxy.isClosed()).isTrue();
+ }
}
diff --git a/camera/camera-core/src/main/cpp/yuv_to_rgb_jni.cc b/camera/camera-core/src/main/cpp/yuv_to_rgb_jni.cc
index 7bb92d5..09b4799 100644
--- a/camera/camera-core/src/main/cpp/yuv_to_rgb_jni.cc
+++ b/camera/camera-core/src/main/cpp/yuv_to_rgb_jni.cc
@@ -12,6 +12,63 @@
#define LOGE(...) __android_log_print(ANDROID_LOG_ERROR, "YuvToRgbJni", __VA_ARGS__)
extern "C" {
+JNIEXPORT jint Java_androidx_camera_core_ImageYuvToRgbConverter_shiftPixel(
+ JNIEnv* env,
+ jclass,
+ jobject src_y,
+ jint src_stride_y,
+ jobject src_u,
+ jint src_stride_u,
+ jobject src_v,
+ jint src_stride_v,
+ jint src_pixel_stride_y,
+ jint src_pixel_stride_uv,
+ jint width,
+ jint height,
+ jint start_offset_y,
+ jint start_offset_u,
+ jint start_offset_v) {
+ uint8_t* src_y_ptr =
+ static_cast<uint8_t*>(env->GetDirectBufferAddress(src_y));
+ uint8_t* src_u_ptr =
+ static_cast<uint8_t*>(env->GetDirectBufferAddress(src_u));
+ uint8_t* src_v_ptr =
+ static_cast<uint8_t*>(env->GetDirectBufferAddress(src_v));
+
+ // TODO(b/195990691): extend the pixel shift to handle multiple corrupted pixels.
+ // We don't support multiple pixel shift now.
+ // Y
+ for (int i = 0; i < height; i++) {
+ memmove(&src_y_ptr[0 + i * src_stride_y],
+ &src_y_ptr[start_offset_y + i * src_stride_y],
+ width - 1);
+
+ src_y_ptr[width - start_offset_y + i * src_stride_y] =
+ src_y_ptr[src_stride_y - start_offset_y + i * src_stride_y];
+ }
+
+ // U
+ for (int i = 0; i < height / 2; i++) {
+ memmove(&src_u_ptr[0 + i * src_stride_u],
+ &src_u_ptr[start_offset_u + i * src_stride_u],
+ width / 2 - 1);
+
+ src_u_ptr[width / 2 - start_offset_u + i * src_stride_u] =
+ src_u_ptr[src_stride_u - start_offset_u + i * src_stride_u];
+ }
+
+ // V
+ for (int i = 0; i < height / 2; i++) {
+ memmove(&src_v_ptr[0 + i * src_stride_v],
+ &src_v_ptr[start_offset_v + i * src_stride_v],
+ width / 2 - 1);
+
+ src_v_ptr[width / 2 - start_offset_v + i * src_stride_v] =
+ src_v_ptr[src_stride_v - start_offset_v + i * src_stride_v];
+ }
+
+ return 0;
+}
JNIEXPORT jint Java_androidx_camera_core_ImageYuvToRgbConverter_convertAndroid420ToABGR(
JNIEnv* env,
diff --git a/camera/camera-core/src/main/java/androidx/camera/core/ImageAnalysisAbstractAnalyzer.java b/camera/camera-core/src/main/java/androidx/camera/core/ImageAnalysisAbstractAnalyzer.java
index 92d6266..80a944e 100644
--- a/camera/camera-core/src/main/java/androidx/camera/core/ImageAnalysisAbstractAnalyzer.java
+++ b/camera/camera-core/src/main/java/androidx/camera/core/ImageAnalysisAbstractAnalyzer.java
@@ -17,6 +17,7 @@
package androidx.camera.core;
import static androidx.camera.core.ImageAnalysis.OUTPUT_IMAGE_FORMAT_RGBA_8888;
+import static androidx.camera.core.ImageYuvToRgbConverter.applyPixelShiftForYUV;
import static androidx.camera.core.ImageYuvToRgbConverter.convertYUVToRGB;
import androidx.annotation.GuardedBy;
@@ -126,6 +127,10 @@
? convertYUVToRGB(
imageProxy, rgbImageReaderProxy, mOnePixelShiftEnabled)
: null;
+ if (mOutputImageFormat == ImageAnalysis.OUTPUT_IMAGE_FORMAT_YUV_420_888
+ && mOnePixelShiftEnabled) {
+ applyPixelShiftForYUV(imageProxy);
+ }
// When the analyzer exists and ImageAnalysis is active.
future = CallbackToFutureAdapter.getFuture(
diff --git a/camera/camera-core/src/main/java/androidx/camera/core/ImageYuvToRgbConverter.java b/camera/camera-core/src/main/java/androidx/camera/core/ImageYuvToRgbConverter.java
index a762f02..6c4a1d4 100644
--- a/camera/camera-core/src/main/java/androidx/camera/core/ImageYuvToRgbConverter.java
+++ b/camera/camera-core/src/main/java/androidx/camera/core/ImageYuvToRgbConverter.java
@@ -82,13 +82,46 @@
}
// Retrieve ImageProxy in RGB
- ImageProxy rgbImageProxy = rgbImageReaderProxy.acquireLatestImage();
-
- // Close YUV image proxy for the next
- if (rgbImageProxy != null) {
- imageProxy.close();
+ final ImageProxy rgbImageProxy = rgbImageReaderProxy.acquireLatestImage();
+ if (rgbImageProxy == null) {
+ return null;
}
- return rgbImageProxy;
+
+ // Close ImageProxy for the next image
+ SingleCloseImageProxy wrappedRgbImageProxy = new SingleCloseImageProxy(rgbImageProxy);
+ wrappedRgbImageProxy.addOnImageCloseListener(image -> {
+ // Close YUV image proxy when RGB image proxy is closed by app.
+ if (rgbImageProxy != null && imageProxy != null) {
+ imageProxy.close();
+ }
+ });
+ return wrappedRgbImageProxy;
+ }
+
+ /**
+ * Applies one pixel shift workaround for YUV image
+ *
+ * @param imageProxy input image proxy in YUV.
+ * @return true if one pixel shift is applied successfully, otherwise false.
+ */
+ public static boolean applyPixelShiftForYUV(@NonNull ImageProxy imageProxy) {
+ if (!ImageYuvToRgbConverter.isSupportedYUVFormat(imageProxy)) {
+ Logger.e(TAG, "Unsupported format for YUV to RGB");
+ return false;
+ }
+
+ ImageYuvToRgbConverter.Result result = applyPixelShiftInternal(imageProxy);
+
+ if (result == Result.ERROR_CONVERSION) {
+ Logger.e(TAG, "YUV to RGB conversion failure");
+ return false;
+ }
+
+ if (result == Result.ERROR_FORMAT) {
+ Logger.e(TAG, "Unsupported format for YUV to RGB");
+ return false;
+ }
+ return true;
}
/**
@@ -115,10 +148,6 @@
@NonNull ImageProxy imageProxy,
@NonNull Surface surface,
boolean onePixelShiftEnabled) {
- if (!isSupportedYUVFormat(imageProxy)) {
- return Result.ERROR_FORMAT;
- }
-
int imageWidth = imageProxy.getWidth();
int imageHeight = imageProxy.getHeight();
int srcStrideY = imageProxy.getPlanes()[0].getRowStride();
@@ -152,6 +181,40 @@
return Result.SUCCESS;
}
+ @NonNull
+ private static Result applyPixelShiftInternal(@NonNull ImageProxy imageProxy) {
+ int imageWidth = imageProxy.getWidth();
+ int imageHeight = imageProxy.getHeight();
+ int srcStrideY = imageProxy.getPlanes()[0].getRowStride();
+ int srcStrideU = imageProxy.getPlanes()[1].getRowStride();
+ int srcStrideV = imageProxy.getPlanes()[2].getRowStride();
+ int srcPixelStrideY = imageProxy.getPlanes()[0].getPixelStride();
+ int srcPixelStrideUV = imageProxy.getPlanes()[1].getPixelStride();
+
+ int startOffsetY = srcPixelStrideY;
+ int startOffsetU = srcPixelStrideUV;
+ int startOffsetV = srcPixelStrideUV;
+
+ int result = shiftPixel(
+ imageProxy.getPlanes()[0].getBuffer(),
+ srcStrideY,
+ imageProxy.getPlanes()[1].getBuffer(),
+ srcStrideU,
+ imageProxy.getPlanes()[2].getBuffer(),
+ srcStrideV,
+ srcPixelStrideY,
+ srcPixelStrideUV,
+ imageWidth,
+ imageHeight,
+ startOffsetY,
+ startOffsetU,
+ startOffsetV);
+ if (result != 0) {
+ return Result.ERROR_CONVERSION;
+ }
+ return Result.SUCCESS;
+ }
+
/**
* Converts Android YUV_420_888 to RGBA.
*
@@ -187,4 +250,19 @@
int startOffsetU,
int startOffsetV);
+ private static native int shiftPixel(
+ @NonNull ByteBuffer srcByteBufferY,
+ int srcStrideY,
+ @NonNull ByteBuffer srcByteBufferU,
+ int srcStrideU,
+ @NonNull ByteBuffer srcByteBufferV,
+ int srcStrideV,
+ int srcPixelStrideY,
+ int srcPixelStrideUV,
+ int width,
+ int height,
+ int startOffsetY,
+ int startOffsetU,
+ int startOffsetV);
+
}
diff --git a/camera/camera-extensions/lint-baseline.xml b/camera/camera-extensions/lint-baseline.xml
new file mode 100644
index 0000000..c2a1cfa
--- /dev/null
+++ b/camera/camera-extensions/lint-baseline.xml
@@ -0,0 +1,81 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<issues format="6" by="lint 7.1.0-dev" type="baseline" client="gradle" dependencies="false" name="AGP (7.1.0-dev)" variant="all" version="7.1.0-dev">
+
+ <issue
+ id="UnsafeOptInUsageError"
+ message="This declaration is opt-in and its usage should be marked with
'@androidx.camera.camera2.interop.ExperimentalCamera2Interop' or '@OptIn(markerClass = androidx.camera.camera2.interop.ExperimentalCamera2Interop.class)'"
+ errorLine1=" Camera2ImplConfig.Builder camera2ConfigurationBuilder = new Camera2ImplConfig.Builder();"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/java/androidx/camera/extensions/internal/AdaptingCaptureStage.java"
+ line="38"
+ column="65"/>
+ </issue>
+
+ <issue
+ id="UnsafeOptInUsageError"
+ message="This declaration is opt-in and its usage should be marked with
'@androidx.camera.camera2.interop.ExperimentalCamera2Interop' or '@OptIn(markerClass = androidx.camera.camera2.interop.ExperimentalCamera2Interop.class)'"
+ errorLine1=" camera2ConfigurationBuilder.setCaptureRequestOption(captureParameter.first,"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/java/androidx/camera/extensions/internal/AdaptingCaptureStage.java"
+ line="41"
+ column="41"/>
+ </issue>
+
+ <issue
+ id="UnsafeOptInUsageError"
+ message="This declaration is opt-in and its usage should be marked with
'@androidx.camera.camera2.interop.ExperimentalCamera2Interop' or '@OptIn(markerClass = androidx.camera.camera2.interop.ExperimentalCamera2Interop.class)'"
+ errorLine1=" captureConfigBuilder.addImplementationOptions(camera2ConfigurationBuilder.build());"
+ errorLine2=" ~~~~~">
+ <location
+ file="src/main/java/androidx/camera/extensions/internal/AdaptingCaptureStage.java"
+ line="46"
+ column="83"/>
+ </issue>
+
+ <issue
+ id="UnsafeOptInUsageError"
+ message="This declaration is opt-in and its usage should be marked with
'@androidx.camera.camera2.interop.ExperimentalCamera2Interop' or '@OptIn(markerClass = androidx.camera.camera2.interop.ExperimentalCamera2Interop.class)'"
+ errorLine1=" new Camera2ImplConfig.Extender<>(builder).setCameraEventCallback("
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/java/androidx/camera/extensions/internal/ImageCaptureConfigProvider.java"
+ line="110"
+ column="13"/>
+ </issue>
+
+ <issue
+ id="UnsafeOptInUsageError"
+ message="This declaration is opt-in and its usage should be marked with
'@androidx.camera.camera2.interop.ExperimentalCamera2Interop' or '@OptIn(markerClass = androidx.camera.camera2.interop.ExperimentalCamera2Interop.class)'"
+ errorLine1=" new Camera2ImplConfig.Extender<>(builder).setCameraEventCallback("
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/java/androidx/camera/extensions/internal/ImageCaptureConfigProvider.java"
+ line="110"
+ column="55"/>
+ </issue>
+
+ <issue
+ id="UnsafeOptInUsageError"
+ message="This declaration is opt-in and its usage should be marked with
'@androidx.camera.camera2.interop.ExperimentalCamera2Interop' or '@OptIn(markerClass = androidx.camera.camera2.interop.ExperimentalCamera2Interop.class)'"
+ errorLine1=" new Camera2ImplConfig.Extender<>(builder).setCameraEventCallback("
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/java/androidx/camera/extensions/internal/PreviewConfigProvider.java"
+ line="110"
+ column="13"/>
+ </issue>
+
+ <issue
+ id="UnsafeOptInUsageError"
+ message="This declaration is opt-in and its usage should be marked with
'@androidx.camera.camera2.interop.ExperimentalCamera2Interop' or '@OptIn(markerClass = androidx.camera.camera2.interop.ExperimentalCamera2Interop.class)'"
+ errorLine1=" new Camera2ImplConfig.Extender<>(builder).setCameraEventCallback("
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/java/androidx/camera/extensions/internal/PreviewConfigProvider.java"
+ line="110"
+ column="55"/>
+ </issue>
+
+</issues>
diff --git a/camera/camera-extensions/src/androidTest/java/androidx/camera/extensions/internal/ImageCaptureConfigProviderTest.kt b/camera/camera-extensions/src/androidTest/java/androidx/camera/extensions/internal/ImageCaptureConfigProviderTest.kt
index 32251f0..cef523b 100644
--- a/camera/camera-extensions/src/androidTest/java/androidx/camera/extensions/internal/ImageCaptureConfigProviderTest.kt
+++ b/camera/camera-extensions/src/androidTest/java/androidx/camera/extensions/internal/ImageCaptureConfigProviderTest.kt
@@ -89,56 +89,7 @@
@Test
@MediumTest
- fun extenderLifeCycleTest_noMoreGetCaptureStagesBeforeAndAfterInitDeInit(): Unit = runBlocking {
- val mockImageCaptureExtenderImpl = mock(ImageCaptureExtenderImpl::class.java)
- val captureStages = mutableListOf<CaptureStageImpl>()
-
- captureStages.add(FakeCaptureStage())
-
- Mockito.`when`(mockImageCaptureExtenderImpl.captureStages).thenReturn(captureStages)
- Mockito.`when`(mockImageCaptureExtenderImpl.captureProcessor).thenReturn(
- mock(CaptureProcessorImpl::class.java)
- )
-
- val mockVendorExtender = mock(BasicVendorExtender::class.java)
- Mockito.`when`(mockVendorExtender.imageCaptureExtenderImpl)
- .thenReturn(mockImageCaptureExtenderImpl)
-
- val imageCapture = createImageCaptureWithExtenderImpl(mockVendorExtender)
-
- withContext(Dispatchers.Main) {
- cameraProvider.bindToLifecycle(fakeLifecycleOwner, cameraSelector, imageCapture)
- }
-
- // To verify the event callbacks in order, and to verification of the getCaptureStages()
- // is also used to wait for the capture session created. The test for the unbind
- // would come after the capture session was created.
- verify(mockImageCaptureExtenderImpl, timeout(3000)).captureProcessor
- verify(mockImageCaptureExtenderImpl, timeout(3000)).maxCaptureStage
-
- verify(mockVendorExtender, timeout(3000)).supportedCaptureOutputResolutions
-
- val inOrder = Mockito.inOrder(mockImageCaptureExtenderImpl)
- inOrder.verify(mockImageCaptureExtenderImpl, timeout(3000)).onInit(
- any(String::class.java), any(CameraCharacteristics::class.java), any()
- )
- inOrder.verify(mockImageCaptureExtenderImpl, timeout(3000).atLeastOnce()).captureStages
-
- withContext(Dispatchers.Main) {
- // Unbind the use case to test the onDeInit.
- cameraProvider.unbind(imageCapture)
- }
-
- // To verify the deInit should been called.
- inOrder.verify(mockImageCaptureExtenderImpl, timeout(3000)).onDeInit()
-
- // To verify there is no any other calls on the mock.
- verifyNoMoreInteractions(mockImageCaptureExtenderImpl)
- }
-
- @Test
- @MediumTest
- fun extenderLifeCycleTest_noMoreCameraEventCallbacksBeforeAndAfterInitDeInit(): Unit =
+ fun extenderLifeCycleTest_noMoreInteractionsBeforeAndAfterInitDeInit(): Unit =
runBlocking {
val mockImageCaptureExtenderImpl = mock(ImageCaptureExtenderImpl::class.java)
val captureStages = mutableListOf<CaptureStageImpl>()
@@ -174,6 +125,7 @@
any(CameraCharacteristics::class.java),
any(Context::class.java)
)
+ inOrder.verify(mockImageCaptureExtenderImpl, timeout(3000).atLeastOnce()).captureStages
inOrder.verify(mockImageCaptureExtenderImpl, timeout(3000).atLeastOnce())
.onPresetSession()
inOrder.verify(mockImageCaptureExtenderImpl, timeout(3000).atLeastOnce())
@@ -189,10 +141,6 @@
.onDisableSession()
inOrder.verify(mockImageCaptureExtenderImpl, timeout(3000)).onDeInit()
- // This test item only focus on onPreset, onEnable and onDisable callback testing,
- // ignore all the getCaptureStages callbacks.
- verify(mockImageCaptureExtenderImpl, Mockito.atLeastOnce()).captureStages
-
// To verify there is no any other calls on the mock.
verifyNoMoreInteractions(mockImageCaptureExtenderImpl)
}
diff --git a/camera/camera-testing/src/main/AndroidManifest.xml b/camera/camera-testing/src/main/AndroidManifest.xml
index 6fb4156..eb27085 100644
--- a/camera/camera-testing/src/main/AndroidManifest.xml
+++ b/camera/camera-testing/src/main/AndroidManifest.xml
@@ -21,6 +21,7 @@
<activity
android:name="androidx.camera.testing.activity.ForegroundTestActivity"
android:exported="true"
+ android:configChanges="orientation|screenSize"
android:label="ForegroundTestActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
diff --git a/camera/camera-testing/src/main/java/androidx/camera/testing/ImageProxyUtil.java b/camera/camera-testing/src/main/java/androidx/camera/testing/ImageProxyUtil.java
index 39c1c70..3d82c1b 100644
--- a/camera/camera-testing/src/main/java/androidx/camera/testing/ImageProxyUtil.java
+++ b/camera/camera-testing/src/main/java/androidx/camera/testing/ImageProxyUtil.java
@@ -37,6 +37,7 @@
* @param width image width.
* @param height image height.
* @param flipUV true if v data is before u data in memory, false otherwise.
+ * @param incrementValue true if the data value will increment by position, e.g. 1, 2, 3, etc,.
* @return image planes in image proxy.
*/
@NonNull
@@ -45,26 +46,27 @@
final int height,
final int pixelStrideY,
final int pixelStrideUV,
- final boolean flipUV) {
+ final boolean flipUV,
+ final boolean incrementValue) {
ImageProxy.PlaneProxy[] planes = new ImageProxy.PlaneProxy[3];
planes[0] =
- createPlane(width, height, pixelStrideY, /*dataValue=*/ 1);
+ createPlane(width, height, pixelStrideY, /*dataValue=*/ 1, incrementValue);
if (flipUV) {
planes[2] =
createPlane(
- width / 2, height / 2, pixelStrideUV, /*dataValue=*/ 1);
+ width / 2, height / 2, pixelStrideUV, /*dataValue=*/ 1, incrementValue);
planes[1] =
createPlane(
- width / 2, height / 2, pixelStrideUV, /*dataValue=*/ 1);
+ width / 2, height / 2, pixelStrideUV, /*dataValue=*/ 1, incrementValue);
} else {
planes[1] =
createPlane(
- width / 2, height / 2, pixelStrideUV, /*dataValue=*/ 1);
+ width / 2, height / 2, pixelStrideUV, /*dataValue=*/ 1, incrementValue);
planes[2] =
createPlane(
- width / 2, height / 2, pixelStrideUV, /*dataValue=*/ 1);
+ width / 2, height / 2, pixelStrideUV, /*dataValue=*/ 1, incrementValue);
}
return planes;
}
@@ -74,11 +76,12 @@
final int width,
final int height,
final int pixelStride,
- final int dataValue) {
+ final int dataValue,
+ final boolean incrementValue) {
return new ImageProxy.PlaneProxy() {
@SuppressLint("SyntheticAccessor")
final ByteBuffer mBuffer =
- createBuffer(width, height, pixelStride, dataValue);
+ createBuffer(width, height, pixelStride, dataValue, incrementValue);
@Override
public int getRowStride() {
@@ -103,13 +106,18 @@
final int width,
final int height,
final int pixelStride,
- final int dataValue) {
+ final int dataValue,
+ final boolean incrementValue) {
int rowStride = width * pixelStride;
ByteBuffer buffer = ByteBuffer.allocateDirect(rowStride * height);
+ int value = dataValue;
for (int y = 0; y < height; ++y) {
for (int x = 0; x < width; ++x) {
buffer.position(y * rowStride + x * pixelStride);
- buffer.put((byte) (dataValue & 0xFF));
+ buffer.put((byte) (value & 0xFF));
+ if (incrementValue) {
+ value++;
+ }
}
}
return buffer;
diff --git a/camera/camera-testing/src/main/java/androidx/camera/testing/fakes/FakeImageProxy.java b/camera/camera-testing/src/main/java/androidx/camera/testing/fakes/FakeImageProxy.java
index 42bfd89..7d1a33d 100644
--- a/camera/camera-testing/src/main/java/androidx/camera/testing/fakes/FakeImageProxy.java
+++ b/camera/camera-testing/src/main/java/androidx/camera/testing/fakes/FakeImageProxy.java
@@ -138,6 +138,16 @@
return mImage;
}
+ /**
+ * Checks the image close status.
+ * @return true if image closed, false otherwise.
+ */
+ public boolean isClosed() {
+ synchronized (mReleaseLock) {
+ return mClosed;
+ }
+ }
+
public void setFormat(int format) {
mFormat = format;
}
diff --git a/camera/camera-testlib-extensions/src/main/java/androidx/camera/extensions/impl/HdrImageCaptureExtenderImpl.java b/camera/camera-testlib-extensions/src/main/java/androidx/camera/extensions/impl/HdrImageCaptureExtenderImpl.java
index d2ea323..e41ad73 100644
--- a/camera/camera-testlib-extensions/src/main/java/androidx/camera/extensions/impl/HdrImageCaptureExtenderImpl.java
+++ b/camera/camera-testlib-extensions/src/main/java/androidx/camera/extensions/impl/HdrImageCaptureExtenderImpl.java
@@ -15,6 +15,8 @@
*/
package androidx.camera.extensions.impl;
+import static android.hardware.camera2.CameraMetadata.CONTROL_AE_MODE_OFF;
+
import android.content.Context;
import android.hardware.camera2.CameraCharacteristics;
import android.hardware.camera2.CaptureRequest;
@@ -51,6 +53,9 @@
private static final int NORMAL_STAGE_ID = 1;
private static final int OVER_STAGE_ID = 2;
private static final int SESSION_STAGE_ID = 101;
+ private static final long UNDER_EXPOSURE_TIME = TimeUnit.MILLISECONDS.toNanos(8);
+ private static final long NORMAL_EXPOSURE_TIME = TimeUnit.MILLISECONDS.toNanos(16);
+ private static final long OVER_EXPOSURE_TIME = TimeUnit.MILLISECONDS.toNanos(32);
public HdrImageCaptureExtenderImpl() {
}
@@ -63,7 +68,35 @@
public boolean isExtensionAvailable(@NonNull String cameraId,
@Nullable CameraCharacteristics cameraCharacteristics) {
// Requires API 23 for ImageWriter
- return android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.M;
+ if (android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.M) {
+ return false;
+ }
+
+ if (cameraCharacteristics == null) {
+ return false;
+ }
+
+ Range<Long> exposureTimeRange =
+ cameraCharacteristics.get(CameraCharacteristics.SENSOR_INFO_EXPOSURE_TIME_RANGE);
+
+ if (exposureTimeRange == null || !exposureTimeRange.contains(
+ Range.create(UNDER_EXPOSURE_TIME, OVER_EXPOSURE_TIME))) {
+ return false;
+ }
+
+ // The device needs to support CONTROL_AE_MODE_OFF for the testing CaptureStages
+ int[] availableAeModes =
+ cameraCharacteristics.get(CameraCharacteristics.CONTROL_AE_AVAILABLE_MODES);
+
+ if (availableAeModes != null) {
+ for (int mode : availableAeModes) {
+ if (mode == CONTROL_AE_MODE_OFF) {
+ return true;
+ }
+ }
+ }
+
+ return false;
}
@Override
@@ -74,17 +107,17 @@
captureStageUnder.addCaptureRequestParameters(CaptureRequest.CONTROL_AE_MODE,
CaptureRequest.CONTROL_AE_MODE_OFF);
captureStageUnder.addCaptureRequestParameters(CaptureRequest.SENSOR_EXPOSURE_TIME,
- TimeUnit.MILLISECONDS.toNanos(8));
+ UNDER_EXPOSURE_TIME);
// Normal exposed capture stage
SettableCaptureStage captureStageNormal = new SettableCaptureStage(NORMAL_STAGE_ID);
captureStageNormal.addCaptureRequestParameters(CaptureRequest.SENSOR_EXPOSURE_TIME,
- TimeUnit.MILLISECONDS.toNanos(16));
+ NORMAL_EXPOSURE_TIME);
// Over exposed capture stage
SettableCaptureStage captureStageOver = new SettableCaptureStage(OVER_STAGE_ID);
captureStageOver.addCaptureRequestParameters(CaptureRequest.SENSOR_EXPOSURE_TIME,
- TimeUnit.MILLISECONDS.toNanos(32));
+ OVER_EXPOSURE_TIME);
List<CaptureStageImpl> captureStages = new ArrayList<>();
captureStages.add(captureStageUnder);
diff --git a/camera/camera-video/src/androidTest/java/androidx/camera/video/RecorderTest.kt b/camera/camera-video/src/androidTest/java/androidx/camera/video/RecorderTest.kt
index 8704eb4..cb6067f 100644
--- a/camera/camera-video/src/androidTest/java/androidx/camera/video/RecorderTest.kt
+++ b/camera/camera-video/src/androidTest/java/androidx/camera/video/RecorderTest.kt
@@ -42,6 +42,8 @@
import androidx.camera.testing.SurfaceTextureProvider
import androidx.camera.video.VideoRecordEvent.Finalize.ERROR_FILE_SIZE_LIMIT_REACHED
import androidx.camera.video.VideoRecordEvent.Finalize.ERROR_SOURCE_INACTIVE
+import androidx.camera.video.internal.compat.quirk.DeactivateEncoderSurfaceBeforeStopEncoderQuirk
+import androidx.camera.video.internal.compat.quirk.DeviceQuirks
import androidx.core.util.Consumer
import androidx.test.core.app.ApplicationProvider
import androidx.test.ext.junit.runners.AndroidJUnit4
@@ -190,7 +192,7 @@
inOrder.verify(videoRecordEventListener, timeout(15000L).atLeast(5))
.accept(any(VideoRecordEvent.Status::class.java))
- activeRecording.stop()
+ activeRecording.stopSafely()
inOrder.verify(videoRecordEventListener, timeout(FINALIZE_TIMEOUT))
.accept(any(VideoRecordEvent.Finalize::class.java))
@@ -235,7 +237,7 @@
assertThat(statusSemaphore.tryAcquire(5, 15000L, TimeUnit.MILLISECONDS)).isTrue()
- activeRecording.stop()
+ activeRecording.stopSafely()
// Wait for the recording to complete.
assertThat(finalizeSemaphore.tryAcquire(FINALIZE_TIMEOUT, TimeUnit.MILLISECONDS)).isTrue()
@@ -275,7 +277,7 @@
inOrder.verify(videoRecordEventListener, timeout(15000L).atLeast(5))
.accept(any(VideoRecordEvent.Status::class.java))
- activeRecording.stop()
+ activeRecording.stopSafely()
inOrder.verify(videoRecordEventListener, timeout(FINALIZE_TIMEOUT))
.accept(any(VideoRecordEvent.Finalize::class.java))
@@ -337,7 +339,7 @@
inOrder.verify(videoRecordEventListener, timeout(15000L).atLeast(5))
.accept(any(VideoRecordEvent.Status::class.java))
- activeRecording.stop()
+ activeRecording.stopSafely()
// Wait for the recording to be finalized.
inOrder.verify(videoRecordEventListener, timeout(FINALIZE_TIMEOUT))
@@ -389,7 +391,7 @@
.accept(any(VideoRecordEvent.Status::class.java))
// Stop
- activeRecording.stop()
+ activeRecording.stopSafely()
inOrder.verify(videoRecordEventListener, timeout(FINALIZE_TIMEOUT))
.accept(any(VideoRecordEvent.Finalize::class.java))
@@ -468,6 +470,7 @@
val outputOptions = FileOutputOptions.builder().setFile(file).build()
val pendingRecording = recorder.prepareRecording(outputOptions)
+ .withEventListener(CameraXExecutors.directExecutor(), videoRecordEventListener)
@Suppress("UNCHECKED_CAST")
val streamStateObserver =
@@ -475,11 +478,18 @@
recorder.streamState.addObserver(CameraXExecutors.directExecutor(), streamStateObserver)
val activeRecording = pendingRecording.start()
- verify(streamStateObserver, timeout(1000L)).onNewData(eq(VideoOutput.StreamState.ACTIVE))
- activeRecording.stop()
+ val inOrder = inOrder(streamStateObserver)
+ inOrder.verify(streamStateObserver, timeout(1000L))
+ .onNewData(eq(VideoOutput.StreamState.ACTIVE))
- verify(streamStateObserver, timeout(1000L)).onNewData(eq(VideoOutput.StreamState.INACTIVE))
+ verify(videoRecordEventListener, timeout(15000L).atLeast(5))
+ .accept(any(VideoRecordEvent.Status::class.java))
+
+ activeRecording.stopSafely()
+
+ inOrder.verify(streamStateObserver, timeout(FINALIZE_TIMEOUT))
+ .onNewData(eq(VideoOutput.StreamState.INACTIVE))
file.delete()
}
@@ -523,7 +533,7 @@
inOrder.verify(videoRecordEventListener, timeout(15000L).atLeast(5))
.accept(any(VideoRecordEvent.Status::class.java))
- activeRecording.stop()
+ activeRecording.stopSafely()
// Wait for the recording to be finalized.
inOrder.verify(videoRecordEventListener, timeout(FINALIZE_TIMEOUT))
.accept(any(VideoRecordEvent.Finalize::class.java))
@@ -586,7 +596,7 @@
inOrder.verify(videoRecordEventListener, timeout(1000L))
.accept(any(VideoRecordEvent.Pause::class.java))
- activeRecording.stop()
+ activeRecording.stopSafely()
// Wait for the recording to be finalized.
inOrder.verify(videoRecordEventListener, timeout(FINALIZE_TIMEOUT))
.accept(any(VideoRecordEvent.Finalize::class.java))
@@ -594,6 +604,136 @@
}
@Test
+ fun pause_noOpWhenAlreadyPaused() {
+ clearInvocations(videoRecordEventListener)
+ invokeSurfaceRequest()
+ val file = File.createTempFile("CameraX", ".tmp").apply { deleteOnExit() }
+ val outputOptions = FileOutputOptions.builder().setFile(file).build()
+
+ val pendingRecording = recorder.prepareRecording(outputOptions)
+ pendingRecording.withEventListener(
+ CameraXExecutors.directExecutor(),
+ videoRecordEventListener
+ ).withAudioEnabled()
+
+ val activeRecording = pendingRecording.start()
+
+ val inOrder = inOrder(videoRecordEventListener)
+ inOrder.verify(videoRecordEventListener, timeout(1000L))
+ .accept(any(VideoRecordEvent.Start::class.java))
+ inOrder.verify(videoRecordEventListener, timeout(15000L).atLeast(5))
+ .accept(any(VideoRecordEvent.Status::class.java))
+
+ activeRecording.pause()
+ inOrder.verify(videoRecordEventListener, timeout(1000L))
+ .accept(any(VideoRecordEvent.Pause::class.java))
+
+ activeRecording.pause()
+
+ // Shouldn't receive an additional Pause event.
+ inOrder.verifyNoMoreInteractions()
+
+ activeRecording.stopSafely()
+
+ inOrder.verify(videoRecordEventListener, timeout(FINALIZE_TIMEOUT))
+ .accept(any(VideoRecordEvent.Finalize::class.java))
+
+ file.delete()
+ }
+
+ @Test
+ fun pause_throwsExceptionWhenStopping() {
+ clearInvocations(videoRecordEventListener)
+ invokeSurfaceRequest()
+ val file = File.createTempFile("CameraX", ".tmp").apply { deleteOnExit() }
+ val outputOptions = FileOutputOptions.builder().setFile(file).build()
+
+ val pendingRecording = recorder.prepareRecording(outputOptions)
+ pendingRecording.withEventListener(
+ CameraXExecutors.directExecutor(),
+ videoRecordEventListener
+ ).withAudioEnabled()
+
+ val activeRecording = pendingRecording.start()
+
+ val inOrder = inOrder(videoRecordEventListener)
+ inOrder.verify(videoRecordEventListener, timeout(1000L))
+ .accept(any(VideoRecordEvent.Start::class.java))
+ inOrder.verify(videoRecordEventListener, timeout(15000L).atLeast(5))
+ .accept(any(VideoRecordEvent.Status::class.java))
+
+ activeRecording.stopSafely()
+ assertThrows(IllegalStateException::class.java) {
+ activeRecording.pause()
+ }
+
+ file.delete()
+ }
+
+ @Test
+ fun resume_noOpWhenNotPaused() {
+ clearInvocations(videoRecordEventListener)
+ invokeSurfaceRequest()
+ val file = File.createTempFile("CameraX", ".tmp").apply { deleteOnExit() }
+ val outputOptions = FileOutputOptions.builder().setFile(file).build()
+
+ val pendingRecording = recorder.prepareRecording(outputOptions)
+ pendingRecording.withEventListener(
+ CameraXExecutors.directExecutor(),
+ videoRecordEventListener
+ ).withAudioEnabled()
+
+ val activeRecording = pendingRecording.start()
+
+ val inOrder = inOrder(videoRecordEventListener)
+ inOrder.verify(videoRecordEventListener, timeout(1000L))
+ .accept(any(VideoRecordEvent.Start::class.java))
+ inOrder.verify(videoRecordEventListener, timeout(15000L).atLeast(5))
+ .accept(any(VideoRecordEvent.Status::class.java))
+
+ activeRecording.resume()
+
+ // Shouldn't receive an Resume event.
+ inOrder.verifyNoMoreInteractions()
+
+ activeRecording.stopSafely()
+
+ inOrder.verify(videoRecordEventListener, timeout(FINALIZE_TIMEOUT))
+ .accept(any(VideoRecordEvent.Finalize::class.java))
+
+ file.delete()
+ }
+
+ @Test
+ fun resume_throwsExceptionWhenStopping() {
+ clearInvocations(videoRecordEventListener)
+ invokeSurfaceRequest()
+ val file = File.createTempFile("CameraX", ".tmp").apply { deleteOnExit() }
+ val outputOptions = FileOutputOptions.builder().setFile(file).build()
+
+ val pendingRecording = recorder.prepareRecording(outputOptions)
+ pendingRecording.withEventListener(
+ CameraXExecutors.directExecutor(),
+ videoRecordEventListener
+ ).withAudioEnabled()
+
+ val activeRecording = pendingRecording.start()
+
+ val inOrder = inOrder(videoRecordEventListener)
+ inOrder.verify(videoRecordEventListener, timeout(1000L))
+ .accept(any(VideoRecordEvent.Start::class.java))
+ inOrder.verify(videoRecordEventListener, timeout(15000L).atLeast(5))
+ .accept(any(VideoRecordEvent.Status::class.java))
+
+ activeRecording.stopSafely()
+ assertThrows(IllegalStateException::class.java) {
+ activeRecording.resume()
+ }
+
+ file.delete()
+ }
+
+ @Test
fun stop_beforeSurfaceRequested() {
clearInvocations(videoRecordEventListener)
val file = File.createTempFile("CameraX", ".tmp").apply { deleteOnExit() }
@@ -607,7 +747,7 @@
val activeRecording = pendingRecording.start()
activeRecording.pause()
- activeRecording.stop()
+ activeRecording.stopSafely()
invokeSurfaceRequest()
@@ -677,6 +817,37 @@
}
@Test
+ fun stop_noOpWhenStopping() {
+ clearInvocations(videoRecordEventListener)
+ invokeSurfaceRequest()
+ val file = File.createTempFile("CameraX", ".tmp").apply { deleteOnExit() }
+ val outputOptions = FileOutputOptions.builder().setFile(file).build()
+
+ val pendingRecording = recorder.prepareRecording(outputOptions)
+ pendingRecording.withEventListener(
+ CameraXExecutors.directExecutor(),
+ videoRecordEventListener
+ ).withAudioEnabled()
+
+ val activeRecording = pendingRecording.start()
+
+ val inOrder = inOrder(videoRecordEventListener)
+ inOrder.verify(videoRecordEventListener, timeout(1000L))
+ .accept(any(VideoRecordEvent.Start::class.java))
+ inOrder.verify(videoRecordEventListener, timeout(15000L).atLeast(5))
+ .accept(any(VideoRecordEvent.Status::class.java))
+
+ activeRecording.stopSafely()
+ activeRecording.stopSafely()
+
+ inOrder.verify(videoRecordEventListener, timeout(FINALIZE_TIMEOUT))
+ .accept(any(VideoRecordEvent.Finalize::class.java))
+ inOrder.verifyNoMoreInteractions()
+
+ file.delete()
+ }
+
+ @Test
fun optionsOverridesDefaults() {
val qualitySelector = QualitySelector.of(QualitySelector.QUALITY_HIGHEST)
val recorder = Recorder.Builder()
@@ -724,7 +895,7 @@
inOrder.verify(videoRecordEventListener, timeout(15000L).atLeast(5))
.accept(any(VideoRecordEvent.Status::class.java))
- activeRecording.stop()
+ activeRecording.stopSafely()
verify(videoRecordEventListener, timeout(FINALIZE_TIMEOUT))
.accept(any(VideoRecordEvent.Finalize::class.java))
@@ -779,4 +950,21 @@
)
}
}
+
+ // It fails on devices with certain chipset if the codec is stopped when the camera is still
+ // producing frames to the provided surface. This method first stop the camera from
+ // producing frames then stops the recording safely on the problematic devices.
+ private fun ActiveRecording.stopSafely() {
+ val deactivateSurfaceBeforeStop =
+ DeviceQuirks.get(DeactivateEncoderSurfaceBeforeStopEncoderQuirk::class.java) != null
+ if (deactivateSurfaceBeforeStop) {
+ instrumentation.runOnMainSync {
+ preview.setSurfaceProvider(null)
+ }
+ }
+ stop()
+ if (deactivateSurfaceBeforeStop && Build.VERSION.SDK_INT >= 23) {
+ invokeSurfaceRequest()
+ }
+ }
}
\ No newline at end of file
diff --git a/camera/camera-video/src/androidTest/java/androidx/camera/video/VideoRecordingTest.kt b/camera/camera-video/src/androidTest/java/androidx/camera/video/VideoRecordingTest.kt
index e0d6e1a..21df9ba 100644
--- a/camera/camera-video/src/androidTest/java/androidx/camera/video/VideoRecordingTest.kt
+++ b/camera/camera-video/src/androidTest/java/androidx/camera/video/VideoRecordingTest.kt
@@ -62,7 +62,6 @@
import org.mockito.Mockito.verify
import org.mockito.Mockito.verifyNoMoreInteractions
import java.io.File
-import java.util.ArrayList
import java.util.concurrent.CountDownLatch
import java.util.concurrent.TimeUnit
@@ -396,58 +395,6 @@
imageFile.delete()
}
- @Test
- fun recordingWithImageAnalysisAndImageCapture() {
- // TODO(b/168187087): Video: Unable to record Video on Pixel 1 API 26,27 without Preview
- Assume.assumeFalse(
- "Pixel running API 26,27 has CameraDevice.onError when set repeating request",
- Build.DEVICE.equals("sailfish", true) &&
- (Build.VERSION.SDK_INT == 26 || Build.VERSION.SDK_INT == 27)
- )
-
- // Pre-check and arrange
- val videoCapture = VideoCapture.withOutput(Recorder.Builder().build())
- val imageCapture = ImageCapture.Builder().build()
- val analysis = ImageAnalysis.Builder().build()
- Assume.assumeTrue(checkUseCasesCombinationSupported(analysis, videoCapture, imageCapture))
-
- val videoFile = File.createTempFile("camerax-video", ".tmp").apply {
- deleteOnExit()
- }
- val imageFile = File.createTempFile("camerax-image-capture", ".tmp").apply {
- deleteOnExit()
- }
- latchForVideoSaved = CountDownLatch(1)
- latchForVideoRecording = CountDownLatch(5)
- val latchForImageAnalysis = CountDownLatch(5)
- analysis.setAnalyzer(CameraXExecutors.directExecutor()) { it: ImageProxy ->
- latchForImageAnalysis.countDown()
- it.close()
- }
-
- instrumentation.runOnMainSync {
- cameraProvider.bindToLifecycle(
- lifecycleOwner,
- cameraSelector,
- analysis,
- imageCapture,
- videoCapture
- )
- }
-
- // Act.
- completeVideoRecording(videoCapture, videoFile)
- completeImageCapture(imageCapture, imageFile)
-
- // Verify.
- verifyRecordingResult(videoFile)
- assertThat(latchForImageAnalysis.await(10, TimeUnit.SECONDS)).isTrue()
-
- // Cleanup.
- videoFile.delete()
- imageFile.delete()
- }
-
private fun startVideoRecording(videoCapture: VideoCapture<Recorder>, file: File):
ActiveRecording {
val outputOptions = FileOutputOptions.builder().setFile(file).build()
diff --git a/camera/camera-video/src/androidTest/java/androidx/camera/video/internal/encoder/VideoEncoderTest.kt b/camera/camera-video/src/androidTest/java/androidx/camera/video/internal/encoder/VideoEncoderTest.kt
index e06a490..2fd9789 100644
--- a/camera/camera-video/src/androidTest/java/androidx/camera/video/internal/encoder/VideoEncoderTest.kt
+++ b/camera/camera-video/src/androidTest/java/androidx/camera/video/internal/encoder/VideoEncoderTest.kt
@@ -41,6 +41,8 @@
import androidx.camera.testing.CameraUtil
import androidx.camera.testing.SurfaceTextureProvider
import androidx.camera.testing.SurfaceTextureProvider.SurfaceTextureCallback
+import androidx.camera.video.internal.compat.quirk.DeviceQuirks
+import androidx.camera.video.internal.compat.quirk.DeactivateEncoderSurfaceBeforeStopEncoderQuirk
import androidx.concurrent.futures.ResolvableFuture
import androidx.core.content.ContextCompat
import androidx.test.core.app.ApplicationProvider
@@ -390,24 +392,26 @@
/**
* Stops safely by first removing the Encoder surface from camera repeating request.
*
- * <p>When encoder is started and repeating request is running, stop the encoder will get EGL
- * error on some devices such as Samsung J2, J3 and J7 (Exynos chipset). The encoder surface
- * needs to be removed from repeating request before stop the encoder to avoid this failure.
- *
- * See b/196039619.
+ * <p>As described in b/196039619, when encoder is started and repeating request is running,
+ * stop the encoder will get EGL error on some Samsung devices. The encoder surface needs to
+ * be removed from repeating request before stop the encoder to avoid this failure.
*/
private fun EncoderImpl.stopSafely() {
- instrumentation.runOnMainSync { previewForVideoEncoder.setSurfaceProvider(null) }
- verify(videoEncoderCallback, noInvocation(2000L, 6000L)).onEncodedData(any())
+ val deactivateSurfaceBeforeStop =
+ DeviceQuirks.get(DeactivateEncoderSurfaceBeforeStopEncoderQuirk::class.java) != null
+
+ if (deactivateSurfaceBeforeStop) {
+ instrumentation.runOnMainSync { previewForVideoEncoder.setSurfaceProvider(null) }
+ verify(videoEncoderCallback, noInvocation(2000L, 6000L)).onEncodedData(any())
+ }
stop()
- verify(videoEncoderCallback, timeout(5000L)).onEncodeStop()
- // The SurfaceProvider needs to be added back to recover repeating. However, for API < 23,
- // EncoderImpl will trigger a surface update event to OnSurfaceUpdateListener and this will
- // be handled by initVideoEncoder() to set the SurfaceProvider with new surface. So no
- // need to add the SurfaceProvider back here.
- if (Build.VERSION.SDK_INT >= 23) {
+ if (deactivateSurfaceBeforeStop && Build.VERSION.SDK_INT >= 23) {
+ // The SurfaceProvider needs to be added back to recover repeating. However, for
+ // API < 23, EncoderImpl will trigger a surface update event to OnSurfaceUpdateListener
+ // and this will be handled by initVideoEncoder() to set the SurfaceProvider with new
+ // surface. So no need to add the SurfaceProvider back here.
instrumentation.runOnMainSync { setVideoPreviewSurfaceProvider(currentSurface!!) }
}
}
diff --git a/camera/camera-video/src/main/java/androidx/camera/video/Recorder.java b/camera/camera-video/src/main/java/androidx/camera/video/Recorder.java
index c43e36c..6bcb207 100644
--- a/camera/camera-video/src/main/java/androidx/camera/video/Recorder.java
+++ b/camera/camera-video/src/main/java/androidx/camera/video/Recorder.java
@@ -63,6 +63,8 @@
import androidx.camera.video.internal.AudioSourceAccessException;
import androidx.camera.video.internal.BufferProvider;
import androidx.camera.video.internal.compat.Api26Impl;
+import androidx.camera.video.internal.compat.quirk.DeactivateEncoderSurfaceBeforeStopEncoderQuirk;
+import androidx.camera.video.internal.compat.quirk.DeviceQuirks;
import androidx.camera.video.internal.encoder.AudioEncoderConfig;
import androidx.camera.video.internal.encoder.EncodeException;
import androidx.camera.video.internal.encoder.EncodedData;
@@ -155,6 +157,10 @@
*/
PAUSED,
/**
+ * There's a recording being stopped.
+ */
+ STOPPING,
+ /**
* There's a running recording and the Recorder is being reset.
*/
RESETTING,
@@ -238,8 +244,7 @@
private final Object mLock = new Object();
@GuardedBy("mLock")
- private final MutableStateObservable<State> mState =
- MutableStateObservable.withInitialState(State.INITIALIZING);
+ private State mState = State.INITIALIZING;
private final MutableStateObservable<StreamState> mStreamState =
MutableStateObservable.withInitialState(StreamState.INACTIVE);
// Used only by getExecutor()
@@ -308,8 +313,7 @@
@Override
public void onSurfaceRequested(@NonNull SurfaceRequest request) {
synchronized (mLock) {
- State state = getObservableData(mState);
- switch (state) {
+ switch (mState) {
case RESETTING:
// Fall-through
case PENDING_RECORDING:
@@ -326,9 +330,11 @@
// Fall-through
case RECORDING:
// Fall-through
+ case STOPPING:
+ // Fall-through
case PAUSED:
throw new IllegalStateException("Surface was requested when the Recorder had "
- + "been initialized with state " + state);
+ + "been initialized with state " + mState);
case ERROR:
throw new IllegalStateException("Surface was requested when the Recorder had "
+ "encountered error " + mErrorCause);
@@ -359,7 +365,7 @@
mSourceState.set(sourceState);
if (sourceState == SourceState.INACTIVE) {
synchronized (mLock) {
- switch (getObservableData(mState)) {
+ switch (mState) {
case PENDING_RECORDING:
// Fall-through
case PENDING_PAUSED:
@@ -379,6 +385,8 @@
// Fall-through
case RESETTING:
// Fall-through
+ case STOPPING:
+ // Fall-through
case ERROR:
// No-op
break;
@@ -540,8 +548,9 @@
new IllegalStateException("The video frame producer is inactive.")));
} else {
synchronized (mLock) {
- State state = getObservableData(mState);
- switch (state) {
+ switch (mState) {
+ case STOPPING:
+ // Fall-through
case PENDING_PAUSED:
// Fall-through
case PAUSED:
@@ -584,7 +593,7 @@
void pause() {
synchronized (mLock) {
- switch (getObservableData(mState)) {
+ switch (mState) {
case PENDING_RECORDING:
// Fall-through
case RESETTING:
@@ -593,8 +602,11 @@
// The recording will automatically pause once the initialization completes.
setState(State.PENDING_PAUSED);
break;
+ case STOPPING:
+ // Fall-through
case IDLING:
- throw new IllegalStateException("Calling pause() while idling is invalid.");
+ throw new IllegalStateException(
+ "Incorrectly invoke pause() in state " + mState);
case RECORDING:
mSequentialExecutor.execute(this::pauseInternal);
setState(State.PAUSED);
@@ -616,7 +628,7 @@
void resume() {
synchronized (mLock) {
- switch (getObservableData(mState)) {
+ switch (mState) {
case PENDING_PAUSED:
// Fall-through
case RESETTING:
@@ -625,8 +637,11 @@
// The recording will automatically start once the initialization completes.
setState(State.PENDING_RECORDING);
break;
+ case STOPPING:
+ // Fall-through
case IDLING:
- throw new IllegalStateException("Calling resume() while idling is invalid.");
+ throw new IllegalStateException(
+ "Incorrectly invoke resume() in state " + mState);
case PENDING_RECORDING:
// Fall-through
case RECORDING:
@@ -648,7 +663,7 @@
void stop() {
synchronized (mLock) {
- switch (getObservableData(mState)) {
+ switch (mState) {
case PENDING_RECORDING:
// Fall-through
case PENDING_PAUSED:
@@ -663,6 +678,7 @@
case PAUSED:
// Fall-through
case RECORDING:
+ setState(State.STOPPING);
mSequentialExecutor.execute(() -> stopInternal(ERROR_NONE));
break;
case ERROR:
@@ -671,8 +687,10 @@
mSequentialExecutor.execute(
() -> finalizeRecording(ERROR_RECORDER_ERROR, mErrorCause));
break;
+ case STOPPING:
+ // Fall-through
case RESETTING:
- // No-Op, the Recorder is being resetting.
+ // No-Op
break;
}
}
@@ -688,7 +706,7 @@
@ExecutedBy("mSequentialExecutor")
void reset() {
synchronized (mLock) {
- switch (getObservableData(mState)) {
+ switch (mState) {
case PENDING_RECORDING:
// Fall-through
case PENDING_PAUSED:
@@ -708,6 +726,9 @@
// at finalizeRecording().
mSequentialExecutor.execute(() -> stopInternal(ERROR_NONE));
break;
+ case STOPPING:
+ setState(State.RESETTING);
+ break;
case RESETTING:
// No-Op, the Recorder is being reset.
break;
@@ -740,30 +761,34 @@
@ExecutedBy("mSequentialExecutor")
private void onInitialized() {
synchronized (mLock) {
- State state = getObservableData(mState);
- switch (state) {
+ switch (mState) {
case IDLING:
// Fall-through
case RECORDING:
// Fall-through
case PAUSED:
// Fall-through
+ case STOPPING:
+ // Fall-through
case RESETTING:
throw new IllegalStateException(
- "Incorrectly invoke onInitialized() in state " + state);
+ "Incorrectly invoke onInitialized() in state " + mState);
case INITIALIZING:
setState(State.IDLING);
break;
case PENDING_PAUSED:
- // Fall-through
+ // Start and pause recording if start() has been called before video encoder is
+ // setup.
+ mSequentialExecutor.execute(() -> {
+ startInternal();
+ pauseInternal();
+ });
+ setState(State.PAUSED);
+ break;
case PENDING_RECORDING:
// Start recording if start() has been called before video encoder is setup.
mSequentialExecutor.execute(this::startInternal);
setState(State.RECORDING);
- if (state == State.PENDING_PAUSED) {
- mSequentialExecutor.execute(this::pauseInternal);
- setState(State.PAUSED);
- }
break;
case ERROR:
Logger.e(TAG,
@@ -1318,7 +1343,7 @@
setState(State.INITIALIZING);
}
- private int internalAudioStateToEventAudioState(AudioState audioState) {
+ private int internalAudioStateToEventAudioState(@NonNull AudioState audioState) {
switch (audioState) {
case DISABLED:
return RecordingStats.AUDIO_DISABLED;
@@ -1335,6 +1360,15 @@
throw new IllegalStateException("Invalid internal audio state: " + audioState);
}
+ @NonNull
+ private StreamState internalStateToStreamState(@NonNull State state) {
+ // Stopping state should be treated as inactive on certain chipsets. See b/196039619.
+ DeactivateEncoderSurfaceBeforeStopEncoderQuirk quirk =
+ DeviceQuirks.get(DeactivateEncoderSurfaceBeforeStopEncoderQuirk.class);
+ return state == State.RECORDING || (state == State.STOPPING && quirk == null)
+ ? StreamState.ACTIVE : StreamState.INACTIVE;
+ }
+
@SuppressWarnings("WeakerAccess") /* synthetic accessor */
boolean isAudioEnabled() {
return mAudioState != AudioState.DISABLED && mAudioState != AudioState.ENCODER_ERROR;
@@ -1386,20 +1420,22 @@
mFileSizeLimitInBytes = OutputOptions.FILE_SIZE_UNLIMITED;
synchronized (mLock) {
- switch (getObservableData(mState)) {
+ switch (mState) {
case INITIALIZING:
// Fall-through
case IDLING:
- // No-op
- break;
+ // Fall-through
+ case RECORDING:
+ // Fall-through
+ case PAUSED:
+ throw new IllegalStateException(
+ "Incorrectly invoke finalizeRecording in state " + mState);
case PENDING_RECORDING:
// Fall-through
case PENDING_PAUSED:
setState(State.INITIALIZING);
break;
- case RECORDING:
- // Fall-through
- case PAUSED:
+ case STOPPING:
// Fall-through
case ERROR:
// Reset the internal state, except when the error is an recorder error,
@@ -1462,14 +1498,12 @@
@SuppressWarnings("WeakerAccess") /* synthetic accessor */
void setState(@NonNull State state) {
synchronized (mLock) {
- Logger.d(TAG,
- "Transitioning Recorder internal state: " + getObservableData(mState) + " -->"
- + " " + state);
- mState.setState(state);
- if (state == State.RECORDING) {
- mStreamState.setState(StreamState.ACTIVE);
+ if (mState != state) {
+ Logger.d(TAG, "Transitioning Recorder internal state: " + mState + " --> " + state);
+ mState = state;
+ mStreamState.setState(internalStateToStreamState(state));
} else {
- mStreamState.setState(StreamState.INACTIVE);
+ Logger.w(TAG, "Attempting to transition to the same state " + mState);
}
}
}
diff --git a/camera/camera-video/src/main/java/androidx/camera/video/internal/compat/quirk/DeactivateEncoderSurfaceBeforeStopEncoderQuirk.java b/camera/camera-video/src/main/java/androidx/camera/video/internal/compat/quirk/DeactivateEncoderSurfaceBeforeStopEncoderQuirk.java
new file mode 100644
index 0000000..b2350d8
--- /dev/null
+++ b/camera/camera-video/src/main/java/androidx/camera/video/internal/compat/quirk/DeactivateEncoderSurfaceBeforeStopEncoderQuirk.java
@@ -0,0 +1,46 @@
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * 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.
+ */
+
+package androidx.camera.video.internal.compat.quirk;
+
+import android.media.MediaCodec;
+import android.os.Build;
+
+import androidx.camera.core.impl.Quirk;
+import androidx.camera.video.Recorder;
+import androidx.camera.video.VideoCapture;
+import androidx.camera.video.VideoOutput;
+
+/**
+ * Quirk denotes that the encoder surface needs to be removed from repeating request before stop
+ * the encoder.
+ *
+ * <p>As described in b/196039619, the camera fails if {@link MediaCodec} is stopped while frames
+ * are still being provided.
+ *
+ * <p>In {@link Recorder}, {@link Recorder#getStreamState()} has to returns
+ * {@link VideoOutput.StreamState#INACTIVE} when the active recording is being stopped.
+ * {@link VideoCapture} monitors {@link VideoOutput#getStreamState()} and
+ * detach the surface from camera if it becomes {@link VideoOutput.StreamState#INACTIVE inactive}.
+ * So making the {@link Recorder} inactive in stopping state will stop the camera from producing
+ * frames to the {@link MediaCodec} before actually stopping it.
+ */
+public class DeactivateEncoderSurfaceBeforeStopEncoderQuirk implements Quirk {
+
+ static boolean load() {
+ return Build.VERSION.SDK_INT <= 22;
+ }
+}
diff --git a/camera/camera-video/src/main/java/androidx/camera/video/internal/compat/quirk/DeviceQuirksLoader.java b/camera/camera-video/src/main/java/androidx/camera/video/internal/compat/quirk/DeviceQuirksLoader.java
index d28f26c..d3e1864 100644
--- a/camera/camera-video/src/main/java/androidx/camera/video/internal/compat/quirk/DeviceQuirksLoader.java
+++ b/camera/camera-video/src/main/java/androidx/camera/video/internal/compat/quirk/DeviceQuirksLoader.java
@@ -45,6 +45,9 @@
if (MediaCodecInfoReportIncorrectInfoQuirk.load()) {
quirks.add(new MediaCodecInfoReportIncorrectInfoQuirk());
}
+ if (DeactivateEncoderSurfaceBeforeStopEncoderQuirk.load()) {
+ quirks.add(new DeactivateEncoderSurfaceBeforeStopEncoderQuirk());
+ }
return quirks;
}
diff --git a/camera/camera-view/lint-baseline.xml b/camera/camera-view/lint-baseline.xml
index 327075e..90df4da 100644
--- a/camera/camera-view/lint-baseline.xml
+++ b/camera/camera-view/lint-baseline.xml
@@ -1,15 +1,48 @@
<?xml version="1.0" encoding="UTF-8"?>
-<issues format="6" by="lint 7.1.0-dev" type="baseline" client="gradle" name="AGP (7.1.0-dev)" variant="all" version="7.1.0-dev">
+<issues format="6" by="lint 7.1.0-dev" type="baseline" client="gradle" dependencies="false" name="AGP (7.1.0-dev)" variant="all" version="7.1.0-dev">
<issue
- id="WrongConstant"
- message="Must be one of: AspectRatio.RATIO_4_3, AspectRatio.RATIO_16_9"
- errorLine1=" builder.setTargetAspectRatio(outputSize.getAspectRatio());"
- errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ id="UnsafeOptInUsageError"
+ message="This declaration is opt-in and its usage should be marked with
'@androidx.camera.core.ExperimentalUseCaseGroup' or '@OptIn(markerClass = androidx.camera.core.ExperimentalUseCaseGroup.class)'"
+ errorLine1=" return ViewPort.FILL_END;"
+ errorLine2=" ~~~~~~~~">
<location
- file="src/main/java/androidx/camera/view/CameraController.java"
- line="465"
- column="42"/>
+ file="src/main/java/androidx/camera/view/PreviewView.java"
+ line="566"
+ column="33"/>
+ </issue>
+
+ <issue
+ id="UnsafeOptInUsageError"
+ message="This declaration is opt-in and its usage should be marked with
'@androidx.camera.core.ExperimentalUseCaseGroup' or '@OptIn(markerClass = androidx.camera.core.ExperimentalUseCaseGroup.class)'"
+ errorLine1=" return ViewPort.FILL_CENTER;"
+ errorLine2=" ~~~~~~~~~~~">
+ <location
+ file="src/main/java/androidx/camera/view/PreviewView.java"
+ line="568"
+ column="33"/>
+ </issue>
+
+ <issue
+ id="UnsafeOptInUsageError"
+ message="This declaration is opt-in and its usage should be marked with
'@androidx.camera.core.ExperimentalUseCaseGroup' or '@OptIn(markerClass = androidx.camera.core.ExperimentalUseCaseGroup.class)'"
+ errorLine1=" return ViewPort.FILL_START;"
+ errorLine2=" ~~~~~~~~~~">
+ <location
+ file="src/main/java/androidx/camera/view/PreviewView.java"
+ line="570"
+ column="33"/>
+ </issue>
+
+ <issue
+ id="UnsafeOptInUsageError"
+ message="This declaration is opt-in and its usage should be marked with
'@androidx.camera.core.ExperimentalUseCaseGroup' or '@OptIn(markerClass = androidx.camera.core.ExperimentalUseCaseGroup.class)'"
+ errorLine1=" return ViewPort.FIT;"
+ errorLine2=" ~~~">
+ <location
+ file="src/main/java/androidx/camera/view/PreviewView.java"
+ line="576"
+ column="33"/>
</issue>
</issues>
diff --git a/camera/integration-tests/coretestapp/src/main/java/androidx/camera/integration/core/CameraXActivity.java b/camera/integration-tests/coretestapp/src/main/java/androidx/camera/integration/core/CameraXActivity.java
index 15f1631..b0af651 100644
--- a/camera/integration-tests/coretestapp/src/main/java/androidx/camera/integration/core/CameraXActivity.java
+++ b/camera/integration-tests/coretestapp/src/main/java/androidx/camera/integration/core/CameraXActivity.java
@@ -19,6 +19,11 @@
import static androidx.camera.core.ImageCapture.FLASH_MODE_AUTO;
import static androidx.camera.core.ImageCapture.FLASH_MODE_OFF;
import static androidx.camera.core.ImageCapture.FLASH_MODE_ON;
+import static androidx.camera.video.QualitySelector.QUALITY_FHD;
+import static androidx.camera.video.QualitySelector.QUALITY_HD;
+import static androidx.camera.video.QualitySelector.QUALITY_NONE;
+import static androidx.camera.video.QualitySelector.QUALITY_SD;
+import static androidx.camera.video.QualitySelector.QUALITY_UHD;
import static androidx.camera.video.VideoRecordEvent.Finalize.ERROR_FILE_SIZE_LIMIT_REACHED;
import static androidx.camera.video.VideoRecordEvent.Finalize.ERROR_INSUFFICIENT_DISK;
import static androidx.camera.video.VideoRecordEvent.Finalize.ERROR_NONE;
@@ -45,6 +50,7 @@
import android.util.Rational;
import android.view.Display;
import android.view.GestureDetector;
+import android.view.Menu;
import android.view.MotionEvent;
import android.view.ScaleGestureDetector;
import android.view.View;
@@ -52,6 +58,7 @@
import android.widget.Button;
import android.widget.CompoundButton;
import android.widget.ImageButton;
+import android.widget.PopupMenu;
import android.widget.SeekBar;
import android.widget.TextView;
import android.widget.Toast;
@@ -87,6 +94,7 @@
import androidx.camera.lifecycle.ProcessCameraProvider;
import androidx.camera.video.ActiveRecording;
import androidx.camera.video.MediaStoreOutputOptions;
+import androidx.camera.video.QualitySelector;
import androidx.camera.video.Recorder;
import androidx.camera.video.RecordingStats;
import androidx.camera.video.VideoCapture;
@@ -182,6 +190,7 @@
private OpenGLRenderer mPreviewRenderer;
private DisplayManager.DisplayListener mDisplayListener;
private RecordUi mRecordUi;
+ private int mVideoQuality = QUALITY_NONE;
SessionImagesUriSet mSessionImagesUriSet = new SessionImagesUriSet();
@@ -404,6 +413,48 @@
"Unexpected state when click pause button: " + state);
}
});
+
+ mRecordUi.getButtonQuality().setText(getQualityIconName(mVideoQuality));
+ mRecordUi.getButtonQuality().setOnClickListener(view -> {
+ PopupMenu popup = new PopupMenu(this, view);
+ Menu menu = popup.getMenu();
+
+ // Add Auto item
+ final int groupId = Menu.NONE;
+ final int autoOrder = 0;
+ menu.add(groupId, QUALITY_NONE, autoOrder, getQualityMenuItemName(QUALITY_NONE));
+ if (mVideoQuality == QUALITY_NONE) {
+ menu.findItem(QUALITY_NONE).setChecked(true);
+ }
+
+ // Add device supported qualities
+ List<Integer> supportedQualities =
+ QualitySelector.getSupportedQualities(mCamera.getCameraInfo());
+ // supportedQualities has been sorted by descending order.
+ for (int i = 0; i < supportedQualities.size(); i++) {
+ int quality = supportedQualities.get(i);
+ menu.add(groupId, quality, autoOrder + 1 + i,
+ getQualityMenuItemName(quality));
+ if (mVideoQuality == quality) {
+ menu.findItem(quality).setChecked(true);
+ }
+
+ }
+ // Make menu single checkable
+ menu.setGroupCheckable(groupId, true, true);
+
+ popup.setOnMenuItemClickListener(item -> {
+ if (item.getItemId() != mVideoQuality) {
+ mVideoQuality = item.getItemId();
+ mRecordUi.getButtonQuality().setText(getQualityIconName(mVideoQuality));
+ // Quality changed, rebind UseCases
+ tryBindUseCases();
+ }
+ return true;
+ });
+
+ popup.show();
+ });
}
private final Consumer<VideoRecordEvent> mVideoRecordEventListener = event -> {
@@ -688,7 +739,8 @@
mRecordUi = new RecordUi(
findViewById(R.id.Video),
findViewById(R.id.video_pause),
- findViewById(R.id.video_stats)
+ findViewById(R.id.video_stats),
+ findViewById(R.id.video_quality)
);
setUpButtonEvents();
@@ -818,14 +870,22 @@
// Set the use cases after a successful binding.
mUseCases = useCases;
} catch (IllegalArgumentException ex) {
- Log.e(TAG, "bindToLifecycle() failed. Usually caused by binding too many use cases.");
- Toast.makeText(this, "Bind too many use cases.", Toast.LENGTH_SHORT).show();
+ String msg;
+ if (mVideoQuality != QUALITY_NONE) {
+ msg = "Bind too many use cases or video quality is too large.";
+ } else {
+ msg = "Bind too many use cases.";
+ }
+ Log.e(TAG, "bindToLifecycle() failed. " + msg);
+ Toast.makeText(this, msg, Toast.LENGTH_LONG).show();
// Restore toggle buttons to the previous state if the bind failed.
mPreviewToggle.setChecked(getPreview() != null);
mPhotoToggle.setChecked(getImageCapture() != null);
mAnalysisToggle.setChecked(getImageAnalysis() != null);
mVideoToggle.setChecked(getVideoCapture() != null);
+ // Reset video quality to avoid always fail by quality too large.
+ mRecordUi.getButtonQuality().setText(getQualityIconName(mVideoQuality = QUALITY_NONE));
if (!calledBySelf) {
// Only call self if not already calling self to avoid an infinite loop.
@@ -875,8 +935,11 @@
}
if (mVideoToggle.isChecked()) {
- VideoCapture<Recorder> videoCapture =
- VideoCapture.withOutput(new Recorder.Builder().build());
+ Recorder.Builder builder = new Recorder.Builder();
+ if (mVideoQuality != QUALITY_NONE) {
+ builder.setQualitySelector(QualitySelector.of(mVideoQuality));
+ }
+ VideoCapture<Recorder> videoCapture = VideoCapture.withOutput(builder.build());
useCases.add(videoCapture);
}
return useCases;
@@ -1199,14 +1262,16 @@
private final Button mButtonRecord;
private final Button mButtonPause;
private final TextView mTextStats;
+ private final Button mButtonQuality;
private boolean mEnabled = false;
private State mState = State.IDLE;
RecordUi(@NonNull Button buttonRecord, @NonNull Button buttonPause,
- @NonNull TextView textStats) {
+ @NonNull TextView textStats, @NonNull Button buttonQuality) {
mButtonRecord = buttonRecord;
mButtonPause = buttonPause;
mTextStats = textStats;
+ mButtonQuality = buttonQuality;
}
void setEnabled(boolean enabled) {
@@ -1214,11 +1279,13 @@
if (enabled) {
mTextStats.setText("");
mTextStats.setVisibility(View.VISIBLE);
+ mButtonQuality.setVisibility(View.VISIBLE);
updateUi();
} else {
mButtonRecord.setText("Record");
mButtonRecord.setEnabled(false);
mButtonPause.setVisibility(View.INVISIBLE);
+ mButtonQuality.setVisibility(View.INVISIBLE);
mTextStats.setVisibility(View.GONE);
}
}
@@ -1276,6 +1343,11 @@
TextView getTextStats() {
return mTextStats;
}
+
+ @NonNull
+ Button getButtonQuality() {
+ return mButtonQuality;
+ }
}
Preview getPreview() {
@@ -1321,4 +1393,40 @@
CameraControl getCameraControl() {
return mCamera != null ? mCamera.getCameraControl() : null;
}
+
+ @NonNull
+ private static String getQualityIconName(int quality) {
+ switch (quality) {
+ case QUALITY_NONE:
+ return "Auto";
+ case QUALITY_UHD:
+ return "UHD";
+ case QUALITY_FHD:
+ return "FHD";
+ case QUALITY_HD:
+ return "HD";
+ case QUALITY_SD:
+ return "SD";
+ default:
+ return "?";
+ }
+ }
+
+ @NonNull
+ private static String getQualityMenuItemName(int quality) {
+ switch (quality) {
+ case QUALITY_NONE:
+ return "Auto";
+ case QUALITY_UHD:
+ return "UHD (2160P)";
+ case QUALITY_FHD:
+ return "FHD (1080P)";
+ case QUALITY_HD:
+ return "HD (720P)";
+ case QUALITY_SD:
+ return "SD (480P)";
+ default:
+ return "Unknown quality";
+ }
+ }
}
diff --git a/camera/integration-tests/coretestapp/src/main/res/drawable/round_button.xml b/camera/integration-tests/coretestapp/src/main/res/drawable/round_button.xml
new file mode 100644
index 0000000..2672c0e
--- /dev/null
+++ b/camera/integration-tests/coretestapp/src/main/res/drawable/round_button.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8"?><!--
+ Copyright 2021 The Android Open Source Project
+
+ 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.
+ -->
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:state_pressed="false">
+ <shape android:shape="oval">
+ <solid android:color="#AA2255FF"/>
+ </shape>
+ </item>
+ <item android:state_pressed="true">
+ <shape android:shape="oval">
+ <solid android:color="#662255FF"/>
+ </shape>
+ </item>
+</selector>
\ No newline at end of file
diff --git a/camera/integration-tests/coretestapp/src/main/res/layout/activity_camera_xmain.xml b/camera/integration-tests/coretestapp/src/main/res/layout/activity_camera_xmain.xml
index 41d5141..dd3dc93 100644
--- a/camera/integration-tests/coretestapp/src/main/res/layout/activity_camera_xmain.xml
+++ b/camera/integration-tests/coretestapp/src/main/res/layout/activity_camera_xmain.xml
@@ -276,6 +276,21 @@
app:layout_constraintLeft_toRightOf="@id/plus_ev_toggle"
app:layout_constraintTop_toBottomOf="@id/VideoToggle" />
+ <Button
+ android:id="@+id/video_quality"
+ android:layout_width="46dp"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="1dp"
+ android:layout_marginRight="5dp"
+ android:background="@drawable/round_button"
+ android:scaleType="fitXY"
+ android:textColor="#EEEEEE"
+ android:textSize="14dp"
+ android:visibility="invisible"
+ app:layout_constraintTop_toBottomOf="@id/direction_toggle"
+ app:layout_constraintRight_toRightOf="parent"
+ />
+
<SeekBar
android:id="@+id/seekBar"
android:layout_width="250dp"
diff --git a/camera/integration-tests/uiwidgetstestapp/src/androidTest/java/androidx/camera/integration/uiwidgets/rotations/ImageAnalysisBaseTest.kt b/camera/integration-tests/uiwidgetstestapp/src/androidTest/java/androidx/camera/integration/uiwidgets/rotations/ImageAnalysisBaseTest.kt
index 9ec030e..cb965b7 100644
--- a/camera/integration-tests/uiwidgetstestapp/src/androidTest/java/androidx/camera/integration/uiwidgets/rotations/ImageAnalysisBaseTest.kt
+++ b/camera/integration-tests/uiwidgetstestapp/src/androidTest/java/androidx/camera/integration/uiwidgets/rotations/ImageAnalysisBaseTest.kt
@@ -59,11 +59,13 @@
CoreAppTestUtil.assumeCompatibleDevice()
Assume.assumeTrue(CameraUtil.hasCameraWithLensFacing(lensFacing))
+ // Ensure it's in a natural orientation. This change could delay around 1 sec, please
+ // call this earlier before launching the test activity.
+ mDevice.setOrientationNatural()
+
// Clear the device UI and check if there is no dialog or lock screen on the top of the
// window before start the test.
CoreAppTestUtil.prepareDeviceUI(InstrumentationRegistry.getInstrumentation())
- // Ensure it's in a natural orientation
- mDevice.setOrientationNatural()
}
protected fun tearDown() {
@@ -116,7 +118,7 @@
protected inline fun <reified A : CameraActivity> ActivityScenario<A>.waitOnCameraFrames() {
val analysisRunning = withActivity { mAnalysisRunning }
- assertWithMessage("Timed out waiting on image analysis frames")
+ assertWithMessage("Timed out waiting on image analysis frames on $analysisRunning")
.that(analysisRunning.tryAcquire(IMAGES_COUNT, TIMEOUT, TimeUnit.SECONDS))
.isTrue()
}
diff --git a/camera/integration-tests/uiwidgetstestapp/src/androidTest/java/androidx/camera/integration/uiwidgets/rotations/ImageCaptureBaseTest.kt b/camera/integration-tests/uiwidgetstestapp/src/androidTest/java/androidx/camera/integration/uiwidgets/rotations/ImageCaptureBaseTest.kt
index a5a4efd..a3da193 100644
--- a/camera/integration-tests/uiwidgetstestapp/src/androidTest/java/androidx/camera/integration/uiwidgets/rotations/ImageCaptureBaseTest.kt
+++ b/camera/integration-tests/uiwidgetstestapp/src/androidTest/java/androidx/camera/integration/uiwidgets/rotations/ImageCaptureBaseTest.kt
@@ -75,11 +75,13 @@
CoreAppTestUtil.assumeCompatibleDevice()
assumeTrue(CameraUtil.hasCameraWithLensFacing(lensFacing))
+ // Ensure it's in a natural orientation. This change could delay around 1 sec, please
+ // call this earlier before launching the test activity.
+ mDevice.setOrientationNatural()
+
// Clear the device UI and check if there is no dialog or lock screen on the top of the
// window before start the test.
CoreAppTestUtil.prepareDeviceUI(InstrumentationRegistry.getInstrumentation())
- // Ensure it's in a natural orientation
- mDevice.setOrientationNatural()
// Create pictures folder if it doesn't exist on the device. If this fails, abort test.
assumeTrue("Failed to create pictures directory", createPicturesFolder())
@@ -175,7 +177,7 @@
protected inline fun <reified A : CameraActivity> ActivityScenario<A>.waitOnCameraFrames() {
val analysisRunning = withActivity { mAnalysisRunning }
- assertWithMessage("Timed out waiting on image analysis frames")
+ assertWithMessage("Timed out waiting on image analysis frames on $analysisRunning")
.that(analysisRunning.tryAcquire(IMAGES_COUNT, TIMEOUT, TimeUnit.SECONDS))
.isTrue()
}
diff --git a/camera/integration-tests/uiwidgetstestapp/src/main/java/androidx/camera/integration/uiwidgets/rotations/CameraActivity.kt b/camera/integration-tests/uiwidgetstestapp/src/main/java/androidx/camera/integration/uiwidgets/rotations/CameraActivity.kt
index ab1d5c4..c6f702ef 100644
--- a/camera/integration-tests/uiwidgetstestapp/src/main/java/androidx/camera/integration/uiwidgets/rotations/CameraActivity.kt
+++ b/camera/integration-tests/uiwidgetstestapp/src/main/java/androidx/camera/integration/uiwidgets/rotations/CameraActivity.kt
@@ -147,7 +147,7 @@
return ImageAnalysis.Analyzer { imageProxy ->
mAnalysisImageRotation = imageProxy.imageInfo.rotationDegrees
mAnalysisRunning.release()
- Log.d(TAG, "Analyzed image rotation = $mAnalysisImageRotation")
+ Log.d(TAG, "Analyzed image rotation = $mAnalysisImageRotation, $mAnalysisRunning")
imageProxy.close()
}
}
diff --git a/car/app/app-automotive/api/1.1.0-beta01.txt b/car/app/app-automotive/api/1.1.0-beta01.txt
new file mode 100644
index 0000000..e44b1f5
--- /dev/null
+++ b/car/app/app-automotive/api/1.1.0-beta01.txt
@@ -0,0 +1,35 @@
+// Signature format: 4.0
+package androidx.car.app.activity {
+
+ public final class CarAppActivity extends androidx.fragment.app.FragmentActivity implements androidx.lifecycle.LifecycleOwner {
+ ctor public CarAppActivity();
+ }
+
+}
+
+package androidx.car.app.activity.renderer.surface {
+
+ public final class LegacySurfacePackage {
+ ctor public LegacySurfacePackage(androidx.car.app.activity.renderer.surface.SurfaceControlCallback);
+ }
+
+ public interface SurfaceControlCallback {
+ method public default void onError(String, Throwable);
+ method public void onKeyEvent(android.view.KeyEvent);
+ method public void onTouchEvent(android.view.MotionEvent);
+ method public void onWindowFocusChanged(boolean, boolean);
+ method public void setSurfaceWrapper(androidx.car.app.activity.renderer.surface.SurfaceWrapper);
+ }
+
+ public final class SurfaceWrapper {
+ ctor public SurfaceWrapper(android.os.IBinder?, @Dimension int, @Dimension int, int, int, android.view.Surface);
+ method public int getDensityDpi();
+ method public int getDisplayId();
+ method @Dimension public int getHeight();
+ method public android.os.IBinder? getHostToken();
+ method public android.view.Surface getSurface();
+ method @Dimension public int getWidth();
+ }
+
+}
+
diff --git a/car/app/app-automotive/api/public_plus_experimental_1.1.0-beta01.txt b/car/app/app-automotive/api/public_plus_experimental_1.1.0-beta01.txt
new file mode 100644
index 0000000..10d773e
--- /dev/null
+++ b/car/app/app-automotive/api/public_plus_experimental_1.1.0-beta01.txt
@@ -0,0 +1,43 @@
+// Signature format: 4.0
+package androidx.car.app.activity {
+
+ public final class CarAppActivity extends androidx.fragment.app.FragmentActivity implements androidx.lifecycle.LifecycleOwner {
+ ctor public CarAppActivity();
+ }
+
+}
+
+package androidx.car.app.activity.renderer.surface {
+
+ public final class LegacySurfacePackage {
+ ctor public LegacySurfacePackage(androidx.car.app.activity.renderer.surface.SurfaceControlCallback);
+ }
+
+ public interface SurfaceControlCallback {
+ method public default void onError(String, Throwable);
+ method public void onKeyEvent(android.view.KeyEvent);
+ method public void onTouchEvent(android.view.MotionEvent);
+ method public void onWindowFocusChanged(boolean, boolean);
+ method public void setSurfaceWrapper(androidx.car.app.activity.renderer.surface.SurfaceWrapper);
+ }
+
+ public final class SurfaceWrapper {
+ ctor public SurfaceWrapper(android.os.IBinder?, @Dimension int, @Dimension int, int, int, android.view.Surface);
+ method public int getDensityDpi();
+ method public int getDisplayId();
+ method @Dimension public int getHeight();
+ method public android.os.IBinder? getHostToken();
+ method public android.view.Surface getSurface();
+ method @Dimension public int getWidth();
+ }
+
+}
+
+package androidx.car.app.hardware {
+
+ @androidx.car.app.annotations.ExperimentalCarApi public final class AutomotiveCarHardwareManager implements androidx.car.app.hardware.CarHardwareManager {
+ ctor public AutomotiveCarHardwareManager(android.content.Context);
+ }
+
+}
+
diff --git a/car/app/app-automotive/api/public_plus_experimental_current.txt b/car/app/app-automotive/api/public_plus_experimental_current.txt
index e44b1f5..10d773e 100644
--- a/car/app/app-automotive/api/public_plus_experimental_current.txt
+++ b/car/app/app-automotive/api/public_plus_experimental_current.txt
@@ -33,3 +33,11 @@
}
+package androidx.car.app.hardware {
+
+ @androidx.car.app.annotations.ExperimentalCarApi public final class AutomotiveCarHardwareManager implements androidx.car.app.hardware.CarHardwareManager {
+ ctor public AutomotiveCarHardwareManager(android.content.Context);
+ }
+
+}
+
diff --git a/work/workmanager-ktx/api/res-2.1.0-beta01.txt b/car/app/app-automotive/api/res-1.1.0-beta01.txt
similarity index 100%
copy from work/workmanager-ktx/api/res-2.1.0-beta01.txt
copy to car/app/app-automotive/api/res-1.1.0-beta01.txt
diff --git a/car/app/app-automotive/api/restricted_1.1.0-beta01.txt b/car/app/app-automotive/api/restricted_1.1.0-beta01.txt
new file mode 100644
index 0000000..e18fd4c
--- /dev/null
+++ b/car/app/app-automotive/api/restricted_1.1.0-beta01.txt
@@ -0,0 +1,35 @@
+// Signature format: 4.0
+package androidx.car.app.activity {
+
+ public final class CarAppActivity extends androidx.fragment.app.FragmentActivity {
+ ctor public CarAppActivity();
+ }
+
+}
+
+package androidx.car.app.activity.renderer.surface {
+
+ public final class LegacySurfacePackage {
+ ctor public LegacySurfacePackage(androidx.car.app.activity.renderer.surface.SurfaceControlCallback);
+ }
+
+ public interface SurfaceControlCallback {
+ method public default void onError(String, Throwable);
+ method public void onKeyEvent(android.view.KeyEvent);
+ method public void onTouchEvent(android.view.MotionEvent);
+ method public void onWindowFocusChanged(boolean, boolean);
+ method public void setSurfaceWrapper(androidx.car.app.activity.renderer.surface.SurfaceWrapper);
+ }
+
+ public final class SurfaceWrapper {
+ ctor public SurfaceWrapper(android.os.IBinder?, @Dimension int, @Dimension int, int, int, android.view.Surface);
+ method public int getDensityDpi();
+ method public int getDisplayId();
+ method @Dimension public int getHeight();
+ method public android.os.IBinder? getHostToken();
+ method public android.view.Surface getSurface();
+ method @Dimension public int getWidth();
+ }
+
+}
+
diff --git a/car/app/app-automotive/src/main/AndroidManifest.xml b/car/app/app-automotive/src/main/AndroidManifest.xml
index 4ef6516..4abc219 100644
--- a/car/app/app-automotive/src/main/AndroidManifest.xml
+++ b/car/app/app-automotive/src/main/AndroidManifest.xml
@@ -15,6 +15,7 @@
limitations under the License.
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:tools="http://schemas.android.com/tools"
package="androidx.car.app.automotive">
<queries>
<intent>
@@ -24,4 +25,22 @@
<uses-feature
android:name="android.hardware.type.automotive"
android:required="false" />
+
+ <application>
+ <service
+ android:name="androidx.car.app.CarAppMetadataHolderService"
+ android:exported="false"
+ android:enabled="false"
+ tools:ignore="Instantiatable"
+ tools:node="merge">
+ <meta-data
+ android:name=
+ "androidx.car.app.CarAppMetadataHolderService.CAR_HARDWARE_MANAGER"
+ android:value="androidx.car.app.hardware.AutomotiveCarHardwareManager" />
+ <meta-data
+ android:name=
+ "androidx.car.app.CarAppMetadataHolderService.RESULT_MANAGER"
+ android:value="androidx.car.app.activity.ResultManagerAutomotive" />
+ </service>
+ </application>
</manifest>
diff --git a/car/app/app-automotive/src/main/java/androidx/car/app/hardware/AutomotiveCarHardwareManager.java b/car/app/app-automotive/src/main/java/androidx/car/app/hardware/AutomotiveCarHardwareManager.java
index d8c7ee9..4ce76a7 100644
--- a/car/app/app-automotive/src/main/java/androidx/car/app/hardware/AutomotiveCarHardwareManager.java
+++ b/car/app/app-automotive/src/main/java/androidx/car/app/hardware/AutomotiveCarHardwareManager.java
@@ -15,7 +15,7 @@
*/
package androidx.car.app.hardware;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import static java.util.Objects.requireNonNull;
@@ -23,6 +23,9 @@
import androidx.annotation.NonNull;
import androidx.annotation.RestrictTo;
+import androidx.car.app.CarContext;
+import androidx.car.app.HostDispatcher;
+import androidx.car.app.annotations.ExperimentalCarApi;
import androidx.car.app.hardware.common.PropertyManager;
import androidx.car.app.hardware.info.AutomotiveCarInfo;
import androidx.car.app.hardware.info.AutomotiveCarSensors;
@@ -32,10 +35,8 @@
/**
* {@link CarHardwareManager} which uses Android Automotive OS APIs to access properties, sensors,
* and actions.
- *
- * @hide
*/
-@RestrictTo(LIBRARY)
+@ExperimentalCarApi
public final class AutomotiveCarHardwareManager implements CarHardwareManager {
private final AutomotiveCarInfo mCarInfo;
@@ -47,6 +48,13 @@
mCarSensors = new AutomotiveCarSensors();
}
+ /** @hide */
+ @RestrictTo(LIBRARY_GROUP)
+ public AutomotiveCarHardwareManager(@NonNull CarContext context,
+ @NonNull HostDispatcher dispatcher) {
+ this(context);
+ }
+
@NonNull
@Override
public CarInfo getCarInfo() {
diff --git a/car/app/app-automotive/src/main/res/layout/error_message_view.xml b/car/app/app-automotive/src/main/res/layout/error_message_view.xml
index db6b738..6af3c3c 100644
--- a/car/app/app-automotive/src/main/res/layout/error_message_view.xml
+++ b/car/app/app-automotive/src/main/res/layout/error_message_view.xml
@@ -50,7 +50,8 @@
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="@dimen/car_app_default_padding_4"
- android:foreground="@drawable/car_app_no_content_view_focus_ring" />
+ android:foreground="@drawable/car_app_no_content_view_focus_ring"
+ android:textSize="@dimen/car_app_error_message_font_size" />
<Button
android:id="@+id/action_button"
@@ -59,7 +60,8 @@
android:layout_marginTop="@dimen/car_app_default_padding_5"
android:background="@drawable/car_app_rounded_corner"
android:backgroundTint="@color/action_button"
- android:textColor="@color/default_white" />
+ android:textColor="@color/default_white"
+ android:textSize="@dimen/car_app_error_message_font_size" />
</LinearLayout>
</FrameLayout>
</androidx.car.app.activity.ui.ErrorMessageView>
\ No newline at end of file
diff --git a/car/app/app-automotive/src/main/res/values/dimens.xml b/car/app/app-automotive/src/main/res/values/dimens.xml
index 6bf99d2..83e3f83 100644
--- a/car/app/app-automotive/src/main/res/values/dimens.xml
+++ b/car/app/app-automotive/src/main/res/values/dimens.xml
@@ -20,6 +20,9 @@
<dimen name="car_app_default_focus_ring_stroke_width_focused">6dp</dimen>
<dimen name="car_app_default_no_content_focus_background_corner_radius">16dp</dimen>
+ <!-- body2 -->
+ <dimen name="car_app_error_message_font_size">28dp</dimen>
+
<dimen name="car_app_focus_ring_stroke_width_hovered">4dp</dimen>
<dimen name="car_app_icon_size">64dp</dimen>
<dimen name="car_app_no_content_view_focus_ring_padding">24dp</dimen>
diff --git a/car/app/app-automotive/src/test/java/androidx/car/app/activity/ResultManagerAutomotiveTest.java b/car/app/app-automotive/src/test/java/androidx/car/app/activity/ResultManagerAutomotiveTest.java
index 5b0e60a..6f987f8 100644
--- a/car/app/app-automotive/src/test/java/androidx/car/app/activity/ResultManagerAutomotiveTest.java
+++ b/car/app/app-automotive/src/test/java/androidx/car/app/activity/ResultManagerAutomotiveTest.java
@@ -30,6 +30,8 @@
import android.content.ComponentName;
import android.content.Intent;
+import androidx.car.app.managers.ResultManager;
+import androidx.car.app.testing.TestCarContext;
import androidx.test.core.app.ApplicationProvider;
import org.junit.Before;
@@ -57,6 +59,12 @@
}
@Test
+ public void resultsManager_returnsAutomotiveInstance() {
+ ResultManager manager = ResultManager.create(TestCarContext.createCarContext(mApplication));
+ assertThat(manager).isInstanceOf(ResultManagerAutomotive.class);
+ }
+
+ @Test
public void setResult_nullActivity_ignored() {
mResultManager.setCarAppResult(-1, new Intent("foo"));
verify(mCarAppActivity, never()).setResult(anyInt(), any());
diff --git a/car/app/app-automotive/src/test/java/androidx/car/app/hardware/AutomotiveCarHardwareManagerTest.java b/car/app/app-automotive/src/test/java/androidx/car/app/hardware/AutomotiveCarHardwareManagerTest.java
new file mode 100644
index 0000000..80e01da
--- /dev/null
+++ b/car/app/app-automotive/src/test/java/androidx/car/app/hardware/AutomotiveCarHardwareManagerTest.java
@@ -0,0 +1,94 @@
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * 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.
+ */
+
+package androidx.car.app.hardware;
+
+import static com.google.common.truth.Truth.assertThat;
+
+import static org.junit.Assert.assertThrows;
+import static org.mockito.ArgumentMatchers.anyString;
+import static org.mockito.Mockito.when;
+
+import android.app.Application;
+import android.car.Car;
+import android.car.hardware.property.CarPropertyManager;
+
+import androidx.car.app.HandshakeInfo;
+import androidx.car.app.HostDispatcher;
+import androidx.car.app.HostException;
+import androidx.car.app.shadows.car.ShadowCar;
+import androidx.car.app.testing.TestCarContext;
+import androidx.car.app.versioning.CarAppApiLevels;
+import androidx.test.core.app.ApplicationProvider;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.Mock;
+import org.mockito.MockitoAnnotations;
+import org.robolectric.RobolectricTestRunner;
+import org.robolectric.Shadows;
+import org.robolectric.annotation.Config;
+import org.robolectric.annotation.internal.DoNotInstrument;
+import org.robolectric.shadows.ShadowApplication;
+
+@Config(
+ manifest = Config.NONE,
+ shadows = {ShadowCar.class}
+)
+@RunWith(RobolectricTestRunner.class)
+@DoNotInstrument
+public class AutomotiveCarHardwareManagerTest {
+ @Mock
+ private Car mCarMock;
+ @Mock
+ private CarPropertyManager mCarPropertyManagerMock;
+
+ private Application mContext;
+ private ShadowApplication mShadowApplication;
+
+ @Before
+ public void setUp() {
+ MockitoAnnotations.initMocks(this);
+ ShadowCar.setCar(mCarMock);
+ when(mCarMock.getCarManager(anyString())).thenReturn(mCarPropertyManagerMock);
+
+ mContext = ApplicationProvider.getApplicationContext();
+ mShadowApplication = Shadows.shadowOf(mContext);
+ mShadowApplication.grantPermissions(Car.PERMISSION_CAR_INFO);
+ }
+
+ @Test
+ public void carHardwareManager_lessThanApi3_throws() {
+ HostDispatcher dispatcher = new HostDispatcher();
+ TestCarContext carContext =
+ TestCarContext.createCarContext(ApplicationProvider.getApplicationContext());
+ carContext.updateHandshakeInfo(new HandshakeInfo("foo", CarAppApiLevels.LEVEL_2));
+ assertThrows(HostException.class,
+ () -> CarHardwareManager.create(carContext, dispatcher));
+ }
+
+ @Test
+ public void carHardwareManager_returnsAutomotiveInstance() {
+ HostDispatcher dispatcher = new HostDispatcher();
+ TestCarContext carContext =
+ TestCarContext.createCarContext(ApplicationProvider.getApplicationContext());
+ // We need API level 3 to access the CarHardwareManager
+ carContext.updateHandshakeInfo(new HandshakeInfo("foo", CarAppApiLevels.LEVEL_3));
+ CarHardwareManager manager = CarHardwareManager.create(carContext, dispatcher);
+ assertThat(manager).isInstanceOf(AutomotiveCarHardwareManager.class);
+ }
+}
diff --git a/work/workmanager-gcm/api/2.5.0-beta01.txt b/car/app/app-projected/api/1.1.0-beta01.txt
similarity index 100%
copy from work/workmanager-gcm/api/2.5.0-beta01.txt
copy to car/app/app-projected/api/1.1.0-beta01.txt
diff --git a/work/workmanager-gcm/api/2.5.0-beta01.txt b/car/app/app-projected/api/public_plus_experimental_1.1.0-beta01.txt
similarity index 100%
copy from work/workmanager-gcm/api/2.5.0-beta01.txt
copy to car/app/app-projected/api/public_plus_experimental_1.1.0-beta01.txt
diff --git a/work/workmanager-ktx/api/res-2.1.0-beta01.txt b/car/app/app-projected/api/res-1.1.0-beta01.txt
similarity index 100%
copy from work/workmanager-ktx/api/res-2.1.0-beta01.txt
copy to car/app/app-projected/api/res-1.1.0-beta01.txt
diff --git a/work/workmanager-gcm/api/2.5.0-beta01.txt b/car/app/app-projected/api/restricted_1.1.0-beta01.txt
similarity index 100%
copy from work/workmanager-gcm/api/2.5.0-beta01.txt
copy to car/app/app-projected/api/restricted_1.1.0-beta01.txt
diff --git a/car/app/app-projected/src/main/AndroidManifest.xml b/car/app/app-projected/src/main/AndroidManifest.xml
index ced5923..a56441a 100644
--- a/car/app/app-projected/src/main/AndroidManifest.xml
+++ b/car/app/app-projected/src/main/AndroidManifest.xml
@@ -15,6 +15,21 @@
limitations under the License.
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:tools="http://schemas.android.com/tools"
package="androidx.car.app.projected">
+ <application>
+ <service
+ android:name="androidx.car.app.CarAppMetadataHolderService"
+ android:exported="false"
+ android:enabled="false"
+ tools:ignore="Instantiatable"
+ tools:node="merge">
+ <meta-data
+ android:name=
+ "androidx.car.app.CarAppMetadataHolderService.CAR_HARDWARE_MANAGER"
+ android:value="androidx.car.app.hardware.ProjectedCarHardwareManager" />
+ </service>
+ </application>
+
</manifest>
\ No newline at end of file
diff --git a/car/app/app-projected/src/main/java/androidx/car/app/hardware/ProjectedCarHardwareManager.java b/car/app/app-projected/src/main/java/androidx/car/app/hardware/ProjectedCarHardwareManager.java
index d69b0fc..131c3c9 100644
--- a/car/app/app-projected/src/main/java/androidx/car/app/hardware/ProjectedCarHardwareManager.java
+++ b/car/app/app-projected/src/main/java/androidx/car/app/hardware/ProjectedCarHardwareManager.java
@@ -19,6 +19,7 @@
import androidx.annotation.NonNull;
import androidx.annotation.RestrictTo;
+import androidx.car.app.CarContext;
import androidx.car.app.HostDispatcher;
import androidx.car.app.hardware.common.CarHardwareHostDispatcher;
import androidx.car.app.hardware.info.CarInfo;
@@ -53,7 +54,8 @@
/**
* Creates an instance of {@link CarHardwareManager}.
*/
- public ProjectedCarHardwareManager(@NonNull HostDispatcher hostDispatcher) {
+ public ProjectedCarHardwareManager(@NonNull CarContext context,
+ @NonNull HostDispatcher hostDispatcher) {
CarHardwareHostDispatcher carHardwareHostDispatcher =
new CarHardwareHostDispatcher(hostDispatcher);
mVehicleInfo = new ProjectedCarInfo(carHardwareHostDispatcher);
diff --git a/car/app/app-projected/src/test/java/androidx/car/app/hardware/ProjectedCarHardwareManagerTest.java b/car/app/app-projected/src/test/java/androidx/car/app/hardware/ProjectedCarHardwareManagerTest.java
new file mode 100644
index 0000000..74904cd
--- /dev/null
+++ b/car/app/app-projected/src/test/java/androidx/car/app/hardware/ProjectedCarHardwareManagerTest.java
@@ -0,0 +1,58 @@
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * 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.
+ */
+
+package androidx.car.app.hardware;
+
+import static com.google.common.truth.Truth.assertThat;
+
+import static org.junit.Assert.assertThrows;
+
+import androidx.car.app.HandshakeInfo;
+import androidx.car.app.HostDispatcher;
+import androidx.car.app.HostException;
+import androidx.car.app.testing.TestCarContext;
+import androidx.car.app.versioning.CarAppApiLevels;
+import androidx.test.core.app.ApplicationProvider;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.robolectric.RobolectricTestRunner;
+import org.robolectric.annotation.internal.DoNotInstrument;
+
+@RunWith(RobolectricTestRunner.class)
+@DoNotInstrument
+public class ProjectedCarHardwareManagerTest {
+ @Test
+ public void carHardwareManager_lessThanApi3_throws() {
+ HostDispatcher dispatcher = new HostDispatcher();
+ TestCarContext carContext =
+ TestCarContext.createCarContext(ApplicationProvider.getApplicationContext());
+ carContext.updateHandshakeInfo(new HandshakeInfo("foo", CarAppApiLevels.LEVEL_2));
+ assertThrows(HostException.class,
+ () -> CarHardwareManager.create(carContext, dispatcher));
+ }
+
+ @Test
+ public void carHardwareManager_returnsProjectedInstance() {
+ HostDispatcher dispatcher = new HostDispatcher();
+ TestCarContext carContext =
+ TestCarContext.createCarContext(ApplicationProvider.getApplicationContext());
+ // We need API level 3 to access the CarHardwareManager
+ carContext.updateHandshakeInfo(new HandshakeInfo("foo", CarAppApiLevels.LEVEL_3));
+ CarHardwareManager manager = CarHardwareManager.create(carContext, dispatcher);
+ assertThat(manager).isInstanceOf(ProjectedCarHardwareManager.class);
+ }
+}
diff --git a/car/app/app-samples/navigation/automotive/github_build.gradle b/car/app/app-samples/navigation/automotive/github_build.gradle
index 3ce7e5f..79bfe1b 100644
--- a/car/app/app-samples/navigation/automotive/github_build.gradle
+++ b/car/app/app-samples/navigation/automotive/github_build.gradle
@@ -23,8 +23,8 @@
applicationId "androidx.car.app.sample.navigation"
minSdkVersion 29
targetSdkVersion 29
- versionCode 100 // Increment this to generate signed builds for uploading to Playstore
- versionName "100"
+ versionCode 101 // Increment this to generate signed builds for uploading to Playstore
+ versionName "101"
}
buildTypes {
diff --git a/car/app/app-samples/navigation/mobile/github_build.gradle b/car/app/app-samples/navigation/mobile/github_build.gradle
index 1a96a4e..4295dea 100644
--- a/car/app/app-samples/navigation/mobile/github_build.gradle
+++ b/car/app/app-samples/navigation/mobile/github_build.gradle
@@ -23,8 +23,8 @@
applicationId "androidx.car.app.sample.navigation"
minSdkVersion 23
targetSdkVersion 29
- versionCode 100 // Increment this to generate signed builds for uploading to Playstore
- versionName "100"
+ versionCode 101 // Increment this to generate signed builds for uploading to Playstore
+ versionName "101"
}
buildTypes {
diff --git a/car/app/app-samples/showcase/automotive/github_build.gradle b/car/app/app-samples/showcase/automotive/github_build.gradle
index 838cbc5..893f0e6 100644
--- a/car/app/app-samples/showcase/automotive/github_build.gradle
+++ b/car/app/app-samples/showcase/automotive/github_build.gradle
@@ -23,8 +23,8 @@
applicationId "androidx.car.app.sample.showcase"
minSdkVersion 29
targetSdkVersion 29
- versionCode 100 // Increment this to generate signed builds for uploading to Playstore
- versionName "100"
+ versionCode 101 // Increment this to generate signed builds for uploading to Playstore
+ versionName "101"
}
buildTypes {
diff --git a/car/app/app-samples/showcase/mobile/github_build.gradle b/car/app/app-samples/showcase/mobile/github_build.gradle
index cc470ac..e8956cd 100644
--- a/car/app/app-samples/showcase/mobile/github_build.gradle
+++ b/car/app/app-samples/showcase/mobile/github_build.gradle
@@ -23,8 +23,8 @@
applicationId "androidx.car.app.sample.showcase"
minSdkVersion 23
targetSdkVersion 29
- versionCode 100 // Increment this to generate signed builds for uploading to Playstore
- versionName "100"
+ versionCode 101 // Increment this to generate signed builds for uploading to Playstore
+ versionName "101"
}
buildTypes {
diff --git a/car/app/app-testing/api/1.1.0-beta01.txt b/car/app/app-testing/api/1.1.0-beta01.txt
new file mode 100644
index 0000000..2befd1d
--- /dev/null
+++ b/car/app/app-testing/api/1.1.0-beta01.txt
@@ -0,0 +1,66 @@
+// Signature format: 4.0
+package androidx.car.app.testing {
+
+ public class FakeHost {
+ method public void performNotificationActionClick(android.app.PendingIntent);
+ }
+
+ public class ScreenController {
+ ctor public ScreenController(androidx.car.app.Screen);
+ ctor @Deprecated public ScreenController(androidx.car.app.testing.TestCarContext, androidx.car.app.Screen);
+ method public androidx.car.app.Screen getScreen();
+ method public Object? getScreenResult();
+ method public java.util.List<androidx.car.app.model.Template!> getTemplatesReturned();
+ method public androidx.car.app.testing.ScreenController moveToState(androidx.lifecycle.Lifecycle.State);
+ method public void reset();
+ }
+
+ public class SessionController {
+ ctor public SessionController(androidx.car.app.Session, androidx.car.app.testing.TestCarContext, android.content.Intent);
+ method public androidx.car.app.Session getSession();
+ method public androidx.car.app.testing.SessionController moveToState(androidx.lifecycle.Lifecycle.State);
+ }
+
+ public class TestAppManager extends androidx.car.app.AppManager {
+ method public androidx.car.app.SurfaceCallback? getSurfaceCallback();
+ method public java.util.List<android.util.Pair<androidx.car.app.Screen!,androidx.car.app.model.Template!>!> getTemplatesReturned();
+ method public java.util.List<java.lang.CharSequence!> getToastsShown();
+ method public void reset();
+ }
+
+ public class TestCarContext extends androidx.car.app.CarContext {
+ method public static androidx.car.app.testing.TestCarContext createCarContext(android.content.Context);
+ method public androidx.car.app.testing.FakeHost getFakeHost();
+ method public androidx.car.app.testing.TestCarContext.PermissionRequestInfo? getLastPermissionRequestInfo();
+ method public java.util.List<android.content.Intent!> getStartCarAppIntents();
+ method public boolean hasCalledFinishCarApp();
+ method public void reset();
+ }
+
+ public static class TestCarContext.PermissionRequestInfo {
+ method public androidx.car.app.OnRequestPermissionsListener getListener();
+ method public java.util.List<java.lang.String!> getPermissionsRequested();
+ }
+
+ public class TestScreenManager extends androidx.car.app.ScreenManager {
+ method public java.util.List<androidx.car.app.Screen!> getScreensPushed();
+ method public java.util.List<androidx.car.app.Screen!> getScreensRemoved();
+ method public boolean hasScreens();
+ method public void reset();
+ }
+
+}
+
+package androidx.car.app.testing.navigation {
+
+ public class TestNavigationManager extends androidx.car.app.navigation.NavigationManager {
+ ctor public TestNavigationManager(androidx.car.app.testing.TestCarContext, androidx.car.app.HostDispatcher);
+ method public int getNavigationEndedCount();
+ method public androidx.car.app.navigation.NavigationManagerCallback? getNavigationManagerCallback();
+ method public int getNavigationStartedCount();
+ method public java.util.List<androidx.car.app.navigation.model.Trip!> getTripsSent();
+ method public void reset();
+ }
+
+}
+
diff --git a/car/app/app-testing/api/public_plus_experimental_1.1.0-beta01.txt b/car/app/app-testing/api/public_plus_experimental_1.1.0-beta01.txt
new file mode 100644
index 0000000..2befd1d
--- /dev/null
+++ b/car/app/app-testing/api/public_plus_experimental_1.1.0-beta01.txt
@@ -0,0 +1,66 @@
+// Signature format: 4.0
+package androidx.car.app.testing {
+
+ public class FakeHost {
+ method public void performNotificationActionClick(android.app.PendingIntent);
+ }
+
+ public class ScreenController {
+ ctor public ScreenController(androidx.car.app.Screen);
+ ctor @Deprecated public ScreenController(androidx.car.app.testing.TestCarContext, androidx.car.app.Screen);
+ method public androidx.car.app.Screen getScreen();
+ method public Object? getScreenResult();
+ method public java.util.List<androidx.car.app.model.Template!> getTemplatesReturned();
+ method public androidx.car.app.testing.ScreenController moveToState(androidx.lifecycle.Lifecycle.State);
+ method public void reset();
+ }
+
+ public class SessionController {
+ ctor public SessionController(androidx.car.app.Session, androidx.car.app.testing.TestCarContext, android.content.Intent);
+ method public androidx.car.app.Session getSession();
+ method public androidx.car.app.testing.SessionController moveToState(androidx.lifecycle.Lifecycle.State);
+ }
+
+ public class TestAppManager extends androidx.car.app.AppManager {
+ method public androidx.car.app.SurfaceCallback? getSurfaceCallback();
+ method public java.util.List<android.util.Pair<androidx.car.app.Screen!,androidx.car.app.model.Template!>!> getTemplatesReturned();
+ method public java.util.List<java.lang.CharSequence!> getToastsShown();
+ method public void reset();
+ }
+
+ public class TestCarContext extends androidx.car.app.CarContext {
+ method public static androidx.car.app.testing.TestCarContext createCarContext(android.content.Context);
+ method public androidx.car.app.testing.FakeHost getFakeHost();
+ method public androidx.car.app.testing.TestCarContext.PermissionRequestInfo? getLastPermissionRequestInfo();
+ method public java.util.List<android.content.Intent!> getStartCarAppIntents();
+ method public boolean hasCalledFinishCarApp();
+ method public void reset();
+ }
+
+ public static class TestCarContext.PermissionRequestInfo {
+ method public androidx.car.app.OnRequestPermissionsListener getListener();
+ method public java.util.List<java.lang.String!> getPermissionsRequested();
+ }
+
+ public class TestScreenManager extends androidx.car.app.ScreenManager {
+ method public java.util.List<androidx.car.app.Screen!> getScreensPushed();
+ method public java.util.List<androidx.car.app.Screen!> getScreensRemoved();
+ method public boolean hasScreens();
+ method public void reset();
+ }
+
+}
+
+package androidx.car.app.testing.navigation {
+
+ public class TestNavigationManager extends androidx.car.app.navigation.NavigationManager {
+ ctor public TestNavigationManager(androidx.car.app.testing.TestCarContext, androidx.car.app.HostDispatcher);
+ method public int getNavigationEndedCount();
+ method public androidx.car.app.navigation.NavigationManagerCallback? getNavigationManagerCallback();
+ method public int getNavigationStartedCount();
+ method public java.util.List<androidx.car.app.navigation.model.Trip!> getTripsSent();
+ method public void reset();
+ }
+
+}
+
diff --git a/work/workmanager-testing/api/res-2.1.0-beta01.txt b/car/app/app-testing/api/res-1.1.0-beta01.txt
similarity index 100%
copy from work/workmanager-testing/api/res-2.1.0-beta01.txt
copy to car/app/app-testing/api/res-1.1.0-beta01.txt
diff --git a/car/app/app-testing/api/restricted_1.1.0-beta01.txt b/car/app/app-testing/api/restricted_1.1.0-beta01.txt
new file mode 100644
index 0000000..2befd1d
--- /dev/null
+++ b/car/app/app-testing/api/restricted_1.1.0-beta01.txt
@@ -0,0 +1,66 @@
+// Signature format: 4.0
+package androidx.car.app.testing {
+
+ public class FakeHost {
+ method public void performNotificationActionClick(android.app.PendingIntent);
+ }
+
+ public class ScreenController {
+ ctor public ScreenController(androidx.car.app.Screen);
+ ctor @Deprecated public ScreenController(androidx.car.app.testing.TestCarContext, androidx.car.app.Screen);
+ method public androidx.car.app.Screen getScreen();
+ method public Object? getScreenResult();
+ method public java.util.List<androidx.car.app.model.Template!> getTemplatesReturned();
+ method public androidx.car.app.testing.ScreenController moveToState(androidx.lifecycle.Lifecycle.State);
+ method public void reset();
+ }
+
+ public class SessionController {
+ ctor public SessionController(androidx.car.app.Session, androidx.car.app.testing.TestCarContext, android.content.Intent);
+ method public androidx.car.app.Session getSession();
+ method public androidx.car.app.testing.SessionController moveToState(androidx.lifecycle.Lifecycle.State);
+ }
+
+ public class TestAppManager extends androidx.car.app.AppManager {
+ method public androidx.car.app.SurfaceCallback? getSurfaceCallback();
+ method public java.util.List<android.util.Pair<androidx.car.app.Screen!,androidx.car.app.model.Template!>!> getTemplatesReturned();
+ method public java.util.List<java.lang.CharSequence!> getToastsShown();
+ method public void reset();
+ }
+
+ public class TestCarContext extends androidx.car.app.CarContext {
+ method public static androidx.car.app.testing.TestCarContext createCarContext(android.content.Context);
+ method public androidx.car.app.testing.FakeHost getFakeHost();
+ method public androidx.car.app.testing.TestCarContext.PermissionRequestInfo? getLastPermissionRequestInfo();
+ method public java.util.List<android.content.Intent!> getStartCarAppIntents();
+ method public boolean hasCalledFinishCarApp();
+ method public void reset();
+ }
+
+ public static class TestCarContext.PermissionRequestInfo {
+ method public androidx.car.app.OnRequestPermissionsListener getListener();
+ method public java.util.List<java.lang.String!> getPermissionsRequested();
+ }
+
+ public class TestScreenManager extends androidx.car.app.ScreenManager {
+ method public java.util.List<androidx.car.app.Screen!> getScreensPushed();
+ method public java.util.List<androidx.car.app.Screen!> getScreensRemoved();
+ method public boolean hasScreens();
+ method public void reset();
+ }
+
+}
+
+package androidx.car.app.testing.navigation {
+
+ public class TestNavigationManager extends androidx.car.app.navigation.NavigationManager {
+ ctor public TestNavigationManager(androidx.car.app.testing.TestCarContext, androidx.car.app.HostDispatcher);
+ method public int getNavigationEndedCount();
+ method public androidx.car.app.navigation.NavigationManagerCallback? getNavigationManagerCallback();
+ method public int getNavigationStartedCount();
+ method public java.util.List<androidx.car.app.navigation.model.Trip!> getTripsSent();
+ method public void reset();
+ }
+
+}
+
diff --git a/car/app/app/api/1.1.0-beta01.txt b/car/app/app/api/1.1.0-beta01.txt
new file mode 100644
index 0000000..d0323fd
--- /dev/null
+++ b/car/app/app/api/1.1.0-beta01.txt
@@ -0,0 +1,1421 @@
+// Signature format: 4.0
+package androidx.car.app {
+
+ @androidx.car.app.annotations.CarProtocol public final class AppInfo {
+ ctor @VisibleForTesting public AppInfo(int, int, String);
+ method public int getLatestCarAppApiLevel();
+ method public String getLibraryDisplayVersion();
+ method public int getMinCarAppApiLevel();
+ field public static final String MIN_API_LEVEL_METADATA_KEY = "androidx.car.app.minCarApiLevel";
+ }
+
+ public class AppManager implements androidx.car.app.managers.Manager {
+ method public void invalidate();
+ method public void setSurfaceCallback(androidx.car.app.SurfaceCallback?);
+ method public void showToast(CharSequence, int);
+ }
+
+ public final class CarAppPermission {
+ method public static void checkHasLibraryPermission(android.content.Context, String);
+ method public static void checkHasPermission(android.content.Context, String);
+ field public static final String ACCESS_SURFACE = "androidx.car.app.ACCESS_SURFACE";
+ field public static final String MAP_TEMPLATES = "androidx.car.app.MAP_TEMPLATES";
+ field public static final String NAVIGATION_TEMPLATES = "androidx.car.app.NAVIGATION_TEMPLATES";
+ }
+
+ public abstract class CarAppService extends android.app.Service {
+ ctor public CarAppService();
+ method public abstract androidx.car.app.validation.HostValidator createHostValidator();
+ method @CallSuper public final void dump(java.io.FileDescriptor, java.io.PrintWriter, String![]?);
+ method public final androidx.car.app.Session? getCurrentSession();
+ method public final androidx.car.app.HostInfo? getHostInfo();
+ method @CallSuper public final android.os.IBinder onBind(android.content.Intent);
+ method public abstract androidx.car.app.Session onCreateSession();
+ method public final boolean onUnbind(android.content.Intent);
+ field public static final String CATEGORY_CHARGING_APP = "androidx.car.app.category.CHARGING";
+ field public static final String CATEGORY_NAVIGATION_APP = "androidx.car.app.category.NAVIGATION";
+ field public static final String CATEGORY_PARKING_APP = "androidx.car.app.category.PARKING";
+ field public static final String SERVICE_INTERFACE = "androidx.car.app.CarAppService";
+ }
+
+ public class CarContext extends android.content.ContextWrapper {
+ method public void finishCarApp();
+ method @androidx.car.app.annotations.RequiresCarApi(2) public android.content.ComponentName? getCallingComponent();
+ method public int getCarAppApiLevel();
+ method public Object getCarService(String);
+ method public <T> T getCarService(Class<T!>);
+ method public String getCarServiceName(Class<?>);
+ method public androidx.car.app.HostInfo? getHostInfo();
+ method public androidx.activity.OnBackPressedDispatcher getOnBackPressedDispatcher();
+ method public boolean isDarkMode();
+ method public void requestPermissions(java.util.List<java.lang.String!>, androidx.car.app.OnRequestPermissionsListener);
+ method public void requestPermissions(java.util.List<java.lang.String!>, java.util.concurrent.Executor, androidx.car.app.OnRequestPermissionsListener);
+ method @androidx.car.app.annotations.RequiresCarApi(2) public void setCarAppResult(int, android.content.Intent?);
+ method public void startCarApp(android.content.Intent);
+ method @Deprecated public static void startCarApp(android.content.Intent, android.content.Intent);
+ field public static final String ACTION_NAVIGATE = "androidx.car.app.action.NAVIGATE";
+ field public static final String APP_SERVICE = "app";
+ field public static final String CAR_SERVICE = "car";
+ field @androidx.car.app.annotations.RequiresCarApi(2) public static final String CONSTRAINT_SERVICE = "constraints";
+ field public static final String EXTRA_START_CAR_APP_BINDER_KEY = "androidx.car.app.extra.START_CAR_APP_BINDER_KEY";
+ field @androidx.car.app.annotations.RequiresCarApi(3) public static final String HARDWARE_SERVICE = "hardware";
+ field public static final String NAVIGATION_SERVICE = "navigation";
+ field public static final String SCREEN_SERVICE = "screen";
+ }
+
+ public final class CarToast {
+ method public static androidx.car.app.CarToast makeText(androidx.car.app.CarContext, @StringRes int, int);
+ method public static androidx.car.app.CarToast makeText(androidx.car.app.CarContext, CharSequence, int);
+ method public void setDuration(int);
+ method public void setText(@StringRes int);
+ method public void setText(CharSequence);
+ method public void show();
+ field public static final int LENGTH_LONG = 1; // 0x1
+ field public static final int LENGTH_SHORT = 0; // 0x0
+ }
+
+ @androidx.car.app.annotations.CarProtocol public final class FailureResponse {
+ ctor public FailureResponse(Throwable);
+ method public int getErrorType();
+ method public String getStackTrace();
+ field public static final int BUNDLER_EXCEPTION = 1; // 0x1
+ field public static final int ILLEGAL_STATE_EXCEPTION = 2; // 0x2
+ field public static final int INVALID_PARAMETER_EXCEPTION = 3; // 0x3
+ field public static final int REMOTE_EXCEPTION = 6; // 0x6
+ field public static final int RUNTIME_EXCEPTION = 5; // 0x5
+ field public static final int SECURITY_EXCEPTION = 4; // 0x4
+ field public static final int UNKNOWN_ERROR = 0; // 0x0
+ }
+
+ @androidx.car.app.annotations.CarProtocol public final class HandshakeInfo {
+ ctor public HandshakeInfo(String, int);
+ method public int getHostCarAppApiLevel();
+ method public String getHostPackageName();
+ }
+
+ public final class HostException extends java.lang.RuntimeException {
+ ctor public HostException(String);
+ ctor public HostException(String, Throwable);
+ ctor public HostException(Throwable);
+ }
+
+ public final class HostInfo {
+ ctor public HostInfo(String, int);
+ method public String getPackageName();
+ method public int getUid();
+ }
+
+ @androidx.car.app.annotations.CarProtocol public interface OnDoneCallback {
+ method public default void onFailure(androidx.car.app.serialization.Bundleable);
+ method public default void onSuccess(androidx.car.app.serialization.Bundleable?);
+ }
+
+ public interface OnRequestPermissionsListener {
+ method public void onRequestPermissionsResult(java.util.List<java.lang.String!>, java.util.List<java.lang.String!>);
+ }
+
+ public interface OnScreenResultListener {
+ method public void onScreenResult(Object?);
+ }
+
+ public abstract class Screen implements androidx.lifecycle.LifecycleOwner {
+ ctor protected Screen(androidx.car.app.CarContext);
+ method public final void finish();
+ method public final androidx.car.app.CarContext getCarContext();
+ method public final androidx.lifecycle.Lifecycle getLifecycle();
+ method public String? getMarker();
+ method public final androidx.car.app.ScreenManager getScreenManager();
+ method public final void invalidate();
+ method public abstract androidx.car.app.model.Template onGetTemplate();
+ method public void setMarker(String?);
+ method public void setResult(Object?);
+ }
+
+ @MainThread public class ScreenManager implements androidx.car.app.managers.Manager {
+ method public int getStackSize();
+ method public androidx.car.app.Screen getTop();
+ method public void pop();
+ method public void popTo(String);
+ method public void popToRoot();
+ method public void push(androidx.car.app.Screen);
+ method public void pushForResult(androidx.car.app.Screen, androidx.car.app.OnScreenResultListener);
+ method public void remove(androidx.car.app.Screen);
+ }
+
+ public abstract class Session implements androidx.lifecycle.LifecycleOwner {
+ ctor public Session();
+ method public final androidx.car.app.CarContext getCarContext();
+ method public androidx.lifecycle.Lifecycle getLifecycle();
+ method public void onCarConfigurationChanged(android.content.res.Configuration);
+ method public abstract androidx.car.app.Screen onCreateScreen(android.content.Intent);
+ method public void onNewIntent(android.content.Intent);
+ }
+
+ public interface SurfaceCallback {
+ method @androidx.car.app.annotations.RequiresCarApi(2) public default void onFling(float, float);
+ method @androidx.car.app.annotations.RequiresCarApi(2) public default void onScale(float, float, float);
+ method @androidx.car.app.annotations.RequiresCarApi(2) public default void onScroll(float, float);
+ method public default void onStableAreaChanged(android.graphics.Rect);
+ method public default void onSurfaceAvailable(androidx.car.app.SurfaceContainer);
+ method public default void onSurfaceDestroyed(androidx.car.app.SurfaceContainer);
+ method public default void onVisibleAreaChanged(android.graphics.Rect);
+ }
+
+ @androidx.car.app.annotations.CarProtocol public final class SurfaceContainer {
+ ctor public SurfaceContainer(android.view.Surface?, int, int, int);
+ method public int getDpi();
+ method public int getHeight();
+ method public android.view.Surface? getSurface();
+ method public int getWidth();
+ }
+
+}
+
+package androidx.car.app.annotations {
+
+ @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @java.lang.annotation.Target({java.lang.annotation.ElementType.TYPE, java.lang.annotation.ElementType.PARAMETER}) public @interface CarProtocol {
+ }
+
+ @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.RUNTIME) @java.lang.annotation.Target({java.lang.annotation.ElementType.TYPE, java.lang.annotation.ElementType.CONSTRUCTOR, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.METHOD}) public @interface RequiresCarApi {
+ method public abstract int value();
+ }
+
+}
+
+package androidx.car.app.connection {
+
+ public final class CarConnection {
+ ctor public CarConnection(android.content.Context);
+ method public androidx.lifecycle.LiveData<java.lang.Integer!> getType();
+ field public static final String ACTION_CAR_CONNECTION_UPDATED = "androidx.car.app.connection.action.CAR_CONNECTION_UPDATED";
+ field public static final String CAR_CONNECTION_STATE = "CarConnectionState";
+ field public static final int CONNECTION_TYPE_NATIVE = 1; // 0x1
+ field public static final int CONNECTION_TYPE_NOT_CONNECTED = 0; // 0x0
+ field public static final int CONNECTION_TYPE_PROJECTION = 2; // 0x2
+ }
+
+}
+
+package androidx.car.app.constraints {
+
+ @androidx.car.app.annotations.RequiresCarApi(2) public class ConstraintManager implements androidx.car.app.managers.Manager {
+ method public int getContentLimit(int);
+ field public static final int CONTENT_LIMIT_TYPE_GRID = 1; // 0x1
+ field public static final int CONTENT_LIMIT_TYPE_LIST = 0; // 0x0
+ field public static final int CONTENT_LIMIT_TYPE_PANE = 4; // 0x4
+ field public static final int CONTENT_LIMIT_TYPE_PLACE_LIST = 2; // 0x2
+ field public static final int CONTENT_LIMIT_TYPE_ROUTE_LIST = 3; // 0x3
+ }
+
+}
+
+package androidx.car.app.hardware {
+
+ @MainThread @androidx.car.app.annotations.RequiresCarApi(3) public interface CarHardwareManager extends androidx.car.app.managers.Manager {
+ method public default androidx.car.app.hardware.info.CarInfo getCarInfo();
+ method public default androidx.car.app.hardware.info.CarSensors getCarSensors();
+ }
+
+}
+
+package androidx.car.app.hardware.common {
+
+ @androidx.car.app.annotations.CarProtocol @androidx.car.app.annotations.RequiresCarApi(3) public final class CarUnit {
+ field public static final int KILOMETER = 3; // 0x3
+ field public static final int KILOMETERS_PER_HOUR = 102; // 0x66
+ field public static final int METER = 2; // 0x2
+ field public static final int METERS_PER_SEC = 101; // 0x65
+ field public static final int MILE = 4; // 0x4
+ field public static final int MILES_PER_HOUR = 103; // 0x67
+ field public static final int MILLIMETER = 1; // 0x1
+ }
+
+ @androidx.car.app.annotations.CarProtocol @androidx.car.app.annotations.RequiresCarApi(3) public final class CarValue<T> {
+ ctor public CarValue(T?, long, int);
+ method public int getStatus();
+ method public long getTimestampMillis();
+ method public T? getValue();
+ field public static final int STATUS_SUCCESS = 1; // 0x1
+ field public static final int STATUS_UNAVAILABLE = 3; // 0x3
+ field public static final int STATUS_UNIMPLEMENTED = 2; // 0x2
+ field public static final int STATUS_UNKNOWN = 0; // 0x0
+ }
+
+ @androidx.car.app.annotations.CarProtocol @androidx.car.app.annotations.RequiresCarApi(3) public interface OnCarDataAvailableListener<T> {
+ method public void onCarDataAvailable(T);
+ }
+
+}
+
+package androidx.car.app.hardware.info {
+
+ @androidx.car.app.annotations.CarProtocol @androidx.car.app.annotations.RequiresCarApi(3) public final class Accelerometer {
+ ctor public Accelerometer(androidx.car.app.hardware.common.CarValue<java.util.List<java.lang.Float!>!>);
+ method public androidx.car.app.hardware.common.CarValue<java.util.List<java.lang.Float!>!> getForces();
+ }
+
+ @androidx.car.app.annotations.CarProtocol @androidx.car.app.annotations.RequiresCarApi(3) public final class CarHardwareLocation {
+ ctor public CarHardwareLocation(androidx.car.app.hardware.common.CarValue<android.location.Location!>);
+ method public androidx.car.app.hardware.common.CarValue<android.location.Location!> getLocation();
+ }
+
+ @MainThread @androidx.car.app.annotations.RequiresCarApi(3) public interface CarInfo {
+ method public void addEnergyLevelListener(java.util.concurrent.Executor, androidx.car.app.hardware.common.OnCarDataAvailableListener<androidx.car.app.hardware.info.EnergyLevel!>);
+ method public void addMileageListener(java.util.concurrent.Executor, androidx.car.app.hardware.common.OnCarDataAvailableListener<androidx.car.app.hardware.info.Mileage!>);
+ method public void addSpeedListener(java.util.concurrent.Executor, androidx.car.app.hardware.common.OnCarDataAvailableListener<androidx.car.app.hardware.info.Speed!>);
+ method public void addTollListener(java.util.concurrent.Executor, androidx.car.app.hardware.common.OnCarDataAvailableListener<androidx.car.app.hardware.info.TollCard!>);
+ method public void fetchEnergyProfile(java.util.concurrent.Executor, androidx.car.app.hardware.common.OnCarDataAvailableListener<androidx.car.app.hardware.info.EnergyProfile!>);
+ method public void fetchModel(java.util.concurrent.Executor, androidx.car.app.hardware.common.OnCarDataAvailableListener<androidx.car.app.hardware.info.Model!>);
+ method public void removeEnergyLevelListener(androidx.car.app.hardware.common.OnCarDataAvailableListener<androidx.car.app.hardware.info.EnergyLevel!>);
+ method public void removeMileageListener(androidx.car.app.hardware.common.OnCarDataAvailableListener<androidx.car.app.hardware.info.Mileage!>);
+ method public void removeSpeedListener(androidx.car.app.hardware.common.OnCarDataAvailableListener<androidx.car.app.hardware.info.Speed!>);
+ method public void removeTollListener(androidx.car.app.hardware.common.OnCarDataAvailableListener<androidx.car.app.hardware.info.TollCard!>);
+ }
+
+ @MainThread @androidx.car.app.annotations.RequiresCarApi(3) public interface CarSensors {
+ method public void addAccelerometerListener(int, java.util.concurrent.Executor, androidx.car.app.hardware.common.OnCarDataAvailableListener<androidx.car.app.hardware.info.Accelerometer!>);
+ method public void addCarHardwareLocationListener(int, java.util.concurrent.Executor, androidx.car.app.hardware.common.OnCarDataAvailableListener<androidx.car.app.hardware.info.CarHardwareLocation!>);
+ method public void addCompassListener(int, java.util.concurrent.Executor, androidx.car.app.hardware.common.OnCarDataAvailableListener<androidx.car.app.hardware.info.Compass!>);
+ method public void addGyroscopeListener(int, java.util.concurrent.Executor, androidx.car.app.hardware.common.OnCarDataAvailableListener<androidx.car.app.hardware.info.Gyroscope!>);
+ method public void removeAccelerometerListener(androidx.car.app.hardware.common.OnCarDataAvailableListener<androidx.car.app.hardware.info.Accelerometer!>);
+ method public void removeCarHardwareLocationListener(androidx.car.app.hardware.common.OnCarDataAvailableListener<androidx.car.app.hardware.info.CarHardwareLocation!>);
+ method public void removeCompassListener(androidx.car.app.hardware.common.OnCarDataAvailableListener<androidx.car.app.hardware.info.Compass!>);
+ method public void removeGyroscopeListener(androidx.car.app.hardware.common.OnCarDataAvailableListener<androidx.car.app.hardware.info.Gyroscope!>);
+ field public static final int UPDATE_RATE_FASTEST = 3; // 0x3
+ field public static final int UPDATE_RATE_NORMAL = 1; // 0x1
+ field public static final int UPDATE_RATE_UI = 2; // 0x2
+ }
+
+ @androidx.car.app.annotations.CarProtocol @androidx.car.app.annotations.RequiresCarApi(3) public final class Compass {
+ ctor public Compass(androidx.car.app.hardware.common.CarValue<java.util.List<java.lang.Float!>!>);
+ method public androidx.car.app.hardware.common.CarValue<java.util.List<java.lang.Float!>!> getOrientations();
+ }
+
+ @androidx.car.app.annotations.CarProtocol @androidx.car.app.annotations.RequiresCarApi(3) public final class EnergyLevel {
+ method public androidx.car.app.hardware.common.CarValue<java.lang.Float!> getBatteryPercent();
+ method public androidx.car.app.hardware.common.CarValue<java.lang.Integer!> getDistanceDisplayUnit();
+ method public androidx.car.app.hardware.common.CarValue<java.lang.Boolean!> getEnergyIsLow();
+ method public androidx.car.app.hardware.common.CarValue<java.lang.Float!> getFuelPercent();
+ method public androidx.car.app.hardware.common.CarValue<java.lang.Float!> getRangeRemainingMeters();
+ }
+
+ public static final class EnergyLevel.Builder {
+ ctor public EnergyLevel.Builder();
+ method public androidx.car.app.hardware.info.EnergyLevel build();
+ method public androidx.car.app.hardware.info.EnergyLevel.Builder setBatteryPercent(androidx.car.app.hardware.common.CarValue<java.lang.Float!>);
+ method public androidx.car.app.hardware.info.EnergyLevel.Builder setDistanceDisplayUnit(androidx.car.app.hardware.common.CarValue<java.lang.Integer!>);
+ method public androidx.car.app.hardware.info.EnergyLevel.Builder setEnergyIsLow(androidx.car.app.hardware.common.CarValue<java.lang.Boolean!>);
+ method public androidx.car.app.hardware.info.EnergyLevel.Builder setFuelPercent(androidx.car.app.hardware.common.CarValue<java.lang.Float!>);
+ method public androidx.car.app.hardware.info.EnergyLevel.Builder setRangeRemainingMeters(androidx.car.app.hardware.common.CarValue<java.lang.Float!>);
+ }
+
+ @androidx.car.app.annotations.CarProtocol @androidx.car.app.annotations.RequiresCarApi(3) public final class EnergyProfile {
+ method public androidx.car.app.hardware.common.CarValue<java.util.List<java.lang.Integer!>!> getEvConnectorTypes();
+ method public androidx.car.app.hardware.common.CarValue<java.util.List<java.lang.Integer!>!> getFuelTypes();
+ field public static final int EVCONNECTOR_TYPE_CHADEMO = 3; // 0x3
+ field public static final int EVCONNECTOR_TYPE_COMBO_1 = 4; // 0x4
+ field public static final int EVCONNECTOR_TYPE_COMBO_2 = 5; // 0x5
+ field public static final int EVCONNECTOR_TYPE_GBT = 9; // 0x9
+ field public static final int EVCONNECTOR_TYPE_GBT_DC = 10; // 0xa
+ field public static final int EVCONNECTOR_TYPE_J1772 = 1; // 0x1
+ field public static final int EVCONNECTOR_TYPE_MENNEKES = 2; // 0x2
+ field public static final int EVCONNECTOR_TYPE_OTHER = 101; // 0x65
+ field public static final int EVCONNECTOR_TYPE_SCAME = 11; // 0xb
+ field public static final int EVCONNECTOR_TYPE_TESLA_HPWC = 7; // 0x7
+ field public static final int EVCONNECTOR_TYPE_TESLA_ROADSTER = 6; // 0x6
+ field public static final int EVCONNECTOR_TYPE_TESLA_SUPERCHARGER = 8; // 0x8
+ field public static final int EVCONNECTOR_TYPE_UNKNOWN = 0; // 0x0
+ field public static final int FUEL_TYPE_BIODIESEL = 5; // 0x5
+ field public static final int FUEL_TYPE_CNG = 8; // 0x8
+ field public static final int FUEL_TYPE_DIESEL_1 = 3; // 0x3
+ field public static final int FUEL_TYPE_DIESEL_2 = 4; // 0x4
+ field public static final int FUEL_TYPE_E85 = 6; // 0x6
+ field public static final int FUEL_TYPE_ELECTRIC = 10; // 0xa
+ field public static final int FUEL_TYPE_HYDROGEN = 11; // 0xb
+ field public static final int FUEL_TYPE_LEADED = 2; // 0x2
+ field public static final int FUEL_TYPE_LNG = 9; // 0x9
+ field public static final int FUEL_TYPE_LPG = 7; // 0x7
+ field public static final int FUEL_TYPE_OTHER = 12; // 0xc
+ field public static final int FUEL_TYPE_UNKNOWN = 0; // 0x0
+ field public static final int FUEL_TYPE_UNLEADED = 1; // 0x1
+ }
+
+ public static final class EnergyProfile.Builder {
+ ctor public EnergyProfile.Builder();
+ method public androidx.car.app.hardware.info.EnergyProfile build();
+ method public androidx.car.app.hardware.info.EnergyProfile.Builder setEvConnectorTypes(androidx.car.app.hardware.common.CarValue<java.util.List<java.lang.Integer!>!>);
+ method public androidx.car.app.hardware.info.EnergyProfile.Builder setFuelTypes(androidx.car.app.hardware.common.CarValue<java.util.List<java.lang.Integer!>!>);
+ }
+
+ @androidx.car.app.annotations.CarProtocol @androidx.car.app.annotations.RequiresCarApi(3) public final class Gyroscope {
+ ctor public Gyroscope(androidx.car.app.hardware.common.CarValue<java.util.List<java.lang.Float!>!>);
+ method public androidx.car.app.hardware.common.CarValue<java.util.List<java.lang.Float!>!> getRotations();
+ }
+
+ @androidx.car.app.annotations.CarProtocol @androidx.car.app.annotations.RequiresCarApi(3) public final class Mileage {
+ method public androidx.car.app.hardware.common.CarValue<java.lang.Integer!> getDistanceDisplayUnit();
+ method public androidx.car.app.hardware.common.CarValue<java.lang.Float!> getOdometerMeters();
+ }
+
+ public static final class Mileage.Builder {
+ ctor public Mileage.Builder();
+ method public androidx.car.app.hardware.info.Mileage build();
+ method public androidx.car.app.hardware.info.Mileage.Builder setDistanceDisplayUnit(androidx.car.app.hardware.common.CarValue<java.lang.Integer!>);
+ method public androidx.car.app.hardware.info.Mileage.Builder setOdometerMeters(androidx.car.app.hardware.common.CarValue<java.lang.Float!>);
+ }
+
+ @androidx.car.app.annotations.CarProtocol @androidx.car.app.annotations.RequiresCarApi(3) public final class Model {
+ method public androidx.car.app.hardware.common.CarValue<java.lang.String!> getManufacturer();
+ method public androidx.car.app.hardware.common.CarValue<java.lang.String!> getName();
+ method public androidx.car.app.hardware.common.CarValue<java.lang.Integer!> getYear();
+ }
+
+ public static final class Model.Builder {
+ ctor public Model.Builder();
+ method public androidx.car.app.hardware.info.Model build();
+ method public androidx.car.app.hardware.info.Model.Builder setManufacturer(androidx.car.app.hardware.common.CarValue<java.lang.String!>);
+ method public androidx.car.app.hardware.info.Model.Builder setName(androidx.car.app.hardware.common.CarValue<java.lang.String!>);
+ method public androidx.car.app.hardware.info.Model.Builder setYear(androidx.car.app.hardware.common.CarValue<java.lang.Integer!>);
+ }
+
+ @androidx.car.app.annotations.CarProtocol @androidx.car.app.annotations.RequiresCarApi(3) public final class Speed {
+ method public androidx.car.app.hardware.common.CarValue<java.lang.Float!> getDisplaySpeedMetersPerSecond();
+ method public androidx.car.app.hardware.common.CarValue<java.lang.Float!> getRawSpeedMetersPerSecond();
+ method public androidx.car.app.hardware.common.CarValue<java.lang.Integer!> getSpeedDisplayUnit();
+ }
+
+ public static final class Speed.Builder {
+ ctor public Speed.Builder();
+ method public androidx.car.app.hardware.info.Speed build();
+ method public androidx.car.app.hardware.info.Speed.Builder setDisplaySpeedMetersPerSecond(androidx.car.app.hardware.common.CarValue<java.lang.Float!>);
+ method public androidx.car.app.hardware.info.Speed.Builder setRawSpeedMetersPerSecond(androidx.car.app.hardware.common.CarValue<java.lang.Float!>);
+ method public androidx.car.app.hardware.info.Speed.Builder setSpeedDisplayUnit(androidx.car.app.hardware.common.CarValue<java.lang.Integer!>);
+ }
+
+ @androidx.car.app.annotations.CarProtocol @androidx.car.app.annotations.RequiresCarApi(3) public final class TollCard {
+ method public androidx.car.app.hardware.common.CarValue<java.lang.Integer!> getCardState();
+ field public static final int TOLLCARD_STATE_INVALID = 2; // 0x2
+ field public static final int TOLLCARD_STATE_NOT_INSERTED = 3; // 0x3
+ field public static final int TOLLCARD_STATE_UNKNOWN = 0; // 0x0
+ field public static final int TOLLCARD_STATE_VALID = 1; // 0x1
+ }
+
+ public static final class TollCard.Builder {
+ ctor public TollCard.Builder();
+ method public androidx.car.app.hardware.info.TollCard build();
+ method public androidx.car.app.hardware.info.TollCard.Builder setCardState(androidx.car.app.hardware.common.CarValue<java.lang.Integer!>);
+ }
+
+}
+
+package androidx.car.app.managers {
+
+ public interface Manager {
+ }
+
+}
+
+package androidx.car.app.model {
+
+ @androidx.car.app.annotations.CarProtocol public final class Action {
+ method public androidx.car.app.model.CarColor? getBackgroundColor();
+ method public androidx.car.app.model.CarIcon? getIcon();
+ method public androidx.car.app.model.OnClickDelegate? getOnClickDelegate();
+ method public androidx.car.app.model.CarText? getTitle();
+ method public int getType();
+ method public boolean isStandard();
+ method public static String typeToString(int);
+ field public static final androidx.car.app.model.Action APP_ICON;
+ field public static final androidx.car.app.model.Action BACK;
+ field public static final androidx.car.app.model.Action PAN;
+ field public static final int TYPE_APP_ICON = 65538; // 0x10002
+ field public static final int TYPE_BACK = 65539; // 0x10003
+ field public static final int TYPE_CUSTOM = 1; // 0x1
+ field public static final int TYPE_PAN = 65540; // 0x10004
+ }
+
+ public static final class Action.Builder {
+ ctor public Action.Builder();
+ ctor @androidx.car.app.annotations.RequiresCarApi(2) public Action.Builder(androidx.car.app.model.Action);
+ method public androidx.car.app.model.Action build();
+ method public androidx.car.app.model.Action.Builder setBackgroundColor(androidx.car.app.model.CarColor);
+ method public androidx.car.app.model.Action.Builder setIcon(androidx.car.app.model.CarIcon);
+ method public androidx.car.app.model.Action.Builder setOnClickListener(androidx.car.app.model.OnClickListener);
+ method public androidx.car.app.model.Action.Builder setTitle(CharSequence);
+ method public androidx.car.app.model.Action.Builder setTitle(androidx.car.app.model.CarText);
+ }
+
+ @androidx.car.app.annotations.CarProtocol public final class ActionStrip {
+ method public java.util.List<androidx.car.app.model.Action!> getActions();
+ method public androidx.car.app.model.Action? getFirstActionOfType(int);
+ }
+
+ public static final class ActionStrip.Builder {
+ ctor public ActionStrip.Builder();
+ method public androidx.car.app.model.ActionStrip.Builder addAction(androidx.car.app.model.Action);
+ method public androidx.car.app.model.ActionStrip build();
+ }
+
+ @androidx.car.app.annotations.CarProtocol public final class CarColor {
+ method public static androidx.car.app.model.CarColor createCustom(@ColorInt int, @ColorInt int);
+ method @ColorInt public int getColor();
+ method @ColorInt public int getColorDark();
+ method public int getType();
+ field public static final androidx.car.app.model.CarColor BLUE;
+ field public static final androidx.car.app.model.CarColor DEFAULT;
+ field public static final androidx.car.app.model.CarColor GREEN;
+ field public static final androidx.car.app.model.CarColor PRIMARY;
+ field public static final androidx.car.app.model.CarColor RED;
+ field public static final androidx.car.app.model.CarColor SECONDARY;
+ field public static final int TYPE_BLUE = 6; // 0x6
+ field public static final int TYPE_CUSTOM = 0; // 0x0
+ field public static final int TYPE_DEFAULT = 1; // 0x1
+ field public static final int TYPE_GREEN = 5; // 0x5
+ field public static final int TYPE_PRIMARY = 2; // 0x2
+ field public static final int TYPE_RED = 4; // 0x4
+ field public static final int TYPE_SECONDARY = 3; // 0x3
+ field public static final int TYPE_YELLOW = 7; // 0x7
+ field public static final androidx.car.app.model.CarColor YELLOW;
+ }
+
+ @androidx.car.app.annotations.CarProtocol public final class CarIcon {
+ method public androidx.core.graphics.drawable.IconCompat? getIcon();
+ method public androidx.car.app.model.CarColor? getTint();
+ method public int getType();
+ field public static final androidx.car.app.model.CarIcon ALERT;
+ field public static final androidx.car.app.model.CarIcon APP_ICON;
+ field public static final androidx.car.app.model.CarIcon BACK;
+ field public static final androidx.car.app.model.CarIcon ERROR;
+ field @androidx.car.app.annotations.RequiresCarApi(2) public static final androidx.car.app.model.CarIcon PAN;
+ field public static final int TYPE_ALERT = 4; // 0x4
+ field public static final int TYPE_APP_ICON = 5; // 0x5
+ field public static final int TYPE_BACK = 3; // 0x3
+ field public static final int TYPE_CUSTOM = 1; // 0x1
+ field public static final int TYPE_ERROR = 6; // 0x6
+ field public static final int TYPE_PAN = 7; // 0x7
+ }
+
+ public static final class CarIcon.Builder {
+ ctor public CarIcon.Builder(androidx.core.graphics.drawable.IconCompat);
+ ctor public CarIcon.Builder(androidx.car.app.model.CarIcon);
+ method public androidx.car.app.model.CarIcon build();
+ method public androidx.car.app.model.CarIcon.Builder setTint(androidx.car.app.model.CarColor);
+ }
+
+ @androidx.car.app.annotations.CarProtocol public final class CarIconSpan extends androidx.car.app.model.CarSpan {
+ method public static androidx.car.app.model.CarIconSpan create(androidx.car.app.model.CarIcon);
+ method public static androidx.car.app.model.CarIconSpan create(androidx.car.app.model.CarIcon, int);
+ method public int getAlignment();
+ method public androidx.car.app.model.CarIcon getIcon();
+ field public static final int ALIGN_BASELINE = 1; // 0x1
+ field public static final int ALIGN_BOTTOM = 0; // 0x0
+ field public static final int ALIGN_CENTER = 2; // 0x2
+ }
+
+ @androidx.car.app.annotations.CarProtocol public final class CarLocation {
+ method public static androidx.car.app.model.CarLocation create(double, double);
+ method public static androidx.car.app.model.CarLocation create(android.location.Location);
+ method public double getLatitude();
+ method public double getLongitude();
+ }
+
+ @Keep @androidx.car.app.annotations.CarProtocol public class CarSpan extends android.text.style.CharacterStyle {
+ ctor public CarSpan();
+ method public void updateDrawState(android.text.TextPaint);
+ }
+
+ @androidx.car.app.annotations.CarProtocol public final class CarText {
+ method public static androidx.car.app.model.CarText create(CharSequence);
+ method public java.util.List<java.lang.CharSequence!> getVariants();
+ method public boolean isEmpty();
+ method public static boolean isNullOrEmpty(androidx.car.app.model.CarText?);
+ method public CharSequence toCharSequence();
+ }
+
+ public static final class CarText.Builder {
+ ctor public CarText.Builder(CharSequence);
+ method @androidx.car.app.annotations.RequiresCarApi(2) public androidx.car.app.model.CarText.Builder addVariant(CharSequence);
+ method public androidx.car.app.model.CarText build();
+ }
+
+ @androidx.car.app.annotations.CarProtocol @androidx.car.app.annotations.RequiresCarApi(2) public final class ClickableSpan extends androidx.car.app.model.CarSpan {
+ method public static androidx.car.app.model.ClickableSpan create(androidx.car.app.model.OnClickListener);
+ method public androidx.car.app.model.OnClickDelegate getOnClickDelegate();
+ }
+
+ @androidx.car.app.annotations.CarProtocol public final class DateTimeWithZone {
+ method public static androidx.car.app.model.DateTimeWithZone create(long, @IntRange(from=0xffff02e0, to=64800) int, String);
+ method public static androidx.car.app.model.DateTimeWithZone create(long, java.util.TimeZone);
+ method @RequiresApi(26) public static androidx.car.app.model.DateTimeWithZone create(java.time.ZonedDateTime);
+ method public long getTimeSinceEpochMillis();
+ method public int getZoneOffsetSeconds();
+ method public String? getZoneShortName();
+ }
+
+ @androidx.car.app.annotations.CarProtocol public final class Distance {
+ method public static androidx.car.app.model.Distance create(double, int);
+ method public double getDisplayDistance();
+ method public int getDisplayUnit();
+ field public static final int UNIT_FEET = 6; // 0x6
+ field public static final int UNIT_KILOMETERS = 2; // 0x2
+ field public static final int UNIT_KILOMETERS_P1 = 3; // 0x3
+ field public static final int UNIT_METERS = 1; // 0x1
+ field public static final int UNIT_MILES = 4; // 0x4
+ field public static final int UNIT_MILES_P1 = 5; // 0x5
+ field public static final int UNIT_YARDS = 7; // 0x7
+ }
+
+ @androidx.car.app.annotations.CarProtocol public final class DistanceSpan extends androidx.car.app.model.CarSpan {
+ method public static androidx.car.app.model.DistanceSpan create(androidx.car.app.model.Distance);
+ method public androidx.car.app.model.Distance getDistance();
+ }
+
+ @androidx.car.app.annotations.CarProtocol public final class DurationSpan extends androidx.car.app.model.CarSpan {
+ method public static androidx.car.app.model.DurationSpan create(long);
+ method @RequiresApi(26) public static androidx.car.app.model.DurationSpan create(java.time.Duration);
+ method public long getDurationSeconds();
+ }
+
+ @androidx.car.app.annotations.CarProtocol public final class ForegroundCarColorSpan extends androidx.car.app.model.CarSpan {
+ method public static androidx.car.app.model.ForegroundCarColorSpan create(androidx.car.app.model.CarColor);
+ method public androidx.car.app.model.CarColor getColor();
+ }
+
+ @androidx.car.app.annotations.CarProtocol public final class GridItem implements androidx.car.app.model.Item {
+ method public androidx.car.app.model.CarIcon? getImage();
+ method public int getImageType();
+ method public androidx.car.app.model.OnClickDelegate? getOnClickDelegate();
+ method public androidx.car.app.model.CarText? getText();
+ method public androidx.car.app.model.CarText? getTitle();
+ method public boolean isLoading();
+ field public static final int IMAGE_TYPE_ICON = 1; // 0x1
+ field public static final int IMAGE_TYPE_LARGE = 2; // 0x2
+ }
+
+ public static final class GridItem.Builder {
+ ctor public GridItem.Builder();
+ method public androidx.car.app.model.GridItem build();
+ method public androidx.car.app.model.GridItem.Builder setImage(androidx.car.app.model.CarIcon);
+ method public androidx.car.app.model.GridItem.Builder setImage(androidx.car.app.model.CarIcon, int);
+ method public androidx.car.app.model.GridItem.Builder setLoading(boolean);
+ method public androidx.car.app.model.GridItem.Builder setOnClickListener(androidx.car.app.model.OnClickListener);
+ method public androidx.car.app.model.GridItem.Builder setText(CharSequence);
+ method public androidx.car.app.model.GridItem.Builder setText(androidx.car.app.model.CarText);
+ method public androidx.car.app.model.GridItem.Builder setTitle(CharSequence);
+ method public androidx.car.app.model.GridItem.Builder setTitle(androidx.car.app.model.CarText);
+ }
+
+ @androidx.car.app.annotations.CarProtocol public final class GridTemplate implements androidx.car.app.model.Template {
+ method public androidx.car.app.model.ActionStrip? getActionStrip();
+ method public androidx.car.app.model.Action? getHeaderAction();
+ method public androidx.car.app.model.ItemList? getSingleList();
+ method public androidx.car.app.model.CarText? getTitle();
+ method public boolean isLoading();
+ }
+
+ public static final class GridTemplate.Builder {
+ ctor public GridTemplate.Builder();
+ method public androidx.car.app.model.GridTemplate build();
+ method public androidx.car.app.model.GridTemplate.Builder setActionStrip(androidx.car.app.model.ActionStrip);
+ method public androidx.car.app.model.GridTemplate.Builder setHeaderAction(androidx.car.app.model.Action);
+ method public androidx.car.app.model.GridTemplate.Builder setLoading(boolean);
+ method public androidx.car.app.model.GridTemplate.Builder setSingleList(androidx.car.app.model.ItemList);
+ method public androidx.car.app.model.GridTemplate.Builder setTitle(CharSequence);
+ }
+
+ @androidx.car.app.annotations.RequiresCarApi(2) public interface InputCallback {
+ method public default void onInputSubmitted(String);
+ method public default void onInputTextChanged(String);
+ }
+
+ @androidx.car.app.annotations.RequiresCarApi(2) public interface InputCallbackDelegate {
+ method public void sendInputSubmitted(String, androidx.car.app.OnDoneCallback);
+ method public void sendInputTextChanged(String, androidx.car.app.OnDoneCallback);
+ }
+
+ @androidx.car.app.annotations.CarProtocol public interface Item {
+ }
+
+ @androidx.car.app.annotations.CarProtocol public final class ItemList {
+ method public java.util.List<androidx.car.app.model.Item!> getItems();
+ method public androidx.car.app.model.CarText? getNoItemsMessage();
+ method public androidx.car.app.model.OnItemVisibilityChangedDelegate? getOnItemVisibilityChangedDelegate();
+ method public androidx.car.app.model.OnSelectedDelegate? getOnSelectedDelegate();
+ method public int getSelectedIndex();
+ }
+
+ public static final class ItemList.Builder {
+ ctor public ItemList.Builder();
+ method public androidx.car.app.model.ItemList.Builder addItem(androidx.car.app.model.Item);
+ method public androidx.car.app.model.ItemList build();
+ method public androidx.car.app.model.ItemList.Builder setNoItemsMessage(CharSequence);
+ method public androidx.car.app.model.ItemList.Builder setOnItemsVisibilityChangedListener(androidx.car.app.model.ItemList.OnItemVisibilityChangedListener);
+ method public androidx.car.app.model.ItemList.Builder setOnSelectedListener(androidx.car.app.model.ItemList.OnSelectedListener);
+ method public androidx.car.app.model.ItemList.Builder setSelectedIndex(@IntRange(from=0) int);
+ }
+
+ public static interface ItemList.OnItemVisibilityChangedListener {
+ method public void onItemVisibilityChanged(int, int);
+ }
+
+ public static interface ItemList.OnSelectedListener {
+ method public void onSelected(int);
+ }
+
+ @androidx.car.app.annotations.CarProtocol public final class ListTemplate implements androidx.car.app.model.Template {
+ method public androidx.car.app.model.ActionStrip? getActionStrip();
+ method public androidx.car.app.model.Action? getHeaderAction();
+ method public java.util.List<androidx.car.app.model.SectionedItemList!> getSectionedLists();
+ method public androidx.car.app.model.ItemList? getSingleList();
+ method public androidx.car.app.model.CarText? getTitle();
+ method public boolean isLoading();
+ }
+
+ public static final class ListTemplate.Builder {
+ ctor public ListTemplate.Builder();
+ method public androidx.car.app.model.ListTemplate.Builder addSectionedList(androidx.car.app.model.SectionedItemList);
+ method public androidx.car.app.model.ListTemplate build();
+ method public androidx.car.app.model.ListTemplate.Builder setActionStrip(androidx.car.app.model.ActionStrip);
+ method public androidx.car.app.model.ListTemplate.Builder setHeaderAction(androidx.car.app.model.Action);
+ method public androidx.car.app.model.ListTemplate.Builder setLoading(boolean);
+ method public androidx.car.app.model.ListTemplate.Builder setSingleList(androidx.car.app.model.ItemList);
+ method public androidx.car.app.model.ListTemplate.Builder setTitle(CharSequence);
+ }
+
+ @androidx.car.app.annotations.RequiresCarApi(2) public final class LongMessageTemplate implements androidx.car.app.model.Template {
+ method public androidx.car.app.model.ActionStrip? getActionStrip();
+ method public java.util.List<androidx.car.app.model.Action!> getActions();
+ method public androidx.car.app.model.Action? getHeaderAction();
+ method public androidx.car.app.model.CarText getMessage();
+ method public androidx.car.app.model.CarText? getTitle();
+ }
+
+ @androidx.car.app.annotations.RequiresCarApi(2) public static final class LongMessageTemplate.Builder {
+ ctor public LongMessageTemplate.Builder(CharSequence);
+ method public androidx.car.app.model.LongMessageTemplate.Builder addAction(androidx.car.app.model.Action);
+ method public androidx.car.app.model.LongMessageTemplate build();
+ method public androidx.car.app.model.LongMessageTemplate.Builder setActionStrip(androidx.car.app.model.ActionStrip);
+ method public androidx.car.app.model.LongMessageTemplate.Builder setHeaderAction(androidx.car.app.model.Action);
+ method public androidx.car.app.model.LongMessageTemplate.Builder setTitle(CharSequence);
+ }
+
+ @androidx.car.app.annotations.CarProtocol public final class MessageTemplate implements androidx.car.app.model.Template {
+ method @androidx.car.app.annotations.RequiresCarApi(2) public androidx.car.app.model.ActionStrip? getActionStrip();
+ method public java.util.List<androidx.car.app.model.Action!> getActions();
+ method public androidx.car.app.model.CarText? getDebugMessage();
+ method public androidx.car.app.model.Action? getHeaderAction();
+ method public androidx.car.app.model.CarIcon? getIcon();
+ method public androidx.car.app.model.CarText getMessage();
+ method public androidx.car.app.model.CarText? getTitle();
+ method @androidx.car.app.annotations.RequiresCarApi(2) public boolean isLoading();
+ }
+
+ public static final class MessageTemplate.Builder {
+ ctor public MessageTemplate.Builder(CharSequence);
+ ctor public MessageTemplate.Builder(androidx.car.app.model.CarText);
+ method public androidx.car.app.model.MessageTemplate.Builder addAction(androidx.car.app.model.Action);
+ method public androidx.car.app.model.MessageTemplate build();
+ method @androidx.car.app.annotations.RequiresCarApi(2) public androidx.car.app.model.MessageTemplate.Builder setActionStrip(androidx.car.app.model.ActionStrip);
+ method public androidx.car.app.model.MessageTemplate.Builder setDebugMessage(Throwable);
+ method public androidx.car.app.model.MessageTemplate.Builder setDebugMessage(String);
+ method public androidx.car.app.model.MessageTemplate.Builder setHeaderAction(androidx.car.app.model.Action);
+ method public androidx.car.app.model.MessageTemplate.Builder setIcon(androidx.car.app.model.CarIcon);
+ method @androidx.car.app.annotations.RequiresCarApi(2) public androidx.car.app.model.MessageTemplate.Builder setLoading(boolean);
+ method public androidx.car.app.model.MessageTemplate.Builder setTitle(CharSequence);
+ }
+
+ @androidx.car.app.annotations.CarProtocol public final class Metadata {
+ method public androidx.car.app.model.Place? getPlace();
+ field public static final androidx.car.app.model.Metadata EMPTY_METADATA;
+ }
+
+ public static final class Metadata.Builder {
+ ctor public Metadata.Builder();
+ ctor public Metadata.Builder(androidx.car.app.model.Metadata);
+ method public androidx.car.app.model.Metadata build();
+ method public androidx.car.app.model.Metadata.Builder setPlace(androidx.car.app.model.Place);
+ }
+
+ @androidx.car.app.annotations.CarProtocol public interface OnCheckedChangeDelegate {
+ method public void sendCheckedChange(boolean, androidx.car.app.OnDoneCallback);
+ }
+
+ @androidx.car.app.annotations.CarProtocol public interface OnClickDelegate {
+ method public boolean isParkedOnly();
+ method public void sendClick(androidx.car.app.OnDoneCallback);
+ }
+
+ public interface OnClickListener {
+ method public void onClick();
+ }
+
+ @androidx.car.app.annotations.CarProtocol public interface OnItemVisibilityChangedDelegate {
+ method public void sendItemVisibilityChanged(int, int, androidx.car.app.OnDoneCallback);
+ }
+
+ @androidx.car.app.annotations.CarProtocol public interface OnSelectedDelegate {
+ method public void sendSelected(int, androidx.car.app.OnDoneCallback);
+ }
+
+ @androidx.car.app.annotations.CarProtocol public final class Pane {
+ method public java.util.List<androidx.car.app.model.Action!> getActions();
+ method public java.util.List<androidx.car.app.model.Row!> getRows();
+ method public boolean isLoading();
+ }
+
+ public static final class Pane.Builder {
+ ctor public Pane.Builder();
+ method public androidx.car.app.model.Pane.Builder addAction(androidx.car.app.model.Action);
+ method public androidx.car.app.model.Pane.Builder addRow(androidx.car.app.model.Row);
+ method public androidx.car.app.model.Pane build();
+ method public androidx.car.app.model.Pane.Builder setLoading(boolean);
+ }
+
+ @androidx.car.app.annotations.CarProtocol public final class PaneTemplate implements androidx.car.app.model.Template {
+ method public androidx.car.app.model.ActionStrip? getActionStrip();
+ method public androidx.car.app.model.Action? getHeaderAction();
+ method public androidx.car.app.model.Pane getPane();
+ method public androidx.car.app.model.CarText? getTitle();
+ }
+
+ public static final class PaneTemplate.Builder {
+ ctor public PaneTemplate.Builder(androidx.car.app.model.Pane);
+ method public androidx.car.app.model.PaneTemplate build();
+ method public androidx.car.app.model.PaneTemplate.Builder setActionStrip(androidx.car.app.model.ActionStrip);
+ method public androidx.car.app.model.PaneTemplate.Builder setHeaderAction(androidx.car.app.model.Action);
+ method public androidx.car.app.model.PaneTemplate.Builder setTitle(CharSequence);
+ }
+
+ @androidx.car.app.annotations.CarProtocol public final class ParkedOnlyOnClickListener implements androidx.car.app.model.OnClickListener {
+ method public static androidx.car.app.model.ParkedOnlyOnClickListener create(androidx.car.app.model.OnClickListener);
+ method public void onClick();
+ }
+
+ @androidx.car.app.annotations.CarProtocol public final class Place {
+ method public androidx.car.app.model.CarLocation getLocation();
+ method public androidx.car.app.model.PlaceMarker? getMarker();
+ }
+
+ public static final class Place.Builder {
+ ctor public Place.Builder(androidx.car.app.model.CarLocation);
+ ctor public Place.Builder(androidx.car.app.model.Place);
+ method public androidx.car.app.model.Place build();
+ method public androidx.car.app.model.Place.Builder setMarker(androidx.car.app.model.PlaceMarker);
+ }
+
+ @androidx.car.app.annotations.CarProtocol public final class PlaceListMapTemplate implements androidx.car.app.model.Template {
+ method public androidx.car.app.model.ActionStrip? getActionStrip();
+ method public androidx.car.app.model.Place? getAnchor();
+ method public androidx.car.app.model.Action? getHeaderAction();
+ method public androidx.car.app.model.ItemList? getItemList();
+ method public androidx.car.app.model.CarText? getTitle();
+ method public boolean isCurrentLocationEnabled();
+ method public boolean isLoading();
+ }
+
+ public static final class PlaceListMapTemplate.Builder {
+ ctor public PlaceListMapTemplate.Builder();
+ method public androidx.car.app.model.PlaceListMapTemplate build();
+ method public androidx.car.app.model.PlaceListMapTemplate.Builder setActionStrip(androidx.car.app.model.ActionStrip);
+ method public androidx.car.app.model.PlaceListMapTemplate.Builder setAnchor(androidx.car.app.model.Place);
+ method public androidx.car.app.model.PlaceListMapTemplate.Builder setCurrentLocationEnabled(boolean);
+ method public androidx.car.app.model.PlaceListMapTemplate.Builder setHeaderAction(androidx.car.app.model.Action);
+ method public androidx.car.app.model.PlaceListMapTemplate.Builder setItemList(androidx.car.app.model.ItemList);
+ method public androidx.car.app.model.PlaceListMapTemplate.Builder setLoading(boolean);
+ method public androidx.car.app.model.PlaceListMapTemplate.Builder setTitle(CharSequence);
+ method public androidx.car.app.model.PlaceListMapTemplate.Builder setTitle(androidx.car.app.model.CarText);
+ }
+
+ @androidx.car.app.annotations.CarProtocol public final class PlaceMarker {
+ method public androidx.car.app.model.CarColor? getColor();
+ method public androidx.car.app.model.CarIcon? getIcon();
+ method public int getIconType();
+ method public androidx.car.app.model.CarText? getLabel();
+ field public static final int TYPE_ICON = 0; // 0x0
+ field public static final int TYPE_IMAGE = 1; // 0x1
+ }
+
+ public static final class PlaceMarker.Builder {
+ ctor public PlaceMarker.Builder();
+ method public androidx.car.app.model.PlaceMarker build();
+ method public androidx.car.app.model.PlaceMarker.Builder setColor(androidx.car.app.model.CarColor);
+ method public androidx.car.app.model.PlaceMarker.Builder setIcon(androidx.car.app.model.CarIcon, int);
+ method public androidx.car.app.model.PlaceMarker.Builder setLabel(CharSequence);
+ }
+
+ @androidx.car.app.annotations.CarProtocol public final class Row implements androidx.car.app.model.Item {
+ method public androidx.car.app.model.CarIcon? getImage();
+ method public androidx.car.app.model.Metadata? getMetadata();
+ method public androidx.car.app.model.OnClickDelegate? getOnClickDelegate();
+ method public int getRowImageType();
+ method public java.util.List<androidx.car.app.model.CarText!> getTexts();
+ method public androidx.car.app.model.CarText? getTitle();
+ method public androidx.car.app.model.Toggle? getToggle();
+ method public boolean isBrowsable();
+ method public androidx.car.app.model.Row row();
+ method public CharSequence yourBoat();
+ field public static final int IMAGE_TYPE_ICON = 4; // 0x4
+ field public static final int IMAGE_TYPE_LARGE = 2; // 0x2
+ field public static final int IMAGE_TYPE_SMALL = 1; // 0x1
+ }
+
+ public static final class Row.Builder {
+ ctor public Row.Builder();
+ method public androidx.car.app.model.Row.Builder addText(CharSequence);
+ method public androidx.car.app.model.Row.Builder addText(androidx.car.app.model.CarText);
+ method public androidx.car.app.model.Row build();
+ method public androidx.car.app.model.Row.Builder setBrowsable(boolean);
+ method public androidx.car.app.model.Row.Builder setImage(androidx.car.app.model.CarIcon);
+ method public androidx.car.app.model.Row.Builder setImage(androidx.car.app.model.CarIcon, int);
+ method public androidx.car.app.model.Row.Builder setMetadata(androidx.car.app.model.Metadata);
+ method public androidx.car.app.model.Row.Builder setOnClickListener(androidx.car.app.model.OnClickListener);
+ method public androidx.car.app.model.Row.Builder setTitle(CharSequence);
+ method public androidx.car.app.model.Row.Builder setTitle(androidx.car.app.model.CarText);
+ method public androidx.car.app.model.Row.Builder setToggle(androidx.car.app.model.Toggle);
+ }
+
+ @androidx.car.app.annotations.CarProtocol public interface SearchCallbackDelegate {
+ method public void sendSearchSubmitted(String, androidx.car.app.OnDoneCallback);
+ method public void sendSearchTextChanged(String, androidx.car.app.OnDoneCallback);
+ }
+
+ @androidx.car.app.annotations.CarProtocol public final class SearchTemplate implements androidx.car.app.model.Template {
+ method public androidx.car.app.model.ActionStrip? getActionStrip();
+ method public androidx.car.app.model.Action? getHeaderAction();
+ method public String? getInitialSearchText();
+ method public androidx.car.app.model.ItemList? getItemList();
+ method public androidx.car.app.model.SearchCallbackDelegate getSearchCallbackDelegate();
+ method public String? getSearchHint();
+ method public boolean isLoading();
+ method public boolean isShowKeyboardByDefault();
+ }
+
+ public static final class SearchTemplate.Builder {
+ ctor public SearchTemplate.Builder(androidx.car.app.model.SearchTemplate.SearchCallback);
+ method public androidx.car.app.model.SearchTemplate build();
+ method public androidx.car.app.model.SearchTemplate.Builder setActionStrip(androidx.car.app.model.ActionStrip);
+ method public androidx.car.app.model.SearchTemplate.Builder setHeaderAction(androidx.car.app.model.Action);
+ method public androidx.car.app.model.SearchTemplate.Builder setInitialSearchText(String);
+ method public androidx.car.app.model.SearchTemplate.Builder setItemList(androidx.car.app.model.ItemList);
+ method public androidx.car.app.model.SearchTemplate.Builder setLoading(boolean);
+ method public androidx.car.app.model.SearchTemplate.Builder setSearchHint(String);
+ method public androidx.car.app.model.SearchTemplate.Builder setShowKeyboardByDefault(boolean);
+ }
+
+ public static interface SearchTemplate.SearchCallback {
+ method public default void onSearchSubmitted(String);
+ method public default void onSearchTextChanged(String);
+ }
+
+ @androidx.car.app.annotations.CarProtocol public final class SectionedItemList {
+ method public static androidx.car.app.model.SectionedItemList create(androidx.car.app.model.ItemList, CharSequence);
+ method public androidx.car.app.model.CarText getHeader();
+ method public androidx.car.app.model.ItemList getItemList();
+ }
+
+ @androidx.car.app.annotations.CarProtocol public interface Template {
+ }
+
+ @androidx.car.app.annotations.CarProtocol public final class TemplateInfo {
+ ctor public TemplateInfo(Class<? extends androidx.car.app.model.Template>, String);
+ method public Class<? extends androidx.car.app.model.Template> getTemplateClass();
+ method public String getTemplateId();
+ }
+
+ @androidx.car.app.annotations.CarProtocol public final class TemplateWrapper {
+ method public static androidx.car.app.model.TemplateWrapper copyOf(androidx.car.app.model.TemplateWrapper);
+ method public int getCurrentTaskStep();
+ method public String getId();
+ method public androidx.car.app.model.Template getTemplate();
+ method public java.util.List<androidx.car.app.model.TemplateInfo!> getTemplateInfosForScreenStack();
+ method public boolean isRefresh();
+ method public void setCurrentTaskStep(int);
+ method public void setId(String);
+ method public void setRefresh(boolean);
+ method public void setTemplate(androidx.car.app.model.Template);
+ method public static androidx.car.app.model.TemplateWrapper wrap(androidx.car.app.model.Template);
+ method public static androidx.car.app.model.TemplateWrapper wrap(androidx.car.app.model.Template, String);
+ }
+
+ @androidx.car.app.annotations.CarProtocol public final class Toggle {
+ method public androidx.car.app.model.OnCheckedChangeDelegate getOnCheckedChangeDelegate();
+ method public boolean isChecked();
+ }
+
+ public static final class Toggle.Builder {
+ ctor public Toggle.Builder(androidx.car.app.model.Toggle.OnCheckedChangeListener);
+ method public androidx.car.app.model.Toggle build();
+ method public androidx.car.app.model.Toggle.Builder setChecked(boolean);
+ }
+
+ public static interface Toggle.OnCheckedChangeListener {
+ method public void onCheckedChange(boolean);
+ }
+
+}
+
+package androidx.car.app.model.signin {
+
+ @androidx.car.app.annotations.RequiresCarApi(2) public final class InputSignInMethod implements androidx.car.app.model.signin.SignInTemplate.SignInMethod {
+ method public androidx.car.app.model.CarText? getDefaultValue();
+ method public androidx.car.app.model.CarText? getErrorMessage();
+ method public androidx.car.app.model.CarText? getHint();
+ method public androidx.car.app.model.InputCallbackDelegate getInputCallbackDelegate();
+ method public int getInputType();
+ method public int getKeyboardType();
+ method public boolean isShowKeyboardByDefault();
+ field public static final int INPUT_TYPE_DEFAULT = 1; // 0x1
+ field public static final int INPUT_TYPE_PASSWORD = 2; // 0x2
+ field public static final int KEYBOARD_DEFAULT = 1; // 0x1
+ field public static final int KEYBOARD_EMAIL = 2; // 0x2
+ field public static final int KEYBOARD_NUMBER = 4; // 0x4
+ field public static final int KEYBOARD_PHONE = 3; // 0x3
+ }
+
+ public static final class InputSignInMethod.Builder {
+ ctor public InputSignInMethod.Builder(androidx.car.app.model.InputCallback);
+ method public androidx.car.app.model.signin.InputSignInMethod build();
+ method public androidx.car.app.model.signin.InputSignInMethod.Builder setDefaultValue(String);
+ method public androidx.car.app.model.signin.InputSignInMethod.Builder setErrorMessage(CharSequence);
+ method public androidx.car.app.model.signin.InputSignInMethod.Builder setHint(CharSequence);
+ method public androidx.car.app.model.signin.InputSignInMethod.Builder setInputType(int);
+ method public androidx.car.app.model.signin.InputSignInMethod.Builder setKeyboardType(int);
+ method public androidx.car.app.model.signin.InputSignInMethod.Builder setShowKeyboardByDefault(boolean);
+ }
+
+ @androidx.car.app.annotations.RequiresCarApi(2) public final class PinSignInMethod implements androidx.car.app.model.signin.SignInTemplate.SignInMethod {
+ ctor public PinSignInMethod(CharSequence);
+ method public androidx.car.app.model.CarText getPinCode();
+ }
+
+ @androidx.car.app.annotations.RequiresCarApi(2) public final class ProviderSignInMethod implements androidx.car.app.model.signin.SignInTemplate.SignInMethod {
+ ctor public ProviderSignInMethod(androidx.car.app.model.Action);
+ method public androidx.car.app.model.Action getAction();
+ }
+
+ @androidx.car.app.annotations.RequiresCarApi(2) public final class SignInTemplate implements androidx.car.app.model.Template {
+ method public androidx.car.app.model.ActionStrip? getActionStrip();
+ method public java.util.List<androidx.car.app.model.Action!> getActions();
+ method public androidx.car.app.model.CarText? getAdditionalText();
+ method public androidx.car.app.model.Action? getHeaderAction();
+ method public androidx.car.app.model.CarText? getInstructions();
+ method public androidx.car.app.model.signin.SignInTemplate.SignInMethod getSignInMethod();
+ method public androidx.car.app.model.CarText? getTitle();
+ method public boolean isLoading();
+ }
+
+ @androidx.car.app.annotations.RequiresCarApi(2) public static final class SignInTemplate.Builder {
+ ctor public SignInTemplate.Builder(androidx.car.app.model.signin.SignInTemplate.SignInMethod);
+ method public androidx.car.app.model.signin.SignInTemplate.Builder addAction(androidx.car.app.model.Action);
+ method public androidx.car.app.model.signin.SignInTemplate build();
+ method public androidx.car.app.model.signin.SignInTemplate.Builder setActionStrip(androidx.car.app.model.ActionStrip);
+ method public androidx.car.app.model.signin.SignInTemplate.Builder setAdditionalText(CharSequence);
+ method public androidx.car.app.model.signin.SignInTemplate.Builder setHeaderAction(androidx.car.app.model.Action);
+ method public androidx.car.app.model.signin.SignInTemplate.Builder setInstructions(CharSequence);
+ method public androidx.car.app.model.signin.SignInTemplate.Builder setLoading(boolean);
+ method public androidx.car.app.model.signin.SignInTemplate.Builder setTitle(CharSequence);
+ }
+
+ public static interface SignInTemplate.SignInMethod {
+ }
+
+}
+
+package androidx.car.app.navigation {
+
+ public class NavigationManager implements androidx.car.app.managers.Manager {
+ method @MainThread public void clearNavigationManagerCallback();
+ method @MainThread public void navigationEnded();
+ method @MainThread public void navigationStarted();
+ method @MainThread public void setNavigationManagerCallback(androidx.car.app.navigation.NavigationManagerCallback);
+ method @MainThread public void setNavigationManagerCallback(java.util.concurrent.Executor, androidx.car.app.navigation.NavigationManagerCallback);
+ method @MainThread public void updateTrip(androidx.car.app.navigation.model.Trip);
+ }
+
+ public interface NavigationManagerCallback {
+ method public default void onAutoDriveEnabled();
+ method public default void onStopNavigation();
+ }
+
+}
+
+package androidx.car.app.navigation.model {
+
+ @androidx.car.app.annotations.CarProtocol public final class Destination {
+ method public androidx.car.app.model.CarText? getAddress();
+ method public androidx.car.app.model.CarIcon? getImage();
+ method public androidx.car.app.model.CarText? getName();
+ }
+
+ public static final class Destination.Builder {
+ ctor public Destination.Builder();
+ method public androidx.car.app.navigation.model.Destination build();
+ method public androidx.car.app.navigation.model.Destination.Builder setAddress(CharSequence);
+ method public androidx.car.app.navigation.model.Destination.Builder setImage(androidx.car.app.model.CarIcon);
+ method public androidx.car.app.navigation.model.Destination.Builder setName(CharSequence);
+ }
+
+ @androidx.car.app.annotations.CarProtocol public final class Lane {
+ method public java.util.List<androidx.car.app.navigation.model.LaneDirection!> getDirections();
+ }
+
+ public static final class Lane.Builder {
+ ctor public Lane.Builder();
+ method public androidx.car.app.navigation.model.Lane.Builder addDirection(androidx.car.app.navigation.model.LaneDirection);
+ method public androidx.car.app.navigation.model.Lane build();
+ }
+
+ @androidx.car.app.annotations.CarProtocol public final class LaneDirection {
+ method public static androidx.car.app.navigation.model.LaneDirection create(int, boolean);
+ method public int getShape();
+ method public boolean isRecommended();
+ field public static final int SHAPE_NORMAL_LEFT = 5; // 0x5
+ field public static final int SHAPE_NORMAL_RIGHT = 6; // 0x6
+ field public static final int SHAPE_SHARP_LEFT = 7; // 0x7
+ field public static final int SHAPE_SHARP_RIGHT = 8; // 0x8
+ field public static final int SHAPE_SLIGHT_LEFT = 3; // 0x3
+ field public static final int SHAPE_SLIGHT_RIGHT = 4; // 0x4
+ field public static final int SHAPE_STRAIGHT = 2; // 0x2
+ field public static final int SHAPE_UNKNOWN = 1; // 0x1
+ field public static final int SHAPE_U_TURN_LEFT = 9; // 0x9
+ field public static final int SHAPE_U_TURN_RIGHT = 10; // 0xa
+ }
+
+ @androidx.car.app.annotations.CarProtocol public final class Maneuver {
+ method public androidx.car.app.model.CarIcon? getIcon();
+ method public int getRoundaboutExitAngle();
+ method public int getRoundaboutExitNumber();
+ method public int getType();
+ field public static final int TYPE_DEPART = 1; // 0x1
+ field public static final int TYPE_DESTINATION = 39; // 0x27
+ field public static final int TYPE_DESTINATION_LEFT = 41; // 0x29
+ field public static final int TYPE_DESTINATION_RIGHT = 42; // 0x2a
+ field public static final int TYPE_DESTINATION_STRAIGHT = 40; // 0x28
+ field public static final int TYPE_FERRY_BOAT = 37; // 0x25
+ field public static final int TYPE_FERRY_BOAT_LEFT = 47; // 0x2f
+ field public static final int TYPE_FERRY_BOAT_RIGHT = 48; // 0x30
+ field public static final int TYPE_FERRY_TRAIN = 38; // 0x26
+ field public static final int TYPE_FERRY_TRAIN_LEFT = 49; // 0x31
+ field public static final int TYPE_FERRY_TRAIN_RIGHT = 50; // 0x32
+ field public static final int TYPE_FORK_LEFT = 25; // 0x19
+ field public static final int TYPE_FORK_RIGHT = 26; // 0x1a
+ field public static final int TYPE_KEEP_LEFT = 3; // 0x3
+ field public static final int TYPE_KEEP_RIGHT = 4; // 0x4
+ field public static final int TYPE_MERGE_LEFT = 27; // 0x1b
+ field public static final int TYPE_MERGE_RIGHT = 28; // 0x1c
+ field public static final int TYPE_MERGE_SIDE_UNSPECIFIED = 29; // 0x1d
+ field public static final int TYPE_NAME_CHANGE = 2; // 0x2
+ field public static final int TYPE_OFF_RAMP_NORMAL_LEFT = 23; // 0x17
+ field public static final int TYPE_OFF_RAMP_NORMAL_RIGHT = 24; // 0x18
+ field public static final int TYPE_OFF_RAMP_SLIGHT_LEFT = 21; // 0x15
+ field public static final int TYPE_OFF_RAMP_SLIGHT_RIGHT = 22; // 0x16
+ field public static final int TYPE_ON_RAMP_NORMAL_LEFT = 15; // 0xf
+ field public static final int TYPE_ON_RAMP_NORMAL_RIGHT = 16; // 0x10
+ field public static final int TYPE_ON_RAMP_SHARP_LEFT = 17; // 0x11
+ field public static final int TYPE_ON_RAMP_SHARP_RIGHT = 18; // 0x12
+ field public static final int TYPE_ON_RAMP_SLIGHT_LEFT = 13; // 0xd
+ field public static final int TYPE_ON_RAMP_SLIGHT_RIGHT = 14; // 0xe
+ field public static final int TYPE_ON_RAMP_U_TURN_LEFT = 19; // 0x13
+ field public static final int TYPE_ON_RAMP_U_TURN_RIGHT = 20; // 0x14
+ field public static final int TYPE_ROUNDABOUT_ENTER_AND_EXIT_CCW = 34; // 0x22
+ field public static final int TYPE_ROUNDABOUT_ENTER_AND_EXIT_CCW_WITH_ANGLE = 35; // 0x23
+ field public static final int TYPE_ROUNDABOUT_ENTER_AND_EXIT_CW = 32; // 0x20
+ field public static final int TYPE_ROUNDABOUT_ENTER_AND_EXIT_CW_WITH_ANGLE = 33; // 0x21
+ field public static final int TYPE_ROUNDABOUT_ENTER_CCW = 45; // 0x2d
+ field public static final int TYPE_ROUNDABOUT_ENTER_CW = 43; // 0x2b
+ field public static final int TYPE_ROUNDABOUT_EXIT_CCW = 46; // 0x2e
+ field public static final int TYPE_ROUNDABOUT_EXIT_CW = 44; // 0x2c
+ field public static final int TYPE_STRAIGHT = 36; // 0x24
+ field public static final int TYPE_TURN_NORMAL_LEFT = 7; // 0x7
+ field public static final int TYPE_TURN_NORMAL_RIGHT = 8; // 0x8
+ field public static final int TYPE_TURN_SHARP_LEFT = 9; // 0x9
+ field public static final int TYPE_TURN_SHARP_RIGHT = 10; // 0xa
+ field public static final int TYPE_TURN_SLIGHT_LEFT = 5; // 0x5
+ field public static final int TYPE_TURN_SLIGHT_RIGHT = 6; // 0x6
+ field public static final int TYPE_UNKNOWN = 0; // 0x0
+ field public static final int TYPE_U_TURN_LEFT = 11; // 0xb
+ field public static final int TYPE_U_TURN_RIGHT = 12; // 0xc
+ }
+
+ public static final class Maneuver.Builder {
+ ctor public Maneuver.Builder(int);
+ method public androidx.car.app.navigation.model.Maneuver build();
+ method public androidx.car.app.navigation.model.Maneuver.Builder setIcon(androidx.car.app.model.CarIcon);
+ method public androidx.car.app.navigation.model.Maneuver.Builder setRoundaboutExitAngle(@IntRange(from=1, to=360) int);
+ method public androidx.car.app.navigation.model.Maneuver.Builder setRoundaboutExitNumber(@IntRange(from=1) int);
+ }
+
+ @androidx.car.app.annotations.CarProtocol public final class MessageInfo implements androidx.car.app.navigation.model.NavigationTemplate.NavigationInfo {
+ method public androidx.car.app.model.CarIcon? getImage();
+ method public androidx.car.app.model.CarText? getText();
+ method public androidx.car.app.model.CarText? getTitle();
+ }
+
+ public static final class MessageInfo.Builder {
+ ctor public MessageInfo.Builder(CharSequence);
+ ctor public MessageInfo.Builder(androidx.car.app.model.CarText);
+ method public androidx.car.app.navigation.model.MessageInfo build();
+ method public androidx.car.app.navigation.model.MessageInfo.Builder setImage(androidx.car.app.model.CarIcon);
+ method public androidx.car.app.navigation.model.MessageInfo.Builder setText(CharSequence);
+ method public androidx.car.app.navigation.model.MessageInfo.Builder setText(androidx.car.app.model.CarText);
+ method public androidx.car.app.navigation.model.MessageInfo.Builder setTitle(CharSequence);
+ }
+
+ @androidx.car.app.annotations.CarProtocol public final class NavigationTemplate implements androidx.car.app.model.Template {
+ method public androidx.car.app.model.ActionStrip? getActionStrip();
+ method public androidx.car.app.model.CarColor? getBackgroundColor();
+ method public androidx.car.app.navigation.model.TravelEstimate? getDestinationTravelEstimate();
+ method @androidx.car.app.annotations.RequiresCarApi(2) public androidx.car.app.model.ActionStrip? getMapActionStrip();
+ method public androidx.car.app.navigation.model.NavigationTemplate.NavigationInfo? getNavigationInfo();
+ method @androidx.car.app.annotations.RequiresCarApi(2) public androidx.car.app.navigation.model.PanModeDelegate? getPanModeDelegate();
+ method @Deprecated @androidx.car.app.annotations.RequiresCarApi(2) public androidx.car.app.model.Toggle? getPanModeToggle();
+ }
+
+ public static final class NavigationTemplate.Builder {
+ ctor public NavigationTemplate.Builder();
+ method public androidx.car.app.navigation.model.NavigationTemplate build();
+ method public androidx.car.app.navigation.model.NavigationTemplate.Builder setActionStrip(androidx.car.app.model.ActionStrip);
+ method public androidx.car.app.navigation.model.NavigationTemplate.Builder setBackgroundColor(androidx.car.app.model.CarColor);
+ method public androidx.car.app.navigation.model.NavigationTemplate.Builder setDestinationTravelEstimate(androidx.car.app.navigation.model.TravelEstimate);
+ method @androidx.car.app.annotations.RequiresCarApi(2) public androidx.car.app.navigation.model.NavigationTemplate.Builder setMapActionStrip(androidx.car.app.model.ActionStrip);
+ method public androidx.car.app.navigation.model.NavigationTemplate.Builder setNavigationInfo(androidx.car.app.navigation.model.NavigationTemplate.NavigationInfo);
+ method @androidx.car.app.annotations.RequiresCarApi(2) public androidx.car.app.navigation.model.NavigationTemplate.Builder setPanModeListener(androidx.car.app.navigation.model.PanModeListener);
+ }
+
+ public static interface NavigationTemplate.NavigationInfo {
+ }
+
+ @androidx.car.app.annotations.CarProtocol @androidx.car.app.annotations.RequiresCarApi(2) public interface PanModeDelegate {
+ method public void sendPanModeChanged(boolean, androidx.car.app.OnDoneCallback);
+ }
+
+ public interface PanModeListener {
+ method public void onPanModeChanged(boolean);
+ }
+
+ @androidx.car.app.annotations.CarProtocol public final class PlaceListNavigationTemplate implements androidx.car.app.model.Template {
+ method public androidx.car.app.model.ActionStrip? getActionStrip();
+ method public androidx.car.app.model.Action? getHeaderAction();
+ method public androidx.car.app.model.ItemList? getItemList();
+ method public androidx.car.app.model.CarText? getTitle();
+ method public boolean isLoading();
+ }
+
+ public static final class PlaceListNavigationTemplate.Builder {
+ ctor public PlaceListNavigationTemplate.Builder();
+ method public androidx.car.app.navigation.model.PlaceListNavigationTemplate build();
+ method public androidx.car.app.navigation.model.PlaceListNavigationTemplate.Builder setActionStrip(androidx.car.app.model.ActionStrip);
+ method public androidx.car.app.navigation.model.PlaceListNavigationTemplate.Builder setHeaderAction(androidx.car.app.model.Action);
+ method public androidx.car.app.navigation.model.PlaceListNavigationTemplate.Builder setItemList(androidx.car.app.model.ItemList);
+ method public androidx.car.app.navigation.model.PlaceListNavigationTemplate.Builder setLoading(boolean);
+ method public androidx.car.app.navigation.model.PlaceListNavigationTemplate.Builder setTitle(CharSequence);
+ method public androidx.car.app.navigation.model.PlaceListNavigationTemplate.Builder setTitle(androidx.car.app.model.CarText);
+ }
+
+ @androidx.car.app.annotations.CarProtocol public final class RoutePreviewNavigationTemplate implements androidx.car.app.model.Template {
+ method public androidx.car.app.model.ActionStrip? getActionStrip();
+ method public androidx.car.app.model.Action? getHeaderAction();
+ method public androidx.car.app.model.ItemList? getItemList();
+ method public androidx.car.app.model.Action? getNavigateAction();
+ method public androidx.car.app.model.CarText? getTitle();
+ method public boolean isLoading();
+ }
+
+ public static final class RoutePreviewNavigationTemplate.Builder {
+ ctor public RoutePreviewNavigationTemplate.Builder();
+ method public androidx.car.app.navigation.model.RoutePreviewNavigationTemplate build();
+ method public androidx.car.app.navigation.model.RoutePreviewNavigationTemplate.Builder setActionStrip(androidx.car.app.model.ActionStrip);
+ method public androidx.car.app.navigation.model.RoutePreviewNavigationTemplate.Builder setHeaderAction(androidx.car.app.model.Action);
+ method public androidx.car.app.navigation.model.RoutePreviewNavigationTemplate.Builder setItemList(androidx.car.app.model.ItemList);
+ method public androidx.car.app.navigation.model.RoutePreviewNavigationTemplate.Builder setLoading(boolean);
+ method public androidx.car.app.navigation.model.RoutePreviewNavigationTemplate.Builder setNavigateAction(androidx.car.app.model.Action);
+ method public androidx.car.app.navigation.model.RoutePreviewNavigationTemplate.Builder setTitle(CharSequence);
+ method public androidx.car.app.navigation.model.RoutePreviewNavigationTemplate.Builder setTitle(androidx.car.app.model.CarText);
+ }
+
+ @androidx.car.app.annotations.CarProtocol public final class RoutingInfo implements androidx.car.app.navigation.model.NavigationTemplate.NavigationInfo {
+ method public androidx.car.app.model.Distance? getCurrentDistance();
+ method public androidx.car.app.navigation.model.Step? getCurrentStep();
+ method public androidx.car.app.model.CarIcon? getJunctionImage();
+ method public androidx.car.app.navigation.model.Step? getNextStep();
+ method public boolean isLoading();
+ }
+
+ public static final class RoutingInfo.Builder {
+ ctor public RoutingInfo.Builder();
+ method public androidx.car.app.navigation.model.RoutingInfo build();
+ method public androidx.car.app.navigation.model.RoutingInfo.Builder setCurrentStep(androidx.car.app.navigation.model.Step, androidx.car.app.model.Distance);
+ method public androidx.car.app.navigation.model.RoutingInfo.Builder setJunctionImage(androidx.car.app.model.CarIcon);
+ method public androidx.car.app.navigation.model.RoutingInfo.Builder setLoading(boolean);
+ method public androidx.car.app.navigation.model.RoutingInfo.Builder setNextStep(androidx.car.app.navigation.model.Step);
+ }
+
+ @androidx.car.app.annotations.CarProtocol public final class Step {
+ method public androidx.car.app.model.CarText? getCue();
+ method public java.util.List<androidx.car.app.navigation.model.Lane!> getLanes();
+ method public androidx.car.app.model.CarIcon? getLanesImage();
+ method public androidx.car.app.navigation.model.Maneuver? getManeuver();
+ method public androidx.car.app.model.CarText? getRoad();
+ }
+
+ public static final class Step.Builder {
+ ctor public Step.Builder();
+ ctor public Step.Builder(CharSequence);
+ ctor public Step.Builder(androidx.car.app.model.CarText);
+ method public androidx.car.app.navigation.model.Step.Builder addLane(androidx.car.app.navigation.model.Lane);
+ method public androidx.car.app.navigation.model.Step build();
+ method public androidx.car.app.navigation.model.Step.Builder setCue(CharSequence);
+ method public androidx.car.app.navigation.model.Step.Builder setLanesImage(androidx.car.app.model.CarIcon);
+ method public androidx.car.app.navigation.model.Step.Builder setManeuver(androidx.car.app.navigation.model.Maneuver);
+ method public androidx.car.app.navigation.model.Step.Builder setRoad(CharSequence);
+ }
+
+ @androidx.car.app.annotations.CarProtocol public final class TravelEstimate {
+ method public androidx.car.app.model.DateTimeWithZone? getArrivalTimeAtDestination();
+ method public androidx.car.app.model.Distance? getRemainingDistance();
+ method public androidx.car.app.model.CarColor? getRemainingDistanceColor();
+ method public androidx.car.app.model.CarColor? getRemainingTimeColor();
+ method public long getRemainingTimeSeconds();
+ field public static final long REMAINING_TIME_UNKNOWN = -1L; // 0xffffffffffffffffL
+ }
+
+ public static final class TravelEstimate.Builder {
+ ctor public TravelEstimate.Builder(androidx.car.app.model.Distance, androidx.car.app.model.DateTimeWithZone);
+ ctor @RequiresApi(26) public TravelEstimate.Builder(androidx.car.app.model.Distance, java.time.ZonedDateTime);
+ method public androidx.car.app.navigation.model.TravelEstimate build();
+ method public androidx.car.app.navigation.model.TravelEstimate.Builder setRemainingDistanceColor(androidx.car.app.model.CarColor);
+ method @RequiresApi(26) public androidx.car.app.navigation.model.TravelEstimate.Builder setRemainingTime(java.time.Duration);
+ method public androidx.car.app.navigation.model.TravelEstimate.Builder setRemainingTimeColor(androidx.car.app.model.CarColor);
+ method public androidx.car.app.navigation.model.TravelEstimate.Builder setRemainingTimeSeconds(@IntRange(from=0xffffffff) long);
+ }
+
+ @androidx.car.app.annotations.CarProtocol public final class Trip {
+ method public androidx.car.app.model.CarText? getCurrentRoad();
+ method public java.util.List<androidx.car.app.navigation.model.TravelEstimate!> getDestinationTravelEstimates();
+ method public java.util.List<androidx.car.app.navigation.model.Destination!> getDestinations();
+ method public java.util.List<androidx.car.app.navigation.model.TravelEstimate!> getStepTravelEstimates();
+ method public java.util.List<androidx.car.app.navigation.model.Step!> getSteps();
+ method public boolean isLoading();
+ }
+
+ public static final class Trip.Builder {
+ ctor public Trip.Builder();
+ method public androidx.car.app.navigation.model.Trip.Builder addDestination(androidx.car.app.navigation.model.Destination, androidx.car.app.navigation.model.TravelEstimate);
+ method public androidx.car.app.navigation.model.Trip.Builder addStep(androidx.car.app.navigation.model.Step, androidx.car.app.navigation.model.TravelEstimate);
+ method public androidx.car.app.navigation.model.Trip build();
+ method public androidx.car.app.navigation.model.Trip.Builder setCurrentRoad(CharSequence);
+ method public androidx.car.app.navigation.model.Trip.Builder setLoading(boolean);
+ }
+
+}
+
+package androidx.car.app.notification {
+
+ public final class CarAppExtender implements androidx.core.app.NotificationCompat.Extender {
+ ctor public CarAppExtender(android.app.Notification);
+ method public androidx.core.app.NotificationCompat.Builder extend(androidx.core.app.NotificationCompat.Builder);
+ method public java.util.List<android.app.Notification.Action!> getActions();
+ method public String? getChannelId();
+ method public androidx.car.app.model.CarColor? getColor();
+ method public android.app.PendingIntent? getContentIntent();
+ method public CharSequence? getContentText();
+ method public CharSequence? getContentTitle();
+ method public android.app.PendingIntent? getDeleteIntent();
+ method public int getImportance();
+ method public android.graphics.Bitmap? getLargeIcon();
+ method @DrawableRes public int getSmallIcon();
+ method public static boolean isExtended(android.app.Notification);
+ }
+
+ public static final class CarAppExtender.Builder {
+ ctor public CarAppExtender.Builder();
+ method public androidx.car.app.notification.CarAppExtender.Builder addAction(@DrawableRes int, CharSequence, android.app.PendingIntent);
+ method public androidx.car.app.notification.CarAppExtender build();
+ method public androidx.car.app.notification.CarAppExtender.Builder setChannelId(String);
+ method public androidx.car.app.notification.CarAppExtender.Builder setColor(androidx.car.app.model.CarColor);
+ method public androidx.car.app.notification.CarAppExtender.Builder setContentIntent(android.app.PendingIntent);
+ method public androidx.car.app.notification.CarAppExtender.Builder setContentText(CharSequence);
+ method public androidx.car.app.notification.CarAppExtender.Builder setContentTitle(CharSequence);
+ method public androidx.car.app.notification.CarAppExtender.Builder setDeleteIntent(android.app.PendingIntent);
+ method public androidx.car.app.notification.CarAppExtender.Builder setImportance(int);
+ method public androidx.car.app.notification.CarAppExtender.Builder setLargeIcon(android.graphics.Bitmap);
+ method public androidx.car.app.notification.CarAppExtender.Builder setSmallIcon(int);
+ }
+
+ public final class CarNotificationManager {
+ method public boolean areNotificationsEnabled();
+ method public void cancel(int);
+ method public void cancel(String?, int);
+ method public void cancelAll();
+ method public void createNotificationChannel(androidx.core.app.NotificationChannelCompat);
+ method public void createNotificationChannelGroup(androidx.core.app.NotificationChannelGroupCompat);
+ method public void createNotificationChannelGroups(java.util.List<androidx.core.app.NotificationChannelGroupCompat!>);
+ method public void createNotificationChannels(java.util.List<androidx.core.app.NotificationChannelCompat!>);
+ method public void deleteNotificationChannel(String);
+ method public void deleteNotificationChannelGroup(String);
+ method public void deleteUnlistedNotificationChannels(java.util.Collection<java.lang.String!>);
+ method public static androidx.car.app.notification.CarNotificationManager from(android.content.Context);
+ method public static java.util.Set<java.lang.String!> getEnabledListenerPackages(android.content.Context);
+ method public int getImportance();
+ method public androidx.core.app.NotificationChannelCompat? getNotificationChannel(String);
+ method public androidx.core.app.NotificationChannelCompat? getNotificationChannel(String, String);
+ method public androidx.core.app.NotificationChannelGroupCompat? getNotificationChannelGroup(String);
+ method public java.util.List<androidx.core.app.NotificationChannelGroupCompat!> getNotificationChannelGroups();
+ method public java.util.List<androidx.core.app.NotificationChannelCompat!> getNotificationChannels();
+ method public void notify(int, androidx.core.app.NotificationCompat.Builder);
+ method public void notify(String?, int, androidx.core.app.NotificationCompat.Builder);
+ }
+
+ public final class CarPendingIntent {
+ method public static android.app.PendingIntent getCarApp(android.content.Context, int, android.content.Intent, int);
+ }
+
+}
+
+package androidx.car.app.serialization {
+
+ public final class Bundleable implements android.os.Parcelable {
+ method public static androidx.car.app.serialization.Bundleable create(Object) throws androidx.car.app.serialization.BundlerException;
+ method public int describeContents();
+ method public Object get() throws androidx.car.app.serialization.BundlerException;
+ method public void writeToParcel(android.os.Parcel, int);
+ field public static final android.os.Parcelable.Creator<androidx.car.app.serialization.Bundleable!> CREATOR;
+ }
+
+ public class BundlerException extends java.lang.Exception {
+ ctor public BundlerException(String?, Throwable);
+ ctor public BundlerException(String?);
+ }
+
+}
+
+package androidx.car.app.validation {
+
+ public final class HostValidator {
+ method public java.util.Map<java.lang.String!,java.util.List<java.lang.String!>!> getAllowedHosts();
+ method public boolean isValidHost(androidx.car.app.HostInfo);
+ field public static final androidx.car.app.validation.HostValidator ALLOW_ALL_HOSTS_VALIDATOR;
+ field public static final String TEMPLATE_RENDERER_PERMISSION = "android.car.permission.TEMPLATE_RENDERER";
+ }
+
+ public static final class HostValidator.Builder {
+ ctor public HostValidator.Builder(android.content.Context);
+ method public androidx.car.app.validation.HostValidator.Builder addAllowedHost(String, String);
+ method public androidx.car.app.validation.HostValidator.Builder addAllowedHosts(@ArrayRes int);
+ method public androidx.car.app.validation.HostValidator build();
+ }
+
+}
+
+package androidx.car.app.versioning {
+
+ public final class CarAppApiLevels {
+ method public static int getLatest();
+ method public static int getOldest();
+ field public static final int LEVEL_1 = 1; // 0x1
+ field public static final int LEVEL_2 = 2; // 0x2
+ field public static final int LEVEL_3 = 3; // 0x3
+ }
+
+}
+
diff --git a/car/app/app/api/public_plus_experimental_1.1.0-beta01.txt b/car/app/app/api/public_plus_experimental_1.1.0-beta01.txt
new file mode 100644
index 0000000..e43b6f474
--- /dev/null
+++ b/car/app/app/api/public_plus_experimental_1.1.0-beta01.txt
@@ -0,0 +1,1424 @@
+// Signature format: 4.0
+package androidx.car.app {
+
+ @androidx.car.app.annotations.CarProtocol public final class AppInfo {
+ ctor @VisibleForTesting public AppInfo(int, int, String);
+ method public int getLatestCarAppApiLevel();
+ method public String getLibraryDisplayVersion();
+ method public int getMinCarAppApiLevel();
+ field public static final String MIN_API_LEVEL_METADATA_KEY = "androidx.car.app.minCarApiLevel";
+ }
+
+ public class AppManager implements androidx.car.app.managers.Manager {
+ method public void invalidate();
+ method public void setSurfaceCallback(androidx.car.app.SurfaceCallback?);
+ method public void showToast(CharSequence, int);
+ }
+
+ public final class CarAppPermission {
+ method public static void checkHasLibraryPermission(android.content.Context, String);
+ method public static void checkHasPermission(android.content.Context, String);
+ field public static final String ACCESS_SURFACE = "androidx.car.app.ACCESS_SURFACE";
+ field public static final String MAP_TEMPLATES = "androidx.car.app.MAP_TEMPLATES";
+ field public static final String NAVIGATION_TEMPLATES = "androidx.car.app.NAVIGATION_TEMPLATES";
+ }
+
+ public abstract class CarAppService extends android.app.Service {
+ ctor public CarAppService();
+ method public abstract androidx.car.app.validation.HostValidator createHostValidator();
+ method @CallSuper public final void dump(java.io.FileDescriptor, java.io.PrintWriter, String![]?);
+ method public final androidx.car.app.Session? getCurrentSession();
+ method public final androidx.car.app.HostInfo? getHostInfo();
+ method @CallSuper public final android.os.IBinder onBind(android.content.Intent);
+ method public abstract androidx.car.app.Session onCreateSession();
+ method public final boolean onUnbind(android.content.Intent);
+ field public static final String CATEGORY_CHARGING_APP = "androidx.car.app.category.CHARGING";
+ field public static final String CATEGORY_NAVIGATION_APP = "androidx.car.app.category.NAVIGATION";
+ field public static final String CATEGORY_PARKING_APP = "androidx.car.app.category.PARKING";
+ field public static final String SERVICE_INTERFACE = "androidx.car.app.CarAppService";
+ }
+
+ public class CarContext extends android.content.ContextWrapper {
+ method public void finishCarApp();
+ method @androidx.car.app.annotations.RequiresCarApi(2) public android.content.ComponentName? getCallingComponent();
+ method public int getCarAppApiLevel();
+ method public Object getCarService(String);
+ method public <T> T getCarService(Class<T!>);
+ method public String getCarServiceName(Class<?>);
+ method public androidx.car.app.HostInfo? getHostInfo();
+ method public androidx.activity.OnBackPressedDispatcher getOnBackPressedDispatcher();
+ method public boolean isDarkMode();
+ method public void requestPermissions(java.util.List<java.lang.String!>, androidx.car.app.OnRequestPermissionsListener);
+ method public void requestPermissions(java.util.List<java.lang.String!>, java.util.concurrent.Executor, androidx.car.app.OnRequestPermissionsListener);
+ method @androidx.car.app.annotations.RequiresCarApi(2) public void setCarAppResult(int, android.content.Intent?);
+ method public void startCarApp(android.content.Intent);
+ method @Deprecated public static void startCarApp(android.content.Intent, android.content.Intent);
+ field public static final String ACTION_NAVIGATE = "androidx.car.app.action.NAVIGATE";
+ field public static final String APP_SERVICE = "app";
+ field public static final String CAR_SERVICE = "car";
+ field @androidx.car.app.annotations.RequiresCarApi(2) public static final String CONSTRAINT_SERVICE = "constraints";
+ field public static final String EXTRA_START_CAR_APP_BINDER_KEY = "androidx.car.app.extra.START_CAR_APP_BINDER_KEY";
+ field @androidx.car.app.annotations.RequiresCarApi(3) public static final String HARDWARE_SERVICE = "hardware";
+ field public static final String NAVIGATION_SERVICE = "navigation";
+ field public static final String SCREEN_SERVICE = "screen";
+ }
+
+ public final class CarToast {
+ method public static androidx.car.app.CarToast makeText(androidx.car.app.CarContext, @StringRes int, int);
+ method public static androidx.car.app.CarToast makeText(androidx.car.app.CarContext, CharSequence, int);
+ method public void setDuration(int);
+ method public void setText(@StringRes int);
+ method public void setText(CharSequence);
+ method public void show();
+ field public static final int LENGTH_LONG = 1; // 0x1
+ field public static final int LENGTH_SHORT = 0; // 0x0
+ }
+
+ @androidx.car.app.annotations.CarProtocol public final class FailureResponse {
+ ctor public FailureResponse(Throwable);
+ method public int getErrorType();
+ method public String getStackTrace();
+ field public static final int BUNDLER_EXCEPTION = 1; // 0x1
+ field public static final int ILLEGAL_STATE_EXCEPTION = 2; // 0x2
+ field public static final int INVALID_PARAMETER_EXCEPTION = 3; // 0x3
+ field public static final int REMOTE_EXCEPTION = 6; // 0x6
+ field public static final int RUNTIME_EXCEPTION = 5; // 0x5
+ field public static final int SECURITY_EXCEPTION = 4; // 0x4
+ field public static final int UNKNOWN_ERROR = 0; // 0x0
+ }
+
+ @androidx.car.app.annotations.CarProtocol public final class HandshakeInfo {
+ ctor public HandshakeInfo(String, int);
+ method public int getHostCarAppApiLevel();
+ method public String getHostPackageName();
+ }
+
+ public final class HostException extends java.lang.RuntimeException {
+ ctor public HostException(String);
+ ctor public HostException(String, Throwable);
+ ctor public HostException(Throwable);
+ }
+
+ public final class HostInfo {
+ ctor public HostInfo(String, int);
+ method public String getPackageName();
+ method public int getUid();
+ }
+
+ @androidx.car.app.annotations.CarProtocol public interface OnDoneCallback {
+ method public default void onFailure(androidx.car.app.serialization.Bundleable);
+ method public default void onSuccess(androidx.car.app.serialization.Bundleable?);
+ }
+
+ public interface OnRequestPermissionsListener {
+ method public void onRequestPermissionsResult(java.util.List<java.lang.String!>, java.util.List<java.lang.String!>);
+ }
+
+ public interface OnScreenResultListener {
+ method public void onScreenResult(Object?);
+ }
+
+ public abstract class Screen implements androidx.lifecycle.LifecycleOwner {
+ ctor protected Screen(androidx.car.app.CarContext);
+ method public final void finish();
+ method public final androidx.car.app.CarContext getCarContext();
+ method public final androidx.lifecycle.Lifecycle getLifecycle();
+ method public String? getMarker();
+ method public final androidx.car.app.ScreenManager getScreenManager();
+ method public final void invalidate();
+ method public abstract androidx.car.app.model.Template onGetTemplate();
+ method public void setMarker(String?);
+ method public void setResult(Object?);
+ }
+
+ @MainThread public class ScreenManager implements androidx.car.app.managers.Manager {
+ method public int getStackSize();
+ method public androidx.car.app.Screen getTop();
+ method public void pop();
+ method public void popTo(String);
+ method public void popToRoot();
+ method public void push(androidx.car.app.Screen);
+ method public void pushForResult(androidx.car.app.Screen, androidx.car.app.OnScreenResultListener);
+ method public void remove(androidx.car.app.Screen);
+ }
+
+ public abstract class Session implements androidx.lifecycle.LifecycleOwner {
+ ctor public Session();
+ method public final androidx.car.app.CarContext getCarContext();
+ method public androidx.lifecycle.Lifecycle getLifecycle();
+ method public void onCarConfigurationChanged(android.content.res.Configuration);
+ method public abstract androidx.car.app.Screen onCreateScreen(android.content.Intent);
+ method public void onNewIntent(android.content.Intent);
+ }
+
+ public interface SurfaceCallback {
+ method @androidx.car.app.annotations.RequiresCarApi(2) public default void onFling(float, float);
+ method @androidx.car.app.annotations.RequiresCarApi(2) public default void onScale(float, float, float);
+ method @androidx.car.app.annotations.RequiresCarApi(2) public default void onScroll(float, float);
+ method public default void onStableAreaChanged(android.graphics.Rect);
+ method public default void onSurfaceAvailable(androidx.car.app.SurfaceContainer);
+ method public default void onSurfaceDestroyed(androidx.car.app.SurfaceContainer);
+ method public default void onVisibleAreaChanged(android.graphics.Rect);
+ }
+
+ @androidx.car.app.annotations.CarProtocol public final class SurfaceContainer {
+ ctor public SurfaceContainer(android.view.Surface?, int, int, int);
+ method public int getDpi();
+ method public int getHeight();
+ method public android.view.Surface? getSurface();
+ method public int getWidth();
+ }
+
+}
+
+package androidx.car.app.annotations {
+
+ @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @java.lang.annotation.Target({java.lang.annotation.ElementType.TYPE, java.lang.annotation.ElementType.PARAMETER}) public @interface CarProtocol {
+ }
+
+ @RequiresOptIn @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.TYPE, java.lang.annotation.ElementType.CONSTRUCTOR, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.METHOD}) public @interface ExperimentalCarApi {
+ }
+
+ @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.RUNTIME) @java.lang.annotation.Target({java.lang.annotation.ElementType.TYPE, java.lang.annotation.ElementType.CONSTRUCTOR, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.METHOD}) public @interface RequiresCarApi {
+ method public abstract int value();
+ }
+
+}
+
+package androidx.car.app.connection {
+
+ public final class CarConnection {
+ ctor public CarConnection(android.content.Context);
+ method public androidx.lifecycle.LiveData<java.lang.Integer!> getType();
+ field public static final String ACTION_CAR_CONNECTION_UPDATED = "androidx.car.app.connection.action.CAR_CONNECTION_UPDATED";
+ field public static final String CAR_CONNECTION_STATE = "CarConnectionState";
+ field public static final int CONNECTION_TYPE_NATIVE = 1; // 0x1
+ field public static final int CONNECTION_TYPE_NOT_CONNECTED = 0; // 0x0
+ field public static final int CONNECTION_TYPE_PROJECTION = 2; // 0x2
+ }
+
+}
+
+package androidx.car.app.constraints {
+
+ @androidx.car.app.annotations.RequiresCarApi(2) public class ConstraintManager implements androidx.car.app.managers.Manager {
+ method public int getContentLimit(int);
+ field public static final int CONTENT_LIMIT_TYPE_GRID = 1; // 0x1
+ field public static final int CONTENT_LIMIT_TYPE_LIST = 0; // 0x0
+ field public static final int CONTENT_LIMIT_TYPE_PANE = 4; // 0x4
+ field public static final int CONTENT_LIMIT_TYPE_PLACE_LIST = 2; // 0x2
+ field public static final int CONTENT_LIMIT_TYPE_ROUTE_LIST = 3; // 0x3
+ }
+
+}
+
+package androidx.car.app.hardware {
+
+ @MainThread @androidx.car.app.annotations.RequiresCarApi(3) public interface CarHardwareManager extends androidx.car.app.managers.Manager {
+ method public default androidx.car.app.hardware.info.CarInfo getCarInfo();
+ method public default androidx.car.app.hardware.info.CarSensors getCarSensors();
+ }
+
+}
+
+package androidx.car.app.hardware.common {
+
+ @androidx.car.app.annotations.CarProtocol @androidx.car.app.annotations.RequiresCarApi(3) public final class CarUnit {
+ field public static final int KILOMETER = 3; // 0x3
+ field public static final int KILOMETERS_PER_HOUR = 102; // 0x66
+ field public static final int METER = 2; // 0x2
+ field public static final int METERS_PER_SEC = 101; // 0x65
+ field public static final int MILE = 4; // 0x4
+ field public static final int MILES_PER_HOUR = 103; // 0x67
+ field public static final int MILLIMETER = 1; // 0x1
+ }
+
+ @androidx.car.app.annotations.CarProtocol @androidx.car.app.annotations.RequiresCarApi(3) public final class CarValue<T> {
+ ctor public CarValue(T?, long, int);
+ method public int getStatus();
+ method public long getTimestampMillis();
+ method public T? getValue();
+ field public static final int STATUS_SUCCESS = 1; // 0x1
+ field public static final int STATUS_UNAVAILABLE = 3; // 0x3
+ field public static final int STATUS_UNIMPLEMENTED = 2; // 0x2
+ field public static final int STATUS_UNKNOWN = 0; // 0x0
+ }
+
+ @androidx.car.app.annotations.CarProtocol @androidx.car.app.annotations.RequiresCarApi(3) public interface OnCarDataAvailableListener<T> {
+ method public void onCarDataAvailable(T);
+ }
+
+}
+
+package androidx.car.app.hardware.info {
+
+ @androidx.car.app.annotations.CarProtocol @androidx.car.app.annotations.RequiresCarApi(3) public final class Accelerometer {
+ ctor public Accelerometer(androidx.car.app.hardware.common.CarValue<java.util.List<java.lang.Float!>!>);
+ method public androidx.car.app.hardware.common.CarValue<java.util.List<java.lang.Float!>!> getForces();
+ }
+
+ @androidx.car.app.annotations.CarProtocol @androidx.car.app.annotations.RequiresCarApi(3) public final class CarHardwareLocation {
+ ctor public CarHardwareLocation(androidx.car.app.hardware.common.CarValue<android.location.Location!>);
+ method public androidx.car.app.hardware.common.CarValue<android.location.Location!> getLocation();
+ }
+
+ @MainThread @androidx.car.app.annotations.RequiresCarApi(3) public interface CarInfo {
+ method public void addEnergyLevelListener(java.util.concurrent.Executor, androidx.car.app.hardware.common.OnCarDataAvailableListener<androidx.car.app.hardware.info.EnergyLevel!>);
+ method public void addMileageListener(java.util.concurrent.Executor, androidx.car.app.hardware.common.OnCarDataAvailableListener<androidx.car.app.hardware.info.Mileage!>);
+ method public void addSpeedListener(java.util.concurrent.Executor, androidx.car.app.hardware.common.OnCarDataAvailableListener<androidx.car.app.hardware.info.Speed!>);
+ method public void addTollListener(java.util.concurrent.Executor, androidx.car.app.hardware.common.OnCarDataAvailableListener<androidx.car.app.hardware.info.TollCard!>);
+ method public void fetchEnergyProfile(java.util.concurrent.Executor, androidx.car.app.hardware.common.OnCarDataAvailableListener<androidx.car.app.hardware.info.EnergyProfile!>);
+ method public void fetchModel(java.util.concurrent.Executor, androidx.car.app.hardware.common.OnCarDataAvailableListener<androidx.car.app.hardware.info.Model!>);
+ method public void removeEnergyLevelListener(androidx.car.app.hardware.common.OnCarDataAvailableListener<androidx.car.app.hardware.info.EnergyLevel!>);
+ method public void removeMileageListener(androidx.car.app.hardware.common.OnCarDataAvailableListener<androidx.car.app.hardware.info.Mileage!>);
+ method public void removeSpeedListener(androidx.car.app.hardware.common.OnCarDataAvailableListener<androidx.car.app.hardware.info.Speed!>);
+ method public void removeTollListener(androidx.car.app.hardware.common.OnCarDataAvailableListener<androidx.car.app.hardware.info.TollCard!>);
+ }
+
+ @MainThread @androidx.car.app.annotations.RequiresCarApi(3) public interface CarSensors {
+ method public void addAccelerometerListener(int, java.util.concurrent.Executor, androidx.car.app.hardware.common.OnCarDataAvailableListener<androidx.car.app.hardware.info.Accelerometer!>);
+ method public void addCarHardwareLocationListener(int, java.util.concurrent.Executor, androidx.car.app.hardware.common.OnCarDataAvailableListener<androidx.car.app.hardware.info.CarHardwareLocation!>);
+ method public void addCompassListener(int, java.util.concurrent.Executor, androidx.car.app.hardware.common.OnCarDataAvailableListener<androidx.car.app.hardware.info.Compass!>);
+ method public void addGyroscopeListener(int, java.util.concurrent.Executor, androidx.car.app.hardware.common.OnCarDataAvailableListener<androidx.car.app.hardware.info.Gyroscope!>);
+ method public void removeAccelerometerListener(androidx.car.app.hardware.common.OnCarDataAvailableListener<androidx.car.app.hardware.info.Accelerometer!>);
+ method public void removeCarHardwareLocationListener(androidx.car.app.hardware.common.OnCarDataAvailableListener<androidx.car.app.hardware.info.CarHardwareLocation!>);
+ method public void removeCompassListener(androidx.car.app.hardware.common.OnCarDataAvailableListener<androidx.car.app.hardware.info.Compass!>);
+ method public void removeGyroscopeListener(androidx.car.app.hardware.common.OnCarDataAvailableListener<androidx.car.app.hardware.info.Gyroscope!>);
+ field public static final int UPDATE_RATE_FASTEST = 3; // 0x3
+ field public static final int UPDATE_RATE_NORMAL = 1; // 0x1
+ field public static final int UPDATE_RATE_UI = 2; // 0x2
+ }
+
+ @androidx.car.app.annotations.CarProtocol @androidx.car.app.annotations.RequiresCarApi(3) public final class Compass {
+ ctor public Compass(androidx.car.app.hardware.common.CarValue<java.util.List<java.lang.Float!>!>);
+ method public androidx.car.app.hardware.common.CarValue<java.util.List<java.lang.Float!>!> getOrientations();
+ }
+
+ @androidx.car.app.annotations.CarProtocol @androidx.car.app.annotations.RequiresCarApi(3) public final class EnergyLevel {
+ method public androidx.car.app.hardware.common.CarValue<java.lang.Float!> getBatteryPercent();
+ method public androidx.car.app.hardware.common.CarValue<java.lang.Integer!> getDistanceDisplayUnit();
+ method public androidx.car.app.hardware.common.CarValue<java.lang.Boolean!> getEnergyIsLow();
+ method public androidx.car.app.hardware.common.CarValue<java.lang.Float!> getFuelPercent();
+ method public androidx.car.app.hardware.common.CarValue<java.lang.Float!> getRangeRemainingMeters();
+ }
+
+ public static final class EnergyLevel.Builder {
+ ctor public EnergyLevel.Builder();
+ method public androidx.car.app.hardware.info.EnergyLevel build();
+ method public androidx.car.app.hardware.info.EnergyLevel.Builder setBatteryPercent(androidx.car.app.hardware.common.CarValue<java.lang.Float!>);
+ method public androidx.car.app.hardware.info.EnergyLevel.Builder setDistanceDisplayUnit(androidx.car.app.hardware.common.CarValue<java.lang.Integer!>);
+ method public androidx.car.app.hardware.info.EnergyLevel.Builder setEnergyIsLow(androidx.car.app.hardware.common.CarValue<java.lang.Boolean!>);
+ method public androidx.car.app.hardware.info.EnergyLevel.Builder setFuelPercent(androidx.car.app.hardware.common.CarValue<java.lang.Float!>);
+ method public androidx.car.app.hardware.info.EnergyLevel.Builder setRangeRemainingMeters(androidx.car.app.hardware.common.CarValue<java.lang.Float!>);
+ }
+
+ @androidx.car.app.annotations.CarProtocol @androidx.car.app.annotations.RequiresCarApi(3) public final class EnergyProfile {
+ method public androidx.car.app.hardware.common.CarValue<java.util.List<java.lang.Integer!>!> getEvConnectorTypes();
+ method public androidx.car.app.hardware.common.CarValue<java.util.List<java.lang.Integer!>!> getFuelTypes();
+ field public static final int EVCONNECTOR_TYPE_CHADEMO = 3; // 0x3
+ field public static final int EVCONNECTOR_TYPE_COMBO_1 = 4; // 0x4
+ field public static final int EVCONNECTOR_TYPE_COMBO_2 = 5; // 0x5
+ field public static final int EVCONNECTOR_TYPE_GBT = 9; // 0x9
+ field public static final int EVCONNECTOR_TYPE_GBT_DC = 10; // 0xa
+ field public static final int EVCONNECTOR_TYPE_J1772 = 1; // 0x1
+ field public static final int EVCONNECTOR_TYPE_MENNEKES = 2; // 0x2
+ field public static final int EVCONNECTOR_TYPE_OTHER = 101; // 0x65
+ field public static final int EVCONNECTOR_TYPE_SCAME = 11; // 0xb
+ field public static final int EVCONNECTOR_TYPE_TESLA_HPWC = 7; // 0x7
+ field public static final int EVCONNECTOR_TYPE_TESLA_ROADSTER = 6; // 0x6
+ field public static final int EVCONNECTOR_TYPE_TESLA_SUPERCHARGER = 8; // 0x8
+ field public static final int EVCONNECTOR_TYPE_UNKNOWN = 0; // 0x0
+ field public static final int FUEL_TYPE_BIODIESEL = 5; // 0x5
+ field public static final int FUEL_TYPE_CNG = 8; // 0x8
+ field public static final int FUEL_TYPE_DIESEL_1 = 3; // 0x3
+ field public static final int FUEL_TYPE_DIESEL_2 = 4; // 0x4
+ field public static final int FUEL_TYPE_E85 = 6; // 0x6
+ field public static final int FUEL_TYPE_ELECTRIC = 10; // 0xa
+ field public static final int FUEL_TYPE_HYDROGEN = 11; // 0xb
+ field public static final int FUEL_TYPE_LEADED = 2; // 0x2
+ field public static final int FUEL_TYPE_LNG = 9; // 0x9
+ field public static final int FUEL_TYPE_LPG = 7; // 0x7
+ field public static final int FUEL_TYPE_OTHER = 12; // 0xc
+ field public static final int FUEL_TYPE_UNKNOWN = 0; // 0x0
+ field public static final int FUEL_TYPE_UNLEADED = 1; // 0x1
+ }
+
+ public static final class EnergyProfile.Builder {
+ ctor public EnergyProfile.Builder();
+ method public androidx.car.app.hardware.info.EnergyProfile build();
+ method public androidx.car.app.hardware.info.EnergyProfile.Builder setEvConnectorTypes(androidx.car.app.hardware.common.CarValue<java.util.List<java.lang.Integer!>!>);
+ method public androidx.car.app.hardware.info.EnergyProfile.Builder setFuelTypes(androidx.car.app.hardware.common.CarValue<java.util.List<java.lang.Integer!>!>);
+ }
+
+ @androidx.car.app.annotations.CarProtocol @androidx.car.app.annotations.RequiresCarApi(3) public final class Gyroscope {
+ ctor public Gyroscope(androidx.car.app.hardware.common.CarValue<java.util.List<java.lang.Float!>!>);
+ method public androidx.car.app.hardware.common.CarValue<java.util.List<java.lang.Float!>!> getRotations();
+ }
+
+ @androidx.car.app.annotations.CarProtocol @androidx.car.app.annotations.RequiresCarApi(3) public final class Mileage {
+ method public androidx.car.app.hardware.common.CarValue<java.lang.Integer!> getDistanceDisplayUnit();
+ method public androidx.car.app.hardware.common.CarValue<java.lang.Float!> getOdometerMeters();
+ }
+
+ public static final class Mileage.Builder {
+ ctor public Mileage.Builder();
+ method public androidx.car.app.hardware.info.Mileage build();
+ method public androidx.car.app.hardware.info.Mileage.Builder setDistanceDisplayUnit(androidx.car.app.hardware.common.CarValue<java.lang.Integer!>);
+ method public androidx.car.app.hardware.info.Mileage.Builder setOdometerMeters(androidx.car.app.hardware.common.CarValue<java.lang.Float!>);
+ }
+
+ @androidx.car.app.annotations.CarProtocol @androidx.car.app.annotations.RequiresCarApi(3) public final class Model {
+ method public androidx.car.app.hardware.common.CarValue<java.lang.String!> getManufacturer();
+ method public androidx.car.app.hardware.common.CarValue<java.lang.String!> getName();
+ method public androidx.car.app.hardware.common.CarValue<java.lang.Integer!> getYear();
+ }
+
+ public static final class Model.Builder {
+ ctor public Model.Builder();
+ method public androidx.car.app.hardware.info.Model build();
+ method public androidx.car.app.hardware.info.Model.Builder setManufacturer(androidx.car.app.hardware.common.CarValue<java.lang.String!>);
+ method public androidx.car.app.hardware.info.Model.Builder setName(androidx.car.app.hardware.common.CarValue<java.lang.String!>);
+ method public androidx.car.app.hardware.info.Model.Builder setYear(androidx.car.app.hardware.common.CarValue<java.lang.Integer!>);
+ }
+
+ @androidx.car.app.annotations.CarProtocol @androidx.car.app.annotations.RequiresCarApi(3) public final class Speed {
+ method public androidx.car.app.hardware.common.CarValue<java.lang.Float!> getDisplaySpeedMetersPerSecond();
+ method public androidx.car.app.hardware.common.CarValue<java.lang.Float!> getRawSpeedMetersPerSecond();
+ method public androidx.car.app.hardware.common.CarValue<java.lang.Integer!> getSpeedDisplayUnit();
+ }
+
+ public static final class Speed.Builder {
+ ctor public Speed.Builder();
+ method public androidx.car.app.hardware.info.Speed build();
+ method public androidx.car.app.hardware.info.Speed.Builder setDisplaySpeedMetersPerSecond(androidx.car.app.hardware.common.CarValue<java.lang.Float!>);
+ method public androidx.car.app.hardware.info.Speed.Builder setRawSpeedMetersPerSecond(androidx.car.app.hardware.common.CarValue<java.lang.Float!>);
+ method public androidx.car.app.hardware.info.Speed.Builder setSpeedDisplayUnit(androidx.car.app.hardware.common.CarValue<java.lang.Integer!>);
+ }
+
+ @androidx.car.app.annotations.CarProtocol @androidx.car.app.annotations.RequiresCarApi(3) public final class TollCard {
+ method public androidx.car.app.hardware.common.CarValue<java.lang.Integer!> getCardState();
+ field public static final int TOLLCARD_STATE_INVALID = 2; // 0x2
+ field public static final int TOLLCARD_STATE_NOT_INSERTED = 3; // 0x3
+ field public static final int TOLLCARD_STATE_UNKNOWN = 0; // 0x0
+ field public static final int TOLLCARD_STATE_VALID = 1; // 0x1
+ }
+
+ public static final class TollCard.Builder {
+ ctor public TollCard.Builder();
+ method public androidx.car.app.hardware.info.TollCard build();
+ method public androidx.car.app.hardware.info.TollCard.Builder setCardState(androidx.car.app.hardware.common.CarValue<java.lang.Integer!>);
+ }
+
+}
+
+package androidx.car.app.managers {
+
+ public interface Manager {
+ }
+
+}
+
+package androidx.car.app.model {
+
+ @androidx.car.app.annotations.CarProtocol public final class Action {
+ method public androidx.car.app.model.CarColor? getBackgroundColor();
+ method public androidx.car.app.model.CarIcon? getIcon();
+ method public androidx.car.app.model.OnClickDelegate? getOnClickDelegate();
+ method public androidx.car.app.model.CarText? getTitle();
+ method public int getType();
+ method public boolean isStandard();
+ method public static String typeToString(int);
+ field public static final androidx.car.app.model.Action APP_ICON;
+ field public static final androidx.car.app.model.Action BACK;
+ field public static final androidx.car.app.model.Action PAN;
+ field public static final int TYPE_APP_ICON = 65538; // 0x10002
+ field public static final int TYPE_BACK = 65539; // 0x10003
+ field public static final int TYPE_CUSTOM = 1; // 0x1
+ field public static final int TYPE_PAN = 65540; // 0x10004
+ }
+
+ public static final class Action.Builder {
+ ctor public Action.Builder();
+ ctor @androidx.car.app.annotations.RequiresCarApi(2) public Action.Builder(androidx.car.app.model.Action);
+ method public androidx.car.app.model.Action build();
+ method public androidx.car.app.model.Action.Builder setBackgroundColor(androidx.car.app.model.CarColor);
+ method public androidx.car.app.model.Action.Builder setIcon(androidx.car.app.model.CarIcon);
+ method public androidx.car.app.model.Action.Builder setOnClickListener(androidx.car.app.model.OnClickListener);
+ method public androidx.car.app.model.Action.Builder setTitle(CharSequence);
+ method public androidx.car.app.model.Action.Builder setTitle(androidx.car.app.model.CarText);
+ }
+
+ @androidx.car.app.annotations.CarProtocol public final class ActionStrip {
+ method public java.util.List<androidx.car.app.model.Action!> getActions();
+ method public androidx.car.app.model.Action? getFirstActionOfType(int);
+ }
+
+ public static final class ActionStrip.Builder {
+ ctor public ActionStrip.Builder();
+ method public androidx.car.app.model.ActionStrip.Builder addAction(androidx.car.app.model.Action);
+ method public androidx.car.app.model.ActionStrip build();
+ }
+
+ @androidx.car.app.annotations.CarProtocol public final class CarColor {
+ method public static androidx.car.app.model.CarColor createCustom(@ColorInt int, @ColorInt int);
+ method @ColorInt public int getColor();
+ method @ColorInt public int getColorDark();
+ method public int getType();
+ field public static final androidx.car.app.model.CarColor BLUE;
+ field public static final androidx.car.app.model.CarColor DEFAULT;
+ field public static final androidx.car.app.model.CarColor GREEN;
+ field public static final androidx.car.app.model.CarColor PRIMARY;
+ field public static final androidx.car.app.model.CarColor RED;
+ field public static final androidx.car.app.model.CarColor SECONDARY;
+ field public static final int TYPE_BLUE = 6; // 0x6
+ field public static final int TYPE_CUSTOM = 0; // 0x0
+ field public static final int TYPE_DEFAULT = 1; // 0x1
+ field public static final int TYPE_GREEN = 5; // 0x5
+ field public static final int TYPE_PRIMARY = 2; // 0x2
+ field public static final int TYPE_RED = 4; // 0x4
+ field public static final int TYPE_SECONDARY = 3; // 0x3
+ field public static final int TYPE_YELLOW = 7; // 0x7
+ field public static final androidx.car.app.model.CarColor YELLOW;
+ }
+
+ @androidx.car.app.annotations.CarProtocol public final class CarIcon {
+ method public androidx.core.graphics.drawable.IconCompat? getIcon();
+ method public androidx.car.app.model.CarColor? getTint();
+ method public int getType();
+ field public static final androidx.car.app.model.CarIcon ALERT;
+ field public static final androidx.car.app.model.CarIcon APP_ICON;
+ field public static final androidx.car.app.model.CarIcon BACK;
+ field public static final androidx.car.app.model.CarIcon ERROR;
+ field @androidx.car.app.annotations.RequiresCarApi(2) public static final androidx.car.app.model.CarIcon PAN;
+ field public static final int TYPE_ALERT = 4; // 0x4
+ field public static final int TYPE_APP_ICON = 5; // 0x5
+ field public static final int TYPE_BACK = 3; // 0x3
+ field public static final int TYPE_CUSTOM = 1; // 0x1
+ field public static final int TYPE_ERROR = 6; // 0x6
+ field public static final int TYPE_PAN = 7; // 0x7
+ }
+
+ public static final class CarIcon.Builder {
+ ctor public CarIcon.Builder(androidx.core.graphics.drawable.IconCompat);
+ ctor public CarIcon.Builder(androidx.car.app.model.CarIcon);
+ method public androidx.car.app.model.CarIcon build();
+ method public androidx.car.app.model.CarIcon.Builder setTint(androidx.car.app.model.CarColor);
+ }
+
+ @androidx.car.app.annotations.CarProtocol public final class CarIconSpan extends androidx.car.app.model.CarSpan {
+ method public static androidx.car.app.model.CarIconSpan create(androidx.car.app.model.CarIcon);
+ method public static androidx.car.app.model.CarIconSpan create(androidx.car.app.model.CarIcon, int);
+ method public int getAlignment();
+ method public androidx.car.app.model.CarIcon getIcon();
+ field public static final int ALIGN_BASELINE = 1; // 0x1
+ field public static final int ALIGN_BOTTOM = 0; // 0x0
+ field public static final int ALIGN_CENTER = 2; // 0x2
+ }
+
+ @androidx.car.app.annotations.CarProtocol public final class CarLocation {
+ method public static androidx.car.app.model.CarLocation create(double, double);
+ method public static androidx.car.app.model.CarLocation create(android.location.Location);
+ method public double getLatitude();
+ method public double getLongitude();
+ }
+
+ @Keep @androidx.car.app.annotations.CarProtocol public class CarSpan extends android.text.style.CharacterStyle {
+ ctor public CarSpan();
+ method public void updateDrawState(android.text.TextPaint);
+ }
+
+ @androidx.car.app.annotations.CarProtocol public final class CarText {
+ method public static androidx.car.app.model.CarText create(CharSequence);
+ method public java.util.List<java.lang.CharSequence!> getVariants();
+ method public boolean isEmpty();
+ method public static boolean isNullOrEmpty(androidx.car.app.model.CarText?);
+ method public CharSequence toCharSequence();
+ }
+
+ public static final class CarText.Builder {
+ ctor public CarText.Builder(CharSequence);
+ method @androidx.car.app.annotations.RequiresCarApi(2) public androidx.car.app.model.CarText.Builder addVariant(CharSequence);
+ method public androidx.car.app.model.CarText build();
+ }
+
+ @androidx.car.app.annotations.CarProtocol @androidx.car.app.annotations.RequiresCarApi(2) public final class ClickableSpan extends androidx.car.app.model.CarSpan {
+ method public static androidx.car.app.model.ClickableSpan create(androidx.car.app.model.OnClickListener);
+ method public androidx.car.app.model.OnClickDelegate getOnClickDelegate();
+ }
+
+ @androidx.car.app.annotations.CarProtocol public final class DateTimeWithZone {
+ method public static androidx.car.app.model.DateTimeWithZone create(long, @IntRange(from=0xffff02e0, to=64800) int, String);
+ method public static androidx.car.app.model.DateTimeWithZone create(long, java.util.TimeZone);
+ method @RequiresApi(26) public static androidx.car.app.model.DateTimeWithZone create(java.time.ZonedDateTime);
+ method public long getTimeSinceEpochMillis();
+ method public int getZoneOffsetSeconds();
+ method public String? getZoneShortName();
+ }
+
+ @androidx.car.app.annotations.CarProtocol public final class Distance {
+ method public static androidx.car.app.model.Distance create(double, int);
+ method public double getDisplayDistance();
+ method public int getDisplayUnit();
+ field public static final int UNIT_FEET = 6; // 0x6
+ field public static final int UNIT_KILOMETERS = 2; // 0x2
+ field public static final int UNIT_KILOMETERS_P1 = 3; // 0x3
+ field public static final int UNIT_METERS = 1; // 0x1
+ field public static final int UNIT_MILES = 4; // 0x4
+ field public static final int UNIT_MILES_P1 = 5; // 0x5
+ field public static final int UNIT_YARDS = 7; // 0x7
+ }
+
+ @androidx.car.app.annotations.CarProtocol public final class DistanceSpan extends androidx.car.app.model.CarSpan {
+ method public static androidx.car.app.model.DistanceSpan create(androidx.car.app.model.Distance);
+ method public androidx.car.app.model.Distance getDistance();
+ }
+
+ @androidx.car.app.annotations.CarProtocol public final class DurationSpan extends androidx.car.app.model.CarSpan {
+ method public static androidx.car.app.model.DurationSpan create(long);
+ method @RequiresApi(26) public static androidx.car.app.model.DurationSpan create(java.time.Duration);
+ method public long getDurationSeconds();
+ }
+
+ @androidx.car.app.annotations.CarProtocol public final class ForegroundCarColorSpan extends androidx.car.app.model.CarSpan {
+ method public static androidx.car.app.model.ForegroundCarColorSpan create(androidx.car.app.model.CarColor);
+ method public androidx.car.app.model.CarColor getColor();
+ }
+
+ @androidx.car.app.annotations.CarProtocol public final class GridItem implements androidx.car.app.model.Item {
+ method public androidx.car.app.model.CarIcon? getImage();
+ method public int getImageType();
+ method public androidx.car.app.model.OnClickDelegate? getOnClickDelegate();
+ method public androidx.car.app.model.CarText? getText();
+ method public androidx.car.app.model.CarText? getTitle();
+ method public boolean isLoading();
+ field public static final int IMAGE_TYPE_ICON = 1; // 0x1
+ field public static final int IMAGE_TYPE_LARGE = 2; // 0x2
+ }
+
+ public static final class GridItem.Builder {
+ ctor public GridItem.Builder();
+ method public androidx.car.app.model.GridItem build();
+ method public androidx.car.app.model.GridItem.Builder setImage(androidx.car.app.model.CarIcon);
+ method public androidx.car.app.model.GridItem.Builder setImage(androidx.car.app.model.CarIcon, int);
+ method public androidx.car.app.model.GridItem.Builder setLoading(boolean);
+ method public androidx.car.app.model.GridItem.Builder setOnClickListener(androidx.car.app.model.OnClickListener);
+ method public androidx.car.app.model.GridItem.Builder setText(CharSequence);
+ method public androidx.car.app.model.GridItem.Builder setText(androidx.car.app.model.CarText);
+ method public androidx.car.app.model.GridItem.Builder setTitle(CharSequence);
+ method public androidx.car.app.model.GridItem.Builder setTitle(androidx.car.app.model.CarText);
+ }
+
+ @androidx.car.app.annotations.CarProtocol public final class GridTemplate implements androidx.car.app.model.Template {
+ method public androidx.car.app.model.ActionStrip? getActionStrip();
+ method public androidx.car.app.model.Action? getHeaderAction();
+ method public androidx.car.app.model.ItemList? getSingleList();
+ method public androidx.car.app.model.CarText? getTitle();
+ method public boolean isLoading();
+ }
+
+ public static final class GridTemplate.Builder {
+ ctor public GridTemplate.Builder();
+ method public androidx.car.app.model.GridTemplate build();
+ method public androidx.car.app.model.GridTemplate.Builder setActionStrip(androidx.car.app.model.ActionStrip);
+ method public androidx.car.app.model.GridTemplate.Builder setHeaderAction(androidx.car.app.model.Action);
+ method public androidx.car.app.model.GridTemplate.Builder setLoading(boolean);
+ method public androidx.car.app.model.GridTemplate.Builder setSingleList(androidx.car.app.model.ItemList);
+ method public androidx.car.app.model.GridTemplate.Builder setTitle(CharSequence);
+ }
+
+ @androidx.car.app.annotations.RequiresCarApi(2) public interface InputCallback {
+ method public default void onInputSubmitted(String);
+ method public default void onInputTextChanged(String);
+ }
+
+ @androidx.car.app.annotations.RequiresCarApi(2) public interface InputCallbackDelegate {
+ method public void sendInputSubmitted(String, androidx.car.app.OnDoneCallback);
+ method public void sendInputTextChanged(String, androidx.car.app.OnDoneCallback);
+ }
+
+ @androidx.car.app.annotations.CarProtocol public interface Item {
+ }
+
+ @androidx.car.app.annotations.CarProtocol public final class ItemList {
+ method public java.util.List<androidx.car.app.model.Item!> getItems();
+ method public androidx.car.app.model.CarText? getNoItemsMessage();
+ method public androidx.car.app.model.OnItemVisibilityChangedDelegate? getOnItemVisibilityChangedDelegate();
+ method public androidx.car.app.model.OnSelectedDelegate? getOnSelectedDelegate();
+ method public int getSelectedIndex();
+ }
+
+ public static final class ItemList.Builder {
+ ctor public ItemList.Builder();
+ method public androidx.car.app.model.ItemList.Builder addItem(androidx.car.app.model.Item);
+ method public androidx.car.app.model.ItemList build();
+ method public androidx.car.app.model.ItemList.Builder setNoItemsMessage(CharSequence);
+ method public androidx.car.app.model.ItemList.Builder setOnItemsVisibilityChangedListener(androidx.car.app.model.ItemList.OnItemVisibilityChangedListener);
+ method public androidx.car.app.model.ItemList.Builder setOnSelectedListener(androidx.car.app.model.ItemList.OnSelectedListener);
+ method public androidx.car.app.model.ItemList.Builder setSelectedIndex(@IntRange(from=0) int);
+ }
+
+ public static interface ItemList.OnItemVisibilityChangedListener {
+ method public void onItemVisibilityChanged(int, int);
+ }
+
+ public static interface ItemList.OnSelectedListener {
+ method public void onSelected(int);
+ }
+
+ @androidx.car.app.annotations.CarProtocol public final class ListTemplate implements androidx.car.app.model.Template {
+ method public androidx.car.app.model.ActionStrip? getActionStrip();
+ method public androidx.car.app.model.Action? getHeaderAction();
+ method public java.util.List<androidx.car.app.model.SectionedItemList!> getSectionedLists();
+ method public androidx.car.app.model.ItemList? getSingleList();
+ method public androidx.car.app.model.CarText? getTitle();
+ method public boolean isLoading();
+ }
+
+ public static final class ListTemplate.Builder {
+ ctor public ListTemplate.Builder();
+ method public androidx.car.app.model.ListTemplate.Builder addSectionedList(androidx.car.app.model.SectionedItemList);
+ method public androidx.car.app.model.ListTemplate build();
+ method public androidx.car.app.model.ListTemplate.Builder setActionStrip(androidx.car.app.model.ActionStrip);
+ method public androidx.car.app.model.ListTemplate.Builder setHeaderAction(androidx.car.app.model.Action);
+ method public androidx.car.app.model.ListTemplate.Builder setLoading(boolean);
+ method public androidx.car.app.model.ListTemplate.Builder setSingleList(androidx.car.app.model.ItemList);
+ method public androidx.car.app.model.ListTemplate.Builder setTitle(CharSequence);
+ }
+
+ @androidx.car.app.annotations.RequiresCarApi(2) public final class LongMessageTemplate implements androidx.car.app.model.Template {
+ method public androidx.car.app.model.ActionStrip? getActionStrip();
+ method public java.util.List<androidx.car.app.model.Action!> getActions();
+ method public androidx.car.app.model.Action? getHeaderAction();
+ method public androidx.car.app.model.CarText getMessage();
+ method public androidx.car.app.model.CarText? getTitle();
+ }
+
+ @androidx.car.app.annotations.RequiresCarApi(2) public static final class LongMessageTemplate.Builder {
+ ctor public LongMessageTemplate.Builder(CharSequence);
+ method public androidx.car.app.model.LongMessageTemplate.Builder addAction(androidx.car.app.model.Action);
+ method public androidx.car.app.model.LongMessageTemplate build();
+ method public androidx.car.app.model.LongMessageTemplate.Builder setActionStrip(androidx.car.app.model.ActionStrip);
+ method public androidx.car.app.model.LongMessageTemplate.Builder setHeaderAction(androidx.car.app.model.Action);
+ method public androidx.car.app.model.LongMessageTemplate.Builder setTitle(CharSequence);
+ }
+
+ @androidx.car.app.annotations.CarProtocol public final class MessageTemplate implements androidx.car.app.model.Template {
+ method @androidx.car.app.annotations.RequiresCarApi(2) public androidx.car.app.model.ActionStrip? getActionStrip();
+ method public java.util.List<androidx.car.app.model.Action!> getActions();
+ method public androidx.car.app.model.CarText? getDebugMessage();
+ method public androidx.car.app.model.Action? getHeaderAction();
+ method public androidx.car.app.model.CarIcon? getIcon();
+ method public androidx.car.app.model.CarText getMessage();
+ method public androidx.car.app.model.CarText? getTitle();
+ method @androidx.car.app.annotations.RequiresCarApi(2) public boolean isLoading();
+ }
+
+ public static final class MessageTemplate.Builder {
+ ctor public MessageTemplate.Builder(CharSequence);
+ ctor public MessageTemplate.Builder(androidx.car.app.model.CarText);
+ method public androidx.car.app.model.MessageTemplate.Builder addAction(androidx.car.app.model.Action);
+ method public androidx.car.app.model.MessageTemplate build();
+ method @androidx.car.app.annotations.RequiresCarApi(2) public androidx.car.app.model.MessageTemplate.Builder setActionStrip(androidx.car.app.model.ActionStrip);
+ method public androidx.car.app.model.MessageTemplate.Builder setDebugMessage(Throwable);
+ method public androidx.car.app.model.MessageTemplate.Builder setDebugMessage(String);
+ method public androidx.car.app.model.MessageTemplate.Builder setHeaderAction(androidx.car.app.model.Action);
+ method public androidx.car.app.model.MessageTemplate.Builder setIcon(androidx.car.app.model.CarIcon);
+ method @androidx.car.app.annotations.RequiresCarApi(2) public androidx.car.app.model.MessageTemplate.Builder setLoading(boolean);
+ method public androidx.car.app.model.MessageTemplate.Builder setTitle(CharSequence);
+ }
+
+ @androidx.car.app.annotations.CarProtocol public final class Metadata {
+ method public androidx.car.app.model.Place? getPlace();
+ field public static final androidx.car.app.model.Metadata EMPTY_METADATA;
+ }
+
+ public static final class Metadata.Builder {
+ ctor public Metadata.Builder();
+ ctor public Metadata.Builder(androidx.car.app.model.Metadata);
+ method public androidx.car.app.model.Metadata build();
+ method public androidx.car.app.model.Metadata.Builder setPlace(androidx.car.app.model.Place);
+ }
+
+ @androidx.car.app.annotations.CarProtocol public interface OnCheckedChangeDelegate {
+ method public void sendCheckedChange(boolean, androidx.car.app.OnDoneCallback);
+ }
+
+ @androidx.car.app.annotations.CarProtocol public interface OnClickDelegate {
+ method public boolean isParkedOnly();
+ method public void sendClick(androidx.car.app.OnDoneCallback);
+ }
+
+ public interface OnClickListener {
+ method public void onClick();
+ }
+
+ @androidx.car.app.annotations.CarProtocol public interface OnItemVisibilityChangedDelegate {
+ method public void sendItemVisibilityChanged(int, int, androidx.car.app.OnDoneCallback);
+ }
+
+ @androidx.car.app.annotations.CarProtocol public interface OnSelectedDelegate {
+ method public void sendSelected(int, androidx.car.app.OnDoneCallback);
+ }
+
+ @androidx.car.app.annotations.CarProtocol public final class Pane {
+ method public java.util.List<androidx.car.app.model.Action!> getActions();
+ method public java.util.List<androidx.car.app.model.Row!> getRows();
+ method public boolean isLoading();
+ }
+
+ public static final class Pane.Builder {
+ ctor public Pane.Builder();
+ method public androidx.car.app.model.Pane.Builder addAction(androidx.car.app.model.Action);
+ method public androidx.car.app.model.Pane.Builder addRow(androidx.car.app.model.Row);
+ method public androidx.car.app.model.Pane build();
+ method public androidx.car.app.model.Pane.Builder setLoading(boolean);
+ }
+
+ @androidx.car.app.annotations.CarProtocol public final class PaneTemplate implements androidx.car.app.model.Template {
+ method public androidx.car.app.model.ActionStrip? getActionStrip();
+ method public androidx.car.app.model.Action? getHeaderAction();
+ method public androidx.car.app.model.Pane getPane();
+ method public androidx.car.app.model.CarText? getTitle();
+ }
+
+ public static final class PaneTemplate.Builder {
+ ctor public PaneTemplate.Builder(androidx.car.app.model.Pane);
+ method public androidx.car.app.model.PaneTemplate build();
+ method public androidx.car.app.model.PaneTemplate.Builder setActionStrip(androidx.car.app.model.ActionStrip);
+ method public androidx.car.app.model.PaneTemplate.Builder setHeaderAction(androidx.car.app.model.Action);
+ method public androidx.car.app.model.PaneTemplate.Builder setTitle(CharSequence);
+ }
+
+ @androidx.car.app.annotations.CarProtocol public final class ParkedOnlyOnClickListener implements androidx.car.app.model.OnClickListener {
+ method public static androidx.car.app.model.ParkedOnlyOnClickListener create(androidx.car.app.model.OnClickListener);
+ method public void onClick();
+ }
+
+ @androidx.car.app.annotations.CarProtocol public final class Place {
+ method public androidx.car.app.model.CarLocation getLocation();
+ method public androidx.car.app.model.PlaceMarker? getMarker();
+ }
+
+ public static final class Place.Builder {
+ ctor public Place.Builder(androidx.car.app.model.CarLocation);
+ ctor public Place.Builder(androidx.car.app.model.Place);
+ method public androidx.car.app.model.Place build();
+ method public androidx.car.app.model.Place.Builder setMarker(androidx.car.app.model.PlaceMarker);
+ }
+
+ @androidx.car.app.annotations.CarProtocol public final class PlaceListMapTemplate implements androidx.car.app.model.Template {
+ method public androidx.car.app.model.ActionStrip? getActionStrip();
+ method public androidx.car.app.model.Place? getAnchor();
+ method public androidx.car.app.model.Action? getHeaderAction();
+ method public androidx.car.app.model.ItemList? getItemList();
+ method public androidx.car.app.model.CarText? getTitle();
+ method public boolean isCurrentLocationEnabled();
+ method public boolean isLoading();
+ }
+
+ public static final class PlaceListMapTemplate.Builder {
+ ctor public PlaceListMapTemplate.Builder();
+ method public androidx.car.app.model.PlaceListMapTemplate build();
+ method public androidx.car.app.model.PlaceListMapTemplate.Builder setActionStrip(androidx.car.app.model.ActionStrip);
+ method public androidx.car.app.model.PlaceListMapTemplate.Builder setAnchor(androidx.car.app.model.Place);
+ method public androidx.car.app.model.PlaceListMapTemplate.Builder setCurrentLocationEnabled(boolean);
+ method public androidx.car.app.model.PlaceListMapTemplate.Builder setHeaderAction(androidx.car.app.model.Action);
+ method public androidx.car.app.model.PlaceListMapTemplate.Builder setItemList(androidx.car.app.model.ItemList);
+ method public androidx.car.app.model.PlaceListMapTemplate.Builder setLoading(boolean);
+ method public androidx.car.app.model.PlaceListMapTemplate.Builder setTitle(CharSequence);
+ method public androidx.car.app.model.PlaceListMapTemplate.Builder setTitle(androidx.car.app.model.CarText);
+ }
+
+ @androidx.car.app.annotations.CarProtocol public final class PlaceMarker {
+ method public androidx.car.app.model.CarColor? getColor();
+ method public androidx.car.app.model.CarIcon? getIcon();
+ method public int getIconType();
+ method public androidx.car.app.model.CarText? getLabel();
+ field public static final int TYPE_ICON = 0; // 0x0
+ field public static final int TYPE_IMAGE = 1; // 0x1
+ }
+
+ public static final class PlaceMarker.Builder {
+ ctor public PlaceMarker.Builder();
+ method public androidx.car.app.model.PlaceMarker build();
+ method public androidx.car.app.model.PlaceMarker.Builder setColor(androidx.car.app.model.CarColor);
+ method public androidx.car.app.model.PlaceMarker.Builder setIcon(androidx.car.app.model.CarIcon, int);
+ method public androidx.car.app.model.PlaceMarker.Builder setLabel(CharSequence);
+ }
+
+ @androidx.car.app.annotations.CarProtocol public final class Row implements androidx.car.app.model.Item {
+ method public androidx.car.app.model.CarIcon? getImage();
+ method public androidx.car.app.model.Metadata? getMetadata();
+ method public androidx.car.app.model.OnClickDelegate? getOnClickDelegate();
+ method public int getRowImageType();
+ method public java.util.List<androidx.car.app.model.CarText!> getTexts();
+ method public androidx.car.app.model.CarText? getTitle();
+ method public androidx.car.app.model.Toggle? getToggle();
+ method public boolean isBrowsable();
+ method public androidx.car.app.model.Row row();
+ method public CharSequence yourBoat();
+ field public static final int IMAGE_TYPE_ICON = 4; // 0x4
+ field public static final int IMAGE_TYPE_LARGE = 2; // 0x2
+ field public static final int IMAGE_TYPE_SMALL = 1; // 0x1
+ }
+
+ public static final class Row.Builder {
+ ctor public Row.Builder();
+ method public androidx.car.app.model.Row.Builder addText(CharSequence);
+ method public androidx.car.app.model.Row.Builder addText(androidx.car.app.model.CarText);
+ method public androidx.car.app.model.Row build();
+ method public androidx.car.app.model.Row.Builder setBrowsable(boolean);
+ method public androidx.car.app.model.Row.Builder setImage(androidx.car.app.model.CarIcon);
+ method public androidx.car.app.model.Row.Builder setImage(androidx.car.app.model.CarIcon, int);
+ method public androidx.car.app.model.Row.Builder setMetadata(androidx.car.app.model.Metadata);
+ method public androidx.car.app.model.Row.Builder setOnClickListener(androidx.car.app.model.OnClickListener);
+ method public androidx.car.app.model.Row.Builder setTitle(CharSequence);
+ method public androidx.car.app.model.Row.Builder setTitle(androidx.car.app.model.CarText);
+ method public androidx.car.app.model.Row.Builder setToggle(androidx.car.app.model.Toggle);
+ }
+
+ @androidx.car.app.annotations.CarProtocol public interface SearchCallbackDelegate {
+ method public void sendSearchSubmitted(String, androidx.car.app.OnDoneCallback);
+ method public void sendSearchTextChanged(String, androidx.car.app.OnDoneCallback);
+ }
+
+ @androidx.car.app.annotations.CarProtocol public final class SearchTemplate implements androidx.car.app.model.Template {
+ method public androidx.car.app.model.ActionStrip? getActionStrip();
+ method public androidx.car.app.model.Action? getHeaderAction();
+ method public String? getInitialSearchText();
+ method public androidx.car.app.model.ItemList? getItemList();
+ method public androidx.car.app.model.SearchCallbackDelegate getSearchCallbackDelegate();
+ method public String? getSearchHint();
+ method public boolean isLoading();
+ method public boolean isShowKeyboardByDefault();
+ }
+
+ public static final class SearchTemplate.Builder {
+ ctor public SearchTemplate.Builder(androidx.car.app.model.SearchTemplate.SearchCallback);
+ method public androidx.car.app.model.SearchTemplate build();
+ method public androidx.car.app.model.SearchTemplate.Builder setActionStrip(androidx.car.app.model.ActionStrip);
+ method public androidx.car.app.model.SearchTemplate.Builder setHeaderAction(androidx.car.app.model.Action);
+ method public androidx.car.app.model.SearchTemplate.Builder setInitialSearchText(String);
+ method public androidx.car.app.model.SearchTemplate.Builder setItemList(androidx.car.app.model.ItemList);
+ method public androidx.car.app.model.SearchTemplate.Builder setLoading(boolean);
+ method public androidx.car.app.model.SearchTemplate.Builder setSearchHint(String);
+ method public androidx.car.app.model.SearchTemplate.Builder setShowKeyboardByDefault(boolean);
+ }
+
+ public static interface SearchTemplate.SearchCallback {
+ method public default void onSearchSubmitted(String);
+ method public default void onSearchTextChanged(String);
+ }
+
+ @androidx.car.app.annotations.CarProtocol public final class SectionedItemList {
+ method public static androidx.car.app.model.SectionedItemList create(androidx.car.app.model.ItemList, CharSequence);
+ method public androidx.car.app.model.CarText getHeader();
+ method public androidx.car.app.model.ItemList getItemList();
+ }
+
+ @androidx.car.app.annotations.CarProtocol public interface Template {
+ }
+
+ @androidx.car.app.annotations.CarProtocol public final class TemplateInfo {
+ ctor public TemplateInfo(Class<? extends androidx.car.app.model.Template>, String);
+ method public Class<? extends androidx.car.app.model.Template> getTemplateClass();
+ method public String getTemplateId();
+ }
+
+ @androidx.car.app.annotations.CarProtocol public final class TemplateWrapper {
+ method public static androidx.car.app.model.TemplateWrapper copyOf(androidx.car.app.model.TemplateWrapper);
+ method public int getCurrentTaskStep();
+ method public String getId();
+ method public androidx.car.app.model.Template getTemplate();
+ method public java.util.List<androidx.car.app.model.TemplateInfo!> getTemplateInfosForScreenStack();
+ method public boolean isRefresh();
+ method public void setCurrentTaskStep(int);
+ method public void setId(String);
+ method public void setRefresh(boolean);
+ method public void setTemplate(androidx.car.app.model.Template);
+ method public static androidx.car.app.model.TemplateWrapper wrap(androidx.car.app.model.Template);
+ method public static androidx.car.app.model.TemplateWrapper wrap(androidx.car.app.model.Template, String);
+ }
+
+ @androidx.car.app.annotations.CarProtocol public final class Toggle {
+ method public androidx.car.app.model.OnCheckedChangeDelegate getOnCheckedChangeDelegate();
+ method public boolean isChecked();
+ }
+
+ public static final class Toggle.Builder {
+ ctor public Toggle.Builder(androidx.car.app.model.Toggle.OnCheckedChangeListener);
+ method public androidx.car.app.model.Toggle build();
+ method public androidx.car.app.model.Toggle.Builder setChecked(boolean);
+ }
+
+ public static interface Toggle.OnCheckedChangeListener {
+ method public void onCheckedChange(boolean);
+ }
+
+}
+
+package androidx.car.app.model.signin {
+
+ @androidx.car.app.annotations.RequiresCarApi(2) public final class InputSignInMethod implements androidx.car.app.model.signin.SignInTemplate.SignInMethod {
+ method public androidx.car.app.model.CarText? getDefaultValue();
+ method public androidx.car.app.model.CarText? getErrorMessage();
+ method public androidx.car.app.model.CarText? getHint();
+ method public androidx.car.app.model.InputCallbackDelegate getInputCallbackDelegate();
+ method public int getInputType();
+ method public int getKeyboardType();
+ method public boolean isShowKeyboardByDefault();
+ field public static final int INPUT_TYPE_DEFAULT = 1; // 0x1
+ field public static final int INPUT_TYPE_PASSWORD = 2; // 0x2
+ field public static final int KEYBOARD_DEFAULT = 1; // 0x1
+ field public static final int KEYBOARD_EMAIL = 2; // 0x2
+ field public static final int KEYBOARD_NUMBER = 4; // 0x4
+ field public static final int KEYBOARD_PHONE = 3; // 0x3
+ }
+
+ public static final class InputSignInMethod.Builder {
+ ctor public InputSignInMethod.Builder(androidx.car.app.model.InputCallback);
+ method public androidx.car.app.model.signin.InputSignInMethod build();
+ method public androidx.car.app.model.signin.InputSignInMethod.Builder setDefaultValue(String);
+ method public androidx.car.app.model.signin.InputSignInMethod.Builder setErrorMessage(CharSequence);
+ method public androidx.car.app.model.signin.InputSignInMethod.Builder setHint(CharSequence);
+ method public androidx.car.app.model.signin.InputSignInMethod.Builder setInputType(int);
+ method public androidx.car.app.model.signin.InputSignInMethod.Builder setKeyboardType(int);
+ method public androidx.car.app.model.signin.InputSignInMethod.Builder setShowKeyboardByDefault(boolean);
+ }
+
+ @androidx.car.app.annotations.RequiresCarApi(2) public final class PinSignInMethod implements androidx.car.app.model.signin.SignInTemplate.SignInMethod {
+ ctor public PinSignInMethod(CharSequence);
+ method public androidx.car.app.model.CarText getPinCode();
+ }
+
+ @androidx.car.app.annotations.RequiresCarApi(2) public final class ProviderSignInMethod implements androidx.car.app.model.signin.SignInTemplate.SignInMethod {
+ ctor public ProviderSignInMethod(androidx.car.app.model.Action);
+ method public androidx.car.app.model.Action getAction();
+ }
+
+ @androidx.car.app.annotations.RequiresCarApi(2) public final class SignInTemplate implements androidx.car.app.model.Template {
+ method public androidx.car.app.model.ActionStrip? getActionStrip();
+ method public java.util.List<androidx.car.app.model.Action!> getActions();
+ method public androidx.car.app.model.CarText? getAdditionalText();
+ method public androidx.car.app.model.Action? getHeaderAction();
+ method public androidx.car.app.model.CarText? getInstructions();
+ method public androidx.car.app.model.signin.SignInTemplate.SignInMethod getSignInMethod();
+ method public androidx.car.app.model.CarText? getTitle();
+ method public boolean isLoading();
+ }
+
+ @androidx.car.app.annotations.RequiresCarApi(2) public static final class SignInTemplate.Builder {
+ ctor public SignInTemplate.Builder(androidx.car.app.model.signin.SignInTemplate.SignInMethod);
+ method public androidx.car.app.model.signin.SignInTemplate.Builder addAction(androidx.car.app.model.Action);
+ method public androidx.car.app.model.signin.SignInTemplate build();
+ method public androidx.car.app.model.signin.SignInTemplate.Builder setActionStrip(androidx.car.app.model.ActionStrip);
+ method public androidx.car.app.model.signin.SignInTemplate.Builder setAdditionalText(CharSequence);
+ method public androidx.car.app.model.signin.SignInTemplate.Builder setHeaderAction(androidx.car.app.model.Action);
+ method public androidx.car.app.model.signin.SignInTemplate.Builder setInstructions(CharSequence);
+ method public androidx.car.app.model.signin.SignInTemplate.Builder setLoading(boolean);
+ method public androidx.car.app.model.signin.SignInTemplate.Builder setTitle(CharSequence);
+ }
+
+ public static interface SignInTemplate.SignInMethod {
+ }
+
+}
+
+package androidx.car.app.navigation {
+
+ public class NavigationManager implements androidx.car.app.managers.Manager {
+ method @MainThread public void clearNavigationManagerCallback();
+ method @MainThread public void navigationEnded();
+ method @MainThread public void navigationStarted();
+ method @MainThread public void setNavigationManagerCallback(androidx.car.app.navigation.NavigationManagerCallback);
+ method @MainThread public void setNavigationManagerCallback(java.util.concurrent.Executor, androidx.car.app.navigation.NavigationManagerCallback);
+ method @MainThread public void updateTrip(androidx.car.app.navigation.model.Trip);
+ }
+
+ public interface NavigationManagerCallback {
+ method public default void onAutoDriveEnabled();
+ method public default void onStopNavigation();
+ }
+
+}
+
+package androidx.car.app.navigation.model {
+
+ @androidx.car.app.annotations.CarProtocol public final class Destination {
+ method public androidx.car.app.model.CarText? getAddress();
+ method public androidx.car.app.model.CarIcon? getImage();
+ method public androidx.car.app.model.CarText? getName();
+ }
+
+ public static final class Destination.Builder {
+ ctor public Destination.Builder();
+ method public androidx.car.app.navigation.model.Destination build();
+ method public androidx.car.app.navigation.model.Destination.Builder setAddress(CharSequence);
+ method public androidx.car.app.navigation.model.Destination.Builder setImage(androidx.car.app.model.CarIcon);
+ method public androidx.car.app.navigation.model.Destination.Builder setName(CharSequence);
+ }
+
+ @androidx.car.app.annotations.CarProtocol public final class Lane {
+ method public java.util.List<androidx.car.app.navigation.model.LaneDirection!> getDirections();
+ }
+
+ public static final class Lane.Builder {
+ ctor public Lane.Builder();
+ method public androidx.car.app.navigation.model.Lane.Builder addDirection(androidx.car.app.navigation.model.LaneDirection);
+ method public androidx.car.app.navigation.model.Lane build();
+ }
+
+ @androidx.car.app.annotations.CarProtocol public final class LaneDirection {
+ method public static androidx.car.app.navigation.model.LaneDirection create(int, boolean);
+ method public int getShape();
+ method public boolean isRecommended();
+ field public static final int SHAPE_NORMAL_LEFT = 5; // 0x5
+ field public static final int SHAPE_NORMAL_RIGHT = 6; // 0x6
+ field public static final int SHAPE_SHARP_LEFT = 7; // 0x7
+ field public static final int SHAPE_SHARP_RIGHT = 8; // 0x8
+ field public static final int SHAPE_SLIGHT_LEFT = 3; // 0x3
+ field public static final int SHAPE_SLIGHT_RIGHT = 4; // 0x4
+ field public static final int SHAPE_STRAIGHT = 2; // 0x2
+ field public static final int SHAPE_UNKNOWN = 1; // 0x1
+ field public static final int SHAPE_U_TURN_LEFT = 9; // 0x9
+ field public static final int SHAPE_U_TURN_RIGHT = 10; // 0xa
+ }
+
+ @androidx.car.app.annotations.CarProtocol public final class Maneuver {
+ method public androidx.car.app.model.CarIcon? getIcon();
+ method public int getRoundaboutExitAngle();
+ method public int getRoundaboutExitNumber();
+ method public int getType();
+ field public static final int TYPE_DEPART = 1; // 0x1
+ field public static final int TYPE_DESTINATION = 39; // 0x27
+ field public static final int TYPE_DESTINATION_LEFT = 41; // 0x29
+ field public static final int TYPE_DESTINATION_RIGHT = 42; // 0x2a
+ field public static final int TYPE_DESTINATION_STRAIGHT = 40; // 0x28
+ field public static final int TYPE_FERRY_BOAT = 37; // 0x25
+ field public static final int TYPE_FERRY_BOAT_LEFT = 47; // 0x2f
+ field public static final int TYPE_FERRY_BOAT_RIGHT = 48; // 0x30
+ field public static final int TYPE_FERRY_TRAIN = 38; // 0x26
+ field public static final int TYPE_FERRY_TRAIN_LEFT = 49; // 0x31
+ field public static final int TYPE_FERRY_TRAIN_RIGHT = 50; // 0x32
+ field public static final int TYPE_FORK_LEFT = 25; // 0x19
+ field public static final int TYPE_FORK_RIGHT = 26; // 0x1a
+ field public static final int TYPE_KEEP_LEFT = 3; // 0x3
+ field public static final int TYPE_KEEP_RIGHT = 4; // 0x4
+ field public static final int TYPE_MERGE_LEFT = 27; // 0x1b
+ field public static final int TYPE_MERGE_RIGHT = 28; // 0x1c
+ field public static final int TYPE_MERGE_SIDE_UNSPECIFIED = 29; // 0x1d
+ field public static final int TYPE_NAME_CHANGE = 2; // 0x2
+ field public static final int TYPE_OFF_RAMP_NORMAL_LEFT = 23; // 0x17
+ field public static final int TYPE_OFF_RAMP_NORMAL_RIGHT = 24; // 0x18
+ field public static final int TYPE_OFF_RAMP_SLIGHT_LEFT = 21; // 0x15
+ field public static final int TYPE_OFF_RAMP_SLIGHT_RIGHT = 22; // 0x16
+ field public static final int TYPE_ON_RAMP_NORMAL_LEFT = 15; // 0xf
+ field public static final int TYPE_ON_RAMP_NORMAL_RIGHT = 16; // 0x10
+ field public static final int TYPE_ON_RAMP_SHARP_LEFT = 17; // 0x11
+ field public static final int TYPE_ON_RAMP_SHARP_RIGHT = 18; // 0x12
+ field public static final int TYPE_ON_RAMP_SLIGHT_LEFT = 13; // 0xd
+ field public static final int TYPE_ON_RAMP_SLIGHT_RIGHT = 14; // 0xe
+ field public static final int TYPE_ON_RAMP_U_TURN_LEFT = 19; // 0x13
+ field public static final int TYPE_ON_RAMP_U_TURN_RIGHT = 20; // 0x14
+ field public static final int TYPE_ROUNDABOUT_ENTER_AND_EXIT_CCW = 34; // 0x22
+ field public static final int TYPE_ROUNDABOUT_ENTER_AND_EXIT_CCW_WITH_ANGLE = 35; // 0x23
+ field public static final int TYPE_ROUNDABOUT_ENTER_AND_EXIT_CW = 32; // 0x20
+ field public static final int TYPE_ROUNDABOUT_ENTER_AND_EXIT_CW_WITH_ANGLE = 33; // 0x21
+ field public static final int TYPE_ROUNDABOUT_ENTER_CCW = 45; // 0x2d
+ field public static final int TYPE_ROUNDABOUT_ENTER_CW = 43; // 0x2b
+ field public static final int TYPE_ROUNDABOUT_EXIT_CCW = 46; // 0x2e
+ field public static final int TYPE_ROUNDABOUT_EXIT_CW = 44; // 0x2c
+ field public static final int TYPE_STRAIGHT = 36; // 0x24
+ field public static final int TYPE_TURN_NORMAL_LEFT = 7; // 0x7
+ field public static final int TYPE_TURN_NORMAL_RIGHT = 8; // 0x8
+ field public static final int TYPE_TURN_SHARP_LEFT = 9; // 0x9
+ field public static final int TYPE_TURN_SHARP_RIGHT = 10; // 0xa
+ field public static final int TYPE_TURN_SLIGHT_LEFT = 5; // 0x5
+ field public static final int TYPE_TURN_SLIGHT_RIGHT = 6; // 0x6
+ field public static final int TYPE_UNKNOWN = 0; // 0x0
+ field public static final int TYPE_U_TURN_LEFT = 11; // 0xb
+ field public static final int TYPE_U_TURN_RIGHT = 12; // 0xc
+ }
+
+ public static final class Maneuver.Builder {
+ ctor public Maneuver.Builder(int);
+ method public androidx.car.app.navigation.model.Maneuver build();
+ method public androidx.car.app.navigation.model.Maneuver.Builder setIcon(androidx.car.app.model.CarIcon);
+ method public androidx.car.app.navigation.model.Maneuver.Builder setRoundaboutExitAngle(@IntRange(from=1, to=360) int);
+ method public androidx.car.app.navigation.model.Maneuver.Builder setRoundaboutExitNumber(@IntRange(from=1) int);
+ }
+
+ @androidx.car.app.annotations.CarProtocol public final class MessageInfo implements androidx.car.app.navigation.model.NavigationTemplate.NavigationInfo {
+ method public androidx.car.app.model.CarIcon? getImage();
+ method public androidx.car.app.model.CarText? getText();
+ method public androidx.car.app.model.CarText? getTitle();
+ }
+
+ public static final class MessageInfo.Builder {
+ ctor public MessageInfo.Builder(CharSequence);
+ ctor public MessageInfo.Builder(androidx.car.app.model.CarText);
+ method public androidx.car.app.navigation.model.MessageInfo build();
+ method public androidx.car.app.navigation.model.MessageInfo.Builder setImage(androidx.car.app.model.CarIcon);
+ method public androidx.car.app.navigation.model.MessageInfo.Builder setText(CharSequence);
+ method public androidx.car.app.navigation.model.MessageInfo.Builder setText(androidx.car.app.model.CarText);
+ method public androidx.car.app.navigation.model.MessageInfo.Builder setTitle(CharSequence);
+ }
+
+ @androidx.car.app.annotations.CarProtocol public final class NavigationTemplate implements androidx.car.app.model.Template {
+ method public androidx.car.app.model.ActionStrip? getActionStrip();
+ method public androidx.car.app.model.CarColor? getBackgroundColor();
+ method public androidx.car.app.navigation.model.TravelEstimate? getDestinationTravelEstimate();
+ method @androidx.car.app.annotations.RequiresCarApi(2) public androidx.car.app.model.ActionStrip? getMapActionStrip();
+ method public androidx.car.app.navigation.model.NavigationTemplate.NavigationInfo? getNavigationInfo();
+ method @androidx.car.app.annotations.RequiresCarApi(2) public androidx.car.app.navigation.model.PanModeDelegate? getPanModeDelegate();
+ method @Deprecated @androidx.car.app.annotations.RequiresCarApi(2) public androidx.car.app.model.Toggle? getPanModeToggle();
+ }
+
+ public static final class NavigationTemplate.Builder {
+ ctor public NavigationTemplate.Builder();
+ method public androidx.car.app.navigation.model.NavigationTemplate build();
+ method public androidx.car.app.navigation.model.NavigationTemplate.Builder setActionStrip(androidx.car.app.model.ActionStrip);
+ method public androidx.car.app.navigation.model.NavigationTemplate.Builder setBackgroundColor(androidx.car.app.model.CarColor);
+ method public androidx.car.app.navigation.model.NavigationTemplate.Builder setDestinationTravelEstimate(androidx.car.app.navigation.model.TravelEstimate);
+ method @androidx.car.app.annotations.RequiresCarApi(2) public androidx.car.app.navigation.model.NavigationTemplate.Builder setMapActionStrip(androidx.car.app.model.ActionStrip);
+ method public androidx.car.app.navigation.model.NavigationTemplate.Builder setNavigationInfo(androidx.car.app.navigation.model.NavigationTemplate.NavigationInfo);
+ method @androidx.car.app.annotations.RequiresCarApi(2) public androidx.car.app.navigation.model.NavigationTemplate.Builder setPanModeListener(androidx.car.app.navigation.model.PanModeListener);
+ }
+
+ public static interface NavigationTemplate.NavigationInfo {
+ }
+
+ @androidx.car.app.annotations.CarProtocol @androidx.car.app.annotations.RequiresCarApi(2) public interface PanModeDelegate {
+ method public void sendPanModeChanged(boolean, androidx.car.app.OnDoneCallback);
+ }
+
+ public interface PanModeListener {
+ method public void onPanModeChanged(boolean);
+ }
+
+ @androidx.car.app.annotations.CarProtocol public final class PlaceListNavigationTemplate implements androidx.car.app.model.Template {
+ method public androidx.car.app.model.ActionStrip? getActionStrip();
+ method public androidx.car.app.model.Action? getHeaderAction();
+ method public androidx.car.app.model.ItemList? getItemList();
+ method public androidx.car.app.model.CarText? getTitle();
+ method public boolean isLoading();
+ }
+
+ public static final class PlaceListNavigationTemplate.Builder {
+ ctor public PlaceListNavigationTemplate.Builder();
+ method public androidx.car.app.navigation.model.PlaceListNavigationTemplate build();
+ method public androidx.car.app.navigation.model.PlaceListNavigationTemplate.Builder setActionStrip(androidx.car.app.model.ActionStrip);
+ method public androidx.car.app.navigation.model.PlaceListNavigationTemplate.Builder setHeaderAction(androidx.car.app.model.Action);
+ method public androidx.car.app.navigation.model.PlaceListNavigationTemplate.Builder setItemList(androidx.car.app.model.ItemList);
+ method public androidx.car.app.navigation.model.PlaceListNavigationTemplate.Builder setLoading(boolean);
+ method public androidx.car.app.navigation.model.PlaceListNavigationTemplate.Builder setTitle(CharSequence);
+ method public androidx.car.app.navigation.model.PlaceListNavigationTemplate.Builder setTitle(androidx.car.app.model.CarText);
+ }
+
+ @androidx.car.app.annotations.CarProtocol public final class RoutePreviewNavigationTemplate implements androidx.car.app.model.Template {
+ method public androidx.car.app.model.ActionStrip? getActionStrip();
+ method public androidx.car.app.model.Action? getHeaderAction();
+ method public androidx.car.app.model.ItemList? getItemList();
+ method public androidx.car.app.model.Action? getNavigateAction();
+ method public androidx.car.app.model.CarText? getTitle();
+ method public boolean isLoading();
+ }
+
+ public static final class RoutePreviewNavigationTemplate.Builder {
+ ctor public RoutePreviewNavigationTemplate.Builder();
+ method public androidx.car.app.navigation.model.RoutePreviewNavigationTemplate build();
+ method public androidx.car.app.navigation.model.RoutePreviewNavigationTemplate.Builder setActionStrip(androidx.car.app.model.ActionStrip);
+ method public androidx.car.app.navigation.model.RoutePreviewNavigationTemplate.Builder setHeaderAction(androidx.car.app.model.Action);
+ method public androidx.car.app.navigation.model.RoutePreviewNavigationTemplate.Builder setItemList(androidx.car.app.model.ItemList);
+ method public androidx.car.app.navigation.model.RoutePreviewNavigationTemplate.Builder setLoading(boolean);
+ method public androidx.car.app.navigation.model.RoutePreviewNavigationTemplate.Builder setNavigateAction(androidx.car.app.model.Action);
+ method public androidx.car.app.navigation.model.RoutePreviewNavigationTemplate.Builder setTitle(CharSequence);
+ method public androidx.car.app.navigation.model.RoutePreviewNavigationTemplate.Builder setTitle(androidx.car.app.model.CarText);
+ }
+
+ @androidx.car.app.annotations.CarProtocol public final class RoutingInfo implements androidx.car.app.navigation.model.NavigationTemplate.NavigationInfo {
+ method public androidx.car.app.model.Distance? getCurrentDistance();
+ method public androidx.car.app.navigation.model.Step? getCurrentStep();
+ method public androidx.car.app.model.CarIcon? getJunctionImage();
+ method public androidx.car.app.navigation.model.Step? getNextStep();
+ method public boolean isLoading();
+ }
+
+ public static final class RoutingInfo.Builder {
+ ctor public RoutingInfo.Builder();
+ method public androidx.car.app.navigation.model.RoutingInfo build();
+ method public androidx.car.app.navigation.model.RoutingInfo.Builder setCurrentStep(androidx.car.app.navigation.model.Step, androidx.car.app.model.Distance);
+ method public androidx.car.app.navigation.model.RoutingInfo.Builder setJunctionImage(androidx.car.app.model.CarIcon);
+ method public androidx.car.app.navigation.model.RoutingInfo.Builder setLoading(boolean);
+ method public androidx.car.app.navigation.model.RoutingInfo.Builder setNextStep(androidx.car.app.navigation.model.Step);
+ }
+
+ @androidx.car.app.annotations.CarProtocol public final class Step {
+ method public androidx.car.app.model.CarText? getCue();
+ method public java.util.List<androidx.car.app.navigation.model.Lane!> getLanes();
+ method public androidx.car.app.model.CarIcon? getLanesImage();
+ method public androidx.car.app.navigation.model.Maneuver? getManeuver();
+ method public androidx.car.app.model.CarText? getRoad();
+ }
+
+ public static final class Step.Builder {
+ ctor public Step.Builder();
+ ctor public Step.Builder(CharSequence);
+ ctor public Step.Builder(androidx.car.app.model.CarText);
+ method public androidx.car.app.navigation.model.Step.Builder addLane(androidx.car.app.navigation.model.Lane);
+ method public androidx.car.app.navigation.model.Step build();
+ method public androidx.car.app.navigation.model.Step.Builder setCue(CharSequence);
+ method public androidx.car.app.navigation.model.Step.Builder setLanesImage(androidx.car.app.model.CarIcon);
+ method public androidx.car.app.navigation.model.Step.Builder setManeuver(androidx.car.app.navigation.model.Maneuver);
+ method public androidx.car.app.navigation.model.Step.Builder setRoad(CharSequence);
+ }
+
+ @androidx.car.app.annotations.CarProtocol public final class TravelEstimate {
+ method public androidx.car.app.model.DateTimeWithZone? getArrivalTimeAtDestination();
+ method public androidx.car.app.model.Distance? getRemainingDistance();
+ method public androidx.car.app.model.CarColor? getRemainingDistanceColor();
+ method public androidx.car.app.model.CarColor? getRemainingTimeColor();
+ method public long getRemainingTimeSeconds();
+ field public static final long REMAINING_TIME_UNKNOWN = -1L; // 0xffffffffffffffffL
+ }
+
+ public static final class TravelEstimate.Builder {
+ ctor public TravelEstimate.Builder(androidx.car.app.model.Distance, androidx.car.app.model.DateTimeWithZone);
+ ctor @RequiresApi(26) public TravelEstimate.Builder(androidx.car.app.model.Distance, java.time.ZonedDateTime);
+ method public androidx.car.app.navigation.model.TravelEstimate build();
+ method public androidx.car.app.navigation.model.TravelEstimate.Builder setRemainingDistanceColor(androidx.car.app.model.CarColor);
+ method @RequiresApi(26) public androidx.car.app.navigation.model.TravelEstimate.Builder setRemainingTime(java.time.Duration);
+ method public androidx.car.app.navigation.model.TravelEstimate.Builder setRemainingTimeColor(androidx.car.app.model.CarColor);
+ method public androidx.car.app.navigation.model.TravelEstimate.Builder setRemainingTimeSeconds(@IntRange(from=0xffffffff) long);
+ }
+
+ @androidx.car.app.annotations.CarProtocol public final class Trip {
+ method public androidx.car.app.model.CarText? getCurrentRoad();
+ method public java.util.List<androidx.car.app.navigation.model.TravelEstimate!> getDestinationTravelEstimates();
+ method public java.util.List<androidx.car.app.navigation.model.Destination!> getDestinations();
+ method public java.util.List<androidx.car.app.navigation.model.TravelEstimate!> getStepTravelEstimates();
+ method public java.util.List<androidx.car.app.navigation.model.Step!> getSteps();
+ method public boolean isLoading();
+ }
+
+ public static final class Trip.Builder {
+ ctor public Trip.Builder();
+ method public androidx.car.app.navigation.model.Trip.Builder addDestination(androidx.car.app.navigation.model.Destination, androidx.car.app.navigation.model.TravelEstimate);
+ method public androidx.car.app.navigation.model.Trip.Builder addStep(androidx.car.app.navigation.model.Step, androidx.car.app.navigation.model.TravelEstimate);
+ method public androidx.car.app.navigation.model.Trip build();
+ method public androidx.car.app.navigation.model.Trip.Builder setCurrentRoad(CharSequence);
+ method public androidx.car.app.navigation.model.Trip.Builder setLoading(boolean);
+ }
+
+}
+
+package androidx.car.app.notification {
+
+ public final class CarAppExtender implements androidx.core.app.NotificationCompat.Extender {
+ ctor public CarAppExtender(android.app.Notification);
+ method public androidx.core.app.NotificationCompat.Builder extend(androidx.core.app.NotificationCompat.Builder);
+ method public java.util.List<android.app.Notification.Action!> getActions();
+ method public String? getChannelId();
+ method public androidx.car.app.model.CarColor? getColor();
+ method public android.app.PendingIntent? getContentIntent();
+ method public CharSequence? getContentText();
+ method public CharSequence? getContentTitle();
+ method public android.app.PendingIntent? getDeleteIntent();
+ method public int getImportance();
+ method public android.graphics.Bitmap? getLargeIcon();
+ method @DrawableRes public int getSmallIcon();
+ method public static boolean isExtended(android.app.Notification);
+ }
+
+ public static final class CarAppExtender.Builder {
+ ctor public CarAppExtender.Builder();
+ method public androidx.car.app.notification.CarAppExtender.Builder addAction(@DrawableRes int, CharSequence, android.app.PendingIntent);
+ method public androidx.car.app.notification.CarAppExtender build();
+ method public androidx.car.app.notification.CarAppExtender.Builder setChannelId(String);
+ method public androidx.car.app.notification.CarAppExtender.Builder setColor(androidx.car.app.model.CarColor);
+ method public androidx.car.app.notification.CarAppExtender.Builder setContentIntent(android.app.PendingIntent);
+ method public androidx.car.app.notification.CarAppExtender.Builder setContentText(CharSequence);
+ method public androidx.car.app.notification.CarAppExtender.Builder setContentTitle(CharSequence);
+ method public androidx.car.app.notification.CarAppExtender.Builder setDeleteIntent(android.app.PendingIntent);
+ method public androidx.car.app.notification.CarAppExtender.Builder setImportance(int);
+ method public androidx.car.app.notification.CarAppExtender.Builder setLargeIcon(android.graphics.Bitmap);
+ method public androidx.car.app.notification.CarAppExtender.Builder setSmallIcon(int);
+ }
+
+ public final class CarNotificationManager {
+ method public boolean areNotificationsEnabled();
+ method public void cancel(int);
+ method public void cancel(String?, int);
+ method public void cancelAll();
+ method public void createNotificationChannel(androidx.core.app.NotificationChannelCompat);
+ method public void createNotificationChannelGroup(androidx.core.app.NotificationChannelGroupCompat);
+ method public void createNotificationChannelGroups(java.util.List<androidx.core.app.NotificationChannelGroupCompat!>);
+ method public void createNotificationChannels(java.util.List<androidx.core.app.NotificationChannelCompat!>);
+ method public void deleteNotificationChannel(String);
+ method public void deleteNotificationChannelGroup(String);
+ method public void deleteUnlistedNotificationChannels(java.util.Collection<java.lang.String!>);
+ method public static androidx.car.app.notification.CarNotificationManager from(android.content.Context);
+ method public static java.util.Set<java.lang.String!> getEnabledListenerPackages(android.content.Context);
+ method public int getImportance();
+ method public androidx.core.app.NotificationChannelCompat? getNotificationChannel(String);
+ method public androidx.core.app.NotificationChannelCompat? getNotificationChannel(String, String);
+ method public androidx.core.app.NotificationChannelGroupCompat? getNotificationChannelGroup(String);
+ method public java.util.List<androidx.core.app.NotificationChannelGroupCompat!> getNotificationChannelGroups();
+ method public java.util.List<androidx.core.app.NotificationChannelCompat!> getNotificationChannels();
+ method public void notify(int, androidx.core.app.NotificationCompat.Builder);
+ method public void notify(String?, int, androidx.core.app.NotificationCompat.Builder);
+ }
+
+ public final class CarPendingIntent {
+ method public static android.app.PendingIntent getCarApp(android.content.Context, int, android.content.Intent, int);
+ }
+
+}
+
+package androidx.car.app.serialization {
+
+ public final class Bundleable implements android.os.Parcelable {
+ method public static androidx.car.app.serialization.Bundleable create(Object) throws androidx.car.app.serialization.BundlerException;
+ method public int describeContents();
+ method public Object get() throws androidx.car.app.serialization.BundlerException;
+ method public void writeToParcel(android.os.Parcel, int);
+ field public static final android.os.Parcelable.Creator<androidx.car.app.serialization.Bundleable!> CREATOR;
+ }
+
+ public class BundlerException extends java.lang.Exception {
+ ctor public BundlerException(String?, Throwable);
+ ctor public BundlerException(String?);
+ }
+
+}
+
+package androidx.car.app.validation {
+
+ public final class HostValidator {
+ method public java.util.Map<java.lang.String!,java.util.List<java.lang.String!>!> getAllowedHosts();
+ method public boolean isValidHost(androidx.car.app.HostInfo);
+ field public static final androidx.car.app.validation.HostValidator ALLOW_ALL_HOSTS_VALIDATOR;
+ field public static final String TEMPLATE_RENDERER_PERMISSION = "android.car.permission.TEMPLATE_RENDERER";
+ }
+
+ public static final class HostValidator.Builder {
+ ctor public HostValidator.Builder(android.content.Context);
+ method public androidx.car.app.validation.HostValidator.Builder addAllowedHost(String, String);
+ method public androidx.car.app.validation.HostValidator.Builder addAllowedHosts(@ArrayRes int);
+ method public androidx.car.app.validation.HostValidator build();
+ }
+
+}
+
+package androidx.car.app.versioning {
+
+ public final class CarAppApiLevels {
+ method public static int getLatest();
+ method public static int getOldest();
+ field public static final int LEVEL_1 = 1; // 0x1
+ field public static final int LEVEL_2 = 2; // 0x2
+ field public static final int LEVEL_3 = 3; // 0x3
+ }
+
+}
+
diff --git a/car/app/app/api/res-1.1.0-beta01.txt b/car/app/app/api/res-1.1.0-beta01.txt
new file mode 100644
index 0000000..686fc80
--- /dev/null
+++ b/car/app/app/api/res-1.1.0-beta01.txt
@@ -0,0 +1,5 @@
+attr carColorPrimary
+attr carColorPrimaryDark
+attr carColorSecondary
+attr carColorSecondaryDark
+attr carPermissionActivityLayout
diff --git a/car/app/app/api/restricted_1.1.0-beta01.txt b/car/app/app/api/restricted_1.1.0-beta01.txt
new file mode 100644
index 0000000..d0323fd
--- /dev/null
+++ b/car/app/app/api/restricted_1.1.0-beta01.txt
@@ -0,0 +1,1421 @@
+// Signature format: 4.0
+package androidx.car.app {
+
+ @androidx.car.app.annotations.CarProtocol public final class AppInfo {
+ ctor @VisibleForTesting public AppInfo(int, int, String);
+ method public int getLatestCarAppApiLevel();
+ method public String getLibraryDisplayVersion();
+ method public int getMinCarAppApiLevel();
+ field public static final String MIN_API_LEVEL_METADATA_KEY = "androidx.car.app.minCarApiLevel";
+ }
+
+ public class AppManager implements androidx.car.app.managers.Manager {
+ method public void invalidate();
+ method public void setSurfaceCallback(androidx.car.app.SurfaceCallback?);
+ method public void showToast(CharSequence, int);
+ }
+
+ public final class CarAppPermission {
+ method public static void checkHasLibraryPermission(android.content.Context, String);
+ method public static void checkHasPermission(android.content.Context, String);
+ field public static final String ACCESS_SURFACE = "androidx.car.app.ACCESS_SURFACE";
+ field public static final String MAP_TEMPLATES = "androidx.car.app.MAP_TEMPLATES";
+ field public static final String NAVIGATION_TEMPLATES = "androidx.car.app.NAVIGATION_TEMPLATES";
+ }
+
+ public abstract class CarAppService extends android.app.Service {
+ ctor public CarAppService();
+ method public abstract androidx.car.app.validation.HostValidator createHostValidator();
+ method @CallSuper public final void dump(java.io.FileDescriptor, java.io.PrintWriter, String![]?);
+ method public final androidx.car.app.Session? getCurrentSession();
+ method public final androidx.car.app.HostInfo? getHostInfo();
+ method @CallSuper public final android.os.IBinder onBind(android.content.Intent);
+ method public abstract androidx.car.app.Session onCreateSession();
+ method public final boolean onUnbind(android.content.Intent);
+ field public static final String CATEGORY_CHARGING_APP = "androidx.car.app.category.CHARGING";
+ field public static final String CATEGORY_NAVIGATION_APP = "androidx.car.app.category.NAVIGATION";
+ field public static final String CATEGORY_PARKING_APP = "androidx.car.app.category.PARKING";
+ field public static final String SERVICE_INTERFACE = "androidx.car.app.CarAppService";
+ }
+
+ public class CarContext extends android.content.ContextWrapper {
+ method public void finishCarApp();
+ method @androidx.car.app.annotations.RequiresCarApi(2) public android.content.ComponentName? getCallingComponent();
+ method public int getCarAppApiLevel();
+ method public Object getCarService(String);
+ method public <T> T getCarService(Class<T!>);
+ method public String getCarServiceName(Class<?>);
+ method public androidx.car.app.HostInfo? getHostInfo();
+ method public androidx.activity.OnBackPressedDispatcher getOnBackPressedDispatcher();
+ method public boolean isDarkMode();
+ method public void requestPermissions(java.util.List<java.lang.String!>, androidx.car.app.OnRequestPermissionsListener);
+ method public void requestPermissions(java.util.List<java.lang.String!>, java.util.concurrent.Executor, androidx.car.app.OnRequestPermissionsListener);
+ method @androidx.car.app.annotations.RequiresCarApi(2) public void setCarAppResult(int, android.content.Intent?);
+ method public void startCarApp(android.content.Intent);
+ method @Deprecated public static void startCarApp(android.content.Intent, android.content.Intent);
+ field public static final String ACTION_NAVIGATE = "androidx.car.app.action.NAVIGATE";
+ field public static final String APP_SERVICE = "app";
+ field public static final String CAR_SERVICE = "car";
+ field @androidx.car.app.annotations.RequiresCarApi(2) public static final String CONSTRAINT_SERVICE = "constraints";
+ field public static final String EXTRA_START_CAR_APP_BINDER_KEY = "androidx.car.app.extra.START_CAR_APP_BINDER_KEY";
+ field @androidx.car.app.annotations.RequiresCarApi(3) public static final String HARDWARE_SERVICE = "hardware";
+ field public static final String NAVIGATION_SERVICE = "navigation";
+ field public static final String SCREEN_SERVICE = "screen";
+ }
+
+ public final class CarToast {
+ method public static androidx.car.app.CarToast makeText(androidx.car.app.CarContext, @StringRes int, int);
+ method public static androidx.car.app.CarToast makeText(androidx.car.app.CarContext, CharSequence, int);
+ method public void setDuration(int);
+ method public void setText(@StringRes int);
+ method public void setText(CharSequence);
+ method public void show();
+ field public static final int LENGTH_LONG = 1; // 0x1
+ field public static final int LENGTH_SHORT = 0; // 0x0
+ }
+
+ @androidx.car.app.annotations.CarProtocol public final class FailureResponse {
+ ctor public FailureResponse(Throwable);
+ method public int getErrorType();
+ method public String getStackTrace();
+ field public static final int BUNDLER_EXCEPTION = 1; // 0x1
+ field public static final int ILLEGAL_STATE_EXCEPTION = 2; // 0x2
+ field public static final int INVALID_PARAMETER_EXCEPTION = 3; // 0x3
+ field public static final int REMOTE_EXCEPTION = 6; // 0x6
+ field public static final int RUNTIME_EXCEPTION = 5; // 0x5
+ field public static final int SECURITY_EXCEPTION = 4; // 0x4
+ field public static final int UNKNOWN_ERROR = 0; // 0x0
+ }
+
+ @androidx.car.app.annotations.CarProtocol public final class HandshakeInfo {
+ ctor public HandshakeInfo(String, int);
+ method public int getHostCarAppApiLevel();
+ method public String getHostPackageName();
+ }
+
+ public final class HostException extends java.lang.RuntimeException {
+ ctor public HostException(String);
+ ctor public HostException(String, Throwable);
+ ctor public HostException(Throwable);
+ }
+
+ public final class HostInfo {
+ ctor public HostInfo(String, int);
+ method public String getPackageName();
+ method public int getUid();
+ }
+
+ @androidx.car.app.annotations.CarProtocol public interface OnDoneCallback {
+ method public default void onFailure(androidx.car.app.serialization.Bundleable);
+ method public default void onSuccess(androidx.car.app.serialization.Bundleable?);
+ }
+
+ public interface OnRequestPermissionsListener {
+ method public void onRequestPermissionsResult(java.util.List<java.lang.String!>, java.util.List<java.lang.String!>);
+ }
+
+ public interface OnScreenResultListener {
+ method public void onScreenResult(Object?);
+ }
+
+ public abstract class Screen implements androidx.lifecycle.LifecycleOwner {
+ ctor protected Screen(androidx.car.app.CarContext);
+ method public final void finish();
+ method public final androidx.car.app.CarContext getCarContext();
+ method public final androidx.lifecycle.Lifecycle getLifecycle();
+ method public String? getMarker();
+ method public final androidx.car.app.ScreenManager getScreenManager();
+ method public final void invalidate();
+ method public abstract androidx.car.app.model.Template onGetTemplate();
+ method public void setMarker(String?);
+ method public void setResult(Object?);
+ }
+
+ @MainThread public class ScreenManager implements androidx.car.app.managers.Manager {
+ method public int getStackSize();
+ method public androidx.car.app.Screen getTop();
+ method public void pop();
+ method public void popTo(String);
+ method public void popToRoot();
+ method public void push(androidx.car.app.Screen);
+ method public void pushForResult(androidx.car.app.Screen, androidx.car.app.OnScreenResultListener);
+ method public void remove(androidx.car.app.Screen);
+ }
+
+ public abstract class Session implements androidx.lifecycle.LifecycleOwner {
+ ctor public Session();
+ method public final androidx.car.app.CarContext getCarContext();
+ method public androidx.lifecycle.Lifecycle getLifecycle();
+ method public void onCarConfigurationChanged(android.content.res.Configuration);
+ method public abstract androidx.car.app.Screen onCreateScreen(android.content.Intent);
+ method public void onNewIntent(android.content.Intent);
+ }
+
+ public interface SurfaceCallback {
+ method @androidx.car.app.annotations.RequiresCarApi(2) public default void onFling(float, float);
+ method @androidx.car.app.annotations.RequiresCarApi(2) public default void onScale(float, float, float);
+ method @androidx.car.app.annotations.RequiresCarApi(2) public default void onScroll(float, float);
+ method public default void onStableAreaChanged(android.graphics.Rect);
+ method public default void onSurfaceAvailable(androidx.car.app.SurfaceContainer);
+ method public default void onSurfaceDestroyed(androidx.car.app.SurfaceContainer);
+ method public default void onVisibleAreaChanged(android.graphics.Rect);
+ }
+
+ @androidx.car.app.annotations.CarProtocol public final class SurfaceContainer {
+ ctor public SurfaceContainer(android.view.Surface?, int, int, int);
+ method public int getDpi();
+ method public int getHeight();
+ method public android.view.Surface? getSurface();
+ method public int getWidth();
+ }
+
+}
+
+package androidx.car.app.annotations {
+
+ @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @java.lang.annotation.Target({java.lang.annotation.ElementType.TYPE, java.lang.annotation.ElementType.PARAMETER}) public @interface CarProtocol {
+ }
+
+ @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.RUNTIME) @java.lang.annotation.Target({java.lang.annotation.ElementType.TYPE, java.lang.annotation.ElementType.CONSTRUCTOR, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.METHOD}) public @interface RequiresCarApi {
+ method public abstract int value();
+ }
+
+}
+
+package androidx.car.app.connection {
+
+ public final class CarConnection {
+ ctor public CarConnection(android.content.Context);
+ method public androidx.lifecycle.LiveData<java.lang.Integer!> getType();
+ field public static final String ACTION_CAR_CONNECTION_UPDATED = "androidx.car.app.connection.action.CAR_CONNECTION_UPDATED";
+ field public static final String CAR_CONNECTION_STATE = "CarConnectionState";
+ field public static final int CONNECTION_TYPE_NATIVE = 1; // 0x1
+ field public static final int CONNECTION_TYPE_NOT_CONNECTED = 0; // 0x0
+ field public static final int CONNECTION_TYPE_PROJECTION = 2; // 0x2
+ }
+
+}
+
+package androidx.car.app.constraints {
+
+ @androidx.car.app.annotations.RequiresCarApi(2) public class ConstraintManager implements androidx.car.app.managers.Manager {
+ method public int getContentLimit(int);
+ field public static final int CONTENT_LIMIT_TYPE_GRID = 1; // 0x1
+ field public static final int CONTENT_LIMIT_TYPE_LIST = 0; // 0x0
+ field public static final int CONTENT_LIMIT_TYPE_PANE = 4; // 0x4
+ field public static final int CONTENT_LIMIT_TYPE_PLACE_LIST = 2; // 0x2
+ field public static final int CONTENT_LIMIT_TYPE_ROUTE_LIST = 3; // 0x3
+ }
+
+}
+
+package androidx.car.app.hardware {
+
+ @MainThread @androidx.car.app.annotations.RequiresCarApi(3) public interface CarHardwareManager extends androidx.car.app.managers.Manager {
+ method public default androidx.car.app.hardware.info.CarInfo getCarInfo();
+ method public default androidx.car.app.hardware.info.CarSensors getCarSensors();
+ }
+
+}
+
+package androidx.car.app.hardware.common {
+
+ @androidx.car.app.annotations.CarProtocol @androidx.car.app.annotations.RequiresCarApi(3) public final class CarUnit {
+ field public static final int KILOMETER = 3; // 0x3
+ field public static final int KILOMETERS_PER_HOUR = 102; // 0x66
+ field public static final int METER = 2; // 0x2
+ field public static final int METERS_PER_SEC = 101; // 0x65
+ field public static final int MILE = 4; // 0x4
+ field public static final int MILES_PER_HOUR = 103; // 0x67
+ field public static final int MILLIMETER = 1; // 0x1
+ }
+
+ @androidx.car.app.annotations.CarProtocol @androidx.car.app.annotations.RequiresCarApi(3) public final class CarValue<T> {
+ ctor public CarValue(T?, long, int);
+ method public int getStatus();
+ method public long getTimestampMillis();
+ method public T? getValue();
+ field public static final int STATUS_SUCCESS = 1; // 0x1
+ field public static final int STATUS_UNAVAILABLE = 3; // 0x3
+ field public static final int STATUS_UNIMPLEMENTED = 2; // 0x2
+ field public static final int STATUS_UNKNOWN = 0; // 0x0
+ }
+
+ @androidx.car.app.annotations.CarProtocol @androidx.car.app.annotations.RequiresCarApi(3) public interface OnCarDataAvailableListener<T> {
+ method public void onCarDataAvailable(T);
+ }
+
+}
+
+package androidx.car.app.hardware.info {
+
+ @androidx.car.app.annotations.CarProtocol @androidx.car.app.annotations.RequiresCarApi(3) public final class Accelerometer {
+ ctor public Accelerometer(androidx.car.app.hardware.common.CarValue<java.util.List<java.lang.Float!>!>);
+ method public androidx.car.app.hardware.common.CarValue<java.util.List<java.lang.Float!>!> getForces();
+ }
+
+ @androidx.car.app.annotations.CarProtocol @androidx.car.app.annotations.RequiresCarApi(3) public final class CarHardwareLocation {
+ ctor public CarHardwareLocation(androidx.car.app.hardware.common.CarValue<android.location.Location!>);
+ method public androidx.car.app.hardware.common.CarValue<android.location.Location!> getLocation();
+ }
+
+ @MainThread @androidx.car.app.annotations.RequiresCarApi(3) public interface CarInfo {
+ method public void addEnergyLevelListener(java.util.concurrent.Executor, androidx.car.app.hardware.common.OnCarDataAvailableListener<androidx.car.app.hardware.info.EnergyLevel!>);
+ method public void addMileageListener(java.util.concurrent.Executor, androidx.car.app.hardware.common.OnCarDataAvailableListener<androidx.car.app.hardware.info.Mileage!>);
+ method public void addSpeedListener(java.util.concurrent.Executor, androidx.car.app.hardware.common.OnCarDataAvailableListener<androidx.car.app.hardware.info.Speed!>);
+ method public void addTollListener(java.util.concurrent.Executor, androidx.car.app.hardware.common.OnCarDataAvailableListener<androidx.car.app.hardware.info.TollCard!>);
+ method public void fetchEnergyProfile(java.util.concurrent.Executor, androidx.car.app.hardware.common.OnCarDataAvailableListener<androidx.car.app.hardware.info.EnergyProfile!>);
+ method public void fetchModel(java.util.concurrent.Executor, androidx.car.app.hardware.common.OnCarDataAvailableListener<androidx.car.app.hardware.info.Model!>);
+ method public void removeEnergyLevelListener(androidx.car.app.hardware.common.OnCarDataAvailableListener<androidx.car.app.hardware.info.EnergyLevel!>);
+ method public void removeMileageListener(androidx.car.app.hardware.common.OnCarDataAvailableListener<androidx.car.app.hardware.info.Mileage!>);
+ method public void removeSpeedListener(androidx.car.app.hardware.common.OnCarDataAvailableListener<androidx.car.app.hardware.info.Speed!>);
+ method public void removeTollListener(androidx.car.app.hardware.common.OnCarDataAvailableListener<androidx.car.app.hardware.info.TollCard!>);
+ }
+
+ @MainThread @androidx.car.app.annotations.RequiresCarApi(3) public interface CarSensors {
+ method public void addAccelerometerListener(int, java.util.concurrent.Executor, androidx.car.app.hardware.common.OnCarDataAvailableListener<androidx.car.app.hardware.info.Accelerometer!>);
+ method public void addCarHardwareLocationListener(int, java.util.concurrent.Executor, androidx.car.app.hardware.common.OnCarDataAvailableListener<androidx.car.app.hardware.info.CarHardwareLocation!>);
+ method public void addCompassListener(int, java.util.concurrent.Executor, androidx.car.app.hardware.common.OnCarDataAvailableListener<androidx.car.app.hardware.info.Compass!>);
+ method public void addGyroscopeListener(int, java.util.concurrent.Executor, androidx.car.app.hardware.common.OnCarDataAvailableListener<androidx.car.app.hardware.info.Gyroscope!>);
+ method public void removeAccelerometerListener(androidx.car.app.hardware.common.OnCarDataAvailableListener<androidx.car.app.hardware.info.Accelerometer!>);
+ method public void removeCarHardwareLocationListener(androidx.car.app.hardware.common.OnCarDataAvailableListener<androidx.car.app.hardware.info.CarHardwareLocation!>);
+ method public void removeCompassListener(androidx.car.app.hardware.common.OnCarDataAvailableListener<androidx.car.app.hardware.info.Compass!>);
+ method public void removeGyroscopeListener(androidx.car.app.hardware.common.OnCarDataAvailableListener<androidx.car.app.hardware.info.Gyroscope!>);
+ field public static final int UPDATE_RATE_FASTEST = 3; // 0x3
+ field public static final int UPDATE_RATE_NORMAL = 1; // 0x1
+ field public static final int UPDATE_RATE_UI = 2; // 0x2
+ }
+
+ @androidx.car.app.annotations.CarProtocol @androidx.car.app.annotations.RequiresCarApi(3) public final class Compass {
+ ctor public Compass(androidx.car.app.hardware.common.CarValue<java.util.List<java.lang.Float!>!>);
+ method public androidx.car.app.hardware.common.CarValue<java.util.List<java.lang.Float!>!> getOrientations();
+ }
+
+ @androidx.car.app.annotations.CarProtocol @androidx.car.app.annotations.RequiresCarApi(3) public final class EnergyLevel {
+ method public androidx.car.app.hardware.common.CarValue<java.lang.Float!> getBatteryPercent();
+ method public androidx.car.app.hardware.common.CarValue<java.lang.Integer!> getDistanceDisplayUnit();
+ method public androidx.car.app.hardware.common.CarValue<java.lang.Boolean!> getEnergyIsLow();
+ method public androidx.car.app.hardware.common.CarValue<java.lang.Float!> getFuelPercent();
+ method public androidx.car.app.hardware.common.CarValue<java.lang.Float!> getRangeRemainingMeters();
+ }
+
+ public static final class EnergyLevel.Builder {
+ ctor public EnergyLevel.Builder();
+ method public androidx.car.app.hardware.info.EnergyLevel build();
+ method public androidx.car.app.hardware.info.EnergyLevel.Builder setBatteryPercent(androidx.car.app.hardware.common.CarValue<java.lang.Float!>);
+ method public androidx.car.app.hardware.info.EnergyLevel.Builder setDistanceDisplayUnit(androidx.car.app.hardware.common.CarValue<java.lang.Integer!>);
+ method public androidx.car.app.hardware.info.EnergyLevel.Builder setEnergyIsLow(androidx.car.app.hardware.common.CarValue<java.lang.Boolean!>);
+ method public androidx.car.app.hardware.info.EnergyLevel.Builder setFuelPercent(androidx.car.app.hardware.common.CarValue<java.lang.Float!>);
+ method public androidx.car.app.hardware.info.EnergyLevel.Builder setRangeRemainingMeters(androidx.car.app.hardware.common.CarValue<java.lang.Float!>);
+ }
+
+ @androidx.car.app.annotations.CarProtocol @androidx.car.app.annotations.RequiresCarApi(3) public final class EnergyProfile {
+ method public androidx.car.app.hardware.common.CarValue<java.util.List<java.lang.Integer!>!> getEvConnectorTypes();
+ method public androidx.car.app.hardware.common.CarValue<java.util.List<java.lang.Integer!>!> getFuelTypes();
+ field public static final int EVCONNECTOR_TYPE_CHADEMO = 3; // 0x3
+ field public static final int EVCONNECTOR_TYPE_COMBO_1 = 4; // 0x4
+ field public static final int EVCONNECTOR_TYPE_COMBO_2 = 5; // 0x5
+ field public static final int EVCONNECTOR_TYPE_GBT = 9; // 0x9
+ field public static final int EVCONNECTOR_TYPE_GBT_DC = 10; // 0xa
+ field public static final int EVCONNECTOR_TYPE_J1772 = 1; // 0x1
+ field public static final int EVCONNECTOR_TYPE_MENNEKES = 2; // 0x2
+ field public static final int EVCONNECTOR_TYPE_OTHER = 101; // 0x65
+ field public static final int EVCONNECTOR_TYPE_SCAME = 11; // 0xb
+ field public static final int EVCONNECTOR_TYPE_TESLA_HPWC = 7; // 0x7
+ field public static final int EVCONNECTOR_TYPE_TESLA_ROADSTER = 6; // 0x6
+ field public static final int EVCONNECTOR_TYPE_TESLA_SUPERCHARGER = 8; // 0x8
+ field public static final int EVCONNECTOR_TYPE_UNKNOWN = 0; // 0x0
+ field public static final int FUEL_TYPE_BIODIESEL = 5; // 0x5
+ field public static final int FUEL_TYPE_CNG = 8; // 0x8
+ field public static final int FUEL_TYPE_DIESEL_1 = 3; // 0x3
+ field public static final int FUEL_TYPE_DIESEL_2 = 4; // 0x4
+ field public static final int FUEL_TYPE_E85 = 6; // 0x6
+ field public static final int FUEL_TYPE_ELECTRIC = 10; // 0xa
+ field public static final int FUEL_TYPE_HYDROGEN = 11; // 0xb
+ field public static final int FUEL_TYPE_LEADED = 2; // 0x2
+ field public static final int FUEL_TYPE_LNG = 9; // 0x9
+ field public static final int FUEL_TYPE_LPG = 7; // 0x7
+ field public static final int FUEL_TYPE_OTHER = 12; // 0xc
+ field public static final int FUEL_TYPE_UNKNOWN = 0; // 0x0
+ field public static final int FUEL_TYPE_UNLEADED = 1; // 0x1
+ }
+
+ public static final class EnergyProfile.Builder {
+ ctor public EnergyProfile.Builder();
+ method public androidx.car.app.hardware.info.EnergyProfile build();
+ method public androidx.car.app.hardware.info.EnergyProfile.Builder setEvConnectorTypes(androidx.car.app.hardware.common.CarValue<java.util.List<java.lang.Integer!>!>);
+ method public androidx.car.app.hardware.info.EnergyProfile.Builder setFuelTypes(androidx.car.app.hardware.common.CarValue<java.util.List<java.lang.Integer!>!>);
+ }
+
+ @androidx.car.app.annotations.CarProtocol @androidx.car.app.annotations.RequiresCarApi(3) public final class Gyroscope {
+ ctor public Gyroscope(androidx.car.app.hardware.common.CarValue<java.util.List<java.lang.Float!>!>);
+ method public androidx.car.app.hardware.common.CarValue<java.util.List<java.lang.Float!>!> getRotations();
+ }
+
+ @androidx.car.app.annotations.CarProtocol @androidx.car.app.annotations.RequiresCarApi(3) public final class Mileage {
+ method public androidx.car.app.hardware.common.CarValue<java.lang.Integer!> getDistanceDisplayUnit();
+ method public androidx.car.app.hardware.common.CarValue<java.lang.Float!> getOdometerMeters();
+ }
+
+ public static final class Mileage.Builder {
+ ctor public Mileage.Builder();
+ method public androidx.car.app.hardware.info.Mileage build();
+ method public androidx.car.app.hardware.info.Mileage.Builder setDistanceDisplayUnit(androidx.car.app.hardware.common.CarValue<java.lang.Integer!>);
+ method public androidx.car.app.hardware.info.Mileage.Builder setOdometerMeters(androidx.car.app.hardware.common.CarValue<java.lang.Float!>);
+ }
+
+ @androidx.car.app.annotations.CarProtocol @androidx.car.app.annotations.RequiresCarApi(3) public final class Model {
+ method public androidx.car.app.hardware.common.CarValue<java.lang.String!> getManufacturer();
+ method public androidx.car.app.hardware.common.CarValue<java.lang.String!> getName();
+ method public androidx.car.app.hardware.common.CarValue<java.lang.Integer!> getYear();
+ }
+
+ public static final class Model.Builder {
+ ctor public Model.Builder();
+ method public androidx.car.app.hardware.info.Model build();
+ method public androidx.car.app.hardware.info.Model.Builder setManufacturer(androidx.car.app.hardware.common.CarValue<java.lang.String!>);
+ method public androidx.car.app.hardware.info.Model.Builder setName(androidx.car.app.hardware.common.CarValue<java.lang.String!>);
+ method public androidx.car.app.hardware.info.Model.Builder setYear(androidx.car.app.hardware.common.CarValue<java.lang.Integer!>);
+ }
+
+ @androidx.car.app.annotations.CarProtocol @androidx.car.app.annotations.RequiresCarApi(3) public final class Speed {
+ method public androidx.car.app.hardware.common.CarValue<java.lang.Float!> getDisplaySpeedMetersPerSecond();
+ method public androidx.car.app.hardware.common.CarValue<java.lang.Float!> getRawSpeedMetersPerSecond();
+ method public androidx.car.app.hardware.common.CarValue<java.lang.Integer!> getSpeedDisplayUnit();
+ }
+
+ public static final class Speed.Builder {
+ ctor public Speed.Builder();
+ method public androidx.car.app.hardware.info.Speed build();
+ method public androidx.car.app.hardware.info.Speed.Builder setDisplaySpeedMetersPerSecond(androidx.car.app.hardware.common.CarValue<java.lang.Float!>);
+ method public androidx.car.app.hardware.info.Speed.Builder setRawSpeedMetersPerSecond(androidx.car.app.hardware.common.CarValue<java.lang.Float!>);
+ method public androidx.car.app.hardware.info.Speed.Builder setSpeedDisplayUnit(androidx.car.app.hardware.common.CarValue<java.lang.Integer!>);
+ }
+
+ @androidx.car.app.annotations.CarProtocol @androidx.car.app.annotations.RequiresCarApi(3) public final class TollCard {
+ method public androidx.car.app.hardware.common.CarValue<java.lang.Integer!> getCardState();
+ field public static final int TOLLCARD_STATE_INVALID = 2; // 0x2
+ field public static final int TOLLCARD_STATE_NOT_INSERTED = 3; // 0x3
+ field public static final int TOLLCARD_STATE_UNKNOWN = 0; // 0x0
+ field public static final int TOLLCARD_STATE_VALID = 1; // 0x1
+ }
+
+ public static final class TollCard.Builder {
+ ctor public TollCard.Builder();
+ method public androidx.car.app.hardware.info.TollCard build();
+ method public androidx.car.app.hardware.info.TollCard.Builder setCardState(androidx.car.app.hardware.common.CarValue<java.lang.Integer!>);
+ }
+
+}
+
+package androidx.car.app.managers {
+
+ public interface Manager {
+ }
+
+}
+
+package androidx.car.app.model {
+
+ @androidx.car.app.annotations.CarProtocol public final class Action {
+ method public androidx.car.app.model.CarColor? getBackgroundColor();
+ method public androidx.car.app.model.CarIcon? getIcon();
+ method public androidx.car.app.model.OnClickDelegate? getOnClickDelegate();
+ method public androidx.car.app.model.CarText? getTitle();
+ method public int getType();
+ method public boolean isStandard();
+ method public static String typeToString(int);
+ field public static final androidx.car.app.model.Action APP_ICON;
+ field public static final androidx.car.app.model.Action BACK;
+ field public static final androidx.car.app.model.Action PAN;
+ field public static final int TYPE_APP_ICON = 65538; // 0x10002
+ field public static final int TYPE_BACK = 65539; // 0x10003
+ field public static final int TYPE_CUSTOM = 1; // 0x1
+ field public static final int TYPE_PAN = 65540; // 0x10004
+ }
+
+ public static final class Action.Builder {
+ ctor public Action.Builder();
+ ctor @androidx.car.app.annotations.RequiresCarApi(2) public Action.Builder(androidx.car.app.model.Action);
+ method public androidx.car.app.model.Action build();
+ method public androidx.car.app.model.Action.Builder setBackgroundColor(androidx.car.app.model.CarColor);
+ method public androidx.car.app.model.Action.Builder setIcon(androidx.car.app.model.CarIcon);
+ method public androidx.car.app.model.Action.Builder setOnClickListener(androidx.car.app.model.OnClickListener);
+ method public androidx.car.app.model.Action.Builder setTitle(CharSequence);
+ method public androidx.car.app.model.Action.Builder setTitle(androidx.car.app.model.CarText);
+ }
+
+ @androidx.car.app.annotations.CarProtocol public final class ActionStrip {
+ method public java.util.List<androidx.car.app.model.Action!> getActions();
+ method public androidx.car.app.model.Action? getFirstActionOfType(int);
+ }
+
+ public static final class ActionStrip.Builder {
+ ctor public ActionStrip.Builder();
+ method public androidx.car.app.model.ActionStrip.Builder addAction(androidx.car.app.model.Action);
+ method public androidx.car.app.model.ActionStrip build();
+ }
+
+ @androidx.car.app.annotations.CarProtocol public final class CarColor {
+ method public static androidx.car.app.model.CarColor createCustom(@ColorInt int, @ColorInt int);
+ method @ColorInt public int getColor();
+ method @ColorInt public int getColorDark();
+ method public int getType();
+ field public static final androidx.car.app.model.CarColor BLUE;
+ field public static final androidx.car.app.model.CarColor DEFAULT;
+ field public static final androidx.car.app.model.CarColor GREEN;
+ field public static final androidx.car.app.model.CarColor PRIMARY;
+ field public static final androidx.car.app.model.CarColor RED;
+ field public static final androidx.car.app.model.CarColor SECONDARY;
+ field public static final int TYPE_BLUE = 6; // 0x6
+ field public static final int TYPE_CUSTOM = 0; // 0x0
+ field public static final int TYPE_DEFAULT = 1; // 0x1
+ field public static final int TYPE_GREEN = 5; // 0x5
+ field public static final int TYPE_PRIMARY = 2; // 0x2
+ field public static final int TYPE_RED = 4; // 0x4
+ field public static final int TYPE_SECONDARY = 3; // 0x3
+ field public static final int TYPE_YELLOW = 7; // 0x7
+ field public static final androidx.car.app.model.CarColor YELLOW;
+ }
+
+ @androidx.car.app.annotations.CarProtocol public final class CarIcon {
+ method public androidx.core.graphics.drawable.IconCompat? getIcon();
+ method public androidx.car.app.model.CarColor? getTint();
+ method public int getType();
+ field public static final androidx.car.app.model.CarIcon ALERT;
+ field public static final androidx.car.app.model.CarIcon APP_ICON;
+ field public static final androidx.car.app.model.CarIcon BACK;
+ field public static final androidx.car.app.model.CarIcon ERROR;
+ field @androidx.car.app.annotations.RequiresCarApi(2) public static final androidx.car.app.model.CarIcon PAN;
+ field public static final int TYPE_ALERT = 4; // 0x4
+ field public static final int TYPE_APP_ICON = 5; // 0x5
+ field public static final int TYPE_BACK = 3; // 0x3
+ field public static final int TYPE_CUSTOM = 1; // 0x1
+ field public static final int TYPE_ERROR = 6; // 0x6
+ field public static final int TYPE_PAN = 7; // 0x7
+ }
+
+ public static final class CarIcon.Builder {
+ ctor public CarIcon.Builder(androidx.core.graphics.drawable.IconCompat);
+ ctor public CarIcon.Builder(androidx.car.app.model.CarIcon);
+ method public androidx.car.app.model.CarIcon build();
+ method public androidx.car.app.model.CarIcon.Builder setTint(androidx.car.app.model.CarColor);
+ }
+
+ @androidx.car.app.annotations.CarProtocol public final class CarIconSpan extends androidx.car.app.model.CarSpan {
+ method public static androidx.car.app.model.CarIconSpan create(androidx.car.app.model.CarIcon);
+ method public static androidx.car.app.model.CarIconSpan create(androidx.car.app.model.CarIcon, int);
+ method public int getAlignment();
+ method public androidx.car.app.model.CarIcon getIcon();
+ field public static final int ALIGN_BASELINE = 1; // 0x1
+ field public static final int ALIGN_BOTTOM = 0; // 0x0
+ field public static final int ALIGN_CENTER = 2; // 0x2
+ }
+
+ @androidx.car.app.annotations.CarProtocol public final class CarLocation {
+ method public static androidx.car.app.model.CarLocation create(double, double);
+ method public static androidx.car.app.model.CarLocation create(android.location.Location);
+ method public double getLatitude();
+ method public double getLongitude();
+ }
+
+ @Keep @androidx.car.app.annotations.CarProtocol public class CarSpan extends android.text.style.CharacterStyle {
+ ctor public CarSpan();
+ method public void updateDrawState(android.text.TextPaint);
+ }
+
+ @androidx.car.app.annotations.CarProtocol public final class CarText {
+ method public static androidx.car.app.model.CarText create(CharSequence);
+ method public java.util.List<java.lang.CharSequence!> getVariants();
+ method public boolean isEmpty();
+ method public static boolean isNullOrEmpty(androidx.car.app.model.CarText?);
+ method public CharSequence toCharSequence();
+ }
+
+ public static final class CarText.Builder {
+ ctor public CarText.Builder(CharSequence);
+ method @androidx.car.app.annotations.RequiresCarApi(2) public androidx.car.app.model.CarText.Builder addVariant(CharSequence);
+ method public androidx.car.app.model.CarText build();
+ }
+
+ @androidx.car.app.annotations.CarProtocol @androidx.car.app.annotations.RequiresCarApi(2) public final class ClickableSpan extends androidx.car.app.model.CarSpan {
+ method public static androidx.car.app.model.ClickableSpan create(androidx.car.app.model.OnClickListener);
+ method public androidx.car.app.model.OnClickDelegate getOnClickDelegate();
+ }
+
+ @androidx.car.app.annotations.CarProtocol public final class DateTimeWithZone {
+ method public static androidx.car.app.model.DateTimeWithZone create(long, @IntRange(from=0xffff02e0, to=64800) int, String);
+ method public static androidx.car.app.model.DateTimeWithZone create(long, java.util.TimeZone);
+ method @RequiresApi(26) public static androidx.car.app.model.DateTimeWithZone create(java.time.ZonedDateTime);
+ method public long getTimeSinceEpochMillis();
+ method public int getZoneOffsetSeconds();
+ method public String? getZoneShortName();
+ }
+
+ @androidx.car.app.annotations.CarProtocol public final class Distance {
+ method public static androidx.car.app.model.Distance create(double, int);
+ method public double getDisplayDistance();
+ method public int getDisplayUnit();
+ field public static final int UNIT_FEET = 6; // 0x6
+ field public static final int UNIT_KILOMETERS = 2; // 0x2
+ field public static final int UNIT_KILOMETERS_P1 = 3; // 0x3
+ field public static final int UNIT_METERS = 1; // 0x1
+ field public static final int UNIT_MILES = 4; // 0x4
+ field public static final int UNIT_MILES_P1 = 5; // 0x5
+ field public static final int UNIT_YARDS = 7; // 0x7
+ }
+
+ @androidx.car.app.annotations.CarProtocol public final class DistanceSpan extends androidx.car.app.model.CarSpan {
+ method public static androidx.car.app.model.DistanceSpan create(androidx.car.app.model.Distance);
+ method public androidx.car.app.model.Distance getDistance();
+ }
+
+ @androidx.car.app.annotations.CarProtocol public final class DurationSpan extends androidx.car.app.model.CarSpan {
+ method public static androidx.car.app.model.DurationSpan create(long);
+ method @RequiresApi(26) public static androidx.car.app.model.DurationSpan create(java.time.Duration);
+ method public long getDurationSeconds();
+ }
+
+ @androidx.car.app.annotations.CarProtocol public final class ForegroundCarColorSpan extends androidx.car.app.model.CarSpan {
+ method public static androidx.car.app.model.ForegroundCarColorSpan create(androidx.car.app.model.CarColor);
+ method public androidx.car.app.model.CarColor getColor();
+ }
+
+ @androidx.car.app.annotations.CarProtocol public final class GridItem implements androidx.car.app.model.Item {
+ method public androidx.car.app.model.CarIcon? getImage();
+ method public int getImageType();
+ method public androidx.car.app.model.OnClickDelegate? getOnClickDelegate();
+ method public androidx.car.app.model.CarText? getText();
+ method public androidx.car.app.model.CarText? getTitle();
+ method public boolean isLoading();
+ field public static final int IMAGE_TYPE_ICON = 1; // 0x1
+ field public static final int IMAGE_TYPE_LARGE = 2; // 0x2
+ }
+
+ public static final class GridItem.Builder {
+ ctor public GridItem.Builder();
+ method public androidx.car.app.model.GridItem build();
+ method public androidx.car.app.model.GridItem.Builder setImage(androidx.car.app.model.CarIcon);
+ method public androidx.car.app.model.GridItem.Builder setImage(androidx.car.app.model.CarIcon, int);
+ method public androidx.car.app.model.GridItem.Builder setLoading(boolean);
+ method public androidx.car.app.model.GridItem.Builder setOnClickListener(androidx.car.app.model.OnClickListener);
+ method public androidx.car.app.model.GridItem.Builder setText(CharSequence);
+ method public androidx.car.app.model.GridItem.Builder setText(androidx.car.app.model.CarText);
+ method public androidx.car.app.model.GridItem.Builder setTitle(CharSequence);
+ method public androidx.car.app.model.GridItem.Builder setTitle(androidx.car.app.model.CarText);
+ }
+
+ @androidx.car.app.annotations.CarProtocol public final class GridTemplate implements androidx.car.app.model.Template {
+ method public androidx.car.app.model.ActionStrip? getActionStrip();
+ method public androidx.car.app.model.Action? getHeaderAction();
+ method public androidx.car.app.model.ItemList? getSingleList();
+ method public androidx.car.app.model.CarText? getTitle();
+ method public boolean isLoading();
+ }
+
+ public static final class GridTemplate.Builder {
+ ctor public GridTemplate.Builder();
+ method public androidx.car.app.model.GridTemplate build();
+ method public androidx.car.app.model.GridTemplate.Builder setActionStrip(androidx.car.app.model.ActionStrip);
+ method public androidx.car.app.model.GridTemplate.Builder setHeaderAction(androidx.car.app.model.Action);
+ method public androidx.car.app.model.GridTemplate.Builder setLoading(boolean);
+ method public androidx.car.app.model.GridTemplate.Builder setSingleList(androidx.car.app.model.ItemList);
+ method public androidx.car.app.model.GridTemplate.Builder setTitle(CharSequence);
+ }
+
+ @androidx.car.app.annotations.RequiresCarApi(2) public interface InputCallback {
+ method public default void onInputSubmitted(String);
+ method public default void onInputTextChanged(String);
+ }
+
+ @androidx.car.app.annotations.RequiresCarApi(2) public interface InputCallbackDelegate {
+ method public void sendInputSubmitted(String, androidx.car.app.OnDoneCallback);
+ method public void sendInputTextChanged(String, androidx.car.app.OnDoneCallback);
+ }
+
+ @androidx.car.app.annotations.CarProtocol public interface Item {
+ }
+
+ @androidx.car.app.annotations.CarProtocol public final class ItemList {
+ method public java.util.List<androidx.car.app.model.Item!> getItems();
+ method public androidx.car.app.model.CarText? getNoItemsMessage();
+ method public androidx.car.app.model.OnItemVisibilityChangedDelegate? getOnItemVisibilityChangedDelegate();
+ method public androidx.car.app.model.OnSelectedDelegate? getOnSelectedDelegate();
+ method public int getSelectedIndex();
+ }
+
+ public static final class ItemList.Builder {
+ ctor public ItemList.Builder();
+ method public androidx.car.app.model.ItemList.Builder addItem(androidx.car.app.model.Item);
+ method public androidx.car.app.model.ItemList build();
+ method public androidx.car.app.model.ItemList.Builder setNoItemsMessage(CharSequence);
+ method public androidx.car.app.model.ItemList.Builder setOnItemsVisibilityChangedListener(androidx.car.app.model.ItemList.OnItemVisibilityChangedListener);
+ method public androidx.car.app.model.ItemList.Builder setOnSelectedListener(androidx.car.app.model.ItemList.OnSelectedListener);
+ method public androidx.car.app.model.ItemList.Builder setSelectedIndex(@IntRange(from=0) int);
+ }
+
+ public static interface ItemList.OnItemVisibilityChangedListener {
+ method public void onItemVisibilityChanged(int, int);
+ }
+
+ public static interface ItemList.OnSelectedListener {
+ method public void onSelected(int);
+ }
+
+ @androidx.car.app.annotations.CarProtocol public final class ListTemplate implements androidx.car.app.model.Template {
+ method public androidx.car.app.model.ActionStrip? getActionStrip();
+ method public androidx.car.app.model.Action? getHeaderAction();
+ method public java.util.List<androidx.car.app.model.SectionedItemList!> getSectionedLists();
+ method public androidx.car.app.model.ItemList? getSingleList();
+ method public androidx.car.app.model.CarText? getTitle();
+ method public boolean isLoading();
+ }
+
+ public static final class ListTemplate.Builder {
+ ctor public ListTemplate.Builder();
+ method public androidx.car.app.model.ListTemplate.Builder addSectionedList(androidx.car.app.model.SectionedItemList);
+ method public androidx.car.app.model.ListTemplate build();
+ method public androidx.car.app.model.ListTemplate.Builder setActionStrip(androidx.car.app.model.ActionStrip);
+ method public androidx.car.app.model.ListTemplate.Builder setHeaderAction(androidx.car.app.model.Action);
+ method public androidx.car.app.model.ListTemplate.Builder setLoading(boolean);
+ method public androidx.car.app.model.ListTemplate.Builder setSingleList(androidx.car.app.model.ItemList);
+ method public androidx.car.app.model.ListTemplate.Builder setTitle(CharSequence);
+ }
+
+ @androidx.car.app.annotations.RequiresCarApi(2) public final class LongMessageTemplate implements androidx.car.app.model.Template {
+ method public androidx.car.app.model.ActionStrip? getActionStrip();
+ method public java.util.List<androidx.car.app.model.Action!> getActions();
+ method public androidx.car.app.model.Action? getHeaderAction();
+ method public androidx.car.app.model.CarText getMessage();
+ method public androidx.car.app.model.CarText? getTitle();
+ }
+
+ @androidx.car.app.annotations.RequiresCarApi(2) public static final class LongMessageTemplate.Builder {
+ ctor public LongMessageTemplate.Builder(CharSequence);
+ method public androidx.car.app.model.LongMessageTemplate.Builder addAction(androidx.car.app.model.Action);
+ method public androidx.car.app.model.LongMessageTemplate build();
+ method public androidx.car.app.model.LongMessageTemplate.Builder setActionStrip(androidx.car.app.model.ActionStrip);
+ method public androidx.car.app.model.LongMessageTemplate.Builder setHeaderAction(androidx.car.app.model.Action);
+ method public androidx.car.app.model.LongMessageTemplate.Builder setTitle(CharSequence);
+ }
+
+ @androidx.car.app.annotations.CarProtocol public final class MessageTemplate implements androidx.car.app.model.Template {
+ method @androidx.car.app.annotations.RequiresCarApi(2) public androidx.car.app.model.ActionStrip? getActionStrip();
+ method public java.util.List<androidx.car.app.model.Action!> getActions();
+ method public androidx.car.app.model.CarText? getDebugMessage();
+ method public androidx.car.app.model.Action? getHeaderAction();
+ method public androidx.car.app.model.CarIcon? getIcon();
+ method public androidx.car.app.model.CarText getMessage();
+ method public androidx.car.app.model.CarText? getTitle();
+ method @androidx.car.app.annotations.RequiresCarApi(2) public boolean isLoading();
+ }
+
+ public static final class MessageTemplate.Builder {
+ ctor public MessageTemplate.Builder(CharSequence);
+ ctor public MessageTemplate.Builder(androidx.car.app.model.CarText);
+ method public androidx.car.app.model.MessageTemplate.Builder addAction(androidx.car.app.model.Action);
+ method public androidx.car.app.model.MessageTemplate build();
+ method @androidx.car.app.annotations.RequiresCarApi(2) public androidx.car.app.model.MessageTemplate.Builder setActionStrip(androidx.car.app.model.ActionStrip);
+ method public androidx.car.app.model.MessageTemplate.Builder setDebugMessage(Throwable);
+ method public androidx.car.app.model.MessageTemplate.Builder setDebugMessage(String);
+ method public androidx.car.app.model.MessageTemplate.Builder setHeaderAction(androidx.car.app.model.Action);
+ method public androidx.car.app.model.MessageTemplate.Builder setIcon(androidx.car.app.model.CarIcon);
+ method @androidx.car.app.annotations.RequiresCarApi(2) public androidx.car.app.model.MessageTemplate.Builder setLoading(boolean);
+ method public androidx.car.app.model.MessageTemplate.Builder setTitle(CharSequence);
+ }
+
+ @androidx.car.app.annotations.CarProtocol public final class Metadata {
+ method public androidx.car.app.model.Place? getPlace();
+ field public static final androidx.car.app.model.Metadata EMPTY_METADATA;
+ }
+
+ public static final class Metadata.Builder {
+ ctor public Metadata.Builder();
+ ctor public Metadata.Builder(androidx.car.app.model.Metadata);
+ method public androidx.car.app.model.Metadata build();
+ method public androidx.car.app.model.Metadata.Builder setPlace(androidx.car.app.model.Place);
+ }
+
+ @androidx.car.app.annotations.CarProtocol public interface OnCheckedChangeDelegate {
+ method public void sendCheckedChange(boolean, androidx.car.app.OnDoneCallback);
+ }
+
+ @androidx.car.app.annotations.CarProtocol public interface OnClickDelegate {
+ method public boolean isParkedOnly();
+ method public void sendClick(androidx.car.app.OnDoneCallback);
+ }
+
+ public interface OnClickListener {
+ method public void onClick();
+ }
+
+ @androidx.car.app.annotations.CarProtocol public interface OnItemVisibilityChangedDelegate {
+ method public void sendItemVisibilityChanged(int, int, androidx.car.app.OnDoneCallback);
+ }
+
+ @androidx.car.app.annotations.CarProtocol public interface OnSelectedDelegate {
+ method public void sendSelected(int, androidx.car.app.OnDoneCallback);
+ }
+
+ @androidx.car.app.annotations.CarProtocol public final class Pane {
+ method public java.util.List<androidx.car.app.model.Action!> getActions();
+ method public java.util.List<androidx.car.app.model.Row!> getRows();
+ method public boolean isLoading();
+ }
+
+ public static final class Pane.Builder {
+ ctor public Pane.Builder();
+ method public androidx.car.app.model.Pane.Builder addAction(androidx.car.app.model.Action);
+ method public androidx.car.app.model.Pane.Builder addRow(androidx.car.app.model.Row);
+ method public androidx.car.app.model.Pane build();
+ method public androidx.car.app.model.Pane.Builder setLoading(boolean);
+ }
+
+ @androidx.car.app.annotations.CarProtocol public final class PaneTemplate implements androidx.car.app.model.Template {
+ method public androidx.car.app.model.ActionStrip? getActionStrip();
+ method public androidx.car.app.model.Action? getHeaderAction();
+ method public androidx.car.app.model.Pane getPane();
+ method public androidx.car.app.model.CarText? getTitle();
+ }
+
+ public static final class PaneTemplate.Builder {
+ ctor public PaneTemplate.Builder(androidx.car.app.model.Pane);
+ method public androidx.car.app.model.PaneTemplate build();
+ method public androidx.car.app.model.PaneTemplate.Builder setActionStrip(androidx.car.app.model.ActionStrip);
+ method public androidx.car.app.model.PaneTemplate.Builder setHeaderAction(androidx.car.app.model.Action);
+ method public androidx.car.app.model.PaneTemplate.Builder setTitle(CharSequence);
+ }
+
+ @androidx.car.app.annotations.CarProtocol public final class ParkedOnlyOnClickListener implements androidx.car.app.model.OnClickListener {
+ method public static androidx.car.app.model.ParkedOnlyOnClickListener create(androidx.car.app.model.OnClickListener);
+ method public void onClick();
+ }
+
+ @androidx.car.app.annotations.CarProtocol public final class Place {
+ method public androidx.car.app.model.CarLocation getLocation();
+ method public androidx.car.app.model.PlaceMarker? getMarker();
+ }
+
+ public static final class Place.Builder {
+ ctor public Place.Builder(androidx.car.app.model.CarLocation);
+ ctor public Place.Builder(androidx.car.app.model.Place);
+ method public androidx.car.app.model.Place build();
+ method public androidx.car.app.model.Place.Builder setMarker(androidx.car.app.model.PlaceMarker);
+ }
+
+ @androidx.car.app.annotations.CarProtocol public final class PlaceListMapTemplate implements androidx.car.app.model.Template {
+ method public androidx.car.app.model.ActionStrip? getActionStrip();
+ method public androidx.car.app.model.Place? getAnchor();
+ method public androidx.car.app.model.Action? getHeaderAction();
+ method public androidx.car.app.model.ItemList? getItemList();
+ method public androidx.car.app.model.CarText? getTitle();
+ method public boolean isCurrentLocationEnabled();
+ method public boolean isLoading();
+ }
+
+ public static final class PlaceListMapTemplate.Builder {
+ ctor public PlaceListMapTemplate.Builder();
+ method public androidx.car.app.model.PlaceListMapTemplate build();
+ method public androidx.car.app.model.PlaceListMapTemplate.Builder setActionStrip(androidx.car.app.model.ActionStrip);
+ method public androidx.car.app.model.PlaceListMapTemplate.Builder setAnchor(androidx.car.app.model.Place);
+ method public androidx.car.app.model.PlaceListMapTemplate.Builder setCurrentLocationEnabled(boolean);
+ method public androidx.car.app.model.PlaceListMapTemplate.Builder setHeaderAction(androidx.car.app.model.Action);
+ method public androidx.car.app.model.PlaceListMapTemplate.Builder setItemList(androidx.car.app.model.ItemList);
+ method public androidx.car.app.model.PlaceListMapTemplate.Builder setLoading(boolean);
+ method public androidx.car.app.model.PlaceListMapTemplate.Builder setTitle(CharSequence);
+ method public androidx.car.app.model.PlaceListMapTemplate.Builder setTitle(androidx.car.app.model.CarText);
+ }
+
+ @androidx.car.app.annotations.CarProtocol public final class PlaceMarker {
+ method public androidx.car.app.model.CarColor? getColor();
+ method public androidx.car.app.model.CarIcon? getIcon();
+ method public int getIconType();
+ method public androidx.car.app.model.CarText? getLabel();
+ field public static final int TYPE_ICON = 0; // 0x0
+ field public static final int TYPE_IMAGE = 1; // 0x1
+ }
+
+ public static final class PlaceMarker.Builder {
+ ctor public PlaceMarker.Builder();
+ method public androidx.car.app.model.PlaceMarker build();
+ method public androidx.car.app.model.PlaceMarker.Builder setColor(androidx.car.app.model.CarColor);
+ method public androidx.car.app.model.PlaceMarker.Builder setIcon(androidx.car.app.model.CarIcon, int);
+ method public androidx.car.app.model.PlaceMarker.Builder setLabel(CharSequence);
+ }
+
+ @androidx.car.app.annotations.CarProtocol public final class Row implements androidx.car.app.model.Item {
+ method public androidx.car.app.model.CarIcon? getImage();
+ method public androidx.car.app.model.Metadata? getMetadata();
+ method public androidx.car.app.model.OnClickDelegate? getOnClickDelegate();
+ method public int getRowImageType();
+ method public java.util.List<androidx.car.app.model.CarText!> getTexts();
+ method public androidx.car.app.model.CarText? getTitle();
+ method public androidx.car.app.model.Toggle? getToggle();
+ method public boolean isBrowsable();
+ method public androidx.car.app.model.Row row();
+ method public CharSequence yourBoat();
+ field public static final int IMAGE_TYPE_ICON = 4; // 0x4
+ field public static final int IMAGE_TYPE_LARGE = 2; // 0x2
+ field public static final int IMAGE_TYPE_SMALL = 1; // 0x1
+ }
+
+ public static final class Row.Builder {
+ ctor public Row.Builder();
+ method public androidx.car.app.model.Row.Builder addText(CharSequence);
+ method public androidx.car.app.model.Row.Builder addText(androidx.car.app.model.CarText);
+ method public androidx.car.app.model.Row build();
+ method public androidx.car.app.model.Row.Builder setBrowsable(boolean);
+ method public androidx.car.app.model.Row.Builder setImage(androidx.car.app.model.CarIcon);
+ method public androidx.car.app.model.Row.Builder setImage(androidx.car.app.model.CarIcon, int);
+ method public androidx.car.app.model.Row.Builder setMetadata(androidx.car.app.model.Metadata);
+ method public androidx.car.app.model.Row.Builder setOnClickListener(androidx.car.app.model.OnClickListener);
+ method public androidx.car.app.model.Row.Builder setTitle(CharSequence);
+ method public androidx.car.app.model.Row.Builder setTitle(androidx.car.app.model.CarText);
+ method public androidx.car.app.model.Row.Builder setToggle(androidx.car.app.model.Toggle);
+ }
+
+ @androidx.car.app.annotations.CarProtocol public interface SearchCallbackDelegate {
+ method public void sendSearchSubmitted(String, androidx.car.app.OnDoneCallback);
+ method public void sendSearchTextChanged(String, androidx.car.app.OnDoneCallback);
+ }
+
+ @androidx.car.app.annotations.CarProtocol public final class SearchTemplate implements androidx.car.app.model.Template {
+ method public androidx.car.app.model.ActionStrip? getActionStrip();
+ method public androidx.car.app.model.Action? getHeaderAction();
+ method public String? getInitialSearchText();
+ method public androidx.car.app.model.ItemList? getItemList();
+ method public androidx.car.app.model.SearchCallbackDelegate getSearchCallbackDelegate();
+ method public String? getSearchHint();
+ method public boolean isLoading();
+ method public boolean isShowKeyboardByDefault();
+ }
+
+ public static final class SearchTemplate.Builder {
+ ctor public SearchTemplate.Builder(androidx.car.app.model.SearchTemplate.SearchCallback);
+ method public androidx.car.app.model.SearchTemplate build();
+ method public androidx.car.app.model.SearchTemplate.Builder setActionStrip(androidx.car.app.model.ActionStrip);
+ method public androidx.car.app.model.SearchTemplate.Builder setHeaderAction(androidx.car.app.model.Action);
+ method public androidx.car.app.model.SearchTemplate.Builder setInitialSearchText(String);
+ method public androidx.car.app.model.SearchTemplate.Builder setItemList(androidx.car.app.model.ItemList);
+ method public androidx.car.app.model.SearchTemplate.Builder setLoading(boolean);
+ method public androidx.car.app.model.SearchTemplate.Builder setSearchHint(String);
+ method public androidx.car.app.model.SearchTemplate.Builder setShowKeyboardByDefault(boolean);
+ }
+
+ public static interface SearchTemplate.SearchCallback {
+ method public default void onSearchSubmitted(String);
+ method public default void onSearchTextChanged(String);
+ }
+
+ @androidx.car.app.annotations.CarProtocol public final class SectionedItemList {
+ method public static androidx.car.app.model.SectionedItemList create(androidx.car.app.model.ItemList, CharSequence);
+ method public androidx.car.app.model.CarText getHeader();
+ method public androidx.car.app.model.ItemList getItemList();
+ }
+
+ @androidx.car.app.annotations.CarProtocol public interface Template {
+ }
+
+ @androidx.car.app.annotations.CarProtocol public final class TemplateInfo {
+ ctor public TemplateInfo(Class<? extends androidx.car.app.model.Template>, String);
+ method public Class<? extends androidx.car.app.model.Template> getTemplateClass();
+ method public String getTemplateId();
+ }
+
+ @androidx.car.app.annotations.CarProtocol public final class TemplateWrapper {
+ method public static androidx.car.app.model.TemplateWrapper copyOf(androidx.car.app.model.TemplateWrapper);
+ method public int getCurrentTaskStep();
+ method public String getId();
+ method public androidx.car.app.model.Template getTemplate();
+ method public java.util.List<androidx.car.app.model.TemplateInfo!> getTemplateInfosForScreenStack();
+ method public boolean isRefresh();
+ method public void setCurrentTaskStep(int);
+ method public void setId(String);
+ method public void setRefresh(boolean);
+ method public void setTemplate(androidx.car.app.model.Template);
+ method public static androidx.car.app.model.TemplateWrapper wrap(androidx.car.app.model.Template);
+ method public static androidx.car.app.model.TemplateWrapper wrap(androidx.car.app.model.Template, String);
+ }
+
+ @androidx.car.app.annotations.CarProtocol public final class Toggle {
+ method public androidx.car.app.model.OnCheckedChangeDelegate getOnCheckedChangeDelegate();
+ method public boolean isChecked();
+ }
+
+ public static final class Toggle.Builder {
+ ctor public Toggle.Builder(androidx.car.app.model.Toggle.OnCheckedChangeListener);
+ method public androidx.car.app.model.Toggle build();
+ method public androidx.car.app.model.Toggle.Builder setChecked(boolean);
+ }
+
+ public static interface Toggle.OnCheckedChangeListener {
+ method public void onCheckedChange(boolean);
+ }
+
+}
+
+package androidx.car.app.model.signin {
+
+ @androidx.car.app.annotations.RequiresCarApi(2) public final class InputSignInMethod implements androidx.car.app.model.signin.SignInTemplate.SignInMethod {
+ method public androidx.car.app.model.CarText? getDefaultValue();
+ method public androidx.car.app.model.CarText? getErrorMessage();
+ method public androidx.car.app.model.CarText? getHint();
+ method public androidx.car.app.model.InputCallbackDelegate getInputCallbackDelegate();
+ method public int getInputType();
+ method public int getKeyboardType();
+ method public boolean isShowKeyboardByDefault();
+ field public static final int INPUT_TYPE_DEFAULT = 1; // 0x1
+ field public static final int INPUT_TYPE_PASSWORD = 2; // 0x2
+ field public static final int KEYBOARD_DEFAULT = 1; // 0x1
+ field public static final int KEYBOARD_EMAIL = 2; // 0x2
+ field public static final int KEYBOARD_NUMBER = 4; // 0x4
+ field public static final int KEYBOARD_PHONE = 3; // 0x3
+ }
+
+ public static final class InputSignInMethod.Builder {
+ ctor public InputSignInMethod.Builder(androidx.car.app.model.InputCallback);
+ method public androidx.car.app.model.signin.InputSignInMethod build();
+ method public androidx.car.app.model.signin.InputSignInMethod.Builder setDefaultValue(String);
+ method public androidx.car.app.model.signin.InputSignInMethod.Builder setErrorMessage(CharSequence);
+ method public androidx.car.app.model.signin.InputSignInMethod.Builder setHint(CharSequence);
+ method public androidx.car.app.model.signin.InputSignInMethod.Builder setInputType(int);
+ method public androidx.car.app.model.signin.InputSignInMethod.Builder setKeyboardType(int);
+ method public androidx.car.app.model.signin.InputSignInMethod.Builder setShowKeyboardByDefault(boolean);
+ }
+
+ @androidx.car.app.annotations.RequiresCarApi(2) public final class PinSignInMethod implements androidx.car.app.model.signin.SignInTemplate.SignInMethod {
+ ctor public PinSignInMethod(CharSequence);
+ method public androidx.car.app.model.CarText getPinCode();
+ }
+
+ @androidx.car.app.annotations.RequiresCarApi(2) public final class ProviderSignInMethod implements androidx.car.app.model.signin.SignInTemplate.SignInMethod {
+ ctor public ProviderSignInMethod(androidx.car.app.model.Action);
+ method public androidx.car.app.model.Action getAction();
+ }
+
+ @androidx.car.app.annotations.RequiresCarApi(2) public final class SignInTemplate implements androidx.car.app.model.Template {
+ method public androidx.car.app.model.ActionStrip? getActionStrip();
+ method public java.util.List<androidx.car.app.model.Action!> getActions();
+ method public androidx.car.app.model.CarText? getAdditionalText();
+ method public androidx.car.app.model.Action? getHeaderAction();
+ method public androidx.car.app.model.CarText? getInstructions();
+ method public androidx.car.app.model.signin.SignInTemplate.SignInMethod getSignInMethod();
+ method public androidx.car.app.model.CarText? getTitle();
+ method public boolean isLoading();
+ }
+
+ @androidx.car.app.annotations.RequiresCarApi(2) public static final class SignInTemplate.Builder {
+ ctor public SignInTemplate.Builder(androidx.car.app.model.signin.SignInTemplate.SignInMethod);
+ method public androidx.car.app.model.signin.SignInTemplate.Builder addAction(androidx.car.app.model.Action);
+ method public androidx.car.app.model.signin.SignInTemplate build();
+ method public androidx.car.app.model.signin.SignInTemplate.Builder setActionStrip(androidx.car.app.model.ActionStrip);
+ method public androidx.car.app.model.signin.SignInTemplate.Builder setAdditionalText(CharSequence);
+ method public androidx.car.app.model.signin.SignInTemplate.Builder setHeaderAction(androidx.car.app.model.Action);
+ method public androidx.car.app.model.signin.SignInTemplate.Builder setInstructions(CharSequence);
+ method public androidx.car.app.model.signin.SignInTemplate.Builder setLoading(boolean);
+ method public androidx.car.app.model.signin.SignInTemplate.Builder setTitle(CharSequence);
+ }
+
+ public static interface SignInTemplate.SignInMethod {
+ }
+
+}
+
+package androidx.car.app.navigation {
+
+ public class NavigationManager implements androidx.car.app.managers.Manager {
+ method @MainThread public void clearNavigationManagerCallback();
+ method @MainThread public void navigationEnded();
+ method @MainThread public void navigationStarted();
+ method @MainThread public void setNavigationManagerCallback(androidx.car.app.navigation.NavigationManagerCallback);
+ method @MainThread public void setNavigationManagerCallback(java.util.concurrent.Executor, androidx.car.app.navigation.NavigationManagerCallback);
+ method @MainThread public void updateTrip(androidx.car.app.navigation.model.Trip);
+ }
+
+ public interface NavigationManagerCallback {
+ method public default void onAutoDriveEnabled();
+ method public default void onStopNavigation();
+ }
+
+}
+
+package androidx.car.app.navigation.model {
+
+ @androidx.car.app.annotations.CarProtocol public final class Destination {
+ method public androidx.car.app.model.CarText? getAddress();
+ method public androidx.car.app.model.CarIcon? getImage();
+ method public androidx.car.app.model.CarText? getName();
+ }
+
+ public static final class Destination.Builder {
+ ctor public Destination.Builder();
+ method public androidx.car.app.navigation.model.Destination build();
+ method public androidx.car.app.navigation.model.Destination.Builder setAddress(CharSequence);
+ method public androidx.car.app.navigation.model.Destination.Builder setImage(androidx.car.app.model.CarIcon);
+ method public androidx.car.app.navigation.model.Destination.Builder setName(CharSequence);
+ }
+
+ @androidx.car.app.annotations.CarProtocol public final class Lane {
+ method public java.util.List<androidx.car.app.navigation.model.LaneDirection!> getDirections();
+ }
+
+ public static final class Lane.Builder {
+ ctor public Lane.Builder();
+ method public androidx.car.app.navigation.model.Lane.Builder addDirection(androidx.car.app.navigation.model.LaneDirection);
+ method public androidx.car.app.navigation.model.Lane build();
+ }
+
+ @androidx.car.app.annotations.CarProtocol public final class LaneDirection {
+ method public static androidx.car.app.navigation.model.LaneDirection create(int, boolean);
+ method public int getShape();
+ method public boolean isRecommended();
+ field public static final int SHAPE_NORMAL_LEFT = 5; // 0x5
+ field public static final int SHAPE_NORMAL_RIGHT = 6; // 0x6
+ field public static final int SHAPE_SHARP_LEFT = 7; // 0x7
+ field public static final int SHAPE_SHARP_RIGHT = 8; // 0x8
+ field public static final int SHAPE_SLIGHT_LEFT = 3; // 0x3
+ field public static final int SHAPE_SLIGHT_RIGHT = 4; // 0x4
+ field public static final int SHAPE_STRAIGHT = 2; // 0x2
+ field public static final int SHAPE_UNKNOWN = 1; // 0x1
+ field public static final int SHAPE_U_TURN_LEFT = 9; // 0x9
+ field public static final int SHAPE_U_TURN_RIGHT = 10; // 0xa
+ }
+
+ @androidx.car.app.annotations.CarProtocol public final class Maneuver {
+ method public androidx.car.app.model.CarIcon? getIcon();
+ method public int getRoundaboutExitAngle();
+ method public int getRoundaboutExitNumber();
+ method public int getType();
+ field public static final int TYPE_DEPART = 1; // 0x1
+ field public static final int TYPE_DESTINATION = 39; // 0x27
+ field public static final int TYPE_DESTINATION_LEFT = 41; // 0x29
+ field public static final int TYPE_DESTINATION_RIGHT = 42; // 0x2a
+ field public static final int TYPE_DESTINATION_STRAIGHT = 40; // 0x28
+ field public static final int TYPE_FERRY_BOAT = 37; // 0x25
+ field public static final int TYPE_FERRY_BOAT_LEFT = 47; // 0x2f
+ field public static final int TYPE_FERRY_BOAT_RIGHT = 48; // 0x30
+ field public static final int TYPE_FERRY_TRAIN = 38; // 0x26
+ field public static final int TYPE_FERRY_TRAIN_LEFT = 49; // 0x31
+ field public static final int TYPE_FERRY_TRAIN_RIGHT = 50; // 0x32
+ field public static final int TYPE_FORK_LEFT = 25; // 0x19
+ field public static final int TYPE_FORK_RIGHT = 26; // 0x1a
+ field public static final int TYPE_KEEP_LEFT = 3; // 0x3
+ field public static final int TYPE_KEEP_RIGHT = 4; // 0x4
+ field public static final int TYPE_MERGE_LEFT = 27; // 0x1b
+ field public static final int TYPE_MERGE_RIGHT = 28; // 0x1c
+ field public static final int TYPE_MERGE_SIDE_UNSPECIFIED = 29; // 0x1d
+ field public static final int TYPE_NAME_CHANGE = 2; // 0x2
+ field public static final int TYPE_OFF_RAMP_NORMAL_LEFT = 23; // 0x17
+ field public static final int TYPE_OFF_RAMP_NORMAL_RIGHT = 24; // 0x18
+ field public static final int TYPE_OFF_RAMP_SLIGHT_LEFT = 21; // 0x15
+ field public static final int TYPE_OFF_RAMP_SLIGHT_RIGHT = 22; // 0x16
+ field public static final int TYPE_ON_RAMP_NORMAL_LEFT = 15; // 0xf
+ field public static final int TYPE_ON_RAMP_NORMAL_RIGHT = 16; // 0x10
+ field public static final int TYPE_ON_RAMP_SHARP_LEFT = 17; // 0x11
+ field public static final int TYPE_ON_RAMP_SHARP_RIGHT = 18; // 0x12
+ field public static final int TYPE_ON_RAMP_SLIGHT_LEFT = 13; // 0xd
+ field public static final int TYPE_ON_RAMP_SLIGHT_RIGHT = 14; // 0xe
+ field public static final int TYPE_ON_RAMP_U_TURN_LEFT = 19; // 0x13
+ field public static final int TYPE_ON_RAMP_U_TURN_RIGHT = 20; // 0x14
+ field public static final int TYPE_ROUNDABOUT_ENTER_AND_EXIT_CCW = 34; // 0x22
+ field public static final int TYPE_ROUNDABOUT_ENTER_AND_EXIT_CCW_WITH_ANGLE = 35; // 0x23
+ field public static final int TYPE_ROUNDABOUT_ENTER_AND_EXIT_CW = 32; // 0x20
+ field public static final int TYPE_ROUNDABOUT_ENTER_AND_EXIT_CW_WITH_ANGLE = 33; // 0x21
+ field public static final int TYPE_ROUNDABOUT_ENTER_CCW = 45; // 0x2d
+ field public static final int TYPE_ROUNDABOUT_ENTER_CW = 43; // 0x2b
+ field public static final int TYPE_ROUNDABOUT_EXIT_CCW = 46; // 0x2e
+ field public static final int TYPE_ROUNDABOUT_EXIT_CW = 44; // 0x2c
+ field public static final int TYPE_STRAIGHT = 36; // 0x24
+ field public static final int TYPE_TURN_NORMAL_LEFT = 7; // 0x7
+ field public static final int TYPE_TURN_NORMAL_RIGHT = 8; // 0x8
+ field public static final int TYPE_TURN_SHARP_LEFT = 9; // 0x9
+ field public static final int TYPE_TURN_SHARP_RIGHT = 10; // 0xa
+ field public static final int TYPE_TURN_SLIGHT_LEFT = 5; // 0x5
+ field public static final int TYPE_TURN_SLIGHT_RIGHT = 6; // 0x6
+ field public static final int TYPE_UNKNOWN = 0; // 0x0
+ field public static final int TYPE_U_TURN_LEFT = 11; // 0xb
+ field public static final int TYPE_U_TURN_RIGHT = 12; // 0xc
+ }
+
+ public static final class Maneuver.Builder {
+ ctor public Maneuver.Builder(int);
+ method public androidx.car.app.navigation.model.Maneuver build();
+ method public androidx.car.app.navigation.model.Maneuver.Builder setIcon(androidx.car.app.model.CarIcon);
+ method public androidx.car.app.navigation.model.Maneuver.Builder setRoundaboutExitAngle(@IntRange(from=1, to=360) int);
+ method public androidx.car.app.navigation.model.Maneuver.Builder setRoundaboutExitNumber(@IntRange(from=1) int);
+ }
+
+ @androidx.car.app.annotations.CarProtocol public final class MessageInfo implements androidx.car.app.navigation.model.NavigationTemplate.NavigationInfo {
+ method public androidx.car.app.model.CarIcon? getImage();
+ method public androidx.car.app.model.CarText? getText();
+ method public androidx.car.app.model.CarText? getTitle();
+ }
+
+ public static final class MessageInfo.Builder {
+ ctor public MessageInfo.Builder(CharSequence);
+ ctor public MessageInfo.Builder(androidx.car.app.model.CarText);
+ method public androidx.car.app.navigation.model.MessageInfo build();
+ method public androidx.car.app.navigation.model.MessageInfo.Builder setImage(androidx.car.app.model.CarIcon);
+ method public androidx.car.app.navigation.model.MessageInfo.Builder setText(CharSequence);
+ method public androidx.car.app.navigation.model.MessageInfo.Builder setText(androidx.car.app.model.CarText);
+ method public androidx.car.app.navigation.model.MessageInfo.Builder setTitle(CharSequence);
+ }
+
+ @androidx.car.app.annotations.CarProtocol public final class NavigationTemplate implements androidx.car.app.model.Template {
+ method public androidx.car.app.model.ActionStrip? getActionStrip();
+ method public androidx.car.app.model.CarColor? getBackgroundColor();
+ method public androidx.car.app.navigation.model.TravelEstimate? getDestinationTravelEstimate();
+ method @androidx.car.app.annotations.RequiresCarApi(2) public androidx.car.app.model.ActionStrip? getMapActionStrip();
+ method public androidx.car.app.navigation.model.NavigationTemplate.NavigationInfo? getNavigationInfo();
+ method @androidx.car.app.annotations.RequiresCarApi(2) public androidx.car.app.navigation.model.PanModeDelegate? getPanModeDelegate();
+ method @Deprecated @androidx.car.app.annotations.RequiresCarApi(2) public androidx.car.app.model.Toggle? getPanModeToggle();
+ }
+
+ public static final class NavigationTemplate.Builder {
+ ctor public NavigationTemplate.Builder();
+ method public androidx.car.app.navigation.model.NavigationTemplate build();
+ method public androidx.car.app.navigation.model.NavigationTemplate.Builder setActionStrip(androidx.car.app.model.ActionStrip);
+ method public androidx.car.app.navigation.model.NavigationTemplate.Builder setBackgroundColor(androidx.car.app.model.CarColor);
+ method public androidx.car.app.navigation.model.NavigationTemplate.Builder setDestinationTravelEstimate(androidx.car.app.navigation.model.TravelEstimate);
+ method @androidx.car.app.annotations.RequiresCarApi(2) public androidx.car.app.navigation.model.NavigationTemplate.Builder setMapActionStrip(androidx.car.app.model.ActionStrip);
+ method public androidx.car.app.navigation.model.NavigationTemplate.Builder setNavigationInfo(androidx.car.app.navigation.model.NavigationTemplate.NavigationInfo);
+ method @androidx.car.app.annotations.RequiresCarApi(2) public androidx.car.app.navigation.model.NavigationTemplate.Builder setPanModeListener(androidx.car.app.navigation.model.PanModeListener);
+ }
+
+ public static interface NavigationTemplate.NavigationInfo {
+ }
+
+ @androidx.car.app.annotations.CarProtocol @androidx.car.app.annotations.RequiresCarApi(2) public interface PanModeDelegate {
+ method public void sendPanModeChanged(boolean, androidx.car.app.OnDoneCallback);
+ }
+
+ public interface PanModeListener {
+ method public void onPanModeChanged(boolean);
+ }
+
+ @androidx.car.app.annotations.CarProtocol public final class PlaceListNavigationTemplate implements androidx.car.app.model.Template {
+ method public androidx.car.app.model.ActionStrip? getActionStrip();
+ method public androidx.car.app.model.Action? getHeaderAction();
+ method public androidx.car.app.model.ItemList? getItemList();
+ method public androidx.car.app.model.CarText? getTitle();
+ method public boolean isLoading();
+ }
+
+ public static final class PlaceListNavigationTemplate.Builder {
+ ctor public PlaceListNavigationTemplate.Builder();
+ method public androidx.car.app.navigation.model.PlaceListNavigationTemplate build();
+ method public androidx.car.app.navigation.model.PlaceListNavigationTemplate.Builder setActionStrip(androidx.car.app.model.ActionStrip);
+ method public androidx.car.app.navigation.model.PlaceListNavigationTemplate.Builder setHeaderAction(androidx.car.app.model.Action);
+ method public androidx.car.app.navigation.model.PlaceListNavigationTemplate.Builder setItemList(androidx.car.app.model.ItemList);
+ method public androidx.car.app.navigation.model.PlaceListNavigationTemplate.Builder setLoading(boolean);
+ method public androidx.car.app.navigation.model.PlaceListNavigationTemplate.Builder setTitle(CharSequence);
+ method public androidx.car.app.navigation.model.PlaceListNavigationTemplate.Builder setTitle(androidx.car.app.model.CarText);
+ }
+
+ @androidx.car.app.annotations.CarProtocol public final class RoutePreviewNavigationTemplate implements androidx.car.app.model.Template {
+ method public androidx.car.app.model.ActionStrip? getActionStrip();
+ method public androidx.car.app.model.Action? getHeaderAction();
+ method public androidx.car.app.model.ItemList? getItemList();
+ method public androidx.car.app.model.Action? getNavigateAction();
+ method public androidx.car.app.model.CarText? getTitle();
+ method public boolean isLoading();
+ }
+
+ public static final class RoutePreviewNavigationTemplate.Builder {
+ ctor public RoutePreviewNavigationTemplate.Builder();
+ method public androidx.car.app.navigation.model.RoutePreviewNavigationTemplate build();
+ method public androidx.car.app.navigation.model.RoutePreviewNavigationTemplate.Builder setActionStrip(androidx.car.app.model.ActionStrip);
+ method public androidx.car.app.navigation.model.RoutePreviewNavigationTemplate.Builder setHeaderAction(androidx.car.app.model.Action);
+ method public androidx.car.app.navigation.model.RoutePreviewNavigationTemplate.Builder setItemList(androidx.car.app.model.ItemList);
+ method public androidx.car.app.navigation.model.RoutePreviewNavigationTemplate.Builder setLoading(boolean);
+ method public androidx.car.app.navigation.model.RoutePreviewNavigationTemplate.Builder setNavigateAction(androidx.car.app.model.Action);
+ method public androidx.car.app.navigation.model.RoutePreviewNavigationTemplate.Builder setTitle(CharSequence);
+ method public androidx.car.app.navigation.model.RoutePreviewNavigationTemplate.Builder setTitle(androidx.car.app.model.CarText);
+ }
+
+ @androidx.car.app.annotations.CarProtocol public final class RoutingInfo implements androidx.car.app.navigation.model.NavigationTemplate.NavigationInfo {
+ method public androidx.car.app.model.Distance? getCurrentDistance();
+ method public androidx.car.app.navigation.model.Step? getCurrentStep();
+ method public androidx.car.app.model.CarIcon? getJunctionImage();
+ method public androidx.car.app.navigation.model.Step? getNextStep();
+ method public boolean isLoading();
+ }
+
+ public static final class RoutingInfo.Builder {
+ ctor public RoutingInfo.Builder();
+ method public androidx.car.app.navigation.model.RoutingInfo build();
+ method public androidx.car.app.navigation.model.RoutingInfo.Builder setCurrentStep(androidx.car.app.navigation.model.Step, androidx.car.app.model.Distance);
+ method public androidx.car.app.navigation.model.RoutingInfo.Builder setJunctionImage(androidx.car.app.model.CarIcon);
+ method public androidx.car.app.navigation.model.RoutingInfo.Builder setLoading(boolean);
+ method public androidx.car.app.navigation.model.RoutingInfo.Builder setNextStep(androidx.car.app.navigation.model.Step);
+ }
+
+ @androidx.car.app.annotations.CarProtocol public final class Step {
+ method public androidx.car.app.model.CarText? getCue();
+ method public java.util.List<androidx.car.app.navigation.model.Lane!> getLanes();
+ method public androidx.car.app.model.CarIcon? getLanesImage();
+ method public androidx.car.app.navigation.model.Maneuver? getManeuver();
+ method public androidx.car.app.model.CarText? getRoad();
+ }
+
+ public static final class Step.Builder {
+ ctor public Step.Builder();
+ ctor public Step.Builder(CharSequence);
+ ctor public Step.Builder(androidx.car.app.model.CarText);
+ method public androidx.car.app.navigation.model.Step.Builder addLane(androidx.car.app.navigation.model.Lane);
+ method public androidx.car.app.navigation.model.Step build();
+ method public androidx.car.app.navigation.model.Step.Builder setCue(CharSequence);
+ method public androidx.car.app.navigation.model.Step.Builder setLanesImage(androidx.car.app.model.CarIcon);
+ method public androidx.car.app.navigation.model.Step.Builder setManeuver(androidx.car.app.navigation.model.Maneuver);
+ method public androidx.car.app.navigation.model.Step.Builder setRoad(CharSequence);
+ }
+
+ @androidx.car.app.annotations.CarProtocol public final class TravelEstimate {
+ method public androidx.car.app.model.DateTimeWithZone? getArrivalTimeAtDestination();
+ method public androidx.car.app.model.Distance? getRemainingDistance();
+ method public androidx.car.app.model.CarColor? getRemainingDistanceColor();
+ method public androidx.car.app.model.CarColor? getRemainingTimeColor();
+ method public long getRemainingTimeSeconds();
+ field public static final long REMAINING_TIME_UNKNOWN = -1L; // 0xffffffffffffffffL
+ }
+
+ public static final class TravelEstimate.Builder {
+ ctor public TravelEstimate.Builder(androidx.car.app.model.Distance, androidx.car.app.model.DateTimeWithZone);
+ ctor @RequiresApi(26) public TravelEstimate.Builder(androidx.car.app.model.Distance, java.time.ZonedDateTime);
+ method public androidx.car.app.navigation.model.TravelEstimate build();
+ method public androidx.car.app.navigation.model.TravelEstimate.Builder setRemainingDistanceColor(androidx.car.app.model.CarColor);
+ method @RequiresApi(26) public androidx.car.app.navigation.model.TravelEstimate.Builder setRemainingTime(java.time.Duration);
+ method public androidx.car.app.navigation.model.TravelEstimate.Builder setRemainingTimeColor(androidx.car.app.model.CarColor);
+ method public androidx.car.app.navigation.model.TravelEstimate.Builder setRemainingTimeSeconds(@IntRange(from=0xffffffff) long);
+ }
+
+ @androidx.car.app.annotations.CarProtocol public final class Trip {
+ method public androidx.car.app.model.CarText? getCurrentRoad();
+ method public java.util.List<androidx.car.app.navigation.model.TravelEstimate!> getDestinationTravelEstimates();
+ method public java.util.List<androidx.car.app.navigation.model.Destination!> getDestinations();
+ method public java.util.List<androidx.car.app.navigation.model.TravelEstimate!> getStepTravelEstimates();
+ method public java.util.List<androidx.car.app.navigation.model.Step!> getSteps();
+ method public boolean isLoading();
+ }
+
+ public static final class Trip.Builder {
+ ctor public Trip.Builder();
+ method public androidx.car.app.navigation.model.Trip.Builder addDestination(androidx.car.app.navigation.model.Destination, androidx.car.app.navigation.model.TravelEstimate);
+ method public androidx.car.app.navigation.model.Trip.Builder addStep(androidx.car.app.navigation.model.Step, androidx.car.app.navigation.model.TravelEstimate);
+ method public androidx.car.app.navigation.model.Trip build();
+ method public androidx.car.app.navigation.model.Trip.Builder setCurrentRoad(CharSequence);
+ method public androidx.car.app.navigation.model.Trip.Builder setLoading(boolean);
+ }
+
+}
+
+package androidx.car.app.notification {
+
+ public final class CarAppExtender implements androidx.core.app.NotificationCompat.Extender {
+ ctor public CarAppExtender(android.app.Notification);
+ method public androidx.core.app.NotificationCompat.Builder extend(androidx.core.app.NotificationCompat.Builder);
+ method public java.util.List<android.app.Notification.Action!> getActions();
+ method public String? getChannelId();
+ method public androidx.car.app.model.CarColor? getColor();
+ method public android.app.PendingIntent? getContentIntent();
+ method public CharSequence? getContentText();
+ method public CharSequence? getContentTitle();
+ method public android.app.PendingIntent? getDeleteIntent();
+ method public int getImportance();
+ method public android.graphics.Bitmap? getLargeIcon();
+ method @DrawableRes public int getSmallIcon();
+ method public static boolean isExtended(android.app.Notification);
+ }
+
+ public static final class CarAppExtender.Builder {
+ ctor public CarAppExtender.Builder();
+ method public androidx.car.app.notification.CarAppExtender.Builder addAction(@DrawableRes int, CharSequence, android.app.PendingIntent);
+ method public androidx.car.app.notification.CarAppExtender build();
+ method public androidx.car.app.notification.CarAppExtender.Builder setChannelId(String);
+ method public androidx.car.app.notification.CarAppExtender.Builder setColor(androidx.car.app.model.CarColor);
+ method public androidx.car.app.notification.CarAppExtender.Builder setContentIntent(android.app.PendingIntent);
+ method public androidx.car.app.notification.CarAppExtender.Builder setContentText(CharSequence);
+ method public androidx.car.app.notification.CarAppExtender.Builder setContentTitle(CharSequence);
+ method public androidx.car.app.notification.CarAppExtender.Builder setDeleteIntent(android.app.PendingIntent);
+ method public androidx.car.app.notification.CarAppExtender.Builder setImportance(int);
+ method public androidx.car.app.notification.CarAppExtender.Builder setLargeIcon(android.graphics.Bitmap);
+ method public androidx.car.app.notification.CarAppExtender.Builder setSmallIcon(int);
+ }
+
+ public final class CarNotificationManager {
+ method public boolean areNotificationsEnabled();
+ method public void cancel(int);
+ method public void cancel(String?, int);
+ method public void cancelAll();
+ method public void createNotificationChannel(androidx.core.app.NotificationChannelCompat);
+ method public void createNotificationChannelGroup(androidx.core.app.NotificationChannelGroupCompat);
+ method public void createNotificationChannelGroups(java.util.List<androidx.core.app.NotificationChannelGroupCompat!>);
+ method public void createNotificationChannels(java.util.List<androidx.core.app.NotificationChannelCompat!>);
+ method public void deleteNotificationChannel(String);
+ method public void deleteNotificationChannelGroup(String);
+ method public void deleteUnlistedNotificationChannels(java.util.Collection<java.lang.String!>);
+ method public static androidx.car.app.notification.CarNotificationManager from(android.content.Context);
+ method public static java.util.Set<java.lang.String!> getEnabledListenerPackages(android.content.Context);
+ method public int getImportance();
+ method public androidx.core.app.NotificationChannelCompat? getNotificationChannel(String);
+ method public androidx.core.app.NotificationChannelCompat? getNotificationChannel(String, String);
+ method public androidx.core.app.NotificationChannelGroupCompat? getNotificationChannelGroup(String);
+ method public java.util.List<androidx.core.app.NotificationChannelGroupCompat!> getNotificationChannelGroups();
+ method public java.util.List<androidx.core.app.NotificationChannelCompat!> getNotificationChannels();
+ method public void notify(int, androidx.core.app.NotificationCompat.Builder);
+ method public void notify(String?, int, androidx.core.app.NotificationCompat.Builder);
+ }
+
+ public final class CarPendingIntent {
+ method public static android.app.PendingIntent getCarApp(android.content.Context, int, android.content.Intent, int);
+ }
+
+}
+
+package androidx.car.app.serialization {
+
+ public final class Bundleable implements android.os.Parcelable {
+ method public static androidx.car.app.serialization.Bundleable create(Object) throws androidx.car.app.serialization.BundlerException;
+ method public int describeContents();
+ method public Object get() throws androidx.car.app.serialization.BundlerException;
+ method public void writeToParcel(android.os.Parcel, int);
+ field public static final android.os.Parcelable.Creator<androidx.car.app.serialization.Bundleable!> CREATOR;
+ }
+
+ public class BundlerException extends java.lang.Exception {
+ ctor public BundlerException(String?, Throwable);
+ ctor public BundlerException(String?);
+ }
+
+}
+
+package androidx.car.app.validation {
+
+ public final class HostValidator {
+ method public java.util.Map<java.lang.String!,java.util.List<java.lang.String!>!> getAllowedHosts();
+ method public boolean isValidHost(androidx.car.app.HostInfo);
+ field public static final androidx.car.app.validation.HostValidator ALLOW_ALL_HOSTS_VALIDATOR;
+ field public static final String TEMPLATE_RENDERER_PERMISSION = "android.car.permission.TEMPLATE_RENDERER";
+ }
+
+ public static final class HostValidator.Builder {
+ ctor public HostValidator.Builder(android.content.Context);
+ method public androidx.car.app.validation.HostValidator.Builder addAllowedHost(String, String);
+ method public androidx.car.app.validation.HostValidator.Builder addAllowedHosts(@ArrayRes int);
+ method public androidx.car.app.validation.HostValidator build();
+ }
+
+}
+
+package androidx.car.app.versioning {
+
+ public final class CarAppApiLevels {
+ method public static int getLatest();
+ method public static int getOldest();
+ field public static final int LEVEL_1 = 1; // 0x1
+ field public static final int LEVEL_2 = 2; // 0x2
+ field public static final int LEVEL_3 = 3; // 0x3
+ }
+
+}
+
diff --git a/car/app/app/src/main/java/androidx/car/app/CarAppMetadataHolderService.java b/car/app/app/src/main/java/androidx/car/app/CarAppMetadataHolderService.java
new file mode 100644
index 0000000..f85125b
--- /dev/null
+++ b/car/app/app/src/main/java/androidx/car/app/CarAppMetadataHolderService.java
@@ -0,0 +1,78 @@
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * 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.
+ */
+
+package androidx.car.app;
+
+import android.app.Service;
+import android.content.ComponentName;
+import android.content.Context;
+import android.content.Intent;
+import android.content.pm.PackageManager;
+import android.content.pm.ServiceInfo;
+import android.os.Build;
+import android.os.IBinder;
+
+import androidx.annotation.DoNotInline;
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+import androidx.annotation.RequiresApi;
+import androidx.annotation.RestrictTo;
+
+/**
+ * A placeholder service to avoid adding application-level metadata.
+ *
+ * <p>The service is only used to expose metadata defined in the library's manifest.
+ *
+ * @hide
+ */
+@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
+public class CarAppMetadataHolderService extends Service {
+ @Nullable
+ @Override
+ public IBinder onBind(@NonNull Intent intent) {
+ throw new UnsupportedOperationException();
+ }
+
+ private CarAppMetadataHolderService() {
+ }
+
+ /**
+ * Returns the {@link ServiceInfo} for the declared {@link CarAppMetadataHolderService}.
+ */
+ @NonNull
+ @SuppressWarnings("deprecation") // GET_DISABLED_COMPONENTS
+ public static ServiceInfo getServiceInfo(@NonNull Context context) throws
+ PackageManager.NameNotFoundException {
+ int flags = PackageManager.GET_META_DATA;
+ // The service is marked as disabled so we need to include the following flags.
+ if (Build.VERSION.SDK_INT >= 24) {
+ flags |= Api24Impl.getDisabledComponentFlag();
+ } else {
+ flags |= PackageManager.GET_DISABLED_COMPONENTS;
+ }
+
+ return context.getPackageManager().getServiceInfo(
+ new ComponentName(context, CarAppMetadataHolderService.class), flags);
+ }
+
+ @RequiresApi(24)
+ private static class Api24Impl {
+ @DoNotInline
+ static int getDisabledComponentFlag() {
+ return PackageManager.MATCH_DISABLED_COMPONENTS;
+ }
+ }
+}
diff --git a/car/app/app/src/main/java/androidx/car/app/CarContext.java b/car/app/app/src/main/java/androidx/car/app/CarContext.java
index 239c2c5..dea577a 100644
--- a/car/app/app/src/main/java/androidx/car/app/CarContext.java
+++ b/car/app/app/src/main/java/androidx/car/app/CarContext.java
@@ -639,9 +639,9 @@
*
* @hide
*/
- @RestrictTo(LIBRARY)
+ @RestrictTo(LIBRARY_GROUP)
@MainThread
- void updateHandshakeInfo(@NonNull HandshakeInfo handshakeInfo) {
+ public void updateHandshakeInfo(@NonNull HandshakeInfo handshakeInfo) {
mCarAppApiLevel = handshakeInfo.getHostCarAppApiLevel();
}
@@ -724,7 +724,8 @@
() -> ConstraintManager.create(this, hostDispatcher));
mManagers.addFactory(CarHardwareManager.class, HARDWARE_SERVICE,
() -> CarHardwareManager.create(this, hostDispatcher));
- mManagers.addFactory(ResultManager.class, null, ResultManager::create);
+ mManagers.addFactory(ResultManager.class, null,
+ () -> ResultManager.create(this));
mOnBackPressedDispatcher =
new OnBackPressedDispatcher(() -> getCarService(ScreenManager.class).pop());
diff --git a/car/app/app/src/main/java/androidx/car/app/hardware/CarHardwareManager.java b/car/app/app/src/main/java/androidx/car/app/hardware/CarHardwareManager.java
index dbb14bf7..3fc8d57 100644
--- a/car/app/app/src/main/java/androidx/car/app/hardware/CarHardwareManager.java
+++ b/car/app/app/src/main/java/androidx/car/app/hardware/CarHardwareManager.java
@@ -15,13 +15,15 @@
*/
package androidx.car.app.hardware;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
-import android.content.Context;
+import android.content.pm.PackageManager;
+import android.content.pm.ServiceInfo;
import androidx.annotation.MainThread;
import androidx.annotation.NonNull;
import androidx.annotation.RestrictTo;
+import androidx.car.app.CarAppMetadataHolderService;
import androidx.car.app.CarContext;
import androidx.car.app.HostDispatcher;
import androidx.car.app.HostException;
@@ -65,7 +67,7 @@
* {@link CarAppApiLevels#LEVEL_3}
* @hide
*/
- @RestrictTo(LIBRARY)
+ @RestrictTo(LIBRARY_GROUP)
@NonNull
static CarHardwareManager create(@NonNull CarContext context,
@NonNull HostDispatcher hostDispatcher) {
@@ -75,32 +77,24 @@
+ "service, but the host is less than " + CarAppApiLevels.LEVEL_3));
}
- try { // Check for automotive library first.
- Class<?> c = Class.forName("androidx.car.app.hardware.AutomotiveCarHardwareManager");
- Constructor<?> ctor = c.getConstructor(Context.class);
- Object object = ctor.newInstance(context);
- return (CarHardwareManager) object;
- } catch (ClassNotFoundException e) {
- // No Automotive. Fall through.
- } catch (ReflectiveOperationException e) {
- // Something went wrong with accessing the constructor or calling newInstance().
- throw new IllegalStateException("Mismatch with app-automotive artifact", e);
- }
+ try {
+ ServiceInfo serviceInfo = CarAppMetadataHolderService.getServiceInfo(context);
+ String managerClassName = null;
+ if (serviceInfo.metaData != null) {
+ managerClassName = serviceInfo.metaData.getString(
+ "androidx.car.app.CarAppMetadataHolderService.CAR_HARDWARE_MANAGER");
+ }
+ if (managerClassName == null) {
+ throw new ClassNotFoundException("CarHardwareManager metadata could not be found");
+ }
- try { // Check for projected library.
- Class<?> c = Class.forName("androidx.car.app.hardware.ProjectedCarHardwareManager");
- Constructor<?> ctor = c.getConstructor(HostDispatcher.class);
- Object object = ctor.newInstance(hostDispatcher);
- return (CarHardwareManager) object;
- } catch (ClassNotFoundException e) {
- // No Projected. Fall through.
- } catch (ReflectiveOperationException e) {
- // Something went wrong with accessing the constructor or calling newInstance().
- throw new IllegalStateException("Mismatch with app-projected artifact", e);
+ Class<?> managerClass = Class.forName(managerClassName);
+ Constructor<?> ctor = managerClass.getConstructor(CarContext.class,
+ HostDispatcher.class);
+ return (CarHardwareManager) ctor.newInstance(context, hostDispatcher);
+ } catch (PackageManager.NameNotFoundException | ReflectiveOperationException e) {
+ throw new IllegalStateException("CarHardwareManager not configured. Did you forget "
+ + "to add a dependency on app-automotive or app-projected artifacts?");
}
-
- throw new IllegalStateException("Vehicle Manager not "
- + "configured. Did you forget to add a dependency on app-automotive or "
- + "app-projected artifacts?");
}
}
diff --git a/car/app/app/src/main/java/androidx/car/app/managers/ResultManager.java b/car/app/app/src/main/java/androidx/car/app/managers/ResultManager.java
index 338eeef..f75486d 100644
--- a/car/app/app/src/main/java/androidx/car/app/managers/ResultManager.java
+++ b/car/app/app/src/main/java/androidx/car/app/managers/ResultManager.java
@@ -18,11 +18,14 @@
import android.content.ComponentName;
import android.content.Intent;
+import android.content.pm.PackageManager;
+import android.content.pm.ServiceInfo;
import androidx.annotation.MainThread;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.RestrictTo;
+import androidx.car.app.CarAppMetadataHolderService;
import androidx.car.app.CarContext;
/**
@@ -60,17 +63,25 @@
* class was found but the constructor was mismatched
* @hide
*/
- @RestrictTo(RestrictTo.Scope.LIBRARY)
+ @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
@NonNull
- static ResultManager create() throws IllegalStateException {
- ResultManager manager = Manager.create(ResultManager.class,
- "androidx.car.app.activity.ResultManagerAutomotive");
+ static ResultManager create(@NonNull CarContext context) throws IllegalStateException {
+ try {
+ ServiceInfo serviceInfo = CarAppMetadataHolderService.getServiceInfo(context);
+ String managerClassName = null;
+ if (serviceInfo.metaData != null) {
+ managerClassName = serviceInfo.metaData.getString(
+ "androidx.car.app.CarAppMetadataHolderService.RESULT_MANAGER");
+ }
+ if (managerClassName == null) {
+ throw new ClassNotFoundException("ResultManager metadata could not be found");
+ }
- if (manager == null) {
- throw new IllegalStateException("Unable to instantiate " + ResultManager.class
- + ". Did you forget to add a dependency on app-automotive artifact?");
+ Class<?> managerClass = Class.forName(managerClassName);
+ return (ResultManager) managerClass.getConstructor().newInstance();
+ } catch (PackageManager.NameNotFoundException | ReflectiveOperationException e) {
+ throw new IllegalStateException("ResultManager not configured. Did you forget "
+ + "to add a dependency on the app-automotive artifact?");
}
-
- return manager;
}
}
diff --git a/collection/collection-benchmark/src/androidTest/AndroidManifest.xml b/collection/collection-benchmark/src/androidTest/AndroidManifest.xml
index 1664e8d..82c5e06 100644
--- a/collection/collection-benchmark/src/androidTest/AndroidManifest.xml
+++ b/collection/collection-benchmark/src/androidTest/AndroidManifest.xml
@@ -16,15 +16,9 @@
-->
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:tools="http://schemas.android.com/tools"
package="androidx.collection.benchmark.test">
-
- <!-- Important: disable debuggable for accurate performance results -->
- <application
- android:debuggable="false"
- tools:replace="android:debuggable">
- <!-- enable profileableByShell for non-intrusive profiling tools -->
- <!--suppress AndroidElementNotAllowed -->
+ <application>
+ <!-- enable profiling by shell for non-intrusive profiling tools -->
<profileable android:shell="true"/>
</application>
</manifest>
diff --git a/collection/collection2/README.md b/collection2/collection2/README.md
similarity index 100%
rename from collection/collection2/README.md
rename to collection2/collection2/README.md
diff --git a/collection/collection2/api/1.0.0.txt b/collection2/collection2/api/1.0.0.txt
similarity index 100%
rename from collection/collection2/api/1.0.0.txt
rename to collection2/collection2/api/1.0.0.txt
diff --git a/collection/collection2/api/1.1.0-beta01.txt b/collection2/collection2/api/1.1.0-beta01.txt
similarity index 100%
rename from collection/collection2/api/1.1.0-beta01.txt
rename to collection2/collection2/api/1.1.0-beta01.txt
diff --git a/collection/collection2/api/1.1.0-beta02.txt b/collection2/collection2/api/1.1.0-beta02.txt
similarity index 100%
rename from collection/collection2/api/1.1.0-beta02.txt
rename to collection2/collection2/api/1.1.0-beta02.txt
diff --git a/collection/collection2/api/1.1.0-rc01.txt b/collection2/collection2/api/1.1.0-rc01.txt
similarity index 100%
rename from collection/collection2/api/1.1.0-rc01.txt
rename to collection2/collection2/api/1.1.0-rc01.txt
diff --git a/collection/collection2/api/current.ignore b/collection2/collection2/api/current.ignore
similarity index 100%
rename from collection/collection2/api/current.ignore
rename to collection2/collection2/api/current.ignore
diff --git a/collection/collection2/api/current.txt b/collection2/collection2/api/current.txt
similarity index 100%
rename from collection/collection2/api/current.txt
rename to collection2/collection2/api/current.txt
diff --git a/collection/collection2/api/public_plus_experimental_1.0.0.txt b/collection2/collection2/api/public_plus_experimental_1.0.0.txt
similarity index 100%
rename from collection/collection2/api/public_plus_experimental_1.0.0.txt
rename to collection2/collection2/api/public_plus_experimental_1.0.0.txt
diff --git a/collection/collection2/api/public_plus_experimental_1.1.0-beta01.txt b/collection2/collection2/api/public_plus_experimental_1.1.0-beta01.txt
similarity index 100%
rename from collection/collection2/api/public_plus_experimental_1.1.0-beta01.txt
rename to collection2/collection2/api/public_plus_experimental_1.1.0-beta01.txt
diff --git a/collection/collection2/api/public_plus_experimental_1.1.0-rc01.txt b/collection2/collection2/api/public_plus_experimental_1.1.0-rc01.txt
similarity index 100%
rename from collection/collection2/api/public_plus_experimental_1.1.0-rc01.txt
rename to collection2/collection2/api/public_plus_experimental_1.1.0-rc01.txt
diff --git a/collection/collection2/api/public_plus_experimental_current.txt b/collection2/collection2/api/public_plus_experimental_current.txt
similarity index 100%
rename from collection/collection2/api/public_plus_experimental_current.txt
rename to collection2/collection2/api/public_plus_experimental_current.txt
diff --git a/collection/collection2/api/restricted_1.0.0.txt b/collection2/collection2/api/restricted_1.0.0.txt
similarity index 100%
rename from collection/collection2/api/restricted_1.0.0.txt
rename to collection2/collection2/api/restricted_1.0.0.txt
diff --git a/collection/collection2/api/restricted_1.1.0-beta01.txt b/collection2/collection2/api/restricted_1.1.0-beta01.txt
similarity index 100%
rename from collection/collection2/api/restricted_1.1.0-beta01.txt
rename to collection2/collection2/api/restricted_1.1.0-beta01.txt
diff --git a/collection/collection2/api/restricted_1.1.0-beta02.txt b/collection2/collection2/api/restricted_1.1.0-beta02.txt
similarity index 100%
rename from collection/collection2/api/restricted_1.1.0-beta02.txt
rename to collection2/collection2/api/restricted_1.1.0-beta02.txt
diff --git a/collection/collection2/api/restricted_1.1.0-rc01.txt b/collection2/collection2/api/restricted_1.1.0-rc01.txt
similarity index 100%
rename from collection/collection2/api/restricted_1.1.0-rc01.txt
rename to collection2/collection2/api/restricted_1.1.0-rc01.txt
diff --git a/collection/collection2/api/restricted_current.ignore b/collection2/collection2/api/restricted_current.ignore
similarity index 100%
rename from collection/collection2/api/restricted_current.ignore
rename to collection2/collection2/api/restricted_current.ignore
diff --git a/collection/collection2/api/restricted_current.txt b/collection2/collection2/api/restricted_current.txt
similarity index 100%
rename from collection/collection2/api/restricted_current.txt
rename to collection2/collection2/api/restricted_current.txt
diff --git a/collection/collection2/build.gradle b/collection2/collection2/build.gradle
similarity index 96%
rename from collection/collection2/build.gradle
rename to collection2/collection2/build.gradle
index a492d63..cb6fc94 100644
--- a/collection/collection2/build.gradle
+++ b/collection2/collection2/build.gradle
@@ -137,16 +137,13 @@
androidx {
name = "Android Support Library collections"
- if (githubBuild) {
- publish = Publish.SNAPSHOT_AND_RELEASE
- } else {
- publish = Publish.NONE
- }
- mavenGroup = LibraryGroups.COLLECTION
+ publish = Publish.SNAPSHOT_AND_RELEASE
+ mavenGroup = LibraryGroups.COLLECTION2
inceptionYear = "2020"
description = "Standalone efficient collections."
legacyDisableKotlinStrictApiMode = true // TODO: Re-enable this!
runApiTasks = new RunApiTasks.No("metalava issues prevent api checks on kmp: b/188171162")
+ multiplatform = true
}
repositories {
diff --git a/collection2/collection2/integration-tests/publishing/build.gradle b/collection2/collection2/integration-tests/publishing/build.gradle
new file mode 100644
index 0000000..8191b473
--- /dev/null
+++ b/collection2/collection2/integration-tests/publishing/build.gradle
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * 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.
+ */
+
+import androidx.build.SdkResourceGenerator
+
+plugins {
+ id("AndroidXPlugin")
+ id("kotlin")
+}
+
+dependencies {
+ implementation(libs.kotlinStdlib)
+
+ testImplementation(project(":internal-testutils-gradle-plugin"))
+ testImplementation(libs.junit)
+ testImplementation(libs.truth)
+ testImplementation(gradleTestKit())
+}
+
+SdkResourceGenerator.generateForHostTest(project)
+
+tasks.findByPath("test").dependsOn(
+ tasks.findByPath(":collection:collection:publish"),
+ tasks.findByPath(":collection2:collection2:publish"),
+)
\ No newline at end of file
diff --git a/collection2/collection2/integration-tests/publishing/src/test/kotlin/androidx/room/gradle/CollectionTest.kt b/collection2/collection2/integration-tests/publishing/src/test/kotlin/androidx/room/gradle/CollectionTest.kt
new file mode 100644
index 0000000..3f31e1a
--- /dev/null
+++ b/collection2/collection2/integration-tests/publishing/src/test/kotlin/androidx/room/gradle/CollectionTest.kt
@@ -0,0 +1,49 @@
+/*
+ * Copyright 2019 The Android Open Source Project
+ *
+ * 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.
+ */
+
+package androidx.room.gradle
+
+import androidx.testutils.gradle.ProjectSetupRule
+import org.junit.Assert
+import org.junit.Rule
+import org.junit.Test
+import java.io.File
+
+class CollectionTest {
+ @get:Rule
+ val projectSetup = ProjectSetupRule()
+
+ @Test
+ fun collection2mavenMetadata() {
+ val c1metadata = getPublishedFile("androidx/collection/collection/maven-metadata.xml")
+ val c2metadata = getPublishedFile("androidx/collection2/collection2/maven-metadata.xml")
+ c1metadata.readLines().zip(c2metadata.readLines()).forEach { (c1, c2) ->
+ if (!c1.contains("lastUpdated")) {
+ Assert.assertEquals(c1.replace("collection", "collection2"), c2)
+ }
+ }
+ }
+
+ private fun getPublishedFile(name: String) =
+ File(projectSetup.props.localSupportRepo).resolve(name).checkIt { exists() }
+
+ private fun <T> T.checkIt(eval: T.() -> Boolean): T {
+ if (!eval()) {
+ Assert.fail("Failed assertion: $this")
+ }
+ return this
+ }
+}
diff --git a/collection/collection2/src/commonMain/kotlin/androidx/collection/ArrayMap.kt b/collection2/collection2/src/commonMain/kotlin/androidx/collection/ArrayMap.kt
similarity index 100%
rename from collection/collection2/src/commonMain/kotlin/androidx/collection/ArrayMap.kt
rename to collection2/collection2/src/commonMain/kotlin/androidx/collection/ArrayMap.kt
diff --git a/collection/collection2/src/commonMain/kotlin/androidx/collection/ArraySet.kt b/collection2/collection2/src/commonMain/kotlin/androidx/collection/ArraySet.kt
similarity index 100%
rename from collection/collection2/src/commonMain/kotlin/androidx/collection/ArraySet.kt
rename to collection2/collection2/src/commonMain/kotlin/androidx/collection/ArraySet.kt
diff --git a/collection/collection2/src/commonMain/kotlin/androidx/collection/CircularArray.kt b/collection2/collection2/src/commonMain/kotlin/androidx/collection/CircularArray.kt
similarity index 100%
rename from collection/collection2/src/commonMain/kotlin/androidx/collection/CircularArray.kt
rename to collection2/collection2/src/commonMain/kotlin/androidx/collection/CircularArray.kt
diff --git a/collection/collection2/src/commonMain/kotlin/androidx/collection/CircularIntArray.kt b/collection2/collection2/src/commonMain/kotlin/androidx/collection/CircularIntArray.kt
similarity index 100%
rename from collection/collection2/src/commonMain/kotlin/androidx/collection/CircularIntArray.kt
rename to collection2/collection2/src/commonMain/kotlin/androidx/collection/CircularIntArray.kt
diff --git a/collection/collection2/src/commonMain/kotlin/androidx/collection/ContainerHelpers.kt b/collection2/collection2/src/commonMain/kotlin/androidx/collection/ContainerHelpers.kt
similarity index 100%
rename from collection/collection2/src/commonMain/kotlin/androidx/collection/ContainerHelpers.kt
rename to collection2/collection2/src/commonMain/kotlin/androidx/collection/ContainerHelpers.kt
diff --git a/collection/collection2/src/commonMain/kotlin/androidx/collection/IndexBasedMutableIterator.kt b/collection2/collection2/src/commonMain/kotlin/androidx/collection/IndexBasedMutableIterator.kt
similarity index 100%
rename from collection/collection2/src/commonMain/kotlin/androidx/collection/IndexBasedMutableIterator.kt
rename to collection2/collection2/src/commonMain/kotlin/androidx/collection/IndexBasedMutableIterator.kt
diff --git a/collection/collection2/src/commonMain/kotlin/androidx/collection/LongSparseArray.kt b/collection2/collection2/src/commonMain/kotlin/androidx/collection/LongSparseArray.kt
similarity index 100%
rename from collection/collection2/src/commonMain/kotlin/androidx/collection/LongSparseArray.kt
rename to collection2/collection2/src/commonMain/kotlin/androidx/collection/LongSparseArray.kt
diff --git a/collection/collection2/src/commonMain/kotlin/androidx/collection/LruCache.kt b/collection2/collection2/src/commonMain/kotlin/androidx/collection/LruCache.kt
similarity index 100%
rename from collection/collection2/src/commonMain/kotlin/androidx/collection/LruCache.kt
rename to collection2/collection2/src/commonMain/kotlin/androidx/collection/LruCache.kt
diff --git a/collection/collection2/src/commonMain/kotlin/androidx/collection/Platform.kt b/collection2/collection2/src/commonMain/kotlin/androidx/collection/Platform.kt
similarity index 100%
rename from collection/collection2/src/commonMain/kotlin/androidx/collection/Platform.kt
rename to collection2/collection2/src/commonMain/kotlin/androidx/collection/Platform.kt
diff --git a/collection/collection2/src/commonMain/kotlin/androidx/collection/SimpleArrayMap.kt b/collection2/collection2/src/commonMain/kotlin/androidx/collection/SimpleArrayMap.kt
similarity index 100%
rename from collection/collection2/src/commonMain/kotlin/androidx/collection/SimpleArrayMap.kt
rename to collection2/collection2/src/commonMain/kotlin/androidx/collection/SimpleArrayMap.kt
diff --git a/collection/collection2/src/commonMain/kotlin/androidx/collection/SparseArray.kt b/collection2/collection2/src/commonMain/kotlin/androidx/collection/SparseArray.kt
similarity index 100%
rename from collection/collection2/src/commonMain/kotlin/androidx/collection/SparseArray.kt
rename to collection2/collection2/src/commonMain/kotlin/androidx/collection/SparseArray.kt
diff --git a/collection/collection2/src/commonTest/kotlin/androidx/collection/ArrayMapKotlinTest.kt b/collection2/collection2/src/commonTest/kotlin/androidx/collection/ArrayMapKotlinTest.kt
similarity index 100%
rename from collection/collection2/src/commonTest/kotlin/androidx/collection/ArrayMapKotlinTest.kt
rename to collection2/collection2/src/commonTest/kotlin/androidx/collection/ArrayMapKotlinTest.kt
diff --git a/collection/collection2/src/commonTest/kotlin/androidx/collection/ArraySetKotlinTest.kt b/collection2/collection2/src/commonTest/kotlin/androidx/collection/ArraySetKotlinTest.kt
similarity index 100%
rename from collection/collection2/src/commonTest/kotlin/androidx/collection/ArraySetKotlinTest.kt
rename to collection2/collection2/src/commonTest/kotlin/androidx/collection/ArraySetKotlinTest.kt
diff --git a/collection/collection2/src/commonTest/kotlin/androidx/collection/CircularArrayKotlinTest.kt b/collection2/collection2/src/commonTest/kotlin/androidx/collection/CircularArrayKotlinTest.kt
similarity index 100%
rename from collection/collection2/src/commonTest/kotlin/androidx/collection/CircularArrayKotlinTest.kt
rename to collection2/collection2/src/commonTest/kotlin/androidx/collection/CircularArrayKotlinTest.kt
diff --git a/collection/collection2/src/commonTest/kotlin/androidx/collection/CircularIntArrayKotlinTest.kt b/collection2/collection2/src/commonTest/kotlin/androidx/collection/CircularIntArrayKotlinTest.kt
similarity index 100%
rename from collection/collection2/src/commonTest/kotlin/androidx/collection/CircularIntArrayKotlinTest.kt
rename to collection2/collection2/src/commonTest/kotlin/androidx/collection/CircularIntArrayKotlinTest.kt
diff --git a/collection/collection2/src/commonTest/kotlin/androidx/collection/IndexBasedMutableIteratorKotlinTest.kt b/collection2/collection2/src/commonTest/kotlin/androidx/collection/IndexBasedMutableIteratorKotlinTest.kt
similarity index 100%
rename from collection/collection2/src/commonTest/kotlin/androidx/collection/IndexBasedMutableIteratorKotlinTest.kt
rename to collection2/collection2/src/commonTest/kotlin/androidx/collection/IndexBasedMutableIteratorKotlinTest.kt
diff --git a/collection/collection2/src/commonTest/kotlin/androidx/collection/LongSparseArrayKotlinTest.kt b/collection2/collection2/src/commonTest/kotlin/androidx/collection/LongSparseArrayKotlinTest.kt
similarity index 100%
rename from collection/collection2/src/commonTest/kotlin/androidx/collection/LongSparseArrayKotlinTest.kt
rename to collection2/collection2/src/commonTest/kotlin/androidx/collection/LongSparseArrayKotlinTest.kt
diff --git a/collection/collection2/src/commonTest/kotlin/androidx/collection/LruCacheKotlinTest.kt b/collection2/collection2/src/commonTest/kotlin/androidx/collection/LruCacheKotlinTest.kt
similarity index 100%
rename from collection/collection2/src/commonTest/kotlin/androidx/collection/LruCacheKotlinTest.kt
rename to collection2/collection2/src/commonTest/kotlin/androidx/collection/LruCacheKotlinTest.kt
diff --git a/collection/collection2/src/commonTest/kotlin/androidx/collection/SimpleArrayMapKotlinTest.kt b/collection2/collection2/src/commonTest/kotlin/androidx/collection/SimpleArrayMapKotlinTest.kt
similarity index 100%
rename from collection/collection2/src/commonTest/kotlin/androidx/collection/SimpleArrayMapKotlinTest.kt
rename to collection2/collection2/src/commonTest/kotlin/androidx/collection/SimpleArrayMapKotlinTest.kt
diff --git a/collection/collection2/src/commonTest/kotlin/androidx/collection/SparseArrayKotlinTest.kt b/collection2/collection2/src/commonTest/kotlin/androidx/collection/SparseArrayKotlinTest.kt
similarity index 100%
rename from collection/collection2/src/commonTest/kotlin/androidx/collection/SparseArrayKotlinTest.kt
rename to collection2/collection2/src/commonTest/kotlin/androidx/collection/SparseArrayKotlinTest.kt
diff --git a/collection/collection2/src/commonTest/kotlin/androidx/collection/testing.kt b/collection2/collection2/src/commonTest/kotlin/androidx/collection/testing.kt
similarity index 100%
rename from collection/collection2/src/commonTest/kotlin/androidx/collection/testing.kt
rename to collection2/collection2/src/commonTest/kotlin/androidx/collection/testing.kt
diff --git a/collection/collection2/src/jsTest/kotlin/androidx/collection/testing.kt b/collection2/collection2/src/jsTest/kotlin/androidx/collection/testing.kt
similarity index 100%
rename from collection/collection2/src/jsTest/kotlin/androidx/collection/testing.kt
rename to collection2/collection2/src/jsTest/kotlin/androidx/collection/testing.kt
diff --git a/collection/collection2/src/jvmMain/java/androidx/collection/ArrayMap.java b/collection2/collection2/src/jvmMain/java/androidx/collection/ArrayMap.java
similarity index 100%
rename from collection/collection2/src/jvmMain/java/androidx/collection/ArrayMap.java
rename to collection2/collection2/src/jvmMain/java/androidx/collection/ArrayMap.java
diff --git a/collection/collection2/src/jvmMain/kotlin/androidx/collection/LongSparseArray.kt b/collection2/collection2/src/jvmMain/kotlin/androidx/collection/LongSparseArray.kt
similarity index 100%
rename from collection/collection2/src/jvmMain/kotlin/androidx/collection/LongSparseArray.kt
rename to collection2/collection2/src/jvmMain/kotlin/androidx/collection/LongSparseArray.kt
diff --git a/collection/collection2/src/jvmMain/kotlin/androidx/collection/Platform.kt b/collection2/collection2/src/jvmMain/kotlin/androidx/collection/Platform.kt
similarity index 100%
rename from collection/collection2/src/jvmMain/kotlin/androidx/collection/Platform.kt
rename to collection2/collection2/src/jvmMain/kotlin/androidx/collection/Platform.kt
diff --git a/collection/collection2/src/jvmMain/kotlin/androidx/collection/SourceCompatibility.kt b/collection2/collection2/src/jvmMain/kotlin/androidx/collection/SourceCompatibility.kt
similarity index 100%
rename from collection/collection2/src/jvmMain/kotlin/androidx/collection/SourceCompatibility.kt
rename to collection2/collection2/src/jvmMain/kotlin/androidx/collection/SourceCompatibility.kt
diff --git a/collection/collection2/src/jvmMain/kotlin/androidx/collection/SparseArray.kt b/collection2/collection2/src/jvmMain/kotlin/androidx/collection/SparseArray.kt
similarity index 100%
rename from collection/collection2/src/jvmMain/kotlin/androidx/collection/SparseArray.kt
rename to collection2/collection2/src/jvmMain/kotlin/androidx/collection/SparseArray.kt
diff --git a/collection/collection2/src/jvmTest/kotlin/androidx/collection/ArrayMapThreadedTest.kt b/collection2/collection2/src/jvmTest/kotlin/androidx/collection/ArrayMapThreadedTest.kt
similarity index 100%
rename from collection/collection2/src/jvmTest/kotlin/androidx/collection/ArrayMapThreadedTest.kt
rename to collection2/collection2/src/jvmTest/kotlin/androidx/collection/ArrayMapThreadedTest.kt
diff --git a/collection/collection2/src/jvmTest/kotlin/androidx/collection/ArraySetThreadedTest.kt b/collection2/collection2/src/jvmTest/kotlin/androidx/collection/ArraySetThreadedTest.kt
similarity index 100%
rename from collection/collection2/src/jvmTest/kotlin/androidx/collection/ArraySetThreadedTest.kt
rename to collection2/collection2/src/jvmTest/kotlin/androidx/collection/ArraySetThreadedTest.kt
diff --git a/collection/collection2/src/jvmTest/kotlin/androidx/collection/CloneableTest.kt b/collection2/collection2/src/jvmTest/kotlin/androidx/collection/CloneableTest.kt
similarity index 100%
rename from collection/collection2/src/jvmTest/kotlin/androidx/collection/CloneableTest.kt
rename to collection2/collection2/src/jvmTest/kotlin/androidx/collection/CloneableTest.kt
diff --git a/collection/collection2/src/jvmTest/kotlin/androidx/collection/LruCacheThreadedTest.kt b/collection2/collection2/src/jvmTest/kotlin/androidx/collection/LruCacheThreadedTest.kt
similarity index 100%
rename from collection/collection2/src/jvmTest/kotlin/androidx/collection/LruCacheThreadedTest.kt
rename to collection2/collection2/src/jvmTest/kotlin/androidx/collection/LruCacheThreadedTest.kt
diff --git a/collection/collection2/src/jvmTest/kotlin/androidx/collection/SimpleArrayMapThreadedTest.kt b/collection2/collection2/src/jvmTest/kotlin/androidx/collection/SimpleArrayMapThreadedTest.kt
similarity index 100%
rename from collection/collection2/src/jvmTest/kotlin/androidx/collection/SimpleArrayMapThreadedTest.kt
rename to collection2/collection2/src/jvmTest/kotlin/androidx/collection/SimpleArrayMapThreadedTest.kt
diff --git a/collection/collection2/src/jvmTest/kotlin/androidx/collection/testing.kt b/collection2/collection2/src/jvmTest/kotlin/androidx/collection/testing.kt
similarity index 100%
rename from collection/collection2/src/jvmTest/kotlin/androidx/collection/testing.kt
rename to collection2/collection2/src/jvmTest/kotlin/androidx/collection/testing.kt
diff --git a/collection/collection2/src/nativeTest/kotlin/androidx/collection/testing.kt b/collection2/collection2/src/nativeTest/kotlin/androidx/collection/testing.kt
similarity index 100%
rename from collection/collection2/src/nativeTest/kotlin/androidx/collection/testing.kt
rename to collection2/collection2/src/nativeTest/kotlin/androidx/collection/testing.kt
diff --git a/collection/collection2/src/nonJvmMain/kotlin/androidx/collection/ArrayMap.kt b/collection2/collection2/src/nonJvmMain/kotlin/androidx/collection/ArrayMap.kt
similarity index 100%
rename from collection/collection2/src/nonJvmMain/kotlin/androidx/collection/ArrayMap.kt
rename to collection2/collection2/src/nonJvmMain/kotlin/androidx/collection/ArrayMap.kt
diff --git a/collection/collection2/src/nonJvmMain/kotlin/androidx/collection/LongSparseArray.kt b/collection2/collection2/src/nonJvmMain/kotlin/androidx/collection/LongSparseArray.kt
similarity index 100%
rename from collection/collection2/src/nonJvmMain/kotlin/androidx/collection/LongSparseArray.kt
rename to collection2/collection2/src/nonJvmMain/kotlin/androidx/collection/LongSparseArray.kt
diff --git a/collection/collection2/src/nonJvmMain/kotlin/androidx/collection/Platform.kt b/collection2/collection2/src/nonJvmMain/kotlin/androidx/collection/Platform.kt
similarity index 100%
rename from collection/collection2/src/nonJvmMain/kotlin/androidx/collection/Platform.kt
rename to collection2/collection2/src/nonJvmMain/kotlin/androidx/collection/Platform.kt
diff --git a/collection/collection2/src/nonJvmMain/kotlin/androidx/collection/SparseArray.kt b/collection2/collection2/src/nonJvmMain/kotlin/androidx/collection/SparseArray.kt
similarity index 100%
rename from collection/collection2/src/nonJvmMain/kotlin/androidx/collection/SparseArray.kt
rename to collection2/collection2/src/nonJvmMain/kotlin/androidx/collection/SparseArray.kt
diff --git a/compose/animation/animation-core-lint/src/main/java/androidx/compose/animation/core/lint/AnimationCoreIssueRegistry.kt b/compose/animation/animation-core-lint/src/main/java/androidx/compose/animation/core/lint/AnimationCoreIssueRegistry.kt
index dae1d21e..ae4d68c 100644
--- a/compose/animation/animation-core-lint/src/main/java/androidx/compose/animation/core/lint/AnimationCoreIssueRegistry.kt
+++ b/compose/animation/animation-core-lint/src/main/java/androidx/compose/animation/core/lint/AnimationCoreIssueRegistry.kt
@@ -25,7 +25,7 @@
*/
class AnimationCoreIssueRegistry : IssueRegistry() {
// Tests are run with this version. We ensure that with ApiLintVersionsTest
- override val api = 10
+ override val api = 11
override val minApi = CURRENT_API
override val issues get() = listOf(
TransitionDetector.UnusedTransitionTargetStateParameter,
diff --git a/compose/animation/animation-core-lint/src/test/java/androidx/compose/animation/core/lint/UnrememberedAnimatableDetectorTest.kt b/compose/animation/animation-core-lint/src/test/java/androidx/compose/animation/core/lint/UnrememberedAnimatableDetectorTest.kt
index e4b2d27..ce267e4 100644
--- a/compose/animation/animation-core-lint/src/test/java/androidx/compose/animation/core/lint/UnrememberedAnimatableDetectorTest.kt
+++ b/compose/animation/animation-core-lint/src/test/java/androidx/compose/animation/core/lint/UnrememberedAnimatableDetectorTest.kt
@@ -21,6 +21,7 @@
import androidx.compose.lint.test.Stubs
import androidx.compose.lint.test.compiledStub
import com.android.tools.lint.checks.infrastructure.LintDetectorTest
+import com.android.tools.lint.checks.infrastructure.TestMode
import com.android.tools.lint.detector.api.Detector
import com.android.tools.lint.detector.api.Issue
import org.junit.Test
@@ -231,6 +232,7 @@
Stubs.Composable,
Stubs.Remember
)
+ .skipTestModes(TestMode.TYPE_ALIAS)
.run()
.expect(
"""
diff --git a/compose/animation/animation-core/benchmark/src/androidTest/AndroidManifest.xml b/compose/animation/animation-core/benchmark/src/androidTest/AndroidManifest.xml
index fea4215..930962e 100644
--- a/compose/animation/animation-core/benchmark/src/androidTest/AndroidManifest.xml
+++ b/compose/animation/animation-core/benchmark/src/androidTest/AndroidManifest.xml
@@ -15,17 +15,9 @@
~ limitations under the License.
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:tools="http://schemas.android.com/tools"
package="androidx.compose.animation.core.benchmark">
-
- <!--
- ~ Important: disable debuggable for accurate performance results
- -->
- <application
- android:debuggable="false"
- tools:replace="android:debuggable">
- <!-- enable profileableByShell for non-intrusive profiling tools -->
- <!--suppress AndroidElementNotAllowed -->
+ <application>
+ <!-- enable profiling by shell for non-intrusive profiling tools -->
<profileable android:shell="true"/>
</application>
</manifest>
diff --git a/compose/animation/animation-lint/src/main/java/androidx/compose/animation/lint/AnimationIssueRegistry.kt b/compose/animation/animation-lint/src/main/java/androidx/compose/animation/lint/AnimationIssueRegistry.kt
index 592a6ba..204d00f 100644
--- a/compose/animation/animation-lint/src/main/java/androidx/compose/animation/lint/AnimationIssueRegistry.kt
+++ b/compose/animation/animation-lint/src/main/java/androidx/compose/animation/lint/AnimationIssueRegistry.kt
@@ -27,7 +27,7 @@
*/
class AnimationIssueRegistry : IssueRegistry() {
// Tests are run with this version. We ensure that with ApiLintVersionsTest
- override val api = 10
+ override val api = 11
override val minApi = CURRENT_API
override val issues get() = listOf(
CrossfadeDetector.UnusedCrossfadeTargetStateParameter
diff --git a/compose/animation/animation/integration-tests/animation-demos/src/main/java/androidx/compose/animation/demos/AnimationDemos.kt b/compose/animation/animation/integration-tests/animation-demos/src/main/java/androidx/compose/animation/demos/AnimationDemos.kt
index 10f7d77..ffa354f 100644
--- a/compose/animation/animation/integration-tests/animation-demos/src/main/java/androidx/compose/animation/demos/AnimationDemos.kt
+++ b/compose/animation/animation/integration-tests/animation-demos/src/main/java/androidx/compose/animation/demos/AnimationDemos.kt
@@ -81,13 +81,20 @@
),
DemoCategory(
+ "Visual Aid \uD83D\uDC40 \uD83D\uDC40",
+ listOf(
+ ComposableDemo("Column Arrangements Demo") { ColumnConfigurationDemo() },
+ ComposableDemo("Row Arrangements Demo (Landscape)") { RowConfigurationDemo() },
+ )
+ ),
+
+ DemoCategory(
"\uD83C\uDF89 Fun Demos",
listOf(
ComposableDemo("Animated clock") { AnimatedClockDemo() },
ComposableDemo("Animated dots") { AnimatedDotsDemo() },
ComposableDemo("Chat screen") { ChatScreen() },
ComposableDemo("Game of fling") { FlingGame() },
- ComposableDemo("Row Configuration Demo (Landscape)") { RowConfigurationDemo() },
ComposableDemo("Spring chain") { SpringChainDemo() },
)
)
diff --git a/compose/animation/animation/integration-tests/animation-demos/src/main/java/androidx/compose/animation/demos/ColumnConfigurationDemo.kt b/compose/animation/animation/integration-tests/animation-demos/src/main/java/androidx/compose/animation/demos/ColumnConfigurationDemo.kt
new file mode 100644
index 0000000..5662e19
--- /dev/null
+++ b/compose/animation/animation/integration-tests/animation-demos/src/main/java/androidx/compose/animation/demos/ColumnConfigurationDemo.kt
@@ -0,0 +1,186 @@
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * 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.
+ */
+
+package androidx.compose.animation.demos
+
+import androidx.compose.animation.core.Spring
+import androidx.compose.animation.core.VectorConverter
+import androidx.compose.animation.core.animate
+import androidx.compose.animation.core.spring
+import androidx.compose.animation.core.tween
+import androidx.compose.foundation.background
+import androidx.compose.foundation.layout.Arrangement
+import androidx.compose.foundation.layout.Box
+import androidx.compose.foundation.layout.Column
+import androidx.compose.foundation.layout.ColumnScope
+import androidx.compose.foundation.layout.Row
+import androidx.compose.foundation.layout.fillMaxSize
+import androidx.compose.foundation.layout.fillMaxHeight
+import androidx.compose.foundation.layout.padding
+import androidx.compose.foundation.layout.requiredHeight
+import androidx.compose.foundation.layout.height
+import androidx.compose.foundation.layout.width
+import androidx.compose.foundation.shape.RoundedCornerShape
+import androidx.compose.material.Text
+import androidx.compose.runtime.Composable
+import androidx.compose.runtime.getValue
+import androidx.compose.runtime.produceState
+import androidx.compose.ui.Alignment
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.draw.shadow
+import androidx.compose.ui.graphics.Color
+import androidx.compose.ui.platform.InfiniteAnimationPolicy
+import androidx.compose.ui.text.style.TextAlign
+import androidx.compose.ui.unit.Dp
+import androidx.compose.ui.unit.dp
+import androidx.compose.ui.unit.sp
+import kotlinx.coroutines.delay
+
+@Composable
+fun ColumnConfigurationDemo() {
+ val height by produceState(250.dp) {
+ // Skip the animations in tests.
+ while (coroutineContext[InfiniteAnimationPolicy] == null) {
+ animate(
+ Dp.VectorConverter, 250.dp, 520.dp,
+ animationSpec = spring(Spring.DampingRatioMediumBouncy, Spring.StiffnessLow)
+ ) { value, _ ->
+ this.value = value
+ }
+ delay(1000)
+ animate(
+ Dp.VectorConverter, 520.dp, 250.dp,
+ animationSpec = tween(520)
+ ) { value, _ ->
+ this.value = value
+ }
+ delay(1000)
+ }
+ }
+ ResizableColumn(height)
+}
+
+@Composable
+fun ResizableColumn(height: Dp) {
+ Column(
+ Modifier.fillMaxSize(),
+ horizontalAlignment = Alignment.CenterHorizontally,
+ verticalArrangement = Arrangement.Center
+ ) {
+ Row(
+ verticalAlignment = Alignment.Bottom,
+ modifier = Modifier.background(Color.White, RoundedCornerShape(5.dp)).padding(10.dp)
+ ) {
+ Text(
+ text = "Equal\nWeight",
+ modifier = Modifier.width(50.dp).padding(2.dp),
+ fontSize = 12.sp, textAlign = TextAlign.Center
+ )
+ Text(
+ text = "Space\nBetween",
+ modifier = Modifier.width(50.dp).padding(2.dp),
+ fontSize = 11.sp,
+ textAlign = TextAlign.Center
+ )
+ Text(
+ text = "Space\nAround",
+ modifier = Modifier.width(50.dp).padding(2.dp),
+ fontSize = 12.sp,
+ textAlign = TextAlign.Center
+ )
+ Text(
+ text = "Space\nEvenly",
+ modifier = Modifier.width(50.dp).padding(2.dp),
+ fontSize = 12.sp,
+ textAlign = TextAlign.Center
+ )
+ Text(
+ text = "Top",
+ modifier = Modifier.width(50.dp).padding(2.dp),
+ fontSize = 12.sp,
+ textAlign = TextAlign.Center
+ )
+ Text(
+ text = "Center",
+ modifier = Modifier.width(50.dp).padding(2.dp),
+ fontSize = 12.sp,
+ textAlign = TextAlign.Center
+ )
+ Text(
+ text = "Bottom",
+ modifier = Modifier.width(50.dp).padding(2.dp),
+ fontSize = 12.sp,
+ textAlign = TextAlign.Center
+ )
+ }
+ Row(Modifier.height(520.dp).requiredHeight(height)) {
+ Column(Modifier.default(androidBlue)) {
+ ColumnItem("A", fixedSize = false)
+ ColumnItem("B", fixedSize = false)
+ ColumnItem("C", fixedSize = false)
+ }
+ Column(Modifier.default(androidDark), verticalArrangement = Arrangement.SpaceBetween) {
+ ColumnItem(text = "A")
+ ColumnItem(text = "B")
+ ColumnItem(text = "C")
+ }
+ Column(Modifier.default(androidGreen), verticalArrangement = Arrangement.SpaceAround) {
+ ColumnItem(text = "A")
+ ColumnItem(text = "B")
+ ColumnItem(text = "C")
+ }
+ Column(Modifier.default(androidBlue), verticalArrangement = Arrangement.SpaceEvenly) {
+ ColumnItem(text = "A")
+ ColumnItem(text = "B")
+ ColumnItem(text = "C")
+ }
+ Column(Modifier.default(androidDark), verticalArrangement = Arrangement.Top) {
+ ColumnItem(text = "A")
+ ColumnItem(text = "B")
+ ColumnItem(text = "C")
+ }
+ Column(Modifier.default(androidGreen), verticalArrangement = Arrangement.Center) {
+ ColumnItem(text = "A")
+ ColumnItem(text = "B")
+ ColumnItem(text = "C")
+ }
+ Column(Modifier.default(androidBlue), verticalArrangement = Arrangement.Bottom) {
+ ColumnItem(text = "A")
+ ColumnItem(text = "B")
+ ColumnItem(text = "C")
+ }
+ }
+ }
+}
+
+private fun Modifier.default(backgroundColor: Color) =
+ this.width(50.dp).padding(2.dp)
+ .background(backgroundColor, RoundedCornerShape(5.dp)).padding(top = 3.dp, bottom = 3.dp)
+ .fillMaxHeight()
+
+@Composable
+fun ColumnScope.ColumnItem(text: String, fixedSize: Boolean = true) {
+ val modifier = if (fixedSize) Modifier.height(80.dp) else Modifier.weight(1f)
+ Box(
+ modifier.width(50.dp).padding(5.dp).shadow(10.dp)
+ .background(Color.White, shape = RoundedCornerShape(5.dp))
+ .padding(top = 5.dp, bottom = 5.dp)
+ ) {
+ Text(text, Modifier.align(Alignment.Center), color = androidDark)
+ }
+}
+
+val androidBlue = Color(0xff4282f2)
\ No newline at end of file
diff --git a/compose/animation/animation/integration-tests/animation-demos/src/main/java/androidx/compose/animation/demos/RowConfigurationDemo.kt b/compose/animation/animation/integration-tests/animation-demos/src/main/java/androidx/compose/animation/demos/RowConfigurationDemo.kt
index 27e353f..19d6e3e 100644
--- a/compose/animation/animation/integration-tests/animation-demos/src/main/java/androidx/compose/animation/demos/RowConfigurationDemo.kt
+++ b/compose/animation/animation/integration-tests/animation-demos/src/main/java/androidx/compose/animation/demos/RowConfigurationDemo.kt
@@ -26,10 +26,12 @@
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
+import androidx.compose.foundation.layout.RowScope
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.requiredWidth
+import androidx.compose.foundation.layout.width
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.Text
import androidx.compose.runtime.Composable
@@ -42,24 +44,27 @@
import androidx.compose.ui.platform.InfiniteAnimationPolicy
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
+import kotlinx.coroutines.delay
@Composable
fun RowConfigurationDemo() {
- val width by produceState(240.dp) {
+ val width by produceState(250.dp) {
// Skip the animations in tests.
while (coroutineContext[InfiniteAnimationPolicy] == null) {
animate(
- Dp.VectorConverter, 240.dp, 500.dp,
- animationSpec = spring(Spring.DampingRatioHighBouncy, Spring.StiffnessLow)
+ Dp.VectorConverter, 250.dp, 520.dp,
+ animationSpec = spring(Spring.DampingRatioMediumBouncy, Spring.StiffnessLow)
) { value, _ ->
this.value = value
}
+ delay(1000)
animate(
- Dp.VectorConverter, 500.dp, 240.dp,
- animationSpec = tween(500)
+ Dp.VectorConverter, 520.dp, 250.dp,
+ animationSpec = tween(520)
) { value, _ ->
this.value = value
}
+ delay(1000)
}
}
ResizableLayout(width)
@@ -76,44 +81,42 @@
Text(text = "Space Between", modifier = Modifier.padding(12.dp))
Text(text = "Space Around", modifier = Modifier.padding(12.dp))
Text(text = "Space Evenly", modifier = Modifier.padding(12.dp))
- Text(text = "Align to End", modifier = Modifier.padding(12.dp))
+ Text(text = "End (LTR)", modifier = Modifier.padding(12.dp))
Text(text = "Center", modifier = Modifier.padding(12.dp))
- Text(text = "Align to Start", modifier = Modifier.padding(12.dp))
+ Text(text = "Start (LTR)", modifier = Modifier.padding(12.dp))
}
Column(Modifier.weight(1f).requiredWidth(width)) {
- val rowModifier =
- Modifier.padding(2.dp).background(Color.Blue, RoundedCornerShape(5.dp))
- Row(rowModifier.fillMaxWidth()) {
- RowItem(Modifier.weight(1f), "A")
- RowItem(Modifier.weight(1f), "B")
- RowItem(Modifier.weight(1f), "C")
+ Row(Modifier.default(androidBlue)) {
+ RowItem("A", fixedSize = false)
+ RowItem("B", fixedSize = false)
+ RowItem("C", fixedSize = false)
}
- Row(rowModifier.fillMaxWidth(), horizontalArrangement = Arrangement.SpaceBetween) {
+ Row(Modifier.default(androidDark), horizontalArrangement = Arrangement.SpaceBetween) {
RowItem(text = "A")
RowItem(text = "B")
RowItem(text = "C")
}
- Row(rowModifier.fillMaxWidth(), horizontalArrangement = Arrangement.SpaceAround) {
+ Row(Modifier.default(androidGreen), horizontalArrangement = Arrangement.SpaceAround) {
RowItem(text = "A")
RowItem(text = "B")
RowItem(text = "C")
}
- Row(rowModifier.fillMaxWidth(), horizontalArrangement = Arrangement.SpaceEvenly) {
+ Row(Modifier.default(androidBlue), horizontalArrangement = Arrangement.SpaceEvenly) {
RowItem(text = "A")
RowItem(text = "B")
RowItem(text = "C")
}
- Row(rowModifier.fillMaxWidth(), horizontalArrangement = Arrangement.End) {
+ Row(Modifier.default(androidDark), horizontalArrangement = Arrangement.End) {
RowItem(text = "A")
RowItem(text = "B")
RowItem(text = "C")
}
- Row(rowModifier.fillMaxWidth(), horizontalArrangement = Arrangement.Center) {
+ Row(Modifier.default(androidGreen), horizontalArrangement = Arrangement.Center) {
RowItem(text = "A")
RowItem(text = "B")
RowItem(text = "C")
}
- Row(rowModifier.fillMaxWidth(), horizontalArrangement = Arrangement.Start) {
+ Row(Modifier.default(androidBlue), horizontalArrangement = Arrangement.Start) {
RowItem(text = "A")
RowItem(text = "B")
RowItem(text = "C")
@@ -122,13 +125,21 @@
}
}
+private fun Modifier.default(background: Color) = this.padding(2.dp)
+ .background(background, RoundedCornerShape(5.dp)).padding(start = 3.dp, end = 3.dp)
+ .fillMaxWidth()
+
@Composable
-fun RowItem(modifier: Modifier = Modifier, text: String, background: Color = Color.Yellow) {
+fun RowScope.RowItem(text: String, fixedSize: Boolean = true) {
+ val modifier = if (fixedSize) Modifier.width(80.dp) else Modifier.weight(1f)
Box(
modifier.padding(5.dp).shadow(10.dp)
- .background(background, shape = RoundedCornerShape(5.dp))
- .padding(start = 30.dp, end = 30.dp, top = 5.dp, bottom = 5.dp)
+ .background(Color.White, shape = RoundedCornerShape(5.dp))
+ .padding(top = 5.dp, bottom = 5.dp)
) {
- Text(text, Modifier.align(Alignment.Center))
+ Text(text, Modifier.align(Alignment.Center), color = androidDark)
}
}
+
+internal val androidGreen = Color(0xff3ddb85)
+internal val androidDark = Color(0xff083042)
diff --git a/compose/benchmark-utils/benchmark/src/androidTest/AndroidManifest.xml b/compose/benchmark-utils/benchmark/src/androidTest/AndroidManifest.xml
index b4b3fae..79f2534 100644
--- a/compose/benchmark-utils/benchmark/src/androidTest/AndroidManifest.xml
+++ b/compose/benchmark-utils/benchmark/src/androidTest/AndroidManifest.xml
@@ -15,17 +15,9 @@
~ limitations under the License.
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:tools="http://schemas.android.com/tools"
package="androidx.compose.benchmarkutils.benchmark">
-
- <!--
- ~ Important: disable debuggable for accurate performance results
- -->
- <application
- android:debuggable="false"
- tools:replace="android:debuggable">
- <!-- enable profileableByShell for non-intrusive profiling tools -->
- <!--suppress AndroidElementNotAllowed -->
+ <application>
+ <!-- enable profiling by shell for non-intrusive profiling tools -->
<profileable android:shell="true"/>
</application>
</manifest>
diff --git a/compose/benchmark-utils/src/androidTest/AndroidManifest.xml b/compose/benchmark-utils/src/androidTest/AndroidManifest.xml
index 6aca4a1..ce8f343 100644
--- a/compose/benchmark-utils/src/androidTest/AndroidManifest.xml
+++ b/compose/benchmark-utils/src/androidTest/AndroidManifest.xml
@@ -14,5 +14,4 @@
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
- package="androidx.compose.benchmarkutils"/>
+<manifest package="androidx.compose.benchmarkutils"/>
diff --git a/compose/compiler/buildSrc b/compose/compiler/buildSrc
new file mode 120000
index 0000000..da68aba
--- /dev/null
+++ b/compose/compiler/buildSrc
@@ -0,0 +1 @@
+../../buildSrc
\ No newline at end of file
diff --git a/compose/compiler/compiler-hosted/src/main/java/androidx/compose/compiler/plugins/kotlin/VersionChecker.kt b/compose/compiler/compiler-hosted/src/main/java/androidx/compose/compiler/plugins/kotlin/VersionChecker.kt
index 99e32a1..a7af029 100644
--- a/compose/compiler/compiler-hosted/src/main/java/androidx/compose/compiler/plugins/kotlin/VersionChecker.kt
+++ b/compose/compiler/compiler-hosted/src/main/java/androidx/compose/compiler/plugins/kotlin/VersionChecker.kt
@@ -52,19 +52,20 @@
3302 to "1.0.2",
4000 to "1.1.0-alpha01",
4100 to "1.1.0-alpha02",
+ 4200 to "1.1.0-alpha03",
)
/**
* The minimum version int that this compiler is guaranteed to be compatible with. Typically
* this will match the version int that is in ComposeVersion.kt in the runtime.
*/
- private val minimumRuntimeVersionInt: Int = 4100
+ private const val minimumRuntimeVersionInt: Int = 3300
/**
* The maven version string of this compiler. This string should be updated before/after every
* release.
*/
- val compilerVersion: String = "1.1.0-alpha02"
+ const val compilerVersion: String = "1.1.0-alpha03"
private val minimumRuntimeVersion: String
get() = versionTable[minimumRuntimeVersionInt] ?: "unknown"
}
diff --git a/compose/compiler/compiler/integration-tests/build.gradle b/compose/compiler/compiler/integration-tests/build.gradle
new file mode 100644
index 0000000..17ba4c8
--- /dev/null
+++ b/compose/compiler/compiler/integration-tests/build.gradle
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * 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.
+ */
+
+import androidx.build.SdkResourceGenerator
+
+plugins {
+ id("kotlin")
+ id("AndroidXPlugin")
+}
+
+dependencies {
+ implementation(libs.kotlinStdlib)
+ testImplementation(libs.junit)
+ testImplementation(gradleTestKit())
+ testImplementation(project(":internal-testutils-gradle-plugin"))
+}
+
+SdkResourceGenerator.generateForHostTest(project)
+
+tasks.findByPath("test").dependsOn(
+ tasks.findByPath(":compose:compiler:compiler:publish"),
+ tasks.findByPath(":compose:runtime:runtime:publish")
+)
\ No newline at end of file
diff --git a/compose/compiler/compiler/integration-tests/src/test/kotlin/androidx/compose/compiler/test/CompilerPluginRuntimeVersionCheckTest.kt b/compose/compiler/compiler/integration-tests/src/test/kotlin/androidx/compose/compiler/test/CompilerPluginRuntimeVersionCheckTest.kt
new file mode 100644
index 0000000..f48a3a0
--- /dev/null
+++ b/compose/compiler/compiler/integration-tests/src/test/kotlin/androidx/compose/compiler/test/CompilerPluginRuntimeVersionCheckTest.kt
@@ -0,0 +1,232 @@
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * 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.
+ */
+
+package androidx.compose.compiler.test
+
+import androidx.testutils.gradle.ProjectSetupRule
+import org.gradle.testkit.runner.GradleRunner
+import org.gradle.testkit.runner.TaskOutcome
+import org.junit.Assert.assertEquals
+import org.junit.Assert.assertTrue
+import org.junit.Before
+import org.junit.Rule
+import org.junit.Test
+import org.junit.runner.RunWith
+import org.junit.runners.JUnit4
+import java.io.File
+import javax.xml.parsers.DocumentBuilderFactory
+import javax.xml.xpath.XPathConstants
+import javax.xml.xpath.XPathFactory
+
+@RunWith(JUnit4::class)
+class CompilerPluginRuntimeVersionCheckTest {
+ companion object {
+ private const val MAIN_DIR = "app/src/main"
+ private const val SOURCE_DIR = "$MAIN_DIR/java/androidx/compose/compiler/test"
+ }
+
+ @get:Rule
+ val projectSetup = ProjectSetupRule()
+
+ private lateinit var gradleRunner: GradleRunner
+
+ private lateinit var projectRoot: File
+
+ private val compilerPluginVersion by lazy {
+ val metadataFile = File(projectSetup.props.localSupportRepo).resolve(
+ "androidx/compose/compiler/compiler/maven-metadata.xml"
+ )
+ check(metadataFile.exists()) {
+ "Cannot find compose metadata file in ${metadataFile.absolutePath}"
+ }
+ check(metadataFile.isFile) {
+ "Metadata file should be a file but it is not."
+ }
+ val xmlDoc = DocumentBuilderFactory.newInstance().newDocumentBuilder()
+ .parse(metadataFile)
+ val latestVersionNode = XPathFactory.newInstance().newXPath()
+ .compile("/metadata/versioning/latest").evaluate(
+ xmlDoc, XPathConstants.STRING
+ )
+ check(latestVersionNode is String) {
+ """Unexpected node for latest version:
+ $latestVersionNode / ${latestVersionNode::class.java}
+ """.trimIndent()
+ }
+ latestVersionNode
+ }
+
+ @Before
+ fun setup() {
+ projectRoot = projectSetup.rootDir
+ gradleRunner = GradleRunner.create()
+ .withProjectDir(projectRoot)
+ .withArguments("clean", "compileDebugKotlin")
+ setupProjectBuildGradle()
+ setupSettingsGradle()
+ setupAndroidManifest()
+ addSource()
+ }
+
+ @Test
+ fun usingNoRuntime() {
+ setupAppBuildGradle("") // Not adding any Compose runtime to classpath
+ val result = gradleRunner.buildAndFail()
+ assertEquals(TaskOutcome.FAILED, result.task(":app:compileDebugKotlin")!!.outcome)
+ assertTrue(
+ result.output.contains(
+ "The Compose Compiler requires the Compose Runtime to be on the class " +
+ "path, but none could be found."
+ )
+ )
+ }
+
+ @Test
+ fun usingLatestUnsupportedRuntime() {
+ setupAppBuildGradle("""implementation("androidx.compose.runtime:runtime:1.0.0-rc02")""")
+ val result = gradleRunner.buildAndFail()
+ assertEquals(TaskOutcome.FAILED, result.task(":app:compileDebugKotlin")!!.outcome)
+ assertTrue(
+ result.output.contains(
+ "You are using an outdated version of Compose Runtime that is not " +
+ "compatible with the version of the Compose Compiler plugin you have installed"
+ )
+ )
+ }
+
+ @Test
+ fun usingLastStableRuntime() {
+ setupAppBuildGradle("""implementation("androidx.compose.runtime:runtime:1.0.0")""")
+ val result = gradleRunner.build()
+ assertEquals(TaskOutcome.SUCCESS, result.task(":app:compileDebugKotlin")!!.outcome)
+ }
+
+ @Test
+ fun usingLatestRuntime() {
+ setupAppBuildGradle("""implementation("androidx.compose.runtime:runtime:+")""")
+ val result = gradleRunner.build()
+ assertEquals(TaskOutcome.SUCCESS, result.task(":app:compileDebugKotlin")!!.outcome)
+ }
+
+ private fun setupProjectBuildGradle() {
+ val kotlinGradlePlugin =
+ "org.jetbrains.kotlin:kotlin-gradle-plugin:${projectSetup.props.kotlinVersion}"
+ val repositoriesBlock = buildString {
+ appendLine("repositories {")
+ appendLine("maven { url \"${projectSetup.props.localSupportRepo}\" }")
+ projectSetup.allRepositoryPaths.forEach {
+ appendLine(
+ """
+ maven {
+ url "$it"
+ }
+ """.trimIndent()
+ )
+ }
+ appendLine("}")
+ }
+ addFileWithContent(
+ "build.gradle",
+ """
+ buildscript {
+ $repositoriesBlock
+ dependencies {
+ classpath "${projectSetup.props.agpDependency}"
+ classpath "$kotlinGradlePlugin"
+ }
+ }
+
+ allprojects {
+ $repositoriesBlock
+ }
+
+ task clean(type: Delete) {
+ delete rootProject.buildDir
+ }
+ """.trimIndent()
+ )
+ }
+
+ private fun setupAppBuildGradle(dependenciesBlock: String) {
+ addFileWithContent(
+ "app/build.gradle",
+ """
+ apply plugin: "com.android.application"
+ apply plugin: "kotlin-android"
+
+ android {
+ compileSdkVersion ${projectSetup.props.compileSdkVersion}
+ buildToolsVersion "${projectSetup.props.buildToolsVersion}"
+ defaultConfig {
+ minSdkVersion 21
+ }
+ signingConfigs {
+ debug {
+ storeFile file("${projectSetup.props.debugKeystore}")
+ }
+ }
+ buildFeatures {
+ compose true
+ }
+ composeOptions {
+ kotlinCompilerExtensionVersion "$compilerPluginVersion"
+ }
+ }
+
+ dependencies {
+ $dependenciesBlock
+ }
+ """.trimIndent()
+ )
+ }
+
+ private fun setupSettingsGradle() {
+ addFileWithContent(
+ "settings.gradle",
+ """
+ include ':app'
+ """.trimIndent()
+ )
+ }
+
+ private fun setupAndroidManifest() {
+ addFileWithContent(
+ "$MAIN_DIR/AndroidManifest.xml",
+ """
+ <manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="androidx.compose.compiler.test">
+ </manifest>
+ """.trimIndent()
+ )
+ }
+
+ private fun addSource() {
+ // Need at least one kotlin file so KotlinCompile task runs
+ addFileWithContent(
+ "$SOURCE_DIR/Test.kt",
+ """
+ package androidx.compose.compiler.test
+ const val number = 5
+ """.trimIndent()
+ )
+ }
+
+ private fun addFileWithContent(relativePath: String, content: String) {
+ val file = File(projectRoot, relativePath)
+ file.parentFile.mkdirs()
+ file.writeText(content)
+ }
+}
\ No newline at end of file
diff --git a/compose/desktop/desktop/samples/src/jvmMain/kotlin/androidx/compose/desktop/examples/popupexample/AppContent.jvm.kt b/compose/desktop/desktop/samples/src/jvmMain/kotlin/androidx/compose/desktop/examples/popupexample/AppContent.jvm.kt
index 01700ee..ca92879 100644
--- a/compose/desktop/desktop/samples/src/jvmMain/kotlin/androidx/compose/desktop/examples/popupexample/AppContent.jvm.kt
+++ b/compose/desktop/desktop/samples/src/jvmMain/kotlin/androidx/compose/desktop/examples/popupexample/AppContent.jvm.kt
@@ -38,7 +38,7 @@
import androidx.compose.material.Button
import androidx.compose.material.ButtonDefaults
import androidx.compose.material.Checkbox
-import androidx.compose.material.ContextMenu
+import androidx.compose.material.CursorDropdownMenu
import androidx.compose.material.DropdownMenu
import androidx.compose.material.DropdownMenuItem
import androidx.compose.material.ExperimentalMaterialApi
@@ -51,6 +51,7 @@
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.ui.Alignment
+import androidx.compose.ui.ExperimentalComposeUiApi
import androidx.compose.ui.Modifier
import androidx.compose.ui.awt.SwingPanel
import androidx.compose.ui.graphics.Color
@@ -386,6 +387,7 @@
}
}
+@OptIn(ExperimentalComposeUiApi::class)
@Composable
fun ContextMenu() {
val items = listOf("Item A", "Item B", "Item C", "Item D", "Item E", "Item F")
@@ -393,9 +395,9 @@
val selectedIndex = remember { mutableStateOf(0) }
BoxWithTooltip(
delay = 100,
- tooltipPlacement = TooltipPlacement(
- anchor = TooltipPlacement.Anchor.Component,
- alignment = Alignment.TopCenter
+ tooltipPlacement = TooltipPlacement.ComponentRect(
+ anchor = Alignment.TopStart,
+ alignment = Alignment.TopEnd
),
tooltip = {
Surface(
@@ -417,7 +419,7 @@
.padding(start = 4.dp, end = 4.dp)
.clickable(onClick = { showMenu.value = true })
)
- ContextMenu(
+ CursorDropdownMenu(
expanded = showMenu.value,
onDismissRequest = { showMenu.value = false }
) {
diff --git a/compose/desktop/desktop/samples/src/jvmMain/kotlin/androidx/compose/desktop/examples/windowapi/Examples.jvm.kt b/compose/desktop/desktop/samples/src/jvmMain/kotlin/androidx/compose/desktop/examples/windowapi/Examples.jvm.kt
index cdd62d0..d7624ae 100644
--- a/compose/desktop/desktop/samples/src/jvmMain/kotlin/androidx/compose/desktop/examples/windowapi/Examples.jvm.kt
+++ b/compose/desktop/desktop/samples/src/jvmMain/kotlin/androidx/compose/desktop/examples/windowapi/Examples.jvm.kt
@@ -49,7 +49,6 @@
import androidx.compose.ui.window.Dialog
import androidx.compose.ui.window.MenuBar
import androidx.compose.ui.window.Notification
-import androidx.compose.ui.window.OwnerWindowScope
import androidx.compose.ui.window.Tray
import androidx.compose.ui.window.TrayState
import androidx.compose.ui.window.Window
@@ -311,7 +310,7 @@
}
@Composable
-private fun OwnerWindowScope.FileDialog(
+private fun FileDialog(
onDismissRequest: (result: String?) -> Unit
) = AwtWindow(
create = {
diff --git a/compose/foundation/foundation-layout/benchmark/src/androidTest/AndroidManifest.xml b/compose/foundation/foundation-layout/benchmark/src/androidTest/AndroidManifest.xml
index 9dc14a7..30a2807 100644
--- a/compose/foundation/foundation-layout/benchmark/src/androidTest/AndroidManifest.xml
+++ b/compose/foundation/foundation-layout/benchmark/src/androidTest/AndroidManifest.xml
@@ -15,17 +15,9 @@
~ limitations under the License.
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:tools="http://schemas.android.com/tools"
package="androidx.compose.foundation.layout.benchmark">
-
- <!--
- ~ Important: disable debuggable for accurate performance results
- -->
- <application
- android:debuggable="false"
- tools:replace="android:debuggable">
- <!-- enable profileableByShell for non-intrusive profiling tools -->
- <!--suppress AndroidElementNotAllowed -->
+ <application>
+ <!-- enable profiling by shell for non-intrusive profiling tools -->
<profileable android:shell="true"/>
</application>
</manifest>
diff --git a/compose/foundation/foundation-layout/build.gradle b/compose/foundation/foundation-layout/build.gradle
index b89661be..884356a 100644
--- a/compose/foundation/foundation-layout/build.gradle
+++ b/compose/foundation/foundation-layout/build.gradle
@@ -36,7 +36,7 @@
*/
api("androidx.annotation:annotation:1.1.0")
- api("androidx.compose.ui:ui:1.0.0")
+ api(project(":compose:ui:ui"))
api(project(":compose:ui:ui-unit"))
implementation(project(":compose:runtime:runtime"))
diff --git a/compose/foundation/foundation-layout/src/androidAndroidTest/AndroidManifest.xml b/compose/foundation/foundation-layout/src/androidAndroidTest/AndroidManifest.xml
index b78e5152..26b9764 100644
--- a/compose/foundation/foundation-layout/src/androidAndroidTest/AndroidManifest.xml
+++ b/compose/foundation/foundation-layout/src/androidAndroidTest/AndroidManifest.xml
@@ -16,17 +16,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="androidx.compose.foundation.layout">
-
- <!--
- ~ Important: disable debuggable for accurate performance results
- ~ requestLegacyExternalStorage to enable legacy JSON reporting when targeting Q
- -->
- <application
- android:requestLegacyExternalStorage="true"
- android:debuggable="false"
- tools:ignore="HardcodedDebugMode"
- tools:replace="android:debuggable">
-
+ <application>
<activity
android:name="androidx.compose.foundation.layout.TestActivity"
android:theme="@android:style/Theme.Material.NoActionBar.Fullscreen" />
diff --git a/compose/foundation/foundation-layout/src/commonMain/kotlin/androidx/compose/foundation/layout/Column.kt b/compose/foundation/foundation-layout/src/commonMain/kotlin/androidx/compose/foundation/layout/Column.kt
index 2cfff87..804a948 100644
--- a/compose/foundation/foundation-layout/src/commonMain/kotlin/androidx/compose/foundation/layout/Column.kt
+++ b/compose/foundation/foundation-layout/src/commonMain/kotlin/androidx/compose/foundation/layout/Column.kt
@@ -36,15 +36,17 @@
* The [Column] layout is able to assign children heights according to their weights provided
* using the [ColumnScope.weight] modifier. If a child is not provided a weight, it will be
* asked for its preferred height before the sizes of the children with weights are calculated
- * proportionally to their weight based on the remaining available space.
+ * proportionally to their weight based on the remaining available space. Note that if the
+ * [Column] is vertically scrollable or part of a vertically scrollable container, any provided
+ * weights will be disregarded as the remaining available space will be infinite.
*
* When none of its children have weights, a [Column] will be as small as possible to fit its
* children one on top of the other. In order to change the height of the [Column], use the
- * [Modifier.requiredHeight] modifiers; e.g. to make it fill the available height [Modifier.fillMaxHeight]
- * can be used. If at least one child of a [Column] has a [weight][ColumnScope.weight],
- * the [Column] will fill the available height, so there is no need for [Modifier.fillMaxHeight].
- * However, if [Column]'s size should be limited, the [Modifier.requiredHeight] or [Modifier.requiredSize] layout
- * modifiers should be applied.
+ * [Modifier.height] modifiers; e.g. to make it fill the available height [Modifier.fillMaxHeight]
+ * can be used. If at least one child of a [Column] has a [weight][ColumnScope.weight], the [Column]
+ * will fill the available height, so there is no need for [Modifier.fillMaxHeight]. However, if
+ * [Column]'s size should be limited, the [Modifier.height] or [Modifier.size] layout modifiers
+ * should be applied.
*
* When the size of the [Column] is larger than the sum of its children sizes, a
* [verticalArrangement] can be specified to define the positioning of the children inside the
diff --git a/compose/foundation/foundation-layout/src/commonMain/kotlin/androidx/compose/foundation/layout/Row.kt b/compose/foundation/foundation-layout/src/commonMain/kotlin/androidx/compose/foundation/layout/Row.kt
index 57e0bd4..4ea1cfd 100644
--- a/compose/foundation/foundation-layout/src/commonMain/kotlin/androidx/compose/foundation/layout/Row.kt
+++ b/compose/foundation/foundation-layout/src/commonMain/kotlin/androidx/compose/foundation/layout/Row.kt
@@ -37,14 +37,16 @@
* The [Row] layout is able to assign children widths according to their weights provided
* using the [RowScope.weight] modifier. If a child is not provided a weight, it will be
* asked for its preferred width before the sizes of the children with weights are calculated
- * proportionally to their weight based on the remaining available space.
+ * proportionally to their weight based on the remaining available space. Note that if the
+ * [Row] is horizontally scrollable or part of a horizontally scrollable container, any provided
+ * weights will be disregarded as the remaining available space will be infinite.
*
* When none of its children have weights, a [Row] will be as small as possible to fit its
* children one next to the other. In order to change the width of the [Row], use the
- * [Modifier.requiredWidth] modifiers; e.g. to make it fill the available width [Modifier.fillMaxWidth]
+ * [Modifier.width] modifiers; e.g. to make it fill the available width [Modifier.fillMaxWidth]
* can be used. If at least one child of a [Row] has a [weight][RowScope.weight], the [Row] will
* fill the available width, so there is no need for [Modifier.fillMaxWidth]. However, if [Row]'s
- * size should be limited, the [Modifier.requiredWidth] or [Modifier.requiredSize] layout modifiers should be
+ * size should be limited, the [Modifier.width] or [Modifier.size] layout modifiers should be
* applied.
*
* When the size of the [Row] is larger than the sum of its children sizes, a
diff --git a/compose/foundation/foundation/benchmark/src/androidTest/AndroidManifest.xml b/compose/foundation/foundation/benchmark/src/androidTest/AndroidManifest.xml
index 58b2405..e0847ac 100644
--- a/compose/foundation/foundation/benchmark/src/androidTest/AndroidManifest.xml
+++ b/compose/foundation/foundation/benchmark/src/androidTest/AndroidManifest.xml
@@ -15,17 +15,9 @@
~ limitations under the License.
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:tools="http://schemas.android.com/tools"
package="androidx.compose.foundation.benchmark">
-
- <!--
- ~ Important: disable debuggable for accurate performance results
- -->
- <application
- android:debuggable="false"
- tools:replace="android:debuggable">
- <!-- enable profileableByShell for non-intrusive profiling tools -->
- <!--suppress AndroidElementNotAllowed -->
+ <application>
+ <!-- enable profiling by shell for non-intrusive profiling tools -->
<profileable android:shell="true"/>
</application>
</manifest>
diff --git a/compose/foundation/foundation/build.gradle b/compose/foundation/foundation/build.gradle
index 24aac8b..14ab039 100644
--- a/compose/foundation/foundation/build.gradle
+++ b/compose/foundation/foundation/build.gradle
@@ -58,7 +58,7 @@
androidTestImplementation(project(":compose:test-utils"))
androidTestImplementation(project(":compose:ui:ui-test-font"))
- androidTestImplementation(project(":test:screenshot:test-screenshot"))
+ androidTestImplementation(project(":test:screenshot:screenshot"))
androidTestImplementation(libs.testUiautomator)
androidTestImplementation(libs.testRules)
androidTestImplementation(libs.testRunner)
@@ -119,7 +119,7 @@
androidAndroidTest.dependencies {
implementation(project(":compose:test-utils"))
implementation(project(":compose:ui:ui-test-font"))
- implementation(project(":test:screenshot:test-screenshot"))
+ implementation(project(":test:screenshot:screenshot"))
implementation(project(":activity:activity-compose"))
implementation(libs.testUiautomator)
diff --git a/compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/ImageTest.kt b/compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/ImageTest.kt
index 35f18d6..4527c60 100644
--- a/compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/ImageTest.kt
+++ b/compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/ImageTest.kt
@@ -554,7 +554,7 @@
} else {
painterId.value = R.drawable.ic_vector_square_asset_test
}
- },
+ }.size(50.dp),
contentScale = ContentScale.FillBounds
)
}
diff --git a/compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/ToggleableTest.kt b/compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/ToggleableTest.kt
index fcf15e4..b637719 100644
--- a/compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/ToggleableTest.kt
+++ b/compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/ToggleableTest.kt
@@ -21,6 +21,8 @@
import androidx.compose.foundation.interaction.PressInteraction
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
+import androidx.compose.foundation.layout.fillMaxSize
+import androidx.compose.foundation.layout.requiredSize
import androidx.compose.foundation.selection.toggleable
import androidx.compose.foundation.selection.triStateToggleable
import androidx.compose.foundation.text.BasicText
@@ -30,6 +32,7 @@
import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier
+import androidx.compose.ui.geometry.Offset
import androidx.compose.ui.platform.InspectableValue
import androidx.compose.ui.platform.isDebugInspectorInfoEnabled
import androidx.compose.ui.platform.testTag
@@ -38,11 +41,14 @@
import androidx.compose.ui.test.SemanticsMatcher
import androidx.compose.ui.test.assert
import androidx.compose.ui.test.assertHasClickAction
+import androidx.compose.ui.test.assertHeightIsEqualTo
import androidx.compose.ui.test.assertIsEnabled
import androidx.compose.ui.test.assertIsNotEnabled
import androidx.compose.ui.test.assertIsOff
import androidx.compose.ui.test.assertIsOn
+import androidx.compose.ui.test.assertWidthIsEqualTo
import androidx.compose.ui.test.center
+import androidx.compose.ui.test.click
import androidx.compose.ui.test.down
import androidx.compose.ui.test.isToggleable
import androidx.compose.ui.test.junit4.createComposeRule
@@ -51,6 +57,7 @@
import androidx.compose.ui.test.performClick
import androidx.compose.ui.test.performGesture
import androidx.compose.ui.test.up
+import androidx.compose.ui.unit.dp
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.MediumTest
import com.google.common.truth.Truth.assertThat
@@ -457,4 +464,64 @@
)
}
}
+
+ @Test
+ fun toggleable_minTouchTarget_clickOutsideLayoutBounds() {
+ var toggled by mutableStateOf(false)
+ val interactionSource = MutableInteractionSource()
+ testToggleableMinTouchTarget {
+ Modifier.toggleable(
+ value = toggled,
+ interactionSource = interactionSource,
+ indication = null,
+ onValueChange = { toggled = true }
+ )
+ }
+ }
+
+ @Test
+ fun triStateToggleable_minTouchTarget_clickOutsideLayoutBounds() {
+ var toggleableState by mutableStateOf(ToggleableState.Off)
+ val interactionSource = MutableInteractionSource()
+ testToggleableMinTouchTarget {
+ Modifier.triStateToggleable(
+ state = toggleableState,
+ interactionSource = interactionSource,
+ indication = null,
+ onClick = { toggleableState = ToggleableState.On }
+ )
+ }
+ }
+
+ @Test
+ fun triStateToggleable_noInteractionSource_minTouchTarget_clickOutsideLayoutBounds() {
+ var toggleableState by mutableStateOf(ToggleableState.Off)
+ testToggleableMinTouchTarget {
+ Modifier.triStateToggleable(
+ state = toggleableState,
+ onClick = { toggleableState = ToggleableState.On }
+ )
+ }
+ }
+
+ private fun testToggleableMinTouchTarget(modifier: () -> Modifier): Unit = with(rule.density) {
+ val tag = "toggleable"
+ rule.setContent {
+ Box(Modifier.fillMaxSize()) {
+ Box(modifier().requiredSize(2.dp).testTag(tag)) {
+ BasicText("ToggleableText")
+ }
+ }
+ }
+
+ val pokePoint = 48.dp.roundToPx().toFloat() - 1f
+
+ rule.onNodeWithTag(tag)
+ .assertIsOff()
+ .assertWidthIsEqualTo(48.dp)
+ .assertHeightIsEqualTo(48.dp)
+ .performGesture {
+ click(position = Offset(pokePoint, pokePoint))
+ }.assertIsOn()
+ }
}
diff --git a/compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/textfield/TextFieldCursorTest.kt b/compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/textfield/TextFieldCursorTest.kt
index 2aa5172..7720e53d 100644
--- a/compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/textfield/TextFieldCursorTest.kt
+++ b/compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/textfield/TextFieldCursorTest.kt
@@ -22,8 +22,11 @@
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.text.BasicTextField
+import androidx.compose.runtime.Composable
+import androidx.compose.runtime.CompositionLocalProvider
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
+import androidx.compose.testutils.TestViewConfiguration
import androidx.compose.testutils.assertPixelColor
import androidx.compose.testutils.assertPixels
import androidx.compose.testutils.assertShape
@@ -35,8 +38,10 @@
import androidx.compose.ui.graphics.RectangleShape
import androidx.compose.ui.graphics.SolidColor
import androidx.compose.ui.graphics.toPixelMap
+import androidx.compose.ui.platform.LocalViewConfiguration
import androidx.compose.ui.test.captureToImage
import androidx.compose.ui.test.hasSetTextAction
+import androidx.compose.ui.test.junit4.ComposeContentTestRule
import androidx.compose.ui.test.junit4.createComposeRule
import androidx.compose.ui.test.performClick
import androidx.compose.ui.test.performTextReplacement
@@ -45,6 +50,7 @@
import androidx.compose.ui.text.input.TextFieldValue
import androidx.compose.ui.unit.Density
import androidx.compose.ui.unit.Dp
+import androidx.compose.ui.unit.DpSize
import androidx.compose.ui.unit.IntSize
import androidx.compose.ui.unit.dp
import androidx.test.filters.LargeTest
@@ -66,7 +72,7 @@
val width = 10.dp
val height = 20.dp
var isFocused = false
- rule.setContent {
+ rule.setContentWithoutMinimumTouchTarget {
BasicTextField(
value = "",
onValueChange = {},
@@ -97,7 +103,7 @@
val width = 10.dp
val height = 20.dp
var isFocused = false
- rule.setContent {
+ rule.setContentWithoutMinimumTouchTarget {
BasicTextField(
value = "",
onValueChange = {},
@@ -136,7 +142,7 @@
val width = 10.dp
val height = 20.dp
var isFocused = false
- rule.setContent {
+ rule.setContentWithoutMinimumTouchTarget {
// The padding helps if the test is run accidentally in landscape. Landscape makes
// the cursor to be next to the navigation bar which affects the red color to be a bit
// different - possibly anti-aliasing.
@@ -184,7 +190,7 @@
val width = 10.dp
val height = 20.dp
var isFocused = false
- rule.setContent {
+ rule.setContentWithoutMinimumTouchTarget {
// The padding helps if the test is run accidentally in landscape. Landscape makes
// the cursor to be next to the navigation bar which affects the red color to be a bit
// different - possibly anti-aliasing.
@@ -235,7 +241,7 @@
val width = 10.dp
val height = 20.dp
var isFocused = false
- rule.setContent {
+ rule.setContentWithoutMinimumTouchTarget {
// The padding helps if the test is run accidentally in landscape. Landscape makes
// the cursor to be next to the navigation bar which affects the red color to be a bit
// different - possibly anti-aliasing.
@@ -284,7 +290,7 @@
val height = 20.dp
var isFocused = false
val textValue = mutableStateOf(TextFieldValue("test", selection = TextRange(2)))
- rule.setContent {
+ rule.setContentWithoutMinimumTouchTarget {
// The padding helps if the test is run accidentally in landscape. Landscape makes
// the cursor to be next to the navigation bar which affects the red color to be a bit
// different - possibly anti-aliasing.
@@ -350,3 +356,22 @@
}
}
}
+
+fun ComposeContentTestRule.setContentWithoutMinimumTouchTarget(
+ composable: @Composable () -> Unit
+) {
+ setContent {
+ val oldViewConfiguration = LocalViewConfiguration.current
+ val viewConfiguration = TestViewConfiguration(
+ longPressTimeoutMillis = oldViewConfiguration.longPressTimeoutMillis,
+ doubleTapTimeoutMillis = oldViewConfiguration.doubleTapTimeoutMillis,
+ doubleTapMinTimeMillis = oldViewConfiguration.doubleTapMinTimeMillis,
+ touchSlop = oldViewConfiguration.touchSlop,
+ minimumTouchTargetSize = DpSize.Zero
+ )
+ CompositionLocalProvider(
+ LocalViewConfiguration provides viewConfiguration,
+ content = composable
+ )
+ }
+}
\ No newline at end of file
diff --git a/compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/textfield/TextFieldOnValueChangeTextFieldValueTest.kt b/compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/textfield/TextFieldOnValueChangeTextFieldValueTest.kt
index a332e2f..a913fc5 100644
--- a/compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/textfield/TextFieldOnValueChangeTextFieldValueTest.kt
+++ b/compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/textfield/TextFieldOnValueChangeTextFieldValueTest.kt
@@ -69,7 +69,7 @@
val platformTextInputService = mock<PlatformTextInputService>()
val textInputService = TextInputService(platformTextInputService)
- rule.setContent {
+ rule.setContentWithoutMinimumTouchTarget {
CompositionLocalProvider(
LocalTextInputService provides textInputService
) {
diff --git a/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/Clickable.kt b/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/Clickable.kt
index d553329..834b038 100644
--- a/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/Clickable.kt
+++ b/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/Clickable.kt
@@ -412,7 +412,10 @@
this.role = role
}
// b/156468846: add long click semantics and double click if needed
- onClick(action = { onClick(); true }, label = onClickLabel)
+ onClick(
+ action = { onClick(); true },
+ label = onClickLabel
+ )
if (onLongClick != null) {
onLongClick(action = { onLongClick(); true }, label = onLongClickLabel)
}
diff --git a/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/gestures/DragGestureDetector.kt b/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/gestures/DragGestureDetector.kt
index a577d7c2..e0614a5 100644
--- a/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/gestures/DragGestureDetector.kt
+++ b/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/gestures/DragGestureDetector.kt
@@ -764,7 +764,9 @@
}
if (
- event.changes.fastAny { it.consumed.downChange || it.isOutOfBounds(size) }
+ event.changes.fastAny {
+ it.consumed.downChange || it.isOutOfBounds(size, extendedTouchPadding)
+ }
) {
finished = true // Canceled
}
diff --git a/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/gestures/TapGestureDetector.kt b/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/gestures/TapGestureDetector.kt
index eef7db7..c961d0e 100644
--- a/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/gestures/TapGestureDetector.kt
+++ b/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/gestures/TapGestureDetector.kt
@@ -16,15 +16,9 @@
package androidx.compose.foundation.gestures
-import androidx.compose.foundation.gestures.TapGestureEvent.AllUp
-import androidx.compose.foundation.gestures.TapGestureEvent.Cancel
-import androidx.compose.foundation.gestures.TapGestureEvent.Down
-import androidx.compose.foundation.gestures.TapGestureEvent.Up
-import androidx.compose.runtime.MutableState
-import androidx.compose.runtime.State
-import androidx.compose.runtime.mutableStateOf
import androidx.compose.ui.geometry.Offset
import androidx.compose.ui.input.pointer.AwaitPointerEventScope
+import androidx.compose.ui.input.pointer.PointerEventTimeoutCancellationException
import androidx.compose.ui.input.pointer.PointerEvent
import androidx.compose.ui.input.pointer.PointerEventPass
import androidx.compose.ui.input.pointer.PointerInputChange
@@ -41,17 +35,9 @@
import androidx.compose.ui.util.fastAll
import androidx.compose.ui.util.fastAny
import androidx.compose.ui.util.fastForEach
-import kotlinx.coroutines.CoroutineScope
-import kotlinx.coroutines.TimeoutCancellationException
-import kotlinx.coroutines.channels.Channel
-import kotlinx.coroutines.channels.ReceiveChannel
-import kotlinx.coroutines.channels.SendChannel
import kotlinx.coroutines.coroutineScope
-import kotlinx.coroutines.isActive
import kotlinx.coroutines.launch
import kotlinx.coroutines.sync.Mutex
-import kotlinx.coroutines.withTimeout
-import kotlinx.coroutines.withTimeoutOrNull
/**
* Receiver scope for [detectTapGestures]'s `onPress` lambda. This offers
@@ -100,53 +86,46 @@
onPress: suspend PressGestureScope.(Offset) -> Unit = NoPressGesture,
onTap: ((Offset) -> Unit)? = null
) = coroutineScope {
- // special signal to indicate to the sending side that it needs to consume(!) all the events
- // until all the pointers will be up
- val consumeAllUntilUpSignal = mutableStateOf(false)
// special signal to indicate to the sending side that it shouldn't intercept and consume
// cancel/up events as we're only require down events
- val consumeOnlyDownsSignal = mutableStateOf(false)
- val channel = Channel<TapGestureEvent>(capacity = Channel.UNLIMITED)
val pressScope = PressGestureScopeImpl(this@detectTapGestures)
- launch {
- while (isActive) {
- consumeAllUntilUpSignal.value = false
- val down = awaitChannelDown(consumeOnlyDownsSignal, channel)
+ forEachGesture {
+ awaitPointerEventScope {
+ val down = awaitFirstDown()
+ down.consumeDownChange()
pressScope.reset()
if (onPress !== NoPressGesture) launch {
pressScope.onPress(down.position)
}
- val longPressTimeout = onLongPress?.let { viewConfiguration.longPressTimeoutMillis }
- var upOrCancel: TapGestureEvent? = null
+ val longPressTimeout = onLongPress?.let {
+ viewConfiguration.longPressTimeoutMillis
+ } ?: (Long.MAX_VALUE / 2)
+ var upOrCancel: PointerInputChange? = null
try {
// wait for first tap up or long press
- upOrCancel = withNullableTimeout(this, longPressTimeout) {
- awaitChannelUpOrCancel(channel)
+ upOrCancel = withTimeout(longPressTimeout) {
+ waitForUpOrCancellation()
}
- if (upOrCancel is Cancel) {
+ if (upOrCancel == null) {
pressScope.cancel() // tap-up was canceled
} else {
+ upOrCancel.consumeDownChange()
pressScope.release()
}
- } catch (_: TimeoutCancellationException) {
+ } catch (_: PointerEventTimeoutCancellationException) {
onLongPress?.invoke(down.position)
- awaitChannelAllUp(consumeAllUntilUpSignal, channel)
+ consumeUntilUp()
pressScope.release()
}
- if (upOrCancel != null && upOrCancel is Up) {
+ if (upOrCancel != null) {
// tap was successful.
if (onDoubleTap == null) {
onTap?.invoke(upOrCancel.position) // no need to check for double-tap.
} else {
// check for second tap
- val secondDown = awaitChannelSecondDown(
- channel,
- consumeOnlyDownsSignal,
- viewConfiguration,
- upOrCancel
- )
+ val secondDown = awaitSecondDown(upOrCancel)
if (secondDown == null) {
onTap?.invoke(upOrCancel.position) // no valid second tap started
@@ -159,9 +138,10 @@
try {
// Might have a long second press as the second tap
- withNullableTimeout(this, longPressTimeout) {
- val secondUp = awaitChannelUpOrCancel(channel)
- if (secondUp is Up) {
+ withTimeout(longPressTimeout) {
+ val secondUp = waitForUpOrCancellation()
+ if (secondUp != null) {
+ secondUp.consumeDownChange()
pressScope.release()
onDoubleTap(secondUp.position)
} else {
@@ -169,14 +149,14 @@
onTap?.invoke(upOrCancel.position)
}
}
- } catch (e: TimeoutCancellationException) {
+ } catch (e: PointerEventTimeoutCancellationException) {
// The first tap was valid, but the second tap is a long press.
// notify for the first tap
onTap?.invoke(upOrCancel.position)
// notify for the long press
onLongPress?.invoke(secondDown.position)
- awaitChannelAllUp(consumeAllUntilUpSignal, channel)
+ consumeUntilUp()
pressScope.release()
}
}
@@ -184,169 +164,34 @@
}
}
}
- forEachGesture {
- awaitPointerEventScope {
- translatePointerEventsToChannel(
- this@coroutineScope,
- channel,
- consumeOnlyDownsSignal,
- consumeAllUntilUpSignal
- )
- }
- }
-}
-
-private suspend fun <T> withNullableTimeout(
- scope: CoroutineScope,
- timeout: Long?,
- block: suspend CoroutineScope.() -> T
-): T {
- return if (timeout != null) {
- withTimeout(timeout, block)
- } else {
- with(scope) {
- block()
- }
- }
}
/**
- * Await down from the channel and return it when it happens
+ * Consumes all pointer events until nothing is pressed and then returns. This method assumes
+ * that something is currently pressed.
*/
-private suspend fun awaitChannelDown(
- onlyDownsSignal: MutableState<Boolean>,
- channel: ReceiveChannel<TapGestureEvent>
-): Down {
- onlyDownsSignal.value = true
- var event = channel.receive()
- while (event !is Down) {
- event = channel.receive()
- }
- onlyDownsSignal.value = false
- return event
-}
-
-/**
- * Reads input for second tap down event from the [channel]. If the second tap is within
- * [ViewConfiguration.doubleTapMinTimeMillis] of [firstUp] uptime, the event is discarded. If the
- * second down is not detected within [ViewConfiguration.doubleTapTimeoutMillis] of [firstUp],
- * `null` is returned. Otherwise, the down event is returned.
- */
-private suspend fun awaitChannelSecondDown(
- channel: ReceiveChannel<TapGestureEvent>,
- onlyDownsSignal: MutableState<Boolean>,
- viewConfiguration: ViewConfiguration,
- firstUp: Up
-): Down? {
- return withTimeoutOrNull(viewConfiguration.doubleTapTimeoutMillis) {
- val minUptime = firstUp.uptimeMillis + viewConfiguration.doubleTapMinTimeMillis
- var change: Down
- // The second tap doesn't count if it happens before DoubleTapMinTime of the first tap
- do {
- change = awaitChannelDown(onlyDownsSignal, channel)
- } while (change.uptimeMillis < minUptime)
- change
- }
-}
-
-/**
- * Special case to wait for all ups after long press has been fired. This sets a state value to
- * true, indicating to the channel producer to consume all events until it will send an [AllUp]
- * event. When all up happens and producer itself flips the value back to false, this method
- * returns.
- */
-private suspend fun awaitChannelAllUp(
- consumeAllSignal: MutableState<Boolean>,
- channel: ReceiveChannel<TapGestureEvent>
-) {
- consumeAllSignal.value = true
- var event = channel.receive()
- while (event != AllUp) {
- event = channel.receive()
- }
-}
-
-/**
- * Await up or cancel event from the channel and return either [Up] or [Cancel]
- */
-private suspend fun awaitChannelUpOrCancel(
- channel: ReceiveChannel<TapGestureEvent>
-): TapGestureEvent {
- var event = channel.receive()
- while (event !is Up && event !is Cancel) {
- event = channel.receive()
- }
- return event
-}
-
-private sealed class TapGestureEvent {
- class Down(val position: Offset, val uptimeMillis: Long) : TapGestureEvent()
- class Up(val position: Offset, val uptimeMillis: Long) : TapGestureEvent()
-
- // special case, the notification sent when we were consuming all previous events before all
- // the pointers are up. AllUp means that we can restart the cycle after long press fired
- object AllUp : TapGestureEvent()
- object Cancel : TapGestureEvent()
-}
-
-/**
- * Method to await domain specific [TapGestureEvent] from the [AwaitPointerEventScope] and send
- * them to the specified [channel].
- *
- * Note: [consumeAllUntilUp] is a switch for a special case which happens when the long press has
- * been fired, after which we want to block all the events until all fingers are up. This methods
- * stars to consume all the events when [consumeAllUntilUp] is `true` and when all pointers are
- * up it flips the [consumeAllUntilUp] itself, so it can suspend on the [AwaitPointerEventScope
- * .awaitPointerEvent] again.
- */
-private suspend fun AwaitPointerEventScope.translatePointerEventsToChannel(
- scope: CoroutineScope,
- channel: SendChannel<TapGestureEvent>,
- detectDownsOnly: State<Boolean>,
- consumeAllUntilUp: MutableState<Boolean>
-) {
- while (scope.isActive) {
- // operate normally, scan all downs / ups / cancels and push them to the channel
+private suspend fun AwaitPointerEventScope.consumeUntilUp() {
+ do {
val event = awaitPointerEvent()
- if (consumeAllUntilUp.value) {
- event.changes.fastForEach { it.consumeAllChanges() }
- // check the signal if we just need to consume everything on the initial pass for
- // cases when the long press has fired and we block everything before all pointers
- // are up
- if (!allPointersUp()) {
- do {
- val initialEvent = awaitPointerEvent(PointerEventPass.Initial)
- initialEvent.changes.fastForEach { it.consumeAllChanges() }
- } while (initialEvent.changes.fastAny { it.pressed })
- // wait for the main pass of the initial event we already have eaten above
- awaitPointerEvent()
- }
- channel.trySend(AllUp)
- consumeAllUntilUp.value = false
- } else if (event.changes.fastAll { it.changedToDown() }) {
- val change = event.changes[0]
- change.consumeDownChange()
- channel.trySend(Down(change.position, change.uptimeMillis))
- } else if (!detectDownsOnly.value) {
- if (event.changes.fastAll { it.changedToUp() }) {
- // All pointers are up
- val change = event.changes[0]
- change.consumeDownChange()
- channel.trySend(Up(change.position, change.uptimeMillis))
- } else if (
- event.changes.fastAny { it.consumed.downChange || it.isOutOfBounds(size) }
- ) {
- channel.trySend(Cancel)
- } else {
- // Check for cancel by position consumption. We can look on the Final pass of the
- // existing pointer event because it comes after the Main pass we checked above.
- val consumeCheck = awaitPointerEvent(PointerEventPass.Final)
- if (consumeCheck.changes.fastAny { it.positionChangeConsumed() }) {
- channel.trySend(Cancel)
- }
- }
- }
- }
+ event.changes.fastForEach { it.consumeAllChanges() }
+ } while (event.changes.fastAny { it.pressed })
+}
+
+/**
+ * Waits for [ViewConfiguration.doubleTapTimeoutMillis] for a second press event. If a
+ * second press event is received before the time out, it is returned or `null` is returned
+ * if no second press is received.
+ */
+private suspend fun AwaitPointerEventScope.awaitSecondDown(
+ firstUp: PointerInputChange
+): PointerInputChange? = withTimeoutOrNull(viewConfiguration.doubleTapTimeoutMillis) {
+ val minUptime = firstUp.uptimeMillis + viewConfiguration.doubleTapMinTimeMillis
+ var change: PointerInputChange
+ // The second tap doesn't count if it happens before DoubleTapMinTime of the first tap
+ do {
+ change = awaitFirstDown()
+ } while (change.uptimeMillis < minUptime)
+ change
}
/**
@@ -415,7 +260,10 @@
return event.changes[0]
}
- if (event.changes.fastAny { it.consumed.downChange || it.isOutOfBounds(size) }) {
+ if (event.changes.fastAny {
+ it.consumed.downChange || it.isOutOfBounds(size, extendedTouchPadding)
+ }
+ ) {
return null // Canceled
}
diff --git a/compose/foundation/foundation/src/desktopMain/kotlin/androidx/compose/foundation/BoxWithTooltip.desktop.kt b/compose/foundation/foundation/src/desktopMain/kotlin/androidx/compose/foundation/BoxWithTooltip.desktop.kt
index fa8b6a9..7cb4557 100644
--- a/compose/foundation/foundation/src/desktopMain/kotlin/androidx/compose/foundation/BoxWithTooltip.desktop.kt
+++ b/compose/foundation/foundation/src/desktopMain/kotlin/androidx/compose/foundation/BoxWithTooltip.desktop.kt
@@ -19,12 +19,12 @@
import androidx.compose.foundation.layout.Box
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
-import androidx.compose.runtime.Immutable
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment
+import androidx.compose.ui.ExperimentalComposeUiApi
import androidx.compose.ui.geometry.Offset
import androidx.compose.ui.input.pointer.changedToDown
import androidx.compose.ui.input.pointer.PointerEventPass
@@ -34,14 +34,15 @@
import androidx.compose.ui.layout.onGloballyPositioned
import androidx.compose.ui.layout.positionInWindow
import androidx.compose.ui.Modifier
-import androidx.compose.ui.platform.LocalDensity
+import androidx.compose.ui.unit.Dp
+import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.DpOffset
import androidx.compose.ui.unit.IntOffset
import androidx.compose.ui.unit.IntRect
-import androidx.compose.ui.unit.IntSize
-import androidx.compose.ui.unit.LayoutDirection
import androidx.compose.ui.window.Popup
import androidx.compose.ui.window.PopupPositionProvider
+import androidx.compose.ui.window.rememberCursorPositionProvider
+import androidx.compose.ui.window.rememberComponentRectPositionProvider
import kotlinx.coroutines.delay
import kotlinx.coroutines.Job
import kotlinx.coroutines.launch
@@ -54,10 +55,10 @@
* @param contentAlignment The default alignment inside the Box.
* @param propagateMinConstraints Whether the incoming min constraints should be passed to content.
* @param delay Delay in milliseconds.
- * @param offset Tooltip offset.
- * @param tooltipPlacement Alignment of the tooltip relative to the [content].
+ * @param tooltipPlacement Defines position of the tooltip.
* @param content Composable content that the current tooltip is set to.
*/
+@OptIn(ExperimentalComposeUiApi::class)
@Composable
fun BoxWithTooltip(
tooltip: @Composable () -> Unit,
@@ -65,10 +66,12 @@
contentAlignment: Alignment = Alignment.TopStart,
propagateMinConstraints: Boolean = false,
delay: Int = 500,
- tooltipPlacement: TooltipPlacement = DefaultTooltipPlacement,
+ @ExperimentalComposeUiApi
+ tooltipPlacement: TooltipPlacement = TooltipPlacement.CursorPoint(
+ offset = DpOffset(0.dp, 16.dp)
+ ),
content: @Composable () -> Unit
) {
- val density = LocalDensity.current
val mousePosition = remember { mutableStateOf(IntOffset.Zero) }
var parentBounds by remember { mutableStateOf(IntRect.Zero) }
var isVisible by remember { mutableStateOf(false) }
@@ -88,12 +91,6 @@
isVisible = false
}
- val popupPositionProvider = TooltipPositionProvider(
- point = mousePosition.value,
- placement = tooltipPlacement,
- density = density.density
- )
-
Box(
modifier = modifier
.onGloballyPositioned { coordinates ->
@@ -131,8 +128,9 @@
) {
content()
if (isVisible) {
+ @OptIn(ExperimentalComposeUiApi::class)
Popup(
- popupPositionProvider = popupPositionProvider,
+ popupPositionProvider = tooltipPlacement.positionProvider(),
onDismissRequest = { isVisible = false }
) {
tooltip()
@@ -153,68 +151,58 @@
}
}
-@Immutable
-internal data class TooltipPositionProvider(
- val point: IntOffset,
- val placement: TooltipPlacement,
- val density: Float
-) : PopupPositionProvider {
- override fun calculatePosition(
- anchorBounds: IntRect,
- windowSize: IntSize,
- layoutDirection: LayoutDirection,
- popupContentSize: IntSize
- ): IntOffset {
- val anchorRect = when (placement.anchor) {
- TooltipPlacement.Anchor.Pointer -> IntRect(
- point,
- IntSize(
- (DefaultCursorSize * density).toInt(),
- (DefaultCursorSize * density).toInt()
- )
- )
- TooltipPlacement.Anchor.Component -> anchorBounds
- }
- val area = IntSize(
- popupContentSize.width * 2 + anchorRect.width,
- popupContentSize.height * 2 + anchorRect.height
+/**
+ * An interface for providing a [PopupPositionProvider] for the tooltip.
+ */
+@ExperimentalComposeUiApi
+interface TooltipPlacement {
+ /**
+ * Returns [PopupPositionProvider] implementation.
+ */
+ @Composable
+ fun positionProvider(): PopupPositionProvider
+
+ /**
+ * [TooltipPlacement] implementation for providing a [PopupPositionProvider] that calculates
+ * the position of the popup relative to the current mouse cursor position.
+ *
+ * @param offset [DpOffset] to be added to the position of the popup.
+ * @param alignment The alignment of the popup relative to the current cursor position.
+ * @param windowMargin Defines the area within the window that limits the placement of the popup.
+ */
+ @ExperimentalComposeUiApi
+ class CursorPoint(
+ private val offset: DpOffset = DpOffset.Zero,
+ private val alignment: Alignment = Alignment.BottomEnd,
+ private val windowMargin: Dp = 4.dp
+ ) : TooltipPlacement {
+ @Composable
+ override fun positionProvider() = rememberCursorPositionProvider(
+ offset,
+ alignment,
+ windowMargin
)
- val anchor = IntOffset(
- anchorRect.left - popupContentSize.width,
- anchorRect.top - popupContentSize.height,
+ }
+
+ /**
+ * [TooltipPlacement] implementation for providing a [PopupPositionProvider] that calculates
+ * the position of the popup relative to the current component bounds.
+ *
+ * @param anchor The anchor point relative to the current component bounds.
+ * @param alignment The alignment of the popup relative to the [anchor] point.
+ * @param offset [DpOffset] to be added to the position of the popup.
+ */
+ @ExperimentalComposeUiApi
+ class ComponentRect(
+ private val anchor: Alignment = Alignment.BottomCenter,
+ private val alignment: Alignment = Alignment.BottomCenter,
+ private val offset: DpOffset = DpOffset.Zero
+ ) : TooltipPlacement {
+ @Composable
+ override fun positionProvider() = rememberComponentRectPositionProvider(
+ anchor,
+ alignment,
+ offset
)
- val position = placement.alignment.align(popupContentSize, area, layoutDirection)
- var x = anchor.x + position.x + (placement.offset.x.value * density).toInt()
- var y = anchor.y + position.y + (placement.offset.y.value * density).toInt()
- if (placement.anchor == TooltipPlacement.Anchor.Pointer) {
- if (x + popupContentSize.width > windowSize.width - TooltipMargin * density) {
- x -= popupContentSize.width
- }
- if (y + popupContentSize.height > windowSize.height - TooltipMargin * density) {
- y -= popupContentSize.height + anchorRect.height
- }
- if (x < TooltipMargin * density) {
- x = (TooltipMargin * density).toInt()
- }
- if (y < TooltipMargin * density) {
- y = (TooltipMargin * density).toInt()
- }
- }
- return IntOffset(x, y)
}
}
-
-class TooltipPlacement(
- val anchor: Anchor,
- val alignment: Alignment,
- val offset: DpOffset = DpOffset.Zero
-) {
- enum class Anchor { Pointer, Component }
-}
-
-private val DefaultTooltipPlacement = TooltipPlacement(
- anchor = TooltipPlacement.Anchor.Pointer,
- alignment = Alignment.BottomStart
-)
-private val DefaultCursorSize = 16
-private val TooltipMargin = 4
\ No newline at end of file
diff --git a/compose/foundation/foundation/src/desktopMain/kotlin/androidx/compose/foundation/Clickable.desktop.kt b/compose/foundation/foundation/src/desktopMain/kotlin/androidx/compose/foundation/Clickable.desktop.kt
index acba3a7..32eb24d 100644
--- a/compose/foundation/foundation/src/desktopMain/kotlin/androidx/compose/foundation/Clickable.desktop.kt
+++ b/compose/foundation/foundation/src/desktopMain/kotlin/androidx/compose/foundation/Clickable.desktop.kt
@@ -142,7 +142,7 @@
val event = awaitPointerEvent()
val change = event.changes[0]
if (change.changedToUp()) {
- return if (change.isOutOfBounds(size)) {
+ return if (change.isOutOfBounds(size, extendedTouchPadding)) {
null
} else {
event
diff --git a/compose/foundation/foundation/src/test/kotlin/androidx/compose/foundation/gestures/TapGestureDetectorTest.kt b/compose/foundation/foundation/src/test/kotlin/androidx/compose/foundation/gestures/TapGestureDetectorTest.kt
index 058acdd..844d010 100644
--- a/compose/foundation/foundation/src/test/kotlin/androidx/compose/foundation/gestures/TapGestureDetectorTest.kt
+++ b/compose/foundation/foundation/src/test/kotlin/androidx/compose/foundation/gestures/TapGestureDetectorTest.kt
@@ -608,4 +608,4 @@
secondDown.up(500)
assertTrue(released)
}
-}
\ No newline at end of file
+}
diff --git a/compose/integration-tests/demos/common/build.gradle b/compose/integration-tests/demos/common/build.gradle
index 393d58f..dc41c9f 100644
--- a/compose/integration-tests/demos/common/build.gradle
+++ b/compose/integration-tests/demos/common/build.gradle
@@ -26,5 +26,6 @@
implementation(libs.kotlinStdlib)
api("androidx.activity:activity:1.2.0")
+ api("androidx.fragment:fragment-ktx:1.3.6")
implementation(projectOrArtifact(":compose:runtime:runtime"))
}
diff --git a/compose/integration-tests/demos/common/src/main/java/androidx/compose/integration/demos/common/Demo.kt b/compose/integration-tests/demos/common/src/main/java/androidx/compose/integration/demos/common/Demo.kt
index 15ee91f..2c1d864 100644
--- a/compose/integration-tests/demos/common/src/main/java/androidx/compose/integration/demos/common/Demo.kt
+++ b/compose/integration-tests/demos/common/src/main/java/androidx/compose/integration/demos/common/Demo.kt
@@ -19,6 +19,7 @@
import android.app.Activity
import androidx.activity.ComponentActivity
import androidx.compose.runtime.Composable
+import androidx.fragment.app.Fragment
import kotlin.reflect.KClass
/**
@@ -39,6 +40,8 @@
*/
class ActivityDemo<T : ComponentActivity>(title: String, val activityClass: KClass<T>) : Demo(title)
+class FragmentDemo<T : Fragment>(title: String, val fragmentClass: KClass<T>) : Demo(title)
+
/**
* Demo that displays [Composable] [content] when selected.
*/
diff --git a/compose/integration-tests/demos/src/main/java/androidx/compose/integration/demos/DemoActivity.kt b/compose/integration-tests/demos/src/main/java/androidx/compose/integration/demos/DemoActivity.kt
index 8f59333..b438f13 100644
--- a/compose/integration-tests/demos/src/main/java/androidx/compose/integration/demos/DemoActivity.kt
+++ b/compose/integration-tests/demos/src/main/java/androidx/compose/integration/demos/DemoActivity.kt
@@ -23,7 +23,6 @@
import android.os.Bundle
import android.view.View
import android.view.Window
-import androidx.activity.ComponentActivity
import androidx.activity.OnBackPressedCallback
import androidx.activity.OnBackPressedDispatcher
import androidx.compose.integration.demos.common.ActivityDemo
@@ -48,6 +47,7 @@
import androidx.compose.ui.platform.ComposeView
import androidx.compose.ui.platform.LocalFocusManager
import androidx.compose.ui.platform.LocalView
+import androidx.fragment.app.FragmentActivity
import androidx.lifecycle.Lifecycle
import androidx.lifecycle.LifecycleEventObserver
import androidx.preference.PreferenceManager
@@ -55,7 +55,7 @@
/**
* Main [Activity] containing all Compose related demos.
*/
-class DemoActivity : ComponentActivity() {
+class DemoActivity : FragmentActivity() {
lateinit var hostView: View
lateinit var focusManager: FocusManager
diff --git a/compose/integration-tests/demos/src/main/java/androidx/compose/integration/demos/DemoApp.kt b/compose/integration-tests/demos/src/main/java/androidx/compose/integration/demos/DemoApp.kt
index fdfbc3e..a878e475 100644
--- a/compose/integration-tests/demos/src/main/java/androidx/compose/integration/demos/DemoApp.kt
+++ b/compose/integration-tests/demos/src/main/java/androidx/compose/integration/demos/DemoApp.kt
@@ -20,8 +20,8 @@
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxSize
-import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.height
+import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.wrapContentSize
import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.verticalScroll
@@ -29,6 +29,7 @@
import androidx.compose.integration.demos.common.ComposableDemo
import androidx.compose.integration.demos.common.Demo
import androidx.compose.integration.demos.common.DemoCategory
+import androidx.compose.integration.demos.common.FragmentDemo
import androidx.compose.integration.demos.common.allLaunchableDemos
import androidx.compose.material.ExperimentalMaterialApi
import androidx.compose.material.Icon
@@ -45,6 +46,7 @@
import androidx.compose.material.icons.filled.Search
import androidx.compose.material.icons.filled.Settings
import androidx.compose.runtime.Composable
+import androidx.compose.runtime.DisposableEffect
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.saveable.rememberSaveable
@@ -55,6 +57,9 @@
import androidx.compose.ui.platform.testTag
import androidx.compose.ui.unit.LayoutDirection
import androidx.compose.ui.unit.dp
+import androidx.compose.ui.viewinterop.AndroidView
+import androidx.fragment.app.FragmentActivity
+import androidx.fragment.app.FragmentContainerView
@Composable
fun DemoApp(
@@ -122,6 +127,30 @@
}
is ComposableDemo -> demo.content()
is DemoCategory -> DisplayDemoCategory(demo, onNavigate)
+ is FragmentDemo<*> -> {
+ lateinit var view: FragmentContainerView
+ AndroidView(
+ modifier = Modifier.fillMaxSize(),
+ factory = { context ->
+ view = FragmentContainerView(context).also {
+ it.id = R.id.fragment_container
+ }
+ view
+ }
+ )
+ DisposableEffect(demo) {
+ // TODO: This code could be cleaner using FragmentContainerView.getFragment().
+ // Update this code once it appears in a released artifact.
+ val fm = (view.context as FragmentActivity).supportFragmentManager
+ fm.beginTransaction()
+ .add(R.id.fragment_container, demo.fragmentClass.java, null, null)
+ .commit()
+ onDispose {
+ fm.beginTransaction().remove(fm.findFragmentById(R.id.fragment_container)!!)
+ .commit()
+ }
+ }
+ }
}
}
diff --git a/compose/integration-tests/demos/src/main/res/values/ids.xml b/compose/integration-tests/demos/src/main/res/values/ids.xml
new file mode 100644
index 0000000..285c404
--- /dev/null
+++ b/compose/integration-tests/demos/src/main/res/values/ids.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?><!--
+ Copyright 2021 The Android Open Source Project
+
+ 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.
+ -->
+
+<resources>
+ <item name="fragment_container" type="id" />
+</resources>
\ No newline at end of file
diff --git a/compose/integration-tests/macrobenchmark-target/src/main/AndroidManifest.xml b/compose/integration-tests/macrobenchmark-target/src/main/AndroidManifest.xml
index c796e40..934f94f 100644
--- a/compose/integration-tests/macrobenchmark-target/src/main/AndroidManifest.xml
+++ b/compose/integration-tests/macrobenchmark-target/src/main/AndroidManifest.xml
@@ -26,7 +26,6 @@
tools:ignore="GoogleAppIndexingWarning">
<!-- Profileable to enable macrobenchmark profiling -->
- <!--suppress AndroidElementNotAllowed -->
<profileable android:shell="true"/>
<!--
diff --git a/compose/lint/internal-lint-checks/src/main/java/androidx/compose/lint/ComposeIssueRegistry.kt b/compose/lint/internal-lint-checks/src/main/java/androidx/compose/lint/ComposeIssueRegistry.kt
index cf49d1c..89745e0 100644
--- a/compose/lint/internal-lint-checks/src/main/java/androidx/compose/lint/ComposeIssueRegistry.kt
+++ b/compose/lint/internal-lint-checks/src/main/java/androidx/compose/lint/ComposeIssueRegistry.kt
@@ -26,7 +26,7 @@
class ComposeIssueRegistry : IssueRegistry() {
override val minApi = CURRENT_API
- override val api = 10
+ override val api = 11
override val issues get(): List<Issue> {
return listOf(
ListIteratorDetector.ISSUE,
diff --git a/compose/lint/internal-lint-checks/src/main/java/androidx/compose/lint/ModifierInspectorInfoDetector.kt b/compose/lint/internal-lint-checks/src/main/java/androidx/compose/lint/ModifierInspectorInfoDetector.kt
index dc7f10f..6483d90 100644
--- a/compose/lint/internal-lint-checks/src/main/java/androidx/compose/lint/ModifierInspectorInfoDetector.kt
+++ b/compose/lint/internal-lint-checks/src/main/java/androidx/compose/lint/ModifierInspectorInfoDetector.kt
@@ -38,6 +38,8 @@
import org.jetbrains.kotlin.asJava.classes.KtLightClass
import org.jetbrains.kotlin.asJava.elements.KtLightField
import org.jetbrains.kotlin.asJava.elements.KtLightParameter
+import org.jetbrains.kotlin.name.FqName
+import org.jetbrains.kotlin.psi.KtFile
import org.jetbrains.kotlin.psi.KtParameter
import org.jetbrains.kotlin.psi.stubs.elements.KtStubElementTypes.VALUE_PARAMETER
import org.jetbrains.uast.UBinaryExpression
@@ -66,8 +68,10 @@
import org.jetbrains.uast.visitor.AbstractUastVisitor
private const val ModifierClass = "androidx.compose.ui.Modifier"
+private const val ModifierCompanionClass = "androidx.compose.ui.Modifier.Companion"
private const val ModifierFile = "Modifier.kt"
private const val ComposedModifierFile = "ComposedModifier.kt"
+private const val InspectableValueFile = "InspectableValue.kt"
private const val LambdaFunction = "kotlin.jvm.functions.Function1"
private const val InspectorInfoClass = "androidx.compose.ui.platform.InspectorInfo"
private const val InspectorValueInfoClass = "androidx.compose.ui.platform.InspectorValueInfo"
@@ -76,9 +80,12 @@
private const val ThenMethodName = "then"
private const val ComposedMethodName = "composed"
private const val RememberMethodName = "remember"
+private const val InspectableMethodName = "inspectable"
private const val ComposedMethodPackage = "androidx.compose.ui"
private const val RememberMethodPackage = "androidx.compose.runtime"
private val DemosPackageRegEx = "androidx\\.compose\\..+\\.demos\\..+".toRegex()
+private val UiPackage = FqName("androidx.compose.ui")
+private val PlatformPackage = FqName("androidx.compose.ui.platform")
/**
* Lint [Detector] to ensure that we are creating debug information for the layout inspector on
@@ -145,8 +152,9 @@
private var methodInfo: MethodInfo? = null
override fun visitMethod(node: UMethod) {
- if (node.containingFile?.name == ModifierFile ||
- node.containingFile?.name == ComposedModifierFile ||
+ if (node.isInFile(ModifierFile, UiPackage) ||
+ node.isInFile(ComposedModifierFile, UiPackage) ||
+ node.isInFile(InspectableValueFile, PlatformPackage) ||
firstParameterType(node) != ModifierClass ||
node.returnType?.canonicalText != ModifierClass ||
DemosPackageRegEx.matches(node.containingClass?.qualifiedName ?: "")
@@ -160,6 +168,11 @@
methodInfo = null
}
+ private fun UMethod.isInFile(fileName: String, packageName: FqName): Boolean {
+ val file = containingFile as? KtFile ?: return false
+ return file.name == fileName && file.packageFqName == packageName
+ }
+
private fun firstParameterType(method: UMethod): String? =
(method.parameters.firstOrNull() as? KtLightParameter)?.type?.canonicalText
@@ -194,6 +207,12 @@
isModifierType(node.returnType) &&
methodPackageName(node) == RememberMethodPackage
+ private fun isInspectableModifier(node: UCallExpression): Boolean =
+ node.methodName == InspectableMethodName &&
+ node.receiverType?.canonicalText in listOf(ModifierClass, ModifierCompanionClass) &&
+ node.returnType?.canonicalText == ModifierClass &&
+ methodPackageName(node) == PlatformPackage.asString()
+
// Return true if this is a lambda expression of the type: "InspectorInfo.() -> Unit"
private fun isInspectorInfoLambdaType(type: PsiType?): Boolean {
val referenceType = type as? PsiClassReferenceType ?: return false
@@ -482,13 +501,14 @@
*/
private inner class ModifierVisitor : UnexpectedVisitor({ wrongLambda(it) }) {
override fun visitCallExpression(node: UCallExpression): Boolean {
- val lastArgument = node.valueArguments.lastOrNull()
- if (isInspectorInfoLambdaType(lastArgument?.getExpressionType())) {
- lastArgument!!.accept(debugInspectorVisitor)
+ val info = if (isInspectableModifier(node)) node.valueArguments.firstOrNull()
+ else node.valueArguments.lastOrNull()
+ if (isInspectorInfoLambdaType(info?.getExpressionType())) {
+ info!!.accept(debugInspectorVisitor)
return true
}
if (isRememberFunctionCall(node)) {
- val lambda = lastArgument as? ULambdaExpression
+ val lambda = info as? ULambdaExpression
val body = lambda?.body as? UBlockExpression
val ret = body?.expressions?.firstOrNull() as? UReturnExpression
val definition = ret?.returnExpression ?: return super.visitCallExpression(node)
diff --git a/compose/lint/internal-lint-checks/src/main/java/androidx/compose/lint/UnnecessaryLambdaCreationDetector.kt b/compose/lint/internal-lint-checks/src/main/java/androidx/compose/lint/UnnecessaryLambdaCreationDetector.kt
index d9bcafd..a6fb8a1 100644
--- a/compose/lint/internal-lint-checks/src/main/java/androidx/compose/lint/UnnecessaryLambdaCreationDetector.kt
+++ b/compose/lint/internal-lint-checks/src/main/java/androidx/compose/lint/UnnecessaryLambdaCreationDetector.kt
@@ -34,6 +34,7 @@
import org.jetbrains.uast.kotlin.KotlinUFunctionCallExpression
import org.jetbrains.uast.kotlin.KotlinUImplicitReturnExpression
import org.jetbrains.uast.kotlin.UnknownKotlinExpression
+import org.jetbrains.uast.skipParenthesizedExprDown
import org.jetbrains.uast.toUElement
import org.jetbrains.uast.tryResolve
@@ -84,7 +85,7 @@
if (expressions.size != 1) return
- val expression = when (val expr = expressions.first()) {
+ val expression = when (val expr = expressions.first().skipParenthesizedExprDown()) {
is KotlinUFunctionCallExpression -> expr
is KotlinUImplicitReturnExpression ->
expr.returnExpression as? KotlinUFunctionCallExpression
diff --git a/compose/lint/internal-lint-checks/src/test/java/androidx/compose/lint/ModifierInspectorInfoDetectorTest.kt b/compose/lint/internal-lint-checks/src/test/java/androidx/compose/lint/ModifierInspectorInfoDetectorTest.kt
index 640e020..60a2359 100644
--- a/compose/lint/internal-lint-checks/src/test/java/androidx/compose/lint/ModifierInspectorInfoDetectorTest.kt
+++ b/compose/lint/internal-lint-checks/src/test/java/androidx/compose/lint/ModifierInspectorInfoDetectorTest.kt
@@ -20,6 +20,7 @@
import androidx.compose.lint.test.Stubs
import com.android.tools.lint.checks.infrastructure.LintDetectorTest
+import com.android.tools.lint.checks.infrastructure.TestMode
import com.android.tools.lint.detector.api.Detector
import com.android.tools.lint.detector.api.Issue
import org.junit.Test
@@ -37,6 +38,8 @@
"""
package androidx.compose.ui.platform
+ import androidx.compose.ui.Modifier
+
val NoInspectorInfo: InspectorInfo.() -> Unit = {}
val DebugInspectorInfo = false
@@ -96,6 +99,34 @@
): InspectorInfo.() -> Unit =
if (DebugInspectorInfo) ({ definitions() }) else NoInspectorInfo
+ fun Modifier.inspectable(
+ inspectorInfo: InspectorInfo.() -> Unit = NoInspectorInfo,
+ wrapped: Modifier
+ ): Modifier = this.then(InspectableModifierImpl(inspectorInfo, wrapped))
+
+ /**
+ * Interface for a [Modifier] wrapped for inspector purposes.
+ */
+ interface InspectableModifier {
+ val wrapped: Modifier
+ }
+
+ private class InspectableModifierImpl(
+ inspectorInfo: InspectorInfo.() -> Unit,
+ override val wrapped: Modifier
+ ) : Modifier.Element, InspectableModifier, InspectorValueInfo(inspectorInfo) {
+ override fun <R> foldIn(initial: R, operation: (R, Modifier.Element) -> R): R =
+ wrapped.foldIn(operation(initial, this), operation)
+
+ override fun <R> foldOut(initial: R, operation: (Modifier.Element, R) -> R): R =
+ operation(this, wrapped.foldOut(initial, operation))
+
+ override fun any(predicate: (Modifier.Element) -> Boolean): Boolean =
+ wrapped.any(predicate)
+
+ override fun all(predicate: (Modifier.Element) -> Boolean): Boolean =
+ wrapped.all(predicate)
+ }
"""
).indented()
@@ -149,6 +180,7 @@
"""
).indented()
)
+ .testModes(TestMode.DEFAULT)
.run()
.expectClean()
}
@@ -199,6 +231,7 @@
"""
).indented()
)
+ .testModes(TestMode.DEFAULT)
.run()
.expectClean()
}
@@ -233,6 +266,7 @@
"""
).indented()
)
+ .testModes(TestMode.DEFAULT)
.run()
.expectClean()
}
@@ -277,6 +311,7 @@
"""
).indented()
)
+ .testModes(TestMode.DEFAULT)
.run()
.expectClean()
}
@@ -301,6 +336,7 @@
"""
).indented()
)
+ .testModes(TestMode.DEFAULT)
.run()
.expectClean()
}
@@ -369,6 +405,7 @@
"""
).indented()
)
+ .testModes(TestMode.DEFAULT)
.run()
.expectClean()
}
@@ -419,6 +456,7 @@
"""
).indented()
)
+ .testModes(TestMode.DEFAULT)
.run()
.expectClean()
}
@@ -460,6 +498,7 @@
"""
).indented()
)
+ .testModes(TestMode.DEFAULT)
.run()
.expectClean()
}
@@ -519,6 +558,7 @@
"""
).indented()
)
+ .testModes(TestMode.DEFAULT)
.run()
.expectClean()
}
@@ -560,6 +600,7 @@
"""
).indented()
)
+ .testModes(TestMode.DEFAULT)
.run()
.expectClean()
}
@@ -598,6 +639,7 @@
"""
).indented()
)
+ .testModes(TestMode.DEFAULT)
.run()
.expectClean()
}
@@ -620,6 +662,7 @@
"""
).indented()
)
+ .testModes(TestMode.DEFAULT)
.run()
.expectClean()
}
@@ -648,6 +691,7 @@
"""
).indented()
)
+ .testModes(TestMode.DEFAULT)
.run()
.expectClean()
}
@@ -676,6 +720,7 @@
"""
).indented()
)
+ .testModes(TestMode.DEFAULT)
.run()
.expect(
"""
@@ -711,6 +756,7 @@
"""
).indented()
)
+ .testModes(TestMode.DEFAULT)
.run()
.expect(
"""
@@ -751,6 +797,7 @@
"""
).indented()
)
+ .testModes(TestMode.DEFAULT)
.run()
.expect(
"""
@@ -792,6 +839,7 @@
"""
).indented()
)
+ .testModes(TestMode.DEFAULT)
.run()
.expect(
"""
@@ -833,6 +881,7 @@
"""
).indented()
)
+ .testModes(TestMode.DEFAULT)
.run()
.expect(
"""
@@ -874,6 +923,7 @@
"""
).indented()
)
+ .testModes(TestMode.DEFAULT)
.run()
.expect(
"""
@@ -916,6 +966,7 @@
"""
).indented()
)
+ .testModes(TestMode.DEFAULT)
.run()
.expect(
"""
@@ -957,6 +1008,7 @@
"""
).indented()
)
+ .testModes(TestMode.DEFAULT)
.run()
.expect(
"""
@@ -999,6 +1051,7 @@
"""
).indented()
)
+ .testModes(TestMode.DEFAULT)
.run()
.expect(
"""
@@ -1039,6 +1092,7 @@
"""
).indented()
)
+ .testModes(TestMode.DEFAULT)
.run()
.expect(
"""
@@ -1086,6 +1140,7 @@
"""
).indented()
)
+ .testModes(TestMode.DEFAULT)
.run()
.expect(
"""
@@ -1132,6 +1187,7 @@
"""
).indented()
)
+ .testModes(TestMode.DEFAULT)
.run()
.expect(
"""
@@ -1198,6 +1254,7 @@
"""
).indented()
)
+ .testModes(TestMode.DEFAULT)
.run()
.expect(
"""
@@ -1214,4 +1271,130 @@
"""
)
}
+
+ @Test
+ fun testInspectable() {
+ lint().files(
+ Stubs.Modifier,
+ composedStub,
+ inspectableInfoStub,
+ kotlin(
+ """
+ package mypackage
+
+ import androidx.compose.ui.Modifier
+ import androidx.compose.ui.platform.inspectable
+ import androidx.compose.ui.platform.InspectorInfo
+ import androidx.compose.ui.platform.InspectorValueInfo
+ import androidx.compose.ui.platform.debugInspectorInfo
+
+ fun Modifier.background(color: Int): Modifier = this.then(
+ Background(color, inspectorInfo = debugInspectorInfo {
+ name = "background"
+ value = color
+ })
+ )
+
+ fun Modifier.border(width: Int, color: Int): Modifier = this.then(
+ BorderModifier(width, color, inspectorInfo = debugInspectorInfo {
+ name = "border"
+ properties["width"] = width
+ properties["color"] = color
+ })
+ )
+
+ fun Modifier.frame(color: Int) = this.then(
+ Modifier.inspectable(
+ inspectorInfo = debugInspectorInfo {
+ name = "frame"
+ value = color
+ },
+ wrapped = Modifier.background(color).border(width = 5, color = color)
+ )
+ )
+
+ private class BackgroundModifier(
+ color: Int,
+ inspectorInfo: InspectorInfo.() -> Unit
+ ): Modifier
+
+ private class BorderModifier(
+ width: Int,
+ color: Int,
+ inspectorInfo: InspectorInfo.() -> Unit
+ ): Modifier
+
+ """
+ ).indented()
+ )
+ .testModes(TestMode.DEFAULT)
+ .run()
+ .expectClean()
+ }
+
+ @Test
+ fun testInspectableWithMissingParameter() {
+ lint().files(
+ Stubs.Modifier,
+ composedStub,
+ inspectableInfoStub,
+ kotlin(
+ """
+ package mypackage
+
+ import androidx.compose.ui.Modifier
+ import androidx.compose.ui.platform.inspectable
+ import androidx.compose.ui.platform.InspectorInfo
+ import androidx.compose.ui.platform.InspectorValueInfo
+ import androidx.compose.ui.platform.debugInspectorInfo
+
+ fun Modifier.background(color: Int): Modifier = this.then(
+ Background(color, inspectorInfo = debugInspectorInfo {
+ name = "background"
+ value = color
+ })
+ )
+
+ fun Modifier.border(width: Int, color: Int): Modifier = this.then(
+ BorderModifier(width, color, inspectorInfo = debugInspectorInfo {
+ name = "border"
+ properties["width"] = width
+ properties["color"] = color
+ })
+ )
+
+ fun Modifier.frame(color: Int) = this.then(
+ Modifier.inspectable(
+ inspectorInfo = debugInspectorInfo {
+ name = "frame"
+ },
+ wrapped = Modifier.background(color).border(width = 5, color = color)
+ )
+ )
+
+ private class BackgroundModifier(
+ color: Int,
+ inspectorInfo: InspectorInfo.() -> Unit
+ ): Modifier
+
+ private class BorderModifier(
+ width: Int,
+ color: Int,
+ inspectorInfo: InspectorInfo.() -> Unit
+ ): Modifier
+
+ """
+ ).indented()
+ )
+ .testModes(TestMode.DEFAULT)
+ .run()
+ .expect(
+ """
+ src/mypackage/BackgroundModifier.kt:26: Error: These lambda arguments are missing in the InspectorInfo: color [ModifierInspectorInfo]
+ inspectorInfo = debugInspectorInfo {
+ ^
+ 1 errors, 0 warnings
+ """
+ )
+ }
}
diff --git a/compose/lint/internal-lint-checks/src/test/java/androidx/compose/lint/UnnecessaryLambdaCreationDetectorTest.kt b/compose/lint/internal-lint-checks/src/test/java/androidx/compose/lint/UnnecessaryLambdaCreationDetectorTest.kt
index cdafef1..c96667d 100644
--- a/compose/lint/internal-lint-checks/src/test/java/androidx/compose/lint/UnnecessaryLambdaCreationDetectorTest.kt
+++ b/compose/lint/internal-lint-checks/src/test/java/androidx/compose/lint/UnnecessaryLambdaCreationDetectorTest.kt
@@ -25,6 +25,7 @@
import org.junit.runner.RunWith
import com.android.tools.lint.checks.infrastructure.LintDetectorTest
import com.android.tools.lint.checks.infrastructure.TestFile
+import com.android.tools.lint.checks.infrastructure.TestMode
import com.android.tools.lint.detector.api.Detector
import com.android.tools.lint.detector.api.Issue
import org.intellij.lang.annotations.Language
@@ -108,6 +109,7 @@
private fun check(@Language("kotlin") code: String): TestLintResult {
return lint()
.files(kotlin(code.trimIndent()), stub, Stubs.Composable)
+ .skipTestModes(TestMode.TYPE_ALIAS)
.run()
}
diff --git a/compose/material/material-icons-extended/build.gradle b/compose/material/material-icons-extended/build.gradle
index ddd18d7..c8fe1a7 100644
--- a/compose/material/material-icons-extended/build.gradle
+++ b/compose/material/material-icons-extended/build.gradle
@@ -53,7 +53,7 @@
androidTestImplementation(project(":compose:foundation:foundation"))
androidTestImplementation(project(":compose:foundation:foundation-layout"))
androidTestImplementation(project(":compose:ui:ui"))
- androidTestImplementation(project(":test:screenshot:test-screenshot"))
+ androidTestImplementation(project(":test:screenshot:screenshot"))
androidTestImplementation(project(":compose:ui:ui-test-junit4"))
androidTestImplementation(project(":compose:test-utils"))
androidTestImplementation(project(":activity:activity-compose"))
@@ -72,7 +72,7 @@
implementation(project(":compose:foundation:foundation"))
implementation(project(":compose:foundation:foundation-layout"))
implementation(project(":compose:ui:ui"))
- implementation(project(":test:screenshot:test-screenshot"))
+ implementation(project(":test:screenshot:screenshot"))
implementation(project(":compose:ui:ui-test-junit4"))
implementation(project(":activity:activity-compose"))
implementation("androidx.appcompat:appcompat:1.3.0")
diff --git a/compose/material/material-lint/src/main/java/androidx/compose/material/lint/MaterialIssueRegistry.kt b/compose/material/material-lint/src/main/java/androidx/compose/material/lint/MaterialIssueRegistry.kt
index 4d711a1..51fb44a 100644
--- a/compose/material/material-lint/src/main/java/androidx/compose/material/lint/MaterialIssueRegistry.kt
+++ b/compose/material/material-lint/src/main/java/androidx/compose/material/lint/MaterialIssueRegistry.kt
@@ -25,7 +25,7 @@
*/
class MaterialIssueRegistry : IssueRegistry() {
// Tests are run with this version. We ensure that with ApiLintVersionsTest
- override val api = 10
+ override val api = 11
override val minApi = CURRENT_API
override val issues get() = listOf(
ColorsDetector.ConflictingOnColor
diff --git a/compose/material/material/benchmark/src/androidTest/AndroidManifest.xml b/compose/material/material/benchmark/src/androidTest/AndroidManifest.xml
index f19b2d8..e473cdc 100644
--- a/compose/material/material/benchmark/src/androidTest/AndroidManifest.xml
+++ b/compose/material/material/benchmark/src/androidTest/AndroidManifest.xml
@@ -15,17 +15,9 @@
~ limitations under the License.
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:tools="http://schemas.android.com/tools"
package="androidx.compose.material.benchmark">
-
- <!--
- ~ Important: disable debuggable for accurate performance results
- -->
- <application
- android:debuggable="false"
- tools:replace="android:debuggable">
- <!-- enable profileableByShell for non-intrusive profiling tools -->
- <!--suppress AndroidElementNotAllowed -->
+ <application>
+ <!-- enable profiling by shell for non-intrusive profiling tools -->
<profileable android:shell="true"/>
</application>
</manifest>
diff --git a/compose/material/material/build.gradle b/compose/material/material/build.gradle
index 7550bb0..f55cc5e 100644
--- a/compose/material/material/build.gradle
+++ b/compose/material/material/build.gradle
@@ -35,16 +35,16 @@
* corresponding block below
*/
api("androidx.compose.animation:animation-core:1.0.0")
- api("androidx.compose.foundation:foundation:1.0.0")
+ api(project(":compose:foundation:foundation"))
api(project(":compose:material:material-icons-core"))
api(project(":compose:material:material-ripple"))
api(project(":compose:runtime:runtime"))
- api("androidx.compose.ui:ui:1.0.0")
+ api(project(":compose:ui:ui"))
api("androidx.compose.ui:ui-text:1.0.0")
implementation(libs.kotlinStdlibCommon)
implementation("androidx.compose.animation:animation:1.0.0")
- implementation("androidx.compose.foundation:foundation-layout:1.0.0")
+ implementation(project(":compose:foundation:foundation-layout"))
implementation("androidx.compose.ui:ui-util:1.0.0")
testImplementation(libs.testRules)
@@ -54,7 +54,7 @@
androidTestImplementation(project(":compose:material:material:material-samples"))
androidTestImplementation(project(":compose:test-utils"))
- androidTestImplementation(project(":test:screenshot:test-screenshot"))
+ androidTestImplementation(project(":test:screenshot:screenshot"))
androidTestImplementation(libs.testRules)
androidTestImplementation(libs.testRunner)
androidTestImplementation(libs.junit)
@@ -110,7 +110,7 @@
androidAndroidTest.dependencies {
implementation(project(":compose:material:material:material-samples"))
implementation(project(":compose:test-utils"))
- implementation(project(":test:screenshot:test-screenshot"))
+ implementation(project(":test:screenshot:screenshot"))
implementation(libs.testRules)
implementation(libs.testRunner)
diff --git a/compose/material/material/samples/src/main/java/androidx/compose/material/samples/SelectionControlsSamples.kt b/compose/material/material/samples/src/main/java/androidx/compose/material/samples/SelectionControlsSamples.kt
index 6e0dab8..af94e92 100644
--- a/compose/material/material/samples/src/main/java/androidx/compose/material/samples/SelectionControlsSamples.kt
+++ b/compose/material/material/samples/src/main/java/androidx/compose/material/samples/SelectionControlsSamples.kt
@@ -19,9 +19,11 @@
import androidx.annotation.Sampled
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
+import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.height
+import androidx.compose.foundation.layout.size
import androidx.compose.foundation.selection.selectable
import androidx.compose.foundation.selection.selectableGroup
import androidx.compose.material.Checkbox
@@ -70,8 +72,10 @@
checkedColor = MaterialTheme.colors.primary
)
)
+ Spacer(Modifier.size(25.dp))
Column(Modifier.padding(10.dp, 0.dp, 0.dp, 0.dp)) {
Checkbox(state, onStateChange)
+ Spacer(Modifier.size(25.dp))
Checkbox(state2, onStateChange2)
}
}
diff --git a/compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/ButtonTest.kt b/compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/ButtonTest.kt
index b5a8122..e0aedb1 100644
--- a/compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/ButtonTest.kt
+++ b/compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/ButtonTest.kt
@@ -37,6 +37,7 @@
import androidx.compose.runtime.setValue
import androidx.compose.testutils.assertShape
import androidx.compose.ui.Modifier
+import androidx.compose.ui.draw.clipToBounds
import androidx.compose.ui.geometry.Offset
import androidx.compose.ui.geometry.Rect
import androidx.compose.ui.graphics.Color
@@ -52,11 +53,11 @@
import androidx.compose.ui.test.assert
import androidx.compose.ui.test.assertHasClickAction
import androidx.compose.ui.test.assertHeightIsAtLeast
-import androidx.compose.ui.test.assertHeightIsEqualTo
import androidx.compose.ui.test.assertIsEnabled
+import androidx.compose.ui.test.assertIsEqualTo
import androidx.compose.ui.test.assertIsNotEnabled
-import androidx.compose.ui.test.assertWidthIsEqualTo
import androidx.compose.ui.test.captureToImage
+import androidx.compose.ui.test.getBoundsInRoot
import androidx.compose.ui.test.hasClickAction
import androidx.compose.ui.test.junit4.createComposeRule
import androidx.compose.ui.test.onNodeWithTag
@@ -64,7 +65,9 @@
import androidx.compose.ui.test.performClick
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
+import androidx.compose.ui.unit.height
import androidx.compose.ui.unit.sp
+import androidx.compose.ui.unit.width
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.LargeTest
import androidx.test.filters.MediumTest
@@ -200,20 +203,20 @@
}
@Test
- fun buttonHeightIsFromSpec() {
+ fun buttonHeightIsFromSpec(): Unit = with(rule.density) {
if (rule.density.fontScale > 1f) {
// This test can be reasonable failing on the non default font scales
// so lets skip it.
return
}
rule.setMaterialContent {
- Button(onClick = {}) {
+ Button(modifier = Modifier.clipToBounds(), onClick = {}) {
Text("Test button")
}
}
rule.onNode(hasClickAction())
- .assertHeightIsEqualTo(36.dp)
+ .getBoundsInRoot().height.assertIsEqualTo(36.dp, "height")
}
@Test
@@ -565,8 +568,12 @@
}
rule.onNodeWithTag("button")
- .assertWidthIsEqualTo(20.dp)
- .assertHeightIsEqualTo(15.dp)
+ .apply {
+ with(getBoundsInRoot()) {
+ width.assertIsEqualTo(20.dp, "width")
+ height.assertIsEqualTo(15.dp, "height")
+ }
+ }
}
@Test
@@ -665,4 +672,4 @@
fun assertWithinOnePixel(expected: Float, actual: Float) {
val diff = abs(expected - actual)
assertThat(diff).isLessThan(1.1f)
-}
+}
\ No newline at end of file
diff --git a/compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/CheckboxUiTest.kt b/compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/CheckboxUiTest.kt
index ca9c82b..31f532f 100644
--- a/compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/CheckboxUiTest.kt
+++ b/compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/CheckboxUiTest.kt
@@ -17,9 +17,15 @@
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
+import androidx.compose.foundation.layout.fillMaxSize
+import androidx.compose.foundation.layout.requiredSize
+import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
+import androidx.compose.runtime.setValue
+import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
+import androidx.compose.ui.geometry.Offset
import androidx.compose.ui.platform.testTag
import androidx.compose.ui.semantics.SemanticsProperties
import androidx.compose.ui.semantics.Role
@@ -33,14 +39,18 @@
import androidx.compose.ui.test.assertHasNoClickAction
import androidx.compose.ui.test.SemanticsMatcher
import androidx.compose.ui.test.assert
+import androidx.compose.ui.test.assertHeightIsEqualTo
import androidx.compose.ui.test.assertIsEnabled
import androidx.compose.ui.test.assertIsOff
import androidx.compose.ui.test.assertIsOn
+import androidx.compose.ui.test.assertWidthIsEqualTo
+import androidx.compose.ui.test.click
import androidx.compose.ui.test.isFocusable
import androidx.compose.ui.test.isNotFocusable
import androidx.compose.ui.test.junit4.createComposeRule
import androidx.compose.ui.test.onNodeWithTag
import androidx.compose.ui.test.performClick
+import androidx.compose.ui.test.performGesture
import androidx.compose.ui.unit.dp
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.MediumTest
@@ -169,4 +179,28 @@
}
.assertIsSquareWithSize(2.dp * 2 + 20.dp)
}
+
+ @Test
+ fun checkBoxTest_clickInMinimumTouchTarget(): Unit = with(rule.density) {
+ val tag = "switch"
+ var state by mutableStateOf(Off)
+ rule.setMaterialContent {
+ // Box is needed because otherwise the control will be expanded to fill its parent
+ Box(Modifier.fillMaxSize()) {
+ TriStateCheckbox(
+ state = state,
+ onClick = { state = On },
+ modifier = Modifier.align(Alignment.Center).requiredSize(2.dp).testTag(tag)
+ )
+ }
+ }
+ val pokePosition = 48.dp.roundToPx().toFloat() - 1f
+ rule.onNodeWithTag(tag)
+ .assertIsOff()
+ .assertWidthIsEqualTo(48.dp)
+ .assertHeightIsEqualTo(48.dp)
+ .performGesture {
+ click(position = Offset(pokePosition, pokePosition))
+ }.assertIsOn()
+ }
}
\ No newline at end of file
diff --git a/compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/IconButtonTest.kt b/compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/IconButtonTest.kt
index 96d39f6..a833b58 100644
--- a/compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/IconButtonTest.kt
+++ b/compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/IconButtonTest.kt
@@ -16,13 +16,17 @@
package androidx.compose.material
import androidx.compose.foundation.layout.Box
+import androidx.compose.foundation.layout.fillMaxSize
+import androidx.compose.foundation.layout.requiredSize
import androidx.compose.foundation.layout.size
import androidx.compose.material.samples.IconButtonSample
import androidx.compose.material.samples.IconToggleButtonSample
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.setValue
+import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
+import androidx.compose.ui.geometry.Offset
import androidx.compose.ui.platform.testTag
import androidx.compose.ui.test.assertHeightIsEqualTo
import androidx.compose.ui.test.assertIsEnabled
@@ -32,11 +36,13 @@
import androidx.compose.ui.test.assertLeftPositionInRootIsEqualTo
import androidx.compose.ui.test.assertTopPositionInRootIsEqualTo
import androidx.compose.ui.test.assertWidthIsEqualTo
+import androidx.compose.ui.test.click
import androidx.compose.ui.test.hasClickAction
import androidx.compose.ui.test.isToggleable
import androidx.compose.ui.test.junit4.createComposeRule
import androidx.compose.ui.test.onNodeWithTag
import androidx.compose.ui.test.performClick
+import androidx.compose.ui.test.performGesture
import androidx.compose.ui.unit.dp
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.LargeTest
@@ -245,4 +251,30 @@
Truth.assertThat(contentAlpha!!).isEqualTo(disabledContentAlpha!!)
}
}
+
+ @Test
+ fun iconToggleButton_clickInMinimumTouchTarget(): Unit = with(rule.density) {
+ val tag = "iconToggleButton"
+ var checked by mutableStateOf(false)
+ rule.setMaterialContent {
+ // Box is needed because otherwise the control will be expanded to fill its parent
+ Box(Modifier.fillMaxSize()) {
+ IconToggleButton(
+ checked = checked,
+ onCheckedChange = { checked = it },
+ modifier = Modifier.align(Alignment.Center).requiredSize(2.dp).testTag(tag)
+ ) {
+ Box(Modifier.size(2.dp))
+ }
+ }
+ }
+ val pokePosition = 48.dp.roundToPx().toFloat() - 1f
+ rule.onNodeWithTag(tag)
+ .assertIsOff()
+ .assertWidthIsEqualTo(48.dp)
+ .assertHeightIsEqualTo(48.dp)
+ .performGesture {
+ click(position = Offset(pokePosition, pokePosition))
+ }.assertIsOn()
+ }
}
diff --git a/compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/SnackbarTest.kt b/compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/SnackbarTest.kt
index 8f4e270..7e7d35b 100644
--- a/compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/SnackbarTest.kt
+++ b/compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/SnackbarTest.kt
@@ -18,12 +18,14 @@
import android.os.Build
import androidx.compose.foundation.layout.Box
+import androidx.compose.foundation.layout.sizeIn
import androidx.compose.foundation.shape.CutCornerShape
import androidx.compose.runtime.CompositionLocalProvider
import androidx.compose.testutils.assertIsEqualTo
import androidx.compose.testutils.assertIsNotEqualTo
import androidx.compose.testutils.assertShape
import androidx.compose.ui.Modifier
+import androidx.compose.ui.draw.clipToBounds
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.compositeOver
import androidx.compose.ui.layout.FirstBaseline
@@ -35,6 +37,7 @@
import androidx.compose.ui.test.assertWidthIsEqualTo
import androidx.compose.ui.test.captureToImage
import androidx.compose.ui.test.getAlignmentLinePosition
+import androidx.compose.ui.test.getBoundsInRoot
import androidx.compose.ui.test.getUnclippedBoundsInRoot
import androidx.compose.ui.test.junit4.createComposeRule
import androidx.compose.ui.test.onNodeWithTag
@@ -42,6 +45,7 @@
import androidx.compose.ui.test.performClick
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.height
+import androidx.compose.ui.unit.max
import androidx.compose.ui.unit.sp
import androidx.compose.ui.unit.width
import androidx.test.ext.junit.runners.AndroidJUnit4
@@ -157,7 +161,7 @@
action = {
TextButton(
onClick = {},
- modifier = Modifier.testTag("button")
+ modifier = Modifier.clipToBounds().testTag("button")
) {
Text("Undo")
}
@@ -174,7 +178,7 @@
val snackBounds = snackbar.getUnclippedBoundsInRoot()
val textBounds = rule.onNodeWithText("Message").getUnclippedBoundsInRoot()
- val buttonBounds = rule.onNodeWithText("Undo").getUnclippedBoundsInRoot()
+ val buttonBounds = rule.onNodeWithText("Undo").getBoundsInRoot()
val buttonTopOffset = buttonBounds.top - snackBounds.top
val textTopOffset = textBounds.top - snackBounds.top
@@ -298,14 +302,14 @@
) {
Snackbar(
content = {
- Text("Message")
+ Text("Message", Modifier.sizeIn(minWidth = 48.dp, minHeight = 48.dp))
},
action = {
TextButton(
onClick = {},
modifier = Modifier.testTag("button")
) {
- Text("Undo")
+ Text("Undo", Modifier.sizeIn(minWidth = 48.dp, minHeight = 48.dp))
}
},
actionOnNewLine = true
@@ -320,8 +324,11 @@
rule.onNodeWithText("Message")
.assertTopPositionInRootIsEqualTo(30.dp - textFirstBaseLine)
- rule.onNodeWithTag("button")
- .assertTopPositionInRootIsEqualTo(18.dp + textBounds.top + textLastBaseLine)
+ val lastBaselineToBottom = max(18.dp, 48.dp - textLastBaseLine)
+
+ rule.onNodeWithTag("button").assertTopPositionInRootIsEqualTo(
+ lastBaselineToBottom + textBounds.top + textLastBaseLine
+ )
snackbar
.assertHeightIsEqualTo(8.dp + buttonBounds.top + buttonBounds.height)
diff --git a/compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/SwipeableTest.kt b/compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/SwipeableTest.kt
index cde992f..87c752c 100644
--- a/compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/SwipeableTest.kt
+++ b/compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/SwipeableTest.kt
@@ -1250,13 +1250,16 @@
assertThat(state.direction).isEqualTo(0f)
}
+ val largeSwipe = with(rule.density) { 125.dp.toPx() + slop }
+ val smallSwipe = with(rule.density) { 25.dp.toPx() + slop }
+
rule.onNodeWithTag(swipeableTag).performGesture {
- swipe(start = center, end = center + Offset(125f - slop, 0f))
+ swipe(start = center, end = center + Offset(largeSwipe, 0f))
}
// draggable needs to recompose to toggle startDragImmediately
rule.mainClock.advanceTimeByFrame()
rule.onNodeWithTag(swipeableTag).performGesture {
- swipe(start = center, end = center - Offset(25f, 0f))
+ swipe(start = center, end = center - Offset(smallSwipe, 0f))
}
rule.runOnIdle {
@@ -1272,12 +1275,12 @@
}
rule.onNodeWithTag(swipeableTag).performGesture {
- swipe(start = center, end = center - Offset(125f - slop, 0f))
+ swipe(start = center, end = center - Offset(largeSwipe, 0f))
}
// draggable needs to recompose to toggle startDragImmediately
rule.mainClock.advanceTimeByFrame()
rule.onNodeWithTag(swipeableTag).performGesture {
- swipe(start = center, end = center + Offset(25f, 0f))
+ swipe(start = center, end = center + Offset(smallSwipe, 0f))
}
rule.runOnIdle {
diff --git a/compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/SwitchTest.kt b/compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/SwitchTest.kt
index 3bbb7dd..45e046b 100644
--- a/compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/SwitchTest.kt
+++ b/compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/SwitchTest.kt
@@ -19,13 +19,17 @@
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
+import androidx.compose.foundation.layout.fillMaxSize
+import androidx.compose.foundation.layout.requiredSize
import androidx.compose.runtime.CompositionLocalProvider
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.saveable.rememberSaveableStateHolder
import androidx.compose.runtime.setValue
+import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
+import androidx.compose.ui.geometry.Offset
import androidx.compose.ui.platform.LocalLayoutDirection
import androidx.compose.ui.platform.testTag
import androidx.compose.ui.semantics.Role
@@ -41,6 +45,7 @@
import androidx.compose.ui.test.assertIsOff
import androidx.compose.ui.test.assertIsOn
import androidx.compose.ui.test.assertWidthIsEqualTo
+import androidx.compose.ui.test.click
import androidx.compose.ui.test.isFocusable
import androidx.compose.ui.test.isNotFocusable
import androidx.compose.ui.test.junit4.createComposeRule
@@ -54,6 +59,7 @@
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.MediumTest
import com.google.common.truth.Truth
+import com.google.common.truth.Truth.assertThat
import org.junit.Rule
import org.junit.Test
import org.junit.runner.RunWith
@@ -316,11 +322,48 @@
rule.onNodeWithTag("2").assertIsOff()
}
- private fun materialSizesTestForValue(checked: Boolean) {
+ private fun materialSizesTestForValue(checked: Boolean) = with(rule.density) {
+ // The padding should be 2 DP, but we round to pixels when determining layout
+ val paddingInPixels = 2.dp.roundToPx()
+
+ // Convert back to DP so that we have an exact DP value to work with. We don't
+ // want to multiply the error by two (one for each padding), so we get the exact
+ // padding based on the expected pixels consumed by the padding.
+ val paddingInDp = paddingInPixels.toDp()
+
rule.setMaterialContentForSizeAssertions {
Switch(checked = checked, onCheckedChange = {}, enabled = false)
}
- .assertWidthIsEqualTo(34.dp + 2.dp * 2)
- .assertHeightIsEqualTo(20.dp + 2.dp * 2)
+ .assertWidthIsEqualTo(34.dp + paddingInDp * 2)
+ .assertHeightIsEqualTo(20.dp + paddingInDp * 2)
+ }
+
+ /**
+ * A switch should have a minimum touch target of 48 DP x 48 DP and the reported size
+ * should match that, despite the fact that we force the size to be smaller.
+ */
+ @Test
+ fun switch_minTouchTargetArea(): Unit = with(rule.density) {
+ var checked by mutableStateOf(false)
+ rule.setMaterialContent {
+ // Box is needed because otherwise the control will be expanded to fill its parent
+ Box(Modifier.fillMaxSize()) {
+ Switch(
+ modifier = Modifier.align(Alignment.Center)
+ .testTag(defaultSwitchTag)
+ .requiredSize(2.dp),
+ checked = checked,
+ onCheckedChange = { checked = it }
+ )
+ }
+ }
+ val pokePosition = 48.dp.roundToPx().toFloat() - 1f
+ rule.onNodeWithTag(defaultSwitchTag)
+ .assertIsOff()
+ .assertWidthIsEqualTo(48.dp)
+ .assertHeightIsEqualTo(48.dp)
+ .performGesture {
+ click(position = Offset(pokePosition, pokePosition))
+ }.assertIsOn()
}
}
diff --git a/compose/material/material/src/commonMain/kotlin/androidx/compose/material/FloatingActionButton.kt b/compose/material/material/src/commonMain/kotlin/androidx/compose/material/FloatingActionButton.kt
index 9dffc43..e6bf730 100644
--- a/compose/material/material/src/commonMain/kotlin/androidx/compose/material/FloatingActionButton.kt
+++ b/compose/material/material/src/commonMain/kotlin/androidx/compose/material/FloatingActionButton.kt
@@ -61,8 +61,7 @@
*
* See [ExtendedFloatingActionButton] for an extended FAB that contains text and an optional icon.
*
- * @param onClick will be called when user clicked on this FAB. The FAB will be disabled
- * when it is null.
+ * @param onClick callback invoked when this FAB is clicked
* @param modifier [Modifier] to be applied to this FAB.
* @param interactionSource the [MutableInteractionSource] representing the stream of
* [Interaction]s for this FAB. You can create and pass in your own remembered
@@ -129,8 +128,7 @@
* @sample androidx.compose.material.samples.FluidExtendedFab
*
* @param text Text label displayed inside this FAB
- * @param onClick will be called when user clicked on this FAB. The FAB will be disabled
- * when it is null.
+ * @param onClick callback invoked when this FAB is clicked
* @param modifier [Modifier] to be applied to this FAB
* @param icon Optional icon for this FAB, typically this will be a
* [Icon].
diff --git a/compose/material/material/src/desktopMain/kotlin/androidx/compose/material/DesktopAlertDialog.desktop.kt b/compose/material/material/src/desktopMain/kotlin/androidx/compose/material/DesktopAlertDialog.desktop.kt
index 64e3e8a..88357d1 100644
--- a/compose/material/material/src/desktopMain/kotlin/androidx/compose/material/DesktopAlertDialog.desktop.kt
+++ b/compose/material/material/src/desktopMain/kotlin/androidx/compose/material/DesktopAlertDialog.desktop.kt
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-@file:Suppress("DEPRECATION")
+
package androidx.compose.material
import androidx.compose.foundation.layout.Box
@@ -29,138 +29,12 @@
import androidx.compose.ui.graphics.Shape
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
-import androidx.compose.ui.window.OwnerWindowScope
import androidx.compose.ui.window.Popup
import androidx.compose.ui.window.rememberDialogState
-import androidx.compose.ui.window.v1.Dialog
-import androidx.compose.ui.window.v1.DialogProperties
import androidx.compose.ui.window.Dialog as CoreDialog
/**
- * Alert dialog is a [Dialog] which interrupts the user with urgent information, details or actions.
- *
- * The dialog will position its buttons based on the available space. By default it will try to
- * place them horizontally next to each other and fallback to horizontal placement if not enough
- * space is available. There is also another version of this composable that has a slot for buttons
- * to provide custom buttons layout.
- *
- * Sample of dialog:
- * @sample androidx.compose.material.samples.AlertDialogSample
- *
- * @param onDismissRequest Executes when the user tries to dismiss the Dialog by clicking outside
- * or pressing the back button. This is not called when the dismiss button is clicked.
- * @param confirmButton A button which is meant to confirm a proposed action, thus resolving
- * what triggered the dialog. The dialog does not set up any events for this button so they need
- * to be set up by the caller.
- * @param modifier Modifier to be applied to the layout of the dialog.
- * @param dismissButton A button which is meant to dismiss the dialog. The dialog does not set up
- * any events for this button so they need to be set up by the caller.
- * @param title The title of the Dialog which should specify the purpose of the Dialog. The title
- * is not mandatory, because there may be sufficient information inside the [text]. Provided text
- * style will be [Typography.subtitle1].
- * @param text The text which presents the details regarding the Dialog's purpose. Provided text
- * style will be [Typography.body2].
- * @param shape Defines the Dialog's shape
- * @param backgroundColor The background color of the dialog.
- * @param contentColor The preferred content color provided by this dialog to its children.
- * @param properties Typically platform specific properties to further configure the dialog.
- */
-@Deprecated(
- "Use another variant of AlertDialog for the new Composable Window API (https://github" +
- ".com/JetBrains/compose-jb/tree/master/tutorials/Window_API_new)"
-)
-@Composable
-fun AlertDialog(
- onDismissRequest: () -> Unit,
- confirmButton: @Composable () -> Unit,
- modifier: Modifier = Modifier,
- dismissButton: @Composable (() -> Unit)? = null,
- title: @Composable (() -> Unit)? = null,
- text: @Composable (() -> Unit)? = null,
- shape: Shape = MaterialTheme.shapes.medium,
- backgroundColor: Color = MaterialTheme.colors.surface,
- contentColor: Color = contentColorFor(backgroundColor),
- properties: DialogProperties = DialogProperties()
-) {
- AlertDialog(
- onDismissRequest = onDismissRequest,
- buttons = {
- // TODO: move the modifiers to FlowRow when it supports a modifier parameter
- Box(Modifier.fillMaxWidth().padding(all = 8.dp)) {
- AlertDialogFlowRow(
- mainAxisSpacing = 8.dp,
- crossAxisSpacing = 12.dp
- ) {
- dismissButton?.invoke()
- confirmButton()
- }
- }
- },
- modifier = modifier,
- title = title,
- text = text,
- shape = shape,
- backgroundColor = backgroundColor,
- contentColor = contentColor,
- properties = properties
- )
-}
-
-/**
- * Alert dialog is a [Dialog] which interrupts the user with urgent information, details or actions.
- *
- * This function can be used to fully customize the button area, e.g. with:
- *
- * @sample androidx.compose.material.samples.CustomAlertDialogSample
- *
- * @param onDismissRequest Executes when the user tries to dismiss the Dialog by clicking outside
- * or pressing the back button. This is not called when the dismiss button is clicked.
- * @param buttons Function that emits the layout with the buttons.
- * @param modifier Modifier to be applied to the layout of the dialog.
- * @param title The title of the Dialog which should specify the purpose of the Dialog. The title
- * is not mandatory, because there may be sufficient information inside the [text]. Provided text
- * style will be [Typography.subtitle1].
- * @param text The text which presents the details regarding the Dialog's purpose. Provided text
- * style will be [Typography.body2].
- * @param shape Defines the Dialog's shape.
- * @param backgroundColor The background color of the dialog.
- * @param contentColor The preferred content color provided by this dialog to its children.
- * @param properties Typically platform specific properties to further configure the dialog.
- */
-@Deprecated(
- "Use another variant of AlertDialog for the new Composable Window API (https://github" +
- ".com/JetBrains/compose-jb/tree/master/tutorials/Window_API_new)"
-)
-@Composable
-fun AlertDialog(
- onDismissRequest: () -> Unit,
- buttons: @Composable () -> Unit,
- modifier: Modifier = Modifier,
- title: (@Composable () -> Unit)? = null,
- text: @Composable (() -> Unit)? = null,
- shape: Shape = MaterialTheme.shapes.medium,
- backgroundColor: Color = MaterialTheme.colors.surface,
- contentColor: Color = contentColorFor(backgroundColor),
- properties: DialogProperties = DialogProperties()
-) {
- Dialog(
- onDismissRequest = onDismissRequest,
- properties = properties
- ) {
- AlertDialogContent(
- buttons = buttons,
- modifier = modifier,
- title = title,
- text = text,
- shape = shape,
- backgroundColor = backgroundColor,
- contentColor = contentColor
- )
- }
-}
-
-/**
- * Alert dialog is a [Dialog] which interrupts the user with urgent information, details or actions.
+ * Alert dialog is a Dialog which interrupts the user with urgent information, details or actions.
*
* The dialog will position its buttons based on the available space. By default it will try to
* place them horizontally next to each other and fallback to horizontal placement if not enough
@@ -189,7 +63,7 @@
*/
@Composable
@ExperimentalMaterialApi
-fun OwnerWindowScope.AlertDialog(
+fun AlertDialog(
onDismissRequest: () -> Unit,
confirmButton: @Composable () -> Unit,
modifier: Modifier = Modifier,
@@ -226,7 +100,7 @@
}
/**
- * Alert dialog is a [Dialog] which interrupts the user with urgent information, details or actions.
+ * Alert dialog is a Dialog which interrupts the user with urgent information, details or actions.
*
* This function can be used to fully customize the button area, e.g. with:
*
@@ -247,7 +121,7 @@
*/
@Composable
@ExperimentalMaterialApi
-fun OwnerWindowScope.AlertDialog(
+fun AlertDialog(
onDismissRequest: () -> Unit,
buttons: @Composable () -> Unit,
modifier: Modifier = Modifier,
@@ -285,7 +159,7 @@
* @param content Content of the dialog
*/
@Composable
- fun OwnerWindowScope.AlertDialog(
+ fun AlertDialog(
onDismissRequest: () -> Unit,
content: @Composable () -> Unit
)
@@ -299,7 +173,7 @@
@ExperimentalMaterialApi
object PopupAlertDialogProvider : AlertDialogProvider {
@Composable
- override fun OwnerWindowScope.AlertDialog(
+ override fun AlertDialog(
onDismissRequest: () -> Unit,
content: @Composable () -> Unit
) {
@@ -321,7 +195,7 @@
@ExperimentalMaterialApi
object UndecoratedWindowAlertDialogProvider : AlertDialogProvider {
@Composable
- override fun OwnerWindowScope.AlertDialog(
+ override fun AlertDialog(
onDismissRequest: () -> Unit,
content: @Composable () -> Unit
) {
diff --git a/compose/material/material/src/desktopMain/kotlin/androidx/compose/material/DesktopMenu.desktop.kt b/compose/material/material/src/desktopMain/kotlin/androidx/compose/material/DesktopMenu.desktop.kt
index 395e154..8d835d1 100644
--- a/compose/material/material/src/desktopMain/kotlin/androidx/compose/material/DesktopMenu.desktop.kt
+++ b/compose/material/material/src/desktopMain/kotlin/androidx/compose/material/DesktopMenu.desktop.kt
@@ -22,14 +22,15 @@
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.RowScope
import androidx.compose.runtime.Composable
-import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
+import androidx.compose.ui.ExperimentalComposeUiApi
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.TransformOrigin
import androidx.compose.ui.platform.LocalDensity
import androidx.compose.ui.unit.DpOffset
import androidx.compose.ui.unit.dp
+import androidx.compose.ui.window.rememberCursorPositionProvider
import androidx.compose.ui.window.Popup
/**
@@ -138,21 +139,21 @@
/**
*
- * A [ContextMenu] behaves similarly to [Popup] and will use the current position of the mouse
+ * A [CursorDropdownMenu] behaves similarly to [Popup] and will use the current position of the mouse
* cursor to position itself on screen.
*
- * The [content] of a [ContextMenu] will typically be [DropdownMenuItem]s, as well as custom
+ * The [content] of a [CursorDropdownMenu] will typically be [DropdownMenuItem]s, as well as custom
* content. Using [DropdownMenuItem]s will result in a menu that matches the Material
* specification for menus.
*
* @param expanded Whether the menu is currently open and visible to the user
* @param onDismissRequest Called when the user requests to dismiss the menu, such as by
* tapping outside the menu's bounds
- * @param offset [DpOffset] to be added to the position of the menu
*/
+@OptIn(ExperimentalComposeUiApi::class)
@Suppress("ModifierParameter")
@Composable
-fun ContextMenu(
+fun CursorDropdownMenu(
expanded: Boolean,
onDismissRequest: () -> Unit,
focusable: Boolean = true,
@@ -164,19 +165,11 @@
if (expandedStates.currentState || expandedStates.targetState) {
val transformOriginState = remember { mutableStateOf(TransformOrigin.Center) }
- val density = LocalDensity.current
- val popupPositionProvider = DropdownMenuPositionProvider(
- DpOffset(0.dp, 0.dp),
- density
- ) { parentBounds, menuBounds ->
- transformOriginState.value = calculateTransformOrigin(parentBounds, menuBounds)
- }
Popup(
focusable = focusable,
- contextMenu = true,
onDismissRequest = onDismissRequest,
- popupPositionProvider = popupPositionProvider
+ popupPositionProvider = rememberCursorPositionProvider()
) {
DropdownMenuContent(
expandedStates = expandedStates,
diff --git a/compose/material/material/src/desktopMain/kotlin/androidx/compose/material/v1/DesktopAlertDialogDeprecated.desktop.kt b/compose/material/material/src/desktopMain/kotlin/androidx/compose/material/v1/DesktopAlertDialogDeprecated.desktop.kt
new file mode 100644
index 0000000..2ca03cd
--- /dev/null
+++ b/compose/material/material/src/desktopMain/kotlin/androidx/compose/material/v1/DesktopAlertDialogDeprecated.desktop.kt
@@ -0,0 +1,157 @@
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * 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.
+ */
+
+@file:Suppress("DEPRECATION")
+
+package androidx.compose.material.v1
+
+import androidx.compose.foundation.layout.Box
+import androidx.compose.foundation.layout.fillMaxWidth
+import androidx.compose.foundation.layout.padding
+import androidx.compose.material.AlertDialogContent
+import androidx.compose.material.AlertDialogFlowRow
+import androidx.compose.material.MaterialTheme
+import androidx.compose.material.contentColorFor
+import androidx.compose.runtime.Composable
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.graphics.Color
+import androidx.compose.ui.graphics.Shape
+import androidx.compose.ui.unit.dp
+import androidx.compose.ui.window.v1.Dialog
+import androidx.compose.ui.window.v1.DialogProperties
+
+/**
+ * Alert dialog is a [Dialog] which interrupts the user with urgent information, details or actions.
+ *
+ * The dialog will position its buttons based on the available space. By default it will try to
+ * place them horizontally next to each other and fallback to horizontal placement if not enough
+ * space is available. There is also another version of this composable that has a slot for buttons
+ * to provide custom buttons layout.
+ *
+ * Sample of dialog:
+ * @sample androidx.compose.material.samples.AlertDialogSample
+ *
+ * @param onDismissRequest Executes when the user tries to dismiss the Dialog by clicking outside
+ * or pressing the back button. This is not called when the dismiss button is clicked.
+ * @param confirmButton A button which is meant to confirm a proposed action, thus resolving
+ * what triggered the dialog. The dialog does not set up any events for this button so they need
+ * to be set up by the caller.
+ * @param modifier Modifier to be applied to the layout of the dialog.
+ * @param dismissButton A button which is meant to dismiss the dialog. The dialog does not set up
+ * any events for this button so they need to be set up by the caller.
+ * @param title The title of the Dialog which should specify the purpose of the Dialog. The title
+ * is not mandatory, because there may be sufficient information inside the [text]. Provided text
+ * style will be [Typography.subtitle1].
+ * @param text The text which presents the details regarding the Dialog's purpose. Provided text
+ * style will be [Typography.body2].
+ * @param shape Defines the Dialog's shape
+ * @param backgroundColor The background color of the dialog.
+ * @param contentColor The preferred content color provided by this dialog to its children.
+ * @param properties Typically platform specific properties to further configure the dialog.
+ */
+@Deprecated(
+ "Use another variant of AlertDialog for the new Composable Window API (https://github" +
+ ".com/JetBrains/compose-jb/tree/master/tutorials/Window_API_new)"
+)
+@Composable
+fun AlertDialog(
+ onDismissRequest: () -> Unit,
+ confirmButton: @Composable () -> Unit,
+ modifier: Modifier = Modifier,
+ dismissButton: @Composable (() -> Unit)? = null,
+ title: @Composable (() -> Unit)? = null,
+ text: @Composable (() -> Unit)? = null,
+ shape: Shape = MaterialTheme.shapes.medium,
+ backgroundColor: Color = MaterialTheme.colors.surface,
+ contentColor: Color = contentColorFor(backgroundColor),
+ properties: DialogProperties = DialogProperties()
+) {
+ AlertDialog(
+ onDismissRequest = onDismissRequest,
+ buttons = {
+ // TODO: move the modifiers to FlowRow when it supports a modifier parameter
+ Box(Modifier.fillMaxWidth().padding(all = 8.dp)) {
+ AlertDialogFlowRow(
+ mainAxisSpacing = 8.dp,
+ crossAxisSpacing = 12.dp
+ ) {
+ dismissButton?.invoke()
+ confirmButton()
+ }
+ }
+ },
+ modifier = modifier,
+ title = title,
+ text = text,
+ shape = shape,
+ backgroundColor = backgroundColor,
+ contentColor = contentColor,
+ properties = properties
+ )
+}
+
+/**
+ * Alert dialog is a [Dialog] which interrupts the user with urgent information, details or actions.
+ *
+ * This function can be used to fully customize the button area, e.g. with:
+ *
+ * @sample androidx.compose.material.samples.CustomAlertDialogSample
+ *
+ * @param onDismissRequest Executes when the user tries to dismiss the Dialog by clicking outside
+ * or pressing the back button. This is not called when the dismiss button is clicked.
+ * @param buttons Function that emits the layout with the buttons.
+ * @param modifier Modifier to be applied to the layout of the dialog.
+ * @param title The title of the Dialog which should specify the purpose of the Dialog. The title
+ * is not mandatory, because there may be sufficient information inside the [text]. Provided text
+ * style will be [Typography.subtitle1].
+ * @param text The text which presents the details regarding the Dialog's purpose. Provided text
+ * style will be [Typography.body2].
+ * @param shape Defines the Dialog's shape.
+ * @param backgroundColor The background color of the dialog.
+ * @param contentColor The preferred content color provided by this dialog to its children.
+ * @param properties Typically platform specific properties to further configure the dialog.
+ */
+@Deprecated(
+ "Use another variant of AlertDialog for the new Composable Window API (https://github" +
+ ".com/JetBrains/compose-jb/tree/master/tutorials/Window_API_new)"
+)
+@Composable
+fun AlertDialog(
+ onDismissRequest: () -> Unit,
+ buttons: @Composable () -> Unit,
+ modifier: Modifier = Modifier,
+ title: (@Composable () -> Unit)? = null,
+ text: @Composable (() -> Unit)? = null,
+ shape: Shape = MaterialTheme.shapes.medium,
+ backgroundColor: Color = MaterialTheme.colors.surface,
+ contentColor: Color = contentColorFor(backgroundColor),
+ properties: DialogProperties = DialogProperties()
+) {
+ Dialog(
+ onDismissRequest = onDismissRequest,
+ properties = properties
+ ) {
+ AlertDialogContent(
+ buttons = buttons,
+ modifier = modifier,
+ title = title,
+ text = text,
+ shape = shape,
+ backgroundColor = backgroundColor,
+ contentColor = contentColor
+ )
+ }
+}
diff --git a/compose/material3/OWNERS b/compose/material3/OWNERS
index d13d53b..558577c 100644
--- a/compose/material3/OWNERS
+++ b/compose/material3/OWNERS
@@ -4,3 +4,7 @@
malkov@google.com
lpf@google.com
soboleva@google.com
+connieshi@google.com
+jaguado@google.com
+maxying@google.com
+sgibly@google.com
diff --git a/compose/material3/material3/api/current.txt b/compose/material3/material3/api/current.txt
index e6f50d0..9f6e933 100644
--- a/compose/material3/material3/api/current.txt
+++ b/compose/material3/material3/api/current.txt
@@ -1 +1,8 @@
// Signature format: 4.0
+package androidx.compose.material3 {
+
+ public final class DynamicTonalPalettesKt {
+ }
+
+}
+
diff --git a/compose/material3/material3/api/public_plus_experimental_current.txt b/compose/material3/material3/api/public_plus_experimental_current.txt
index e6f50d0..9f6e933 100644
--- a/compose/material3/material3/api/public_plus_experimental_current.txt
+++ b/compose/material3/material3/api/public_plus_experimental_current.txt
@@ -1 +1,8 @@
// Signature format: 4.0
+package androidx.compose.material3 {
+
+ public final class DynamicTonalPalettesKt {
+ }
+
+}
+
diff --git a/compose/material3/material3/api/restricted_current.txt b/compose/material3/material3/api/restricted_current.txt
index e6f50d0..9f6e933 100644
--- a/compose/material3/material3/api/restricted_current.txt
+++ b/compose/material3/material3/api/restricted_current.txt
@@ -1 +1,8 @@
// Signature format: 4.0
+package androidx.compose.material3 {
+
+ public final class DynamicTonalPalettesKt {
+ }
+
+}
+
diff --git a/compose/material3/material3/build.gradle b/compose/material3/material3/build.gradle
index 840537c..48b3f76 100644
--- a/compose/material3/material3/build.gradle
+++ b/compose/material3/material3/build.gradle
@@ -28,6 +28,7 @@
AndroidXComposePlugin.applyAndConfigureKotlinPlugin(project)
dependencies {
+
kotlinPlugin(project(":compose:compiler:compiler"))
if(!AndroidXComposePlugin.isMultiplatformEnabled(project)) {
@@ -36,6 +37,10 @@
* corresponding block below
*/
implementation(libs.kotlinStdlibCommon)
+
+ api(project(":compose:runtime:runtime"))
+ api(project(":compose:ui:ui-graphics"))
+
}
}
@@ -51,6 +56,9 @@
sourceSets {
commonMain.dependencies {
implementation(libs.kotlinStdlibCommon)
+
+ api(project(":compose:runtime:runtime"))
+ api(project(":compose:ui:ui-graphics"))
}
androidMain.dependencies {
diff --git a/compose/material3/material3/src/androidMain/kotlin/androidx/compose/material3/DynamicTonalPalettes.kt b/compose/material3/material3/src/androidMain/kotlin/androidx/compose/material3/DynamicTonalPalettes.kt
new file mode 100644
index 0000000..2ee520a
--- /dev/null
+++ b/compose/material3/material3/src/androidMain/kotlin/androidx/compose/material3/DynamicTonalPalettes.kt
@@ -0,0 +1,165 @@
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * 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.
+ */
+
+package androidx.compose.material3
+
+import android.content.Context
+import android.os.Build
+import androidx.annotation.ColorRes
+import androidx.annotation.DoNotInline
+import androidx.annotation.RequiresApi
+import androidx.compose.ui.graphics.Color
+
+/** Dynamic colors in Material3. */
+@RequiresApi(Build.VERSION_CODES.S)
+internal fun dynamicTonalPalettes(context: Context): TonalPalettes =
+ TonalPalettes(
+ // The neutral tonal palette from the generated dynamic color palettes.
+ neutral0 = ColorResourceHelper.getColor(context, android.R.color.system_neutral1_0),
+ neutral10 = ColorResourceHelper.getColor(context, android.R.color.system_neutral1_10),
+ neutral50 = ColorResourceHelper.getColor(context, android.R.color.system_neutral1_50),
+ neutral100 = ColorResourceHelper.getColor(context, android.R.color.system_neutral1_100),
+ neutral200 = ColorResourceHelper.getColor(context, android.R.color.system_neutral1_200),
+ neutral300 = ColorResourceHelper.getColor(context, android.R.color.system_neutral1_300),
+ neutral400 = ColorResourceHelper.getColor(context, android.R.color.system_neutral1_400),
+ neutral500 = ColorResourceHelper.getColor(context, android.R.color.system_neutral1_500),
+ neutral600 = ColorResourceHelper.getColor(context, android.R.color.system_neutral1_600),
+ neutral700 = ColorResourceHelper.getColor(context, android.R.color.system_neutral1_700),
+ neutral800 = ColorResourceHelper.getColor(context, android.R.color.system_neutral1_800),
+ neutral900 = ColorResourceHelper.getColor(context, android.R.color.system_neutral1_900),
+ neutral1000 = ColorResourceHelper.getColor(context, android.R.color.system_neutral1_1000),
+
+ // The neutral variant tonal palette, sometimes called "neutral 2", from the
+ // generated dynamic color palettes.
+ neutralVariant0 = ColorResourceHelper.getColor(context, android.R.color.system_neutral2_0),
+ neutralVariant10 =
+ ColorResourceHelper.getColor(context, android.R.color.system_neutral2_10),
+ neutralVariant50 =
+ ColorResourceHelper.getColor(context, android.R.color.system_neutral2_50),
+ neutralVariant100 =
+ ColorResourceHelper.getColor(context, android.R.color.system_neutral2_100),
+ neutralVariant200 =
+ ColorResourceHelper.getColor(context, android.R.color.system_neutral2_200),
+ neutralVariant300 =
+ ColorResourceHelper.getColor(context, android.R.color.system_neutral2_300),
+ neutralVariant400 =
+ ColorResourceHelper.getColor(context, android.R.color.system_neutral2_400),
+ neutralVariant500 =
+ ColorResourceHelper.getColor(context, android.R.color.system_neutral2_500),
+ neutralVariant600 =
+ ColorResourceHelper.getColor(context, android.R.color.system_neutral2_600),
+ neutralVariant700 =
+ ColorResourceHelper.getColor(context, android.R.color.system_neutral2_700),
+ neutralVariant800 =
+ ColorResourceHelper.getColor(context, android.R.color.system_neutral2_800),
+ neutralVariant900 =
+ ColorResourceHelper.getColor(context, android.R.color.system_neutral2_900),
+ neutralVariant1000 =
+ ColorResourceHelper.getColor(context, android.R.color.system_neutral2_1000),
+
+ // The primary tonal palette from the generated dynamic color palettes.
+ primary0 =
+ ColorResourceHelper.getColor(context, android.R.color.system_accent1_0),
+ primary10 =
+ ColorResourceHelper.getColor(context, android.R.color.system_accent1_10),
+ primary50 =
+ ColorResourceHelper.getColor(context, android.R.color.system_accent1_50),
+ primary100 =
+ ColorResourceHelper.getColor(context, android.R.color.system_accent1_100),
+ primary200 =
+ ColorResourceHelper.getColor(context, android.R.color.system_accent1_200),
+ primary300 =
+ ColorResourceHelper.getColor(context, android.R.color.system_accent1_300),
+ primary400 =
+ ColorResourceHelper.getColor(context, android.R.color.system_accent1_400),
+ primary500 =
+ ColorResourceHelper.getColor(context, android.R.color.system_accent1_500),
+ primary600 =
+ ColorResourceHelper.getColor(context, android.R.color.system_accent1_600),
+ primary700 =
+ ColorResourceHelper.getColor(context, android.R.color.system_accent1_700),
+ primary800 =
+ ColorResourceHelper.getColor(context, android.R.color.system_accent1_800),
+ primary900 =
+ ColorResourceHelper.getColor(context, android.R.color.system_accent1_900),
+ primary1000 =
+ ColorResourceHelper.getColor(context, android.R.color.system_accent1_1000),
+
+ // The secondary tonal palette from the generated dynamic color palettes.
+ secondary0 =
+ ColorResourceHelper.getColor(context, android.R.color.system_accent2_0),
+ secondary10 =
+ ColorResourceHelper.getColor(context, android.R.color.system_accent2_10),
+ secondary50 =
+ ColorResourceHelper.getColor(context, android.R.color.system_accent2_50),
+ secondary100 =
+ ColorResourceHelper.getColor(context, android.R.color.system_accent2_100),
+ secondary200 =
+ ColorResourceHelper.getColor(context, android.R.color.system_accent2_200),
+ secondary300 =
+ ColorResourceHelper.getColor(context, android.R.color.system_accent2_300),
+ secondary400 =
+ ColorResourceHelper.getColor(context, android.R.color.system_accent2_400),
+ secondary500 =
+ ColorResourceHelper.getColor(context, android.R.color.system_accent2_500),
+ secondary600 =
+ ColorResourceHelper.getColor(context, android.R.color.system_accent2_600),
+ secondary700 =
+ ColorResourceHelper.getColor(context, android.R.color.system_accent2_700),
+ secondary800 =
+ ColorResourceHelper.getColor(context, android.R.color.system_accent2_800),
+ secondary900 =
+ ColorResourceHelper.getColor(context, android.R.color.system_accent2_900),
+ secondary1000 =
+ ColorResourceHelper.getColor(context, android.R.color.system_accent2_1000),
+
+ // The tertiary tonal palette from the generated dynamic color palettes.
+ tertiary0 =
+ ColorResourceHelper.getColor(context, android.R.color.system_accent3_0),
+ tertiary10 =
+ ColorResourceHelper.getColor(context, android.R.color.system_accent3_10),
+ tertiary50 =
+ ColorResourceHelper.getColor(context, android.R.color.system_accent3_50),
+ tertiary100 =
+ ColorResourceHelper.getColor(context, android.R.color.system_accent3_100),
+ tertiary200 =
+ ColorResourceHelper.getColor(context, android.R.color.system_accent3_200),
+ tertiary300 =
+ ColorResourceHelper.getColor(context, android.R.color.system_accent3_300),
+ tertiary400 =
+ ColorResourceHelper.getColor(context, android.R.color.system_accent3_400),
+ tertiary500 =
+ ColorResourceHelper.getColor(context, android.R.color.system_accent3_500),
+ tertiary600 =
+ ColorResourceHelper.getColor(context, android.R.color.system_accent3_600),
+ tertiary700 =
+ ColorResourceHelper.getColor(context, android.R.color.system_accent3_700),
+ tertiary800 =
+ ColorResourceHelper.getColor(context, android.R.color.system_accent3_800),
+ tertiary900 =
+ ColorResourceHelper.getColor(context, android.R.color.system_accent3_900),
+
+ tertiary1000 =
+ ColorResourceHelper.getColor(context, android.R.color.system_accent3_1000),
+ )
+
+@RequiresApi(23)
+private object ColorResourceHelper {
+ @DoNotInline
+ fun getColor(context: Context, @ColorRes id: Int): Color {
+ return Color(context.resources.getColor(id, context.theme))
+ }
+}
diff --git a/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/TonalPalettes.kt b/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/TonalPalettes.kt
new file mode 100644
index 0000000..214d27e
--- /dev/null
+++ b/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/TonalPalettes.kt
@@ -0,0 +1,98 @@
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * 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.
+ */
+
+package androidx.compose.material3
+
+import androidx.compose.ui.graphics.Color
+
+/** Tonal Palette structure in Material3. */
+internal class TonalPalettes(
+ // The neutral tonal palette from the generated dynamic color palettes.
+ val neutral0: Color,
+ val neutral10: Color,
+ val neutral50: Color,
+ val neutral100: Color,
+ val neutral200: Color,
+ val neutral300: Color,
+ val neutral400: Color,
+ val neutral500: Color,
+ val neutral600: Color,
+ val neutral700: Color,
+ val neutral800: Color,
+ val neutral900: Color,
+ val neutral1000: Color,
+
+ // The neutral variant tonal palette, sometimes called "neutral 2", from the
+ // generated dynamic color palettes.
+ val neutralVariant0: Color,
+ val neutralVariant10: Color,
+ val neutralVariant50: Color,
+ val neutralVariant100: Color,
+ val neutralVariant200: Color,
+ val neutralVariant300: Color,
+ val neutralVariant400: Color,
+ val neutralVariant500: Color,
+ val neutralVariant600: Color,
+ val neutralVariant700: Color,
+ val neutralVariant800: Color,
+ val neutralVariant900: Color,
+ val neutralVariant1000: Color,
+
+ // The primary tonal palette from the generated dynamic color palettes.
+ val primary0: Color,
+ val primary10: Color,
+ val primary50: Color,
+ val primary100: Color,
+ val primary200: Color,
+ val primary300: Color,
+ val primary400: Color,
+ val primary500: Color,
+ val primary600: Color,
+ val primary700: Color,
+ val primary800: Color,
+ val primary900: Color,
+ val primary1000: Color,
+
+ // The secondary tonal palette from the generated dynamic color palettes.
+ val secondary0: Color,
+ val secondary10: Color,
+ val secondary50: Color,
+ val secondary100: Color,
+ val secondary200: Color,
+ val secondary300: Color,
+ val secondary400: Color,
+ val secondary500: Color,
+ val secondary600: Color,
+ val secondary700: Color,
+ val secondary800: Color,
+ val secondary900: Color,
+ val secondary1000: Color,
+
+ // The tertiary tonal palette from the generated dynamic color palettes.
+ val tertiary0: Color,
+ val tertiary10: Color,
+ val tertiary50: Color,
+ val tertiary100: Color,
+ val tertiary200: Color,
+ val tertiary300: Color,
+ val tertiary400: Color,
+ val tertiary500: Color,
+ val tertiary600: Color,
+ val tertiary700: Color,
+ val tertiary800: Color,
+ val tertiary900: Color,
+ val tertiary1000: Color,
+)
diff --git a/compose/material3/material3/src/commonMain/androidx/compose/material3/compose-material-documentation.md b/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/compose-material-documentation.md
similarity index 100%
rename from compose/material3/material3/src/commonMain/androidx/compose/material3/compose-material-documentation.md
rename to compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/compose-material-documentation.md
diff --git a/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/tokens/ColorDark.kt b/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/tokens/ColorDark.kt
new file mode 100644
index 0000000..1fec7cb
--- /dev/null
+++ b/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/tokens/ColorDark.kt
@@ -0,0 +1,77 @@
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * 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.
+ */
+// GENERATED CODE - DO NOT MODIFY BY HAND
+
+package androidx.compose.material3.tokens
+
+internal object ColorDark {
+ val Background = Palette.Neutral900
+ val Error = Palette.Error200
+ val ErrorStateContent = Palette.Error200
+ val ErrorStateLayer = Error
+ val Hairline = Palette.NeutralVariant700
+ val InverseOnSurface = Palette.Neutral800
+ val InversePrimary = Palette.Primary600
+ val InversePrimaryStateContent = Palette.Primary700
+ val InversePrimaryStateLayer = Palette.Primary600
+ val InverseSurface = Palette.Neutral100
+ val OnBackground = Palette.Neutral100
+ val OnError = Palette.Error800
+ val OnErrorStateContent = OnError
+ val OnErrorStateLayer = Palette.Error50
+ val OnPrimary = Palette.Primary800
+ val OnPrimaryContainer = Palette.Primary100
+ val OnPrimaryContainerStateContent = OnPrimaryContainer
+ val OnPrimaryContainerStateLayer = OnPrimaryContainer
+ val OnPrimaryStateContent = OnPrimary
+ val OnPrimaryStateLayer = OnPrimary
+ val OnSecondary = Palette.Secondary800
+ val OnSecondaryContainer = Palette.Secondary100
+ val OnSecondaryContainerStateContent = OnSecondaryContainer
+ val OnSecondaryContainerStateLayer = OnSecondaryContainer
+ val OnSecondaryStateContent = OnSecondary
+ val OnSecondaryStateLayer = OnSecondary
+ val OnSurface = Palette.Neutral100
+ val OnSurfaceStateContent = Palette.Neutral100
+ val OnSurfaceStateLayer = OnSurface
+ val OnSurfaceVariant = Palette.NeutralVariant200
+ val OnSurfaceVariantStateContent = Palette.NeutralVariant200
+ val OnSurfaceVariantStateLayer = OnSurfaceVariant
+ val OnTertiaryContainer = Palette.Tertiary100
+ val OnTertiaryContainerStateContent = OnTertiaryContainer
+ val OnTertiaryContainerStateLayer = OnTertiaryContainer
+ val Outline = Palette.NeutralVariant400
+ val Primary = Palette.Primary200
+ val PrimaryContainer = Palette.Primary700
+ val PrimaryStateContent = Primary
+ val PrimaryStateLayer = Palette.Primary300
+ val PrimaryVariant = Primary
+ val Secondary = Palette.Secondary200
+ val SecondaryContainer = Palette.Secondary700
+ val SecondaryStateContent = Secondary
+ val SecondaryStateLayer = Palette.Secondary300
+ val SecondaryVariant = Secondary
+ val Shadow = Palette.Neutral1000
+ val Surface = Palette.Neutral900
+ val SurfaceVariant = Palette.NeutralVariant700
+ val TertiaryContainer = Palette.Tertiary700
+ val TextfieldError = Palette.Red200
+ val TextfieldHairline = Palette.Grey400
+ val TextfieldOnSurfaceVariant = Palette.Grey400
+ val TextfieldPrimary = Palette.Blue300
+ val TextfieldStateLayer = Palette.Grey100
+ val TextfieldSurface = Palette.Grey800
+}
diff --git a/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/tokens/ColorLight.kt b/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/tokens/ColorLight.kt
new file mode 100644
index 0000000..c54e194
--- /dev/null
+++ b/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/tokens/ColorLight.kt
@@ -0,0 +1,77 @@
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * 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.
+ */
+// GENERATED CODE - DO NOT MODIFY BY HAND
+
+package androidx.compose.material3.tokens
+
+internal object ColorLight {
+ val Background = Palette.Neutral0
+ val Error = Palette.Error500
+ val ErrorStateContent = Palette.Error800
+ val ErrorStateLayer = Error
+ val Hairline = Palette.NeutralVariant300
+ val InverseOnSurface = Palette.Neutral50
+ val InversePrimary = Palette.Primary200
+ val InversePrimaryStateContent = Palette.Primary200
+ val InversePrimaryStateLayer = Palette.Primary300
+ val InverseSurface = Palette.Neutral800
+ val OnBackground = Palette.Neutral900
+ val OnError = Palette.Error0
+ val OnErrorStateContent = OnError
+ val OnErrorStateLayer = Palette.Neutral900
+ val OnPrimary = Palette.Primary0
+ val OnPrimaryContainer = Palette.Primary900
+ val OnPrimaryContainerStateContent = OnPrimaryContainer
+ val OnPrimaryContainerStateLayer = OnPrimaryContainer
+ val OnPrimaryStateContent = OnPrimary
+ val OnPrimaryStateLayer = Palette.Primary900
+ val OnSecondary = Palette.Secondary0
+ val OnSecondaryContainer = Palette.Secondary900
+ val OnSecondaryContainerStateContent = OnSecondaryContainer
+ val OnSecondaryContainerStateLayer = OnSecondaryContainer
+ val OnSecondaryStateContent = OnSecondary
+ val OnSecondaryStateLayer = Palette.Secondary900
+ val OnSurface = Palette.Neutral900
+ val OnSurfaceStateContent = OnSurface
+ val OnSurfaceStateLayer = OnSurface
+ val OnSurfaceVariant = Palette.NeutralVariant700
+ val OnSurfaceVariantStateContent = OnSurfaceVariant
+ val OnSurfaceVariantStateLayer = OnSurfaceVariant
+ val OnTertiaryContainer = Palette.Tertiary900
+ val OnTertiaryContainerStateContent = OnTertiaryContainer
+ val OnTertiaryContainerStateLayer = OnTertiaryContainer
+ val Outline = Palette.NeutralVariant500
+ val Primary = Palette.Primary600
+ val PrimaryContainer = Palette.Primary100
+ val PrimaryStateContent = Palette.Primary700
+ val PrimaryStateLayer = Primary
+ val PrimaryVariant = Primary
+ val Secondary = Palette.Secondary600
+ val SecondaryContainer = Palette.Secondary100
+ val SecondaryStateContent = Palette.Secondary700
+ val SecondaryStateLayer = Secondary
+ val SecondaryVariant = Secondary
+ val Shadow = Palette.Neutral1000
+ val Surface = Palette.Neutral0
+ val SurfaceVariant = Palette.NeutralVariant100
+ val TertiaryContainer = Palette.Tertiary100
+ val TextfieldError = Palette.Red700
+ val TextfieldHairline = Palette.Grey600
+ val TextfieldOnSurfaceVariant = Palette.Grey700
+ val TextfieldPrimary = Palette.Blue700
+ val TextfieldStateLayer = Palette.Grey800
+ val TextfieldSurface = Palette.Grey100
+}
diff --git a/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/tokens/ColorSchemeKey.kt b/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/tokens/ColorSchemeKey.kt
new file mode 100644
index 0000000..5d41b56
--- /dev/null
+++ b/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/tokens/ColorSchemeKey.kt
@@ -0,0 +1,82 @@
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * 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.
+ */
+// GENERATED CODE - DO NOT MODIFY BY HAND
+
+package androidx.compose
+
+internal enum class ColorSchemeKey {
+ Background,
+ Error,
+ ErrorStateContent,
+ ErrorStateLayer,
+ Hairline,
+ InverseOnSurface,
+ InversePrimary,
+ InversePrimaryStateContent,
+ InversePrimaryStateLayer,
+ InverseSurface,
+ OnBackground,
+ OnError,
+ OnErrorStateContent,
+ OnErrorStateLayer,
+ OnPrimary,
+ OnPrimaryContainer,
+ OnPrimaryContainerStateContent,
+ OnPrimaryContainerStateLayer,
+ OnPrimaryStateContent,
+ OnPrimaryStateLayer,
+ OnSecondary,
+ OnSecondaryContainer,
+ OnSecondaryContainerStateContent,
+ OnSecondaryContainerStateLayer,
+ OnSecondaryStateContent,
+ OnSecondaryStateLayer,
+ OnSurface,
+ OnSurfaceStateContent,
+ OnSurfaceStateLayer,
+ OnSurfaceVariant,
+ OnSurfaceVariantStateContent,
+ OnSurfaceVariantStateLayer,
+ OnTertiaryContainer,
+ OnTertiaryContainerStateContent,
+ OnTertiaryContainerStateLayer,
+ Outline,
+ Primary,
+ PrimaryContainer,
+ PrimaryStateContent,
+ PrimaryStateLayer,
+ PrimaryVariant,
+ Secondary,
+ SecondaryContainer,
+ SecondaryStateContent,
+ SecondaryStateLayer,
+ SecondaryVariant,
+ Shadow,
+ Surface,
+ SurfaceVariant,
+ TertiaryContainer,
+ TextfieldError,
+ TextfieldHairline,
+ TextfieldOnSurfaceVariant,
+ TextfieldPrimary,
+ TextfieldStateLayer,
+ TextfieldSurface,
+ Surface1,
+ Surface2,
+ Surface3,
+ Surface4,
+ Surface5,
+}
\ No newline at end of file
diff --git a/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/tokens/Palette.kt b/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/tokens/Palette.kt
new file mode 100644
index 0000000..fec466b
--- /dev/null
+++ b/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/tokens/Palette.kt
@@ -0,0 +1,194 @@
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * 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.
+ */
+// GENERATED CODE - DO NOT MODIFY BY HAND
+
+package androidx.compose.material3.tokens
+
+import androidx.compose.ui.graphics.Color
+
+internal object Palette {
+ val Black = Color(0xFF000000)
+ val Blue0 = Color(0xFFffffff)
+ val Blue10 = Color(0xFFfafbff)
+ val Blue100 = Color(0xFFd3e3fd)
+ val Blue1000 = Color(0xFF000000)
+ val Blue200 = Color(0xFFa8c7fa)
+ val Blue300 = Color(0xFF7cacf8)
+ val Blue400 = Color(0xFF4c8df6)
+ val Blue50 = Color(0xFFecf3fe)
+ val Blue500 = Color(0xFF1b6ef3)
+ val Blue600 = Color(0xFF0b57d0)
+ val Blue700 = Color(0xFF0842a0)
+ val Blue800 = Color(0xFF062e6f)
+ val Blue900 = Color(0xFF041e49)
+ val BlueVariant0 = Color(0xFFffffff)
+ val BlueVariant10 = Color(0xFFf7fcff)
+ val BlueVariant100 = Color(0xFFc2e7ff)
+ val BlueVariant1000 = Color(0xFF000000)
+ val BlueVariant200 = Color(0xFF7fcfff)
+ val BlueVariant300 = Color(0xFF5ab3f0)
+ val BlueVariant400 = Color(0xFF3998d3)
+ val BlueVariant50 = Color(0xFFdff3ff)
+ val BlueVariant500 = Color(0xFF047db7)
+ val BlueVariant600 = Color(0xFF00639b)
+ val BlueVariant700 = Color(0xFF004a77)
+ val BlueVariant800 = Color(0xFF003355)
+ val BlueVariant900 = Color(0xFF001d35)
+ val Error0 = Color(0xFFffffff)
+ val Error10 = Color(0xFFfffbf9)
+ val Error100 = Color(0xFFf9dedc)
+ val Error1000 = Color(0xFF000000)
+ val Error200 = Color(0xFFf2b8b5)
+ val Error300 = Color(0xFFec928e)
+ val Error400 = Color(0xFFe46962)
+ val Error50 = Color(0xFFfceeee)
+ val Error500 = Color(0xFFdc362e)
+ val Error600 = Color(0xFFb3261e)
+ val Error700 = Color(0xFF8c1d18)
+ val Error800 = Color(0xFF601410)
+ val Error900 = Color(0xFF410e0b)
+ val Green0 = Color(0xFFffffff)
+ val Green10 = Color(0xFFf2ffee)
+ val Green100 = Color(0xFFc4eed0)
+ val Green1000 = Color(0xFF000000)
+ val Green200 = Color(0xFF6dd58c)
+ val Green300 = Color(0xFF37be5f)
+ val Green400 = Color(0xFF1ea446)
+ val Green50 = Color(0xFFe7f8ed)
+ val Green500 = Color(0xFF198639)
+ val Green600 = Color(0xFF146c2e)
+ val Green700 = Color(0xFF0f5223)
+ val Green800 = Color(0xFF0a3818)
+ val Green900 = Color(0xFF072711)
+ val Grey0 = Color(0xFFffffff)
+ val Grey10 = Color(0xFFfdfcfb)
+ val Grey100 = Color(0xFFe3e3e3)
+ val Grey1000 = Color(0xFF000000)
+ val Grey200 = Color(0xFFc7c7c7)
+ val Grey300 = Color(0xFFababab)
+ val Grey400 = Color(0xFF8f8f8f)
+ val Grey50 = Color(0xFFf2f2f2)
+ val Grey500 = Color(0xFF757575)
+ val Grey600 = Color(0xFF5e5e5e)
+ val Grey700 = Color(0xFF474747)
+ val Grey800 = Color(0xFF303030)
+ val Grey900 = Color(0xFF1f1f1f)
+ val GreyVariant0 = Color(0xFFffffff)
+ val GreyVariant10 = Color(0xFFfafdfb)
+ val GreyVariant100 = Color(0xFFe1e3e1)
+ val GreyVariant1000 = Color(0xFF000000)
+ val GreyVariant200 = Color(0xFFc4c7c5)
+ val GreyVariant300 = Color(0xFFa9acaa)
+ val GreyVariant400 = Color(0xFF8e918f)
+ val GreyVariant50 = Color(0xFFeff2ef)
+ val GreyVariant500 = Color(0xFF747775)
+ val GreyVariant600 = Color(0xFF5c5f5e)
+ val GreyVariant700 = Color(0xFF444746)
+ val GreyVariant800 = Color(0xFF2d312f)
+ val GreyVariant900 = Color(0xFF191d1c)
+ val Neutral0 = Color(0xFFffffff)
+ val Neutral10 = Color(0xFFfdfdf5)
+ val Neutral100 = Color(0xFFe2e3dc)
+ val Neutral1000 = Color(0xFF000000)
+ val Neutral200 = Color(0xFFc7c7c0)
+ val Neutral300 = Color(0xFFabaca5)
+ val Neutral400 = Color(0xFF90918c)
+ val Neutral50 = Color(0xFFf1f1eb)
+ val Neutral500 = Color(0xFF757771)
+ val Neutral600 = Color(0xFF5d5f5a)
+ val Neutral700 = Color(0xFF464743)
+ val Neutral800 = Color(0xFF2f312d)
+ val Neutral900 = Color(0xFF1a1c18)
+ val NeutralVariant0 = Color(0xFFffffff)
+ val NeutralVariant10 = Color(0xFFf9fef0)
+ val NeutralVariant100 = Color(0xFFe0e4d7)
+ val NeutralVariant1000 = Color(0xFF000000)
+ val NeutralVariant200 = Color(0xFFc4c8bb)
+ val NeutralVariant300 = Color(0xFFa7ada0)
+ val NeutralVariant400 = Color(0xFF8d9286)
+ val NeutralVariant50 = Color(0xFFeef3e4)
+ val NeutralVariant500 = Color(0xFF72786c)
+ val NeutralVariant600 = Color(0xFF5b6056)
+ val NeutralVariant700 = Color(0xFF43483e)
+ val NeutralVariant800 = Color(0xFF2d3228)
+ val NeutralVariant900 = Color(0xFF181d14)
+ val Primary0 = Color(0xFFffffff)
+ val Primary10 = Color(0xFFf6ffe8)
+ val Primary100 = Color(0xFFb7f397)
+ val Primary1000 = Color(0xFF000000)
+ val Primary200 = Color(0xFF9cd67e)
+ val Primary300 = Color(0xFF82ba65)
+ val Primary400 = Color(0xFF689e4d)
+ val Primary50 = Color(0xFFcdffac)
+ val Primary500 = Color(0xFF4e8335)
+ val Primary600 = Color(0xFF386a20)
+ val Primary700 = Color(0xFF205107)
+ val Primary800 = Color(0xFF0c3900)
+ val Primary900 = Color(0xFF042100)
+ val Red0 = Color(0xFFffffff)
+ val Red10 = Color(0xFFfffbf9)
+ val Red100 = Color(0xFFf9dedc)
+ val Red1000 = Color(0xFF000000)
+ val Red200 = Color(0xFFf2b8b5)
+ val Red300 = Color(0xFFec928e)
+ val Red400 = Color(0xFFe46962)
+ val Red50 = Color(0xFFfceeee)
+ val Red500 = Color(0xFFdc362e)
+ val Red600 = Color(0xFFb3261e)
+ val Red700 = Color(0xFF8c1d18)
+ val Red800 = Color(0xFF601410)
+ val Red900 = Color(0xFF410e0b)
+ val Secondary0 = Color(0xFFffffff)
+ val Secondary10 = Color(0xFFf6ffe8)
+ val Secondary100 = Color(0xFFd9e7cb)
+ val Secondary1000 = Color(0xFF000000)
+ val Secondary200 = Color(0xFFbdcbb0)
+ val Secondary300 = Color(0xFFa1b095)
+ val Secondary400 = Color(0xFF87957c)
+ val Secondary50 = Color(0xFFe7f5d8)
+ val Secondary500 = Color(0xFF6d7a63)
+ val Secondary600 = Color(0xFF55624c)
+ val Secondary700 = Color(0xFF3e4a36)
+ val Secondary800 = Color(0xFF273420)
+ val Secondary900 = Color(0xFF131f0d)
+ val Tertiary0 = Color(0xFFffffff)
+ val Tertiary10 = Color(0xFFefffff)
+ val Tertiary100 = Color(0xFFa8eff0)
+ val Tertiary1000 = Color(0xFF000000)
+ val Tertiary200 = Color(0xFF8cd3d4)
+ val Tertiary300 = Color(0xFF70b7b8)
+ val Tertiary400 = Color(0xFF559c9d)
+ val Tertiary50 = Color(0xFFb6fdfe)
+ val Tertiary500 = Color(0xFF388182)
+ val Tertiary600 = Color(0xFF19686a)
+ val Tertiary700 = Color(0xFF004f51)
+ val Tertiary800 = Color(0xFF003738)
+ val Tertiary900 = Color(0xFF002021)
+ val White = Color(0xFFffffff)
+ val Yellow0 = Color(0xFFffffff)
+ val Yellow10 = Color(0xFFfffbf0)
+ val Yellow100 = Color(0xFFffdf99)
+ val Yellow1000 = Color(0xFF000000)
+ val Yellow200 = Color(0xFFffbb29)
+ val Yellow300 = Color(0xFFf09d00)
+ val Yellow400 = Color(0xFFd68400)
+ val Yellow50 = Color(0xFFfff0d1)
+ val Yellow500 = Color(0xFFb26c00)
+ val Yellow600 = Color(0xFF945700)
+ val Yellow700 = Color(0xFF754200)
+ val Yellow800 = Color(0xFF562d00)
+ val Yellow900 = Color(0xFF421f00)
+}
diff --git a/compose/runtime/.idea/codeStyles/Project.xml b/compose/runtime/.idea/codeStyles/Project.xml
new file mode 120000
index 0000000..32e9847
--- /dev/null
+++ b/compose/runtime/.idea/codeStyles/Project.xml
@@ -0,0 +1 @@
+../../../../.idea/codeStyles/Project.xml
\ No newline at end of file
diff --git a/compose/runtime/.idea/codeStyles/codeStyleConfig.xml b/compose/runtime/.idea/codeStyles/codeStyleConfig.xml
new file mode 120000
index 0000000..873592ff
--- /dev/null
+++ b/compose/runtime/.idea/codeStyles/codeStyleConfig.xml
@@ -0,0 +1 @@
+../../../../.idea/codeStyles/codeStyleConfig.xml
\ No newline at end of file
diff --git a/compose/runtime/.idea/copyright/AndroidCopyright.xml b/compose/runtime/.idea/copyright/AndroidCopyright.xml
new file mode 120000
index 0000000..f9a587a
--- /dev/null
+++ b/compose/runtime/.idea/copyright/AndroidCopyright.xml
@@ -0,0 +1 @@
+../../../../.idea/copyright/AndroidCopyright.xml
\ No newline at end of file
diff --git a/compose/runtime/.idea/copyright/profiles_settings.xml b/compose/runtime/.idea/copyright/profiles_settings.xml
new file mode 120000
index 0000000..0b054ba
--- /dev/null
+++ b/compose/runtime/.idea/copyright/profiles_settings.xml
@@ -0,0 +1 @@
+../../../../.idea/copyright/profiles_settings.xml
\ No newline at end of file
diff --git a/compose/runtime/.idea/inspectionProfiles/Project_Default.xml b/compose/runtime/.idea/inspectionProfiles/Project_Default.xml
new file mode 120000
index 0000000..b8d649c
--- /dev/null
+++ b/compose/runtime/.idea/inspectionProfiles/Project_Default.xml
@@ -0,0 +1 @@
+../../../../.idea/inspectionProfiles/Project_Default.xml
\ No newline at end of file
diff --git a/compose/runtime/.idea/scopes/Ignore_API_Files.xml b/compose/runtime/.idea/scopes/Ignore_API_Files.xml
new file mode 120000
index 0000000..009eced
--- /dev/null
+++ b/compose/runtime/.idea/scopes/Ignore_API_Files.xml
@@ -0,0 +1 @@
+../../../../.idea/scopes/Ignore_API_Files.xml
\ No newline at end of file
diff --git a/compose/runtime/.idea/scopes/buildSrc.xml b/compose/runtime/.idea/scopes/buildSrc.xml
new file mode 120000
index 0000000..a4d6cbd
--- /dev/null
+++ b/compose/runtime/.idea/scopes/buildSrc.xml
@@ -0,0 +1 @@
+../../../../.idea/scopes/buildSrc.xml
\ No newline at end of file
diff --git a/compose/runtime/buildSrc b/compose/runtime/buildSrc
new file mode 120000
index 0000000..da68aba
--- /dev/null
+++ b/compose/runtime/buildSrc
@@ -0,0 +1 @@
+../../buildSrc
\ No newline at end of file
diff --git a/compose/runtime/gradle b/compose/runtime/gradle
new file mode 120000
index 0000000..27b2e9c
--- /dev/null
+++ b/compose/runtime/gradle
@@ -0,0 +1 @@
+../../playground-common/gradle
\ No newline at end of file
diff --git a/compose/runtime/gradle.properties b/compose/runtime/gradle.properties
new file mode 120000
index 0000000..bbd5978
--- /dev/null
+++ b/compose/runtime/gradle.properties
@@ -0,0 +1 @@
+../../playground-common/androidx-shared.properties
\ No newline at end of file
diff --git a/compose/runtime/gradlew b/compose/runtime/gradlew
new file mode 120000
index 0000000..d9f055c
--- /dev/null
+++ b/compose/runtime/gradlew
@@ -0,0 +1 @@
+../../playground-common/gradlew
\ No newline at end of file
diff --git a/compose/runtime/gradlew.bat b/compose/runtime/gradlew.bat
new file mode 120000
index 0000000..c35bc92
--- /dev/null
+++ b/compose/runtime/gradlew.bat
@@ -0,0 +1 @@
+../../playground-common/gradlew.bat
\ No newline at end of file
diff --git a/compose/runtime/runtime-lint/build.gradle b/compose/runtime/runtime-lint/build.gradle
index bd68015..0e2bd51 100644
--- a/compose/runtime/runtime-lint/build.gradle
+++ b/compose/runtime/runtime-lint/build.gradle
@@ -29,9 +29,9 @@
dependencies {
compileOnly(libs.androidLintMinComposeApi)
compileOnly(libs.kotlinStdlib)
- bundleInside(project(":compose:lint:common"))
+ bundleInside(projectOrArtifact(":compose:lint:common"))
- testImplementation(project(":compose:lint:common-test"))
+ testImplementation(projectOrArtifact(":compose:lint:common-test"))
testImplementation(libs.kotlinStdlib)
testImplementation(libs.androidLint)
testImplementation(libs.androidLintTests)
diff --git a/compose/runtime/runtime-lint/src/main/java/androidx/compose/runtime/lint/RuntimeIssueRegistry.kt b/compose/runtime/runtime-lint/src/main/java/androidx/compose/runtime/lint/RuntimeIssueRegistry.kt
index 842aa7c..7e32f82 100644
--- a/compose/runtime/runtime-lint/src/main/java/androidx/compose/runtime/lint/RuntimeIssueRegistry.kt
+++ b/compose/runtime/runtime-lint/src/main/java/androidx/compose/runtime/lint/RuntimeIssueRegistry.kt
@@ -27,7 +27,7 @@
*/
class RuntimeIssueRegistry : IssueRegistry() {
// Tests are run with this version. We ensure that with ApiLintVersionsTest
- override val api = 10
+ override val api = 11
override val minApi = CURRENT_API
override val issues get() = listOf(
ComposableCoroutineCreationDetector.CoroutineCreationDuringComposition,
diff --git a/compose/runtime/runtime-lint/src/test/java/androidx/compose/runtime/lint/ComposableCoroutineCreationDetectorTest.kt b/compose/runtime/runtime-lint/src/test/java/androidx/compose/runtime/lint/ComposableCoroutineCreationDetectorTest.kt
index b428009..c921e890 100644
--- a/compose/runtime/runtime-lint/src/test/java/androidx/compose/runtime/lint/ComposableCoroutineCreationDetectorTest.kt
+++ b/compose/runtime/runtime-lint/src/test/java/androidx/compose/runtime/lint/ComposableCoroutineCreationDetectorTest.kt
@@ -22,6 +22,7 @@
import androidx.compose.lint.test.compiledStub
import com.android.tools.lint.checks.infrastructure.LintDetectorTest
import com.android.tools.lint.checks.infrastructure.TestFile
+import com.android.tools.lint.checks.infrastructure.TestMode
import com.android.tools.lint.detector.api.Detector
import com.android.tools.lint.detector.api.Issue
import org.junit.Test
@@ -155,6 +156,7 @@
Stubs.Composable,
coroutineBuildersStub
)
+ .skipTestModes(TestMode.TYPE_ALIAS)
.run()
.expect(
"""
diff --git a/compose/runtime/runtime-lint/src/test/java/androidx/compose/runtime/lint/ComposableFlowOperatorDetectorTest.kt b/compose/runtime/runtime-lint/src/test/java/androidx/compose/runtime/lint/ComposableFlowOperatorDetectorTest.kt
index 248ba1a..2e48806 100644
--- a/compose/runtime/runtime-lint/src/test/java/androidx/compose/runtime/lint/ComposableFlowOperatorDetectorTest.kt
+++ b/compose/runtime/runtime-lint/src/test/java/androidx/compose/runtime/lint/ComposableFlowOperatorDetectorTest.kt
@@ -22,6 +22,7 @@
import androidx.compose.lint.test.compiledStub
import com.android.tools.lint.checks.infrastructure.LintDetectorTest
import com.android.tools.lint.checks.infrastructure.TestFile
+import com.android.tools.lint.checks.infrastructure.TestMode
import com.android.tools.lint.detector.api.Detector
import com.android.tools.lint.detector.api.Issue
import org.junit.Test
@@ -191,6 +192,7 @@
Stubs.Composable,
flowStub
)
+ .skipTestModes(TestMode.TYPE_ALIAS)
.run()
.expect(
"""
diff --git a/compose/runtime/runtime-lint/src/test/java/androidx/compose/runtime/lint/ComposableLambdaParameterDetectorTest.kt b/compose/runtime/runtime-lint/src/test/java/androidx/compose/runtime/lint/ComposableLambdaParameterDetectorTest.kt
index 44f5639..463830d 100644
--- a/compose/runtime/runtime-lint/src/test/java/androidx/compose/runtime/lint/ComposableLambdaParameterDetectorTest.kt
+++ b/compose/runtime/runtime-lint/src/test/java/androidx/compose/runtime/lint/ComposableLambdaParameterDetectorTest.kt
@@ -20,6 +20,7 @@
import androidx.compose.lint.test.Stubs
import com.android.tools.lint.checks.infrastructure.LintDetectorTest
+import com.android.tools.lint.checks.infrastructure.TestMode
import com.android.tools.lint.detector.api.Detector
import com.android.tools.lint.detector.api.Issue
import org.junit.Test
@@ -57,6 +58,7 @@
),
Stubs.Composable
)
+ .skipTestModes(TestMode.TYPE_ALIAS)
.run()
.expect(
"""
@@ -93,6 +95,7 @@
),
Stubs.Composable
)
+ .skipTestModes(TestMode.TYPE_ALIAS)
.run()
.expect(
"""
@@ -121,6 +124,7 @@
),
Stubs.Composable
)
+ .skipTestModes(TestMode.TYPE_ALIAS)
.run()
.expect(
"""
@@ -226,6 +230,7 @@
),
Stubs.Composable
)
+ .skipTestModes(TestMode.TYPE_ALIAS)
.run()
.expect(
"""
diff --git a/compose/runtime/runtime-lint/src/test/java/androidx/compose/runtime/lint/UnrememberedMutableStateDetectorTest.kt b/compose/runtime/runtime-lint/src/test/java/androidx/compose/runtime/lint/UnrememberedMutableStateDetectorTest.kt
index 1a307c6..422709f 100644
--- a/compose/runtime/runtime-lint/src/test/java/androidx/compose/runtime/lint/UnrememberedMutableStateDetectorTest.kt
+++ b/compose/runtime/runtime-lint/src/test/java/androidx/compose/runtime/lint/UnrememberedMutableStateDetectorTest.kt
@@ -20,6 +20,7 @@
import androidx.compose.lint.test.Stubs
import com.android.tools.lint.checks.infrastructure.LintDetectorTest
+import com.android.tools.lint.checks.infrastructure.TestMode
import com.android.tools.lint.detector.api.Detector
import com.android.tools.lint.detector.api.Issue
import org.junit.Test
@@ -111,6 +112,7 @@
Stubs.MutableState,
Stubs.Remember
)
+ .skipTestModes(TestMode.TYPE_ALIAS)
.run()
.expect(
"""
diff --git a/compose/runtime/runtime-livedata/build.gradle b/compose/runtime/runtime-livedata/build.gradle
index 571700c..0ae4cea 100644
--- a/compose/runtime/runtime-livedata/build.gradle
+++ b/compose/runtime/runtime-livedata/build.gradle
@@ -26,7 +26,7 @@
}
dependencies {
- kotlinPlugin(project(":compose:compiler:compiler"))
+ kotlinPlugin(projectOrArtifact(":compose:compiler:compiler"))
implementation(libs.kotlinStdlib)
@@ -34,8 +34,8 @@
api("androidx.lifecycle:lifecycle-livedata:2.2.0")
implementation("androidx.compose.ui:ui:1.0.0")
- androidTestImplementation(project(":compose:ui:ui-test-junit4"))
- androidTestImplementation(project(":compose:test-utils"))
+ androidTestImplementation(projectOrArtifact(":compose:ui:ui-test-junit4"))
+ androidTestImplementation(projectOrArtifact(":compose:test-utils"))
androidTestImplementation(libs.testRunner)
androidTestImplementation(libs.junit)
androidTestImplementation(libs.truth)
diff --git a/compose/runtime/runtime-livedata/samples/build.gradle b/compose/runtime/runtime-livedata/samples/build.gradle
index 7ed3f26..d1a1739 100644
--- a/compose/runtime/runtime-livedata/samples/build.gradle
+++ b/compose/runtime/runtime-livedata/samples/build.gradle
@@ -26,13 +26,13 @@
}
dependencies {
- kotlinPlugin(project(":compose:compiler:compiler"))
+ kotlinPlugin(projectOrArtifact(":compose:compiler:compiler"))
implementation(libs.kotlinStdlib)
- compileOnly(project(":annotation:annotation-sampled"))
+ compileOnly(projectOrArtifact(":annotation:annotation-sampled"))
implementation("androidx.compose.foundation:foundation:1.0.0")
implementation("androidx.compose.material:material:1.0.0")
- implementation(project(":compose:runtime:runtime-livedata"))
+ implementation(projectOrArtifact(":compose:runtime:runtime-livedata"))
}
androidx {
diff --git a/compose/runtime/runtime-rxjava2/build.gradle b/compose/runtime/runtime-rxjava2/build.gradle
index a5299b3..0b781ff 100644
--- a/compose/runtime/runtime-rxjava2/build.gradle
+++ b/compose/runtime/runtime-rxjava2/build.gradle
@@ -26,15 +26,15 @@
}
dependencies {
- kotlinPlugin(project(":compose:compiler:compiler"))
+ kotlinPlugin(projectOrArtifact(":compose:compiler:compiler"))
implementation(libs.kotlinStdlib)
api(project(":compose:runtime:runtime"))
api(libs.rxjava2)
- androidTestImplementation(project(":compose:ui:ui-test-junit4"))
- androidTestImplementation(project(":compose:test-utils"))
+ androidTestImplementation(projectOrArtifact(":compose:ui:ui-test-junit4"))
+ androidTestImplementation(projectOrArtifact(":compose:test-utils"))
androidTestImplementation(libs.testRunner)
androidTestImplementation(libs.junit)
androidTestImplementation(libs.truth)
diff --git a/compose/runtime/runtime-rxjava2/samples/build.gradle b/compose/runtime/runtime-rxjava2/samples/build.gradle
index ba79184..d451505 100644
--- a/compose/runtime/runtime-rxjava2/samples/build.gradle
+++ b/compose/runtime/runtime-rxjava2/samples/build.gradle
@@ -26,13 +26,13 @@
}
dependencies {
- kotlinPlugin(project(":compose:compiler:compiler"))
+ kotlinPlugin(projectOrArtifact(":compose:compiler:compiler"))
implementation(libs.kotlinStdlib)
- compileOnly(project(":annotation:annotation-sampled"))
+ compileOnly(projectOrArtifact(":annotation:annotation-sampled"))
implementation("androidx.compose.foundation:foundation:1.0.0")
implementation("androidx.compose.material:material:1.0.0")
- implementation(project(":compose:runtime:runtime-rxjava2"))
+ implementation(projectOrArtifact(":compose:runtime:runtime-rxjava2"))
}
androidx {
diff --git a/compose/runtime/runtime-rxjava3/build.gradle b/compose/runtime/runtime-rxjava3/build.gradle
index 3ac8f8c5..f63fc46 100644
--- a/compose/runtime/runtime-rxjava3/build.gradle
+++ b/compose/runtime/runtime-rxjava3/build.gradle
@@ -26,15 +26,15 @@
}
dependencies {
- kotlinPlugin(project(":compose:compiler:compiler"))
+ kotlinPlugin(projectOrArtifact(":compose:compiler:compiler"))
implementation(libs.kotlinStdlib)
api(project(":compose:runtime:runtime"))
api(libs.rxjava3)
- androidTestImplementation(project(":compose:ui:ui-test-junit4"))
- androidTestImplementation(project(":compose:test-utils"))
+ androidTestImplementation(projectOrArtifact(":compose:ui:ui-test-junit4"))
+ androidTestImplementation(projectOrArtifact(":compose:test-utils"))
androidTestImplementation(libs.testRunner)
androidTestImplementation(libs.junit)
androidTestImplementation(libs.truth)
diff --git a/compose/runtime/runtime-rxjava3/samples/build.gradle b/compose/runtime/runtime-rxjava3/samples/build.gradle
index 5580e54..2c9f9ec 100644
--- a/compose/runtime/runtime-rxjava3/samples/build.gradle
+++ b/compose/runtime/runtime-rxjava3/samples/build.gradle
@@ -26,13 +26,13 @@
}
dependencies {
- kotlinPlugin(project(":compose:compiler:compiler"))
+ kotlinPlugin(projectOrArtifact(":compose:compiler:compiler"))
implementation(libs.kotlinStdlib)
- compileOnly(project(":annotation:annotation-sampled"))
+ compileOnly(projectOrArtifact(":annotation:annotation-sampled"))
implementation("androidx.compose.foundation:foundation:1.0.0")
implementation("androidx.compose.material:material:1.0.0")
- implementation(project(":compose:runtime:runtime-rxjava3"))
+ implementation(projectOrArtifact(":compose:runtime:runtime-rxjava3"))
}
androidx {
diff --git a/compose/runtime/runtime-saveable-lint/build.gradle b/compose/runtime/runtime-saveable-lint/build.gradle
index 37c4b6f..ce48943 100644
--- a/compose/runtime/runtime-saveable-lint/build.gradle
+++ b/compose/runtime/runtime-saveable-lint/build.gradle
@@ -29,9 +29,9 @@
dependencies {
compileOnly(libs.androidLintMinComposeApi)
compileOnly(libs.kotlinStdlib)
- bundleInside(project(":compose:lint:common"))
+ bundleInside(projectOrArtifact(":compose:lint:common"))
- testImplementation(project(":compose:lint:common-test"))
+ testImplementation(projectOrArtifact(":compose:lint:common-test"))
testImplementation(libs.kotlinStdlib)
testImplementation(libs.androidLint)
testImplementation(libs.androidLintTests)
diff --git a/compose/runtime/runtime-saveable-lint/src/main/java/androidx/compose/runtime/saveable/lint/RuntimeSaveableIssueRegistry.kt b/compose/runtime/runtime-saveable-lint/src/main/java/androidx/compose/runtime/saveable/lint/RuntimeSaveableIssueRegistry.kt
index ada42a3..67dd009 100644
--- a/compose/runtime/runtime-saveable-lint/src/main/java/androidx/compose/runtime/saveable/lint/RuntimeSaveableIssueRegistry.kt
+++ b/compose/runtime/runtime-saveable-lint/src/main/java/androidx/compose/runtime/saveable/lint/RuntimeSaveableIssueRegistry.kt
@@ -27,7 +27,7 @@
*/
class RuntimeSaveableIssueRegistry : IssueRegistry() {
// Tests are run with this version. We ensure that with ApiLintVersionsTest
- override val api = 10
+ override val api = 11
override val minApi = CURRENT_API
override val issues get() = listOf(
RememberSaveableDetector.RememberSaveableSaverParameter
diff --git a/compose/runtime/runtime-saveable/build.gradle b/compose/runtime/runtime-saveable/build.gradle
index e5fcce5..1743df4 100644
--- a/compose/runtime/runtime-saveable/build.gradle
+++ b/compose/runtime/runtime-saveable/build.gradle
@@ -28,7 +28,7 @@
AndroidXComposePlugin.applyAndConfigureKotlinPlugin(project)
dependencies {
- kotlinPlugin project(":compose:compiler:compiler")
+ kotlinPlugin projectOrArtifact(":compose:compiler:compiler")
if(!AndroidXComposePlugin.isMultiplatformEnabled(project)) {
/* When updating dependencies, make sure to make the an an analogous update in the
@@ -43,11 +43,11 @@
testImplementation(libs.testCore)
testImplementation(libs.testRules)
- androidTestImplementation project(':compose:ui:ui')
- androidTestImplementation project(":compose:ui:ui-test-junit4")
- androidTestImplementation project(":compose:test-utils")
+ androidTestImplementation projectOrArtifact(':compose:ui:ui')
+ androidTestImplementation projectOrArtifact(":compose:ui:ui-test-junit4")
+ androidTestImplementation projectOrArtifact(":compose:test-utils")
androidTestImplementation "androidx.fragment:fragment:1.3.0"
- androidTestImplementation project(":activity:activity-compose")
+ androidTestImplementation projectOrArtifact(":activity:activity-compose")
androidTestImplementation(libs.testUiautomator)
androidTestImplementation(libs.testCore)
androidTestImplementation(libs.testRules)
diff --git a/compose/runtime/runtime-saveable/samples/build.gradle b/compose/runtime/runtime-saveable/samples/build.gradle
index ac95521..7706813 100644
--- a/compose/runtime/runtime-saveable/samples/build.gradle
+++ b/compose/runtime/runtime-saveable/samples/build.gradle
@@ -26,14 +26,14 @@
}
dependencies {
- kotlinPlugin project(":compose:compiler:compiler")
+ kotlinPlugin projectOrArtifact(":compose:compiler:compiler")
implementation(libs.kotlinStdlib)
- compileOnly project(":annotation:annotation-sampled")
+ compileOnly projectOrArtifact(":annotation:annotation-sampled")
- implementation project(":compose:foundation:foundation")
- implementation project(":compose:material:material")
+ implementation projectOrArtifact(":compose:foundation:foundation")
+ implementation projectOrArtifact(":compose:material:material")
implementation project(":compose:runtime:runtime")
implementation project(":compose:runtime:runtime-saveable")
}
diff --git a/compose/runtime/runtime/build.gradle b/compose/runtime/runtime/build.gradle
index ea291db..4a85e73 100644
--- a/compose/runtime/runtime/build.gradle
+++ b/compose/runtime/runtime/build.gradle
@@ -29,7 +29,7 @@
AndroidXComposePlugin.applyAndConfigureKotlinPlugin(project)
dependencies {
- kotlinPlugin(project(":compose:compiler:compiler"))
+ kotlinPlugin(projectOrArtifact(":compose:compiler:compiler"))
if(!AndroidXComposePlugin.isMultiplatformEnabled(project)) {
/*
@@ -54,8 +54,8 @@
androidTestImplementation(libs.junit)
androidTestImplementation(libs.truth)
- lintChecks(project(":compose:runtime:runtime-lint"))
- lintPublish(project(":compose:runtime:runtime-lint"))
+ lintChecks(projectOrArtifact(":compose:runtime:runtime-lint"))
+ lintPublish(projectOrArtifact(":compose:runtime:runtime-lint"))
}
}
diff --git a/compose/runtime/runtime/compose-runtime-benchmark/build.gradle b/compose/runtime/runtime/compose-runtime-benchmark/build.gradle
index de24070..a569c881 100644
--- a/compose/runtime/runtime/compose-runtime-benchmark/build.gradle
+++ b/compose/runtime/runtime/compose-runtime-benchmark/build.gradle
@@ -31,16 +31,16 @@
}
dependencies {
- kotlinPlugin(project(":compose:compiler:compiler"))
+ kotlinPlugin(projectOrArtifact(":compose:compiler:compiler"))
- androidTestImplementation(project(":compose:ui:ui"))
- androidTestImplementation(project(":compose:ui:ui-test-junit4"))
- androidTestImplementation(project(":compose:foundation:foundation"))
- androidTestImplementation(project(":compose:foundation:foundation-layout"))
- androidTestImplementation(project(":compose:material:material"))
- androidTestImplementation(project(":compose:runtime:runtime"))
- androidTestImplementation(project(":compose:ui:ui-text"))
- androidTestImplementation(project(":compose:ui:ui-util"))
+ androidTestImplementation(projectOrArtifact(":compose:ui:ui"))
+ androidTestImplementation(projectOrArtifact(":compose:ui:ui-test-junit4"))
+ androidTestImplementation(projectOrArtifact(":compose:foundation:foundation"))
+ androidTestImplementation(projectOrArtifact(":compose:foundation:foundation-layout"))
+ androidTestImplementation(projectOrArtifact(":compose:material:material"))
+ androidTestImplementation(projectOrArtifact(":compose:runtime:runtime"))
+ androidTestImplementation(projectOrArtifact(":compose:ui:ui-text"))
+ androidTestImplementation(projectOrArtifact(":compose:ui:ui-util"))
androidTestImplementation(libs.junit)
androidTestImplementation(libs.testExtJunit)
@@ -49,11 +49,11 @@
androidTestImplementation(libs.testRules)
androidTestImplementation(libs.kotlinStdlib)
androidTestImplementation(libs.kotlinReflect)
- androidTestImplementation(project(":benchmark:benchmark-junit4"))
+ androidTestImplementation(projectOrArtifact(":benchmark:benchmark-junit4"))
androidTestImplementation("androidx.activity:activity:1.2.0")
- androidTestImplementation(project(":activity:activity-compose"))
+ androidTestImplementation(projectOrArtifact(":activity:activity-compose"))
}
androidx {
benchmarkRunAlsoInterpreted = true
-}
\ No newline at end of file
+}
diff --git a/compose/runtime/runtime/compose-runtime-benchmark/src/androidTest/AndroidManifest.xml b/compose/runtime/runtime/compose-runtime-benchmark/src/androidTest/AndroidManifest.xml
index 0eb4313..7622f47 100644
--- a/compose/runtime/runtime/compose-runtime-benchmark/src/androidTest/AndroidManifest.xml
+++ b/compose/runtime/runtime/compose-runtime-benchmark/src/androidTest/AndroidManifest.xml
@@ -16,16 +16,9 @@
-->
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:tools="http://schemas.android.com/tools"
package="androidx.compose.runtime.benchmark">
- <!--
- ~ Important: disable debuggable for accurate performance results
- -->
- <application
- android:debuggable="false"
- tools:replace="android:debuggable">
- <!-- enable profileableByShell for non-intrusive profiling tools -->
- <!--suppress AndroidElementNotAllowed -->
+ <application>
+ <!-- enable profiling by shell for non-intrusive profiling tools -->
<profileable android:shell="true"/>
<activity
diff --git a/compose/runtime/runtime/integration-tests/build.gradle b/compose/runtime/runtime/integration-tests/build.gradle
index 65a8c1d..d26ace2 100644
--- a/compose/runtime/runtime/integration-tests/build.gradle
+++ b/compose/runtime/runtime/integration-tests/build.gradle
@@ -27,14 +27,14 @@
AndroidXComposePlugin.applyAndConfigureKotlinPlugin(project)
dependencies {
- kotlinPlugin(project(":compose:compiler:compiler"))
+ kotlinPlugin(projectOrArtifact(":compose:compiler:compiler"))
if(!AndroidXComposePlugin.isMultiplatformEnabled(project)) {
- androidTestImplementation(project(":compose:ui:ui"))
- androidTestImplementation(project(":compose:ui:ui-test-junit4"))
+ androidTestImplementation(projectOrArtifact(":compose:ui:ui"))
+ androidTestImplementation(projectOrArtifact(":compose:ui:ui-test-junit4"))
androidTestImplementation(project(":compose:runtime:runtime"))
- androidTestImplementation(project(":compose:test-utils"))
- androidTestImplementation(project(":activity:activity-compose"))
+ androidTestImplementation(projectOrArtifact(":compose:test-utils"))
+ androidTestImplementation(projectOrArtifact(":activity:activity-compose"))
androidTestImplementation(libs.junit)
androidTestImplementation(libs.kotlinTestJunit)
@@ -61,7 +61,7 @@
commonMain.dependencies {
implementation(libs.kotlinStdlibCommon)
implementation(libs.kotlinCoroutinesCore)
- implementation(project(":compose:ui:ui"))
+ implementation(projectOrArtifact(":compose:ui:ui"))
}
jvmMain.dependencies {
implementation(libs.kotlinStdlib)
@@ -87,10 +87,10 @@
implementation(kotlin("test-junit"))
}
androidAndroidTest.dependencies {
- implementation(project(":compose:ui:ui"))
- implementation(project(":compose:ui:ui-test-junit4"))
- implementation(project(":compose:test-utils"))
- implementation(project(":activity:activity-compose"))
+ implementation(projectOrArtifact(":compose:ui:ui"))
+ implementation(projectOrArtifact(":compose:ui:ui-test-junit4"))
+ implementation(projectOrArtifact(":compose:test-utils"))
+ implementation(projectOrArtifact(":activity:activity-compose"))
implementation(libs.testExtJunit)
implementation(libs.testRules)
implementation(libs.testRunner)
diff --git a/compose/runtime/runtime/samples/build.gradle b/compose/runtime/runtime/samples/build.gradle
index 1c32eb2..f1304c2 100644
--- a/compose/runtime/runtime/samples/build.gradle
+++ b/compose/runtime/runtime/samples/build.gradle
@@ -26,11 +26,11 @@
}
dependencies {
- kotlinPlugin(project(":compose:compiler:compiler"))
+ kotlinPlugin(projectOrArtifact(":compose:compiler:compiler"))
implementation(libs.kotlinStdlib)
- compileOnly(project(":annotation:annotation-sampled"))
+ compileOnly(projectOrArtifact(":annotation:annotation-sampled"))
implementation("androidx.compose.foundation:foundation-layout:1.0.0")
implementation("androidx.compose.material:material:1.0.0")
implementation(project(":compose:runtime:runtime"))
diff --git a/compose/runtime/runtime/src/commonMain/kotlin/androidx/compose/runtime/ComposeVersion.kt b/compose/runtime/runtime/src/commonMain/kotlin/androidx/compose/runtime/ComposeVersion.kt
index 3c2b1fb..87b346a 100644
--- a/compose/runtime/runtime/src/commonMain/kotlin/androidx/compose/runtime/ComposeVersion.kt
+++ b/compose/runtime/runtime/src/commonMain/kotlin/androidx/compose/runtime/ComposeVersion.kt
@@ -28,5 +28,5 @@
* IMPORTANT: Whenever updating this value, please make sure to also update `versionTable` and
* `minimumRuntimeVersionInt` in `VersionChecker.kt` of the compiler.
*/
- const val version: Int = 4100
+ const val version: Int = 4200
}
diff --git a/compose/runtime/settings.gradle b/compose/runtime/settings.gradle
new file mode 100644
index 0000000..a76317c
--- /dev/null
+++ b/compose/runtime/settings.gradle
@@ -0,0 +1,12 @@
+rootProject.name = "compose-runtime"
+apply from: "../../playground-common/playground-include-settings.gradle"
+setupPlayground(this, "../..")
+
+selectProjectsFromAndroidX({ name ->
+ if (name.startsWith(":compose:runtime") && name != ":compose:runtime") return true
+ if (name == ":annotation:annotation-sampled") return true
+ if (isNeededForComposePlayground(name)) return true
+ return false
+})
+
+
diff --git a/compose/test-utils/build.gradle b/compose/test-utils/build.gradle
index 0af2b73..a52af54 100644
--- a/compose/test-utils/build.gradle
+++ b/compose/test-utils/build.gradle
@@ -36,7 +36,7 @@
api("androidx.activity:activity:1.2.0")
api(projectOrArtifact(":compose:ui:ui-test-junit4"))
- api(project(":test:screenshot:test-screenshot"))
+ api(project(":test:screenshot:screenshot"))
implementation(libs.kotlinStdlibCommon)
implementation(projectOrArtifact(":compose:runtime:runtime"))
@@ -77,7 +77,7 @@
api("androidx.activity:activity:1.2.0")
implementation project(":activity:activity-compose")
api(projectOrArtifact(":compose:ui:ui-test-junit4"))
- api(project(":test:screenshot:test-screenshot"))
+ api(project(":test:screenshot:screenshot"))
// This has stub APIs for access to legacy Android APIs, so we don't want
// any dependency on this module.
compileOnly(projectOrArtifact(":compose:ui:ui-android-stubs"))
diff --git a/compose/test-utils/lint-baseline.xml b/compose/test-utils/lint-baseline.xml
new file mode 100644
index 0000000..75d53c0
--- /dev/null
+++ b/compose/test-utils/lint-baseline.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<issues format="6" by="lint 7.1.0-dev" type="baseline" client="gradle" dependencies="false" name="AGP (7.1.0-dev)" variant="all" version="7.1.0-dev">
+
+ <issue
+ id="VisibleForTests"
+ message="This method should only be accessed from tests or within private scope"
+ errorLine1=" view = findViewRootForTest(activity)!!.view"
+ errorLine2=" ~~~~">
+ <location
+ file="src/androidMain/kotlin/androidx/compose/testutils/AndroidComposeTestCaseRunner.android.kt"
+ line="126"
+ column="48"/>
+ </issue>
+
+</issues>
diff --git a/compose/test-utils/src/commonMain/kotlin/androidx/compose/testutils/TestViewConfiguration.kt b/compose/test-utils/src/commonMain/kotlin/androidx/compose/testutils/TestViewConfiguration.kt
index 64f01f6..b7f339bd 100644
--- a/compose/test-utils/src/commonMain/kotlin/androidx/compose/testutils/TestViewConfiguration.kt
+++ b/compose/test-utils/src/commonMain/kotlin/androidx/compose/testutils/TestViewConfiguration.kt
@@ -20,6 +20,7 @@
import androidx.compose.runtime.CompositionLocalProvider
import androidx.compose.ui.platform.LocalViewConfiguration
import androidx.compose.ui.platform.ViewConfiguration
+import androidx.compose.ui.unit.DpSize
/**
* A [ViewConfiguration] that can be used for testing. The default values are representative for
@@ -35,7 +36,8 @@
override val longPressTimeoutMillis: Long = 500L,
override val doubleTapTimeoutMillis: Long = 300L,
override val doubleTapMinTimeMillis: Long = 40L,
- override val touchSlop: Float = 18f
+ override val touchSlop: Float = 18f,
+ override val minimumTouchTargetSize: DpSize = DpSize.Zero
) : ViewConfiguration
@Composable
diff --git a/compose/ui/ui-graphics-lint/src/main/java/androidx/compose/ui/graphics/lint/UiGraphicsIssueRegistry.kt b/compose/ui/ui-graphics-lint/src/main/java/androidx/compose/ui/graphics/lint/UiGraphicsIssueRegistry.kt
index 6b90727..2ea0ed4 100644
--- a/compose/ui/ui-graphics-lint/src/main/java/androidx/compose/ui/graphics/lint/UiGraphicsIssueRegistry.kt
+++ b/compose/ui/ui-graphics-lint/src/main/java/androidx/compose/ui/graphics/lint/UiGraphicsIssueRegistry.kt
@@ -25,7 +25,7 @@
*/
class UiGraphicsIssueRegistry : IssueRegistry() {
// Tests are run with this version. We ensure that with ApiLintVersionsTest
- override val api = 10
+ override val api = 11
override val minApi = CURRENT_API
override val issues get() = listOf(
ColorDetector.MissingColorAlphaChannel,
diff --git a/compose/ui/ui-graphics/benchmark/build.gradle b/compose/ui/ui-graphics/benchmark/build.gradle
index 9670e0f..90bdbca 100644
--- a/compose/ui/ui-graphics/benchmark/build.gradle
+++ b/compose/ui/ui-graphics/benchmark/build.gradle
@@ -32,6 +32,5 @@
implementation(libs.kotlinStdlib)
androidTestImplementation project(":benchmark:benchmark-junit4")
- androidTestImplementation project(":benchmark:benchmark-macro-junit4")
androidTestImplementation(libs.testRules)
}
diff --git a/compose/ui/ui-graphics/benchmark/src/androidTest/AndroidManifest.xml b/compose/ui/ui-graphics/benchmark/src/androidTest/AndroidManifest.xml
index b5d6704..33d38e6 100644
--- a/compose/ui/ui-graphics/benchmark/src/androidTest/AndroidManifest.xml
+++ b/compose/ui/ui-graphics/benchmark/src/androidTest/AndroidManifest.xml
@@ -15,17 +15,9 @@
~ limitations under the License.
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:tools="http://schemas.android.com/tools"
package="androidx.compose.ui.graphics.benchmark">
-
- <!--
- ~ Important: disable debuggable for accurate performance results
- -->
- <application
- android:debuggable="false"
- tools:replace="android:debuggable">
- <!-- enable profileableByShell for non-intrusive profiling tools -->
- <!--suppress AndroidElementNotAllowed -->
+ <application>
+ <!-- enable profiling by shell for non-intrusive profiling tools -->
<profileable android:shell="true"/>
</application>
</manifest>
diff --git a/compose/ui/ui-graphics/benchmark/src/androidTest/java/androidx/compose/ui/graphics/benchmark/VectorBenchmarkWithTracing.kt b/compose/ui/ui-graphics/benchmark/src/androidTest/java/androidx/compose/ui/graphics/benchmark/VectorBenchmarkWithTracing.kt
index d4e4318..33af974 100644
--- a/compose/ui/ui-graphics/benchmark/src/androidTest/java/androidx/compose/ui/graphics/benchmark/VectorBenchmarkWithTracing.kt
+++ b/compose/ui/ui-graphics/benchmark/src/androidTest/java/androidx/compose/ui/graphics/benchmark/VectorBenchmarkWithTracing.kt
@@ -16,7 +16,7 @@
package androidx.compose.ui.graphics.benchmark
-import androidx.benchmark.macro.junit4.PerfettoRule
+import androidx.benchmark.junit4.PerfettoRule
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.LargeTest
import org.junit.Rule
diff --git a/compose/ui/ui-graphics/benchmark/test/src/androidTest/AndroidManifest.xml b/compose/ui/ui-graphics/benchmark/test/src/androidTest/AndroidManifest.xml
index 11e4107..784abb9 100644
--- a/compose/ui/ui-graphics/benchmark/test/src/androidTest/AndroidManifest.xml
+++ b/compose/ui/ui-graphics/benchmark/test/src/androidTest/AndroidManifest.xml
@@ -14,7 +14,4 @@
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:tools="http://schemas.android.com/tools"
- package="androidx.compose.ui.graphics.benchmark.test">
-</manifest>
+<manifest package="androidx.compose.ui.graphics.benchmark.test"/>
diff --git a/compose/ui/ui-graphics/src/desktopMain/kotlin/androidx/compose/ui/graphics/DesktopImageConverters.desktop.kt b/compose/ui/ui-graphics/src/desktopMain/kotlin/androidx/compose/ui/graphics/DesktopImageConverters.desktop.kt
index aaeacd9..2eceb87 100644
--- a/compose/ui/ui-graphics/src/desktopMain/kotlin/androidx/compose/ui/graphics/DesktopImageConverters.desktop.kt
+++ b/compose/ui/ui-graphics/src/desktopMain/kotlin/androidx/compose/ui/graphics/DesktopImageConverters.desktop.kt
@@ -20,6 +20,7 @@
import androidx.compose.ui.geometry.isSpecified
import androidx.compose.ui.graphics.drawscope.CanvasDrawScope
import androidx.compose.ui.graphics.drawscope.DrawScope
+import androidx.compose.ui.graphics.painter.BitmapPainter
import androidx.compose.ui.graphics.painter.Painter
import androidx.compose.ui.unit.Density
import androidx.compose.ui.unit.IntSize
@@ -61,7 +62,8 @@
/**
* Convert Compose [Painter] to AWT [Image]. The result will not be rasterized right now, it
* will be rasterized when AWT will request the image with needed width and height, by calling
- * [AbstractMultiResolutionImage.getResolutionVariant]
+ * [AbstractMultiResolutionImage.getResolutionVariant] on Windows/Linux, or
+ * [AbstractMultiResolutionImage.getResolutionVariants] on macOs.
*
* At the rasterization moment, [density] and [layoutDirection] will be passed to the painter.
* Usually most painters don't use them. Like the painters for svg/xml/raster resources:
@@ -90,10 +92,12 @@
private val painter: Painter,
private val density: Density,
private val layoutDirection: LayoutDirection,
- private val size: Size,
+ size: Size,
) : Image(), MultiResolutionImage {
- override fun getWidth(observer: ImageObserver?) = size.width.toInt()
- override fun getHeight(observer: ImageObserver?) = size.height.toInt()
+ private val width = size.width.toInt()
+ private val height = size.height.toInt()
+ override fun getWidth(observer: ImageObserver?) = width
+ override fun getHeight(observer: ImageObserver?) = height
override fun getResolutionVariant(
destImageWidth: Double,
@@ -138,9 +142,20 @@
"getGraphics() not supported"
)
- override fun getResolutionVariants() = throw UnsupportedOperationException(
- "getResolutionVariants() not supported"
- )
+ // AWT only calls this field on macOs
+ private val _resolutionVariants by lazy {
+ // optimizations to avoid unnecessary rasterizations
+ when (painter) {
+ is BufferedImagePainter -> listOf(painter.image)
+ is BitmapPainter -> listOf(asBitmap(width, height).asAwtImage())
+ else -> listOf(
+ asBitmap(width, height).asAwtImage(), // for usual displays
+ asBitmap(width * 2, height * 2).asAwtImage(), // for retina displays
+ )
+ }
+ }
+
+ override fun getResolutionVariants() = _resolutionVariants
}
// TODO(demin): should we optimize toAwtImage/toBitmap? Currently we convert colors according to the
diff --git a/compose/ui/ui-inspection/src/androidTest/java/androidx/compose/ui/inspection/inspector/ParameterFactoryTest.kt b/compose/ui/ui-inspection/src/androidTest/java/androidx/compose/ui/inspection/inspector/ParameterFactoryTest.kt
index e60d546..c680d65 100644
--- a/compose/ui/ui-inspection/src/androidTest/java/androidx/compose/ui/inspection/inspector/ParameterFactoryTest.kt
+++ b/compose/ui/ui-inspection/src/androidTest/java/androidx/compose/ui/inspection/inspector/ParameterFactoryTest.kt
@@ -22,6 +22,7 @@
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.fillMaxWidth
+import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.layout.wrapContentHeight
@@ -49,6 +50,8 @@
import androidx.compose.ui.graphics.drawscope.DrawScope
import androidx.compose.ui.graphics.painter.Painter
import androidx.compose.ui.graphics.toArgb
+import androidx.compose.ui.platform.debugInspectorInfo
+import androidx.compose.ui.platform.inspectable
import androidx.compose.ui.platform.isDebugInspectorInfoEnabled
import androidx.compose.ui.text.AnnotatedString
import androidx.compose.ui.text.TextStyle
@@ -666,6 +669,25 @@
}
@Test
+ fun testWrappedModifier() {
+ fun Modifier.frame(color: Color) = inspectable(
+ debugInspectorInfo {
+ name = "frame"
+ value = color
+ }
+ ) {
+ background(color).border(width = 5.dp, color = color)
+ }
+ validate(create("modifier", Modifier.width(40.dp).frame(Color.Green).height(50.dp))) {
+ parameter("modifier", ParameterType.String, "") {
+ parameter("width", ParameterType.DimensionDp, 40.0f)
+ parameter("frame", ParameterType.Color, Color.Green.toArgb())
+ parameter("height", ParameterType.DimensionDp, 50.0f)
+ }
+ }
+ }
+
+ @Test
fun testSingleModifierWithParameters() {
validate(create("modifier", Modifier.padding(1.dp, 2.dp, 3.dp, 4.dp))) {
parameter("modifier", ParameterType.String, "") {
diff --git a/compose/ui/ui-inspection/src/main/java/androidx/compose/ui/inspection/inspector/ParameterFactory.kt b/compose/ui/ui-inspection/src/main/java/androidx/compose/ui/inspection/inspector/ParameterFactory.kt
index 9d4b77f..358f301 100644
--- a/compose/ui/ui-inspection/src/main/java/androidx/compose/ui/inspection/inspector/ParameterFactory.kt
+++ b/compose/ui/ui-inspection/src/main/java/androidx/compose/ui/inspection/inspector/ParameterFactory.kt
@@ -30,6 +30,7 @@
import androidx.compose.ui.graphics.toArgb
import androidx.compose.ui.graphics.vector.ImageVector
import androidx.compose.ui.inspection.inspector.ParameterType.DimensionDp
+import androidx.compose.ui.platform.InspectableModifier
import androidx.compose.ui.platform.InspectableValue
import androidx.compose.ui.text.AnnotatedString
import androidx.compose.ui.text.font.FontListFontFamily
@@ -838,8 +839,7 @@
private fun createFromModifier(name: String, value: Modifier): NodeParameter? = when {
name.isNotEmpty() -> {
val parameter = NodeParameter(name, ParameterType.String, "")
- val modifiers = mutableListOf<Modifier.Element>()
- value.foldIn(modifiers) { acc, m -> acc.apply { add(m) } }
+ val modifiers = unwrap(value)
when {
modifiers.isEmpty() -> parameter
!shouldRecurseDeeper() -> parameter.withChildReference(value)
@@ -856,14 +856,23 @@
else -> null
}
+ private fun unwrap(value: Modifier): List<Modifier.Element> {
+ val collector = ModifierCollector()
+ value.foldIn(collector) { acc, m ->
+ acc.apply {
+ add(m)
+ }
+ }
+ return collector.modifiers
+ }
+
private fun findFromModifier(
name: String,
value: Modifier,
index: Int
): Pair<String, Any?>? = when {
name.isNotEmpty() -> {
- val modifiers = mutableListOf<Modifier.Element>()
- value.foldIn(modifiers) { acc, m -> acc.apply { add(m) } }
+ val modifiers = unwrap(value)
if (index in modifiers.indices) Pair("", modifiers[index]) else null
}
value is InspectableValue -> findFromInspectableValue(value, index)
@@ -930,4 +939,20 @@
abs(it.weight.weight - FontWeight.Normal.weight) + it.style.value
}
}
+
+ private class ModifierCollector {
+ val modifiers = mutableListOf<Modifier.Element>()
+ private var ignoreCount = 0
+
+ fun add(element: Modifier.Element) {
+ if (ignoreCount > 0) {
+ ignoreCount--
+ } else {
+ modifiers.add(element)
+ if (element is InspectableModifier) {
+ ignoreCount = element.wrapped.foldIn(0) { count, _ -> count + 1 }
+ }
+ }
+ }
+ }
}
diff --git a/compose/ui/ui-lint/src/main/java/androidx/compose/ui/lint/UiIssueRegistry.kt b/compose/ui/ui-lint/src/main/java/androidx/compose/ui/lint/UiIssueRegistry.kt
index 066c257..1cc5a92 100644
--- a/compose/ui/ui-lint/src/main/java/androidx/compose/ui/lint/UiIssueRegistry.kt
+++ b/compose/ui/ui-lint/src/main/java/androidx/compose/ui/lint/UiIssueRegistry.kt
@@ -27,7 +27,7 @@
*/
class UiIssueRegistry : IssueRegistry() {
// Tests are run with this version. We ensure that with ApiLintVersionsTest
- override val api = 10
+ override val api = 11
override val minApi = CURRENT_API
override val issues get() = listOf(
ComposedModifierDetector.UnnecessaryComposedModifier,
diff --git a/compose/ui/ui-test-junit4/lint-baseline.xml b/compose/ui/ui-test-junit4/lint-baseline.xml
index 24081e2..76fa171 100644
--- a/compose/ui/ui-test-junit4/lint-baseline.xml
+++ b/compose/ui/ui-test-junit4/lint-baseline.xml
@@ -4,6 +4,72 @@
<issue
id="VisibleForTests"
message="This method should only be accessed from tests or within private scope"
+ errorLine1=" hadPendingMeasureLayout = composeRoots.any { it.hasPendingMeasureOrLayout }"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/androidMain/kotlin/androidx/compose/ui/test/junit4/android/ComposeIdlingResource.android.kt"
+ line="69"
+ column="61"/>
+ </issue>
+
+ <issue
+ id="VisibleForTests"
+ message="This method should only be accessed from tests or within private scope"
+ errorLine1=" return view.rootView.parent != null && !view.isAttachedToWindow"
+ errorLine2=" ~~~~">
+ <location
+ file="src/androidMain/kotlin/androidx/compose/ui/test/junit4/android/ComposeIdlingResource.android.kt"
+ line="113"
+ column="16"/>
+ </issue>
+
+ <issue
+ id="VisibleForTests"
+ message="This method should only be accessed from tests or within private scope"
+ errorLine1=" return view.rootView.parent != null && !view.isAttachedToWindow"
+ errorLine2=" ~~~~">
+ <location
+ file="src/androidMain/kotlin/androidx/compose/ui/test/junit4/android/ComposeIdlingResource.android.kt"
+ line="113"
+ column="49"/>
+ </issue>
+
+ <issue
+ id="VisibleForTests"
+ message="This method should only be accessed from tests or within private scope"
+ errorLine1=" get() = ViewRootForTest.onViewCreatedCallback == ::onViewRootCreated"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/androidMain/kotlin/androidx/compose/ui/test/junit4/android/ComposeRootRegistry.android.kt"
+ line="54"
+ column="33"/>
+ </issue>
+
+ <issue
+ id="VisibleForTests"
+ message="This method should only be accessed from tests or within private scope"
+ errorLine1=" ViewRootForTest.onViewCreatedCallback = ::onViewRootCreated"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/androidMain/kotlin/androidx/compose/ui/test/junit4/android/ComposeRootRegistry.android.kt"
+ line="60"
+ column="25"/>
+ </issue>
+
+ <issue
+ id="VisibleForTests"
+ message="This method should only be accessed from tests or within private scope"
+ errorLine1=" root.view.addOnAttachStateChangeListener(StateChangeHandler(root))"
+ errorLine2=" ~~~~">
+ <location
+ file="src/androidMain/kotlin/androidx/compose/ui/test/junit4/android/ComposeRootRegistry.android.kt"
+ line="88"
+ column="22"/>
+ </issue>
+
+ <issue
+ id="VisibleForTests"
+ message="This method should only be accessed from tests or within private scope"
errorLine1=" if (composeRoot == this.composeRoot && !registered) {"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
@@ -12,4 +78,26 @@
column="17"/>
</issue>
+ <issue
+ id="VisibleForTests"
+ message="This method should only be accessed from tests or within private scope"
+ errorLine1=" return composeRoots.filter { it.hasPendingMeasureOrLayout }"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/androidMain/kotlin/androidx/compose/ui/test/junit4/RobolectricIdlingStrategy.android.kt"
+ line="94"
+ column="41"/>
+ </issue>
+
+ <issue
+ id="VisibleForTests"
+ message="This method should only be accessed from tests or within private scope"
+ errorLine1=" .onEach { it.view.requestLayout() }"
+ errorLine2=" ~~~~">
+ <location
+ file="src/androidMain/kotlin/androidx/compose/ui/test/junit4/RobolectricIdlingStrategy.android.kt"
+ line="95"
+ column="26"/>
+ </issue>
+
</issues>
diff --git a/compose/ui/ui-test/api/current.txt b/compose/ui/ui-test/api/current.txt
index a6d29d0..f10e454 100644
--- a/compose/ui/ui-test/api/current.txt
+++ b/compose/ui/ui-test/api/current.txt
@@ -52,12 +52,14 @@
public final class BoundsAssertionsKt {
method public static androidx.compose.ui.test.SemanticsNodeInteraction assertHeightIsAtLeast(androidx.compose.ui.test.SemanticsNodeInteraction, float expectedMinHeight);
method public static androidx.compose.ui.test.SemanticsNodeInteraction assertHeightIsEqualTo(androidx.compose.ui.test.SemanticsNodeInteraction, float expectedHeight);
+ method public static void assertIsEqualTo(float, float expected, String subject, optional float tolerance);
method public static androidx.compose.ui.test.SemanticsNodeInteraction assertLeftPositionInRootIsEqualTo(androidx.compose.ui.test.SemanticsNodeInteraction, float expectedLeft);
method public static androidx.compose.ui.test.SemanticsNodeInteraction assertPositionInRootIsEqualTo(androidx.compose.ui.test.SemanticsNodeInteraction, float expectedLeft, float expectedTop);
method public static androidx.compose.ui.test.SemanticsNodeInteraction assertTopPositionInRootIsEqualTo(androidx.compose.ui.test.SemanticsNodeInteraction, float expectedTop);
method public static androidx.compose.ui.test.SemanticsNodeInteraction assertWidthIsAtLeast(androidx.compose.ui.test.SemanticsNodeInteraction, float expectedMinWidth);
method public static androidx.compose.ui.test.SemanticsNodeInteraction assertWidthIsEqualTo(androidx.compose.ui.test.SemanticsNodeInteraction, float expectedWidth);
method public static float getAlignmentLinePosition(androidx.compose.ui.test.SemanticsNodeInteraction, androidx.compose.ui.layout.AlignmentLine alignmentLine);
+ method public static androidx.compose.ui.unit.DpRect getBoundsInRoot(androidx.compose.ui.test.SemanticsNodeInteraction);
method public static androidx.compose.ui.unit.DpRect getUnclippedBoundsInRoot(androidx.compose.ui.test.SemanticsNodeInteraction);
}
diff --git a/compose/ui/ui-test/api/public_plus_experimental_current.txt b/compose/ui/ui-test/api/public_plus_experimental_current.txt
index af6af83..3955208 100644
--- a/compose/ui/ui-test/api/public_plus_experimental_current.txt
+++ b/compose/ui/ui-test/api/public_plus_experimental_current.txt
@@ -54,12 +54,14 @@
public final class BoundsAssertionsKt {
method public static androidx.compose.ui.test.SemanticsNodeInteraction assertHeightIsAtLeast(androidx.compose.ui.test.SemanticsNodeInteraction, float expectedMinHeight);
method public static androidx.compose.ui.test.SemanticsNodeInteraction assertHeightIsEqualTo(androidx.compose.ui.test.SemanticsNodeInteraction, float expectedHeight);
+ method public static void assertIsEqualTo(float, float expected, String subject, optional float tolerance);
method public static androidx.compose.ui.test.SemanticsNodeInteraction assertLeftPositionInRootIsEqualTo(androidx.compose.ui.test.SemanticsNodeInteraction, float expectedLeft);
method public static androidx.compose.ui.test.SemanticsNodeInteraction assertPositionInRootIsEqualTo(androidx.compose.ui.test.SemanticsNodeInteraction, float expectedLeft, float expectedTop);
method public static androidx.compose.ui.test.SemanticsNodeInteraction assertTopPositionInRootIsEqualTo(androidx.compose.ui.test.SemanticsNodeInteraction, float expectedTop);
method public static androidx.compose.ui.test.SemanticsNodeInteraction assertWidthIsAtLeast(androidx.compose.ui.test.SemanticsNodeInteraction, float expectedMinWidth);
method public static androidx.compose.ui.test.SemanticsNodeInteraction assertWidthIsEqualTo(androidx.compose.ui.test.SemanticsNodeInteraction, float expectedWidth);
method public static float getAlignmentLinePosition(androidx.compose.ui.test.SemanticsNodeInteraction, androidx.compose.ui.layout.AlignmentLine alignmentLine);
+ method public static androidx.compose.ui.unit.DpRect getBoundsInRoot(androidx.compose.ui.test.SemanticsNodeInteraction);
method public static androidx.compose.ui.unit.DpRect getUnclippedBoundsInRoot(androidx.compose.ui.test.SemanticsNodeInteraction);
}
diff --git a/compose/ui/ui-test/api/restricted_current.txt b/compose/ui/ui-test/api/restricted_current.txt
index a6d29d0..f10e454 100644
--- a/compose/ui/ui-test/api/restricted_current.txt
+++ b/compose/ui/ui-test/api/restricted_current.txt
@@ -52,12 +52,14 @@
public final class BoundsAssertionsKt {
method public static androidx.compose.ui.test.SemanticsNodeInteraction assertHeightIsAtLeast(androidx.compose.ui.test.SemanticsNodeInteraction, float expectedMinHeight);
method public static androidx.compose.ui.test.SemanticsNodeInteraction assertHeightIsEqualTo(androidx.compose.ui.test.SemanticsNodeInteraction, float expectedHeight);
+ method public static void assertIsEqualTo(float, float expected, String subject, optional float tolerance);
method public static androidx.compose.ui.test.SemanticsNodeInteraction assertLeftPositionInRootIsEqualTo(androidx.compose.ui.test.SemanticsNodeInteraction, float expectedLeft);
method public static androidx.compose.ui.test.SemanticsNodeInteraction assertPositionInRootIsEqualTo(androidx.compose.ui.test.SemanticsNodeInteraction, float expectedLeft, float expectedTop);
method public static androidx.compose.ui.test.SemanticsNodeInteraction assertTopPositionInRootIsEqualTo(androidx.compose.ui.test.SemanticsNodeInteraction, float expectedTop);
method public static androidx.compose.ui.test.SemanticsNodeInteraction assertWidthIsAtLeast(androidx.compose.ui.test.SemanticsNodeInteraction, float expectedMinWidth);
method public static androidx.compose.ui.test.SemanticsNodeInteraction assertWidthIsEqualTo(androidx.compose.ui.test.SemanticsNodeInteraction, float expectedWidth);
method public static float getAlignmentLinePosition(androidx.compose.ui.test.SemanticsNodeInteraction, androidx.compose.ui.layout.AlignmentLine alignmentLine);
+ method public static androidx.compose.ui.unit.DpRect getBoundsInRoot(androidx.compose.ui.test.SemanticsNodeInteraction);
method public static androidx.compose.ui.unit.DpRect getUnclippedBoundsInRoot(androidx.compose.ui.test.SemanticsNodeInteraction);
}
diff --git a/compose/ui/ui-test/lint-baseline.xml b/compose/ui/ui-test/lint-baseline.xml
new file mode 100644
index 0000000..249b7e8
--- /dev/null
+++ b/compose/ui/ui-test/lint-baseline.xml
@@ -0,0 +1,70 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<issues format="6" by="lint 7.1.0-dev" type="baseline" client="gradle" dependencies="false" name="AGP (7.1.0-dev)" variant="all" version="7.1.0-dev">
+
+ <issue
+ id="VisibleForTests"
+ message="This method should only be accessed from tests or within private scope"
+ errorLine1=" if (!ViewMatchers.isDisplayed().matches(it.view)) {"
+ errorLine2=" ~~~~">
+ <location
+ file="src/androidMain/kotlin/androidx/compose/ui/test/AndroidAssertions.android.kt"
+ line="41"
+ column="52"/>
+ </issue>
+
+ <issue
+ id="VisibleForTests"
+ message="This method should only be accessed from tests or within private scope"
+ errorLine1=" val composeView = (root as ViewRootForTest).view"
+ errorLine2=" ~~~~">
+ <location
+ file="src/androidMain/kotlin/androidx/compose/ui/test/AndroidAssertions.android.kt"
+ line="56"
+ column="49"/>
+ </issue>
+
+ <issue
+ id="VisibleForTests"
+ message="This method should only be accessed from tests or within private scope"
+ errorLine1=" val composeView = (root as ViewRootForTest).view"
+ errorLine2=" ~~~~">
+ <location
+ file="src/androidMain/kotlin/androidx/compose/ui/test/AndroidAssertions.android.kt"
+ line="65"
+ column="49"/>
+ </issue>
+
+ <issue
+ id="VisibleForTests"
+ message="This method should only be accessed from tests or within private scope"
+ errorLine1=" val view = (node.root as ViewRootForTest).view"
+ errorLine2=" ~~~~">
+ <location
+ file="src/androidMain/kotlin/androidx/compose/ui/test/AndroidImageHelpers.android.kt"
+ line="56"
+ column="47"/>
+ </issue>
+
+ <issue
+ id="VisibleForTests"
+ message="This method should only be accessed from tests or within private scope"
+ errorLine1=" val view = root.view"
+ errorLine2=" ~~~~">
+ <location
+ file="src/androidMain/kotlin/androidx/compose/ui/test/AndroidInputDispatcher.android.kt"
+ line="40"
+ column="21"/>
+ </issue>
+
+ <issue
+ id="VisibleForTests"
+ message="This method should only be accessed from tests or within private scope"
+ errorLine1=" root.view.getLocationOnScreen(array)"
+ errorLine2=" ~~~~">
+ <location
+ file="src/androidMain/kotlin/androidx/compose/ui/test/AndroidInputDispatcher.android.kt"
+ line="120"
+ column="22"/>
+ </issue>
+
+</issues>
diff --git a/compose/ui/ui-test/src/androidAndroidTest/kotlin/androidx/compose/ui/test/ErrorMessagesTest.kt b/compose/ui/ui-test/src/androidAndroidTest/kotlin/androidx/compose/ui/test/ErrorMessagesTest.kt
index 587ba21..1a8555e 100644
--- a/compose/ui/ui-test/src/androidAndroidTest/kotlin/androidx/compose/ui/test/ErrorMessagesTest.kt
+++ b/compose/ui/ui-test/src/androidAndroidTest/kotlin/androidx/compose/ui/test/ErrorMessagesTest.kt
@@ -23,14 +23,22 @@
import androidx.compose.material.Surface
import androidx.compose.material.Text
import androidx.compose.runtime.Composable
+import androidx.compose.runtime.CompositionLocalProvider
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
+import androidx.compose.testutils.TestViewConfiguration
import androidx.compose.ui.Modifier
+import androidx.compose.ui.platform.LocalViewConfiguration
import androidx.compose.ui.platform.testTag
import androidx.compose.ui.semantics.SemanticsActions
+import androidx.compose.ui.semantics.clearAndSetSemantics
+import androidx.compose.ui.semantics.text
+import androidx.compose.ui.test.junit4.ComposeContentTestRule
import androidx.compose.ui.test.junit4.createComposeRule
import androidx.compose.ui.test.util.expectErrorMessage
import androidx.compose.ui.test.util.expectErrorMessageStartsWith
+import androidx.compose.ui.text.AnnotatedString
+import androidx.compose.ui.unit.DpSize
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.MediumTest
import org.junit.Rule
@@ -108,7 +116,7 @@
@Test
fun findByText_doClick_butMoreThanOneElementFound() {
- rule.setContent {
+ rule.setContentWithoutMinimumTouchTarget {
ComposeSimpleCase()
}
@@ -144,7 +152,7 @@
@Test
fun findByTag_assertDoesNotExist_butElementFound() {
- rule.setContent {
+ rule.setContentWithoutMinimumTouchTarget {
ComposeSimpleCase()
}
@@ -163,7 +171,7 @@
@Test
fun findAll_assertMultiple_butIsDifferentAmount() {
- rule.setContent {
+ rule.setContentWithoutMinimumTouchTarget {
ComposeSimpleCase()
}
@@ -280,6 +288,59 @@
}
}
+ @Test
+ fun findByTag_assertExists_noElementFoundButFoundInMerged() {
+ rule.setContent {
+ ComposeMerged()
+ }
+
+ expectErrorMessage(
+ """
+ Failed: assertExists.
+ Reason: Expected exactly '1' node but could not find any node that satisfies: (Text + EditableText contains 'Banana' (ignoreCase: false))
+ However, the unmerged tree contains '1' node that matches. Are you missing `useUnmergedNode = true` in your finder?
+ """.trimIndent()
+ ) {
+ rule.onNodeWithText("Banana")
+ .assertExists()
+ }
+ }
+ @Test
+ fun findByTag_assertExists_NoElementFoundButMultipleFoundInMerged() {
+ rule.setContent {
+ ComposeMerged(5)
+ }
+
+ expectErrorMessage(
+ """
+ Failed: assertExists.
+ Reason: Expected exactly '1' node but could not find any node that satisfies: (Text + EditableText contains 'Banana' (ignoreCase: false))
+ However, the unmerged tree contains '5' nodes that match. Are you missing `useUnmergedNode = true` in your finder?
+ """.trimIndent()
+ ) {
+ rule.onNodeWithText("Banana")
+ .assertExists()
+ }
+ }
+
+ @Test
+ fun findByTag_performAction_NoElementFoundButFoundInMerged() {
+ rule.setContent {
+ ComposeMerged()
+ }
+
+ expectErrorMessage(
+ """
+ Failed to perform a gesture.
+ Reason: Expected exactly '1' node but could not find any node that satisfies: (Text + EditableText contains 'Banana' (ignoreCase: false))
+ However, the unmerged tree contains '1' node that matches. Are you missing `useUnmergedNode = true` in your finder?
+ """.trimIndent()
+ ) {
+ rule.onNodeWithText("Banana")
+ .performClick()
+ }
+ }
+
@Composable
fun ComposeSimpleCase() {
MaterialTheme {
@@ -313,6 +374,21 @@
}
@Composable
+ fun ComposeMerged(numberOfTexts: Int = 1) {
+ Column {
+ TestButton(
+ modifier = Modifier
+ .testTag("MyButton")
+ .clearAndSetSemantics { text = AnnotatedString("Not Banana") }
+ ) {
+ repeat(numberOfTexts) {
+ Text("Banana")
+ }
+ }
+ }
+ }
+
+ @Composable
fun TestButton(
modifier: Modifier = Modifier,
onClick: (() -> Unit)? = null,
@@ -324,4 +400,23 @@
}
}
}
+}
+
+fun ComposeContentTestRule.setContentWithoutMinimumTouchTarget(
+ composable: @Composable () -> Unit
+) {
+ setContent {
+ val oldViewConfiguration = LocalViewConfiguration.current
+ val viewConfiguration = TestViewConfiguration(
+ longPressTimeoutMillis = oldViewConfiguration.longPressTimeoutMillis,
+ doubleTapTimeoutMillis = oldViewConfiguration.doubleTapTimeoutMillis,
+ doubleTapMinTimeMillis = oldViewConfiguration.doubleTapMinTimeMillis,
+ touchSlop = oldViewConfiguration.touchSlop,
+ minimumTouchTargetSize = DpSize.Zero
+ )
+ CompositionLocalProvider(
+ LocalViewConfiguration provides viewConfiguration,
+ content = composable
+ )
+ }
}
\ No newline at end of file
diff --git a/compose/ui/ui-test/src/androidAndroidTest/kotlin/androidx/compose/ui/test/PrintToStringTest.kt b/compose/ui/ui-test/src/androidAndroidTest/kotlin/androidx/compose/ui/test/PrintToStringTest.kt
index 79b46da..fada0e7 100644
--- a/compose/ui/ui-test/src/androidAndroidTest/kotlin/androidx/compose/ui/test/PrintToStringTest.kt
+++ b/compose/ui/ui-test/src/androidAndroidTest/kotlin/androidx/compose/ui/test/PrintToStringTest.kt
@@ -106,7 +106,7 @@
@Test
fun printHierarchy() {
- rule.setContent {
+ rule.setContentWithoutMinimumTouchTarget {
Column(Modifier.semantics { this.disabled(); this.testTag = "column" }) {
Box(Modifier.semantics { this.disabled(); this.testTag = "box" }) {
Button(onClick = {}) {
diff --git a/compose/ui/ui-test/src/commonMain/kotlin/androidx/compose/ui/test/BoundsAssertions.kt b/compose/ui/ui-test/src/commonMain/kotlin/androidx/compose/ui/test/BoundsAssertions.kt
index bf90245..d0fc7485 100644
--- a/compose/ui/ui-test/src/commonMain/kotlin/androidx/compose/ui/test/BoundsAssertions.kt
+++ b/compose/ui/ui-test/src/commonMain/kotlin/androidx/compose/ui/test/BoundsAssertions.kt
@@ -138,6 +138,19 @@
}
/**
+ * Returns the bounds of the layout of this node as clipped to the root. The bounds are relative to
+ * the root composable.
+ */
+fun SemanticsNodeInteraction.getBoundsInRoot(): DpRect {
+ val node = fetchSemanticsNode("Failed to retrieve bounds of the node.")
+ return with(node.root!!.density) {
+ node.boundsInRoot.let {
+ DpRect(it.left.toDp(), it.top.toDp(), it.right.toDp(), it.bottom.toDp())
+ }
+ }
+}
+
+/**
* Returns the position of an [alignment line][AlignmentLine], or [Dp.Unspecified] if the line is
* not provided.
*/
@@ -209,7 +222,7 @@
*
* @throws AssertionError if comparison fails.
*/
-private fun Dp.assertIsEqualTo(expected: Dp, subject: String, tolerance: Dp = Dp(.5f)) {
+fun Dp.assertIsEqualTo(expected: Dp, subject: String, tolerance: Dp = Dp(.5f)) {
if (!isWithinTolerance(expected, tolerance)) {
// Comparison failed, report the error in DPs
throw AssertionError(
diff --git a/compose/ui/ui-test/src/commonMain/kotlin/androidx/compose/ui/test/ErrorMessages.kt b/compose/ui/ui-test/src/commonMain/kotlin/androidx/compose/ui/test/ErrorMessages.kt
index b54df55..b81ba2f 100644
--- a/compose/ui/ui-test/src/commonMain/kotlin/androidx/compose/ui/test/ErrorMessages.kt
+++ b/compose/ui/ui-test/src/commonMain/kotlin/androidx/compose/ui/test/ErrorMessages.kt
@@ -33,7 +33,8 @@
errorMessage: String,
selector: SemanticsSelector?,
foundNodes: List<SemanticsNode>,
- expectedCount: Int
+ expectedCount: Int,
+ foundNodesUnmerged: List<SemanticsNode> = emptyList()
): String {
val sb = StringBuilder()
@@ -65,6 +66,18 @@
sb.append(".")
}
+ // If no nodes were found but they exist in the unmerged tree, display a warning.
+ if (foundNodes.isEmpty() && foundNodesUnmerged.isNotEmpty()) {
+ sb.appendLine()
+ sb.append("However, the unmerged tree contains ")
+ if (foundNodesUnmerged.size == 1) {
+ sb.append("'1' node that matches. ")
+ } else {
+ sb.append("'${foundNodesUnmerged.size}' nodes that match. ")
+ }
+ sb.append("Are you missing `useUnmergedNode = true` in your finder?")
+ }
+
sb.appendLine()
if (foundNodes.isNotEmpty()) {
diff --git a/compose/ui/ui-test/src/commonMain/kotlin/androidx/compose/ui/test/SemanticsNodeInteraction.kt b/compose/ui/ui-test/src/commonMain/kotlin/androidx/compose/ui/test/SemanticsNodeInteraction.kt
index 5e453f8..2102d0e 100644
--- a/compose/ui/ui-test/src/commonMain/kotlin/androidx/compose/ui/test/SemanticsNodeInteraction.kt
+++ b/compose/ui/ui-test/src/commonMain/kotlin/androidx/compose/ui/test/SemanticsNodeInteraction.kt
@@ -174,7 +174,8 @@
errorMessage = finalErrorMessage,
foundNodes = result.selectedNodes,
expectedCount = 1,
- selector = selector
+ selector = selector,
+ foundNodesUnmerged = getNodesInUnmergedTree(errorMessageOnFail)
)
)
}
@@ -182,6 +183,24 @@
lastSeenSemantics = result.selectedNodes.first().printToString()
return result.selectedNodes.first()
}
+
+ /**
+ * If using the merged tree, performs the same search in the unmerged tree.
+ */
+ private fun getNodesInUnmergedTree(errorMessageOnFail: String?): List<SemanticsNode> {
+ return if (!useUnmergedTree) {
+ selector
+ .map(
+ testContext.getAllSemanticsNodes(
+ atLeastOneRootRequired = true,
+ useUnmergedTree = true
+ ),
+ errorMessageOnFail.orEmpty()
+ ).selectedNodes
+ } else {
+ emptyList()
+ }
+ }
}
/**
diff --git a/compose/ui/ui-text/benchmark/lint-baseline.xml b/compose/ui/ui-text/benchmark/lint-baseline.xml
index 00ea318..96b875a 100644
--- a/compose/ui/ui-text/benchmark/lint-baseline.xml
+++ b/compose/ui/ui-text/benchmark/lint-baseline.xml
@@ -1,5 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
-<issues format="6" by="lint 7.1.0-alpha02" type="baseline" client="cli" name="Lint" variant="all" version="7.1.0-alpha02">
+<issues format="6" by="lint 7.1.0-dev" type="baseline" client="gradle" dependencies="false" name="AGP (7.1.0-dev)" variant="all" version="7.1.0-dev">
+
+ <issue
+ id="SoonBlockedPrivateApi"
+ message="Reflective access to freeTextLayoutCaches will throw an exception when targeting API 31 and above"
+ errorLine1=" val freeCaches = Canvas::class.java.getDeclaredMethod("freeTextLayoutCaches")"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/java/androidx/compose/ui/text/benchmark/TextBenchmarkTestRule.kt"
+ line="79"
+ column="30"/>
+ </issue>
<issue
id="BanUncheckedReflection"
diff --git a/compose/ui/ui-text/benchmark/src/androidTest/AndroidManifest.xml b/compose/ui/ui-text/benchmark/src/androidTest/AndroidManifest.xml
index 7529fea..e342247 100644
--- a/compose/ui/ui-text/benchmark/src/androidTest/AndroidManifest.xml
+++ b/compose/ui/ui-text/benchmark/src/androidTest/AndroidManifest.xml
@@ -15,17 +15,9 @@
~ limitations under the License.
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:tools="http://schemas.android.com/tools"
package="androidx.compose.ui.text.benchmark">
-
- <!--
- ~ Important: disable debuggable for accurate performance results
- -->
- <application
- android:debuggable="false"
- tools:replace="android:debuggable">
- <!-- enable profileableByShell for non-intrusive profiling tools -->
- <!--suppress AndroidElementNotAllowed -->
+ <application>
+ <!-- enable profiling by shell for non-intrusive profiling tools -->
<profileable android:shell="true"/>
</application>
</manifest>
diff --git a/compose/ui/ui/api/current.txt b/compose/ui/ui/api/current.txt
index 63ab22d..d2388ce 100644
--- a/compose/ui/ui/api/current.txt
+++ b/compose/ui/ui/api/current.txt
@@ -1287,9 +1287,13 @@
@kotlin.coroutines.RestrictsSuspension public interface AwaitPointerEventScope extends androidx.compose.ui.unit.Density {
method public suspend Object? awaitPointerEvent(optional androidx.compose.ui.input.pointer.PointerEventPass pass, optional kotlin.coroutines.Continuation<? super androidx.compose.ui.input.pointer.PointerEvent> p);
method public androidx.compose.ui.input.pointer.PointerEvent getCurrentEvent();
+ method public default long getExtendedTouchPadding();
method public long getSize();
method public androidx.compose.ui.platform.ViewConfiguration getViewConfiguration();
+ method public default suspend <T> Object? withTimeout(long timeMillis, kotlin.jvm.functions.Function2<? super androidx.compose.ui.input.pointer.AwaitPointerEventScope,? super kotlin.coroutines.Continuation<? super T>,?> block, kotlin.coroutines.Continuation<? super T> p);
+ method public default suspend <T> Object? withTimeoutOrNull(long timeMillis, kotlin.jvm.functions.Function2<? super androidx.compose.ui.input.pointer.AwaitPointerEventScope,? super kotlin.coroutines.Continuation<? super T>,?> block, kotlin.coroutines.Continuation<? super T> p);
property public abstract androidx.compose.ui.input.pointer.PointerEvent currentEvent;
+ property public default long extendedTouchPadding;
property public abstract long size;
property public abstract androidx.compose.ui.platform.ViewConfiguration viewConfiguration;
}
@@ -1332,7 +1336,8 @@
method public static void consumeAllChanges(androidx.compose.ui.input.pointer.PointerInputChange);
method public static void consumeDownChange(androidx.compose.ui.input.pointer.PointerInputChange);
method public static void consumePositionChange(androidx.compose.ui.input.pointer.PointerInputChange);
- method public static boolean isOutOfBounds(androidx.compose.ui.input.pointer.PointerInputChange, long size);
+ method @Deprecated public static boolean isOutOfBounds(androidx.compose.ui.input.pointer.PointerInputChange, long size);
+ method public static boolean isOutOfBounds(androidx.compose.ui.input.pointer.PointerInputChange, long size, long extendedTouchPadding);
method public static long positionChange(androidx.compose.ui.input.pointer.PointerInputChange);
method public static boolean positionChangeConsumed(androidx.compose.ui.input.pointer.PointerInputChange);
method public static long positionChangeIgnoreConsumed(androidx.compose.ui.input.pointer.PointerInputChange);
@@ -1346,6 +1351,10 @@
enum_constant public static final androidx.compose.ui.input.pointer.PointerEventPass Main;
}
+ public final class PointerEventTimeoutCancellationException extends java.util.concurrent.CancellationException {
+ ctor public PointerEventTimeoutCancellationException(long time);
+ }
+
public final class PointerEvent_androidKt {
method public static boolean getAreAnyPressed(int);
method public static int indexOfFirstPressed(int);
@@ -1415,8 +1424,10 @@
public interface PointerInputScope extends androidx.compose.ui.unit.Density {
method public suspend <R> Object? awaitPointerEventScope(kotlin.jvm.functions.Function2<? super androidx.compose.ui.input.pointer.AwaitPointerEventScope,? super kotlin.coroutines.Continuation<? super R>,?> block, kotlin.coroutines.Continuation<? super R> p);
+ method public default long getExtendedTouchPadding();
method public long getSize();
method public androidx.compose.ui.platform.ViewConfiguration getViewConfiguration();
+ property public default long extendedTouchPadding;
property public abstract long size;
property public abstract androidx.compose.ui.platform.ViewConfiguration viewConfiguration;
}
@@ -1946,6 +1957,11 @@
public static final class InfiniteAnimationPolicy.Key implements kotlin.coroutines.CoroutineContext.Key<androidx.compose.ui.platform.InfiniteAnimationPolicy> {
}
+ public interface InspectableModifier {
+ method public androidx.compose.ui.Modifier getWrapped();
+ property public abstract androidx.compose.ui.Modifier wrapped;
+ }
+
public interface InspectableValue {
method public default kotlin.sequences.Sequence<androidx.compose.ui.platform.ValueElement> getInspectableElements();
method public default String? getNameFallback();
@@ -1958,6 +1974,7 @@
public final class InspectableValueKt {
method public static inline kotlin.jvm.functions.Function1<androidx.compose.ui.platform.InspectorInfo,kotlin.Unit> debugInspectorInfo(kotlin.jvm.functions.Function1<? super androidx.compose.ui.platform.InspectorInfo,kotlin.Unit> definitions);
method public static kotlin.jvm.functions.Function1<androidx.compose.ui.platform.InspectorInfo,kotlin.Unit> getNoInspectorInfo();
+ method public static inline androidx.compose.ui.Modifier inspectable(androidx.compose.ui.Modifier, kotlin.jvm.functions.Function1<? super androidx.compose.ui.platform.InspectorInfo,kotlin.Unit> inspectorInfo, kotlin.jvm.functions.Function1<? super androidx.compose.ui.Modifier,? extends androidx.compose.ui.Modifier> wrapped);
method public static boolean isDebugInspectorInfoEnabled();
method public static void setDebugInspectorInfoEnabled(boolean isDebugInspectorInfoEnabled);
}
@@ -2065,10 +2082,12 @@
method public long getDoubleTapMinTimeMillis();
method public long getDoubleTapTimeoutMillis();
method public long getLongPressTimeoutMillis();
+ method public default long getMinimumTouchTargetSize();
method public float getTouchSlop();
property public abstract long doubleTapMinTimeMillis;
property public abstract long doubleTapTimeoutMillis;
property public abstract long longPressTimeoutMillis;
+ property public default long minimumTouchTargetSize;
property public abstract float touchSlop;
}
diff --git a/compose/ui/ui/api/public_plus_experimental_current.txt b/compose/ui/ui/api/public_plus_experimental_current.txt
index cd35a7b7..1e8a8dd 100644
--- a/compose/ui/ui/api/public_plus_experimental_current.txt
+++ b/compose/ui/ui/api/public_plus_experimental_current.txt
@@ -1451,9 +1451,13 @@
@kotlin.coroutines.RestrictsSuspension public interface AwaitPointerEventScope extends androidx.compose.ui.unit.Density {
method public suspend Object? awaitPointerEvent(optional androidx.compose.ui.input.pointer.PointerEventPass pass, optional kotlin.coroutines.Continuation<? super androidx.compose.ui.input.pointer.PointerEvent> p);
method public androidx.compose.ui.input.pointer.PointerEvent getCurrentEvent();
+ method public default long getExtendedTouchPadding();
method public long getSize();
method public androidx.compose.ui.platform.ViewConfiguration getViewConfiguration();
+ method public default suspend <T> Object? withTimeout(long timeMillis, kotlin.jvm.functions.Function2<? super androidx.compose.ui.input.pointer.AwaitPointerEventScope,? super kotlin.coroutines.Continuation<? super T>,?> block, kotlin.coroutines.Continuation<? super T> p);
+ method public default suspend <T> Object? withTimeoutOrNull(long timeMillis, kotlin.jvm.functions.Function2<? super androidx.compose.ui.input.pointer.AwaitPointerEventScope,? super kotlin.coroutines.Continuation<? super T>,?> block, kotlin.coroutines.Continuation<? super T> p);
property public abstract androidx.compose.ui.input.pointer.PointerEvent currentEvent;
+ property public default long extendedTouchPadding;
property public abstract long size;
property public abstract androidx.compose.ui.platform.ViewConfiguration viewConfiguration;
}
@@ -1496,7 +1500,8 @@
method public static void consumeAllChanges(androidx.compose.ui.input.pointer.PointerInputChange);
method public static void consumeDownChange(androidx.compose.ui.input.pointer.PointerInputChange);
method public static void consumePositionChange(androidx.compose.ui.input.pointer.PointerInputChange);
- method public static boolean isOutOfBounds(androidx.compose.ui.input.pointer.PointerInputChange, long size);
+ method @Deprecated public static boolean isOutOfBounds(androidx.compose.ui.input.pointer.PointerInputChange, long size);
+ method public static boolean isOutOfBounds(androidx.compose.ui.input.pointer.PointerInputChange, long size, long extendedTouchPadding);
method public static long positionChange(androidx.compose.ui.input.pointer.PointerInputChange);
method public static boolean positionChangeConsumed(androidx.compose.ui.input.pointer.PointerInputChange);
method public static long positionChangeIgnoreConsumed(androidx.compose.ui.input.pointer.PointerInputChange);
@@ -1510,6 +1515,10 @@
enum_constant public static final androidx.compose.ui.input.pointer.PointerEventPass Main;
}
+ public final class PointerEventTimeoutCancellationException extends java.util.concurrent.CancellationException {
+ ctor public PointerEventTimeoutCancellationException(long time);
+ }
+
public final class PointerEvent_androidKt {
method public static boolean getAreAnyPressed(int);
method public static int indexOfFirstPressed(int);
@@ -1579,8 +1588,10 @@
public interface PointerInputScope extends androidx.compose.ui.unit.Density {
method public suspend <R> Object? awaitPointerEventScope(kotlin.jvm.functions.Function2<? super androidx.compose.ui.input.pointer.AwaitPointerEventScope,? super kotlin.coroutines.Continuation<? super R>,?> block, kotlin.coroutines.Continuation<? super R> p);
+ method public default long getExtendedTouchPadding();
method public long getSize();
method public androidx.compose.ui.platform.ViewConfiguration getViewConfiguration();
+ property public default long extendedTouchPadding;
property public abstract long size;
property public abstract androidx.compose.ui.platform.ViewConfiguration viewConfiguration;
}
@@ -2135,6 +2146,11 @@
public static final class InfiniteAnimationPolicy.Key implements kotlin.coroutines.CoroutineContext.Key<androidx.compose.ui.platform.InfiniteAnimationPolicy> {
}
+ public interface InspectableModifier {
+ method public androidx.compose.ui.Modifier getWrapped();
+ property public abstract androidx.compose.ui.Modifier wrapped;
+ }
+
public interface InspectableValue {
method public default kotlin.sequences.Sequence<androidx.compose.ui.platform.ValueElement> getInspectableElements();
method public default String? getNameFallback();
@@ -2147,6 +2163,7 @@
public final class InspectableValueKt {
method public static inline kotlin.jvm.functions.Function1<androidx.compose.ui.platform.InspectorInfo,kotlin.Unit> debugInspectorInfo(kotlin.jvm.functions.Function1<? super androidx.compose.ui.platform.InspectorInfo,kotlin.Unit> definitions);
method public static kotlin.jvm.functions.Function1<androidx.compose.ui.platform.InspectorInfo,kotlin.Unit> getNoInspectorInfo();
+ method public static inline androidx.compose.ui.Modifier inspectable(androidx.compose.ui.Modifier, kotlin.jvm.functions.Function1<? super androidx.compose.ui.platform.InspectorInfo,kotlin.Unit> inspectorInfo, kotlin.jvm.functions.Function1<? super androidx.compose.ui.Modifier,? extends androidx.compose.ui.Modifier> wrapped);
method public static boolean isDebugInspectorInfoEnabled();
method public static void setDebugInspectorInfoEnabled(boolean isDebugInspectorInfoEnabled);
}
@@ -2268,10 +2285,12 @@
method public long getDoubleTapMinTimeMillis();
method public long getDoubleTapTimeoutMillis();
method public long getLongPressTimeoutMillis();
+ method public default long getMinimumTouchTargetSize();
method public float getTouchSlop();
property public abstract long doubleTapMinTimeMillis;
property public abstract long doubleTapTimeoutMillis;
property public abstract long longPressTimeoutMillis;
+ property public default long minimumTouchTargetSize;
property public abstract float touchSlop;
}
diff --git a/compose/ui/ui/api/restricted_current.txt b/compose/ui/ui/api/restricted_current.txt
index 6dc2c81..3d0c852 100644
--- a/compose/ui/ui/api/restricted_current.txt
+++ b/compose/ui/ui/api/restricted_current.txt
@@ -1287,9 +1287,13 @@
@kotlin.coroutines.RestrictsSuspension public interface AwaitPointerEventScope extends androidx.compose.ui.unit.Density {
method public suspend Object? awaitPointerEvent(optional androidx.compose.ui.input.pointer.PointerEventPass pass, optional kotlin.coroutines.Continuation<? super androidx.compose.ui.input.pointer.PointerEvent> p);
method public androidx.compose.ui.input.pointer.PointerEvent getCurrentEvent();
+ method public default long getExtendedTouchPadding();
method public long getSize();
method public androidx.compose.ui.platform.ViewConfiguration getViewConfiguration();
+ method public default suspend <T> Object? withTimeout(long timeMillis, kotlin.jvm.functions.Function2<? super androidx.compose.ui.input.pointer.AwaitPointerEventScope,? super kotlin.coroutines.Continuation<? super T>,?> block, kotlin.coroutines.Continuation<? super T> p);
+ method public default suspend <T> Object? withTimeoutOrNull(long timeMillis, kotlin.jvm.functions.Function2<? super androidx.compose.ui.input.pointer.AwaitPointerEventScope,? super kotlin.coroutines.Continuation<? super T>,?> block, kotlin.coroutines.Continuation<? super T> p);
property public abstract androidx.compose.ui.input.pointer.PointerEvent currentEvent;
+ property public default long extendedTouchPadding;
property public abstract long size;
property public abstract androidx.compose.ui.platform.ViewConfiguration viewConfiguration;
}
@@ -1332,7 +1336,8 @@
method public static void consumeAllChanges(androidx.compose.ui.input.pointer.PointerInputChange);
method public static void consumeDownChange(androidx.compose.ui.input.pointer.PointerInputChange);
method public static void consumePositionChange(androidx.compose.ui.input.pointer.PointerInputChange);
- method public static boolean isOutOfBounds(androidx.compose.ui.input.pointer.PointerInputChange, long size);
+ method @Deprecated public static boolean isOutOfBounds(androidx.compose.ui.input.pointer.PointerInputChange, long size);
+ method public static boolean isOutOfBounds(androidx.compose.ui.input.pointer.PointerInputChange, long size, long extendedTouchPadding);
method public static long positionChange(androidx.compose.ui.input.pointer.PointerInputChange);
method public static boolean positionChangeConsumed(androidx.compose.ui.input.pointer.PointerInputChange);
method public static long positionChangeIgnoreConsumed(androidx.compose.ui.input.pointer.PointerInputChange);
@@ -1346,6 +1351,10 @@
enum_constant public static final androidx.compose.ui.input.pointer.PointerEventPass Main;
}
+ public final class PointerEventTimeoutCancellationException extends java.util.concurrent.CancellationException {
+ ctor public PointerEventTimeoutCancellationException(long time);
+ }
+
public final class PointerEvent_androidKt {
method public static boolean getAreAnyPressed(int);
method public static int indexOfFirstPressed(int);
@@ -1415,8 +1424,10 @@
public interface PointerInputScope extends androidx.compose.ui.unit.Density {
method public suspend <R> Object? awaitPointerEventScope(kotlin.jvm.functions.Function2<? super androidx.compose.ui.input.pointer.AwaitPointerEventScope,? super kotlin.coroutines.Continuation<? super R>,?> block, kotlin.coroutines.Continuation<? super R> p);
+ method public default long getExtendedTouchPadding();
method public long getSize();
method public androidx.compose.ui.platform.ViewConfiguration getViewConfiguration();
+ property public default long extendedTouchPadding;
property public abstract long size;
property public abstract androidx.compose.ui.platform.ViewConfiguration viewConfiguration;
}
@@ -1797,14 +1808,17 @@
method public androidx.compose.ui.unit.LayoutDirection getLayoutDirection();
method public androidx.compose.ui.layout.MeasurePolicy getMeasurePolicy();
method public androidx.compose.ui.Modifier getModifier();
+ method public androidx.compose.ui.platform.ViewConfiguration getViewConfiguration();
method public void setDensity(androidx.compose.ui.unit.Density density);
method public void setLayoutDirection(androidx.compose.ui.unit.LayoutDirection layoutDirection);
method public void setMeasurePolicy(androidx.compose.ui.layout.MeasurePolicy measurePolicy);
method public void setModifier(androidx.compose.ui.Modifier modifier);
+ method public void setViewConfiguration(androidx.compose.ui.platform.ViewConfiguration viewConfiguration);
property public abstract androidx.compose.ui.unit.Density density;
property public abstract androidx.compose.ui.unit.LayoutDirection layoutDirection;
property public abstract androidx.compose.ui.layout.MeasurePolicy measurePolicy;
property public abstract androidx.compose.ui.Modifier modifier;
+ property public abstract androidx.compose.ui.platform.ViewConfiguration viewConfiguration;
field public static final androidx.compose.ui.node.ComposeUiNode.Companion Companion;
}
@@ -1814,11 +1828,13 @@
method public kotlin.jvm.functions.Function2<androidx.compose.ui.node.ComposeUiNode,androidx.compose.ui.unit.LayoutDirection,kotlin.Unit> getSetLayoutDirection();
method public kotlin.jvm.functions.Function2<androidx.compose.ui.node.ComposeUiNode,androidx.compose.ui.layout.MeasurePolicy,kotlin.Unit> getSetMeasurePolicy();
method public kotlin.jvm.functions.Function2<androidx.compose.ui.node.ComposeUiNode,androidx.compose.ui.Modifier,kotlin.Unit> getSetModifier();
+ method public kotlin.jvm.functions.Function2<androidx.compose.ui.node.ComposeUiNode,androidx.compose.ui.platform.ViewConfiguration,kotlin.Unit> getSetViewConfiguration();
property public final kotlin.jvm.functions.Function0<androidx.compose.ui.node.ComposeUiNode> Constructor;
property public final kotlin.jvm.functions.Function2<androidx.compose.ui.node.ComposeUiNode,androidx.compose.ui.unit.Density,kotlin.Unit> SetDensity;
property public final kotlin.jvm.functions.Function2<androidx.compose.ui.node.ComposeUiNode,androidx.compose.ui.unit.LayoutDirection,kotlin.Unit> SetLayoutDirection;
property public final kotlin.jvm.functions.Function2<androidx.compose.ui.node.ComposeUiNode,androidx.compose.ui.layout.MeasurePolicy,kotlin.Unit> SetMeasurePolicy;
property public final kotlin.jvm.functions.Function2<androidx.compose.ui.node.ComposeUiNode,androidx.compose.ui.Modifier,kotlin.Unit> SetModifier;
+ property public final kotlin.jvm.functions.Function2<androidx.compose.ui.node.ComposeUiNode,androidx.compose.ui.platform.ViewConfiguration,kotlin.Unit> SetViewConfiguration;
}
public final class LayoutNodeKt {
@@ -1976,6 +1992,11 @@
public static final class InfiniteAnimationPolicy.Key implements kotlin.coroutines.CoroutineContext.Key<androidx.compose.ui.platform.InfiniteAnimationPolicy> {
}
+ public interface InspectableModifier {
+ method public androidx.compose.ui.Modifier getWrapped();
+ property public abstract androidx.compose.ui.Modifier wrapped;
+ }
+
public interface InspectableValue {
method public default kotlin.sequences.Sequence<androidx.compose.ui.platform.ValueElement> getInspectableElements();
method public default String? getNameFallback();
@@ -1988,6 +2009,8 @@
public final class InspectableValueKt {
method public static inline kotlin.jvm.functions.Function1<androidx.compose.ui.platform.InspectorInfo,kotlin.Unit> debugInspectorInfo(kotlin.jvm.functions.Function1<? super androidx.compose.ui.platform.InspectorInfo,kotlin.Unit> definitions);
method public static kotlin.jvm.functions.Function1<androidx.compose.ui.platform.InspectorInfo,kotlin.Unit> getNoInspectorInfo();
+ method public static inline androidx.compose.ui.Modifier inspectable(androidx.compose.ui.Modifier, kotlin.jvm.functions.Function1<? super androidx.compose.ui.platform.InspectorInfo,kotlin.Unit> inspectorInfo, kotlin.jvm.functions.Function1<? super androidx.compose.ui.Modifier,? extends androidx.compose.ui.Modifier> wrapped);
+ method @kotlin.PublishedApi internal static androidx.compose.ui.Modifier inspectableWrapper(androidx.compose.ui.Modifier, kotlin.jvm.functions.Function1<? super androidx.compose.ui.platform.InspectorInfo,kotlin.Unit> inspectorInfo, androidx.compose.ui.Modifier wrapped);
method public static boolean isDebugInspectorInfoEnabled();
method public static void setDebugInspectorInfoEnabled(boolean isDebugInspectorInfoEnabled);
}
@@ -2095,10 +2118,12 @@
method public long getDoubleTapMinTimeMillis();
method public long getDoubleTapTimeoutMillis();
method public long getLongPressTimeoutMillis();
+ method public default long getMinimumTouchTargetSize();
method public float getTouchSlop();
property public abstract long doubleTapMinTimeMillis;
property public abstract long doubleTapTimeoutMillis;
property public abstract long longPressTimeoutMillis;
+ property public default long minimumTouchTargetSize;
property public abstract float touchSlop;
}
diff --git a/compose/ui/ui/benchmark/src/androidTest/AndroidManifest.xml b/compose/ui/ui/benchmark/src/androidTest/AndroidManifest.xml
index 0113871a..d7acb11 100644
--- a/compose/ui/ui/benchmark/src/androidTest/AndroidManifest.xml
+++ b/compose/ui/ui/benchmark/src/androidTest/AndroidManifest.xml
@@ -15,18 +15,11 @@
~ limitations under the License.
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:tools="http://schemas.android.com/tools"
package="androidx.compose.ui.benchmark">
-
- <!--
- ~ Important: disable debuggable for accurate performance results
- -->
- <application
- android:debuggable="false"
- tools:replace="android:debuggable">
- <!-- enable profileableByShell for non-intrusive profiling tools -->
- <!--suppress AndroidElementNotAllowed -->
+ <application>
+ <!-- enable profiling by shell for non-intrusive profiling tools -->
<profileable android:shell="true"/>
+
<activity android:name="androidx.compose.ui.benchmark.input.pointer.TestActivity" />
</application>
</manifest>
diff --git a/compose/ui/ui/build.gradle b/compose/ui/ui/build.gradle
index c56710f..08b2ea4 100644
--- a/compose/ui/ui/build.gradle
+++ b/compose/ui/ui/build.gradle
@@ -92,7 +92,7 @@
androidTestImplementation(project(":compose:test-utils"))
androidTestImplementation(project(":compose:ui:ui-test-font"))
androidTestImplementation(project(":compose:ui:ui-test-junit4"))
- androidTestImplementation(project(":test:screenshot:test-screenshot"))
+ androidTestImplementation(project(":test:screenshot:screenshot"))
androidTestImplementation("androidx.recyclerview:recyclerview:1.1.0")
androidTestImplementation("androidx.core:core-ktx:1.1.0")
androidTestImplementation(project(":activity:activity-compose"))
@@ -190,7 +190,7 @@
implementation(project(":compose:test-utils"))
implementation(project(":compose:ui:ui-test-font"))
implementation(project(":compose:ui:ui-test-junit4"))
- implementation(project(":test:screenshot:test-screenshot"))
+ implementation(project(":test:screenshot:screenshot"))
implementation("androidx.recyclerview:recyclerview:1.1.0")
implementation("androidx.core:core-ktx:1.1.0")
implementation(project(":activity:activity-compose"))
diff --git a/compose/ui/ui/samples/src/main/java/androidx/compose/ui/samples/InspectableModifierSample.kt b/compose/ui/ui/samples/src/main/java/androidx/compose/ui/samples/InspectableModifierSample.kt
new file mode 100644
index 0000000..f0654e5
--- /dev/null
+++ b/compose/ui/ui/samples/src/main/java/androidx/compose/ui/samples/InspectableModifierSample.kt
@@ -0,0 +1,58 @@
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * 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.
+ */
+
+package androidx.compose.ui.samples
+
+import androidx.annotation.Sampled
+import androidx.compose.foundation.background
+import androidx.compose.foundation.shape.RoundedCornerShape
+import androidx.compose.runtime.Composable
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.graphics.Color
+import androidx.compose.ui.platform.debugInspectorInfo
+import androidx.compose.ui.platform.inspectable
+import androidx.compose.ui.unit.Dp
+import androidx.compose.ui.unit.dp
+
+@Sampled
+@Composable
+fun InspectableModifierSample() {
+
+ /**
+ * Sample with a single parameter
+ */
+ fun Modifier.simpleFrame(color: Color) = inspectable(
+ inspectorInfo = debugInspectorInfo {
+ name = "simpleFrame"
+ value = color
+ }
+ ) {
+ background(color, RoundedCornerShape(5.0.dp))
+ }
+
+ /**
+ * Sample with multiple parameters
+ */
+ fun Modifier.fancyFrame(size: Dp, color: Color) = inspectable(
+ inspectorInfo = debugInspectorInfo {
+ name = "fancyFrame"
+ properties["size"] = size
+ properties["color"] = color
+ }
+ ) {
+ background(color, RoundedCornerShape(size))
+ }
+}
diff --git a/compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/AndroidAccessibilityTest.kt b/compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/AndroidAccessibilityTest.kt
index fed8579..7d4b955 100644
--- a/compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/AndroidAccessibilityTest.kt
+++ b/compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/AndroidAccessibilityTest.kt
@@ -118,6 +118,7 @@
import androidx.compose.ui.text.input.PasswordVisualTransformation
import androidx.compose.ui.text.input.TextFieldValue
import androidx.compose.ui.unit.Density
+import androidx.compose.ui.unit.dp
import androidx.compose.ui.viewinterop.AndroidView
import androidx.compose.ui.window.Dialog
import androidx.core.view.ViewCompat
@@ -2276,8 +2277,8 @@
}
@Test
- fun testReportedBounds_clickableNode_includesPadding() {
- val size = 100
+ fun testReportedBounds_clickableNode_includesPadding(): Unit = with(rule.density) {
+ val size = 100.dp.roundToPx()
container.setContent {
with(LocalDensity.current) {
Column {
@@ -2308,8 +2309,8 @@
}
@Test
- fun testReportedBounds_clickableNode_excludesPadding() {
- val size = 100
+ fun testReportedBounds_clickableNode_excludesPadding(): Unit = with(rule.density) {
+ val size = 100.dp.roundToPx()
val density = Density(2f)
container.setContent {
CompositionLocalProvider(LocalDensity provides density) {
@@ -2371,8 +2372,8 @@
}
@Test
- fun testReportedBounds_withTwoClickable_outermostWins() {
- val size = 100
+ fun testReportedBounds_withTwoClickable_outermostWins(): Unit = with(rule.density) {
+ val size = 100.dp.roundToPx()
container.setContent {
with(LocalDensity.current) {
Column {
diff --git a/compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/draw/PainterModifierTest.kt b/compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/draw/PainterModifierTest.kt
index e47b044..360b423 100644
--- a/compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/draw/PainterModifierTest.kt
+++ b/compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/draw/PainterModifierTest.kt
@@ -454,17 +454,16 @@
}
@Test
- fun testPainterFixedDimensionUnchanged() {
+ fun testPainterFixedDimensionUnchanged(): Unit = with(rule.density) {
val painterWidth = 1000f
val painterHeight = 375f
- val density = rule.density.density
- val composableWidth = 500f
- val composableHeight = 800f
+ val composableWidth = 250f
+ val composableHeight = 400f
// Because the constraints are tight here, do not attempt to resize the composable
// based on the intrinsic dimensions of the Painter
testPainterScaleMatchesSize(
- Modifier.requiredWidth((composableWidth / density).dp)
- .requiredHeight((composableHeight / density).dp),
+ Modifier.requiredWidth(composableWidth.toDp())
+ .requiredHeight(composableHeight.toDp()),
ContentScale.Fit,
Size(painterWidth, painterHeight),
composableWidth,
@@ -517,12 +516,10 @@
painterSize: Size,
composableWidthPx: Float,
composableHeightPx: Float
- ) {
- var composableWidth = 0f
- var composableHeight = 0f
+ ) = with(rule.density) {
+ val composableWidth = composableWidthPx.toDp()
+ val composableHeight = composableHeightPx.toDp()
rule.setContent {
- composableWidth = composableWidthPx / LocalDensity.current.density
- composableHeight = composableHeightPx / LocalDensity.current.density
// Because the painter is told to fit inside the constraints, the width should
// match that of the provided fixed width and the height should match that of the
// composable as no scaling is being done
@@ -541,24 +538,24 @@
}
rule.onRoot()
- .assertWidthIsEqualTo(composableWidth.dp)
- .assertHeightIsEqualTo(composableHeight.dp)
+ .assertWidthIsEqualTo(composableWidth)
+ .assertHeightIsEqualTo(composableHeight)
}
@SdkSuppress(minSdkVersion = Build.VERSION_CODES.O)
@Test
- fun testBitmapPainterScalesContent() {
+ fun testBitmapPainterScalesContent(): Unit = with(rule.density) {
// BitmapPainter should handle scaling its content image up to fill the
// corresponding content bounds. Because the composable is twice the
// height of the image and we are providing ContentScale.FillHeight
// the BitmapPainter should draw the image with twice its original
// height and width centered within the bounds of the composable
- val boxWidth = 600
- val boxHeight = 400
- val srcImage = ImageBitmap(100, 200)
+ val boxWidth = 300
+ val boxHeight = 200
+ val srcImage = ImageBitmap(50, 100)
val canvas = Canvas(srcImage)
val paint = Paint().apply { this.color = Color.Red }
- canvas.drawRect(0f, 0f, 400f, 200f, paint)
+ canvas.drawRect(0f, 0f, 200f, 100f, paint)
val testTag = "testTag"
@@ -567,8 +564,8 @@
modifier = Modifier
.testTag(testTag)
.background(color = Color.Gray)
- .requiredWidth((boxWidth / LocalDensity.current.density).dp)
- .requiredHeight((boxHeight / LocalDensity.current.density).dp)
+ .requiredWidth(boxWidth.toDp())
+ .requiredHeight(boxHeight.toDp())
.paint(BitmapPainter(srcImage), contentScale = ContentScale.FillHeight)
)
}
@@ -623,24 +620,24 @@
@SdkSuppress(minSdkVersion = Build.VERSION_CODES.O)
@Test
- fun testVectorPainterScalesContent() {
+ fun testVectorPainterScalesContent(): Unit = with(rule.density) {
// VectorPainter should handle scaling its content vector up to fill the
// corresponding content bounds. Because the composable is twice the
// height of the vector and we are providing ContentScale.FillHeight
// the VectorPainter should draw the vector with twice its original
// height and width centered within the bounds of the composable
- val boxWidth = 600
- val boxHeight = 400
+ val boxWidth = 300
+ val boxHeight = 200
- val vectorWidth = 100
- val vectorHeight = 200
+ val vectorWidth = 50
+ val vectorHeight = 100
rule.setContent {
- val vectorWidthDp = (vectorWidth / LocalDensity.current.density).dp
- val vectorHeightDp = (vectorHeight / LocalDensity.current.density).dp
+ val vectorWidthDp = vectorWidth.toDp()
+ val vectorHeightDp = vectorHeight.toDp()
Box(
modifier = Modifier.background(color = Color.Gray)
- .requiredWidth((boxWidth / LocalDensity.current.density).dp)
- .requiredHeight((boxHeight / LocalDensity.current.density).dp)
+ .requiredWidth(boxWidth.toDp())
+ .requiredHeight(boxHeight.toDp())
.paint(
rememberVectorPainter(
defaultWidth = vectorWidthDp,
diff --git a/compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/graphics/vector/VectorTest.kt b/compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/graphics/vector/VectorTest.kt
index 383b749..95448cb 100644
--- a/compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/graphics/vector/VectorTest.kt
+++ b/compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/graphics/vector/VectorTest.kt
@@ -95,11 +95,11 @@
@Test
fun testVectorAlignment() {
rule.setContent {
- VectorTint(minimumSize = 500, alignment = Alignment.BottomEnd)
+ VectorTint(minimumSize = 450, alignment = Alignment.BottomEnd)
}
- takeScreenShot(500).apply {
- assertEquals(getPixel(480, 480), Color.Cyan.toArgb())
+ takeScreenShot(450).apply {
+ assertEquals(getPixel(430, 430), Color.Cyan.toArgb())
}
}
@@ -191,8 +191,8 @@
@SdkSuppress(minSdkVersion = Build.VERSION_CODES.O)
@Test
fun testImageVectorChangeOnStateChange() {
- val defaultWidth = 24.dp
- val defaultHeight = 24.dp
+ val defaultWidth = 48.dp
+ val defaultHeight = 48.dp
val viewportWidth = 24f
val viewportHeight = 24f
diff --git a/compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/input/pointer/HitPathTrackerTest.kt b/compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/input/pointer/HitPathTrackerTest.kt
index d74228e..5bb9d6a 100644
--- a/compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/input/pointer/HitPathTrackerTest.kt
+++ b/compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/input/pointer/HitPathTrackerTest.kt
@@ -3191,4 +3191,4 @@
override fun get(alignmentLine: AlignmentLine): Int {
TODO("not implemented")
}
-}
\ No newline at end of file
+}
diff --git a/compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/input/pointer/RestrictedSizeTest.kt b/compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/input/pointer/RestrictedSizeTest.kt
new file mode 100644
index 0000000..c3836cc
--- /dev/null
+++ b/compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/input/pointer/RestrictedSizeTest.kt
@@ -0,0 +1,121 @@
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * 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.
+ */
+
+package androidx.compose.ui.input.pointer
+
+import androidx.compose.foundation.layout.Box
+import androidx.compose.foundation.layout.fillMaxSize
+import androidx.compose.foundation.layout.requiredSize
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.geometry.Offset
+import androidx.compose.ui.platform.testTag
+import androidx.compose.ui.test.assertHeightIsEqualTo
+import androidx.compose.ui.test.assertWidthIsEqualTo
+import androidx.compose.ui.test.click
+import androidx.compose.ui.test.junit4.createComposeRule
+import androidx.compose.ui.test.onNodeWithTag
+import androidx.compose.ui.test.performGesture
+import androidx.compose.ui.unit.dp
+import androidx.test.ext.junit.runners.AndroidJUnit4
+import com.google.common.truth.Truth.assertThat
+import org.junit.Rule
+import org.junit.Test
+import org.junit.runner.RunWith
+
+@RunWith(AndroidJUnit4::class)
+class RestrictedSizeTest {
+ @get:Rule
+ val rule = createComposeRule()
+
+ private val tag = "tag"
+
+ @Test
+ fun pointerPositionAtMeasuredSize(): Unit = with(rule.density) {
+ var point = Offset.Zero
+
+ rule.setContent {
+ Box(Modifier.fillMaxSize()) {
+ Box(Modifier.requiredSize(50.dp).testTag(tag)) {
+ Box(
+ Modifier.requiredSize(80.dp).pointerInput(Unit) {
+ awaitPointerEventScope {
+ val event = awaitPointerEvent()
+ point = event.changes[0].position
+ }
+ }
+ )
+ }
+ }
+ }
+
+ rule.onNodeWithTag(tag)
+ .performGesture {
+ click(Offset.Zero)
+ }
+
+ assertThat(point.x).isEqualTo(15.dp.roundToPx().toFloat())
+ assertThat(point.y).isEqualTo(15.dp.roundToPx().toFloat())
+ }
+
+ @Test
+ fun pointerOutOfLayoutBounds(): Unit = with(rule.density) {
+ var point = Offset.Zero
+ var isOutOfBounds = true
+
+ rule.setContent {
+ Box(Modifier.fillMaxSize()) {
+ Box(Modifier.requiredSize(50.dp).testTag(tag)) {
+ Box(
+ Modifier.requiredSize(80.dp).pointerInput(Unit) {
+ awaitPointerEventScope {
+ val event = awaitPointerEvent()
+ point = event.changes[0].position
+ isOutOfBounds =
+ event.changes[0].isOutOfBounds(size, extendedTouchPadding)
+ }
+ }
+ )
+ }
+ }
+ }
+
+ rule.onNodeWithTag(tag)
+ .performGesture {
+ click(Offset(-5f, -2f))
+ }
+
+ assertThat(point.x).isEqualTo(15.dp.roundToPx().toFloat() - 5f)
+ assertThat(point.y).isEqualTo(15.dp.roundToPx().toFloat() - 2f)
+ assertThat(isOutOfBounds).isFalse()
+ }
+
+ @Test
+ fun semanticsSizeTooSmall(): Unit = with(rule.density) {
+ rule.setContent {
+ Box(Modifier.fillMaxSize()) {
+ Box(Modifier.requiredSize(50.dp)) {
+ Box(
+ Modifier.requiredSize(80.dp).testTag(tag)
+ )
+ }
+ }
+ }
+
+ rule.onNodeWithTag(tag)
+ .assertWidthIsEqualTo(80.dp)
+ .assertHeightIsEqualTo(80.dp)
+ }
+}
\ No newline at end of file
diff --git a/compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/input/pointer/SuspendingPointerInputFilterTest.kt b/compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/input/pointer/SuspendingPointerInputFilterTest.kt
index 3610949..4cbda97 100644
--- a/compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/input/pointer/SuspendingPointerInputFilterTest.kt
+++ b/compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/input/pointer/SuspendingPointerInputFilterTest.kt
@@ -279,6 +279,33 @@
)
}
}
+
+ @Test(expected = PointerEventTimeoutCancellationException::class)
+ fun testWithTimeout() = runBlockingTest {
+ val filter = SuspendingPointerInputFilter(TestViewConfiguration())
+ filter.coroutineScope = this
+ with(filter) {
+ awaitPointerEventScope {
+ withTimeout(10) {
+ awaitPointerEvent()
+ }
+ }
+ }
+ }
+
+ @Test
+ fun testWithTimeoutOrNull() = runBlockingTest {
+ val filter = SuspendingPointerInputFilter(TestViewConfiguration())
+ filter.coroutineScope = this
+ val result: PointerEvent? = with(filter) {
+ awaitPointerEventScope {
+ withTimeoutOrNull(10) {
+ awaitPointerEvent()
+ }
+ }
+ }
+ assertThat(result).isNull()
+ }
}
private fun PointerInputChange.toPointerEvent() = PointerEvent(listOf(this))
diff --git a/compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/platform/InspectableValueTest.kt b/compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/platform/InspectableValueTest.kt
new file mode 100644
index 0000000..0e86b81
--- /dev/null
+++ b/compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/platform/InspectableValueTest.kt
@@ -0,0 +1,66 @@
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * 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.
+ */
+
+package androidx.compose.ui.platform
+
+import androidx.compose.foundation.border
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.graphics.Color
+import androidx.compose.ui.padding
+import androidx.compose.ui.test.TestActivity
+import androidx.compose.ui.test.junit4.createAndroidComposeRule
+import androidx.compose.ui.unit.Dp
+import androidx.compose.ui.unit.dp
+import com.google.common.truth.Truth.assertThat
+import org.junit.After
+import org.junit.Before
+import org.junit.Rule
+import org.junit.Test
+
+class InspectableValueTest {
+ @get:Rule
+ val rule = createAndroidComposeRule<TestActivity>()
+
+ @Before
+ fun before() {
+ isDebugInspectorInfoEnabled = true
+ }
+
+ @After
+ fun after() {
+ isDebugInspectorInfoEnabled = false
+ }
+
+ fun Modifier.simple(padding: Int, border: Dp) = inspectable(
+ debugInspectorInfo {
+ name = "simple"
+ properties["padding"] = padding
+ properties["border"] = border
+ }
+ ) {
+ padding(padding).border(border, color = Color.Blue)
+ }
+
+ @Test
+ fun simpleLayoutTest() {
+ val modifier = Modifier.simple(10, 3.dp) as InspectableValue
+ assertThat(modifier.nameFallback).isEqualTo("simple")
+ assertThat(modifier.inspectableElements.asIterable()).containsExactly(
+ ValueElement("padding", 10),
+ ValueElement("border", 3.0.dp)
+ )
+ }
+}
diff --git a/compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/platform/AndroidComposeView.android.kt b/compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/platform/AndroidComposeView.android.kt
index 988de49..11bf968 100644
--- a/compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/platform/AndroidComposeView.android.kt
+++ b/compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/platform/AndroidComposeView.android.kt
@@ -189,6 +189,7 @@
.then(semanticsModifier)
.then(_focusManager.modifier)
.then(keyInputModifier)
+ it.density = density
}
override val rootForTest: RootForTest = this
diff --git a/compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/platform/AndroidComposeViewAccessibilityDelegateCompat.android.kt b/compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/platform/AndroidComposeViewAccessibilityDelegateCompat.android.kt
index 1110f69..49c7984 100644
--- a/compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/platform/AndroidComposeViewAccessibilityDelegateCompat.android.kt
+++ b/compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/platform/AndroidComposeViewAccessibilityDelegateCompat.android.kt
@@ -65,6 +65,7 @@
import androidx.compose.ui.fastJoinToString
import androidx.compose.ui.focus.requestFocus
import androidx.compose.ui.geometry.Offset
+import androidx.compose.ui.node.HitTestResult
import androidx.compose.ui.platform.accessibility.hasCollectionInfo
import androidx.compose.ui.platform.accessibility.setCollectionInfo
import androidx.compose.ui.platform.accessibility.setCollectionItemInfo
@@ -1439,7 +1440,7 @@
internal fun hitTestSemanticsAt(x: Float, y: Float): Int {
view.measureAndLayout()
- val hitSemanticsWrappers: MutableList<SemanticsWrapper> = mutableListOf()
+ val hitSemanticsWrappers = HitTestResult<SemanticsWrapper>()
view.root.hitTestSemantics(
pointerPosition = Offset(x, y),
hitSemanticsWrappers = hitSemanticsWrappers
@@ -2536,4 +2537,4 @@
}
}
return null
-}
\ No newline at end of file
+}
diff --git a/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/input/pointer/PointerEvent.kt b/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/input/pointer/PointerEvent.kt
index 01ed2cd..2ea5b6e 100644
--- a/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/input/pointer/PointerEvent.kt
+++ b/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/input/pointer/PointerEvent.kt
@@ -21,6 +21,7 @@
import androidx.compose.runtime.Immutable
import androidx.compose.ui.Modifier
import androidx.compose.ui.geometry.Offset
+import androidx.compose.ui.geometry.Size
import androidx.compose.ui.input.pointer.PointerEventPass.Final
import androidx.compose.ui.input.pointer.PointerEventPass.Initial
import androidx.compose.ui.input.pointer.PointerEventPass.Main
@@ -498,6 +499,10 @@
* `(0, 0, size.width, size.height)` or `false` if the current pointer is up or it is inside the
* given bounds.
*/
+@Deprecated(
+ message = "Use isOutOfBounds() that supports minimum touch target",
+ replaceWith = ReplaceWith("this.isOutOfBounds(size, extendedTouchPadding)")
+)
fun PointerInputChange.isOutOfBounds(size: IntSize): Boolean {
val position = position
val x = position.x
@@ -506,3 +511,25 @@
val height = size.height
return x < 0f || x > width || y < 0f || y > height
}
+
+/**
+ * Returns `true` if the pointer has moved outside of the pointer region. For Touch
+ * events, this is (-extendedTouchPadding.width, -extendedTouchPadding.height,
+ * size.width + extendedTouchPadding.width, size.height + extendedTouchPadding.height) and
+ * for other events, this is `(0, 0, size.width, size.height)`. Returns`false` if the
+ * current pointer is up or it is inside the pointer region.
+ */
+fun PointerInputChange.isOutOfBounds(size: IntSize, extendedTouchPadding: Size): Boolean {
+ if (type != PointerType.Touch) {
+ @Suppress("DEPRECATION")
+ return isOutOfBounds(size)
+ }
+ val position = position
+ val x = position.x
+ val y = position.y
+ val minX = -extendedTouchPadding.width
+ val maxX = size.width + extendedTouchPadding.width
+ val minY = -extendedTouchPadding.height
+ val maxY = size.height + extendedTouchPadding.height
+ return x < minX || x > maxX || y < minY || y > maxY
+}
\ No newline at end of file
diff --git a/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/input/pointer/PointerInputEventProcessor.kt b/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/input/pointer/PointerInputEventProcessor.kt
index 1f97dcc..7c21cbf 100644
--- a/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/input/pointer/PointerInputEventProcessor.kt
+++ b/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/input/pointer/PointerInputEventProcessor.kt
@@ -17,6 +17,7 @@
package androidx.compose.ui.input.pointer
import androidx.compose.ui.geometry.Offset
+import androidx.compose.ui.node.HitTestResult
import androidx.compose.ui.node.InternalCoreApi
import androidx.compose.ui.node.LayoutNode
import androidx.compose.ui.util.fastForEach
@@ -34,7 +35,7 @@
private val hitPathTracker = HitPathTracker(root.coordinates)
private val pointerInputChangeEventProducer = PointerInputChangeEventProducer()
- private val hitResult: MutableList<PointerInputFilter> = mutableListOf()
+ private val hitResult = HitTestResult<PointerInputFilter>()
/**
* Receives [PointerInputEvent]s and process them through the tree rooted on [root].
@@ -58,10 +59,8 @@
// Add new hit paths to the tracker due to down events.
internalPointerEvent.changes.values.forEach { pointerInputChange ->
if (pointerInputChange.changedToDownIgnoreConsumed()) {
- root.hitTest(
- pointerInputChange.position,
- hitResult
- )
+ val isTouchEvent = pointerInputChange.type == PointerType.Touch
+ root.hitTest(pointerInputChange.position, hitResult, isTouchEvent)
if (hitResult.isNotEmpty()) {
hitPathTracker.addHitPath(pointerInputChange.id, hitResult)
hitResult.clear()
@@ -204,4 +203,4 @@
val val1 = if (dispatchedToAPointerInputModifier) 1 else 0
val val2 = if (anyMovementConsumed) (1 shl 1) else 0
return ProcessResult(val1 or val2)
-}
\ No newline at end of file
+}
diff --git a/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/input/pointer/SuspendingPointerInputFilter.kt b/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/input/pointer/SuspendingPointerInputFilter.kt
index eb6c8a8..d379135 100644
--- a/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/input/pointer/SuspendingPointerInputFilter.kt
+++ b/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/input/pointer/SuspendingPointerInputFilter.kt
@@ -22,6 +22,7 @@
import androidx.compose.ui.Modifier
import androidx.compose.ui.composed
import androidx.compose.ui.fastMapNotNull
+import androidx.compose.ui.geometry.Size
import androidx.compose.ui.platform.LocalDensity
import androidx.compose.ui.platform.LocalViewConfiguration
import androidx.compose.ui.platform.ViewConfiguration
@@ -30,6 +31,12 @@
import androidx.compose.ui.unit.IntSize
import androidx.compose.ui.util.fastAll
import kotlinx.coroutines.CancellableContinuation
+import kotlinx.coroutines.CancellationException
+import kotlinx.coroutines.CoroutineScope
+import kotlinx.coroutines.DelicateCoroutinesApi
+import kotlinx.coroutines.GlobalScope
+import kotlinx.coroutines.delay
+import kotlinx.coroutines.launch
import kotlinx.coroutines.suspendCancellableCoroutine
import kotlin.coroutines.Continuation
import kotlin.coroutines.ContinuationInterceptor
@@ -38,9 +45,12 @@
import kotlin.coroutines.RestrictsSuspension
import kotlin.coroutines.createCoroutine
import kotlin.coroutines.resume
+import kotlin.coroutines.resumeWithException
+import kotlin.math.max
/**
- * Receiver scope for awaiting pointer events in a call to [PointerInputScope.awaitPointerEventScope].
+ * Receiver scope for awaiting pointer events in a call to
+ * [PointerInputScope.awaitPointerEventScope].
*
* This is a restricted suspension scope. Code in this scope is always called undispatched and
* may only suspend for calls to [awaitPointerEvent]. These functions
@@ -56,6 +66,13 @@
*/
val size: IntSize
+ /*
+ * The additional space applied to each side of the layout area. This can be
+ * non-[zero][Size.Zero] when `minimumTouchTargetSize` is set in [pointerInput].
+ */
+ val extendedTouchPadding: Size
+ get() = Size.Zero
+
/**
* The [PointerEvent] from the most recent touch event.
*/
@@ -79,6 +96,24 @@
suspend fun awaitPointerEvent(
pass: PointerEventPass = PointerEventPass.Main
): PointerEvent
+
+ /**
+ * Runs [block] and returns the result of [block] or `null` if [timeMillis] has passed
+ * before [timeMillis].
+ */
+ suspend fun <T> withTimeoutOrNull(
+ timeMillis: Long,
+ block: suspend AwaitPointerEventScope.() -> T
+ ): T? = block()
+
+ /**
+ * Runs [block] and returns its results. An [PointerEventTimeoutCancellationException] is thrown
+ * if [timeMillis] has passed before [block] completes.
+ */
+ suspend fun <T> withTimeout(
+ timeMillis: Long,
+ block: suspend AwaitPointerEventScope.() -> T
+ ): T = block()
}
/**
@@ -100,6 +135,13 @@
val size: IntSize
/**
+ * The additional space applied to each side of the layout area when the layout is smaller
+ * than [ViewConfiguration.minimumTouchTargetSize].
+ */
+ val extendedTouchPadding: Size
+ get() = Size.Zero
+
+ /**
* The [ViewConfiguration] used to tune gesture detectors.
*/
val viewConfiguration: ViewConfiguration
@@ -163,7 +205,9 @@
val density = LocalDensity.current
val viewConfiguration = LocalViewConfiguration.current
remember(density) { SuspendingPointerInputFilter(viewConfiguration, density) }.apply {
+ val filter = this
LaunchedEffect(this, key1) {
+ filter.coroutineScope = this
block()
}
}
@@ -193,9 +237,10 @@
) {
val density = LocalDensity.current
val viewConfiguration = LocalViewConfiguration.current
- remember(density) { SuspendingPointerInputFilter(viewConfiguration, density) }.apply {
+ remember(density) { SuspendingPointerInputFilter(viewConfiguration, density) }.also { filter ->
LaunchedEffect(this, key1, key2) {
- block()
+ filter.coroutineScope = this
+ filter.block()
}
}
}
@@ -222,7 +267,9 @@
val density = LocalDensity.current
val viewConfiguration = LocalViewConfiguration.current
remember(density) { SuspendingPointerInputFilter(viewConfiguration, density) }.apply {
+ val filter = this
LaunchedEffect(this, *keys) {
+ filter.coroutineScope = this
block()
}
}
@@ -290,6 +337,21 @@
private var boundsSize: IntSize = IntSize.Zero
/**
+ * This will be changed immediately on launching, but I always want it to be non-null.
+ */
+ @OptIn(DelicateCoroutinesApi::class)
+ var coroutineScope: CoroutineScope = GlobalScope
+
+ override val extendedTouchPadding: Size
+ get() {
+ val minimumTouchTargetSize = viewConfiguration.minimumTouchTargetSize.toSize()
+ val size = size
+ val horizontal = max(0f, minimumTouchTargetSize.width - size.width) / 2f
+ val vertical = max(0f, minimumTouchTargetSize.height - size.height) / 2f
+ return Size(horizontal, vertical)
+ }
+
+ /**
* Snapshot the current [pointerHandlers] and run [block] on each one.
* May not be called reentrant or concurrent with itself.
*
@@ -424,6 +486,8 @@
get() = this@SuspendingPointerInputFilter.boundsSize
override val viewConfiguration: ViewConfiguration
get() = this@SuspendingPointerInputFilter.viewConfiguration
+ override val extendedTouchPadding: Size
+ get() = this@SuspendingPointerInputFilter.extendedTouchPadding
fun offerPointerEvent(event: PointerEvent, pass: PointerEventPass) {
if (pass == awaitPass) {
@@ -457,5 +521,46 @@
awaitPass = pass
pointerAwaiter = continuation
}
+
+ override suspend fun <T> withTimeoutOrNull(
+ timeMillis: Long,
+ block: suspend AwaitPointerEventScope.() -> T
+ ): T? {
+ return try {
+ withTimeout(timeMillis, block)
+ } catch (_: PointerEventTimeoutCancellationException) {
+ null
+ }
+ }
+
+ override suspend fun <T> withTimeout(
+ timeMillis: Long,
+ block: suspend AwaitPointerEventScope.() -> T
+ ): T {
+ if (timeMillis <= 0L) {
+ pointerAwaiter?.resumeWithException(
+ PointerEventTimeoutCancellationException(timeMillis)
+ )
+ }
+ val job = coroutineScope.launch {
+ delay(timeMillis)
+ pointerAwaiter?.resumeWithException(
+ PointerEventTimeoutCancellationException(timeMillis)
+ )
+ }
+ try {
+ return block()
+ } finally {
+ job.cancel()
+ }
+ }
}
-}
\ No newline at end of file
+}
+
+/**
+ * An exception thrown from [AwaitPointerEventScope.withTimeout] when the execution time
+ * of the coroutine is too long.
+ */
+class PointerEventTimeoutCancellationException(
+ time: Long
+) : CancellationException("Timed out waiting for $time ms")
\ No newline at end of file
diff --git a/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/layout/Layout.kt b/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/layout/Layout.kt
index b15b091..3a50384 100644
--- a/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/layout/Layout.kt
+++ b/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/layout/Layout.kt
@@ -31,6 +31,7 @@
import androidx.compose.ui.node.MeasureBlocks
import androidx.compose.ui.platform.LocalDensity
import androidx.compose.ui.platform.LocalLayoutDirection
+import androidx.compose.ui.platform.LocalViewConfiguration
import androidx.compose.ui.platform.simpleIdentityToString
import androidx.compose.ui.unit.Constraints
import androidx.compose.ui.unit.Density
@@ -71,12 +72,14 @@
) {
val density = LocalDensity.current
val layoutDirection = LocalLayoutDirection.current
+ val viewConfiguration = LocalViewConfiguration.current
ReusableComposeNode<ComposeUiNode, Applier<Any>>(
factory = ComposeUiNode.Constructor,
update = {
set(measurePolicy, ComposeUiNode.SetMeasurePolicy)
set(density, ComposeUiNode.SetDensity)
set(layoutDirection, ComposeUiNode.SetLayoutDirection)
+ set(viewConfiguration, ComposeUiNode.SetViewConfiguration)
},
skippableUpdate = materializerOf(modifier),
content = content
@@ -191,6 +194,7 @@
val materialized = currentComposer.materialize(modifier)
val density = LocalDensity.current
val layoutDirection = LocalLayoutDirection.current
+ val viewConfiguration = LocalViewConfiguration.current
ReusableComposeNode<LayoutNode, Applier<Any>>(
factory = LayoutNode.Constructor,
@@ -199,6 +203,7 @@
set(measurePolicy, ComposeUiNode.SetMeasurePolicy)
set(density, ComposeUiNode.SetDensity)
set(layoutDirection, ComposeUiNode.SetLayoutDirection)
+ set(viewConfiguration, ComposeUiNode.SetViewConfiguration)
@Suppress("DEPRECATION")
init { this.canMultiMeasure = true }
},
diff --git a/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/layout/SubcomposeLayout.kt b/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/layout/SubcomposeLayout.kt
index 59b148f..b031665 100644
--- a/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/layout/SubcomposeLayout.kt
+++ b/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/layout/SubcomposeLayout.kt
@@ -32,6 +32,7 @@
import androidx.compose.ui.node.LayoutNode.LayoutState
import androidx.compose.ui.platform.LocalDensity
import androidx.compose.ui.platform.LocalLayoutDirection
+import androidx.compose.ui.platform.LocalViewConfiguration
import androidx.compose.ui.platform.createSubcomposition
import androidx.compose.ui.unit.Constraints
import androidx.compose.ui.unit.LayoutDirection
@@ -103,6 +104,7 @@
val materialized = currentComposer.materialize(modifier)
val density = LocalDensity.current
val layoutDirection = LocalLayoutDirection.current
+ val viewConfiguration = LocalViewConfiguration.current
ComposeNode<LayoutNode, Applier<Any>>(
factory = LayoutNode.Constructor,
update = {
@@ -111,6 +113,7 @@
set(measurePolicy, state.setMeasurePolicy)
set(density, ComposeUiNode.SetDensity)
set(layoutDirection, ComposeUiNode.SetLayoutDirection)
+ set(viewConfiguration, ComposeUiNode.SetViewConfiguration)
}
)
}
diff --git a/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/node/ComposeUiNode.kt b/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/node/ComposeUiNode.kt
index 57f6b75..f4f88ef 100644
--- a/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/node/ComposeUiNode.kt
+++ b/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/node/ComposeUiNode.kt
@@ -18,6 +18,7 @@
import androidx.compose.ui.Modifier
import androidx.compose.ui.layout.MeasurePolicy
+import androidx.compose.ui.platform.ViewConfiguration
import androidx.compose.ui.unit.Density
import androidx.compose.ui.unit.LayoutDirection
@@ -30,6 +31,7 @@
var layoutDirection: LayoutDirection
var density: Density
var modifier: Modifier
+ var viewConfiguration: ViewConfiguration
/**
* Object of pre-allocated lambdas used to make use with ComposeNode allocation-less.
@@ -42,5 +44,7 @@
{ this.measurePolicy = it }
val SetLayoutDirection: ComposeUiNode.(LayoutDirection) -> Unit =
{ this.layoutDirection = it }
+ val SetViewConfiguration: ComposeUiNode.(ViewConfiguration) -> Unit =
+ { this.viewConfiguration = it }
}
}
diff --git a/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/node/DelegatingLayoutNodeWrapper.kt b/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/node/DelegatingLayoutNodeWrapper.kt
index 5b510e3..37b9109 100644
--- a/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/node/DelegatingLayoutNodeWrapper.kt
+++ b/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/node/DelegatingLayoutNodeWrapper.kt
@@ -18,6 +18,7 @@
import androidx.compose.ui.Modifier
import androidx.compose.ui.geometry.Offset
+import androidx.compose.ui.geometry.Size
import androidx.compose.ui.graphics.Canvas
import androidx.compose.ui.graphics.GraphicsLayerScope
import androidx.compose.ui.input.pointer.PointerInputFilter
@@ -70,17 +71,18 @@
override fun hitTest(
pointerPosition: Offset,
- hitPointerInputFilters: MutableList<PointerInputFilter>
+ hitTestResult: HitTestResult<PointerInputFilter>,
+ isTouchEvent: Boolean
) {
if (withinLayerBounds(pointerPosition)) {
val positionInWrapped = wrapped.fromParentPosition(pointerPosition)
- wrapped.hitTest(positionInWrapped, hitPointerInputFilters)
+ wrapped.hitTest(positionInWrapped, hitTestResult, isTouchEvent)
}
}
override fun hitTestSemantics(
pointerPosition: Offset,
- hitSemanticsWrappers: MutableList<SemanticsWrapper>
+ hitSemanticsWrappers: HitTestResult<SemanticsWrapper>
) {
if (withinLayerBounds(pointerPosition)) {
val positionInWrapped = wrapped.fromParentPosition(pointerPosition)
@@ -165,4 +167,76 @@
override fun maxIntrinsicHeight(width: Int) = wrapped.maxIntrinsicHeight(width)
override val parentData: Any? get() = wrapped.parentData
+
+ private fun offsetFromEdge(pointerPosition: Offset): Offset {
+ val x = pointerPosition.x
+ val horizontal = maxOf(0f, if (x < 0) -x else x - measuredWidth)
+ val y = pointerPosition.y
+ val vertical = maxOf(0f, if (y < 0) -y else y - measuredHeight)
+
+ return Offset(horizontal, vertical)
+ }
+
+ /**
+ * Returns the additional amount on the horizontal and vertical dimensions that
+ * this extends beyond [width] and [height] on all sides. This takes into account
+ * [minimumTouchTargetSize] and [measuredSize] vs. [width] and [height].
+ */
+ protected fun calculateMinimumTouchTargetPadding(minimumTouchTargetSize: Size): Size {
+ val widthDiff = minimumTouchTargetSize.width - measuredWidth.toFloat()
+ val heightDiff = minimumTouchTargetSize.height - measuredHeight.toFloat()
+ return Size(maxOf(0f, widthDiff / 2f), maxOf(0f, heightDiff / 2f))
+ }
+
+ /**
+ * Does a hit test, adding [content] as a [HitTestResult.hit] or
+ * [HitTestResult.hitInMinimumTouchTarget] depending on whether or not it hit
+ * or hit in the [minimumTouchTargetSize] area. The newly-created [HitTestResult] is returned
+ * if there was a hit or `null` is returned if it missed.
+ */
+ protected fun <T> hitTestInMinimumTouchTarget(
+ pointerPosition: Offset,
+ hitTestResult: HitTestResult<T>,
+ content: T,
+ block: () -> Unit
+ ) {
+ if (!withinLayerBounds(pointerPosition)) {
+ return
+ }
+ if (isPointerInBounds(pointerPosition)) {
+ hitTestResult.hit(content, block)
+ } else {
+ val offsetFromEdge = offsetFromEdge(pointerPosition)
+ val distanceFromEdge = maxOf(offsetFromEdge.x, offsetFromEdge.y)
+ val minimumTouchTargetSize = minimumTouchTargetSize
+
+ if (offsetFromEdge.x >= minimumTouchTargetSize.width / 2f ||
+ offsetFromEdge.y >= minimumTouchTargetSize.height / 2f ||
+ !hitTestResult.isHitInMinimumTouchTargetBetter(distanceFromEdge)
+ ) {
+ return // complete miss or the other hit was better
+ }
+
+ if (isHitInMinimumTouchTarget(offsetFromEdge, minimumTouchTargetSize)) {
+ // This was definitely closer than any other target and hit this
+ hitTestResult.hitInMinimumTouchTarget(content, distanceFromEdge, block)
+ } else {
+ // We have to consider anything that may be within the minimum touch target
+ // in case a child is within the minimum touch target. For example, a
+ // switch may have a thumb to one side. The switch's width may preclude
+ // it from receiving minimum touch target special treatment, but the thumb
+ // may be small enough to receive a minimum touch target outside the bounds
+ // of the switch.
+ hitTestResult.speculativeHit(content, distanceFromEdge, block)
+ }
+ }
+ }
+
+ private fun isHitInMinimumTouchTarget(
+ offsetFromEdge: Offset,
+ minimumTouchTargetSize: Size
+ ): Boolean {
+ val touchPadding = calculateMinimumTouchTargetPadding(minimumTouchTargetSize)
+ return offsetFromEdge.x < touchPadding.width && offsetFromEdge.y < touchPadding.height
+ }
}
diff --git a/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/node/HitTestResult.kt b/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/node/HitTestResult.kt
new file mode 100644
index 0000000..49a8886
--- /dev/null
+++ b/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/node/HitTestResult.kt
@@ -0,0 +1,261 @@
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * 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.
+ */
+
+package androidx.compose.ui.node
+
+/**
+ * This tracks the hit test results to allow for minimum touch target and single-pass hit testing.
+ * If there is a hit at the minimum touch target, searching for a hit within the layout bounds
+ * can still continue, but the near miss is still tracked.
+ *
+ * The List<T> interface should only be used after hit testing has completed.
+ *
+ * @see LayoutNode.hitTest
+ * @see LayoutNodeWrapper.hitTest
+ * @see PointerInputDelegatingWrapper.hitTest
+ */
+internal class HitTestResult<T> : List<T> {
+ private var values = arrayOfNulls<Any>(16)
+ private var distancesFromEdge = FloatArray(16)
+ private var hitDepth = -1
+
+ override var size: Int = 0
+ private set
+
+ /**
+ * `true` when there has been a direct hit within touch bounds ([hit] called) or
+ * `false` otherwise.
+ */
+ val isHit: Boolean get() =
+ hitDepth < lastIndex && values[hitDepth + 1] != null && distancesFromEdge[hitDepth + 1] < 0f
+
+ private fun resizeToHitDepth() {
+ for (i in (hitDepth + 1)..lastIndex) {
+ values[i] = null
+ }
+ size = hitDepth + 1
+ }
+
+ /**
+ * Returns `true` if [distanceFromEdge] is less than the previous value passed in
+ * [hitInMinimumTouchTarget] or [speculativeHit].
+ */
+ fun isHitInMinimumTouchTargetBetter(distanceFromEdge: Float): Boolean {
+ return hitDepth == lastIndex ||
+ values[hitDepth + 1] == null ||
+ distanceFromEdge < distancesFromEdge[hitDepth + 1]
+ }
+
+ /**
+ * Records [node] as a hit, adding it to the [HitTestResult] or replacing the existing one.
+ * Runs [childHitTest] to do further hit testing for children.
+ */
+ fun hit(node: T, childHitTest: () -> Unit) {
+ hitInMinimumTouchTarget(node, -1f, childHitTest)
+ }
+
+ /**
+ * Records [node] as a hit with [distanceFromEdge] distance, replacing any existing record.
+ * Runs [childHitTest] to do further hit testing for children.
+ */
+ fun hitInMinimumTouchTarget(node: T, distanceFromEdge: Float, childHitTest: () -> Unit) {
+ hitDepth++
+ ensureContainerSize()
+ values[hitDepth] = node
+ distancesFromEdge[hitDepth] = distanceFromEdge
+ resizeToHitDepth()
+ childHitTest()
+ hitDepth--
+ }
+
+ /**
+ * Temporarily records [node] as a hit with [distanceFromEdge] distance and calls
+ * [childHitTest] to record hits for children. If no children have hits, then
+ * the hit is discarded. If a child had a hit, then [node] replaces an existing
+ * hit.
+ */
+ fun speculativeHit(node: T, distanceFromEdge: Float, childHitTest: () -> Unit) {
+ if (hitDepth == lastIndex) {
+ // Speculation is easy. We don't have to do any array shuffling.
+ hitInMinimumTouchTarget(node, distanceFromEdge, childHitTest)
+ if (hitDepth + 1 == lastIndex) {
+ // Discard the hit because there were no child hits.
+ resizeToHitDepth()
+ }
+ return
+ }
+
+ // We have to tack the speculation to the end of the array
+ val previousHitDepth = hitDepth
+ hitDepth = lastIndex
+
+ hitInMinimumTouchTarget(node, distanceFromEdge, childHitTest)
+ if (hitDepth + 1 < lastIndex) {
+ // This was a successful hit, so we should move this to the previous hit depth
+ val fromIndex = hitDepth + 1
+ val toIndex = previousHitDepth + 1
+ values.copyInto(
+ destination = values,
+ destinationOffset = toIndex,
+ startIndex = fromIndex,
+ endIndex = size
+ )
+ distancesFromEdge.copyInto(
+ destination = distancesFromEdge,
+ destinationOffset = toIndex,
+ startIndex = fromIndex,
+ endIndex = size
+ )
+
+ // Discard the remainder of the hits
+ hitDepth = previousHitDepth + size - hitDepth - 1
+ }
+ resizeToHitDepth()
+ hitDepth = previousHitDepth
+ }
+
+ private fun ensureContainerSize() {
+ if (hitDepth >= values.size) {
+ val newSize = values.size + 16
+ values = values.copyOf(newSize)
+ distancesFromEdge = distancesFromEdge.copyOf(newSize)
+ }
+ }
+
+ override fun contains(element: T): Boolean = indexOf(element) != -1
+
+ override fun containsAll(elements: Collection<T>): Boolean {
+ elements.forEach {
+ if (!contains(it)) {
+ return false
+ }
+ }
+ return true
+ }
+
+ @Suppress("UNCHECKED_CAST")
+ override fun get(index: Int): T = values[index] as T
+
+ override fun indexOf(element: T): Int {
+ for (i in 0..lastIndex) {
+ if (values[i] == element) {
+ return i
+ }
+ }
+ return -1
+ }
+
+ override fun isEmpty(): Boolean = size == 0
+
+ override fun iterator(): Iterator<T> = HitTestResultIterator()
+
+ override fun lastIndexOf(element: T): Int {
+ for (i in lastIndex downTo 0) {
+ if (values[i] == element) {
+ return i
+ }
+ }
+ return -1
+ }
+
+ override fun listIterator(): ListIterator<T> = HitTestResultIterator()
+
+ override fun listIterator(index: Int): ListIterator<T> = HitTestResultIterator(index)
+
+ override fun subList(fromIndex: Int, toIndex: Int): List<T> =
+ SubList(fromIndex, toIndex)
+
+ /**
+ * Clears all entries to make an empty list.
+ */
+ fun clear() {
+ hitDepth = -1
+ resizeToHitDepth()
+ }
+
+ private inner class HitTestResultIterator(
+ var index: Int = 0,
+ val minIndex: Int = 0,
+ val maxIndex: Int = size
+ ) : ListIterator<T> {
+ override fun hasNext(): Boolean = index < maxIndex
+
+ override fun hasPrevious(): Boolean = index > minIndex
+
+ @Suppress("UNCHECKED_CAST")
+ override fun next(): T = values[index++] as T
+
+ override fun nextIndex(): Int = index - minIndex
+
+ @Suppress("UNCHECKED_CAST")
+ override fun previous(): T = values[--index] as T
+
+ override fun previousIndex(): Int = index - minIndex - 1
+ }
+
+ private inner class SubList(
+ val minIndex: Int,
+ val maxIndex: Int
+ ) : List<T> {
+ override val size: Int
+ get() = maxIndex - minIndex
+
+ override fun contains(element: T): Boolean = indexOf(element) != -1
+
+ override fun containsAll(elements: Collection<T>): Boolean {
+ elements.forEach {
+ if (!contains(it)) {
+ return false
+ }
+ }
+ return true
+ }
+
+ @Suppress("UNCHECKED_CAST")
+ override fun get(index: Int): T = values[index + minIndex] as T
+
+ override fun indexOf(element: T): Int {
+ for (i in minIndex..maxIndex) {
+ if (values[i] == element) {
+ return i - minIndex
+ }
+ }
+ return -1
+ }
+
+ override fun isEmpty(): Boolean = size == 0
+
+ override fun iterator(): Iterator<T> = HitTestResultIterator(minIndex, minIndex, maxIndex)
+
+ override fun lastIndexOf(element: T): Int {
+ for (i in maxIndex downTo minIndex) {
+ if (values[i] == element) {
+ return i - minIndex
+ }
+ }
+ return -1
+ }
+
+ override fun listIterator(): ListIterator<T> =
+ HitTestResultIterator(minIndex, minIndex, maxIndex)
+
+ override fun listIterator(index: Int): ListIterator<T> =
+ HitTestResultIterator(minIndex + index, minIndex, maxIndex)
+
+ override fun subList(fromIndex: Int, toIndex: Int): List<T> =
+ SubList(minIndex + fromIndex, minIndex + toIndex)
+ }
+}
\ No newline at end of file
diff --git a/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/node/InnerPlaceable.kt b/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/node/InnerPlaceable.kt
index a92a309..5a277e4 100644
--- a/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/node/InnerPlaceable.kt
+++ b/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/node/InnerPlaceable.kt
@@ -140,31 +140,32 @@
override fun hitTest(
pointerPosition: Offset,
- hitPointerInputFilters: MutableList<PointerInputFilter>
+ hitTestResult: HitTestResult<PointerInputFilter>,
+ isTouchEvent: Boolean
) {
- hitTestSubtree(pointerPosition, hitPointerInputFilters, LayoutNode::hitTest)
+ hitTestSubtree(pointerPosition, hitTestResult, isTouchEvent, LayoutNode::hitTest)
}
override fun hitTestSemantics(
pointerPosition: Offset,
- hitSemanticsWrappers: MutableList<SemanticsWrapper>
+ hitSemanticsWrappers: HitTestResult<SemanticsWrapper>
) {
- hitTestSubtree(pointerPosition, hitSemanticsWrappers, LayoutNode::hitTestSemantics)
+ hitTestSubtree(pointerPosition, hitSemanticsWrappers, true, LayoutNode::hitTestSemantics)
}
private inline fun <T> hitTestSubtree(
pointerPosition: Offset,
- hitResult: MutableList<T>,
- nodeHitTest: LayoutNode.(Offset, MutableList<T>) -> Unit
+ hitTestResult: HitTestResult<T>,
+ isTouchEvent: Boolean,
+ nodeHitTest: LayoutNode.(Offset, HitTestResult<T>, Boolean) -> Unit
) {
if (withinLayerBounds(pointerPosition)) {
- val originalSize = hitResult.size
// Any because as soon as true is returned, we know we have found a hit path and we must
// not add hit results on different paths so we should not even go looking.
layoutNode.zSortedChildren.reversedAny { child ->
if (child.isPlaced) {
- child.nodeHitTest(pointerPosition, hitResult)
- hitResult.size > originalSize
+ child.nodeHitTest(pointerPosition, hitTestResult, isTouchEvent)
+ hitTestResult.isHit
} else {
false
}
diff --git a/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/node/LayoutNode.kt b/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/node/LayoutNode.kt
index b553e6a2..9e3a1fd 100644
--- a/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/node/LayoutNode.kt
+++ b/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/node/LayoutNode.kt
@@ -55,6 +55,7 @@
import androidx.compose.ui.node.LayoutNode.LayoutState.NeedsRelayout
import androidx.compose.ui.node.LayoutNode.LayoutState.NeedsRemeasure
import androidx.compose.ui.node.LayoutNode.LayoutState.Ready
+import androidx.compose.ui.platform.ViewConfiguration
import androidx.compose.ui.platform.nativeClass
import androidx.compose.ui.platform.simpleIdentityToString
import androidx.compose.ui.semantics.SemanticsModifier
@@ -62,6 +63,7 @@
import androidx.compose.ui.semantics.outerSemantics
import androidx.compose.ui.unit.Constraints
import androidx.compose.ui.unit.Density
+import androidx.compose.ui.unit.DpSize
import androidx.compose.ui.unit.LayoutDirection
/**
@@ -513,6 +515,8 @@
}
}
+ override var viewConfiguration: ViewConfiguration = DummyViewConfiguration
+
private fun onDensityOrLayoutDirectionChanged() {
// measure/layout modifiers on the node
requestRemeasure()
@@ -825,28 +829,32 @@
* all [PointerInputModifier]s on all descendant [LayoutNode]s.
*
* If [pointerPosition] is within the bounds of any tested
- * [PointerInputModifier]s, the [PointerInputModifier] is added to [hitPointerInputFilters]
+ * [PointerInputModifier]s, the [PointerInputModifier] is added to [hitTestResult]
* and true is returned.
*
* @param pointerPosition The tested pointer position, which is relative to
* the LayoutNode.
- * @param hitPointerInputFilters The collection that the hit [PointerInputFilter]s will be
+ * @param hitTestResult The collection that the hit [PointerInputFilter]s will be
* added to if hit.
*/
internal fun hitTest(
pointerPosition: Offset,
- hitPointerInputFilters: MutableList<PointerInputFilter>
+ hitTestResult: HitTestResult<PointerInputFilter>,
+ isTouchEvent: Boolean = false
) {
val positionInWrapped = outerLayoutNodeWrapper.fromParentPosition(pointerPosition)
outerLayoutNodeWrapper.hitTest(
positionInWrapped,
- hitPointerInputFilters
+ hitTestResult,
+ isTouchEvent
)
}
+ @Suppress("UNUSED_PARAMETER")
internal fun hitTestSemantics(
pointerPosition: Offset,
- hitSemanticsWrappers: MutableList<SemanticsWrapper>
+ hitSemanticsWrappers: HitTestResult<SemanticsWrapper>,
+ isTouchEvent: Boolean = true
) {
val positionInWrapped = outerLayoutNodeWrapper.fromParentPosition(pointerPosition)
outerLayoutNodeWrapper.hitTestSemantics(
@@ -1335,6 +1343,23 @@
* Pre-allocated constructor to be used with ComposeNode
*/
internal val Constructor: () -> LayoutNode = { LayoutNode() }
+
+ /**
+ * All of these values are only used in tests. The real ViewConfiguration should
+ * be set in Layout()
+ */
+ internal val DummyViewConfiguration = object : ViewConfiguration {
+ override val longPressTimeoutMillis: Long
+ get() = 400L
+ override val doubleTapTimeoutMillis: Long
+ get() = 300L
+ override val doubleTapMinTimeMillis: Long
+ get() = 40L
+ override val touchSlop: Float
+ get() = 16f
+ override val minimumTouchTargetSize: DpSize
+ get() = DpSize.Zero
+ }
}
/**
@@ -1406,4 +1431,4 @@
wrapper.isChained = true
}
return this
-}
\ No newline at end of file
+}
diff --git a/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/node/LayoutNodeWrapper.kt b/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/node/LayoutNodeWrapper.kt
index bb72662..c44a5a4 100644
--- a/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/node/LayoutNodeWrapper.kt
+++ b/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/node/LayoutNodeWrapper.kt
@@ -24,6 +24,7 @@
import androidx.compose.ui.geometry.MutableRect
import androidx.compose.ui.geometry.Offset
import androidx.compose.ui.geometry.Rect
+import androidx.compose.ui.geometry.Size
import androidx.compose.ui.geometry.isFinite
import androidx.compose.ui.geometry.toRect
import androidx.compose.ui.graphics.Canvas
@@ -175,7 +176,7 @@
var isShallowPlacing = false
private var _rectCache: MutableRect? = null
- private val rectCache: MutableRect
+ protected val rectCache: MutableRect
get() = _rectCache ?: MutableRect(0f, 0f, 0f, 0f).also {
_rectCache = it
}
@@ -352,25 +353,28 @@
override val isValid: Boolean
get() = layer != null
+ protected val minimumTouchTargetSize: Size
+ get() = with(layerDensity) { layoutNode.viewConfiguration.minimumTouchTargetSize.toSize() }
+
/**
* Executes a hit test on any appropriate type associated with this [LayoutNodeWrapper].
*
- * Override appropriately to either add a [PointerInputFilter] to [hitPointerInputFilters] or
+ * Override appropriately to either add a [HitTestResult] to [hitTestResult] or
* to pass the execution on.
*
* @param pointerPosition The tested pointer position, which is relative to
* the [LayoutNodeWrapper].
- * @param hitPointerInputFilters The collection that the hit [PointerInputFilter]s will be
- * added to if hit.
+ * @param hitTestResult The parent [HitTestResult] that any hit should be added to.
*/
abstract fun hitTest(
pointerPosition: Offset,
- hitPointerInputFilters: MutableList<PointerInputFilter>
+ hitTestResult: HitTestResult<PointerInputFilter>,
+ isTouchEvent: Boolean
)
abstract fun hitTestSemantics(
pointerPosition: Offset,
- hitSemanticsWrappers: MutableList<SemanticsWrapper>
+ hitSemanticsWrappers: HitTestResult<SemanticsWrapper>
)
override fun windowToLocal(relativeToWindow: Offset): Offset {
@@ -547,7 +551,7 @@
* Modifies bounds to be in the parent LayoutNodeWrapper's coordinates, including clipping,
* if [clipBounds] is true.
*/
- private fun rectInParent(bounds: MutableRect, clipBounds: Boolean) {
+ internal fun rectInParent(bounds: MutableRect, clipBounds: Boolean) {
val layer = layer
if (layer != null) {
if (isClipping && clipBounds) {
diff --git a/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/node/PointerInputDelegatingWrapper.kt b/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/node/PointerInputDelegatingWrapper.kt
index cae95de..274124e 100644
--- a/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/node/PointerInputDelegatingWrapper.kt
+++ b/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/node/PointerInputDelegatingWrapper.kt
@@ -38,16 +38,34 @@
override fun hitTest(
pointerPosition: Offset,
- hitPointerInputFilters: MutableList<PointerInputFilter>
+ hitTestResult: HitTestResult<PointerInputFilter>,
+ isTouchEvent: Boolean
) {
- if (isPointerInBounds(pointerPosition) && withinLayerBounds(pointerPosition)) {
- // If the pointer is in bounds, we hit the pointer input filter, so add it!
- hitPointerInputFilters.add(modifier.pointerInputFilter)
-
- // Also, keep looking to see if we also might hit any children.
- // This avoids checking layer bounds twice as when we call super.hitTest()
- val positionInWrapped = wrapped.fromParentPosition(pointerPosition)
- wrapped.hitTest(positionInWrapped, hitPointerInputFilters)
+ if (!isTouchEvent) {
+ if (isPointerInBounds(pointerPosition) && withinLayerBounds(pointerPosition)) {
+ hitTestResult.hit(modifier.pointerInputFilter) {
+ hitTestChild(pointerPosition, hitTestResult, isTouchEvent)
+ }
+ }
+ } else {
+ hitTestInMinimumTouchTarget(
+ pointerPosition,
+ hitTestResult,
+ modifier.pointerInputFilter
+ ) {
+ hitTestChild(pointerPosition, hitTestResult, isTouchEvent)
+ }
}
}
+
+ private fun hitTestChild(
+ pointerPosition: Offset,
+ hitTestResult: HitTestResult<PointerInputFilter>,
+ isTouchEvent: Boolean
+ ) {
+ // Also, keep looking to see if we also might hit any children.
+ // This avoids checking layer bounds twice as when we call super.hitTest()
+ val positionInWrapped = wrapped.fromParentPosition(pointerPosition)
+ wrapped.hitTest(positionInWrapped, hitTestResult, isTouchEvent)
+ }
}
diff --git a/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/platform/InspectableValue.kt b/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/platform/InspectableValue.kt
index 87c1ac4..91e605d 100644
--- a/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/platform/InspectableValue.kt
+++ b/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/platform/InspectableValue.kt
@@ -17,6 +17,7 @@
package androidx.compose.ui.platform
import androidx.compose.runtime.InternalComposeApi
+import androidx.compose.ui.Modifier
/**
* An empty [InspectorInfo] DSL.
@@ -127,3 +128,63 @@
): InspectorInfo.() -> Unit =
@OptIn(InternalComposeApi::class)
if (isDebugInspectorInfoEnabled) ({ definitions() }) else NoInspectorInfo
+
+/**
+ * Use this to group a common set of modifiers and provide [InspectorInfo] for the resulting
+ * modifier.
+ *
+ * @sample androidx.compose.ui.samples.InspectableModifierSample
+ */
+inline fun Modifier.inspectable(
+ noinline inspectorInfo: InspectorInfo.() -> Unit,
+ wrapped: Modifier.() -> Modifier
+): Modifier = inspectableWrapper(inspectorInfo, wrapped())
+
+/**
+ * Do not use this explicitly. Instead use [Modifier.inspectable].
+ */
+@PublishedApi
+internal fun Modifier.inspectableWrapper(
+ inspectorInfo: InspectorInfo.() -> Unit,
+ wrapped: Modifier
+): Modifier = this.then(InspectableModifierImpl(wrapped, inspectorInfo))
+
+/**
+ * Interface for a [Modifier] wrapped for inspector purposes.
+ *
+ * This gives tools access to the [wrapped] modifier in InspectableModifier.
+ * It is expected that the implementation of this interface implements [Modifier.foldIn]
+ * similar to [InspectableModifierImpl].
+ */
+interface InspectableModifier {
+ /**
+ * The actual modifier that [Modifier.inspectable] has wrapped with its own [InspectorInfo].
+ */
+ val wrapped: Modifier
+}
+
+private class InspectableModifierImpl(
+ override val wrapped: Modifier,
+ inspectorInfo: InspectorInfo.() -> Unit
+) : Modifier.Element, InspectableModifier, InspectorValueInfo(inspectorInfo) {
+ override fun <R> foldIn(initial: R, operation: (R, Modifier.Element) -> R): R =
+ wrapped.foldIn(operation(initial, this), operation)
+
+ override fun <R> foldOut(initial: R, operation: (Modifier.Element, R) -> R): R =
+ operation(this, wrapped.foldOut(initial, operation))
+
+ override fun any(predicate: (Modifier.Element) -> Boolean): Boolean =
+ wrapped.any(predicate)
+
+ override fun all(predicate: (Modifier.Element) -> Boolean): Boolean =
+ wrapped.all(predicate)
+
+ override fun equals(other: Any?): Boolean =
+ other is InspectableModifier && wrapped == other.wrapped
+
+ override fun hashCode(): Int = wrapped.hashCode() + 31
+
+ override fun toString() = "[" + foldIn("") { acc, element ->
+ if (acc.isEmpty()) element.toString() else "$acc, $element"
+ } + "]"
+}
diff --git a/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/platform/ViewConfiguration.kt b/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/platform/ViewConfiguration.kt
index 9a3e115..c6f26fd 100644
--- a/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/platform/ViewConfiguration.kt
+++ b/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/platform/ViewConfiguration.kt
@@ -16,6 +16,9 @@
package androidx.compose.ui.platform
+import androidx.compose.ui.unit.DpSize
+import androidx.compose.ui.unit.dp
+
/**
* Contains methods to standard constants used in the UI for timeouts, sizes, and distances.
*/
@@ -41,4 +44,12 @@
* Distance in pixels a touch can wander before we think the user is scrolling.
*/
val touchSlop: Float
-}
+
+ /**
+ * The minimum touch target size. If layout has reduced the pointer input bounds below this,
+ * the touch target will be expanded evenly around the layout to ensure that it is at least
+ * this big.
+ */
+ val minimumTouchTargetSize: DpSize
+ get() = DpSize(48.dp, 48.dp)
+}
\ No newline at end of file
diff --git a/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/semantics/SemanticsNode.kt b/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/semantics/SemanticsNode.kt
index 41b1f8b..ae27a54 100644
--- a/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/semantics/SemanticsNode.kt
+++ b/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/semantics/SemanticsNode.kt
@@ -19,16 +19,15 @@
import androidx.compose.ui.geometry.Offset
import androidx.compose.ui.geometry.Rect
import androidx.compose.ui.layout.AlignmentLine
-import androidx.compose.ui.layout.boundsInRoot
import androidx.compose.ui.layout.positionInRoot
import androidx.compose.ui.layout.LayoutInfo
-import androidx.compose.ui.layout.boundsInWindow
import androidx.compose.ui.layout.positionInWindow
import androidx.compose.ui.node.LayoutNode
import androidx.compose.ui.node.LayoutNodeWrapper
import androidx.compose.ui.node.RootForTest
import androidx.compose.ui.unit.IntSize
import androidx.compose.ui.util.fastForEach
+import kotlin.math.roundToInt
/**
* A list of key/value pairs associated with a layout node or its subtree.
@@ -84,7 +83,10 @@
/**
* The size of the bounding box for this node, with no clipping applied
*/
- val size: IntSize get() = findWrapperToGetBounds().size
+ val size: IntSize get() {
+ val size = findWrapperToGetBounds().semanticsSize
+ return IntSize(size.width.roundToInt(), size.height.roundToInt())
+ }
/**
* The bounding box for this node relative to the root of this Compose hierarchy, with
@@ -94,7 +96,7 @@
val boundsInRoot: Rect
get() {
if (!layoutNode.isAttached) return Rect.Zero
- return this.findWrapperToGetBounds().boundsInRoot()
+ return findWrapperToGetBounds().semanticsBoundsInRoot()
}
/**
@@ -104,7 +106,7 @@
val positionInRoot: Offset
get() {
if (!layoutNode.isAttached) return Offset.Zero
- return findWrapperToGetBounds().positionInRoot()
+ return findWrapperToGetBounds().semanticsPositionInRoot()
}
/**
@@ -114,7 +116,7 @@
val boundsInWindow: Rect
get() {
if (!layoutNode.isAttached) return Rect.Zero
- return findWrapperToGetBounds().boundsInWindow()
+ return findWrapperToGetBounds().semanticsBoundsInWindow()
}
/**
@@ -123,7 +125,7 @@
val positionInWindow: Offset
get() {
if (!layoutNode.isAttached) return Offset.Zero
- return findWrapperToGetBounds().positionInWindow()
+ return findWrapperToGetBounds().semanticsPositionInWindow()
}
/**
@@ -319,7 +321,7 @@
* of use cases it means that accessibility bounds will be equal to the clickable area.
* Otherwise the outermost semantics will be used to report bounds, size and position.
*/
- private fun findWrapperToGetBounds(): LayoutNodeWrapper {
+ private fun findWrapperToGetBounds(): SemanticsWrapper {
return if (unmergedConfig.isMergingSemanticsOfDescendants) {
layoutNode.outerMergingSemantics ?: outerSemanticsNodeWrapper
} else {
diff --git a/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/semantics/SemanticsProperties.kt b/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/semantics/SemanticsProperties.kt
index 0798b76..d24f050 100644
--- a/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/semantics/SemanticsProperties.kt
+++ b/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/semantics/SemanticsProperties.kt
@@ -824,8 +824,7 @@
*
* The presence of this property indicates that the element is toggleable.
*/
-var SemanticsPropertyReceiver.toggleableState
-by SemanticsProperties.ToggleableState
+var SemanticsPropertyReceiver.toggleableState by SemanticsProperties.ToggleableState
/**
* The node is marked as a password.
diff --git a/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/semantics/SemanticsWrapper.kt b/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/semantics/SemanticsWrapper.kt
index af6c6a6..40218de 100644
--- a/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/semantics/SemanticsWrapper.kt
+++ b/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/semantics/SemanticsWrapper.kt
@@ -16,21 +16,47 @@
package androidx.compose.ui.semantics
+import androidx.compose.ui.geometry.MutableRect
import androidx.compose.ui.geometry.Offset
+import androidx.compose.ui.geometry.Rect
+import androidx.compose.ui.geometry.Size
+import androidx.compose.ui.geometry.toRect
+import androidx.compose.ui.layout.boundsInRoot
+import androidx.compose.ui.layout.boundsInWindow
+import androidx.compose.ui.layout.findRoot
+import androidx.compose.ui.layout.positionInRoot
import androidx.compose.ui.node.DelegatingLayoutNodeWrapper
+import androidx.compose.ui.node.HitTestResult
import androidx.compose.ui.node.LayoutNodeWrapper
+import androidx.compose.ui.node.requireOwner
+import androidx.compose.ui.unit.toSize
internal class SemanticsWrapper(
wrapped: LayoutNodeWrapper,
semanticsModifier: SemanticsModifier
) : DelegatingLayoutNodeWrapper<SemanticsModifier>(wrapped, semanticsModifier) {
+ val semanticsSize: Size
+ get() {
+ val measuredSize = measuredSize
+ if (!useMinimumTouchTarget) {
+ return measuredSize.toSize()
+ }
+ val minTouchTargetSize = minimumTouchTargetSize
+ val width = maxOf(measuredSize.width.toFloat(), minTouchTargetSize.width)
+ val height = maxOf(measuredSize.height.toFloat(), minTouchTargetSize.height)
+ return Size(width, height)
+ }
+
+ private val useMinimumTouchTarget: Boolean
+ get() = modifier.semanticsConfiguration.getOrNull(SemanticsActions.OnClick) != null
+
fun collapsedSemanticsConfiguration(): SemanticsConfiguration {
val nextSemantics = wrapped.nearestSemantics { true }
if (nextSemantics == null || modifier.semanticsConfiguration.isClearingSemantics) {
return modifier.semanticsConfiguration
}
- var config = modifier.semanticsConfiguration.copy()
+ val config = modifier.semanticsConfiguration.copy()
config.collapsePeer(nextSemantics.collapsedSemanticsConfiguration())
return config
}
@@ -51,13 +77,86 @@
override fun hitTestSemantics(
pointerPosition: Offset,
- hitSemanticsWrappers: MutableList<SemanticsWrapper>
+ hitSemanticsWrappers: HitTestResult<SemanticsWrapper>
) {
- if (isPointerInBounds(pointerPosition) && withinLayerBounds(pointerPosition)) {
- hitSemanticsWrappers.add(this)
-
+ hitTestInMinimumTouchTarget(
+ pointerPosition,
+ hitSemanticsWrappers,
+ this
+ ) {
+ // Also, keep looking to see if we also might hit any children.
+ // This avoids checking layer bounds twice as when we call super.hitTest()
val positionInWrapped = wrapped.fromParentPosition(pointerPosition)
wrapped.hitTestSemantics(positionInWrapped, hitSemanticsWrappers)
}
}
+
+ fun semanticsPositionInRoot(): Offset {
+ if (!useMinimumTouchTarget) {
+ return positionInRoot()
+ }
+ check(isAttached) { ExpectAttachedLayoutCoordinates }
+ val root = findRoot()
+
+ val padding = calculateMinimumTouchTargetPadding(minimumTouchTargetSize)
+ val left = -padding.width
+ val top = -padding.height
+
+ return root.localPositionOf(this, Offset(left, top))
+ }
+
+ fun semanticsPositionInWindow(): Offset {
+ val positionInRoot = semanticsPositionInRoot()
+ return layoutNode.requireOwner().calculatePositionInWindow(positionInRoot)
+ }
+
+ fun semanticsBoundsInRoot(): Rect {
+ if (!useMinimumTouchTarget) {
+ return boundsInRoot()
+ }
+ return calculateBoundsInRoot().toRect()
+ }
+
+ fun semanticsBoundsInWindow(): Rect {
+ if (!useMinimumTouchTarget) {
+ return boundsInWindow()
+ }
+ val bounds = calculateBoundsInRoot()
+
+ val root = findRoot()
+ val topLeft = root.localToWindow(Offset(bounds.left, bounds.top))
+ val topRight = root.localToWindow(Offset(bounds.right, bounds.top))
+ val bottomRight = root.localToWindow(Offset(bounds.right, bounds.bottom))
+ val bottomLeft = root.localToWindow(Offset(bounds.left, bounds.bottom))
+ val left = minOf(topLeft.x, topRight.x, bottomLeft.x, bottomRight.x)
+ val top = minOf(topLeft.y, topRight.y, bottomLeft.y, bottomRight.y)
+ val right = maxOf(topLeft.x, topRight.x, bottomLeft.x, bottomRight.x)
+ val bottom = maxOf(topLeft.y, topRight.y, bottomLeft.y, bottomRight.y)
+
+ return Rect(left, top, right, bottom)
+ }
+
+ private fun calculateBoundsInRoot(): MutableRect {
+ check(isAttached) { ExpectAttachedLayoutCoordinates }
+ val root = findRoot()
+
+ val bounds = rectCache
+ val padding = calculateMinimumTouchTargetPadding(minimumTouchTargetSize)
+ bounds.left = -padding.width
+ bounds.top = -padding.height
+ bounds.right = measuredWidth + padding.width
+ bounds.bottom = measuredHeight + padding.height
+
+ var wrapper: LayoutNodeWrapper = this
+ while (wrapper !== root) {
+ wrapper.rectInParent(bounds, true)
+ if (bounds.isEmpty) {
+ bounds.set(0f, 0f, 0f, 0f)
+ return bounds
+ }
+
+ wrapper = wrapper.wrappedBy!!
+ }
+ return bounds
+ }
}
diff --git a/compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/awt/ComposeDialog.desktop.kt b/compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/awt/ComposeDialog.desktop.kt
index 3185cb4..6f6d33f 100644
--- a/compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/awt/ComposeDialog.desktop.kt
+++ b/compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/awt/ComposeDialog.desktop.kt
@@ -36,7 +36,7 @@
owner: Window? = null,
modalityType: ModalityType = ModalityType.MODELESS
) : JDialog(owner, modalityType) {
- private val delegate = ComposeWindowDelegate()
+ private val delegate = ComposeWindowDelegate(this)
internal val layer get() = delegate.layer
init {
diff --git a/compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/awt/ComposeWindow.desktop.kt b/compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/awt/ComposeWindow.desktop.kt
index 0eba709..9ba240f 100644
--- a/compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/awt/ComposeWindow.desktop.kt
+++ b/compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/awt/ComposeWindow.desktop.kt
@@ -33,7 +33,7 @@
* ComposeWindow inherits javax.swing.JFrame.
*/
class ComposeWindow : JFrame() {
- private val delegate = ComposeWindowDelegate()
+ private val delegate = ComposeWindowDelegate(this)
internal val layer get() = delegate.layer
init {
diff --git a/compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/awt/ComposeWindowDelegate.desktop.kt b/compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/awt/ComposeWindowDelegate.desktop.kt
index 06bcd46..ce63cab 100644
--- a/compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/awt/ComposeWindowDelegate.desktop.kt
+++ b/compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/awt/ComposeWindowDelegate.desktop.kt
@@ -20,16 +20,18 @@
import androidx.compose.runtime.CompositionContext
import androidx.compose.runtime.CompositionLocalProvider
import androidx.compose.ui.input.key.KeyEvent
+import androidx.compose.ui.window.LocalWindow
import org.jetbrains.skiko.ClipComponent
import org.jetbrains.skiko.GraphicsApi
import org.jetbrains.skiko.SkiaLayer
import java.awt.Component
+import java.awt.Window
import java.awt.event.MouseListener
import java.awt.event.MouseMotionListener
import java.awt.event.MouseWheelListener
import javax.swing.JLayeredPane
-internal class ComposeWindowDelegate {
+internal class ComposeWindowDelegate(private val window: Window) {
private var isDisposed = false
val layer = ComposeLayer()
@@ -87,6 +89,7 @@
onKeyEvent = onKeyEvent,
) {
CompositionLocalProvider(
+ LocalWindow provides window,
LocalLayerContainer provides pane
) {
content()
diff --git a/compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/platform/DesktopOwner.desktop.kt b/compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/platform/DesktopOwner.desktop.kt
index 24552d8..99f8808 100644
--- a/compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/platform/DesktopOwner.desktop.kt
+++ b/compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/platform/DesktopOwner.desktop.kt
@@ -55,6 +55,7 @@
import androidx.compose.ui.input.pointer.TestPointerInputEventData
import androidx.compose.ui.layout.RootMeasurePolicy
import androidx.compose.ui.layout.boundsInWindow
+import androidx.compose.ui.node.HitTestResult
import androidx.compose.ui.node.InternalCoreApi
import androidx.compose.ui.node.LayoutNode
import androidx.compose.ui.node.LayoutNodeDrawScope
@@ -336,7 +337,7 @@
internal fun onMouseScroll(position: Offset, event: MouseScrollEvent) {
measureAndLayout()
- val inputFilters = mutableListOf<PointerInputFilter>()
+ val inputFilters = HitTestResult<PointerInputFilter>()
root.hitTest(position, inputFilters)
for (
@@ -351,7 +352,7 @@
}
private var oldMoveFilters = listOf<PointerMoveEventFilter>()
- private var newMoveFilters = mutableListOf<PointerInputFilter>()
+ private val newMoveFilters = HitTestResult<PointerInputFilter>()
internal fun onPointerMove(position: Offset) {
// TODO: do we actually need that?
@@ -391,7 +392,7 @@
}
oldMoveFilters = newMoveFilters.filterIsInstance<PointerMoveEventFilter>()
- newMoveFilters = mutableListOf()
+ newMoveFilters.clear()
}
internal fun onPointerEnter(position: Offset) {
@@ -410,7 +411,7 @@
}
}
oldMoveFilters = newMoveFilters.filterIsInstance<PointerMoveEventFilter>()
- newMoveFilters = mutableListOf()
+ newMoveFilters.clear()
}
internal fun onPointerExit() {
@@ -421,6 +422,6 @@
}
}
oldMoveFilters = listOf()
- newMoveFilters = mutableListOf()
+ newMoveFilters.clear()
}
}
diff --git a/compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/util/Windows.desktop.kt b/compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/util/Windows.desktop.kt
index 85323c3..4a6b15f 100644
--- a/compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/util/Windows.desktop.kt
+++ b/compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/util/Windows.desktop.kt
@@ -18,6 +18,7 @@
import androidx.compose.ui.Alignment
import androidx.compose.ui.awt.ComposeWindow
+import androidx.compose.ui.geometry.Size
import androidx.compose.ui.graphics.asAwtImage
import androidx.compose.ui.graphics.painter.Painter
import androidx.compose.ui.unit.IntSize
@@ -145,6 +146,11 @@
}
}
+// In fact, this size doesn't affect anything on Windows/Linux, and isn't used by macOs (macOs
+// doesn't have separate Window icons). We specify it to support Painter's with
+// Unspecified intrinsicSize
+private val iconSize = Size(32f, 32f)
+
internal fun Window.setIcon(painter: Painter?) {
- setIconImage(painter?.asAwtImage(density, layoutDirection))
+ setIconImage(painter?.asAwtImage(density, layoutDirection, iconSize))
}
diff --git a/compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/window/Application.desktop.kt b/compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/window/Application.desktop.kt
index 981048f..8073778 100644
--- a/compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/window/Application.desktop.kt
+++ b/compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/window/Application.desktop.kt
@@ -160,8 +160,6 @@
var isOpen by mutableStateOf(true)
val applicationScope = object : ApplicationScope {
- override val ownerWindow: Window? get() = null
-
override fun exitApplication() {
isOpen = false
}
@@ -196,7 +194,7 @@
}
}
-interface ApplicationScope : OwnerWindowScope {
+interface ApplicationScope {
fun exitApplication()
}
diff --git a/compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/window/AwtWindow.desktop.kt b/compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/window/AwtWindow.desktop.kt
index ee17d49..3b046e3 100644
--- a/compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/window/AwtWindow.desktop.kt
+++ b/compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/window/AwtWindow.desktop.kt
@@ -60,7 +60,7 @@
@OptIn(DelicateCoroutinesApi::class)
@Suppress("unused")
@Composable
-fun <T : Window> OwnerWindowScope.AwtWindow(
+fun <T : Window> AwtWindow(
visible: Boolean = true,
create: () -> T,
dispose: (T) -> Unit,
diff --git a/compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/window/DesktopPopup.desktop.kt b/compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/window/DesktopPopup.desktop.kt
index 0cb06a1..bb9e977 100644
--- a/compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/window/DesktopPopup.desktop.kt
+++ b/compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/window/DesktopPopup.desktop.kt
@@ -23,6 +23,7 @@
import androidx.compose.runtime.rememberCompositionContext
import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment
+import androidx.compose.ui.ExperimentalComposeUiApi
import androidx.compose.ui.Modifier
import androidx.compose.ui.awt.LocalLayerContainer
import androidx.compose.ui.geometry.Offset
@@ -33,9 +34,13 @@
import androidx.compose.ui.platform.LocalDensity
import androidx.compose.ui.platform.LocalDesktopOwners
import androidx.compose.ui.platform.setContent
+import androidx.compose.ui.unit.Dp
+import androidx.compose.ui.unit.DpOffset
import androidx.compose.ui.unit.IntOffset
import androidx.compose.ui.unit.IntRect
import androidx.compose.ui.unit.IntSize
+import androidx.compose.ui.unit.LayoutDirection
+import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.round
/**
@@ -99,8 +104,6 @@
* @param popupPositionProvider Provides the screen position of the popup.
* @param onDismissRequest Executes when the user clicks outside of the popup.
* @param focusable Indicates if the popup can grab the focus.
- * @property contextMenu Places the popup window below the lower-right rectangle of the mouse
- * cursor image (basic context menu behaviour).
* @param onPreviewKeyEvent This callback is invoked when the user interacts with the hardware
* keyboard. It gives ancestors of a focused component the chance to intercept a [KeyEvent].
* Return true to stop propagation of this event. If you return false, the key event will be
@@ -118,13 +121,11 @@
onPreviewKeyEvent: ((KeyEvent) -> Boolean) = { false },
onKeyEvent: ((KeyEvent) -> Boolean) = { false },
focusable: Boolean = false,
- contextMenu: Boolean = false,
content: @Composable () -> Unit
) {
PopupLayout(
popupPositionProvider,
focusable,
- contextMenu,
onDismissRequest,
onPreviewKeyEvent,
onKeyEvent,
@@ -136,7 +137,6 @@
private fun PopupLayout(
popupPositionProvider: PopupPositionProvider,
focusable: Boolean,
- contextMenu: Boolean,
onDismissRequest: (() -> Unit)?,
onPreviewKeyEvent: ((KeyEvent) -> Boolean) = { false },
onKeyEvent: ((KeyEvent) -> Boolean) = { false },
@@ -144,11 +144,9 @@
) {
val owners = LocalDesktopOwners.current
val density = LocalDensity.current
- val component = if (contextMenu) LocalLayerContainer.current else null
var parentBounds by remember { mutableStateOf(IntRect.Zero) }
var popupBounds by remember { mutableStateOf(IntRect.Zero) }
- val pointClick = remember { component?.getMousePosition() }
// getting parent bounds
Layout(
@@ -191,20 +189,13 @@
layout(constraints.maxWidth, constraints.maxHeight) {
measurables.forEach {
val placeable = it.measure(constraints)
- var position: IntOffset
- if (contextMenu) {
- position = IntOffset(
- (pointClick!!.x * density.density).toInt(),
- (pointClick.y * density.density).toInt()
- )
- } else {
- position = popupPositionProvider.calculatePosition(
- anchorBounds = parentBounds,
- windowSize = windowSize,
- layoutDirection = layoutDirection,
- popupContentSize = IntSize(placeable.width, placeable.height)
- )
- }
+ val position = popupPositionProvider.calculatePosition(
+ anchorBounds = parentBounds,
+ windowSize = windowSize,
+ layoutDirection = layoutDirection,
+ popupContentSize = IntSize(placeable.width, placeable.height)
+ )
+
popupBounds = IntRect(
position,
IntSize(placeable.width, placeable.height)
@@ -230,3 +221,104 @@
private fun isOutsideRectTap(rect: IntRect, point: Offset): Boolean {
return !rect.contains(IntOffset(point.x.toInt(), point.y.toInt()))
}
+
+/**
+ * Provides [PopupPositionProvider] relative to the current mouse cursor position.
+ *
+ * @param offset [DpOffset] to be added to the position of the popup.
+ * @param alignment The alignment of the popup relative to the current cursor position.
+ * @param windowMargin Defines the area within the window that limits the placement of the popup.
+ */
+@ExperimentalComposeUiApi
+@Composable
+fun rememberCursorPositionProvider(
+ offset: DpOffset = DpOffset.Zero,
+ alignment: Alignment = Alignment.BottomEnd,
+ windowMargin: Dp = 4.dp
+): PopupPositionProvider = with(LocalDensity.current) {
+ val component = LocalLayerContainer.current
+ val cursorPoint = remember {
+ val awtMousePosition = component.mousePosition
+ IntOffset(
+ (awtMousePosition.x * density).toInt(),
+ (awtMousePosition.y * density).toInt()
+ )
+ }
+ val offsetPx = IntOffset(offset.x.roundToPx(), offset.y.roundToPx())
+ val windowMarginPx = windowMargin.roundToPx()
+ object : PopupPositionProvider {
+ override fun calculatePosition(
+ anchorBounds: IntRect,
+ windowSize: IntSize,
+ layoutDirection: LayoutDirection,
+ popupContentSize: IntSize
+ ) = with(density) {
+ val anchor = IntRect(cursorPoint, IntSize.Zero)
+ val tooltipArea = IntRect(
+ IntOffset(
+ anchor.left - popupContentSize.width,
+ anchor.top - popupContentSize.height,
+ ),
+ IntSize(
+ popupContentSize.width * 2,
+ popupContentSize.height * 2
+ )
+ )
+ val position = alignment.align(popupContentSize, tooltipArea.size, layoutDirection)
+ var x = tooltipArea.left + position.x + offsetPx.x
+ var y = tooltipArea.top + position.y + offsetPx.y
+ if (x + popupContentSize.width > windowSize.width - windowMarginPx) {
+ x -= popupContentSize.width
+ }
+ if (y + popupContentSize.height > windowSize.height - windowMarginPx) {
+ y -= popupContentSize.height + anchor.height
+ }
+ if (x < windowMarginPx) {
+ x = windowMarginPx
+ }
+ if (y < windowMarginPx) {
+ y = windowMarginPx
+ }
+ IntOffset(x, y)
+ }
+ }
+}
+
+/**
+ * Provides [PopupPositionProvider] relative to the current component bounds.
+ *
+ * @param anchor The anchor point relative to the current component bounds.
+ * @param alignment The alignment of the popup relative to the [anchor] point.
+ * @param offset [DpOffset] to be added to the position of the popup.
+ */
+@ExperimentalComposeUiApi
+@Composable
+fun rememberComponentRectPositionProvider(
+ anchor: Alignment = Alignment.BottomCenter,
+ alignment: Alignment = Alignment.BottomCenter,
+ offset: DpOffset = DpOffset.Zero
+): PopupPositionProvider = with(LocalDensity.current) {
+ val offsetPx = IntOffset(offset.x.roundToPx(), offset.y.roundToPx())
+ return object : PopupPositionProvider {
+ override fun calculatePosition(
+ anchorBounds: IntRect,
+ windowSize: IntSize,
+ layoutDirection: LayoutDirection,
+ popupContentSize: IntSize
+ ): IntOffset {
+ val anchorPoint = anchor.align(IntSize.Zero, anchorBounds.size, layoutDirection)
+ val tooltipArea = IntRect(
+ IntOffset(
+ anchorBounds.left + anchorPoint.x - popupContentSize.width,
+ anchorBounds.top + anchorPoint.y - popupContentSize.height,
+ ),
+ IntSize(
+ popupContentSize.width * 2,
+ popupContentSize.height * 2
+ )
+ )
+ val position = alignment.align(popupContentSize, tooltipArea.size, layoutDirection)
+ return tooltipArea.topLeft + position + offsetPx
+ }
+ }
+}
diff --git a/compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/window/Dialog.desktop.kt b/compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/window/Dialog.desktop.kt
index 7616158..f9b2450 100644
--- a/compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/window/Dialog.desktop.kt
+++ b/compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/window/Dialog.desktop.kt
@@ -90,7 +90,7 @@
* @param content content of the dialog
*/
@Composable
-fun OwnerWindowScope.Dialog(
+fun Dialog(
onCloseRequest: () -> Unit,
state: DialogState = rememberDialogState(),
visible: Boolean = true,
@@ -104,7 +104,7 @@
onKeyEvent: ((KeyEvent) -> Boolean) = { false },
content: @Composable DialogWindowScope.() -> Unit
) {
- val owner = this.ownerWindow
+ val owner = LocalWindow.current
val currentState by rememberUpdatedState(state)
val currentTitle by rememberUpdatedState(title)
@@ -202,7 +202,7 @@
*/
@Suppress("unused")
@Composable
-fun OwnerWindowScope.Dialog(
+fun Dialog(
visible: Boolean = true,
onPreviewKeyEvent: ((KeyEvent) -> Boolean) = { false },
onKeyEvent: ((KeyEvent) -> Boolean) = { false },
diff --git a/compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/window/OwnerWindowScope.kt b/compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/window/LocalWindow.kt
similarity index 61%
copy from compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/window/OwnerWindowScope.kt
copy to compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/window/LocalWindow.kt
index b641fea..3b8921b 100644
--- a/compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/window/OwnerWindowScope.kt
+++ b/compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/window/LocalWindow.kt
@@ -16,15 +16,14 @@
package androidx.compose.ui.window
+import androidx.compose.ui.awt.ComposeDialog
+import androidx.compose.ui.awt.ComposePanel
+import androidx.compose.ui.awt.ComposeWindow
+import androidx.compose.runtime.compositionLocalOf
import java.awt.Window
/**
- * Scope that is created by [application], [Window] or [Dialog] and provides an owner window of
- * this scope
+ * Window-owner of the current composition (for example, [ComposeWindow] or [ComposeDialog]).
+ * If the composition is not inside Window (for example, [ComposePanel]), then return null
*/
-interface OwnerWindowScope {
- /**
- * Owner window of this scope
- */
- val ownerWindow: Window?
-}
\ No newline at end of file
+internal val LocalWindow = compositionLocalOf<Window?> { null }
\ No newline at end of file
diff --git a/compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/window/Menu.desktop.kt b/compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/window/Menu.desktop.kt
index 9d520bf..d8e22ef 100644
--- a/compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/window/Menu.desktop.kt
+++ b/compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/window/Menu.desktop.kt
@@ -119,7 +119,7 @@
parentComposition: CompositionContext,
content: @Composable (MenuScope.() -> Unit)
): Composition {
- val applier = MutableListApplier(asMutableList())
+ val applier = JMenuItemApplier(this)
val composition = Composition(applier, parentComposition)
val scope = MenuScope(SwingMenuScope())
composition.setContent {
@@ -154,33 +154,6 @@
)
}
-@Composable
-private fun SwingMenu(
- text: String,
- enabled: Boolean,
- mnemonic: Char?,
- content: @Composable MenuScope.() -> Unit
-) {
- val menu = remember(::JMenu)
- val compositionContext = rememberCompositionContext()
-
- DisposableEffect(Unit) {
- val composition = menu.setContent(compositionContext, content)
- onDispose {
- composition.dispose()
- }
- }
-
- ComposeNode<JMenu, MutableListApplier<JComponent>>(
- factory = { menu },
- update = {
- set(text, JMenu::setText)
- set(enabled, JMenu::setEnabled)
- set(mnemonic, JMenu::setMnemonic)
- }
- )
-}
-
// TODO(demin): consider making MenuBarScope/MenuScope as an interface
// after b/165812010 will be fixed
/**
@@ -204,12 +177,26 @@
mnemonic: Char? = null,
enabled: Boolean = true,
content: @Composable MenuScope.() -> Unit
- ): Unit = SwingMenu(
- text,
- enabled,
- mnemonic,
- content
- )
+ ) {
+ val menu = remember(::JMenu)
+ val compositionContext = rememberCompositionContext()
+
+ DisposableEffect(Unit) {
+ val composition = menu.setContent(compositionContext, content)
+ onDispose {
+ composition.dispose()
+ }
+ }
+
+ ComposeNode<JMenu, MutableListApplier<JComponent>>(
+ factory = { menu },
+ update = {
+ set(text, JMenu::setText)
+ set(enabled, JMenu::setEnabled)
+ set(mnemonic, JMenu::setMnemonic)
+ }
+ )
+ }
}
internal interface MenuScopeImpl {
@@ -399,16 +386,24 @@
enabled: Boolean,
mnemonic: Char?,
content: @Composable MenuScope.() -> Unit
- ): Unit = SwingMenu(
- text,
- enabled,
- mnemonic,
- content
- )
+ ) {
+ ComposeNode<JMenu, JMenuItemApplier>(
+ factory = { JMenu() },
+ update = {
+ set(text, JMenu::setText)
+ set(enabled, JMenu::setEnabled)
+ set(mnemonic, JMenu::setMnemonic)
+ },
+ content = {
+ val scope = MenuScope(this)
+ scope.content()
+ }
+ )
+ }
@Composable
override fun Separator() {
- ComposeNode<JComponent, MutableListApplier<JComponent>>(
+ ComposeNode<JPopupMenu.Separator, JMenuItemApplier>(
// item with name "-" has different look
factory = { JPopupMenu.Separator() },
update = {}
@@ -427,7 +422,7 @@
val currentOnClick by rememberUpdatedState(onClick)
val awtIcon = rememberAwtIcon(icon)
- ComposeNode<JMenuItem, MutableListApplier<JComponent>>(
+ ComposeNode<JMenuItem, JMenuItemApplier>(
factory = {
JMenuItem().apply {
addActionListener {
@@ -462,7 +457,7 @@
JCheckBoxMenuItem::getState
)
- ComposeNode<JCheckBoxMenuItem, MutableListApplier<JComponent>>(
+ ComposeNode<JCheckBoxMenuItem, JMenuItemApplier>(
factory = {
JCheckBoxMenuItem().apply {
addItemListener {
@@ -499,7 +494,7 @@
JRadioButtonMenuItem::isSelected
)
- ComposeNode<JRadioButtonMenuItem, MutableListApplier<JComponent>>(
+ ComposeNode<JRadioButtonMenuItem, JMenuItemApplier>(
factory = {
JRadioButtonMenuItem().apply {
addItemListener {
@@ -664,25 +659,76 @@
}
}
-private fun JMenuBar.asMutableList(): MutableList<JComponent> {
- return object : AddRemoveMutableList<JComponent>() {
- override val size: Int get() = this@asMutableList.menuCount
- override fun get(index: Int) = this@asMutableList.getMenu(index)
-
- override fun performAdd(element: JComponent) {
- this@asMutableList.add(element)
+// Copied from androidx/compose/ui/graphics/vector/Vector.kt
+private inline fun <T> performMove(
+ from: Int,
+ to: Int,
+ count: Int,
+ getItem: (Int) -> T,
+ removeItem: (Int) -> Unit,
+ insertItem: (T, Int) -> Unit
+) {
+ if (from > to) {
+ var current = to
+ repeat(count) {
+ val node = getItem(from)
+ removeItem(from)
+ insertItem(node, current)
+ current++
}
-
- override fun performRemove(index: Int) {
- this@asMutableList.remove(index)
+ } else {
+ repeat(count) {
+ val node = getItem(from)
+ removeItem(from)
+ insertItem(node, to - 1)
}
}
}
-private fun JMenu.asMutableList(): MutableList<JComponent> {
+internal abstract class JComponentApplier(root: JComponent) : AbstractApplier<JComponent>(root) {
+ override fun onClear() {
+ root.removeAll()
+ }
+
+ override fun insertBottomUp(index: Int, instance: JComponent) {
+ // Ignored as the tree is built top-down.
+ }
+
+ override fun insertTopDown(index: Int, instance: JComponent) {
+ current.add(instance, index)
+ }
+
+ override fun move(from: Int, to: Int, count: Int) {
+ val current = current
+
+ performMove(
+ from, to, count,
+ getItem = { current.getComponent(it) },
+ removeItem = { current.remove(it) },
+ insertItem = { item, idx -> current.add(item, idx) }
+ )
+ }
+
+ override fun remove(index: Int, count: Int) {
+ val current = current
+ for (i in index + count - 1 downTo index) {
+ current.remove(i)
+ }
+ }
+}
+
+internal class JMenuItemApplier(root: JMenu) : JComponentApplier(root) {
+ override fun onEndChanges() {
+ // If the menu is changed while the popup is open, we need to ask the popup to remeasure
+ // itself.
+ (root as JMenu).popupMenu.pack()
+ }
+}
+
+private fun JMenuBar.asMutableList(): MutableList<JComponent> {
return object : AddRemoveMutableList<JComponent>() {
- override val size: Int get() = this@asMutableList.itemCount
- override fun get(index: Int) = this@asMutableList.getMenuComponent(index) as JComponent
+ override val size: Int get() = this@asMutableList.menuCount
+ override fun get(index: Int) = this@asMutableList.getMenu(index)
override fun performAdd(element: JComponent) {
this@asMutableList.add(element)
diff --git a/compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/window/Tray.desktop.kt b/compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/window/Tray.desktop.kt
index 6953b39..157fe34 100644
--- a/compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/window/Tray.desktop.kt
+++ b/compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/window/Tray.desktop.kt
@@ -24,8 +24,10 @@
import androidx.compose.runtime.rememberCompositionContext
import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.runtime.rememberUpdatedState
+import androidx.compose.ui.geometry.Size
import androidx.compose.ui.graphics.painter.Painter
import androidx.compose.ui.graphics.asAwtImage
+import androidx.compose.ui.platform.DesktopPlatform
import kotlinx.coroutines.channels.Channel
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.launchIn
@@ -35,6 +37,20 @@
import java.awt.SystemTray
import java.awt.TrayIcon
+// In fact, this size doesn't affect anything on Windows/Linux, because they request what they
+// need, and not what we provide. It only affects macOs. This size will be scaled in asAwtImage to
+// support DPI=2.0
+// Unfortunately I hadn't enough time to find sources from the official docs
+private val iconSize = when (DesktopPlatform.Current) {
+ // https://doc.qt.io/qt-5/qtwidgets-desktop-systray-example.html (search 22x22)
+ DesktopPlatform.Linux -> Size(22f, 22f)
+ // https://doc.qt.io/qt-5/qtwidgets-desktop-systray-example.html (search 16x16)
+ DesktopPlatform.Windows -> Size(16f, 16f)
+ // https://medium.com/@acwrightdesign/creating-a-macos-menu-bar-application-using-swiftui-54572a5d5f87
+ DesktopPlatform.MacOS -> Size(22f, 22f)
+ DesktopPlatform.Unknown -> Size(32f, 32f)
+}
+
/**
* `true` if the platform supports tray icons in the taskbar
*/
@@ -94,7 +110,7 @@
// (see MultiResolutionImage.getResolutionVariant). Resources like svg/xml should look okay
// because they don't use absolute '.dp' values to draw, they use values which are
// relative to their viewport.
- icon.asAwtImage(GlobalDensity, GlobalLayoutDirection)
+ icon.asAwtImage(GlobalDensity, GlobalLayoutDirection, iconSize)
}
val tray = remember {
diff --git a/compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/window/Window.desktop.kt b/compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/window/Window.desktop.kt
index 0d520b4..ea71dc7 100644
--- a/compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/window/Window.desktop.kt
+++ b/compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/window/Window.desktop.kt
@@ -103,7 +103,7 @@
* @param content Content of the window
*/
@Composable
-fun ApplicationScope.Window(
+fun Window(
onCloseRequest: () -> Unit,
state: WindowState = rememberWindowState(),
visible: Boolean = true,
@@ -293,7 +293,7 @@
*/
@Suppress("unused")
@Composable
-fun ApplicationScope.Window(
+fun Window(
visible: Boolean = true,
onPreviewKeyEvent: (KeyEvent) -> Boolean = { false },
onKeyEvent: (KeyEvent) -> Boolean = { false },
diff --git a/compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/window/WindowScope.kt b/compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/window/WindowScope.kt
index e44b4d1..6ea1ebb 100644
--- a/compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/window/WindowScope.kt
+++ b/compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/window/WindowScope.kt
@@ -22,12 +22,10 @@
* Receiver scope which is used by [androidx.compose.ui.window.Window] and
* [androidx.compose.ui.window.Dialog].
*/
-interface WindowScope : OwnerWindowScope {
+interface WindowScope {
/**
* [Window] that was created inside [androidx.compose.ui.window.Window]
* or [androidx.compose.ui.window.Dialog]
*/
val window: Window
-
- override val ownerWindow: Window get() = window
}
\ No newline at end of file
diff --git a/compose/ui/ui/src/desktopTest/kotlin/androidx/compose/ui/window/window/WindowTest.kt b/compose/ui/ui/src/desktopTest/kotlin/androidx/compose/ui/window/window/WindowTest.kt
index aee6327..160912c 100644
--- a/compose/ui/ui/src/desktopTest/kotlin/androidx/compose/ui/window/window/WindowTest.kt
+++ b/compose/ui/ui/src/desktopTest/kotlin/androidx/compose/ui/window/window/WindowTest.kt
@@ -248,8 +248,63 @@
}
@Test
+ fun `open nested window`() = runApplicationTest {
+ var window1: ComposeWindow? = null
+ var window2: ComposeWindow? = null
+
+ var isOpen by mutableStateOf(true)
+ var isNestedOpen by mutableStateOf(true)
+
+ launchApplication {
+ if (isOpen) {
+ Window(
+ onCloseRequest = {},
+ state = rememberWindowState(
+ size = WindowSize(600.dp, 600.dp),
+ )
+ ) {
+ window1 = this.window
+ Box(Modifier.size(32.dp).background(Color.Red))
+
+ if (isNestedOpen) {
+ Window(
+ onCloseRequest = {},
+ state = rememberWindowState(
+ size = WindowSize(300.dp, 300.dp),
+ )
+ ) {
+ window2 = this.window
+ Box(Modifier.size(32.dp).background(Color.Blue))
+ }
+ }
+ }
+ }
+ }
+
+ awaitIdle()
+ assertThat(window1?.isShowing).isTrue()
+ assertThat(window2?.isShowing).isTrue()
+
+ isNestedOpen = false
+ awaitIdle()
+ assertThat(window1?.isShowing).isTrue()
+ assertThat(window2?.isShowing).isFalse()
+
+ isNestedOpen = true
+ awaitIdle()
+ assertThat(window1?.isShowing).isTrue()
+ assertThat(window2?.isShowing).isTrue()
+
+ isOpen = false
+ awaitIdle()
+ assertThat(window1?.isShowing).isFalse()
+ assertThat(window2?.isShowing).isFalse()
+ }
+
+ @Test
fun `pass composition local to windows`() = runApplicationTest {
var actualValue1: Int? = null
+ var actualValue2: Int? = null
var isOpen by mutableStateOf(true)
var testValue by mutableStateOf(0)
@@ -266,6 +321,16 @@
) {
actualValue1 = localTestValue.current
Box(Modifier.size(32.dp).background(Color.Red))
+
+ Window(
+ onCloseRequest = {},
+ state = rememberWindowState(
+ size = WindowSize(300.dp, 300.dp),
+ )
+ ) {
+ actualValue2 = localTestValue.current
+ Box(Modifier.size(32.dp).background(Color.Blue))
+ }
}
}
}
@@ -273,10 +338,12 @@
awaitIdle()
assertThat(actualValue1).isEqualTo(0)
+ assertThat(actualValue2).isEqualTo(0)
testValue = 42
awaitIdle()
assertThat(actualValue1).isEqualTo(42)
+ assertThat(actualValue2).isEqualTo(42)
isOpen = false
}
diff --git a/compose/ui/ui/src/test/kotlin/androidx/compose/ui/node/HitTestResultTest.kt b/compose/ui/ui/src/test/kotlin/androidx/compose/ui/node/HitTestResultTest.kt
new file mode 100644
index 0000000..33dbbbe
--- /dev/null
+++ b/compose/ui/ui/src/test/kotlin/androidx/compose/ui/node/HitTestResultTest.kt
@@ -0,0 +1,298 @@
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * 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.
+ */
+
+package androidx.compose.ui.node
+
+import org.junit.Test
+import org.junit.runner.RunWith
+import org.junit.runners.JUnit4
+
+import com.google.common.truth.Truth.assertThat
+
+@RunWith(JUnit4::class)
+class HitTestResultTest {
+ @Test
+ fun testHit() {
+ val hitTestResult = HitTestResult<String>()
+ hitTestResult.hit("Hello") {
+ hitTestResult.hit("World") {
+ assertThat(hitTestResult.isHit).isFalse()
+ }
+ assertThat(hitTestResult.isHit).isTrue()
+ }
+ assertThat(hitTestResult.isHit).isTrue()
+ assertThat(hitTestResult.isHitInMinimumTouchTargetBetter(0f)).isFalse()
+
+ assertThat(hitTestResult).hasSize(2)
+ assertThat(hitTestResult[0]).isEqualTo("Hello")
+ assertThat(hitTestResult[1]).isEqualTo("World")
+
+ hitTestResult.hit("Baz") {}
+ assertThat(hitTestResult.isHit).isTrue()
+ assertThat(hitTestResult).hasSize(1)
+ assertThat(hitTestResult[0]).isEqualTo("Baz")
+ }
+
+ @Test
+ fun testHitInMinimumTouchTarget() {
+ val hitTestResult = HitTestResult<String>()
+ hitTestResult.hitInMinimumTouchTarget("Hello", 1f) {
+ hitTestResult.hitInMinimumTouchTarget("World", 2f) { }
+ assertThat(hitTestResult.isHit).isFalse()
+ assertThat(hitTestResult.isHitInMinimumTouchTargetBetter(1.5f)).isTrue()
+ assertThat(hitTestResult.isHitInMinimumTouchTargetBetter(2.5f)).isFalse()
+ }
+ assertThat(hitTestResult.isHit).isFalse()
+ assertThat(hitTestResult.isHitInMinimumTouchTargetBetter(0.5f)).isTrue()
+ assertThat(hitTestResult.isHitInMinimumTouchTargetBetter(1.5f)).isFalse()
+
+ assertThat(hitTestResult).hasSize(2)
+ assertThat(hitTestResult[0]).isEqualTo("Hello")
+ assertThat(hitTestResult[1]).isEqualTo("World")
+
+ hitTestResult.hitInMinimumTouchTarget("Baz", 0.5f) { }
+ assertThat(hitTestResult.isHit).isFalse()
+ assertThat(hitTestResult).hasSize(1)
+ assertThat(hitTestResult[0]).isEqualTo("Baz")
+ }
+
+ @Test
+ fun testEasySpeculativeHit() {
+ val hitTestResult = HitTestResult<String>()
+ hitTestResult.speculativeHit("Hello", 1f) {
+ }
+ assertThat(hitTestResult).hasSize(0)
+
+ hitTestResult.speculativeHit("Hello", 1f) {
+ hitTestResult.hitInMinimumTouchTarget("World", 2f) {}
+ }
+
+ assertThat(hitTestResult.isHit).isFalse()
+ assertThat(hitTestResult.isHitInMinimumTouchTargetBetter(0.5f)).isTrue()
+ assertThat(hitTestResult.isHitInMinimumTouchTargetBetter(1.5f)).isFalse()
+
+ assertThat(hitTestResult).hasSize(2)
+ assertThat(hitTestResult[0]).isEqualTo("Hello")
+ assertThat(hitTestResult[1]).isEqualTo("World")
+ }
+
+ @Test
+ fun testSpeculativeHitWithMove() {
+ val hitTestResult = HitTestResult<String>()
+ hitTestResult.hitInMinimumTouchTarget("Foo", 1.5f) { }
+
+ hitTestResult.speculativeHit("Hello", 1f) {
+ }
+
+ assertThat(hitTestResult).hasSize(1)
+ assertThat(hitTestResult[0]).isEqualTo("Foo")
+
+ hitTestResult.speculativeHit("Hello", 1f) {
+ hitTestResult.hitInMinimumTouchTarget("World", 2f) {}
+ }
+
+ assertThat(hitTestResult.isHit).isFalse()
+ assertThat(hitTestResult.isHitInMinimumTouchTargetBetter(0.5f)).isTrue()
+ assertThat(hitTestResult.isHitInMinimumTouchTargetBetter(1.25f)).isFalse()
+
+ assertThat(hitTestResult).hasSize(2)
+ assertThat(hitTestResult[0]).isEqualTo("Hello")
+ assertThat(hitTestResult[1]).isEqualTo("World")
+ }
+
+ @Test
+ fun testClear() {
+ val hitTestResult = fillHitTestResult()
+ assertThat(hitTestResult).hasSize(5)
+ hitTestResult.clear()
+ assertThat(hitTestResult).hasSize(0)
+ }
+
+ @Test
+ fun testContains() {
+ val hitTestResult = fillHitTestResult()
+ assertThat(hitTestResult.contains("Hello")).isTrue()
+ assertThat(hitTestResult.contains("World")).isTrue()
+ assertThat(hitTestResult.contains("this")).isTrue()
+ assertThat(hitTestResult.contains("is")).isTrue()
+ assertThat(hitTestResult.contains("great")).isTrue()
+ assertThat(hitTestResult.contains("foo")).isFalse()
+ }
+
+ @Test
+ fun testContainsAll() {
+ val hitTestResult = fillHitTestResult()
+ assertThat(hitTestResult.containsAll(listOf("Hello", "great", "this"))).isTrue()
+ assertThat(hitTestResult.containsAll(listOf("Hello", "great", "foo", "this"))).isFalse()
+ }
+
+ @Test
+ fun testGet() {
+ val hitTestResult = fillHitTestResult()
+ assertThat(hitTestResult[0]).isEqualTo("Hello")
+ assertThat(hitTestResult[1]).isEqualTo("World")
+ assertThat(hitTestResult[2]).isEqualTo("this")
+ assertThat(hitTestResult[3]).isEqualTo("is")
+ assertThat(hitTestResult[4]).isEqualTo("great")
+ }
+
+ @Test
+ fun testIndexOf() {
+ val hitTestResult = fillHitTestResult("World")
+ assertThat(hitTestResult.indexOf("Hello")).isEqualTo(0)
+ assertThat(hitTestResult.indexOf("World")).isEqualTo(1)
+ assertThat(hitTestResult.indexOf("this")).isEqualTo(2)
+ assertThat(hitTestResult.indexOf("is")).isEqualTo(3)
+ assertThat(hitTestResult.indexOf("great")).isEqualTo(4)
+ assertThat(hitTestResult.indexOf("foo")).isEqualTo(-1)
+ }
+
+ @Test
+ fun testIsEmpty() {
+ val hitTestResult = fillHitTestResult()
+ assertThat(hitTestResult.isEmpty()).isFalse()
+ hitTestResult.clear()
+ assertThat(hitTestResult.isEmpty()).isTrue()
+ assertThat(HitTestResult<String>().isEmpty()).isTrue()
+ }
+
+ @Test
+ fun testIterator() {
+ val hitTestResult = fillHitTestResult()
+ assertThat(hitTestResult.toList()).isEqualTo(
+ listOf("Hello", "World", "this", "is", "great")
+ )
+ }
+
+ @Test
+ fun testLastIndexOf() {
+ val hitTestResult = fillHitTestResult("World")
+ assertThat(hitTestResult.lastIndexOf("Hello")).isEqualTo(0)
+ assertThat(hitTestResult.lastIndexOf("World")).isEqualTo(5)
+ assertThat(hitTestResult.lastIndexOf("this")).isEqualTo(2)
+ assertThat(hitTestResult.lastIndexOf("is")).isEqualTo(3)
+ assertThat(hitTestResult.lastIndexOf("great")).isEqualTo(4)
+ assertThat(hitTestResult.lastIndexOf("foo")).isEqualTo(-1)
+ }
+
+ @Test
+ fun testListIterator() {
+ val hitTestResult = fillHitTestResult()
+ val iterator = hitTestResult.listIterator()
+
+ val values = listOf("Hello", "World", "this", "is", "great")
+
+ values.forEachIndexed { index, value ->
+ assertThat(iterator.nextIndex()).isEqualTo(index)
+ if (index > 0) {
+ assertThat(iterator.previousIndex()).isEqualTo(index - 1)
+ }
+ assertThat(iterator.hasNext()).isTrue()
+ val hasPrevious = (index != 0)
+ assertThat(iterator.hasPrevious()).isEqualTo(hasPrevious)
+ assertThat(iterator.next()).isEqualTo(value)
+ }
+
+ for (index in values.lastIndex downTo 0) {
+ val value = values[index]
+ assertThat(iterator.previous()).isEqualTo(value)
+ }
+ }
+
+ @Test
+ fun testListIteratorWithStart() {
+ val hitTestResult = fillHitTestResult()
+ val iterator = hitTestResult.listIterator(2)
+
+ val values = listOf("Hello", "World", "this", "is", "great")
+
+ for (index in 2..values.lastIndex) {
+ assertThat(iterator.nextIndex()).isEqualTo(index)
+ if (index > 0) {
+ assertThat(iterator.previousIndex()).isEqualTo(index - 1)
+ }
+ assertThat(iterator.hasNext()).isTrue()
+ val hasPrevious = (index != 0)
+ assertThat(iterator.hasPrevious()).isEqualTo(hasPrevious)
+ assertThat(iterator.next()).isEqualTo(values[index])
+ }
+
+ for (index in values.lastIndex downTo 0) {
+ val value = values[index]
+ assertThat(iterator.previous()).isEqualTo(value)
+ }
+ }
+
+ @Test
+ fun testSubList() {
+ val hitTestResult = fillHitTestResult()
+ val subList = hitTestResult.subList(2, 4)
+ assertThat(subList).hasSize(2)
+
+ assertThat(subList.toList()).isEqualTo(listOf("this", "is"))
+ assertThat(subList.contains("this")).isTrue()
+ assertThat(subList.contains("foo")).isFalse()
+ assertThat(subList.containsAll(listOf("this", "is"))).isTrue()
+ assertThat(subList.containsAll(listOf("is", "this"))).isTrue()
+ assertThat(subList.containsAll(listOf("foo", "this"))).isFalse()
+ assertThat(subList[0]).isEqualTo("this")
+ assertThat(subList[1]).isEqualTo("is")
+ assertThat(subList.indexOf("is")).isEqualTo(1)
+ assertThat(subList.isEmpty()).isFalse()
+ assertThat(hitTestResult.subList(4, 4).isEmpty()).isTrue()
+ assertThat(subList.subList(0, 2).toList()).isEqualTo(subList.toList())
+ assertThat(subList.subList(0, 1)[0]).isEqualTo("this")
+
+ val listIterator1 = subList.listIterator()
+ assertThat(listIterator1.hasNext()).isTrue()
+ assertThat(listIterator1.hasPrevious()).isFalse()
+ assertThat(listIterator1.nextIndex()).isEqualTo(0)
+ assertThat(listIterator1.next()).isEqualTo("this")
+ assertThat(listIterator1.hasNext()).isTrue()
+ assertThat(listIterator1.hasPrevious()).isTrue()
+ assertThat(listIterator1.nextIndex()).isEqualTo(1)
+ assertThat(listIterator1.next()).isEqualTo("is")
+ assertThat(listIterator1.hasNext()).isFalse()
+ assertThat(listIterator1.hasPrevious()).isTrue()
+ assertThat(listIterator1.previousIndex()).isEqualTo(1)
+ assertThat(listIterator1.previous()).isEqualTo("is")
+
+ val listIterator2 = subList.listIterator(1)
+ assertThat(listIterator2.hasPrevious()).isTrue()
+ assertThat(listIterator2.hasNext()).isTrue()
+ assertThat(listIterator2.previousIndex()).isEqualTo(0)
+ assertThat(listIterator2.nextIndex()).isEqualTo(1)
+ assertThat(listIterator2.previous()).isEqualTo("this")
+ }
+
+ private fun fillHitTestResult(last: String? = null): HitTestResult<String> {
+ val hitTestResult = HitTestResult<String>()
+ hitTestResult.hit("Hello") {
+ hitTestResult.hit("World") {
+ hitTestResult.hit("this") {
+ hitTestResult.hit("is") {
+ hitTestResult.hit("great") {
+ last?.let {
+ hitTestResult.hit(it) {}
+ }
+ }
+ }
+ }
+ }
+ }
+ return hitTestResult
+ }
+}
\ No newline at end of file
diff --git a/compose/ui/ui/src/test/kotlin/androidx/compose/ui/node/LayoutNodeTest.kt b/compose/ui/ui/src/test/kotlin/androidx/compose/ui/node/LayoutNodeTest.kt
index 6518162..f476cf4 100644
--- a/compose/ui/ui/src/test/kotlin/androidx/compose/ui/node/LayoutNodeTest.kt
+++ b/compose/ui/ui/src/test/kotlin/androidx/compose/ui/node/LayoutNodeTest.kt
@@ -15,6 +15,7 @@
*/
package androidx.compose.ui.node
+import androidx.compose.testutils.TestViewConfiguration
import androidx.compose.ui.ExperimentalComposeUiApi
import androidx.compose.ui.Modifier
import androidx.compose.ui.autofill.Autofill
@@ -48,13 +49,18 @@
import androidx.compose.ui.platform.TextToolbar
import androidx.compose.ui.platform.ViewConfiguration
import androidx.compose.ui.platform.WindowInfo
+import androidx.compose.ui.semantics.SemanticsConfiguration
+import androidx.compose.ui.semantics.SemanticsModifier
+import androidx.compose.ui.semantics.SemanticsWrapper
import androidx.compose.ui.text.font.Font
import androidx.compose.ui.text.input.TextInputService
import androidx.compose.ui.unit.Constraints
import androidx.compose.ui.unit.Density
+import androidx.compose.ui.unit.DpSize
import androidx.compose.ui.unit.IntOffset
import androidx.compose.ui.unit.IntSize
import androidx.compose.ui.unit.LayoutDirection
+import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.toOffset
import androidx.compose.ui.zIndex
import com.google.common.truth.Truth.assertThat
@@ -813,6 +819,353 @@
}
@Test
+ fun hitTest_pointerInMinimumTouchTarget_pointerInputFilterHit() {
+ val pointerInputFilter: PointerInputFilter = mockPointerInputFilter()
+ val layoutNode =
+ LayoutNode(
+ 0, 0, 1, 1,
+ PointerInputModifierImpl(pointerInputFilter),
+ DpSize(48.dp, 48.dp)
+ ).apply {
+ attach(MockOwner())
+ }
+ val hit = mutableListOf<PointerInputFilter>()
+
+ layoutNode.hitTest(Offset(-3f, 3f), hit, true)
+
+ assertThat(hit).isEqualTo(listOf(pointerInputFilter))
+ }
+
+ @Test
+ fun hitTest_pointerInMinimumTouchTarget_pointerInputFilterHit_nestedNodes() {
+ val pointerInputFilter: PointerInputFilter = mockPointerInputFilter()
+ val outerNode = LayoutNode(0, 0, 1, 1).apply { attach(MockOwner()) }
+ val layoutNode = LayoutNode(
+ 0, 0, 1, 1,
+ PointerInputModifierImpl(pointerInputFilter),
+ DpSize(48.dp, 48.dp)
+ )
+ outerNode.add(layoutNode)
+ layoutNode.onNodePlaced()
+ val hit = mutableListOf<PointerInputFilter>()
+
+ outerNode.hitTest(Offset(-3f, 3f), hit, true)
+
+ assertThat(hit).isEqualTo(listOf(pointerInputFilter))
+ }
+
+ @Test
+ fun hitTest_pointerInMinimumTouchTarget_closestHit() {
+ val pointerInputFilter1: PointerInputFilter = mockPointerInputFilter()
+ val layoutNode1 = LayoutNode(
+ 0, 0, 5, 5,
+ PointerInputModifierImpl(pointerInputFilter1),
+ DpSize(48.dp, 48.dp)
+ )
+
+ val pointerInputFilter2: PointerInputFilter = mockPointerInputFilter()
+ val layoutNode2 = LayoutNode(
+ 6, 6, 11, 11,
+ PointerInputModifierImpl(pointerInputFilter2),
+ DpSize(48.dp, 48.dp)
+ )
+ val outerNode = LayoutNode(0, 0, 11, 11).apply { attach(MockOwner()) }
+ outerNode.add(layoutNode1)
+ outerNode.add(layoutNode2)
+ layoutNode1.onNodePlaced()
+ layoutNode2.onNodePlaced()
+
+ val hit = mutableListOf<PointerInputFilter>()
+
+ // Hit closer to layoutNode1
+ outerNode.hitTest(Offset(5.1f, 5.5f), hit, true)
+
+ assertThat(hit).isEqualTo(listOf(pointerInputFilter1))
+
+ hit.clear()
+
+ // Hit closer to layoutNode2
+ outerNode.hitTest(Offset(5.9f, 5.5f), hit, true)
+
+ assertThat(hit).isEqualTo(listOf(pointerInputFilter2))
+
+ hit.clear()
+
+ // Hit closer to layoutNode1
+ outerNode.hitTest(Offset(5.5f, 5.1f), hit, true)
+
+ assertThat(hit).isEqualTo(listOf(pointerInputFilter1))
+
+ hit.clear()
+
+ // Hit closer to layoutNode2
+ outerNode.hitTest(Offset(5.5f, 5.9f), hit, true)
+
+ assertThat(hit).isEqualTo(listOf(pointerInputFilter2))
+
+ hit.clear()
+
+ // Hit inside layoutNode1
+ outerNode.hitTest(Offset(4.9f, 4.9f), hit, true)
+
+ assertThat(hit).isEqualTo(listOf(pointerInputFilter1))
+
+ hit.clear()
+
+ // Hit inside layoutNode2
+ outerNode.hitTest(Offset(6.1f, 6.1f), hit, true)
+
+ assertThat(hit).isEqualTo(listOf(pointerInputFilter2))
+ }
+
+ /**
+ * When a child is in the minimum touch target area, but the parent is big enough to not
+ * worry about minimum touch target, the child should still be able to be hit outside the
+ * parent's bounds.
+ */
+ @Test
+ fun hitTest_pointerInMinimumTouchTarget_inChild_closestHit() {
+ test_pointerInMinimumTouchTarget_inChild_closestHit { outerNode, nodeWithChild, soloNode ->
+ outerNode.add(nodeWithChild)
+ outerNode.add(soloNode)
+ }
+ }
+
+ /**
+ * When a child is in the minimum touch target area, but the parent is big enough to not
+ * worry about minimum touch target, the child should still be able to be hit outside the
+ * parent's bounds. This is different from
+ * [hitTest_pointerInMinimumTouchTarget_inChild_closestHit] because the node with the nested
+ * child is after the other node.
+ */
+ @Test
+ fun hitTest_pointerInMinimumTouchTarget_inChildOver_closestHit() {
+ test_pointerInMinimumTouchTarget_inChild_closestHit { outerNode, nodeWithChild, soloNode ->
+ outerNode.add(soloNode)
+ outerNode.add(nodeWithChild)
+ }
+ }
+
+ private fun test_pointerInMinimumTouchTarget_inChild_closestHit(
+ block: (outerNode: LayoutNode, nodeWithChild: LayoutNode, soloNode: LayoutNode) -> Unit
+ ) {
+ val pointerInputFilter1: PointerInputFilter = mockPointerInputFilter()
+ val layoutNode1 = LayoutNode(
+ 5, 5, 10, 10,
+ PointerInputModifierImpl(pointerInputFilter1),
+ DpSize(48.dp, 48.dp)
+ )
+
+ val pointerInputFilter2: PointerInputFilter = mockPointerInputFilter()
+ val layoutNode2 = LayoutNode(
+ 0, 0, 10, 10,
+ PointerInputModifierImpl(pointerInputFilter2),
+ DpSize(48.dp, 48.dp)
+ )
+ layoutNode2.add(layoutNode1)
+
+ val pointerInputFilter3: PointerInputFilter = mockPointerInputFilter()
+ val layoutNode3 = LayoutNode(
+ 12, 12, 17, 17,
+ PointerInputModifierImpl(pointerInputFilter3),
+ DpSize(48.dp, 48.dp)
+ )
+
+ val outerNode = LayoutNode(0, 0, 20, 20).apply { attach(MockOwner()) }
+ block(outerNode, layoutNode2, layoutNode3)
+ layoutNode1.onNodePlaced()
+ layoutNode2.onNodePlaced()
+ layoutNode3.onNodePlaced()
+
+ val hit = mutableListOf<PointerInputFilter>()
+
+ // Hit outside of layoutNode2, but near layoutNode1
+ outerNode.hitTest(Offset(10.1f, 10.1f), hit, true)
+
+ assertThat(hit).isEqualTo(listOf(pointerInputFilter2, pointerInputFilter1))
+
+ hit.clear()
+
+ // Hit closer to layoutNode3
+ outerNode.hitTest(Offset(11.9f, 11.9f), hit, true)
+
+ assertThat(hit).isEqualTo(listOf(pointerInputFilter3))
+ }
+
+ @Test
+ fun hitTest_pointerInMinimumTouchTarget_closestHitWithOverlap() {
+ val pointerInputFilter1: PointerInputFilter = mockPointerInputFilter()
+ val layoutNode1 = LayoutNode(
+ 0, 0, 5, 5, PointerInputModifierImpl(pointerInputFilter1),
+ DpSize(48.dp, 48.dp)
+ )
+
+ val pointerInputFilter2: PointerInputFilter = mockPointerInputFilter()
+ val layoutNode2 = LayoutNode(
+ 4, 4, 9, 9,
+ PointerInputModifierImpl(pointerInputFilter2),
+ DpSize(48.dp, 48.dp)
+ )
+ val outerNode = LayoutNode(0, 0, 9, 9).apply { attach(MockOwner()) }
+ outerNode.add(layoutNode1)
+ outerNode.add(layoutNode2)
+ layoutNode1.onNodePlaced()
+ layoutNode2.onNodePlaced()
+
+ val hit = mutableListOf<PointerInputFilter>()
+
+ // Hit layoutNode1
+ outerNode.hitTest(Offset(3.95f, 3.95f), hit, true)
+
+ assertThat(hit).isEqualTo(listOf(pointerInputFilter1))
+
+ hit.clear()
+
+ // Hit layoutNode2
+ outerNode.hitTest(Offset(4.05f, 4.05f), hit, true)
+
+ assertThat(hit).isEqualTo(listOf(pointerInputFilter2))
+ }
+
+ @Test
+ fun hitTestSemantics_pointerInMinimumTouchTarget_pointerInputFilterHit() {
+ val semanticsConfiguration = SemanticsConfiguration()
+ val semanticsModifier = object : SemanticsModifier {
+ override val id: Int = 1
+ override val semanticsConfiguration: SemanticsConfiguration = semanticsConfiguration
+ }
+ val layoutNode =
+ LayoutNode(
+ 0, 0, 1, 1,
+ semanticsModifier,
+ DpSize(48.dp, 48.dp)
+ ).apply {
+ attach(MockOwner())
+ }
+ val hit = HitTestResult<SemanticsWrapper>()
+
+ layoutNode.hitTestSemantics(Offset(-3f, 3f), hit)
+
+ assertThat(hit).hasSize(1)
+ assertThat(hit[0].modifier).isEqualTo(semanticsModifier)
+ }
+
+ @Test
+ fun hitTestSemantics_pointerInMinimumTouchTarget_pointerInputFilterHit_nestedNodes() {
+ val semanticsConfiguration = SemanticsConfiguration()
+ val semanticsModifier = object : SemanticsModifier {
+ override val id: Int = 1
+ override val semanticsConfiguration: SemanticsConfiguration = semanticsConfiguration
+ }
+ val outerNode = LayoutNode(0, 0, 1, 1).apply { attach(MockOwner()) }
+ val layoutNode = LayoutNode(0, 0, 1, 1, semanticsModifier, DpSize(48.dp, 48.dp))
+ outerNode.add(layoutNode)
+ layoutNode.onNodePlaced()
+ val hit = HitTestResult<SemanticsWrapper>()
+
+ layoutNode.hitTestSemantics(Offset(-3f, 3f), hit)
+
+ assertThat(hit).hasSize(1)
+ assertThat(hit[0].modifier).isEqualTo(semanticsModifier)
+ }
+
+ @Test
+ fun hitTestSemantics_pointerInMinimumTouchTarget_closestHit() {
+ val semanticsConfiguration = SemanticsConfiguration()
+ val semanticsModifier1 = object : SemanticsModifier {
+ override val id: Int = 1
+ override val semanticsConfiguration: SemanticsConfiguration = semanticsConfiguration
+ }
+ val semanticsModifier2 = object : SemanticsModifier {
+ override val id: Int = 1
+ override val semanticsConfiguration: SemanticsConfiguration = semanticsConfiguration
+ }
+ val layoutNode1 = LayoutNode(0, 0, 5, 5, semanticsModifier1, DpSize(48.dp, 48.dp))
+ val layoutNode2 = LayoutNode(6, 6, 11, 11, semanticsModifier2, DpSize(48.dp, 48.dp))
+ val outerNode = LayoutNode(0, 0, 11, 11).apply { attach(MockOwner()) }
+ outerNode.add(layoutNode1)
+ outerNode.add(layoutNode2)
+ layoutNode1.onNodePlaced()
+ layoutNode2.onNodePlaced()
+
+ // Hit closer to layoutNode1
+ val hit1 = HitTestResult<SemanticsWrapper>()
+ outerNode.hitTestSemantics(Offset(5.1f, 5.5f), hit1, true)
+
+ assertThat(hit1).hasSize(1)
+ assertThat(hit1[0].modifier).isEqualTo(semanticsModifier1)
+
+ // Hit closer to layoutNode2
+ val hit2 = HitTestResult<SemanticsWrapper>()
+ outerNode.hitTestSemantics(Offset(5.9f, 5.5f), hit2, true)
+
+ assertThat(hit2).hasSize(1)
+ assertThat(hit2[0].modifier).isEqualTo(semanticsModifier2)
+
+ // Hit closer to layoutNode1
+ val hit3 = HitTestResult<SemanticsWrapper>()
+ outerNode.hitTestSemantics(Offset(5.5f, 5.1f), hit3, true)
+
+ assertThat(hit3).hasSize(1)
+ assertThat(hit3[0].modifier).isEqualTo(semanticsModifier1)
+
+ // Hit closer to layoutNode2
+ val hit4 = HitTestResult<SemanticsWrapper>()
+ outerNode.hitTestSemantics(Offset(5.5f, 5.9f), hit4, true)
+
+ assertThat(hit4).hasSize(1)
+ assertThat(hit4[0].modifier).isEqualTo(semanticsModifier2)
+
+ // Hit inside layoutNode1
+ val hit5 = HitTestResult<SemanticsWrapper>()
+ outerNode.hitTestSemantics(Offset(4.9f, 4.9f), hit5, true)
+
+ assertThat(hit5).hasSize(1)
+ assertThat(hit5[0].modifier).isEqualTo(semanticsModifier1)
+
+ // Hit inside layoutNode2
+ val hit6 = HitTestResult<SemanticsWrapper>()
+ outerNode.hitTestSemantics(Offset(6.1f, 6.1f), hit6, true)
+
+ assertThat(hit6).hasSize(1)
+ assertThat(hit6[0].modifier).isEqualTo(semanticsModifier2)
+ }
+
+ @Test
+ fun hitTestSemantics_pointerInMinimumTouchTarget_closestHitWithOverlap() {
+ val semanticsConfiguration = SemanticsConfiguration()
+ val semanticsModifier1 = object : SemanticsModifier {
+ override val id: Int = 1
+ override val semanticsConfiguration: SemanticsConfiguration = semanticsConfiguration
+ }
+ val semanticsModifier2 = object : SemanticsModifier {
+ override val id: Int = 1
+ override val semanticsConfiguration: SemanticsConfiguration = semanticsConfiguration
+ }
+ val layoutNode1 = LayoutNode(0, 0, 5, 5, semanticsModifier1, DpSize(48.dp, 48.dp))
+ val layoutNode2 = LayoutNode(4, 4, 9, 9, semanticsModifier2, DpSize(48.dp, 48.dp))
+ val outerNode = LayoutNode(0, 0, 11, 11).apply { attach(MockOwner()) }
+ outerNode.add(layoutNode1)
+ outerNode.add(layoutNode2)
+ layoutNode1.onNodePlaced()
+ layoutNode2.onNodePlaced()
+
+ // Hit layoutNode1
+ val hit1 = HitTestResult<SemanticsWrapper>()
+ outerNode.hitTestSemantics(Offset(3.95f, 3.95f), hit1, true)
+
+ assertThat(hit1).hasSize(1)
+ assertThat(hit1[0].modifier).isEqualTo(semanticsModifier1)
+
+ // Hit layoutNode2
+ val hit2 = HitTestResult<SemanticsWrapper>()
+ outerNode.hitTestSemantics(Offset(4.05f, 4.05f), hit2, true)
+
+ assertThat(hit2).hasSize(1)
+ assertThat(hit2[0].modifier).isEqualTo(semanticsModifier2)
+ }
+
+ @Test
fun hitTest_pointerOutOfBounds_nothingHit() {
val pointerInputFilter: PointerInputFilter = mockPointerInputFilter()
val layoutNode =
@@ -840,6 +1193,34 @@
}
@Test
+ fun hitTest_pointerOutOfBounds_nothingHit_extendedBounds() {
+ val pointerInputFilter: PointerInputFilter = mockPointerInputFilter()
+ val layoutNode =
+ LayoutNode(
+ 0, 0, 1, 1,
+ PointerInputModifierImpl(pointerInputFilter),
+ minimumTouchTargetSize = DpSize(4.dp, 8.dp)
+ ).apply {
+ attach(MockOwner())
+ }
+ val hit = mutableListOf<PointerInputFilter>()
+
+ layoutNode.hitTest(Offset(-3f, -5f), hit)
+ layoutNode.hitTest(Offset(0f, -5f), hit)
+ layoutNode.hitTest(Offset(3f, -5f), hit)
+
+ layoutNode.hitTest(Offset(-3f, 0f), hit)
+ // 0, 0 would hit
+ layoutNode.hitTest(Offset(3f, 0f), hit)
+
+ layoutNode.hitTest(Offset(-3f, 5f), hit)
+ layoutNode.hitTest(Offset(0f, 5f), hit)
+ layoutNode.hitTest(Offset(-3f, 5f), hit)
+
+ assertThat(hit).isEmpty()
+ }
+
+ @Test
fun hitTest_nestedOffsetNodesHits3_allHitInCorrectOrder() {
hitTest_nestedOffsetNodes_allHitInCorrectOrder(3)
}
@@ -1898,29 +2279,46 @@
override val sharedDrawScope = LayoutNodeDrawScope()
}
-private fun LayoutNode(x: Int, y: Int, x2: Int, y2: Int, modifier: Modifier = Modifier) =
- LayoutNode().apply {
- this.modifier = modifier
- measurePolicy = object : LayoutNode.NoIntrinsicsMeasurePolicy("not supported") {
- override fun MeasureScope.measure(
- measurables: List<Measurable>,
- constraints: Constraints
- ): MeasureResult =
- layout(x2 - x, y2 - y) {
- measurables.forEach { it.measure(constraints).place(0, 0) }
- }
- }
- attach(MockOwner())
- layoutState = LayoutNode.LayoutState.NeedsRemeasure
- remeasure(Constraints())
- var wrapper: LayoutNodeWrapper? = outerLayoutNodeWrapper
- while (wrapper != null) {
- wrapper.measureResult = innerLayoutNodeWrapper.measureResult
- wrapper = (wrapper as? LayoutNodeWrapper)?.wrapped
- }
- place(x, y)
- detach()
+private fun LayoutNode.hitTest(
+ pointerPosition: Offset,
+ hitPointerInputFilters: MutableList<PointerInputFilter>,
+ isTouchEvent: Boolean = false
+) {
+ val hitTestResult = HitTestResult<PointerInputFilter>()
+ hitTest(pointerPosition, hitTestResult, isTouchEvent)
+ hitPointerInputFilters.addAll(hitTestResult)
+}
+
+private fun LayoutNode(
+ x: Int,
+ y: Int,
+ x2: Int,
+ y2: Int,
+ modifier: Modifier = Modifier,
+ minimumTouchTargetSize: DpSize = DpSize.Zero
+) = LayoutNode().apply {
+ this.viewConfiguration = TestViewConfiguration(minimumTouchTargetSize = minimumTouchTargetSize)
+ this.modifier = modifier
+ measurePolicy = object : LayoutNode.NoIntrinsicsMeasurePolicy("not supported") {
+ override fun MeasureScope.measure(
+ measurables: List<Measurable>,
+ constraints: Constraints
+ ): MeasureResult =
+ layout(x2 - x, y2 - y) {
+ measurables.forEach { it.measure(constraints).place(0, 0) }
+ }
}
+ attach(MockOwner())
+ layoutState = LayoutNode.LayoutState.NeedsRemeasure
+ remeasure(Constraints())
+ var wrapper: LayoutNodeWrapper? = outerLayoutNodeWrapper
+ while (wrapper != null) {
+ wrapper.measureResult = innerLayoutNodeWrapper.measureResult
+ wrapper = (wrapper as? LayoutNodeWrapper)?.wrapped
+ }
+ place(x, y)
+ detach()
+}
private fun mockPointerInputFilter(): PointerInputFilter = object : PointerInputFilter() {
override fun onPointerEvent(
@@ -1932,4 +2330,4 @@
override fun onCancel() {
}
-}
\ No newline at end of file
+}
diff --git a/core/core-appdigest/src/androidTest/java/androidx/core/appdigest/ChecksumsTest.java b/core/core-appdigest/src/androidTest/java/androidx/core/appdigest/ChecksumsTest.java
index 16eff3c..069eb07 100644
--- a/core/core-appdigest/src/androidTest/java/androidx/core/appdigest/ChecksumsTest.java
+++ b/core/core-appdigest/src/androidTest/java/androidx/core/appdigest/ChecksumsTest.java
@@ -511,7 +511,7 @@
private void validateFixedAllChecksums(Checksum[] checksums) {
assertNotNull(checksums);
- if (BuildCompat.isAtLeastR()) {
+ if (BuildCompat.isAtLeastS()) {
assertEquals(checksums.length, 7);
assertEquals(checksums[0].getType(),
android.content.pm.Checksum.TYPE_WHOLE_MERKLE_ROOT_4K_SHA256);
@@ -659,7 +659,8 @@
Intent intent = new Intent(action);
PendingIntent sender = PendingIntent.getBroadcast(mContext, resultId, intent,
- PendingIntent.FLAG_ONE_SHOT | PendingIntent.FLAG_UPDATE_CURRENT);
+ PendingIntent.FLAG_ONE_SHOT | PendingIntent.FLAG_UPDATE_CURRENT
+ | PendingIntent.FLAG_MUTABLE);
session.commit(sender.getIntentSender());
diff --git a/core/core-splashscreen/build.gradle b/core/core-splashscreen/build.gradle
index 70b0d81..d70c8a7b 100644
--- a/core/core-splashscreen/build.gradle
+++ b/core/core-splashscreen/build.gradle
@@ -36,7 +36,7 @@
implementation("androidx.annotation:annotation:1.2.0")
- androidTestImplementation(project(":test:screenshot:test-screenshot"))
+ androidTestImplementation(project(":test:screenshot:screenshot"))
androidTestImplementation(libs.testExtJunit)
androidTestImplementation(libs.testRunner)
androidTestImplementation(libs.testRules)
diff --git a/core/core-splashscreen/core-splashscreen-sample/build.gradle b/core/core-splashscreen/samples/build.gradle
similarity index 91%
rename from core/core-splashscreen/core-splashscreen-sample/build.gradle
rename to core/core-splashscreen/samples/build.gradle
index 0128b8c..05baf9f 100644
--- a/core/core-splashscreen/core-splashscreen-sample/build.gradle
+++ b/core/core-splashscreen/samples/build.gradle
@@ -16,6 +16,7 @@
import androidx.build.LibraryGroups
+import androidx.build.LibraryType
import androidx.build.LibraryVersions
import androidx.build.Publish
@@ -27,7 +28,7 @@
android {
defaultConfig {
- applicationId "androidx.core.splashscreen.sample"
+ applicationId "androidx.core.splashscreen.samples"
minSdkVersion 21
}
}
@@ -42,7 +43,7 @@
androidx {
name = "AndroidX Splashscreen Samples"
- publish = Publish.NONE
+ type = LibraryType.SAMPLES
mavenVersion = LibraryVersions.CORE_SPLASHSCREEN
mavenGroup = LibraryGroups.CORE
inceptionYear = "2021"
diff --git a/core/core-splashscreen/core-splashscreen-sample/src/main/AndroidManifest.xml b/core/core-splashscreen/samples/src/main/AndroidManifest.xml
similarity index 100%
rename from core/core-splashscreen/core-splashscreen-sample/src/main/AndroidManifest.xml
rename to core/core-splashscreen/samples/src/main/AndroidManifest.xml
diff --git a/core/core-splashscreen/core-splashscreen-sample/src/main/java/androidx/core/splashscreen/sample/SplashScreenSampleActivity.kt b/core/core-splashscreen/samples/src/main/java/androidx/core/splashscreen/sample/SplashScreenSampleActivity.kt
similarity index 100%
rename from core/core-splashscreen/core-splashscreen-sample/src/main/java/androidx/core/splashscreen/sample/SplashScreenSampleActivity.kt
rename to core/core-splashscreen/samples/src/main/java/androidx/core/splashscreen/sample/SplashScreenSampleActivity.kt
diff --git a/core/core-splashscreen/core-splashscreen-sample/src/main/res/drawable-v26/ic_launcher.xml b/core/core-splashscreen/samples/src/main/res/drawable-v26/ic_launcher.xml
similarity index 100%
rename from core/core-splashscreen/core-splashscreen-sample/src/main/res/drawable-v26/ic_launcher.xml
rename to core/core-splashscreen/samples/src/main/res/drawable-v26/ic_launcher.xml
diff --git a/core/core-splashscreen/core-splashscreen-sample/src/main/res/drawable-v31/splashscreen_icon.xml b/core/core-splashscreen/samples/src/main/res/drawable-v31/splashscreen_icon.xml
similarity index 100%
rename from core/core-splashscreen/core-splashscreen-sample/src/main/res/drawable-v31/splashscreen_icon.xml
rename to core/core-splashscreen/samples/src/main/res/drawable-v31/splashscreen_icon.xml
diff --git a/core/core-splashscreen/core-splashscreen-sample/src/main/res/drawable/android.xml b/core/core-splashscreen/samples/src/main/res/drawable/android.xml
similarity index 100%
rename from core/core-splashscreen/core-splashscreen-sample/src/main/res/drawable/android.xml
rename to core/core-splashscreen/samples/src/main/res/drawable/android.xml
diff --git a/core/core-splashscreen/core-splashscreen-sample/src/main/res/drawable/foreground.xml b/core/core-splashscreen/samples/src/main/res/drawable/foreground.xml
similarity index 100%
rename from core/core-splashscreen/core-splashscreen-sample/src/main/res/drawable/foreground.xml
rename to core/core-splashscreen/samples/src/main/res/drawable/foreground.xml
diff --git a/core/core-splashscreen/core-splashscreen-sample/src/main/res/drawable/ic_launcher.xml b/core/core-splashscreen/samples/src/main/res/drawable/ic_launcher.xml
similarity index 100%
rename from core/core-splashscreen/core-splashscreen-sample/src/main/res/drawable/ic_launcher.xml
rename to core/core-splashscreen/samples/src/main/res/drawable/ic_launcher.xml
diff --git a/core/core-splashscreen/core-splashscreen-sample/src/main/res/drawable/splashscreen_icon.xml b/core/core-splashscreen/samples/src/main/res/drawable/splashscreen_icon.xml
similarity index 100%
rename from core/core-splashscreen/core-splashscreen-sample/src/main/res/drawable/splashscreen_icon.xml
rename to core/core-splashscreen/samples/src/main/res/drawable/splashscreen_icon.xml
diff --git a/core/core-splashscreen/core-splashscreen-sample/src/main/res/layout/main_activity.xml b/core/core-splashscreen/samples/src/main/res/layout/main_activity.xml
similarity index 100%
rename from core/core-splashscreen/core-splashscreen-sample/src/main/res/layout/main_activity.xml
rename to core/core-splashscreen/samples/src/main/res/layout/main_activity.xml
diff --git a/core/core-splashscreen/core-splashscreen-sample/src/main/res/values/colors.xml b/core/core-splashscreen/samples/src/main/res/values/colors.xml
similarity index 100%
rename from core/core-splashscreen/core-splashscreen-sample/src/main/res/values/colors.xml
rename to core/core-splashscreen/samples/src/main/res/values/colors.xml
diff --git a/core/core-splashscreen/core-splashscreen-sample/src/main/res/values/dimens.xml b/core/core-splashscreen/samples/src/main/res/values/dimens.xml
similarity index 100%
rename from core/core-splashscreen/core-splashscreen-sample/src/main/res/values/dimens.xml
rename to core/core-splashscreen/samples/src/main/res/values/dimens.xml
diff --git a/core/core-splashscreen/core-splashscreen-sample/src/main/res/values/strings.xml b/core/core-splashscreen/samples/src/main/res/values/strings.xml
similarity index 100%
rename from core/core-splashscreen/core-splashscreen-sample/src/main/res/values/strings.xml
rename to core/core-splashscreen/samples/src/main/res/values/strings.xml
diff --git a/core/core-splashscreen/core-splashscreen-sample/src/main/res/values/styles.xml b/core/core-splashscreen/samples/src/main/res/values/styles.xml
similarity index 100%
rename from core/core-splashscreen/core-splashscreen-sample/src/main/res/values/styles.xml
rename to core/core-splashscreen/samples/src/main/res/values/styles.xml
diff --git a/core/core/api/current.txt b/core/core/api/current.txt
index e120d3b..7c12da4 100644
--- a/core/core/api/current.txt
+++ b/core/core/api/current.txt
@@ -1737,6 +1737,25 @@
package androidx.core.provider {
+ public final class DocumentsContractCompat {
+ method public static android.net.Uri? buildChildDocumentsUri(String, String?);
+ method public static android.net.Uri? buildChildDocumentsUriUsingTree(android.net.Uri, String);
+ method public static android.net.Uri? buildDocumentUri(String, String);
+ method public static android.net.Uri? buildDocumentUriUsingTree(android.net.Uri, String);
+ method public static android.net.Uri? buildTreeDocumentUri(String, String);
+ method public static android.net.Uri? createDocument(android.content.ContentResolver, android.net.Uri, String, String) throws java.io.FileNotFoundException;
+ method public static String? getDocumentId(android.net.Uri);
+ method public static String? getTreeDocumentId(android.net.Uri);
+ method public static boolean isDocumentUri(android.content.Context, android.net.Uri?);
+ method public static boolean isTreeUri(android.net.Uri);
+ method public static boolean removeDocument(android.content.ContentResolver, android.net.Uri, android.net.Uri) throws java.io.FileNotFoundException;
+ method public static android.net.Uri? renameDocument(android.content.ContentResolver, android.net.Uri, String) throws java.io.FileNotFoundException;
+ }
+
+ public static final class DocumentsContractCompat.DocumentCompat {
+ field public static final int FLAG_VIRTUAL_DOCUMENT = 512; // 0x200
+ }
+
public final class FontRequest {
ctor public FontRequest(String, String, String, java.util.List<java.util.List<byte[]!>!>);
ctor public FontRequest(String, String, String, @ArrayRes int);
@@ -2181,6 +2200,14 @@
method @Deprecated public static void setShowAsAction(android.view.MenuItem!, int);
}
+ public interface MenuHost {
+ method public void addMenuProvider(androidx.core.view.MenuProvider);
+ method public void addMenuProvider(androidx.core.view.MenuProvider, androidx.lifecycle.LifecycleOwner);
+ method public void addMenuProvider(androidx.core.view.MenuProvider, androidx.lifecycle.LifecycleOwner, androidx.lifecycle.Lifecycle.State);
+ method public void invalidateMenu();
+ method public void removeMenuProvider(androidx.core.view.MenuProvider);
+ }
+
public final class MenuItemCompat {
method @Deprecated public static boolean collapseActionView(android.view.MenuItem!);
method @Deprecated public static boolean expandActionView(android.view.MenuItem!);
@@ -2217,6 +2244,11 @@
method @Deprecated public boolean onMenuItemActionExpand(android.view.MenuItem!);
}
+ public interface MenuProvider {
+ method public void onCreateMenu(android.view.Menu, android.view.MenuInflater);
+ method public boolean onMenuItemSelected(android.view.MenuItem);
+ }
+
public final class MotionEventCompat {
method @Deprecated public static int findPointerIndex(android.view.MotionEvent!, int);
method @Deprecated public static int getActionIndex(android.view.MotionEvent!);
diff --git a/core/core/api/public_plus_experimental_current.txt b/core/core/api/public_plus_experimental_current.txt
index 0f87349..ba266c4 100644
--- a/core/core/api/public_plus_experimental_current.txt
+++ b/core/core/api/public_plus_experimental_current.txt
@@ -1741,6 +1741,25 @@
package androidx.core.provider {
+ public final class DocumentsContractCompat {
+ method public static android.net.Uri? buildChildDocumentsUri(String, String?);
+ method public static android.net.Uri? buildChildDocumentsUriUsingTree(android.net.Uri, String);
+ method public static android.net.Uri? buildDocumentUri(String, String);
+ method public static android.net.Uri? buildDocumentUriUsingTree(android.net.Uri, String);
+ method public static android.net.Uri? buildTreeDocumentUri(String, String);
+ method public static android.net.Uri? createDocument(android.content.ContentResolver, android.net.Uri, String, String) throws java.io.FileNotFoundException;
+ method public static String? getDocumentId(android.net.Uri);
+ method public static String? getTreeDocumentId(android.net.Uri);
+ method public static boolean isDocumentUri(android.content.Context, android.net.Uri?);
+ method public static boolean isTreeUri(android.net.Uri);
+ method public static boolean removeDocument(android.content.ContentResolver, android.net.Uri, android.net.Uri) throws java.io.FileNotFoundException;
+ method public static android.net.Uri? renameDocument(android.content.ContentResolver, android.net.Uri, String) throws java.io.FileNotFoundException;
+ }
+
+ public static final class DocumentsContractCompat.DocumentCompat {
+ field public static final int FLAG_VIRTUAL_DOCUMENT = 512; // 0x200
+ }
+
public final class FontRequest {
ctor public FontRequest(String, String, String, java.util.List<java.util.List<byte[]!>!>);
ctor public FontRequest(String, String, String, @ArrayRes int);
@@ -2185,6 +2204,14 @@
method @Deprecated public static void setShowAsAction(android.view.MenuItem!, int);
}
+ public interface MenuHost {
+ method public void addMenuProvider(androidx.core.view.MenuProvider);
+ method public void addMenuProvider(androidx.core.view.MenuProvider, androidx.lifecycle.LifecycleOwner);
+ method public void addMenuProvider(androidx.core.view.MenuProvider, androidx.lifecycle.LifecycleOwner, androidx.lifecycle.Lifecycle.State);
+ method public void invalidateMenu();
+ method public void removeMenuProvider(androidx.core.view.MenuProvider);
+ }
+
public final class MenuItemCompat {
method @Deprecated public static boolean collapseActionView(android.view.MenuItem!);
method @Deprecated public static boolean expandActionView(android.view.MenuItem!);
@@ -2221,6 +2248,11 @@
method @Deprecated public boolean onMenuItemActionExpand(android.view.MenuItem!);
}
+ public interface MenuProvider {
+ method public void onCreateMenu(android.view.Menu, android.view.MenuInflater);
+ method public boolean onMenuItemSelected(android.view.MenuItem);
+ }
+
public final class MotionEventCompat {
method @Deprecated public static int findPointerIndex(android.view.MotionEvent!, int);
method @Deprecated public static int getActionIndex(android.view.MotionEvent!);
diff --git a/core/core/api/restricted_current.txt b/core/core/api/restricted_current.txt
index f788b28..bfe70c0 100644
--- a/core/core/api/restricted_current.txt
+++ b/core/core/api/restricted_current.txt
@@ -2065,6 +2065,25 @@
package androidx.core.provider {
+ public final class DocumentsContractCompat {
+ method public static android.net.Uri? buildChildDocumentsUri(String, String?);
+ method public static android.net.Uri? buildChildDocumentsUriUsingTree(android.net.Uri, String);
+ method public static android.net.Uri? buildDocumentUri(String, String);
+ method public static android.net.Uri? buildDocumentUriUsingTree(android.net.Uri, String);
+ method public static android.net.Uri? buildTreeDocumentUri(String, String);
+ method public static android.net.Uri? createDocument(android.content.ContentResolver, android.net.Uri, String, String) throws java.io.FileNotFoundException;
+ method public static String? getDocumentId(android.net.Uri);
+ method public static String? getTreeDocumentId(android.net.Uri);
+ method public static boolean isDocumentUri(android.content.Context, android.net.Uri?);
+ method public static boolean isTreeUri(android.net.Uri);
+ method public static boolean removeDocument(android.content.ContentResolver, android.net.Uri, android.net.Uri) throws java.io.FileNotFoundException;
+ method public static android.net.Uri? renameDocument(android.content.ContentResolver, android.net.Uri, String) throws java.io.FileNotFoundException;
+ }
+
+ public static final class DocumentsContractCompat.DocumentCompat {
+ field public static final int FLAG_VIRTUAL_DOCUMENT = 512; // 0x200
+ }
+
public final class FontRequest {
ctor public FontRequest(String, String, String, java.util.List<java.util.List<byte[]!>!>);
ctor public FontRequest(String, String, String, @ArrayRes int);
@@ -2603,6 +2622,14 @@
method @Deprecated public static void setShowAsAction(android.view.MenuItem!, int);
}
+ public interface MenuHost {
+ method public void addMenuProvider(androidx.core.view.MenuProvider);
+ method public void addMenuProvider(androidx.core.view.MenuProvider, androidx.lifecycle.LifecycleOwner);
+ method public void addMenuProvider(androidx.core.view.MenuProvider, androidx.lifecycle.LifecycleOwner, androidx.lifecycle.Lifecycle.State);
+ method public void invalidateMenu();
+ method public void removeMenuProvider(androidx.core.view.MenuProvider);
+ }
+
public final class MenuItemCompat {
method @Deprecated public static boolean collapseActionView(android.view.MenuItem!);
method @Deprecated public static boolean expandActionView(android.view.MenuItem!);
@@ -2639,6 +2666,11 @@
method @Deprecated public boolean onMenuItemActionExpand(android.view.MenuItem!);
}
+ public interface MenuProvider {
+ method public void onCreateMenu(android.view.Menu, android.view.MenuInflater);
+ method public boolean onMenuItemSelected(android.view.MenuItem);
+ }
+
public final class MotionEventCompat {
method @Deprecated public static int findPointerIndex(android.view.MotionEvent!, int);
method @Deprecated public static int getActionIndex(android.view.MotionEvent!);
diff --git a/core/core/lint-baseline.xml b/core/core/lint-baseline.xml
index 9f56df7..2c24d1a 100644
--- a/core/core/lint-baseline.xml
+++ b/core/core/lint-baseline.xml
@@ -1,5 +1,60 @@
<?xml version="1.0" encoding="UTF-8"?>
-<issues format="6" by="lint 7.1.0-alpha06" type="baseline" client="gradle" dependencies="false" name="AGP (7.1.0-alpha06)" variant="all" version="7.1.0-alpha06">
+<issues format="6" by="lint 7.1.0-dev" type="baseline" client="gradle" dependencies="false" name="AGP (7.1.0-dev)" variant="all" version="7.1.0-dev">
+
+ <issue
+ id="NewApi"
+ message="Call requires API level S (current min is 14): `android.view.ContentInfo#getClip`"
+ errorLine1=" return mWrapped.getClip();"
+ errorLine2=" ~~~~~~~">
+ <location
+ file="src/main/java/androidx/core/view/ContentInfoCompat.java"
+ line="456"
+ column="29"/>
+ </issue>
+
+ <issue
+ id="NewApi"
+ message="Call requires API level S (current min is 14): `android.view.ContentInfo#getSource`"
+ errorLine1=" return mWrapped.getSource();"
+ errorLine2=" ~~~~~~~~~">
+ <location
+ file="src/main/java/androidx/core/view/ContentInfoCompat.java"
+ line="462"
+ column="29"/>
+ </issue>
+
+ <issue
+ id="NewApi"
+ message="Call requires API level S (current min is 14): `android.view.ContentInfo#getFlags`"
+ errorLine1=" return mWrapped.getFlags();"
+ errorLine2=" ~~~~~~~~">
+ <location
+ file="src/main/java/androidx/core/view/ContentInfoCompat.java"
+ line="468"
+ column="29"/>
+ </issue>
+
+ <issue
+ id="NewApi"
+ message="Call requires API level S (current min is 14): `android.view.ContentInfo#getLinkUri`"
+ errorLine1=" return mWrapped.getLinkUri();"
+ errorLine2=" ~~~~~~~~~~">
+ <location
+ file="src/main/java/androidx/core/view/ContentInfoCompat.java"
+ line="474"
+ column="29"/>
+ </issue>
+
+ <issue
+ id="NewApi"
+ message="Call requires API level S (current min is 14): `android.view.ContentInfo#getExtras`"
+ errorLine1=" return mWrapped.getExtras();"
+ errorLine2=" ~~~~~~~~~">
+ <location
+ file="src/main/java/androidx/core/view/ContentInfoCompat.java"
+ line="480"
+ column="29"/>
+ </issue>
<issue
id="NewApi"
@@ -102,6 +157,39 @@
<issue
id="NewApi"
+ message="Call requires API level S (current min is 30): `new android.widget.EdgeEffect`"
+ errorLine1=" return new EdgeEffect(context, attrs);"
+ errorLine2=" ~~~~~~~~~~~~~~">
+ <location
+ file="src/main/java/androidx/core/widget/EdgeEffectCompat.java"
+ line="306"
+ column="24"/>
+ </issue>
+
+ <issue
+ id="NewApi"
+ message="Call requires API level S (current min is 30): `android.widget.EdgeEffect#onPullDistance`"
+ errorLine1=" return edgeEffect.onPullDistance(deltaDistance, displacement);"
+ errorLine2=" ~~~~~~~~~~~~~~">
+ <location
+ file="src/main/java/androidx/core/widget/EdgeEffectCompat.java"
+ line="319"
+ column="35"/>
+ </issue>
+
+ <issue
+ id="NewApi"
+ message="Call requires API level S (current min is 30): `android.widget.EdgeEffect#getDistance`"
+ errorLine1=" return edgeEffect.getDistance();"
+ errorLine2=" ~~~~~~~~~~~">
+ <location
+ file="src/main/java/androidx/core/widget/EdgeEffectCompat.java"
+ line="329"
+ column="35"/>
+ </issue>
+
+ <issue
+ id="NewApi"
message="Call requires API level 19 (current min is 14): `java.lang.AutoCloseable#close`"
errorLine1=" closeable.close();"
errorLine2=" ~~~~~">
@@ -113,6 +201,39 @@
<issue
id="NewApi"
+ message="Class requires API level S (current min is 14): `android.location.LocationRequest`"
+ errorLine1=" LocationRequest.class, Executor.class, LocationListener.class);"
+ errorLine2=" ~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/java/androidx/core/location/LocationManagerCompat.java"
+ line="254"
+ column="29"/>
+ </issue>
+
+ <issue
+ id="NewApi"
+ message="Class requires API level S (current min is 14): `android.location.LocationRequest`"
+ errorLine1=" LocationRequest.class, LocationListener.class, Looper.class);"
+ errorLine2=" ~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/java/androidx/core/location/LocationManagerCompat.java"
+ line="273"
+ column="29"/>
+ </issue>
+
+ <issue
+ id="NewApi"
+ message="Class requires API level S (current min is 14): `android.location.LocationRequest`"
+ errorLine1=" LocationRequest.class, LocationListener.class, Looper.class);"
+ errorLine2=" ~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/java/androidx/core/location/LocationManagerCompat.java"
+ line="324"
+ column="29"/>
+ </issue>
+
+ <issue
+ id="NewApi"
message="Call requires API level 24 (current min is 14): `java.util.Collection#removeIf`"
errorLine1=" transports.removeIf(reference -> reference.get() == null);"
errorLine2=" ~~~~~~~~">
@@ -124,6 +245,105 @@
<issue
id="NewApi"
+ message="Call requires API level S (current min is 14): `android.location.LocationListener#onLocationChanged`"
+ errorLine1=" listener.onLocationChanged(locations);"
+ errorLine2=" ~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/java/androidx/core/location/LocationManagerCompat.java"
+ line="668"
+ column="26"/>
+ </issue>
+
+ <issue
+ id="NewApi"
+ message="Call requires API level S (current min is 14): `android.location.LocationListener#onFlushComplete`"
+ errorLine1=" listener.onFlushComplete(requestCode);"
+ errorLine2=" ~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/java/androidx/core/location/LocationManagerCompat.java"
+ line="683"
+ column="26"/>
+ </issue>
+
+ <issue
+ id="NewApi"
+ message="Class requires API level S (current min is 19): `android.location.LocationRequest`"
+ errorLine1=" sCreateFromDeprecatedProviderMethod = LocationRequest.class.getDeclaredMethod("
+ errorLine2=" ~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/java/androidx/core/location/LocationRequestCompat.java"
+ line="234"
+ column="55"/>
+ </issue>
+
+ <issue
+ id="NewApi"
+ message="Class requires API level S (current min is 19): `android.location.LocationRequest`"
+ errorLine1=" (LocationRequest) sCreateFromDeprecatedProviderMethod.invoke(null, provider,"
+ errorLine2=" ~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/java/androidx/core/location/LocationRequestCompat.java"
+ line="241"
+ column="22"/>
+ </issue>
+
+ <issue
+ id="NewApi"
+ message="Class requires API level S (current min is 19): `android.location.LocationRequest`"
+ errorLine1=" sSetQualityMethod = LocationRequest.class.getDeclaredMethod("
+ errorLine2=" ~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/java/androidx/core/location/LocationRequestCompat.java"
+ line="250"
+ column="37"/>
+ </issue>
+
+ <issue
+ id="NewApi"
+ message="Class requires API level S (current min is 19): `android.location.LocationRequest`"
+ errorLine1=" sSetFastestIntervalMethod = LocationRequest.class.getDeclaredMethod("
+ errorLine2=" ~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/java/androidx/core/location/LocationRequestCompat.java"
+ line="258"
+ column="49"/>
+ </issue>
+
+ <issue
+ id="NewApi"
+ message="Class requires API level S (current min is 19): `android.location.LocationRequest`"
+ errorLine1=" sSetNumUpdatesMethod = LocationRequest.class.getDeclaredMethod("
+ errorLine2=" ~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/java/androidx/core/location/LocationRequestCompat.java"
+ line="268"
+ column="44"/>
+ </issue>
+
+ <issue
+ id="NewApi"
+ message="Class requires API level S (current min is 19): `android.location.LocationRequest`"
+ errorLine1=" sSetExpireInMethod = LocationRequest.class.getDeclaredMethod("
+ errorLine2=" ~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/java/androidx/core/location/LocationRequestCompat.java"
+ line="278"
+ column="42"/>
+ </issue>
+
+ <issue
+ id="NewApi"
+ message="Call requires API level S (current min is 19): `android.location.LocationRequest#getQuality`"
+ errorLine1=" builder.build().toLocationRequest("test").getQuality());"
+ errorLine2=" ~~~~~~~~~~">
+ <location
+ file="src/androidTest/java/androidx/core/location/LocationRequestCompatTest.java"
+ line="102"
+ column="59"/>
+ </issue>
+
+ <issue
+ id="NewApi"
message="Call requires API level S (current min is 19): `toLocationRequest`"
errorLine1=" assertEquals(Long.MAX_VALUE, getExpireAt(builder.build().toLocationRequest()));"
errorLine2=" ~~~~~~~~~~~~~~~~~">
@@ -135,6 +355,17 @@
<issue
id="NewApi"
+ message="Call requires API level S (current min is 19): `android.location.LocationRequest#getQuality`"
+ errorLine1=" assertEquals(QUALITY_HIGH_ACCURACY, builder.build().toLocationRequest("test").getQuality());"
+ errorLine2=" ~~~~~~~~~~">
+ <location
+ file="src/androidTest/java/androidx/core/location/LocationRequestCompatTest.java"
+ line="110"
+ column="87"/>
+ </issue>
+
+ <issue
+ id="NewApi"
message="Call requires API level S (current min is 19): `toLocationRequest`"
errorLine1=" assertThat(getExpireAt(builder.build().toLocationRequest())).isIn("
errorLine2=" ~~~~~~~~~~~~~~~~~">
@@ -146,6 +377,72 @@
<issue
id="NewApi"
+ message="Class requires API level S (current min is 14): `android.location.LocationRequest`"
+ errorLine1=" sGetProviderMethod = LocationRequest.class.getDeclaredMethod("getProvider");"
+ errorLine2=" ~~~~~~~~~~~~~~~">
+ <location
+ file="src/androidTest/java/androidx/core/location/LocationRequestCompatTest.java"
+ line="186"
+ column="34"/>
+ </issue>
+
+ <issue
+ id="NewApi"
+ message="Class requires API level S (current min is 14): `android.location.LocationRequest`"
+ errorLine1=" sGetIntervalMethod = LocationRequest.class.getDeclaredMethod("getInterval");"
+ errorLine2=" ~~~~~~~~~~~~~~~">
+ <location
+ file="src/androidTest/java/androidx/core/location/LocationRequestCompatTest.java"
+ line="196"
+ column="34"/>
+ </issue>
+
+ <issue
+ id="NewApi"
+ message="Class requires API level S (current min is 14): `android.location.LocationRequest`"
+ errorLine1=" sGetFastestIntervalMethod = LocationRequest.class.getDeclaredMethod("
+ errorLine2=" ~~~~~~~~~~~~~~~">
+ <location
+ file="src/androidTest/java/androidx/core/location/LocationRequestCompatTest.java"
+ line="206"
+ column="41"/>
+ </issue>
+
+ <issue
+ id="NewApi"
+ message="Class requires API level S (current min is 14): `android.location.LocationRequest`"
+ errorLine1=" sGetExpireAtMethod = LocationRequest.class.getDeclaredMethod("getExpireAt");"
+ errorLine2=" ~~~~~~~~~~~~~~~">
+ <location
+ file="src/androidTest/java/androidx/core/location/LocationRequestCompatTest.java"
+ line="217"
+ column="34"/>
+ </issue>
+
+ <issue
+ id="NewApi"
+ message="Class requires API level S (current min is 14): `android.location.LocationRequest`"
+ errorLine1=" sGetNumUpdatesMethod = LocationRequest.class.getDeclaredMethod("getNumUpdates");"
+ errorLine2=" ~~~~~~~~~~~~~~~">
+ <location
+ file="src/androidTest/java/androidx/core/location/LocationRequestCompatTest.java"
+ line="227"
+ column="36"/>
+ </issue>
+
+ <issue
+ id="NewApi"
+ message="Class requires API level S (current min is 14): `android.location.LocationRequest`"
+ errorLine1=" sGetSmallestDisplacementMethod = LocationRequest.class.getDeclaredMethod("
+ errorLine2=" ~~~~~~~~~~~~~~~">
+ <location
+ file="src/androidTest/java/androidx/core/location/LocationRequestCompatTest.java"
+ line="237"
+ column="46"/>
+ </issue>
+
+ <issue
+ id="NewApi"
message="Call requires API level 26 (current min is 14): `android.app.NotificationChannel#getImportance`"
errorLine1=" boolean equality = nc1.getImportance() == nc2.getImportance()"
errorLine2=" ~~~~~~~~~~~~~">
@@ -685,28 +982,6 @@
<issue
id="NewApi"
- message="Call requires API level 21 (current min is 14): `android.os.BaseBundle#get`"
- errorLine1=" assertValueEquals("$keyPath/$key", b1[key], b2[key])"
- errorLine2=" ~~~~~~~">
- <location
- file="src/androidTest/java/androidx/core/app/NotificationTester.kt"
- line="39"
- column="48"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Call requires API level 21 (current min is 14): `android.os.BaseBundle#get`"
- errorLine1=" assertValueEquals("$keyPath/$key", b1[key], b2[key])"
- errorLine2=" ~~~~~~~">
- <location
- file="src/androidTest/java/androidx/core/app/NotificationTester.kt"
- line="39"
- column="57"/>
- </issue>
-
- <issue
- id="NewApi"
message="Call requires API level 29 (current min is 28): `COLOR_DODGE`"
errorLine1=" verifyPorterDuffMatchesCompat(BlendModeCompat.COLOR_DODGE, null);"
errorLine2=" ~~~~~~~~~~~">
@@ -1108,7 +1383,7 @@
errorLine2=" ~~~~~~~~">
<location
file="src/androidTest/java/androidx/core/view/WindowInsetsControllerCompatActivityTest.kt"
- line="269"
+ line="298"
column="9"/>
</issue>
@@ -1119,7 +1394,7 @@
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~">
<location
file="src/androidTest/java/androidx/core/view/WindowInsetsControllerCompatActivityTest.kt"
- line="270"
+ line="299"
column="13"/>
</issue>
@@ -1130,7 +1405,7 @@
errorLine2=" ~~~~~~~~">
<location
file="src/androidTest/java/androidx/core/view/WindowInsetsControllerCompatActivityTest.kt"
- line="273"
+ line="302"
column="25"/>
</issue>
@@ -1141,7 +1416,7 @@
errorLine2=" ~~~~~~~~">
<location
file="src/androidTest/java/androidx/core/view/WindowInsetsControllerCompatActivityTest.kt"
- line="286"
+ line="315"
column="9"/>
</issue>
@@ -1152,7 +1427,7 @@
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~">
<location
file="src/androidTest/java/androidx/core/view/WindowInsetsControllerCompatActivityTest.kt"
- line="287"
+ line="316"
column="13"/>
</issue>
@@ -1163,7 +1438,7 @@
errorLine2=" ~~~~~~~~">
<location
file="src/androidTest/java/androidx/core/view/WindowInsetsControllerCompatActivityTest.kt"
- line="290"
+ line="319"
column="25"/>
</issue>
@@ -1339,7 +1614,7 @@
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="src/main/java/androidx/core/view/WindowInsetsControllerCompat.java"
- line="723"
+ line="730"
column="20"/>
</issue>
@@ -9519,7 +9794,7 @@
errorLine2=" ~~~~">
<location
file="src/main/java/androidx/core/view/ViewCompat.java"
- line="1468"
+ line="1469"
column="34"/>
</issue>
@@ -9530,7 +9805,7 @@
errorLine2=" ~~~~">
<location
file="src/main/java/androidx/core/view/ViewCompat.java"
- line="1507"
+ line="1508"
column="37"/>
</issue>
@@ -9541,7 +9816,7 @@
errorLine2=" ~~~~~">
<location
file="src/main/java/androidx/core/view/ViewCompat.java"
- line="1507"
+ line="1508"
column="74"/>
</issue>
@@ -9552,7 +9827,7 @@
errorLine2=" ~~~~">
<location
file="src/main/java/androidx/core/view/ViewCompat.java"
- line="1531"
+ line="1532"
column="36"/>
</issue>
@@ -9563,7 +9838,7 @@
errorLine2=" ~~~~">
<location
file="src/main/java/androidx/core/view/ViewCompat.java"
- line="1699"
+ line="1700"
column="36"/>
</issue>
@@ -9574,7 +9849,7 @@
errorLine2=" ~~~~">
<location
file="src/main/java/androidx/core/view/ViewCompat.java"
- line="1736"
+ line="1737"
column="48"/>
</issue>
@@ -9585,7 +9860,7 @@
errorLine2=" ~~~~">
<location
file="src/main/java/androidx/core/view/ViewCompat.java"
- line="1753"
+ line="1754"
column="49"/>
</issue>
@@ -9596,7 +9871,7 @@
errorLine2=" ~~~~">
<location
file="src/main/java/androidx/core/view/ViewCompat.java"
- line="1767"
+ line="1768"
column="40"/>
</issue>
@@ -9607,7 +9882,7 @@
errorLine2=" ~~~~">
<location
file="src/main/java/androidx/core/view/ViewCompat.java"
- line="1959"
+ line="1960"
column="41"/>
</issue>
@@ -9618,7 +9893,7 @@
errorLine2=" ~~~~">
<location
file="src/main/java/androidx/core/view/ViewCompat.java"
- line="1973"
+ line="1974"
column="41"/>
</issue>
@@ -9629,7 +9904,7 @@
errorLine2=" ~~~~">
<location
file="src/main/java/androidx/core/view/ViewCompat.java"
- line="1995"
+ line="1996"
column="36"/>
</issue>
@@ -9640,7 +9915,7 @@
errorLine2=" ~~~~">
<location
file="src/main/java/androidx/core/view/ViewCompat.java"
- line="2101"
+ line="2102"
column="40"/>
</issue>
@@ -9651,7 +9926,7 @@
errorLine2=" ~~~~">
<location
file="src/main/java/androidx/core/view/ViewCompat.java"
- line="2118"
+ line="2119"
column="40"/>
</issue>
@@ -9662,7 +9937,7 @@
errorLine2=" ~~~~">
<location
file="src/main/java/androidx/core/view/ViewCompat.java"
- line="2135"
+ line="2136"
column="33"/>
</issue>
@@ -9673,7 +9948,7 @@
errorLine2=" ~~~~">
<location
file="src/main/java/androidx/core/view/ViewCompat.java"
- line="2150"
+ line="2151"
column="29"/>
</issue>
@@ -9684,7 +9959,7 @@
errorLine2=" ~~~~">
<location
file="src/main/java/androidx/core/view/ViewCompat.java"
- line="2165"
+ line="2166"
column="29"/>
</issue>
@@ -9695,7 +9970,7 @@
errorLine2=" ~~~~">
<location
file="src/main/java/androidx/core/view/ViewCompat.java"
- line="2178"
+ line="2179"
column="36"/>
</issue>
@@ -9706,7 +9981,7 @@
errorLine2=" ~~~~">
<location
file="src/main/java/androidx/core/view/ViewCompat.java"
- line="2192"
+ line="2193"
column="37"/>
</issue>
@@ -9717,7 +9992,7 @@
errorLine2=" ~~~~">
<location
file="src/main/java/androidx/core/view/ViewCompat.java"
- line="2206"
+ line="2207"
column="37"/>
</issue>
@@ -9728,7 +10003,7 @@
errorLine2=" ~~~~">
<location
file="src/main/java/androidx/core/view/ViewCompat.java"
- line="2219"
+ line="2220"
column="34"/>
</issue>
@@ -9739,7 +10014,7 @@
errorLine2=" ~~~~">
<location
file="src/main/java/androidx/core/view/ViewCompat.java"
- line="2232"
+ line="2233"
column="34"/>
</issue>
@@ -9750,7 +10025,7 @@
errorLine2=" ~~~~">
<location
file="src/main/java/androidx/core/view/ViewCompat.java"
- line="2243"
+ line="2244"
column="35"/>
</issue>
@@ -9761,7 +10036,7 @@
errorLine2=" ~~~~">
<location
file="src/main/java/androidx/core/view/ViewCompat.java"
- line="2259"
+ line="2260"
column="34"/>
</issue>
@@ -9772,7 +10047,7 @@
errorLine2=" ~~~~">
<location
file="src/main/java/androidx/core/view/ViewCompat.java"
- line="2272"
+ line="2273"
column="35"/>
</issue>
@@ -9783,7 +10058,7 @@
errorLine2=" ~~~~">
<location
file="src/main/java/androidx/core/view/ViewCompat.java"
- line="2288"
+ line="2289"
column="34"/>
</issue>
@@ -9794,7 +10069,7 @@
errorLine2=" ~~~~">
<location
file="src/main/java/androidx/core/view/ViewCompat.java"
- line="2296"
+ line="2297"
column="37"/>
</issue>
@@ -9805,7 +10080,7 @@
errorLine2=" ~~~~">
<location
file="src/main/java/androidx/core/view/ViewCompat.java"
- line="2304"
+ line="2305"
column="38"/>
</issue>
@@ -9816,7 +10091,7 @@
errorLine2=" ~~~~">
<location
file="src/main/java/androidx/core/view/ViewCompat.java"
- line="2312"
+ line="2313"
column="38"/>
</issue>
@@ -9827,7 +10102,7 @@
errorLine2=" ~~~~">
<location
file="src/main/java/androidx/core/view/ViewCompat.java"
- line="2320"
+ line="2321"
column="35"/>
</issue>
@@ -9838,7 +10113,7 @@
errorLine2=" ~~~~">
<location
file="src/main/java/androidx/core/view/ViewCompat.java"
- line="2328"
+ line="2329"
column="35"/>
</issue>
@@ -9849,7 +10124,7 @@
errorLine2=" ~~~~">
<location
file="src/main/java/androidx/core/view/ViewCompat.java"
- line="2336"
+ line="2337"
column="30"/>
</issue>
@@ -9860,7 +10135,7 @@
errorLine2=" ~~~~">
<location
file="src/main/java/androidx/core/view/ViewCompat.java"
- line="2344"
+ line="2345"
column="30"/>
</issue>
@@ -9871,7 +10146,7 @@
errorLine2=" ~~~~~~~~~">
<location
file="src/main/java/androidx/core/view/ViewCompat.java"
- line="2468"
+ line="2469"
column="55"/>
</issue>
@@ -9882,7 +10157,7 @@
errorLine2=" ~~~~">
<location
file="src/main/java/androidx/core/view/ViewCompat.java"
- line="2509"
+ line="2510"
column="45"/>
</issue>
@@ -9893,7 +10168,7 @@
errorLine2=" ~~~~">
<location
file="src/main/java/androidx/core/view/ViewCompat.java"
- line="2523"
+ line="2524"
column="52"/>
</issue>
@@ -9904,7 +10179,7 @@
errorLine2=" ~~~~">
<location
file="src/main/java/androidx/core/view/ViewCompat.java"
- line="2929"
+ line="2930"
column="49"/>
</issue>
@@ -9915,7 +10190,7 @@
errorLine2=" ~~~~">
<location
file="src/main/java/androidx/core/view/ViewCompat.java"
- line="2945"
+ line="2946"
column="37"/>
</issue>
diff --git a/core/core/src/androidTest/java/androidx/core/location/LocationRequestCompatTest.java b/core/core/src/androidTest/java/androidx/core/location/LocationRequestCompatTest.java
index 4500b2c..93cfca4 100644
--- a/core/core/src/androidTest/java/androidx/core/location/LocationRequestCompatTest.java
+++ b/core/core/src/androidTest/java/androidx/core/location/LocationRequestCompatTest.java
@@ -25,8 +25,10 @@
import static org.junit.Assert.assertEquals;
import android.location.LocationRequest;
+import android.os.Build.VERSION;
import android.os.SystemClock;
+import androidx.annotation.RequiresApi;
import androidx.core.util.Preconditions;
import androidx.test.filters.SdkSuppress;
import androidx.test.filters.SmallTest;
@@ -45,6 +47,7 @@
private static Method sGetIntervalMethod;
private static Method sGetFastestIntervalMethod;
private static Method sGetExpireAtMethod;
+ private static Method sGetExpireInMethod;
private static Method sGetNumUpdatesMethod;
private static Method sGetSmallestDisplacementMethod;
@@ -102,7 +105,7 @@
builder.build().toLocationRequest("test").getQuality());
assertEquals(0, getInterval(builder.build().toLocationRequest("test")));
assertEquals(0, getFastestInterval(builder.build().toLocationRequest("test")));
- assertEquals(Long.MAX_VALUE, getExpireAt(builder.build().toLocationRequest()));
+ assertEquals(Long.MAX_VALUE, getExpireAt(builder.build().toLocationRequest("test")));
assertEquals(Integer.MAX_VALUE, getNumUpdates(builder.build().toLocationRequest("test")));
assertEquals(0, getSmallestDisplacement(builder.build().toLocationRequest("test")), 0);
@@ -122,9 +125,13 @@
assertEquals(1000, getFastestInterval(builder.build().toLocationRequest("test")));
builder.setDurationMillis(1);
- long time = SystemClock.elapsedRealtime();
- assertThat(getExpireAt(builder.build().toLocationRequest())).isIn(
- Range.closed(time - 1000, time));
+ if (VERSION.SDK_INT < 30) {
+ long time = SystemClock.elapsedRealtime();
+ assertThat(getExpireAt(builder.build().toLocationRequest("test"))).isIn(
+ Range.closed(time - 100, time + 100));
+ } else {
+ assertThat(getExpireIn(builder.build().toLocationRequest("test"))).isEqualTo(1);
+ }
builder.setMaxUpdates(1);
assertEquals(1, getNumUpdates(builder.build().toLocationRequest("test")));
@@ -221,6 +228,17 @@
return (Long) Preconditions.checkNotNull(sGetExpireAtMethod.invoke(request));
}
+ @RequiresApi(30)
+ private static long getExpireIn(LocationRequest request)
+ throws InvocationTargetException, IllegalAccessException, NoSuchMethodException {
+ if (sGetExpireInMethod == null) {
+ sGetExpireInMethod = LocationRequest.class.getDeclaredMethod("getExpireIn");
+ sGetExpireInMethod.setAccessible(true);
+ }
+
+ return (Long) Preconditions.checkNotNull(sGetExpireInMethod.invoke(request));
+ }
+
private static int getNumUpdates(LocationRequest request)
throws InvocationTargetException, IllegalAccessException, NoSuchMethodException {
if (sGetNumUpdatesMethod == null) {
diff --git a/core/core/src/androidTest/java/androidx/core/provider/DocumentsContractCompatTest.kt b/core/core/src/androidTest/java/androidx/core/provider/DocumentsContractCompatTest.kt
new file mode 100644
index 0000000..ef88a90
--- /dev/null
+++ b/core/core/src/androidTest/java/androidx/core/provider/DocumentsContractCompatTest.kt
@@ -0,0 +1,302 @@
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * 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.
+ */
+
+package androidx.core.provider
+
+import android.net.Uri
+import android.os.Build
+import android.provider.DocumentsContract
+import android.provider.MediaStore
+import androidx.test.filters.MediumTest
+import androidx.test.filters.SdkSuppress
+import androidx.test.filters.SmallTest
+import androidx.test.platform.app.InstrumentationRegistry
+import org.junit.Assert.assertEquals
+import org.junit.Assert.assertFalse
+import org.junit.Assert.assertNull
+import org.junit.Assert.assertTrue
+import org.junit.Test
+
+private const val EXTERNAL_STORAGE_PROVIDER_AUTHORITY = "com.android.externalstorage.documents"
+private const val DOWNLOAD_DOCID = "primary:Download"
+
+/**
+ * Tests for {@link DocumentsContractCompat}.
+ */
+@SmallTest
+class DocumentsContractCompatTest {
+
+ @Test
+ @SdkSuppress(minSdkVersion = 24)
+ fun testVirtualDocConstantCheck() {
+ assertEquals(
+ DocumentsContractCompat.DocumentCompat.FLAG_VIRTUAL_DOCUMENT,
+ DocumentsContract.Document.FLAG_VIRTUAL_DOCUMENT
+ )
+ }
+
+ @Test
+ fun testBuildChildDocumentsUri() {
+ if (isAtLeastKitKat()) {
+ assertEquals(
+ DocumentsContractCompat.buildChildDocumentsUri(
+ EXTERNAL_STORAGE_PROVIDER_AUTHORITY, DOWNLOAD_DOCID
+ ),
+ DocumentsContract.buildChildDocumentsUri(
+ EXTERNAL_STORAGE_PROVIDER_AUTHORITY, DOWNLOAD_DOCID
+ )
+ )
+ } else {
+ assertNull(
+ DocumentsContractCompat.buildChildDocumentsUri(
+ EXTERNAL_STORAGE_PROVIDER_AUTHORITY,
+ DOWNLOAD_DOCID
+ )
+ )
+ }
+ }
+
+ @Test
+ fun testBuildChildDocumentsUriUsingTree() {
+ if (isAtLeastLollipop()) {
+ val treeUri = DocumentsContract.buildTreeDocumentUri(
+ EXTERNAL_STORAGE_PROVIDER_AUTHORITY, DOWNLOAD_DOCID
+ )
+ assertEquals(
+ DocumentsContractCompat.buildChildDocumentsUriUsingTree(treeUri, DOWNLOAD_DOCID),
+ DocumentsContract.buildChildDocumentsUriUsingTree(treeUri, DOWNLOAD_DOCID)
+ )
+ } else {
+ val treeUri = buildTreeDocUri(EXTERNAL_STORAGE_PROVIDER_AUTHORITY, DOWNLOAD_DOCID)
+ val treeUriWithDocId = buildDocUriWithTree(treeUri, DOWNLOAD_DOCID)
+ assertNull(
+ DocumentsContractCompat.buildChildDocumentsUriUsingTree(
+ treeUriWithDocId,
+ DOWNLOAD_DOCID
+ ),
+ )
+ }
+ }
+
+ @Test
+ fun testBuildDocumentUri() {
+ if (isAtLeastKitKat()) {
+ assertEquals(
+ DocumentsContractCompat.buildDocumentUri(
+ EXTERNAL_STORAGE_PROVIDER_AUTHORITY, DOWNLOAD_DOCID
+ ),
+ DocumentsContract.buildDocumentUri(
+ EXTERNAL_STORAGE_PROVIDER_AUTHORITY, DOWNLOAD_DOCID
+ )
+ )
+ } else {
+ assertNull(
+ DocumentsContractCompat.buildDocumentUri(
+ EXTERNAL_STORAGE_PROVIDER_AUTHORITY, DOWNLOAD_DOCID
+ )
+ )
+ }
+ }
+
+ @Test
+ fun testBuildDocumentUriUsingTree() {
+ if (isAtLeastLollipop()) {
+ val treeUri = DocumentsContract.buildTreeDocumentUri(
+ EXTERNAL_STORAGE_PROVIDER_AUTHORITY, DOWNLOAD_DOCID
+ )
+ assertEquals(
+ DocumentsContractCompat.buildDocumentUriUsingTree(treeUri, DOWNLOAD_DOCID),
+ DocumentsContract.buildDocumentUriUsingTree(treeUri, DOWNLOAD_DOCID)
+ )
+ } else {
+ val treeUri = buildTreeDocUri(EXTERNAL_STORAGE_PROVIDER_AUTHORITY, DOWNLOAD_DOCID)
+ assertNull(
+ DocumentsContractCompat.buildDocumentUriUsingTree(treeUri, DOWNLOAD_DOCID)
+ )
+ }
+ }
+
+ @Test
+ fun testBuildTreeDocumentUri() {
+ if (isAtLeastLollipop()) {
+ assertEquals(
+ DocumentsContractCompat.buildTreeDocumentUri(
+ EXTERNAL_STORAGE_PROVIDER_AUTHORITY,
+ DOWNLOAD_DOCID
+ ),
+ DocumentsContract.buildTreeDocumentUri(
+ EXTERNAL_STORAGE_PROVIDER_AUTHORITY,
+ DOWNLOAD_DOCID
+ )
+ )
+ } else {
+ assertNull(
+ DocumentsContractCompat.buildTreeDocumentUri(
+ EXTERNAL_STORAGE_PROVIDER_AUTHORITY, DOWNLOAD_DOCID
+ )
+ )
+ }
+ }
+
+ @Test
+ fun testGetDocumentId() {
+ if (isAtLeastKitKat()) {
+ val documentUri = DocumentsContract.buildDocumentUri(
+ EXTERNAL_STORAGE_PROVIDER_AUTHORITY, DOWNLOAD_DOCID
+ )
+ assertEquals(
+ DocumentsContractCompat.getDocumentId(documentUri),
+ DocumentsContract.getDocumentId(documentUri)
+ )
+ } else {
+ val documentUri = buildDocUri(EXTERNAL_STORAGE_PROVIDER_AUTHORITY, DOWNLOAD_DOCID)
+ assertNull(
+ DocumentsContractCompat.getDocumentId(documentUri)
+ )
+ }
+ }
+
+ @Test
+ fun testGetTreeDocumentId() {
+ if (isAtLeastLollipop()) {
+ val treeUri = DocumentsContract.buildTreeDocumentUri(
+ EXTERNAL_STORAGE_PROVIDER_AUTHORITY, DOWNLOAD_DOCID
+ )
+ val treeUriWithDocId =
+ DocumentsContract.buildDocumentUriUsingTree(treeUri, DOWNLOAD_DOCID)
+ assertEquals(
+ DocumentsContractCompat.getTreeDocumentId(treeUri),
+ DocumentsContract.getTreeDocumentId(treeUri)
+ )
+ assertEquals(
+ DocumentsContractCompat.getTreeDocumentId(treeUriWithDocId),
+ DocumentsContract.getTreeDocumentId(treeUriWithDocId)
+ )
+ } else {
+ val treeUri = buildTreeDocUri(EXTERNAL_STORAGE_PROVIDER_AUTHORITY, DOWNLOAD_DOCID)
+ val treeUriWithDocId = buildDocUriWithTree(treeUri, DOWNLOAD_DOCID)
+
+ assertNull(DocumentsContractCompat.getTreeDocumentId(treeUri))
+ assertNull(DocumentsContractCompat.getTreeDocumentId(treeUriWithDocId))
+ }
+ }
+
+ @Test
+ fun testIsTreeUri() {
+ if (isAtLeastLollipop()) {
+ val documentUri = DocumentsContract.buildDocumentUri(
+ EXTERNAL_STORAGE_PROVIDER_AUTHORITY, DOWNLOAD_DOCID
+ )
+ assertFalse(DocumentsContractCompat.isTreeUri(documentUri))
+ val downloadTree = DocumentsContract.buildTreeDocumentUri(
+ EXTERNAL_STORAGE_PROVIDER_AUTHORITY, DOWNLOAD_DOCID
+ )
+ val downloadTreeDocUri = DocumentsContract.buildDocumentUriUsingTree(
+ downloadTree, DOWNLOAD_DOCID
+ )
+ // A bare "tree" Uri is a tree Uri.
+ assertTrue(DocumentsContractCompat.isTreeUri(downloadTree))
+ // So is a "tree" Uri that includes a "document" part.
+ assertTrue(DocumentsContractCompat.isTreeUri(downloadTreeDocUri))
+ } else {
+ val documentUri = buildDocUri(EXTERNAL_STORAGE_PROVIDER_AUTHORITY, DOWNLOAD_DOCID)
+ val downloadTree = buildTreeDocUri(EXTERNAL_STORAGE_PROVIDER_AUTHORITY, DOWNLOAD_DOCID)
+ val downloadTreeDocUri = buildDocUriWithTree(downloadTree, DOWNLOAD_DOCID)
+
+ assertFalse(DocumentsContractCompat.isTreeUri(documentUri))
+ assertFalse(DocumentsContractCompat.isTreeUri(downloadTree))
+ assertFalse(DocumentsContractCompat.isTreeUri(downloadTreeDocUri))
+ }
+ }
+
+ /**
+ * This is a "medium" test because it performs IPC to lookup if the authority of the Uri
+ * passed in is a [android.provider.DocumentsProvider]. To be safe, we use the
+ * authority of `com.android.externalstorage.ExternalStorageProvider`.
+ */
+ @MediumTest
+ @Test
+ fun testIsDocumentUri() {
+ val context = InstrumentationRegistry.getInstrumentation().context
+
+ // MediaStore Uris are not DocumentUris.
+ val mediaStoreUri = MediaStore.Images.Media.EXTERNAL_CONTENT_URI
+ assertFalse(DocumentsContractCompat.isDocumentUri(context, mediaStoreUri))
+
+ if (isAtLeastKitKat()) {
+ val documentUri = DocumentsContract.buildDocumentUri(
+ EXTERNAL_STORAGE_PROVIDER_AUTHORITY, DOWNLOAD_DOCID
+ )
+ assertTrue(DocumentsContractCompat.isDocumentUri(context, documentUri))
+ } else {
+ val documentUri = buildDocUri(EXTERNAL_STORAGE_PROVIDER_AUTHORITY, DOWNLOAD_DOCID)
+
+ // DocumentsProvider doesn't exist before KitKat.
+ assertFalse(DocumentsContractCompat.isDocumentUri(context, documentUri))
+ }
+
+ if (isAtLeastLollipop()) {
+ val downloadTree = DocumentsContract.buildTreeDocumentUri(
+ EXTERNAL_STORAGE_PROVIDER_AUTHORITY, DOWNLOAD_DOCID
+ )
+ val downloadTreeDocUri = DocumentsContract.buildDocumentUriUsingTree(
+ downloadTree, DOWNLOAD_DOCID
+ )
+ // A bare "tree" Uri is not a "document" Uri.
+ assertFalse(DocumentsContractCompat.isDocumentUri(context, downloadTree))
+ // But a "tree" with a "document" part is.
+ assertTrue(DocumentsContractCompat.isDocumentUri(context, downloadTreeDocUri))
+ } else {
+ val downloadTree = buildTreeDocUri(EXTERNAL_STORAGE_PROVIDER_AUTHORITY, DOWNLOAD_DOCID)
+ val downloadTreeDocUri = buildDocUriWithTree(downloadTree, DOWNLOAD_DOCID)
+
+ // Trees aren't supported below Lollipop.
+ assertFalse(DocumentsContractCompat.isDocumentUri(context, downloadTree))
+ assertFalse(DocumentsContractCompat.isDocumentUri(context, downloadTreeDocUri))
+ }
+ }
+
+ private fun isAtLeastKitKat() = Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT
+ private fun isAtLeastLollipop() = Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP
+
+ /**
+ * Helper method that works similar to [DocumentsContract.buildDocumentUri].
+ */
+ @Suppress("SameParameterValue")
+ private fun buildDocUri(authority: String, docId: String) =
+ Uri.Builder().scheme("content")
+ .authority(authority).appendPath("document").appendPath(docId).build()
+
+ /**
+ * Helper method that works similar to [DocumentsContract.buildDocumentUriUsingTree].
+ */
+ @Suppress("SameParameterValue")
+ private fun buildDocUriWithTree(treeUri: Uri, docId: String) =
+ Uri.Builder().scheme("content")
+ .authority(treeUri.authority)
+ .appendPath("tree").appendPath(treeUri.pathSegments[1])
+ .appendPath("document").appendPath(docId)
+ .build()
+
+ /**
+ * Helper method that works similar to [DocumentsContract.buildTreeDocumentUri].
+ */
+ @Suppress("SameParameterValue")
+ private fun buildTreeDocUri(authority: String, docId: String) =
+ Uri.Builder().scheme("content")
+ .authority(authority).appendPath("tree").appendPath(docId)
+ .build()
+}
diff --git a/core/core/src/main/java/androidx/core/content/PackageManagerCompat.java b/core/core/src/main/java/androidx/core/content/PackageManagerCompat.java
index e0ffa4b..8b901ee 100644
--- a/core/core/src/main/java/androidx/core/content/PackageManagerCompat.java
+++ b/core/core/src/main/java/androidx/core/content/PackageManagerCompat.java
@@ -57,7 +57,9 @@
/* Hide constructor */
}
- static final String LOG_TAG = "PackageManagerCompat";
+ /** @hide */
+ @RestrictTo(LIBRARY)
+ public static final String LOG_TAG = "PackageManagerCompat";
/**
* Activity action: creates an intent to redirect the user to UI to turn on/off their
@@ -170,11 +172,11 @@
UnusedAppRestrictionsBackportServiceConnection backportServiceConnection =
new UnusedAppRestrictionsBackportServiceConnection(context);
- resultFuture.addListener(() -> {
- // Keep the connection object alive until the async operation completes, and then
- // disconnect it.
- backportServiceConnection.disconnectFromService();
- }, Executors.newSingleThreadExecutor());
+ // Keep the connection object alive until the async operation completes, and then
+ // disconnect it.
+ resultFuture.addListener(
+ backportServiceConnection::disconnectFromService,
+ Executors.newSingleThreadExecutor());
// Start binding the service and fetch the result
backportServiceConnection.connectAndFetchResult(resultFuture);
@@ -182,8 +184,13 @@
return resultFuture;
}
- /** Returns whether any unused app restriction features are available on the device. */
- static boolean areUnusedAppRestrictionsAvailable(
+ /**
+ * Returns whether any unused app restriction features are available on the device.
+ *
+ * @hide
+ */
+ @RestrictTo(LIBRARY)
+ public static boolean areUnusedAppRestrictionsAvailable(
@NonNull PackageManager packageManager) {
boolean restrictionsBuiltIntoOs = Build.VERSION.SDK_INT >= Build.VERSION_CODES.R;
boolean isOsMThroughQ =
@@ -198,9 +205,13 @@
* Returns the package name of the one and only Verifier on the device that can support
* permission revocation. If none exist, this will return {@code null}. Likewise, if multiple
* Verifiers exist, this method will return the first Verifier's package name.
+ *
+ * @hide
*/
@Nullable
- static String getPermissionRevocationVerifierApp(@NonNull PackageManager packageManager) {
+ @RestrictTo(LIBRARY)
+ public static String getPermissionRevocationVerifierApp(
+ @NonNull PackageManager packageManager) {
Intent permissionRevocationSettingsIntent =
new Intent(ACTION_PERMISSION_REVOCATION_SETTINGS)
.setData(Uri.fromParts(
diff --git a/core/core/src/main/java/androidx/core/content/UnusedAppRestrictionsBackportCallback.java b/core/core/src/main/java/androidx/core/content/UnusedAppRestrictionsBackportCallback.java
index df892cb..34dd875 100644
--- a/core/core/src/main/java/androidx/core/content/UnusedAppRestrictionsBackportCallback.java
+++ b/core/core/src/main/java/androidx/core/content/UnusedAppRestrictionsBackportCallback.java
@@ -16,8 +16,12 @@
package androidx.core.content;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY;
+
import android.os.RemoteException;
+import androidx.annotation.NonNull;
+import androidx.annotation.RestrictTo;
import androidx.core.app.unusedapprestrictions.IUnusedAppRestrictionsBackportCallback;
/**
@@ -30,7 +34,10 @@
private IUnusedAppRestrictionsBackportCallback mCallback;
- UnusedAppRestrictionsBackportCallback(IUnusedAppRestrictionsBackportCallback callback) {
+ /** @hide */
+ @RestrictTo(LIBRARY)
+ public UnusedAppRestrictionsBackportCallback(
+ @NonNull IUnusedAppRestrictionsBackportCallback callback) {
mCallback = callback;
}
diff --git a/core/core/src/main/java/androidx/core/content/res/ResourcesCompat.java b/core/core/src/main/java/androidx/core/content/res/ResourcesCompat.java
index f27583d..03c8c78 100644
--- a/core/core/src/main/java/androidx/core/content/res/ResourcesCompat.java
+++ b/core/core/src/main/java/androidx/core/content/res/ResourcesCompat.java
@@ -207,7 +207,11 @@
return csl;
}
// If we reach here then we couldn't inflate it, so let the framework handle it
- return res.getColorStateList(id);
+ if (SDK_INT >= 23) {
+ return Api23Impl.getColorStateList(res, id, theme);
+ } else {
+ return res.getColorStateList(id);
+ }
}
/**
@@ -626,6 +630,19 @@
}
}
+ @RequiresApi(23)
+ static class Api23Impl {
+ private Api23Impl() {
+ // This class is not instantiable.
+ }
+
+ @NonNull
+ static ColorStateList getColorStateList(@NonNull Resources res, @ColorRes int id,
+ @Nullable Theme theme) {
+ return res.getColorStateList(id, theme);
+ }
+ }
+
private ResourcesCompat() {}
/**
diff --git a/core/core/src/main/java/androidx/core/provider/DocumentsContractCompat.java b/core/core/src/main/java/androidx/core/provider/DocumentsContractCompat.java
new file mode 100644
index 0000000..2938434
--- /dev/null
+++ b/core/core/src/main/java/androidx/core/provider/DocumentsContractCompat.java
@@ -0,0 +1,343 @@
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * 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.
+ */
+
+package androidx.core.provider;
+
+import android.content.ContentResolver;
+import android.content.Context;
+import android.net.Uri;
+import android.os.Build;
+import android.provider.DocumentsContract;
+import android.provider.DocumentsContract.Document;
+import android.provider.DocumentsProvider;
+
+import androidx.annotation.DoNotInline;
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+import androidx.annotation.RequiresApi;
+
+import java.io.FileNotFoundException;
+import java.util.List;
+
+/**
+ * Helper for accessing features in {@link DocumentsContract}.
+ */
+@SuppressWarnings("unused")
+public final class DocumentsContractCompat {
+
+ /**
+ * Helper for accessing features in {@link DocumentsContract.Document}.
+ */
+ public static final class DocumentCompat {
+ /**
+ * Flag indicating that a document is virtual, and doesn't have byte
+ * representation in the MIME type specified as {@link Document#COLUMN_MIME_TYPE}.
+ *
+ * <p><em>Virtual documents must have at least one alternative streamable
+ * format via {@link DocumentsProvider#openTypedDocument}</em>
+ *
+ * @see Document#FLAG_VIRTUAL_DOCUMENT
+ */
+ public static final int FLAG_VIRTUAL_DOCUMENT = 1 << 9;
+
+ private DocumentCompat() {
+ }
+ }
+
+ private static final String PATH_TREE = "tree";
+
+ /**
+ * Checks if the given URI represents a {@link Document} backed by a
+ * {@link DocumentsProvider}.
+ *
+ * @see DocumentsContract#isDocumentUri(Context, Uri)
+ */
+ public static boolean isDocumentUri(@NonNull Context context, @Nullable Uri uri) {
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
+ return DocumentsContractApi19Impl.isDocumentUri(context, uri);
+ }
+ return false;
+ }
+
+ /**
+ * Checks if the given URI represents a {@link Document} tree.
+ *
+ * @see DocumentsContract#isTreeUri(Uri)
+ */
+ public static boolean isTreeUri(@NonNull Uri uri) {
+ if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
+ return false;
+ } else if (Build.VERSION.SDK_INT < Build.VERSION_CODES.N) {
+ // While "tree" Uris were added in 21, the check was only (publicly) added in 24
+ final List<String> paths = uri.getPathSegments();
+ return (paths.size() >= 2 && PATH_TREE.equals(paths.get(0)));
+ } else {
+ return DocumentsContractApi24Impl.isTreeUri(uri);
+ }
+ }
+
+ /**
+ * Extract the {@link Document#COLUMN_DOCUMENT_ID} from the given URI.
+ *
+ * @see DocumentsContract#getDocumentId(Uri)
+ */
+ @Nullable
+ public static String getDocumentId(@NonNull Uri documentUri) {
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
+ return DocumentsContractApi19Impl.getDocumentId(documentUri);
+ }
+ return null;
+ }
+
+ /**
+ * Extract the via {@link Document#COLUMN_DOCUMENT_ID} from the given URI.
+ *
+ * @see DocumentsContract#getTreeDocumentId(Uri)
+ */
+ @Nullable
+ public static String getTreeDocumentId(@NonNull Uri documentUri) {
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
+ return DocumentsContractApi21Impl.getTreeDocumentId(documentUri);
+ }
+ return null;
+ }
+
+ /**
+ * Build URI representing the target {@link Document#COLUMN_DOCUMENT_ID} in
+ * a document provider. When queried, a provider will return a single row
+ * with columns defined by {@link Document}.
+ *
+ * @see DocumentsContract#buildDocumentUri(String, String)
+ */
+ @Nullable
+ public static Uri buildDocumentUri(@NonNull String authority, @NonNull String documentId) {
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
+ return DocumentsContractApi19Impl.buildDocumentUri(authority, documentId);
+ }
+ return null;
+ }
+
+ /**
+ * Build URI representing the target {@link Document#COLUMN_DOCUMENT_ID} in
+ * a document provider. When queried, a provider will return a single row
+ * with columns defined by {@link Document}.
+ */
+ @Nullable
+ public static Uri buildDocumentUriUsingTree(@NonNull Uri treeUri, @NonNull String documentId) {
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
+ return DocumentsContractApi21Impl.buildDocumentUriUsingTree(treeUri, documentId);
+ }
+ return null;
+ }
+
+ /**
+ * Build URI representing access to descendant documents of the given
+ * {@link Document#COLUMN_DOCUMENT_ID}.
+ *
+ * @see DocumentsContract#buildTreeDocumentUri(String, String)
+ */
+ @Nullable
+ public static Uri buildTreeDocumentUri(@NonNull String authority, @NonNull String documentId) {
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
+ return DocumentsContractApi21Impl.buildTreeDocumentUri(authority, documentId);
+ }
+ return null;
+ }
+
+ /**
+ * Build URI representing the children of the target directory in a document
+ * provider. When queried, a provider will return zero or more rows with
+ * columns defined by {@link Document}.
+ *
+ * @see DocumentsContract#buildChildDocumentsUri(String, String)
+ */
+ @Nullable
+ public static Uri buildChildDocumentsUri(@NonNull String authority,
+ @Nullable String parentDocumentId) {
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
+ return DocumentsContractApi21Impl.buildChildDocumentsUri(authority, parentDocumentId);
+ }
+ return null;
+ }
+
+ /**
+ * Build URI representing the children of the target directory in a document
+ * provider. When queried, a provider will return zero or more rows with
+ * columns defined by {@link Document}.
+ *
+ * @see DocumentsContract#buildChildDocumentsUriUsingTree(Uri, String)
+ */
+ @Nullable
+ public static Uri buildChildDocumentsUriUsingTree(@NonNull Uri treeUri,
+ @NonNull String parentDocumentId) {
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
+ return DocumentsContractApi21Impl.buildChildDocumentsUriUsingTree(treeUri,
+ parentDocumentId);
+ }
+ return null;
+ }
+
+ /**
+ * Create a new document with given MIME type and display name.
+ *
+ * @param parentDocumentUri directory with {@link Document#FLAG_DIR_SUPPORTS_CREATE}
+ * @param mimeType MIME type of new document
+ * @param displayName name of new document
+ * @return newly created document, or {@code null} if failed
+ */
+ @Nullable
+ public static Uri createDocument(@NonNull ContentResolver content,
+ @NonNull Uri parentDocumentUri, @NonNull String mimeType, @NonNull String displayName)
+ throws FileNotFoundException {
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
+ return DocumentsContractApi21Impl.createDocument(content, parentDocumentUri, mimeType,
+ displayName);
+ }
+ return null;
+ }
+
+ /**
+ * Change the display name of an existing document.
+ *
+ * @see DocumentsContract#renameDocument(ContentResolver, Uri, String)
+ */
+ @Nullable
+ public static Uri renameDocument(@NonNull ContentResolver content,
+ @NonNull Uri documentUri, @NonNull String displayName) throws FileNotFoundException {
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
+ return DocumentsContractApi21Impl.renameDocument(content, documentUri, displayName);
+ }
+ return null;
+ }
+
+ /**
+ * Removes the given document from a parent directory.
+ *
+ * In contrast to {@link DocumentsContract#deleteDocument} it requires specifying the parent.
+ * This method is especially useful if the document can be in multiple parents.
+ *
+ * This method was only added in {@link Build.VERSION_CODES#N}. On versions prior to this,
+ * this method calls through to {@link DocumentsContract#deleteDocument(ContentResolver, Uri)}.
+ *
+ * @param documentUri document with {@link Document#FLAG_SUPPORTS_REMOVE}
+ * @param parentDocumentUri parent document of the document to remove.
+ * @return true if the document was removed successfully.
+ */
+ public static boolean removeDocument(@NonNull ContentResolver content, @NonNull Uri documentUri,
+ @NonNull Uri parentDocumentUri) throws FileNotFoundException {
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
+ return DocumentsContractApi24Impl.removeDocument(content, documentUri,
+ parentDocumentUri);
+ } else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
+ return DocumentsContractApi19Impl.deleteDocument(content, documentUri);
+ } else {
+ return false;
+ }
+ }
+
+ @RequiresApi(19)
+ private static class DocumentsContractApi19Impl {
+
+ @DoNotInline
+ public static Uri buildDocumentUri(String authority, String documentId) {
+ return DocumentsContract.buildDocumentUri(authority, documentId);
+ }
+
+ @DoNotInline
+ static boolean isDocumentUri(Context context, @Nullable Uri uri) {
+ return DocumentsContract.isDocumentUri(context, uri);
+ }
+
+ @DoNotInline
+ static String getDocumentId(Uri documentUri) {
+ return DocumentsContract.getDocumentId(documentUri);
+ }
+
+ @DoNotInline
+ static boolean deleteDocument(ContentResolver content, Uri documentUri)
+ throws FileNotFoundException {
+ return DocumentsContract.deleteDocument(content, documentUri);
+ }
+
+ private DocumentsContractApi19Impl() {
+ }
+ }
+
+ @RequiresApi(21)
+ private static class DocumentsContractApi21Impl {
+ @DoNotInline
+ static String getTreeDocumentId(Uri documentUri) {
+ return DocumentsContract.getTreeDocumentId(documentUri);
+ }
+
+ @DoNotInline
+ public static Uri buildTreeDocumentUri(String authority, String documentId) {
+ return DocumentsContract.buildTreeDocumentUri(authority, documentId);
+ }
+
+ @DoNotInline
+ static Uri buildDocumentUriUsingTree(Uri treeUri, String documentId) {
+ return DocumentsContract.buildDocumentUriUsingTree(treeUri, documentId);
+ }
+
+ @DoNotInline
+ static Uri buildChildDocumentsUri(String authority, String parentDocumentId) {
+ return DocumentsContract.buildChildDocumentsUri(authority, parentDocumentId);
+ }
+
+ @DoNotInline
+ static Uri buildChildDocumentsUriUsingTree(Uri treeUri, String parentDocumentId) {
+ return DocumentsContract.buildChildDocumentsUriUsingTree(treeUri, parentDocumentId);
+ }
+
+ @DoNotInline
+ static Uri createDocument(ContentResolver content, Uri parentDocumentUri,
+ String mimeType, String displayName) throws FileNotFoundException {
+ return DocumentsContract.createDocument(content, parentDocumentUri, mimeType,
+ displayName);
+ }
+
+ @DoNotInline
+ static Uri renameDocument(@NonNull ContentResolver content,
+ @NonNull Uri documentUri, @NonNull String displayName)
+ throws FileNotFoundException {
+ return DocumentsContract.renameDocument(content, documentUri, displayName);
+ }
+
+ private DocumentsContractApi21Impl() {
+ }
+ }
+
+ @RequiresApi(24)
+ private static class DocumentsContractApi24Impl {
+ @DoNotInline
+ static boolean isTreeUri(@NonNull Uri uri) {
+ return DocumentsContract.isTreeUri(uri);
+ }
+
+ @DoNotInline
+ static boolean removeDocument(ContentResolver content, Uri documentUri,
+ Uri parentDocumentUri) throws FileNotFoundException {
+ return DocumentsContract.removeDocument(content, documentUri, parentDocumentUri);
+ }
+
+ private DocumentsContractApi24Impl() {
+ }
+ }
+
+ private DocumentsContractCompat() {
+ }
+}
diff --git a/core/core/src/main/java/androidx/core/provider/FontRequestWorker.java b/core/core/src/main/java/androidx/core/provider/FontRequestWorker.java
index e5d8b80..d7975b7 100644
--- a/core/core/src/main/java/androidx/core/provider/FontRequestWorker.java
+++ b/core/core/src/main/java/androidx/core/provider/FontRequestWorker.java
@@ -171,6 +171,9 @@
final Consumer<TypefaceResult> reply = new Consumer<TypefaceResult>() {
@Override
public void accept(TypefaceResult typefaceResult) {
+ if (typefaceResult == null) {
+ typefaceResult = new TypefaceResult(FAIL_REASON_FONT_LOAD_ERROR);
+ }
callback.onTypefaceResult(typefaceResult);
}
};
@@ -191,8 +194,11 @@
final Callable<TypefaceResult> fetcher = new Callable<TypefaceResult>() {
@Override
public TypefaceResult call() {
- TypefaceResult typeface = getFontSync(id, context, request, style);
- return typeface;
+ try {
+ return getFontSync(id, context, request, style);
+ } catch (Throwable t) {
+ return new TypefaceResult(FAIL_REASON_FONT_LOAD_ERROR);
+ }
}
};
Executor finalExecutor = executor == null ? DEFAULT_EXECUTOR_SERVICE : executor;
diff --git a/core/core/src/main/java/androidx/core/view/MenuHost.java b/core/core/src/main/java/androidx/core/view/MenuHost.java
new file mode 100644
index 0000000..731b945
--- /dev/null
+++ b/core/core/src/main/java/androidx/core/view/MenuHost.java
@@ -0,0 +1,82 @@
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * 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.
+ */
+package androidx.core.view;
+
+import android.annotation.SuppressLint;
+
+import androidx.annotation.NonNull;
+import androidx.lifecycle.Lifecycle;
+import androidx.lifecycle.LifecycleOwner;
+
+/**
+ * A class that allows you to host and
+ * keep track of {@link MenuProvider}s that will supply
+ * {@link android.view.MenuItem}s to the app bar.
+ */
+public interface MenuHost {
+
+ /**
+ * Adds the given {@link MenuProvider} to this {@link MenuHost}.
+ *
+ * If using this method, you must manually remove the provider when necessary.
+ *
+ * @param provider the MenuProvider to be added
+ * @see #removeMenuProvider(MenuProvider)
+ */
+ void addMenuProvider(@NonNull MenuProvider provider);
+
+ /**
+ * Adds the given {@link MenuProvider} to this {@link MenuHost}.
+ *
+ * This {@link MenuProvider} will be removed once the given {@link LifecycleOwner}
+ * receives an {@link Lifecycle.Event.ON_DESTROY} event.
+ *
+ * @param provider the MenuProvider to be added
+ * @param owner the Lifecycle owner that will determine the removal of the provider
+ */
+ void addMenuProvider(@NonNull MenuProvider provider, @NonNull LifecycleOwner owner);
+
+ /**
+ * Adds the given {@link MenuProvider} to this {@link MenuHost} once the given
+ * {@link LifecycleOwner} reaches the given {@link Lifecycle.State}.
+ *
+ * This {@link MenuProvider} will be removed once the given {@link LifecycleOwner}
+ * goes down from the given {@link Lifecycle.State}.
+ *
+ * @param provider the MenuProvider to be added
+ * @param state the Lifecycle.State to check for automated addition/removal
+ * @param owner the calling component's LifecycleOwner
+ */
+ @SuppressLint("LambdaLast")
+ void addMenuProvider(@NonNull MenuProvider provider, @NonNull LifecycleOwner owner,
+ @NonNull Lifecycle.State state);
+
+ /**
+ * Removes the given {@link MenuProvider} from this {@link MenuHost}.
+ *
+ * @param provider the MenuProvider to be removed
+ */
+ void removeMenuProvider(@NonNull MenuProvider provider);
+
+ /**
+ * Invalidates the {@link android.view.Menu} to ensure that what is
+ * displayed matches the current internal state of the menu.
+ *
+ * This should be called whenever the state of the menu is changed,
+ * such as items being removed or disabled based on some user event.
+ */
+ void invalidateMenu();
+}
diff --git a/core/core/src/main/java/androidx/core/view/MenuProvider.java b/core/core/src/main/java/androidx/core/view/MenuProvider.java
new file mode 100644
index 0000000..3019711
--- /dev/null
+++ b/core/core/src/main/java/androidx/core/view/MenuProvider.java
@@ -0,0 +1,48 @@
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * 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.
+ */
+
+package androidx.core.view;
+
+import android.view.Menu;
+import android.view.MenuInflater;
+import android.view.MenuItem;
+
+import androidx.annotation.NonNull;
+
+/**
+ * Interface for indicating that a component will be supplying
+ * {@link MenuItem}s to the component owning the app bar.
+ */
+public interface MenuProvider {
+
+ /**
+ * Called by the {@link MenuHost} to allow the {@link MenuProvider}
+ * to inflate {@link MenuItem}s into the menu.
+ *
+ * @param menu the menu to inflate the new menu items into
+ * @param menuInflater the inflater to be used to inflate the updated menu
+ */
+ void onCreateMenu(@NonNull Menu menu, @NonNull MenuInflater menuInflater);
+
+ /**
+ * Called by the {@link MenuHost} when a {@link MenuItem} is selected from the menu.
+ *
+ * @param menuItem the menu item that was selected
+ * @return <code>true</code> if the given menu item is handled by this menu provider,
+ * <code>false</code> otherwise
+ */
+ boolean onMenuItemSelected(@NonNull MenuItem menuItem);
+}
diff --git a/datastore/buildSrc b/datastore/buildSrc
new file mode 120000
index 0000000..053a423
--- /dev/null
+++ b/datastore/buildSrc
@@ -0,0 +1 @@
+../buildSrc
\ No newline at end of file
diff --git a/datastore/datastore-core/src/main/java/androidx/datastore/core/DataMigration.kt b/datastore/datastore-core/src/main/java/androidx/datastore/core/DataMigration.kt
index 4318b91..711821b 100644
--- a/datastore/datastore-core/src/main/java/androidx/datastore/core/DataMigration.kt
+++ b/datastore/datastore-core/src/main/java/androidx/datastore/core/DataMigration.kt
@@ -38,8 +38,8 @@
* Note that accessing any data from DataStore directly from inside this function will result
* in deadlock, since DataStore doesn't return data until all migrations complete.
*
- * @param currentData the current data (which might already populated from previous runs of this
- * or other migrations)
+ * @param currentData the current data (which might already be populated from previous runs of
+ * this or other migrations)
*/
public suspend fun shouldMigrate(currentData: T): Boolean
diff --git a/datastore/datastore-rxjava2/src/main/java/androidx/datastore/rxjava2/RxDataMigration.java b/datastore/datastore-rxjava2/src/main/java/androidx/datastore/rxjava2/RxDataMigration.java
index 79df6a1..472625e 100644
--- a/datastore/datastore-rxjava2/src/main/java/androidx/datastore/rxjava2/RxDataMigration.java
+++ b/datastore/datastore-rxjava2/src/main/java/androidx/datastore/rxjava2/RxDataMigration.java
@@ -43,9 +43,9 @@
*
* Note that this will always be called before each call to [migrate].
*
- * @param currentData the current data (which might already populated from previous runs of this
- * or other migrations). Only Nullable if the type used with DataStore is
- * Nullable.
+ * @param currentData the current data (which might already be populated from previous runs of
+ * this or other migrations). Only Nullable if the type used with DataStore
+ * is Nullable.
*/
@NonNull
Single<Boolean> shouldMigrate(@Nullable T currentData);
diff --git a/datastore/datastore-rxjava3/src/main/java/androidx/datastore/rxjava3/RxDataMigration.java b/datastore/datastore-rxjava3/src/main/java/androidx/datastore/rxjava3/RxDataMigration.java
index ade2acc..2ae2079 100644
--- a/datastore/datastore-rxjava3/src/main/java/androidx/datastore/rxjava3/RxDataMigration.java
+++ b/datastore/datastore-rxjava3/src/main/java/androidx/datastore/rxjava3/RxDataMigration.java
@@ -43,9 +43,9 @@
*
* Note that this will always be called before each call to [migrate].
*
- * @param currentData the current data (which might already populated from previous runs of this
- * or other migrations). Only Nullable if the type used with DataStore is
- * Nullable.
+ * @param currentData the current data (which might already be populated from previous runs of
+ * this or other migrations). Only Nullable if the type used with DataStore
+ * is Nullable.
*/
@NonNull
Single<Boolean> shouldMigrate(@Nullable T currentData);
diff --git a/development/build_log_simplifier/messages.ignore b/development/build_log_simplifier/messages.ignore
index f2684a0..914e784 100644
--- a/development/build_log_simplifier/messages.ignore
+++ b/development/build_log_simplifier/messages.ignore
@@ -124,7 +124,6 @@
DIST_DIR=\$DIST_DIR
CHECKOUT=\$CHECKOUT
GRADLE_USER_HOME=\$GRADLE_USER_HOME
-To honour the JVM settings for this build a single\-use Daemon process will be forked\. See https://docs\.gradle\.org/[0-9]+\.[0-9]+/userguide/gradle_daemon\.html\#sec:disabling_the_daemon\.
Downloading file\:\$SUPPORT\/gradle\/wrapper\/.*
\.\.\.\.\.\.\.\.\.\.10%\.\.\.\.\.\.\.\.\.\.\.20%\.\.\.\.\.\.\.\.\.\.\.30%\.\.\.\.\.\.\.\.\.\.\.40%\.\.\.\.\.\.\.\.\.\.\.50%\.\.\.\.\.\.\.\.\.\.\.60%\.\.\.\.\.\.\.\.\.\.\.70%\.\.\.\.\.\.\.\.\.\.\.80%\.\.\.\.\.\.\.\.\.\.\.90%\.\.\.\.\.\.\.\.\.\.\.100%
Welcome to Gradle .*
@@ -160,7 +159,7 @@
# > Task :listTaskOutputs
Wrote \$DIST_DIR/task_outputs\.txt
Deprecated Gradle features were used in this build, making it incompatible with Gradle [0-9]+\.[0-9]+\.
-See https://docs\.gradle\.org/[0-9]+\.[0-9]+/userguide/command_line_interface\.html\#sec:command_line_warnings
+See https://docs.gradle.org/.*/userguide/command_line_interface\.html#sec:command_line_warnings
Execution optimizations have been disabled for [0-9]+ invalid unit\(s\) of work during this build to ensure correctness\.
Please consult deprecation warnings for more details\.
BUILD SUCCESSFUL in .*
@@ -540,7 +539,7 @@
# https://youtrack.jetbrains.com/issue/KT-30589
WARNING: Illegal reflective access by org\.jetbrains\.kotlin\.kapt3\.base\.javac\.KaptJavaFileManager .* to method com\.sun\.tools\.javac\.file\.BaseFileManager\.handleOption\(com\.sun\.tools\.javac\.main\.Option,java\.lang\.String\)
# > Task :benchmark:benchmark-macro:compileReleaseKotlin
-Execution optimizations have been disabled for task ':benchmark:benchmark\-macro:.*' to ensure correctness due to the following reasons:
+Execution optimizations have been disabled for task ':benchmark:benchmark\-common:.*' to ensure correctness due to the following reasons:
\- Gradle detected a problem with the following location: '\$OUT_DIR/androidx/benchmark/benchmark\-macro/build/generated/source/wire'\. Reason: Task ':benchmark:benchmark\-macro:.*' uses this output of task ':benchmark:benchmark\-macro:.*' without declaring an explicit or implicit dependency\. This can lead to incorrect results being produced, depending on what order the tasks are executed\. Please refer to https://docs\.gradle\.org/[0-9]+\.[0-9]+/userguide/validation_problems\.html\#implicit_dependency for more details about this problem\.
# > Task :profileinstaller:profileinstaller:processDebugUnitTestManifest
Scanning .+: \.*
@@ -589,7 +588,6 @@
The current default is \'false\'\.
# ./gradlew tasks warns as we have warnings present
You can use \'\-\-warning\-mode all\' to show the individual deprecation warnings and determine if they come from your own scripts or plugins\.
-See https://docs.gradle.org/.*/userguide/command_line_interface\.html#sec:command_line_warnings
# > Task :emoji2:emoji2-bundled:processDebugAndroidTestManifest
\$SUPPORT/emoji[0-9]+/emoji[0-9]+\-bundled/src/androidTest/AndroidManifest\.xml:[0-9]+:[0-9]+\-[0-9]+:[0-9]+ Warning:
meta\-data\#androidx\.emoji[0-9]+\.text\.EmojiCompatInitializer was tagged at AndroidManifest\.xml:[0-9]+ to remove other declarations but no other declaration present
@@ -599,9 +597,9 @@
WARNING:The option setting 'android\.disableAutomaticComponentCreation=true' is experimental\.
# > Task :navigation:navigation-benchmark:processReleaseAndroidTestManifest
\$SUPPORT/navigation/navigation\-benchmark/src/androidTest/AndroidManifest\.xml:[0-9]+:[0-9]+\-[0-9]+:[0-9]+ Warning:
-# > Configure project :buildSrc-tests
-WARNING\:The option setting \'android\.dependencyResolutionAtConfigurationTime\.disallow\=true\' is experimental\.
# b/195025261
Unable to detect AGP versions for included builds\. All projects in the build should use the same AGP version\. Class name for the included build .*
-\- Gradle detected a problem with the following location: '\$OUT_DIR/androidx/benchmark/benchmark-macro/build/generated/source/wire'\. Reason: Task ':benchmark:benchmark-macro:.*' uses this output of task ':benchmark:benchmark-macro:generate(Debug|Release)Protos' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed. Please refer to .*
+\- Gradle detected a problem with the following location: '\$OUT_DIR/androidx/benchmark/benchmark-common/build/generated/source/wire'\. Reason: Task ':benchmark:benchmark-common:.*' uses this output of task ':benchmark:benchmark-common:generate(Debug|Release)Protos' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed. Please refer to .*
To honour the JVM settings for this build a single\-use Daemon process will be forked.*
+# > Task :work:work-benchmark:processReleaseAndroidTestManifest
+\$SUPPORT/work/work\-benchmark/src/androidTest/AndroidManifest\.xml:[0-9]+:[0-9]+\-[0-9]+:[0-9]+ Warning:
\ No newline at end of file
diff --git a/development/project-creator/README.md b/development/project-creator/README.md
index c933139..34b1750 100644
--- a/development/project-creator/README.md
+++ b/development/project-creator/README.md
@@ -21,7 +21,7 @@
### Project/Module Types
-The script leverages buildSrc/src/main/kotlin/androidx/build/LibraryType.kt
+The script leverages buildSrc/public/src/main/kotlin/androidx/build/LibraryType.kt
to create the recommended defaults for your project. However, you can override
the options to best fit your requirements.
diff --git a/development/project-creator/compose-template/groupId/artifactId/src/main/groupId/artifactId-documentation.md b/development/project-creator/compose-template/groupId/artifactId/src/main/groupId/artifactId-documentation.md
new file mode 100644
index 0000000..a37b120
--- /dev/null
+++ b/development/project-creator/compose-template/groupId/artifactId/src/main/groupId/artifactId-documentation.md
@@ -0,0 +1,7 @@
+# Module root
+
+<GROUPID> <ARTIFACTID>
+
+# Package <PACKAGE>
+
+Insert package level documentation here
diff --git a/development/project-creator/create_project.py b/development/project-creator/create_project.py
index 11f4ddc..e3e5568 100755
--- a/development/project-creator/create_project.py
+++ b/development/project-creator/create_project.py
@@ -33,9 +33,9 @@
SAMPLE_KOTLIN_SRC_FP = os.path.abspath(os.path.join(os.getcwd(), 'kotlin-template', 'groupId', 'artifactId'))
SAMPLE_COMPOSE_SRC_FP = os.path.abspath(os.path.join(os.getcwd(), 'compose-template', 'groupId', 'artifactId'))
SETTINGS_GRADLE_FP = os.path.abspath(os.path.join(os.getcwd(), '..', '..', "settings.gradle"))
-LIBRARY_VERSIONS_REL = './buildSrc/src/main/kotlin/androidx/build/LibraryVersions.kt'
+LIBRARY_VERSIONS_REL = './buildSrc/public/src/main/kotlin/androidx/build/LibraryVersions.kt'
LIBRARY_VERSIONS_FP = os.path.join(FRAMEWORKS_SUPPORT_FP, LIBRARY_VERSIONS_REL)
-LIBRARY_GROUPS_REL = './buildSrc/src/main/kotlin/androidx/build/LibraryGroups.kt'
+LIBRARY_GROUPS_REL = './buildSrc/public/src/main/kotlin/androidx/build/LibraryGroups.kt'
LIBRARY_GROUPS_FP = os.path.join(FRAMEWORKS_SUPPORT_FP, LIBRARY_GROUPS_REL)
DOCS_TOT_BUILD_GRADLE_REL = './docs-tip-of-tree/build.gradle'
DOCS_TOT_BUILD_GRADLE_FP = os.path.join(FRAMEWORKS_SUPPORT_FP, DOCS_TOT_BUILD_GRADLE_REL)
@@ -103,6 +103,30 @@
return None
return dst_path_dir
+def rename_file(src_file, new_file_name):
+ """Renames a file from src_file to new_file_name, within the same directory.
+
+ Args:
+ src_file: the source file, which must exist
+ new_file_name: the new file name
+ """
+ if not os.path.exists(src_file):
+ print_e('mv file error: Source file %s does not exist.' % src_file)
+ return None
+ # Check that destination directory already exists
+ parent_src_file_dir = os.path.dirname(src_file)
+ new_file_path = os.path.join(parent_src_file_dir, new_file_name)
+ if os.path.exists(new_file_path):
+ print_e('mv file error: Source file %s already exists.' % new_file_path)
+ return None
+ try:
+ os.rename(src_file, new_file_path)
+ except OSError as error:
+ print_e('FAIL: Unable to rename %s to destination %s' % (src_file, new_file_path))
+ print_e(error)
+ return None
+ return new_file_path
+
def generate_package_name(group_id, artifact_id):
final_group_id_word = group_id.split(".")[-1]
artifact_id_suffix = artifact_id.replace(final_group_id_word, "")
@@ -229,12 +253,15 @@
group_id_path = get_group_id_path(group_id)
return group_id_path + "/" + artifact_id
-def get_package_info_file_dir(group_id, artifact_id):
- """Generates the full package_info.java filepath
+def get_package_documentation_file_dir(group_id, artifact_id):
+ """Generates the full package documentation directory
Given androidx.foo.bar:bar-qux, the structure will be:
frameworks/support/foo/bar/bar-qux/src/main/androidx/foo/package-info.java
+ or for Kotlin:
+ frameworks/support/foo/bar/bar-qux/src/main/androidx/foo/<group>-<artifact>-documentation.md
+
Args:
group_id: group_id of the new library
artifact_id: group_id of the new library
@@ -244,13 +271,49 @@
group_id.replace(".", "/")
return full_artifact_path + group_id_subpath
-def create_directories(group_id, artifact_id):
+def get_package_documentation_filename(group_id, artifact_id, is_kotlin_project):
+ """Generates the documentation filename
+
+ Given androidx.foo.bar:bar-qux, the structure will be:
+ package-info.java
+
+ or for Kotlin:
+ <group>-<artifact>-documentation.md
+
+ Args:
+ group_id: group_id of the new library
+ artifact_id: group_id of the new library
+ is_kotlin_project: whether or not the library is a kotin project
+ """
+ if is_kotlin_project:
+ formatted_group_id = group_id.replace(".", "-")
+ return "%s-%s-documentation.md" % (formatted_group_id, artifact_id)
+ else:
+ return "package-info.java"
+
+def ask_if_kotlin_project(group_id, artifact_id):
+ """Asks the user if the project is a kotlin or java project
+ """
+ if "compose" in group_id or "compose" in artifact_id:
+ return True
+ elif ask_yes_or_no("Is this a kotlin project?"):
+ return True
+ else:
+ # Confirm that the user is intentionally using java.
+ ask_yes_or_no("All new androidx projects are expected and encouraged "
+ "to use Kotlin. Java projects should only be used if "
+ "there is a business need to do so. "
+ "Please ack to proceed:")
+ return False
+
+def create_directories(group_id, artifact_id, is_kotlin_project):
"""Creates the standard directories for the given group_id and artifact_id.
Given androidx.foo.bar:bar-qux, the structure will be:
frameworks/support/foo/bar/bar-qux/build.gradle
frameworks/support/foo/bar/bar-qux/src/main/AndroidManifest.xml
frameworks/support/foo/bar/bar-qux/src/main/androidx/foo/bar/package-info.java
+ frameworks/support/foo/bar/bar-qux/src/main/androidx/foo/bar/artifact-documentation.md
frameworks/support/foo/bar/bar-qux/src/androidTest/AndroidManifest.xml
frameworks/support/foo/bar/bar-qux/api/current.txt
@@ -271,14 +334,9 @@
if "compose" in group_id or "compose" in artifact_id:
print("Auto-detected Compose project.")
cp(SAMPLE_COMPOSE_SRC_FP, full_artifact_path)
- elif ask_yes_or_no("Is this a kotlin project?"):
+ elif is_kotlin_project:
cp(SAMPLE_KOTLIN_SRC_FP, full_artifact_path)
else:
- # Confirm that the user is intentionally using java.
- ask_yes_or_no("All new androidx projects are expected and encouraged "
- "to use Kotlin. Java projects should only be used if "
- "there is a business need to do so. "
- "Please ack to proceed:")
cp(SAMPLE_JAVA_SRC_FP, full_artifact_path)
# Java only libraries have no dependency on android.
@@ -304,10 +362,15 @@
else:
project_description = ask_project_description()
- # Rename the package-info directory
- full_package_info_dir = get_package_info_file_dir(group_id, artifact_id)
- full_package_info_path = full_package_info_dir + "/package-info.java"
- mv_dir(full_artifact_path + "/src/main/groupId", full_package_info_dir)
+ # Set up the package documentation.
+ full_package_docs_dir = get_package_documentation_file_dir(group_id, artifact_id)
+ package_docs_filename = get_package_documentation_filename(group_id, artifact_id, is_kotlin_project)
+ full_package_docs_file = os.path.join(full_package_docs_dir, package_docs_filename)
+ # Kotlin projects use -documentation.md files, so we need to rename it appropriately.
+ if is_kotlin_project:
+ rename_file(full_artifact_path + "/src/main/groupId/artifactId-documentation.md",
+ package_docs_filename)
+ mv_dir(full_artifact_path + "/src/main/groupId", full_package_docs_dir)
# Populate the library type
library_type = get_library_type(artifact_id)
@@ -318,12 +381,12 @@
sed("<YEAR>", year, full_artifact_path + "/build.gradle")
sed("<YEAR>", year, full_artifact_path + "/src/androidTest/AndroidManifest.xml")
sed("<YEAR>", year, full_artifact_path + "/src/main/AndroidManifest.xml")
- sed("<YEAR>", year, full_package_info_path)
+ sed("<YEAR>", year, full_package_docs_file)
# Populate the PACKAGE
package = generate_package_name(group_id, artifact_id)
sed("<PACKAGE>", package, full_artifact_path + "/src/androidTest/AndroidManifest.xml")
sed("<PACKAGE>", package, full_artifact_path + "/src/main/AndroidManifest.xml")
- sed("<PACKAGE>", package, full_package_info_path)
+ sed("<PACKAGE>", package, full_package_docs_file)
# Populate the VERSION macro
group_id_version_macro = get_group_id_version_macro(group_id)
sed("<GROUPID>", group_id_version_macro, full_artifact_path + "/build.gradle")
@@ -331,6 +394,7 @@
sed("<NAME>", group_id + ":" + artifact_id, full_artifact_path + "/build.gradle")
sed("<DESCRIPTION>", project_description, full_artifact_path + "/build.gradle")
+
def get_new_settings_gradle_line(group_id, artifact_id):
"""Generates the line needed for frameworks/support/settings.gradle.
@@ -576,7 +640,7 @@
# The group id does not exist yet, so just default to false.
return False
-def print_todo_list(group_id, artifact_id):
+def print_todo_list(group_id, artifact_id, is_kotlin_project):
"""Prints to the todo list once the script has finished.
There are some pieces that can not be automated or require human eyes.
@@ -590,8 +654,9 @@
build_gradle_path = get_full_artifact_path(group_id, artifact_id) + \
"/build.gradle"
owners_file_path = get_group_id_path(group_id) + "/OWNERS"
- package_info_path = get_package_info_file_dir(group_id, artifact_id) + \
- "/package-info.java"
+ package_docs_path = os.path.join(
+ get_package_documentation_file_dir(group_id, artifact_id),
+ get_package_documentation_filename(group_id, artifact_id, is_kotlin_project))
print("---\n")
print("Created the project. The following TODOs need to be completed by "
"you:\n")
@@ -605,8 +670,8 @@
"\n\t\t" + build_gradle_path)
print("\t4. Fill out the project/module name in the build.gradle:"
"\n\t\t" + build_gradle_path)
- print("\t5. Update the project/module package-info.java file:"
- "\n\t\t" + package_info_path)
+ print("\t5. Update the project/module package documentation:"
+ "\n\t\t" + package_docs_path)
def main(args):
# Parse arguments and check for existence of build ID or file
@@ -617,20 +682,19 @@
if not validate_name(args.group_id, args.artifact_id):
sys.exit(1)
- create_directories(args.group_id, args.artifact_id)
+ is_kotlin_project = ask_if_kotlin_project(args.group_id, args.artifact_id)
+ create_directories(args.group_id, args.artifact_id, is_kotlin_project)
update_settings_gradle(args.group_id, args.artifact_id)
insert_new_group_id_into_library_versions_kt(args.group_id,
args.artifact_id)
update_docs_tip_of_tree_build_grade(args.group_id, args.artifact_id)
print("Created directories. \nRunning updateApi for the new "
"library, this may take a minute...", end='')
- print_todo_list(args.group_id, args.artifact_id)
- return
if run_update_api(args.group_id, args.artifact_id):
print("done.")
else:
print("failed. Please investigate manually.")
- print_todo_list(args.group_id, args.artifact_id)
+ print_todo_list(args.group_id, args.artifact_id, is_kotlin_project)
if __name__ == '__main__':
main(sys.argv)
diff --git a/development/project-creator/kotlin-template/groupId/artifactId/src/main/groupId/artifactId-documentation.md b/development/project-creator/kotlin-template/groupId/artifactId/src/main/groupId/artifactId-documentation.md
new file mode 100644
index 0000000..a37b120
--- /dev/null
+++ b/development/project-creator/kotlin-template/groupId/artifactId/src/main/groupId/artifactId-documentation.md
@@ -0,0 +1,7 @@
+# Module root
+
+<GROUPID> <ARTIFACTID>
+
+# Package <PACKAGE>
+
+Insert package level documentation here
diff --git a/development/project-creator/kotlin-template/groupId/artifactId/src/main/groupId/package-info.java b/development/project-creator/kotlin-template/groupId/artifactId/src/main/groupId/package-info.java
deleted file mode 100644
index a51e68c..0000000
--- a/development/project-creator/kotlin-template/groupId/artifactId/src/main/groupId/package-info.java
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) <YEAR> The Android Open Source Project
- *
- * 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.
- */
-
-/**
- * Insert package level documentation here
- */
-package <PACKAGE>;
diff --git a/development/project-creator/test_project_creator.py b/development/project-creator/test_project_creator.py
index 9c7ef1d..7123b18 100755
--- a/development/project-creator/test_project_creator.py
+++ b/development/project-creator/test_project_creator.py
@@ -58,20 +58,47 @@
full_fp = get_full_artifact_path("androidx.foo.bar", "bar-qux")
self.assertTrue(full_fp.endswith("frameworks/support/foo/bar/bar-qux"))
- def test_get_package_info_file_dir(self):
- package_info_dir_fp = get_package_info_file_dir("androidx.foo", "foo")
+ def test_get_package_documentation_file_dir(self):
+ package_info_dir_fp = get_package_documentation_file_dir("androidx.foo", "foo")
frameworks_support_fp = os.path.abspath(os.path.join(os.getcwd(), '..', '..'))
self.assertEqual(frameworks_support_fp + "/foo/foo/src/main/androidx/foo", package_info_dir_fp)
- package_info_dir_fp = get_package_info_file_dir("androidx.foo", "foo-bar")
+ package_info_dir_fp = get_package_documentation_file_dir("androidx.foo", "foo-bar")
self.assertEqual(frameworks_support_fp + "/foo/foo-bar/src/main/androidx/foo", package_info_dir_fp)
- package_info_dir_fp = get_package_info_file_dir("androidx.foo.bar", "bar")
+ package_info_dir_fp = get_package_documentation_file_dir("androidx.foo.bar", "bar")
self.assertEqual(frameworks_support_fp + "/foo/bar/bar/src/main/androidx/foo/bar", package_info_dir_fp)
- package_info_dir_fp = get_package_info_file_dir("androidx.foo.bar", "bar-qux")
+ package_info_dir_fp = get_package_documentation_file_dir("androidx.foo.bar", "bar-qux")
self.assertEqual(frameworks_support_fp + "/foo/bar/bar-qux/src/main/androidx/foo/bar", package_info_dir_fp)
+ def test_get_package_documentation_filename(self):
+ frameworks_support_fp = os.path.abspath(os.path.join(os.getcwd(), '..', '..'))
+
+ package_info_dir_filename = get_package_documentation_filename("androidx.foo", "foo", True)
+ self.assertEqual("androidx-foo-foo-documentation.md", package_info_dir_filename)
+
+ package_info_dir_filename = get_package_documentation_filename("androidx.foo", "foo-bar", True)
+ self.assertEqual("androidx-foo-foo-bar-documentation.md", package_info_dir_filename)
+
+ package_info_dir_filename = get_package_documentation_filename("androidx.foo.bar", "bar", True)
+ self.assertEqual("androidx-foo-bar-bar-documentation.md", package_info_dir_filename)
+
+ package_info_dir_filename = get_package_documentation_filename("androidx.foo.bar", "bar-qux", True)
+ self.assertEqual("androidx-foo-bar-bar-qux-documentation.md", package_info_dir_filename)
+
+ package_info_dir_filename = get_package_documentation_filename("androidx.foo", "foo", False)
+ self.assertEqual("package-info.java", package_info_dir_filename)
+
+ package_info_dir_filename = get_package_documentation_filename("androidx.foo", "foo-bar", False)
+ self.assertEqual("package-info.java", package_info_dir_filename)
+
+ package_info_dir_filename = get_package_documentation_filename("androidx.foo.bar", "bar", False)
+ self.assertEqual("package-info.java", package_info_dir_filename)
+
+ package_info_dir_filename = get_package_documentation_filename("androidx.foo.bar", "bar-qux", False)
+ self.assertEqual("package-info.java", package_info_dir_filename)
+
def test_group_id_directory_name(self):
full_fp = get_group_id_path("androidx.foo")
self.assertTrue(full_fp.endswith("frameworks/support/foo"))
@@ -249,6 +276,20 @@
rm(src_out_dir)
rm(dst_out_dir_parent)
+ def test_rename_file_within_same_dir(self):
+ test_src_file = "./temp.txt"
+ test_file_contents = "a\nb\nc"
+ with open(test_src_file,"w") as f:
+ f.write("a\nb\nc")
+
+ test_dst_file = "./temp_out.txt"
+ rename_file(test_src_file, test_dst_file)
+ # read back the file
+ with open(test_dst_file) as f:
+ file_contents = f.read()
+ self.assertEqual("a\nb\nc", file_contents)
+ rm(test_dst_file)
+
def test_remove_line(self):
out_dir = "./out"
test_file = out_dir + "/temp.txt"
diff --git a/development/referenceDocs/stageReferenceDocs.sh b/development/referenceDocs/stageReferenceDocs.sh
index 2091cd5..c80b41e 100755
--- a/development/referenceDocs/stageReferenceDocs.sh
+++ b/development/referenceDocs/stageReferenceDocs.sh
@@ -70,6 +70,7 @@
cd reference
python3 ./../../../switcher.py --work androidx
+python3 ./../../../switcher.py --work support
printf "============================ STEP 5 =============================== \n"
printf "== Run the following command to copy the docs into Google3 \n"
diff --git a/development/referenceDocs/stageReferenceDocsWithDackka.sh b/development/referenceDocs/stageReferenceDocsWithDackka.sh
index ee55786..24447c6 100755
--- a/development/referenceDocs/stageReferenceDocsWithDackka.sh
+++ b/development/referenceDocs/stageReferenceDocsWithDackka.sh
@@ -5,9 +5,10 @@
source gbash.sh || exit
readonly defaultDb=""
-DEFINE_string buildId --required "" "The build ID from the Android build server"
+DEFINE_string buildId --required "" "The build ID from the Android build server. This is ignored when specifying the 'sourceDir' flag."
DEFINE_string dateStr "<insert date here>" "Date string used for CL message. Enclose date in double quotes (ex: \"April 29, 2021\")"
DEFINE_string db "$defaultDb" "The database used for staging. Omitting this value will stage changes to the staging DB."
+DEFINE_string sourceDir "" "Local directory to fetch doc artifacts from"
DEFINE_bool useToT false "Stage docs from tip-of-tree docs build rather than public docs build"
gbash::init_google "$@"
@@ -56,38 +57,49 @@
mkdir -p $outDir/$dackkaNewDir
cd $outDir
-printf "=================================================================== \n"
-printf "== Download the doc zip files from the build server \n"
-printf "=================================================================== \n"
+if [ "$FLAGS_sourceDir" == "" ]; then
+ printf "=================================================================== \n"
+ printf "== Download the doc zip files from the build server \n"
+ printf "=================================================================== \n"
-if (( FLAGS_useToT )); then
- printf "Downloading docs-tip-of-tree zip files \n"
- androidxJavaDocsZip="doclava-tip-of-tree-docs-${FLAGS_buildId}.zip"
- androidxKotlinDocsZip="dokka-tip-of-tree-docs-${FLAGS_buildId}.zip"
- androidxDackkaDocsZip="dackka-tip-of-tree-docs-${FLAGS_buildId}.zip"
+ if (( FLAGS_useToT )); then
+ printf "Downloading docs-tip-of-tree zip files \n"
+ androidxJavaDocsZip="doclava-tip-of-tree-docs-${FLAGS_buildId}.zip"
+ androidxKotlinDocsZip="dokka-tip-of-tree-docs-${FLAGS_buildId}.zip"
+ androidxDackkaDocsZip="dackka-tip-of-tree-docs-${FLAGS_buildId}.zip"
+ else
+ printf "Downloading docs-public zip files \n"
+ androidxJavaDocsZip="doclava-public-docs-${FLAGS_buildId}.zip"
+ androidxKotlinDocsZip="dokka-public-docs-${FLAGS_buildId}.zip"
+ androidxDackkaDocsZip="dackka-public-docs-${FLAGS_buildId}.zip"
+ fi
+
+ /google/data/ro/projects/android/fetch_artifact --bid $FLAGS_buildId --target androidx $androidxJavaDocsZip
+ /google/data/ro/projects/android/fetch_artifact --bid $FLAGS_buildId --target androidx $androidxKotlinDocsZip
+ /google/data/ro/projects/android/fetch_artifact --bid $FLAGS_buildId --target androidx $androidxDackkaDocsZip
+
+ printf "\n"
+ printf "=================================================================== \n"
+ printf "== Unzip the doc zip files \n"
+ printf "=================================================================== \n"
+
+ unzip $androidxJavaDocsZip -d $newDir
+ unzip $androidxKotlinDocsZip -d $newDir
+ unzip $androidxDackkaDocsZip -d $dackkaNewDir
else
- printf "Downloading docs-public zip files \n"
- androidxJavaDocsZip="doclava-public-docs-${FLAGS_buildId}.zip"
- androidxKotlinDocsZip="dokka-public-docs-${FLAGS_buildId}.zip"
- androidxDackkaDocsZip="dackka-public-docs-${FLAGS_buildId}.zip"
+ printf "=================================================================== \n"
+ printf "== Copying doc sources from local directory $FLAGS_sourceDir \n"
+ printf "=================================================================== \n"
+
+ cp -r "$FLAGS_sourceDir/javadoc/." $newDir
+ mkdir -p $newDir/reference/kotlin
+ cp -r "$FLAGS_sourceDir/dokkaKotlinDocs/." $newDir/reference/kotlin
+ cp -r "$FLAGS_sourceDir/dackkaDocs/." $dackkaNewDir
fi
-/google/data/ro/projects/android/fetch_artifact --bid $FLAGS_buildId --target androidx $androidxJavaDocsZip
-/google/data/ro/projects/android/fetch_artifact --bid $FLAGS_buildId --target androidx $androidxKotlinDocsZip
-/google/data/ro/projects/android/fetch_artifact --bid $FLAGS_buildId --target androidx $androidxDackkaDocsZip
-
printf "\n"
printf "=================================================================== \n"
-printf "== Unzip the doc zip files \n"
-printf "=================================================================== \n"
-
-unzip $androidxJavaDocsZip -d $newDir
-unzip $androidxKotlinDocsZip -d $newDir
-unzip $androidxDackkaDocsZip -d $dackkaNewDir
-
-printf "\n"
-printf "=================================================================== \n"
-printf "== Format the doc zip files \n"
+printf "== Format the doc files \n"
printf "=================================================================== \n"
cd $newDir
@@ -146,6 +158,7 @@
cd $newDir/reference
python3 ./../../../switcher.py --work androidx
+python3 ./../../../switcher.py --work support
printf "\n"
printf "=================================================================== \n"
diff --git a/development/update_studio.sh b/development/update_studio.sh
index e4d192c..978e9b2 100755
--- a/development/update_studio.sh
+++ b/development/update_studio.sh
@@ -1,7 +1,7 @@
#!/bin/bash
# Get versions
-AGP_VERSION=${1:-7.1.0-alpha07}
-STUDIO_VERSION_STRING=${2:-"Android Studio Bumblebee (2021.1.1) Canary 7"}
+AGP_VERSION=${1:-7.1.0-alpha08}
+STUDIO_VERSION_STRING=${2:-"Android Studio Bumblebee (2021.1.1) Canary 8"}
STUDIO_IFRAME_LINK=`curl "https://developer.android.com/studio/archive.html" | grep iframe | sed "s/.*src=\"\([a-zA-Z0-9\/\._]*\)\".*/https:\/\/android-dot-devsite-v2-prod.appspot.com\1/g"`
STUDIO_LINK=`curl -s $STUDIO_IFRAME_LINK | grep -C30 "$STUDIO_VERSION_STRING" | grep Linux | tail -n 1 | sed 's/.*a href="\(.*\).*"/\1/g'`
STUDIO_VERSION=`echo $STUDIO_LINK | sed "s/.*ide-zips\/\(.*\)\/android-studio-.*/\1/g"`
diff --git a/docs-public/build.gradle b/docs-public/build.gradle
index e8e67eb..ea64326 100644
--- a/docs-public/build.gradle
+++ b/docs-public/build.gradle
@@ -25,20 +25,20 @@
docs("androidx.arch.core:core-testing:2.1.0")
docs("androidx.asynclayoutinflater:asynclayoutinflater:1.0.0")
docs("androidx.autofill:autofill:1.2.0-beta01")
- docs("androidx.benchmark:benchmark-common:1.1.0-alpha05")
- docs("androidx.benchmark:benchmark-junit4:1.1.0-alpha05")
- docs("androidx.benchmark:benchmark-macro:1.1.0-alpha05")
- docs("androidx.benchmark:benchmark-macro-junit4:1.1.0-alpha05")
+ docs("androidx.benchmark:benchmark-common:1.1.0-alpha06")
+ docs("androidx.benchmark:benchmark-junit4:1.1.0-alpha06")
+ docs("androidx.benchmark:benchmark-macro:1.1.0-alpha06")
+ docs("androidx.benchmark:benchmark-macro-junit4:1.1.0-alpha06")
docs("androidx.biometric:biometric:1.2.0-alpha03")
docs("androidx.biometric:biometric-ktx:1.2.0-alpha03")
samples("androidx.biometric:biometric-ktx-samples:1.2.0-alpha03")
docs("androidx.browser:browser:1.3.0")
- docs("androidx.camera:camera-camera2:1.1.0-alpha07")
- docs("androidx.camera:camera-core:1.1.0-alpha07")
- docs("androidx.camera:camera-extensions:1.0.0-alpha27")
+ docs("androidx.camera:camera-camera2:1.1.0-alpha08")
+ docs("androidx.camera:camera-core:1.1.0-alpha08")
+ docs("androidx.camera:camera-extensions:1.0.0-alpha28")
stubs(fileTree(dir: "../camera/camera-extensions-stub", include: ["camera-extensions-stub.jar"]))
- docs("androidx.camera:camera-lifecycle:1.1.0-alpha07")
- docs("androidx.camera:camera-view:1.0.0-alpha27")
+ docs("androidx.camera:camera-lifecycle:1.1.0-alpha08")
+ docs("androidx.camera:camera-view:1.0.0-alpha28")
docs("androidx.car.app:app:1.1.0-alpha02")
docs("androidx.car.app:app-automotive:1.1.0-alpha02")
docs("androidx.car.app:app-projected:1.1.0-alpha02")
@@ -46,48 +46,48 @@
docs("androidx.cardview:cardview:1.0.0")
docs("androidx.collection:collection:1.2.0-alpha01")
docs("androidx.collection:collection-ktx:1.2.0-alpha01")
- docs("androidx.compose.animation:animation:1.1.0-alpha01")
- docs("androidx.compose.animation:animation-core:1.1.0-alpha01")
- docs("androidx.compose.animation:animation-graphics:1.1.0-alpha01")
- samples("androidx.compose.animation:animation-samples:1.1.0-alpha01")
- samples("androidx.compose.animation:animation-core-samples:1.1.0-alpha01")
- samples("androidx.compose.animation:animation-graphics-samples:1.1.0-alpha01")
- docs("androidx.compose.foundation:foundation:1.1.0-alpha01")
- docs("androidx.compose.foundation:foundation-layout:1.1.0-alpha01")
- samples("androidx.compose.foundation:foundation-layout-samples:1.1.0-alpha01")
- samples("androidx.compose.foundation:foundation-samples:1.1.0-alpha01")
- docs("androidx.compose.material:material:1.1.0-alpha01")
- docs("androidx.compose.material:material-icons-core:1.1.0-alpha01")
- samples("androidx.compose.material:material-icons-core-samples:1.1.0-alpha01")
- docs("androidx.compose.material:material-ripple:1.1.0-alpha01")
- samples("androidx.compose.material:material-samples:1.1.0-alpha01")
- docs("androidx.compose.runtime:runtime:1.1.0-alpha01")
- docs("androidx.compose.runtime:runtime-livedata:1.1.0-alpha01")
- samples("androidx.compose.runtime:runtime-livedata-samples:1.1.0-alpha01")
- docs("androidx.compose.runtime:runtime-rxjava2:1.1.0-alpha01")
- samples("androidx.compose.runtime:runtime-rxjava2-samples:1.1.0-alpha01")
- docs("androidx.compose.runtime:runtime-rxjava3:1.1.0-alpha01")
- samples("androidx.compose.runtime:runtime-rxjava3-samples:1.1.0-alpha01")
- docs("androidx.compose.runtime:runtime-saveable:1.1.0-alpha01")
- samples("androidx.compose.runtime:runtime-saveable-samples:1.1.0-alpha01")
- samples("androidx.compose.runtime:runtime-samples:1.1.0-alpha01")
- docs("androidx.compose.ui:ui:1.1.0-alpha01")
- docs("androidx.compose.ui:ui-geometry:1.1.0-alpha01")
- docs("androidx.compose.ui:ui-graphics:1.1.0-alpha01")
- samples("androidx.compose.ui:ui-graphics-samples:1.1.0-alpha01")
- docs("androidx.compose.ui:ui-test:1.1.0-alpha01")
- docs("androidx.compose.ui:ui-test-junit4:1.1.0-alpha01")
- docs("androidx.compose.ui:ui-text:1.1.0-alpha01")
- samples("androidx.compose.ui:ui-text-samples:1.1.0-alpha01")
- docs("androidx.compose.ui:ui-tooling:1.1.0-alpha01")
- docs("androidx.compose.ui:ui-tooling-data:1.1.0-alpha01")
- docs("androidx.compose.ui:ui-tooling-preview:1.1.0-alpha01")
- docs("androidx.compose.ui:ui-unit:1.1.0-alpha01")
- samples("androidx.compose.ui:ui-unit-samples:1.1.0-alpha01")
- docs("androidx.compose.ui:ui-util:1.1.0-alpha01")
- docs("androidx.compose.ui:ui-viewbinding:1.1.0-alpha01")
- samples("androidx.compose.ui:ui-viewbinding-samples:1.1.0-alpha01")
- samples("androidx.compose.ui:ui-samples:1.1.0-alpha01")
+ docs("androidx.compose.animation:animation:1.1.0-alpha02")
+ docs("androidx.compose.animation:animation-core:1.1.0-alpha02")
+ docs("androidx.compose.animation:animation-graphics:1.1.0-alpha02")
+ samples("androidx.compose.animation:animation-samples:1.1.0-alpha02")
+ samples("androidx.compose.animation:animation-core-samples:1.1.0-alpha02")
+ samples("androidx.compose.animation:animation-graphics-samples:1.1.0-alpha02")
+ docs("androidx.compose.foundation:foundation:1.1.0-alpha02")
+ docs("androidx.compose.foundation:foundation-layout:1.1.0-alpha02")
+ samples("androidx.compose.foundation:foundation-layout-samples:1.1.0-alpha02")
+ samples("androidx.compose.foundation:foundation-samples:1.1.0-alpha02")
+ docs("androidx.compose.material:material:1.1.0-alpha02")
+ docs("androidx.compose.material:material-icons-core:1.1.0-alpha02")
+ samples("androidx.compose.material:material-icons-core-samples:1.1.0-alpha02")
+ docs("androidx.compose.material:material-ripple:1.1.0-alpha02")
+ samples("androidx.compose.material:material-samples:1.1.0-alpha02")
+ docs("androidx.compose.runtime:runtime:1.1.0-alpha02")
+ docs("androidx.compose.runtime:runtime-livedata:1.1.0-alpha02")
+ samples("androidx.compose.runtime:runtime-livedata-samples:1.1.0-alpha02")
+ docs("androidx.compose.runtime:runtime-rxjava2:1.1.0-alpha02")
+ samples("androidx.compose.runtime:runtime-rxjava2-samples:1.1.0-alpha02")
+ docs("androidx.compose.runtime:runtime-rxjava3:1.1.0-alpha02")
+ samples("androidx.compose.runtime:runtime-rxjava3-samples:1.1.0-alpha02")
+ docs("androidx.compose.runtime:runtime-saveable:1.1.0-alpha02")
+ samples("androidx.compose.runtime:runtime-saveable-samples:1.1.0-alpha02")
+ samples("androidx.compose.runtime:runtime-samples:1.1.0-alpha02")
+ docs("androidx.compose.ui:ui:1.1.0-alpha02")
+ docs("androidx.compose.ui:ui-geometry:1.1.0-alpha02")
+ docs("androidx.compose.ui:ui-graphics:1.1.0-alpha02")
+ samples("androidx.compose.ui:ui-graphics-samples:1.1.0-alpha02")
+ docs("androidx.compose.ui:ui-test:1.1.0-alpha02")
+ docs("androidx.compose.ui:ui-test-junit4:1.1.0-alpha02")
+ docs("androidx.compose.ui:ui-text:1.1.0-alpha02")
+ samples("androidx.compose.ui:ui-text-samples:1.1.0-alpha02")
+ docs("androidx.compose.ui:ui-tooling:1.1.0-alpha02")
+ docs("androidx.compose.ui:ui-tooling-data:1.1.0-alpha02")
+ docs("androidx.compose.ui:ui-tooling-preview:1.1.0-alpha02")
+ docs("androidx.compose.ui:ui-unit:1.1.0-alpha02")
+ samples("androidx.compose.ui:ui-unit-samples:1.1.0-alpha02")
+ docs("androidx.compose.ui:ui-util:1.1.0-alpha02")
+ docs("androidx.compose.ui:ui-viewbinding:1.1.0-alpha02")
+ samples("androidx.compose.ui:ui-viewbinding-samples:1.1.0-alpha02")
+ samples("androidx.compose.ui:ui-samples:1.1.0-alpha02")
docs("androidx.concurrent:concurrent-futures:1.1.0")
docs("androidx.concurrent:concurrent-futures-ktx:1.1.0")
docs("androidx.contentpager:contentpager:1.0.0")
@@ -109,7 +109,7 @@
docs("androidx.datastore:datastore-preferences-rxjava3:1.0.0")
docs("androidx.datastore:datastore-rxjava2:1.0.0")
docs("androidx.datastore:datastore-rxjava3:1.0.0")
- docs("androidx.documentfile:documentfile:1.0.0")
+ docs("androidx.documentfile:documentfile:1.1.0-alpha01")
docs("androidx.drawerlayout:drawerlayout:1.1.1")
docs("androidx.dynamicanimation:dynamicanimation:1.1.0-alpha02")
docs("androidx.dynamicanimation:dynamicanimation-ktx:1.0.0-alpha03")
@@ -123,9 +123,9 @@
docs("androidx.enterprise:enterprise-feedback:1.1.0")
docs("androidx.enterprise:enterprise-feedback-testing:1.1.0")
docs("androidx.exifinterface:exifinterface:1.3.3")
- docs("androidx.fragment:fragment:1.4.0-alpha06")
- docs("androidx.fragment:fragment-ktx:1.4.0-alpha06")
- docs("androidx.fragment:fragment-testing:1.4.0-alpha06")
+ docs("androidx.fragment:fragment:1.4.0-alpha07")
+ docs("androidx.fragment:fragment-ktx:1.4.0-alpha07")
+ docs("androidx.fragment:fragment-testing:1.4.0-alpha07")
docs("androidx.gridlayout:gridlayout:1.0.0")
docs("androidx.health:health-services-client:1.0.0-alpha01")
docs("androidx.heifwriter:heifwriter:1.1.0-alpha01")
@@ -167,19 +167,19 @@
docs("androidx.media2:media2-widget:1.2.0-beta01")
docs("androidx.media:media:1.4.1")
docs("androidx.mediarouter:mediarouter:1.2.4")
- docs("androidx.navigation:navigation-common:2.4.0-alpha06")
- docs("androidx.navigation:navigation-common-ktx:2.4.0-alpha06")
- docs("androidx.navigation:navigation-compose:2.4.0-alpha06")
- samples("androidx.navigation:navigation-compose-samples:2.4.0-alpha06")
- docs("androidx.navigation:navigation-dynamic-features-fragment:2.4.0-alpha06")
- docs("androidx.navigation:navigation-dynamic-features-runtime:2.4.0-alpha06")
- docs("androidx.navigation:navigation-fragment:2.4.0-alpha06")
- docs("androidx.navigation:navigation-fragment-ktx:2.4.0-alpha06")
- docs("androidx.navigation:navigation-runtime:2.4.0-alpha06")
- docs("androidx.navigation:navigation-runtime-ktx:2.4.0-alpha06")
- docs("androidx.navigation:navigation-testing:2.4.0-alpha06")
- docs("androidx.navigation:navigation-ui:2.4.0-alpha06")
- docs("androidx.navigation:navigation-ui-ktx:2.4.0-alpha06")
+ docs("androidx.navigation:navigation-common:2.4.0-alpha07")
+ docs("androidx.navigation:navigation-common-ktx:2.4.0-alpha07")
+ docs("androidx.navigation:navigation-compose:2.4.0-alpha07")
+ samples("androidx.navigation:navigation-compose-samples:2.4.0-alpha07")
+ docs("androidx.navigation:navigation-dynamic-features-fragment:2.4.0-alpha07")
+ docs("androidx.navigation:navigation-dynamic-features-runtime:2.4.0-alpha07")
+ docs("androidx.navigation:navigation-fragment:2.4.0-alpha07")
+ docs("androidx.navigation:navigation-fragment-ktx:2.4.0-alpha07")
+ docs("androidx.navigation:navigation-runtime:2.4.0-alpha07")
+ docs("androidx.navigation:navigation-runtime-ktx:2.4.0-alpha07")
+ docs("androidx.navigation:navigation-testing:2.4.0-alpha07")
+ docs("androidx.navigation:navigation-ui:2.4.0-alpha07")
+ docs("androidx.navigation:navigation-ui-ktx:2.4.0-alpha07")
docs("androidx.paging:paging-common:3.1.0-alpha03")
docs("androidx.paging:paging-common-ktx:3.1.0-alpha03")
docs("androidx.paging:paging-compose:1.0.0-alpha12")
@@ -197,7 +197,7 @@
docs("androidx.preference:preference:1.1.1")
docs("androidx.preference:preference-ktx:1.1.1")
docs("androidx.print:print:1.1.0-beta01")
- docs("androidx.profileinstaller:profileinstaller:1.1.0-alpha02")
+ docs("androidx.profileinstaller:profileinstaller:1.1.0-alpha03")
docs("androidx.recommendation:recommendation:1.0.0")
docs("androidx.recyclerview:recyclerview:1.2.1")
docs("androidx.recyclerview:recyclerview-selection:2.0.0-alpha01")
@@ -224,7 +224,7 @@
docs("androidx.slice:slice-builders-ktx:1.0.0-alpha08")
docs("androidx.slice:slice-core:1.1.0-alpha02")
docs("androidx.slice:slice-view:1.1.0-alpha02")
- docs("androidx.slidingpanelayout:slidingpanelayout:1.2.0-alpha03")
+ docs("androidx.slidingpanelayout:slidingpanelayout:1.2.0-alpha04")
docs("androidx.sqlite:sqlite:2.2.0-alpha02")
docs("androidx.sqlite:sqlite-framework:2.2.0-alpha02")
docs("androidx.sqlite:sqlite-ktx:2.2.0-alpha02")
@@ -243,40 +243,41 @@
docs("androidx.versionedparcelable:versionedparcelable:1.1.1")
docs("androidx.viewpager2:viewpager2:1.1.0-beta01")
docs("androidx.viewpager:viewpager:1.0.0")
- docs("androidx.wear.compose:compose-foundation:1.0.0-alpha03")
- samples("androidx.wear.compose:compose-foundation-samples:1.0.0-alpha03")
- docs("androidx.wear.compose:compose-material:1.0.0-alpha03")
- samples("androidx.wear.compose:compose-material-samples:1.0.0-alpha03")
+ docs("androidx.wear.compose:compose-foundation:1.0.0-alpha04")
+ samples("androidx.wear.compose:compose-foundation-samples:1.0.0-alpha04")
+ docs("androidx.wear.compose:compose-material:1.0.0-alpha04")
+ samples("androidx.wear.compose:compose-material-samples:1.0.0-alpha04")
docs("androidx.wear.tiles:tiles:1.0.0-alpha10")
docs("androidx.wear.tiles:tiles-renderer:1.0.0-alpha10")
docs("androidx.wear.tiles:tiles-testing:1.0.0-alpha10")
- docs("androidx.wear:wear:1.2.0-alpha13")
+ docs("androidx.wear:wear:1.2.0-beta01")
stubs(fileTree(dir: "../wear/wear_stubs/", include: ["com.google.android.wearable-stubs.jar"]))
- docs("androidx.wear:wear-complications-data:1.0.0-alpha19")
- docs("androidx.wear:wear-complications-data-source:1.0.0-alpha19")
- docs("androidx.wear:wear-ongoing:1.0.0-beta01")
- docs("androidx.wear:wear-phone-interactions:1.0.0-alpha07")
- docs("androidx.wear:wear-remote-interactions:1.0.0-alpha06")
- docs("androidx.wear:wear-watchface:1.0.0-alpha19")
- docs("androidx.wear:wear-watchface-client:1.0.0-alpha19")
- docs("androidx.wear:wear-watchface-client-guava:1.0.0-alpha19")
- docs("androidx.wear:wear-watchface-complications-rendering:1.0.0-alpha19")
- docs("androidx.wear:wear-watchface-data:1.0.0-alpha19")
- docs("androidx.wear:wear-watchface-editor:1.0.0-alpha19")
- docs("androidx.wear:wear-watchface-editor-guava:1.0.0-alpha19")
- docs("androidx.wear:wear-watchface-guava:1.0.0-alpha19")
+ docs("androidx.wear:wear-complications-data:1.0.0-alpha20")
+ docs("androidx.wear:wear-complications-data-source:1.0.0-alpha20")
+ docs("androidx.wear:wear-complications-data-source-ktx:1.0.0-alpha20")
+ docs("androidx.wear:wear-ongoing:1.0.0-rc01")
+ docs("androidx.wear:wear-phone-interactions:1.0.0-beta01")
+ docs("androidx.wear:wear-remote-interactions:1.0.0-beta01")
+ docs("androidx.wear:wear-watchface:1.0.0-alpha20")
+ docs("androidx.wear:wear-watchface-client:1.0.0-alpha20")
+ docs("androidx.wear:wear-watchface-client-guava:1.0.0-alpha20")
+ docs("androidx.wear:wear-watchface-complications-rendering:1.0.0-alpha20")
+ docs("androidx.wear:wear-watchface-data:1.0.0-alpha20")
+ docs("androidx.wear:wear-watchface-editor:1.0.0-alpha20")
+ docs("androidx.wear:wear-watchface-editor-guava:1.0.0-alpha20")
+ docs("androidx.wear:wear-watchface-guava:1.0.0-alpha20")
samples("androidx.wear:wear-watchface-samples:1.0.0-alpha02")
- docs("androidx.wear:wear-watchface-style:1.0.0-alpha19")
- docs("androidx.wear:wear-input:1.1.0-rc01")
- docs("androidx.wear:wear-input-testing:1.1.0-rc01")
+ docs("androidx.wear:wear-watchface-style:1.0.0-alpha20")
+ docs("androidx.wear:wear-input:1.1.0")
+ docs("androidx.wear:wear-input-testing:1.1.0")
docs("androidx.webkit:webkit:1.4.0")
- docs("androidx.window:window:1.0.0-alpha09")
+ docs("androidx.window:window:1.0.0-beta01")
stubs(fileTree(dir: "../window/stubs/", include: ["window-sidecar-release-0.1.0-alpha01.aar"]))
stubs(project(":window:window-extensions"))
- docs("androidx.window:window-java:1.0.0-alpha09")
- docs("androidx.window:window-rxjava2:1.0.0-alpha09")
- docs("androidx.window:window-rxjava3:1.0.0-alpha09")
- docs("androidx.window:window-testing:1.0.0-alpha09")
+ docs("androidx.window:window-java:1.0.0-beta01")
+ docs("androidx.window:window-rxjava2:1.0.0-beta01")
+ docs("androidx.window:window-rxjava3:1.0.0-beta01")
+ docs("androidx.window:window-testing:1.0.0-beta01")
docs("androidx.work:work-gcm:2.7.0-alpha05")
docs("androidx.work:work-multiprocess:2.7.0-alpha05")
docs("androidx.work:work-runtime:2.7.0-alpha05")
diff --git a/docs-tip-of-tree/build.gradle b/docs-tip-of-tree/build.gradle
index ea18191..4da9f9c 100644
--- a/docs-tip-of-tree/build.gradle
+++ b/docs-tip-of-tree/build.gradle
@@ -117,6 +117,7 @@
docs(project(":datastore:datastore-rxjava2"))
docs(project(":datastore:datastore-rxjava3"))
docs(project(":documentfile:documentfile"))
+ docs(project(":draganddrop:draganddrop"))
docs(project(":drawerlayout:drawerlayout"))
docs(project(":dynamicanimation:dynamicanimation"))
docs(project(":dynamicanimation:dynamicanimation-ktx"))
@@ -134,6 +135,8 @@
docs(project(":fragment:fragment-ktx"))
docs(project(":fragment:fragment-testing"))
docs(project(":glance:glance"))
+ docs(project(":glance:glance-appwidget"))
+ docs(project(":glance:glance-wear"))
docs(project(":gridlayout:gridlayout"))
docs(project(":health:health-services-client"))
docs(project(":heifwriter:heifwriter"))
diff --git a/docs/OWNERS b/docs/OWNERS
deleted file mode 100644
index 07d3979..0000000
--- a/docs/OWNERS
+++ /dev/null
@@ -1 +0,0 @@
-copybara-worker-blackhole@google.com
diff --git a/docs/api_guidelines.md b/docs/api_guidelines.md
index 40b34ff..2510986 100644
--- a/docs/api_guidelines.md
+++ b/docs/api_guidelines.md
@@ -40,7 +40,57 @@
name `:core:core-role` and directory `/core/core-role`.
New modules in androidx can be created using the
-[project creator script](/company/teams/androidx/policies.md#project-creator).
+[project creator script](#module-creator).
+
+#### Project directory structure {#module-structure}
+
+Libraries developed in AndroidX follow a consistent project naming and directory
+structure.
+
+Library groups should organize their projects into directories and project names
+(in brackets) as:
+
+```
+<feature-name>/
+ <feature-name>-<sub-feature>/ [<feature-name>:<feature-name>-<sub-feature>]
+ samples/ [<feature-name>:<feature-name>-<sub-feature>:samples]
+ integration-tests/
+ testapp/ [<feature-name>:testapp]
+ testlib/ [<feature-name>:testlib]
+```
+
+For example, the `navigation` library group's directory structure is:
+
+```
+navigation/
+ navigation-benchmark/ [navigation:navigation-benchmark]
+ ...
+ navigation-ui/ [navigation:navigation-ui]
+ navigation-ui-ktx/ [navigation:navigation-ui-ktx]
+ integration-tests/
+ testapp/ [navigation:integration-tests:testapp]
+```
+
+#### Project creator script {#module-creation}
+
+Note: The terms _project_, _module_, and _library_ are often used
+interchangeably within AndroidX, with project being the technical term used by
+Gradle to describe a build target, e.g. a library that maps to a single AAR.
+
+New projects can be created using our
+[project creation script](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:development/project-creator/?q=project-creator&ss=androidx%2Fplatform%2Fframeworks%2Fsupport)
+available in our repo.
+
+It will create a new project with the proper structure and configuration based
+on your project needs!
+
+To use it:
+
+```sh
+cd ~/androidx-main/frameworks/support && \
+cd development/project-creator && \
+./create_project.py androidx.foo foo-bar
+```
#### Common sub-feature names {#module-naming-subfeature}
@@ -1019,7 +1069,16 @@
## Dependencies {#dependencies}
-### Specification types {#dependencies-spec}
+Artifacts may depend on other artifacts within AndroidX as well as sanctioned
+third-party libraries.
+
+### Versioned artifacts {#dependencies-versioned}
+
+One of the most difficult aspects of independently-versioned releases is
+maintaining compatibility with public artifacts. In a mono repo such as Google's
+repository or Android Git at master revision, it's easy for an artifact to
+accidentally gain a dependency on a feature that may not be released on the same
+schedule.
- Project `project(":core:core")` uses the tip-of-tree sources for the
`androidx.core:core` library and requires that they be loaded in the
@@ -1036,6 +1095,78 @@
that include the APIs or behaviors required by the library, using project or
Playground specs only in cases where tip-of-tree APIs or behaviors are required.
+#### Pre-release dependencies {#dependencies-pre-release}
+
+Pre-release suffixes **must** propagate up the dependency tree. For example, if
+your artifact has API-type dependencies on pre-release artifacts, ex.
+`1.1.0-alpha01`, then your artifact must also carry the `alpha` suffix. If you
+only have implementation-type dependencies, your artifact may carry either the
+`alpha` or `beta` suffix.
+
+Note: This does not apply to test dependencies: suffixes of test dependencies do
+_not_ carry over to your artifact.
+
+#### Pinned versions {#dependencies-prebuilt}
+
+To avoid issues with dependency versioning, consider pinning your artifact's
+dependencies to the oldest version (available via local `maven_repo` or Google
+Maven) that satisfies the artifact's API requirements. This will ensure that the
+artifact's release schedule is not accidentally tied to that of another artifact
+and will allow developers to use older libraries if desired.
+
+```
+dependencies {
+ api("androidx.collection:collection:1.0.0")
+ ...
+}
+```
+
+Artifacts should be built and tested against both pinned and tip-of-tree
+versions of their dependencies to ensure behavioral compatibility.
+
+#### Tip-of-tree versions {#dependencies-project}
+
+Below is an example of a non-pinned dependency. It ties the artifact's release
+schedule to that of the dependency artifact, because the dependency will need to
+be released at the same time.
+
+```
+dependencies {
+ api(project(":collection"))
+ ...
+}
+```
+
+### Non-public APIs {#dependencies-non-public-apis}
+
+Artifacts may depend on non-public (e.g. `@hide`) APIs exposed within their own
+artifact or another artifact in the same `groupId`; however, cross-artifact
+usages are subject to binary compatibility guarantees and
+`@RestrictTo(Scope.LIBRARY_GROUP)` APIs must be tracked like public APIs.
+
+```
+Dependency versioning policies are enforced at build time in the createArchive task. This task will ensure that pre-release version suffixes are propagated appropriately.
+
+Cross-artifact API usage policies are enforced by the checkApi and checkApiRelease tasks (see Life of a release).
+```
+
+### Third-party libraries {#dependencies-3p}
+
+Artifacts may depend on libraries developed outside of AndroidX; however, they
+must conform to the following guidelines:
+
+* Prebuilt **must** be checked into Android Git with both Maven and Make
+ artifacts
+ * `prebuilts/maven_repo` is recommended if this dependency is only
+ intended for use with AndroidX artifacts, otherwise please use
+ `external`
+* Prebuilt directory **must** contains an `OWNERS` file identifying one or
+ more individual owners (e.g. NOT a group alias)
+* Library **must** be approved by legal
+
+Please see Jetpack's [open-source policy page](open_source.md) for more details
+on using third-party libraries.
+
### System health {#dependencies-health}
Libraries should consider the system health implications of their dependencies,
@@ -1084,7 +1215,7 @@
libraries to stay on Java 8. However, if you have a business need to target Java
7, you can specify Java 7 in your `build.gradle` as follows:
-```Groovy
+```groovy
android {
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_7
@@ -1735,12 +1866,14 @@
new lint check, and it is prohibitively expensive / not possible to fix the
errors generated by enabling this lint check.
-To update a lint baseline (lint-baseline.xml) after you have fixed issues, add
-`-PupdateLintBaseline` to the end of your lint command. This will delete and
-then regenerate the baseline file.
+To update a lint baseline (`lint-baseline.xml`) after you have fixed issues,
+first **manually delete the `lint-baseline.xml` file** for your project and then
+run the `lintDebug` task for your project with the argument
+`-PupdateLintBaseline`.
```shell
-./gradlew core:lintDebug -PupdateLintBaseline
+rm core/core/lint-baseline.xml
+./gradlew :core:core:lintDebug -PupdateLintBaseline
```
## Metalava API Lint
diff --git a/docs/benchmarking.md b/docs/benchmarking.md
index a4fabb1..c54786a 100644
--- a/docs/benchmarking.md
+++ b/docs/benchmarking.md
@@ -93,15 +93,15 @@
### Command Line
-The benchmark library supports capturing profiling information - sampled and
-method - from the command line. Here's an example which runs the
-`androidx.ui.benchmark.test.CheckboxesInRowsBenchmark#draw` method with
-`MethodSampling` profiling:
+The benchmark library supports capturing profiling information - stack sampling
+and method tracing - from the command line. Here's an example which runs the
+`androidx.compose.material.benchmark.CheckboxesInRowsBenchmark#draw` method with
+`StackSampling` profiling:
```
-./gradlew compose:integ:bench:cC \
- -P android.testInstrumentationRunnerArguments.androidx.benchmark.profiling.mode=MethodSampling \
- -P android.testInstrumentationRunnerArguments.class=androidx.ui.benchmark.test.CheckboxesInRowsBenchmark#draw
+./gradlew compose:material:material-benchmark:cC \
+ -P android.testInstrumentationRunnerArguments.androidx.benchmark.profiling.mode=StackSampling \
+ -P android.testInstrumentationRunnerArguments.class=androidx.compose.material.benchmark.CheckboxesInRowsBenchmark#draw
```
The command output will tell you where to look for the file on your host
@@ -115,123 +115,24 @@
To inspect the captured trace, open the appropriate `*.trace` file in that
directory with Android Studio, using `File > Open`.
-For more information on the `MethodSampling` and `MethodTracing` profiling
-modes, see the
+NOTE For stack sampling, it's recommended to profile on Android Q(API 29) or
+higher, as this enables the benchmark library to use
+[Simpleperf](https://android.googlesource.com/platform/system/extras/+/master/simpleperf/doc/).
+Simpleperf previously required a
+[more complex setup process](https://issuetracker.google.com/issues/158303822) -
+this has been fixed!
+
+For more information on the `StackSampling` and `MethodTracing` profiling modes,
+see the
[Studio Profiler configuration docs](https://developer.android.com/studio/profile/cpu-profiler#configurations),
-specifically Java Sampled Profiling, and Java Method Tracing.
+specifically "Sample C/C++ Functions" (a confusing name for Simpleperf), and
+Java Method Tracing.

-### Advanced: Simpleperf Method Sampling
-
-[Simpleperf](https://android.googlesource.com/platform/system/extras/+/master/simpleperf/doc/)
-offers more accurate profiling for apps than standard method sampling, due to
-lower overhead (as well as C++ profiling support). Simpleperf support will be
-simplified and improved over time.
-
-[Simpleperf app profiling docs](https://android.googlesource.com/platform/system/extras/+/master/simpleperf/doc/android_application_profiling.md).
-
-#### Device
-
-Get an API 29+ device. The rest of this section is about *why* those constraints
-exist, skip if not interested.
-
-Simpleperf has restrictions about where it can be used - Jetpack Benchmark will
-only support API 29+ for now, due to
-[platform/simpleperf constraints](https://android.googlesource.com/platform/system/extras/+/master/simpleperf/doc/android_application_profiling.md#prepare-an-android-application)
-(see last subsection titled "If you want to profile Java code"). Summary is:
-
-- <=23 (M): Unsupported for Java code.
-
-- 24-25 (N): Requires compiled Java code. We haven't investigated support.
-
-- 26 (O): Requires compiled Java code, and wrapper script. We haven't
- investigated support.
-
-- 27 (O.1): Can profile all Java code, but requires `userdebug`/rooted device
-
-- 28 (P): Can profile all Java code, requires debuggable (or
- `userdebug`/rooted device, but this appears to not be supported by scripts
- currently)
-
-- \>=29 (Q): Can profile all Java code, requires profileable or debuggable (or
- `userdebug`/rooted device)
-
-We aren't planning to support profiling debuggable APK builds, since they're
-misleading for profiling.
-
-#### Initial setup
-
-Currently, we rely on Python scripts built by the simpleperf team. We can
-eventually build this into the benchmark library / gradle plugin. Download the
-scripts from AOSP:
-
-```
-# copying to somewhere outside of the androidx repo
-git clone https://android.googlesource.com/platform/system/extras ~/simpleperf
-```
-
-Next configure your path to ensure the ADB that the scripts will use matches the
-androidx tools:
-
-```
-export PATH=$PATH:<path/to/androidx>/prebuilts/fullsdk-<linux or darwin>/platform-tools
-```
-
-Now, setup your device for simpleperf:
-
-```
-~/simpleperf/simpleperf/scripts/api_profiler.py prepare --max-sample-rate 10000000
-```
-
-#### Build and Run, Option 1: Studio (slightly recommended)
-
-Running from Studio is simpler, since you don't have to manually install and run
-the APKs, avoiding Gradle.
-
-Add the following to the benchmark module's build.gradle:
-
-```
-android {
- defaultConfig {
- // DO NOT COMMIT!!
- testInstrumentationRunnerArgument 'androidx.benchmark.profiling.mode', 'MethodSamplingSimpleperf'
- // Optional: Control freq / duration.
- testInstrumentationRunnerArgument 'androidx.benchmark.profiler.sampleFrequency', '1000000'
- testInstrumentationRunnerArgument 'androidx.benchmark.profiler.sampleDurationSeconds', '5'
- }
-}
-```
-
-And run the test or tests you'd like to measure from within Studio.
-
-#### Build and Run, Option 2: Command Line
-
-**Note - this will be significantly simplified in the future**
-
-Since we're not using AGP to pull the files yet, we can't invoke the benchmark
-through Gradle, because Gradle uninstalls after each test run. Instead, let's
-just build and run manually:
-
-```
-./gradlew compose:integration-tests:benchmark:assembleReleaseAndroidTest
-
-adb install -r ../../../out/ui/compose/integration-tests/benchmark/build/outputs/apk/androidTest/release/benchmark-release-androidTest.apk
-
-# run the test (can copy this line from Studio console, when running a benchmark)
-adb shell am instrument -w -m --no-window-animation -e androidx.benchmark.profiling.mode MethodSamplingSimpleperf -e debug false -e class 'androidx.ui.benchmark.test.CheckboxesInRowsBenchmark#toggleCheckbox_draw' androidx.ui.benchmark.test/androidx.benchmark.junit4.AndroidBenchmarkRunner
-```
-
-#### Pull and open the trace
-
-```
-# move the files to host
-# (Note: removes files from device)
-~/simpleperf/simpleperf/scripts/api_profiler.py collect -p androidx.ui.benchmark.test -o ~/simpleperf/results
-
-# create/open the HTML report
-~/simpleperf/simpleperf/scripts/report_html.py -i ~/simpleperf/results/CheckboxesInRowsBenchmark_toggleCheckbox_draw\[1\].data
-```
+NOTE Simpleperf captures stack traces from all threads, so click the test thread
+in the left profiler panel, and select flame chart on the right to see just
+samples from the test.
### Advanced: Studio Profiling
diff --git a/docs/onboarding.md b/docs/onboarding.md
index 35db1e2..1bbe627 100644
--- a/docs/onboarding.md
+++ b/docs/onboarding.md
@@ -131,6 +131,14 @@
git config --global diff.renameLimit 999999
```
+### To check out older source, use the superproject
+
+The
+[git superproject](https://android.googlesource.com/platform/superproject/+/androidx-main)
+contains a history of the matching exact commits of each git repository over
+time, and it can be
+[checked out directly via git](https://stackoverflow.com/questions/3796927/how-to-git-clone-including-submodules)
+
## Explore source code from a browser {#code-search}
`androidx-main` has a publicly-accessible
@@ -227,6 +235,38 @@
hitting a rare issue with Git-on-Borg and HTTP/2. You can force `git` and `repo`
to use HTTP/1.1 with `git config --global http.version HTTP/1.1`.
+### Fixing Kotlin code style errors
+
+`repo upload` automatically runs `ktlint`, which will cause the upload to fail
+if your code has style errors, which it reports on the command line like so:
+
+```
+[FAILED] ktlint_hook
+ [path]/MessageListAdapter.kt:36:69: Missing newline before ")"
+```
+
+To find and fix these errors, you can run ktlint locally, either in a console
+window or in the Terminal tool in Android Studio. Running in the Terminal tool
+is preferable because it will surface links to your source files/lines so you
+can easily navigate to the code to fix any problems.
+
+First, to run the tool and see all of the errors, run:
+
+`./gradlew module:submodule:ktlint`
+
+where module/submodule are the names used to refer to the module you want to
+check, such as `navigation:navigation-common`. You can also run ktlint on the
+entire project, but that takes longer as it is checking all active modules in
+your project.
+
+Many of the errors that ktlint finds can be automatically fixed by running
+ktlintFormat:
+
+`./gradlew module:submodule:ktlintFormat`
+
+ktlintFormat will report any remaining errors, but you can also run `ktlint`
+again at any time to see an updated list of the remaining errors.
+
## Building {#building}
### Modules and Maven artifacts {#modules-and-maven-artifacts}
diff --git a/docs/policies.md b/docs/policies.md
deleted file mode 100644
index ffe656f..0000000
--- a/docs/policies.md
+++ /dev/null
@@ -1,195 +0,0 @@
-# Policies and processes
-
-This document is intended to describe release policies that affect the workflow
-of an engineer developing within the AndroidX libraries. It also describes the
-process followed by a release engineer or TPM to take a development branch and
-publish it as a release on Google Maven.
-
-Policies and processes automated via tooling are noted in
-<span style="color:#bf9000;">yellow</span>.
-
-[TOC]
-
-## Project directory structure {#directory-structure}
-
-Libraries developed in AndroidX follow a consistent project naming and directory
-structure.
-
-Library groups should organize their projects into directories and project names
-(in brackets) as:
-
-```
-<feature-name>/
- <feature-name>-<sub-feature>/ [<feature-name>:<feature-name>-<sub-feature>]
- samples/ [<feature-name>:<feature-name>-<sub-feature>:samples]
- integration-tests/
- testapp/ [<feature-name>:testapp]
- testlib/ [<feature-name>:testlib]
-```
-
-For example, the `navigation` library group's directory structure is:
-
-```
-navigation/
- navigation-benchmark/ [navigation:navigation-benchmark]
- ...
- navigation-ui/ [navigation:navigation-ui]
- navigation-ui-ktx/ [navigation:navigation-ui-ktx]
- integration-tests/
- testapp/ [navigation:integration-tests:testapp]
-```
-
-### Project creator script {#project-creator}
-
-Note: The terms _project_, _module_, and _library_ are often used
-interchangeably within AndroidX, with project being the technical term used by
-Gradle to describe a build target, e.g. a library that maps to a single AAR.
-
-New projects can be created using our
-[project creation script](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:development/project-creator/?q=project-creator&ss=androidx%2Fplatform%2Fframeworks%2Fsupport)
-available in our repo.
-
-It will create a new project with the proper structure and configuration based
-on your project needs!
-
-To use it:
-
-```sh
-cd ~/androidx-main/framework/support && \
-cd development/project-creator && \
-./create_project.py androidx.foo foo-bar
-```
-
-## Terminology {#terminology}
-
-**Artifact**
-: Previously referred to as "a Support Library library." A library --
- typically Java or Android -- that maps to a single Maven artifact, ex.
- `androidx.recyclerview:recyclerview`. An artifact is associated with a
- single Android Studio module and a directory containing a `build.gradle`
- configuration, resources, and source code.
-
-**API Council**
-: A committee that reviews Android APIs, both platform and library, to ensure
- they are consistent and follow the best-practices defined in our API
- guidelines.
-
-**Semantic Versioning (SemVer)**
-: A versioning standard developed by one of the co-founders of GitHub that is
- understood by common dependency management systems, including Maven. In this
- document, we are referring specifically to
- [Semantic Versioning 2.0.0](https://semver.org/spec/v2.0.0.html).
-
-## Managing versions {#managing-versions}
-
-This section outlines the steps for a variety of common versioning-related
-tasks. Artifact versions should **only** be modified by their owners as
-specified in the artifact directory's `OWNERS` file.
-
-Artifact versions are specified in
-[`LibraryVersions.kt`](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:buildSrc/src/main/kotlin/androidx/build/LibraryVersions.kt).
-Versions are bound to your artifact in the `supportLibrary` block in your
-artifact's `build.gradle` file. The `Version` class validates the version string
-at build time.
-
-In the
-[`LibraryVersions.kt`](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:buildSrc/src/main/kotlin/androidx/build/LibraryVersions.kt)
-file:
-
-```
-object LibraryVersions {
- val SNAZZY_ARTIFACT = Version("1.1.0-alpha03")
-}
-```
-
-In your artifact's `build.gradle` file:
-
-```
-import androidx.build.LibraryVersions
-
-supportLibrary {
- mavenVersion = LibraryVersions.SNAZZY_ARTIFACT
-}
-```
-
-## Dependencies {#dependencies}
-
-Artifacts may depend on other artifacts within AndroidX as well as sanctioned
-third-party libraries.
-
-### Versioned artifacts {#versioned-artifacts}
-
-One of the most difficult aspects of independently-versioned releases is
-maintaining compatibility with public artifacts. In a mono repo such as Google's
-repository or Android Git at master revision, it's easy for an artifact to
-accidentally gain a dependency on a feature that may not be released on the same
-schedule.
-
-#### Pre-release dependencies {#pre-release-dependencies}
-
-Pre-release suffixes **must** propagate up the dependency tree. For example, if
-your artifact has API-type dependencies on pre-release artifacts, ex.
-`1.1.0-alpha01`, then your artifact must also carry the `alpha` suffix. If you
-only have implementation-type dependencies, your artifact may carry either the
-`alpha` or `beta` suffix.
-
-Note: This does not apply to test dependencies: suffixes of test dependencies do
-_not_ carry over to your artifact.
-
-#### Pinned versions {#pinned-versions}
-
-To avoid issues with dependency versioning, consider pinning your artifact's
-dependencies to the oldest version (available via local `maven_repo` or Google
-Maven) that satisfies the artifact's API requirements. This will ensure that the
-artifact's release schedule is not accidentally tied to that of another artifact
-and will allow developers to use older libraries if desired.
-
-```
-dependencies {
- api("androidx.collection:collection:1.0.0")
- ...
-}
-```
-
-Artifacts should be built and tested against both pinned and tip-of-tree
-versions of their dependencies to ensure behavioral compatibility.
-
-#### Non-Pinned versions {#nonpinned-versions}
-
-Below is an example of a non-pinned dependency. It ties the artifact's release
-schedule to that of the dependency artifact, because the dependency will need to
-be released at the same time.
-
-```
-dependencies {
- api(project(":collection"))
- ...
-}
-```
-
-### Non-public APIs {#non-public-apis}
-
-Artifacts may depend on non-public (e.g. `@hide`) APIs exposed within their own
-artifact or another artifact in the same `groupId`; however, cross-artifact
-usages are subject to binary compatibility guarantees and
-`@RestrictTo(Scope.LIBRARY_GROUP)` APIs must be tracked like public APIs.
-
-```
-Dependency versioning policies are enforced at build time in the createArchive task. This task will ensure that pre-release version suffixes are propagated appropriately.
-
-Cross-artifact API usage policies are enforced by the checkApi and checkApiRelease tasks (see Life of a release).
-```
-
-### Third-party libraries {#third-party-libraries}
-
-Artifacts may depend on libraries developed outside of AndroidX; however, they
-must conform to the following guidelines:
-
-* Prebuilt **must** be checked into Android Git with both Maven and Make
- artifacts
- * `prebuilts/maven_repo` is recommended if this dependency is only
- intended for use with AndroidX artifacts, otherwise please use
- `external`
-* Prebuilt directory **must** contains an OWNERS file identifying one or more
- individual owners (e.g. NOT a group alias)
-* Library **must** be approved by legal
diff --git a/docs/testing.md b/docs/testing.md
index 5ebb807..0dbc1d6 100644
--- a/docs/testing.md
+++ b/docs/testing.md
@@ -103,9 +103,7 @@
You may also gate portions of test implementation code using `SDK_INT` or
[`BuildCompat.isAtLeast`](https://developer.android.com/reference/androidx/core/os/BuildCompat)
-methods.
-
-To restrict to only phsyical devices, use
+methods. s To restrict to only physical devices, use
[`@RequiresDevice`](https://developer.android.com/reference/androidx/test/filters/RequiresDevice).
NOTE [Cuttlefish](https://source.android.com/setup/create/cuttlefish) is not
diff --git a/draganddrop/OWNERS b/draganddrop/OWNERS
new file mode 100644
index 0000000..7de3c23
--- /dev/null
+++ b/draganddrop/OWNERS
@@ -0,0 +1 @@
+rledley@google.com
diff --git a/appsearch/debug-view/api/current.txt b/draganddrop/draganddrop/api/current.txt
similarity index 100%
copy from appsearch/debug-view/api/current.txt
copy to draganddrop/draganddrop/api/current.txt
diff --git a/appsearch/debug-view/api/public_plus_experimental_current.txt b/draganddrop/draganddrop/api/public_plus_experimental_current.txt
similarity index 100%
copy from appsearch/debug-view/api/public_plus_experimental_current.txt
copy to draganddrop/draganddrop/api/public_plus_experimental_current.txt
diff --git a/appsearch/debug-view/api/restricted_current.txt b/draganddrop/draganddrop/api/restricted_current.txt
similarity index 100%
copy from appsearch/debug-view/api/restricted_current.txt
copy to draganddrop/draganddrop/api/restricted_current.txt
diff --git a/draganddrop/draganddrop/build.gradle b/draganddrop/draganddrop/build.gradle
new file mode 100644
index 0000000..b81c64a
--- /dev/null
+++ b/draganddrop/draganddrop/build.gradle
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * 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.
+ */
+
+import androidx.build.LibraryGroups
+import androidx.build.LibraryType
+import androidx.build.LibraryVersions
+
+plugins {
+ id("AndroidXPlugin")
+ id("java-library")
+}
+
+dependencies {
+ annotationProcessor(libs.nullaway)
+ // Add dependencies here
+}
+
+androidx {
+ name = "AndroidX Drag and Drop Library"
+ type = LibraryType.PUBLISHED_LIBRARY
+ mavenVersion = LibraryVersions.DRAGANDDROP
+ mavenGroup = LibraryGroups.DRAGANDDROP
+ inceptionYear = "2021"
+ description = "This library makes it easy for developers to accept data dragged-and-dropped from another app, and show a consistent affordance."
+}
diff --git a/draganddrop/draganddrop/src/androidTest/AndroidManifest.xml b/draganddrop/draganddrop/src/androidTest/AndroidManifest.xml
new file mode 100644
index 0000000..7d51e3a
--- /dev/null
+++ b/draganddrop/draganddrop/src/androidTest/AndroidManifest.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright 2021 The Android Open Source Project
+
+ 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.
+ -->
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="androidx.draganddrop.test">
+
+</manifest>
diff --git a/draganddrop/draganddrop/src/main/AndroidManifest.xml b/draganddrop/draganddrop/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..56c387a
--- /dev/null
+++ b/draganddrop/draganddrop/src/main/AndroidManifest.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright 2021 The Android Open Source Project
+
+ 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.
+ -->
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="androidx.draganddrop">
+
+</manifest>
\ No newline at end of file
diff --git a/development/project-creator/compose-template/groupId/artifactId/src/main/groupId/package-info.java b/draganddrop/draganddrop/src/main/androidx/draganddrop/package-info.java
similarity index 82%
rename from development/project-creator/compose-template/groupId/artifactId/src/main/groupId/package-info.java
rename to draganddrop/draganddrop/src/main/androidx/draganddrop/package-info.java
index a51e68c..480752e 100644
--- a/development/project-creator/compose-template/groupId/artifactId/src/main/groupId/package-info.java
+++ b/draganddrop/draganddrop/src/main/androidx/draganddrop/package-info.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) <YEAR> The Android Open Source Project
+ * Copyright (C) 2021 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,6 +15,6 @@
*/
/**
- * Insert package level documentation here
+ * Drag and drop utilities.
*/
-package <PACKAGE>;
+package androidx.draganddrop;
diff --git a/emoji/emoji/src/androidTest/java/androidx/emoji/text/EmojiCompatTest.java b/emoji/emoji/src/androidTest/java/androidx/emoji/text/EmojiCompatTest.java
index 08a8cd7..1ff7816 100644
--- a/emoji/emoji/src/androidTest/java/androidx/emoji/text/EmojiCompatTest.java
+++ b/emoji/emoji/src/androidTest/java/androidx/emoji/text/EmojiCompatTest.java
@@ -833,6 +833,21 @@
}
@Test
+ @SdkSuppress(minSdkVersion = 19)
+ public void testUpdateEditorInfoAttrs_makesBundleIfNull() {
+ final EditorInfo editorInfo = new EditorInfo();
+ editorInfo.extras = null;
+ EmojiCompat.Config config = TestConfigBuilder.config().setReplaceAll(false);
+ EmojiCompat.reset(config);
+ EmojiCompat.get().updateEditorInfoAttrs(editorInfo);
+
+ final Bundle extras = editorInfo.extras;
+ assertTrue(extras.containsKey(EmojiCompat.EDITOR_INFO_METAVERSION_KEY));
+ assertTrue(extras.getInt(EmojiCompat.EDITOR_INFO_METAVERSION_KEY) > 0);
+ assertTrue(extras.containsKey(EmojiCompat.EDITOR_INFO_REPLACE_ALL_KEY));
+ }
+
+ @Test
@SdkSuppress(maxSdkVersion = 18)
public void testHandleDeleteSurroundingText_pre19() {
final TestString testString = new TestString(EMOJI_SINGLE_CODEPOINT);
diff --git a/emoji/emoji/src/main/java/androidx/emoji/text/EmojiCompat.java b/emoji/emoji/src/main/java/androidx/emoji/text/EmojiCompat.java
index 5f960fa6..a0013d4 100644
--- a/emoji/emoji/src/main/java/androidx/emoji/text/EmojiCompat.java
+++ b/emoji/emoji/src/main/java/androidx/emoji/text/EmojiCompat.java
@@ -20,6 +20,7 @@
import android.graphics.Color;
import android.graphics.Paint;
import android.os.Build;
+import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.text.Editable;
@@ -792,6 +793,12 @@
* Updates the EditorInfo attributes in order to communicate information to Keyboards. When
* used on devices running API 18 or below, does not update EditorInfo attributes.
*
+ * This is called by from EditText integrations when using
+ * {@link androidx.emoji.widget.EmojiEditTextHelper}. Custom widgets that allow
+ * IME not subclassing EditText should call this method when creating an input connection.
+ *
+ * Prior to {@link #LOAD_STATE_SUCCEEDED}, this method has no effect.
+ *
* @param outAttrs EditorInfo instance passed to
* {@link android.widget.TextView#onCreateInputConnection(EditorInfo)}
*
@@ -803,9 +810,13 @@
@RestrictTo(LIBRARY_GROUP_PREFIX)
public void updateEditorInfoAttrs(@NonNull final EditorInfo outAttrs) {
//noinspection ConstantConditions
- if (isInitialized() && outAttrs != null && outAttrs.extras != null) {
- mHelper.updateEditorInfoAttrs(outAttrs);
+ if (!isInitialized() || outAttrs == null) {
+ return;
}
+ if (outAttrs.extras == null) {
+ outAttrs.extras = new Bundle();
+ }
+ mHelper.updateEditorInfoAttrs(outAttrs);
}
/**
diff --git a/emoji2/emoji2-benchmark/build.gradle b/emoji2/emoji2-benchmark/build.gradle
index 4ebdafd..2a2c030 100644
--- a/emoji2/emoji2-benchmark/build.gradle
+++ b/emoji2/emoji2-benchmark/build.gradle
@@ -24,8 +24,24 @@
id("androidx.benchmark")
}
+ext {
+ fontDir = project(':noto-emoji-compat-font').projectDir
+}
+
+android {
+ sourceSets {
+ androidTest {
+ assets {
+ srcDirs = [new File(fontDir, "supported-emojis").getAbsolutePath()]
+ }
+ }
+ }
+
+}
+
dependencies {
androidTestImplementation(project(":emoji2:emoji2"))
+ androidTestImplementation(project(":emoji2:emoji2-bundled"))
androidTestImplementation(projectOrArtifact(":benchmark:benchmark-junit4"))
androidTestImplementation(libs.junit)
androidTestImplementation(libs.testExtJunit)
diff --git a/emoji2/emoji2-benchmark/src/androidTest/AndroidManifest.xml b/emoji2/emoji2-benchmark/src/androidTest/AndroidManifest.xml
index 07b3c28..5a4a164 100644
--- a/emoji2/emoji2-benchmark/src/androidTest/AndroidManifest.xml
+++ b/emoji2/emoji2-benchmark/src/androidTest/AndroidManifest.xml
@@ -16,15 +16,9 @@
-->
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:tools="http://schemas.android.com/tools"
package="androidx.emoji2.benchmark">
-
- <!-- Important: disable debuggable for accurate performance results -->
- <application
- android:debuggable="false"
- tools:replace="android:debuggable">
- <!-- enable profileableByShell for non-intrusive profiling tools -->
- <!--suppress AndroidElementNotAllowed -->
+ <application>
+ <!-- enable profiling by shell for non-intrusive profiling tools -->
<profileable android:shell="true"/>
</application>
</manifest>
diff --git a/emoji2/emoji2-benchmark/src/androidTest/java/androidx/emoji2/benchmark/text/CachedEmojiCompatInitBenchmark.kt b/emoji2/emoji2-benchmark/src/androidTest/java/androidx/emoji2/benchmark/text/CachedEmojiCompatInitBenchmark.kt
index ea969a4..211dd7f 100644
--- a/emoji2/emoji2-benchmark/src/androidTest/java/androidx/emoji2/benchmark/text/CachedEmojiCompatInitBenchmark.kt
+++ b/emoji2/emoji2-benchmark/src/androidTest/java/androidx/emoji2/benchmark/text/CachedEmojiCompatInitBenchmark.kt
@@ -24,6 +24,7 @@
import androidx.test.core.app.ApplicationProvider
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.LargeTest
+import androidx.test.filters.SdkSuppress
import org.junit.Assert.assertNotNull
import org.junit.Rule
import org.junit.Test
@@ -31,6 +32,7 @@
@RunWith(AndroidJUnit4::class)
@LargeTest
+@SdkSuppress(minSdkVersion = 19)
class CachedEmojiCompatInitBenchmark {
@get:Rule
diff --git a/emoji2/emoji2-benchmark/src/androidTest/java/androidx/emoji2/benchmark/text/EmojiHasGlyphBenchmark.kt b/emoji2/emoji2-benchmark/src/androidTest/java/androidx/emoji2/benchmark/text/EmojiHasGlyphBenchmark.kt
new file mode 100644
index 0000000..b42d928
--- /dev/null
+++ b/emoji2/emoji2-benchmark/src/androidTest/java/androidx/emoji2/benchmark/text/EmojiHasGlyphBenchmark.kt
@@ -0,0 +1,48 @@
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * 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.
+ */
+
+package androidx.emoji2.benchmark.text
+
+import android.text.TextPaint
+import androidx.benchmark.junit4.BenchmarkRule
+import androidx.benchmark.junit4.measureRepeated
+import androidx.core.graphics.PaintCompat
+import androidx.test.ext.junit.runners.AndroidJUnit4
+import androidx.test.filters.LargeTest
+import androidx.test.filters.SdkSuppress
+import org.junit.Rule
+import org.junit.Test
+import org.junit.runner.RunWith
+
+@RunWith(AndroidJUnit4::class)
+@LargeTest
+@SdkSuppress(minSdkVersion = 19)
+class EmojiHasGlyphBenchmark {
+
+ @get:Rule
+ val benchmarkRule = BenchmarkRule()
+
+ @Test
+ fun hasGlyph() {
+ initializeEmojiCompatWithBundledForTest()
+ val snowman = POLARBEAR
+ val textPaint = TextPaint()
+
+ benchmarkRule.measureRepeated {
+ PaintCompat.hasGlyph(textPaint, snowman)
+ }
+ }
+}
diff --git a/emoji2/emoji2-benchmark/src/androidTest/java/androidx/emoji2/benchmark/text/EmojiProcessBenchmark.kt b/emoji2/emoji2-benchmark/src/androidTest/java/androidx/emoji2/benchmark/text/EmojiProcessBenchmark.kt
new file mode 100644
index 0000000..f439250
--- /dev/null
+++ b/emoji2/emoji2-benchmark/src/androidTest/java/androidx/emoji2/benchmark/text/EmojiProcessBenchmark.kt
@@ -0,0 +1,124 @@
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * 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.
+ */
+
+package androidx.emoji2.benchmark.text
+
+import android.text.SpannableStringBuilder
+import android.text.Spanned
+import android.text.SpannedString
+import androidx.benchmark.junit4.BenchmarkRule
+import androidx.benchmark.junit4.measureRepeated
+import androidx.emoji2.text.EmojiCompat
+import androidx.emoji2.text.EmojiSpan
+import androidx.test.filters.LargeTest
+import androidx.test.filters.SdkSuppress
+import org.junit.Rule
+import org.junit.Test
+import org.junit.runner.RunWith
+import org.junit.runners.Parameterized
+
+@RunWith(Parameterized::class)
+@LargeTest
+@SdkSuppress(minSdkVersion = 23)
+class EmojiProcessBenchmark(
+ private val size: Int,
+ private val replaceAll: Boolean
+) {
+
+ @get:Rule
+ val benchmarkRule = BenchmarkRule()
+
+ companion object {
+ @Parameterized.Parameters(name = "size={0},replaceAll={1}")
+ @JvmStatic
+ fun parameters() = mutableListOf<Array<Any>>().apply {
+ listOf(1, 10, 20, 30, 40).forEach { size ->
+ listOf(true, false).forEach { replaceAll ->
+ add(arrayOf(size, replaceAll))
+ }
+ }
+ }
+ }
+
+ @Test
+ fun emojiSpannableStringBuilder_emptyHasGlyphCache() {
+ doEmojiBenchmark {
+ val text = SpannableStringBuilder(emojisString(size))
+ emptyGlyphCache(text)
+ text
+ }
+ }
+
+ @Test
+ fun emojiSpannableStringBuilder() {
+ doEmojiBenchmark {
+ SpannableStringBuilder(emojisString(size))
+ }
+ }
+
+ @Test
+ fun emojiSpannedString() {
+ doEmojiBenchmark {
+ SpannedString(emojisString(size))
+ }
+ }
+
+ @Test
+ fun emojiSpannedString_withExistingEmojiSpans() {
+ doEmojiBenchmark {
+ val spannedString = SpannedString(emojisString(size))
+ val alreadySpanned = EmojiCompat.get().process(spannedString)!!
+ alreadySpanned
+ }
+ }
+
+ @Test
+ fun emojiString() {
+
+ // string is immutable
+ val string = emojisString(size)
+ doEmojiBenchmark { string }
+ }
+
+ @Test
+ fun latin() {
+ val string = "E".repeat(size)
+
+ // string is immutable
+ doEmojiBenchmark { string }
+ }
+
+ private fun doEmojiBenchmark(
+ stepFactory: () -> CharSequence
+ ) {
+ initializeEmojiCompatWithBundledForTest(replaceAll)
+ val ec = EmojiCompat.get()
+ benchmarkRule.measureRepeated {
+ val text = runWithTimingDisabled(stepFactory)
+ ec.process(text)
+ }
+ }
+
+ private fun emptyGlyphCache(text: CharSequence) {
+ if (replaceAll) return
+ // reset hasGlyph cache on all metadata returned via replaceAll
+ val allEmojiMetadata = EmojiCompat.get()
+ .process(text, 0, text.length, size, EmojiCompat.REPLACE_STRATEGY_ALL)
+ as Spanned
+ allEmojiMetadata.getSpans(0, text.length, EmojiSpan::class.java)
+ .forEach { it.metadata.resetHasGlyphCache() }
+ }
+}
\ No newline at end of file
diff --git a/emoji2/emoji2-benchmark/src/androidTest/java/androidx/emoji2/benchmark/text/EmojiSpanDrawBenchmark.kt b/emoji2/emoji2-benchmark/src/androidTest/java/androidx/emoji2/benchmark/text/EmojiSpanDrawBenchmark.kt
new file mode 100644
index 0000000..d7701c9
--- /dev/null
+++ b/emoji2/emoji2-benchmark/src/androidTest/java/androidx/emoji2/benchmark/text/EmojiSpanDrawBenchmark.kt
@@ -0,0 +1,76 @@
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * 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.
+ */
+
+package androidx.emoji2.benchmark.text
+
+import android.graphics.Bitmap
+import android.graphics.Canvas
+import android.text.Spanned
+import android.text.TextPaint
+import androidx.benchmark.junit4.BenchmarkRule
+import androidx.benchmark.junit4.measureRepeated
+import androidx.emoji2.text.EmojiCompat
+import androidx.emoji2.text.EmojiSpan
+import androidx.test.ext.junit.runners.AndroidJUnit4
+import androidx.test.filters.LargeTest
+import androidx.test.filters.SdkSuppress
+import org.junit.Rule
+import org.junit.Test
+import org.junit.runner.RunWith
+
+@RunWith(AndroidJUnit4::class)
+@LargeTest
+@SdkSuppress(minSdkVersion = 19)
+class EmojiSpanDrawBenchmark {
+
+ @get:Rule
+ val benchmarkRule = BenchmarkRule()
+
+ @Test
+ fun draw() {
+ initializeEmojiCompatWithBundledForTest(true)
+ val ec = EmojiCompat.get()
+ val polarSpanned = ec.process(POLARBEAR) as Spanned
+ val span = polarSpanned.getSpans(0, polarSpanned.length, EmojiSpan::class.java).first()
+
+ val paint = TextPaint()
+ var bitmap: Bitmap? = null
+ try {
+ bitmap = Bitmap.createBitmap(
+ 100,
+ 100,
+ Bitmap.Config.ARGB_8888
+ )
+ val canvas = Canvas(bitmap)
+
+ benchmarkRule.measureRepeated {
+ span.draw(
+ canvas,
+ polarSpanned,
+ /* start */ 0,
+ /* end */ polarSpanned.length,
+ /* x */0f,
+ /* top */ 0,
+ /* y */ 0,
+ /* bottom */ 0,
+ paint
+ )
+ }
+ } finally {
+ bitmap?.recycle()
+ }
+ }
+}
diff --git a/emoji2/emoji2-benchmark/src/androidTest/java/androidx/emoji2/benchmark/text/EmojiSpanDrawLayoutBenchmark.kt b/emoji2/emoji2-benchmark/src/androidTest/java/androidx/emoji2/benchmark/text/EmojiSpanDrawLayoutBenchmark.kt
new file mode 100644
index 0000000..84594f8
--- /dev/null
+++ b/emoji2/emoji2-benchmark/src/androidTest/java/androidx/emoji2/benchmark/text/EmojiSpanDrawLayoutBenchmark.kt
@@ -0,0 +1,93 @@
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * 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.
+ */
+
+package androidx.emoji2.benchmark.text
+
+import android.graphics.Bitmap
+import android.graphics.Canvas
+import android.text.Spanned
+import android.text.StaticLayout
+import android.text.TextPaint
+import androidx.benchmark.junit4.BenchmarkRule
+import androidx.benchmark.junit4.measureRepeated
+import androidx.emoji2.text.EmojiCompat
+import androidx.emoji2.text.EmojiSpan
+import androidx.test.filters.LargeTest
+import androidx.test.filters.SdkSuppress
+import org.junit.Assert.assertEquals
+import org.junit.Rule
+import org.junit.Test
+import org.junit.runner.RunWith
+import org.junit.runners.Parameterized
+
+@RunWith(Parameterized::class)
+@LargeTest
+@SdkSuppress(minSdkVersion = 23)
+class EmojiSpanDrawLayoutBenchmark(private val size: Int) {
+
+ @get:Rule
+ val benchmarkRule = BenchmarkRule()
+
+ companion object {
+ @Parameterized.Parameters(name = "size={0}")
+ @JvmStatic
+ fun parameters() = listOf(1, 40, 80, 120, 160, 200)
+ }
+
+ @Test
+ fun emojiSpansDraw() {
+ initializeEmojiCompatWithBundledForTest()
+ val text = EmojiCompat.get().process(POLARBEAR.repeat(size)) as? Spanned
+ ?: throw IllegalStateException("Fail the test")
+ // this assertion is just to validate we're actually benchmarking EmojiSpans
+ assertEquals(size, text.getSpans(0, text.length, EmojiSpan::class.java).size)
+ measureRepeatedDrawText(text)
+ }
+
+ @Test
+ fun emojiDraw() {
+ val emojiString = POLARBEAR.repeat(size)
+ measureRepeatedDrawText(emojiString)
+ }
+
+ @Test
+ fun latinDraw() {
+ val string = "E".repeat(size)
+
+ measureRepeatedDrawText(string)
+ }
+
+ private fun measureRepeatedDrawText(text: CharSequence) {
+ val paint = TextPaint()
+ val layout = StaticLayout.Builder
+ .obtain(text, 0, size, paint, Int.MAX_VALUE)
+ .build()
+ var bitmap: Bitmap? = null
+ try {
+ bitmap = Bitmap.createBitmap(
+ layout.getLineWidth(1).toInt() + 100,
+ 100,
+ Bitmap.Config.ARGB_8888
+ )
+ val canvas = Canvas(bitmap)
+ benchmarkRule.measureRepeated {
+ layout.draw(canvas)
+ }
+ } finally {
+ bitmap?.recycle()
+ }
+ }
+}
diff --git a/emoji2/emoji2-benchmark/src/androidTest/java/androidx/emoji2/benchmark/text/EmojiStrings.kt b/emoji2/emoji2-benchmark/src/androidTest/java/androidx/emoji2/benchmark/text/EmojiStrings.kt
new file mode 100644
index 0000000..fa6c533
--- /dev/null
+++ b/emoji2/emoji2-benchmark/src/androidTest/java/androidx/emoji2/benchmark/text/EmojiStrings.kt
@@ -0,0 +1,50 @@
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * 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.
+ */
+
+package androidx.emoji2.benchmark.text
+
+import android.content.Context
+import androidx.test.core.app.ApplicationProvider
+import java.io.BufferedReader
+import java.io.InputStreamReader
+
+const val POLARBEAR = "\uD83D\uDC3B\u200D❄️"
+private val loadedEmojiStrings: List<String> by lazy { loadEmojiStrings() }
+
+fun emojisString(size: Int) = emojisList(size).joinToString("")
+fun emojisList(size: Int) = loadedEmojiStrings.take(size)
+
+fun loadEmojiStrings(): List<String> {
+ val context = ApplicationProvider.getApplicationContext<Context>()
+ val inputStream = context.assets.open("emojis.txt")
+ val result = mutableListOf<String>()
+ return inputStream.use {
+ val reader = BufferedReader(InputStreamReader(inputStream))
+ val stringBuilder = StringBuilder()
+ reader.forEachLine {
+ val line = it.trim()
+ if (line.isEmpty() || line.startsWith("#")) return@forEachLine
+
+ stringBuilder.setLength(0)
+ line.split(" ")
+ .toTypedArray()
+ .map { intVal -> Character.toChars(intVal.toInt(16)) }
+ .forEach { charArray -> stringBuilder.append(charArray) }
+ result.add(stringBuilder.toString())
+ }
+ result
+ }
+}
\ No newline at end of file
diff --git a/emoji2/emoji2-benchmark/src/androidTest/java/androidx/emoji2/benchmark/text/InitializeEmojiCompat.kt b/emoji2/emoji2-benchmark/src/androidTest/java/androidx/emoji2/benchmark/text/InitializeEmojiCompat.kt
new file mode 100644
index 0000000..aec408a
--- /dev/null
+++ b/emoji2/emoji2-benchmark/src/androidTest/java/androidx/emoji2/benchmark/text/InitializeEmojiCompat.kt
@@ -0,0 +1,40 @@
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * 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.
+ */
+
+package androidx.emoji2.benchmark.text
+
+import android.content.Context
+import androidx.emoji2.bundled.BundledEmojiCompatConfig
+import androidx.emoji2.text.EmojiCompat
+import androidx.test.core.app.ApplicationProvider
+import java.util.concurrent.CountDownLatch
+import java.util.concurrent.TimeUnit
+
+fun initializeEmojiCompatWithBundledForTest(replaceAll: Boolean = true) {
+ val context = ApplicationProvider.getApplicationContext<Context>()
+ val config = BundledEmojiCompatConfig(context)
+ config.setMetadataLoadStrategy(EmojiCompat.LOAD_STRATEGY_MANUAL)
+ config.setReplaceAll(replaceAll)
+ val latch = CountDownLatch(1)
+ config.registerInitCallback(object : EmojiCompat.InitCallback() {
+ override fun onInitialized() {
+ super.onInitialized()
+ latch.countDown()
+ }
+ })
+ EmojiCompat.reset(config).load()
+ latch.await(2, TimeUnit.SECONDS)
+}
\ No newline at end of file
diff --git a/emoji2/emoji2-bundled/src/androidTest/java/androidx/emoji2/bundled/EmojiCompatTest.java b/emoji2/emoji2-bundled/src/androidTest/java/androidx/emoji2/bundled/EmojiCompatTest.java
index 4613036..fccf0ac 100644
--- a/emoji2/emoji2-bundled/src/androidTest/java/androidx/emoji2/bundled/EmojiCompatTest.java
+++ b/emoji2/emoji2-bundled/src/androidTest/java/androidx/emoji2/bundled/EmojiCompatTest.java
@@ -750,7 +750,7 @@
final EmojiCompat.Config config = new TestConfigBuilder.TestConfig(metadataLoader);
EmojiCompat.reset(config);
- EmojiCompat.get().updateEditorInfoAttrs(editorInfo);
+ EmojiCompat.get().updateEditorInfo(editorInfo);
final Bundle extras = editorInfo.extras;
assertFalse(extras.containsKey(EmojiCompat.EDITOR_INFO_METAVERSION_KEY));
@@ -872,7 +872,7 @@
editorInfo.extras = new Bundle();
EmojiCompat.Config config = TestConfigBuilder.config().setReplaceAll(false);
EmojiCompat.reset(config);
- EmojiCompat.get().updateEditorInfoAttrs(editorInfo);
+ EmojiCompat.get().updateEditorInfo(editorInfo);
final Bundle extras = editorInfo.extras;
assertTrue(extras.containsKey(EmojiCompat.EDITOR_INFO_METAVERSION_KEY));
@@ -882,13 +882,28 @@
config = new TestConfigBuilder.TestConfig().setReplaceAll(true);
EmojiCompat.reset(config);
- EmojiCompat.get().updateEditorInfoAttrs(editorInfo);
+ EmojiCompat.get().updateEditorInfo(editorInfo);
assertTrue(extras.containsKey(EmojiCompat.EDITOR_INFO_REPLACE_ALL_KEY));
assertTrue(extras.getBoolean(EmojiCompat.EDITOR_INFO_REPLACE_ALL_KEY));
}
@Test
+ @SdkSuppress(minSdkVersion = 19)
+ public void testUpdateEditorInfoAttrs_makesBundleIfNull() {
+ final EditorInfo editorInfo = new EditorInfo();
+ editorInfo.extras = null;
+ EmojiCompat.Config config = TestConfigBuilder.config().setReplaceAll(false);
+ EmojiCompat.reset(config);
+ EmojiCompat.get().updateEditorInfo(editorInfo);
+
+ final Bundle extras = editorInfo.extras;
+ assertTrue(extras.containsKey(EmojiCompat.EDITOR_INFO_METAVERSION_KEY));
+ assertTrue(extras.getInt(EmojiCompat.EDITOR_INFO_METAVERSION_KEY) > 0);
+ assertTrue(extras.containsKey(EmojiCompat.EDITOR_INFO_REPLACE_ALL_KEY));
+ }
+
+ @Test
@SdkSuppress(maxSdkVersion = 18)
public void testHandleDeleteSurroundingText_pre19() {
final TestString testString = new TestString(Emoji.EMOJI_SINGLE_CODEPOINT);
diff --git a/emoji2/emoji2-views-helper/src/main/java/androidx/emoji2/viewsintegration/EmojiInputConnection.java b/emoji2/emoji2-views-helper/src/main/java/androidx/emoji2/viewsintegration/EmojiInputConnection.java
index 1d5a3af..a767459 100644
--- a/emoji2/emoji2-views-helper/src/main/java/androidx/emoji2/viewsintegration/EmojiInputConnection.java
+++ b/emoji2/emoji2-views-helper/src/main/java/androidx/emoji2/viewsintegration/EmojiInputConnection.java
@@ -93,7 +93,7 @@
public void updateEditorInfoAttrs(@NonNull final EditorInfo outAttrs) {
if (EmojiCompat.isConfigured()) {
- EmojiCompat.get().updateEditorInfoAttrs(outAttrs);
+ EmojiCompat.get().updateEditorInfo(outAttrs);
}
}
}
diff --git a/emoji2/emoji2/api/current.txt b/emoji2/emoji2/api/current.txt
index f723bb9..b8f6783 100644
--- a/emoji2/emoji2/api/current.txt
+++ b/emoji2/emoji2/api/current.txt
@@ -23,6 +23,7 @@
method @CheckResult public CharSequence? process(CharSequence?, @IntRange(from=0) int, @IntRange(from=0) int, @IntRange(from=0) int, int);
method public void registerInitCallback(androidx.emoji2.text.EmojiCompat.InitCallback);
method public void unregisterInitCallback(androidx.emoji2.text.EmojiCompat.InitCallback);
+ method public void updateEditorInfo(android.view.inputmethod.EditorInfo);
field public static final String EDITOR_INFO_METAVERSION_KEY = "android.support.text.emoji.emojiCompat_metadataVersion";
field public static final String EDITOR_INFO_REPLACE_ALL_KEY = "android.support.text.emoji.emojiCompat_replaceAll";
field public static final int LOAD_STATE_DEFAULT = 3; // 0x3
diff --git a/emoji2/emoji2/api/public_plus_experimental_current.txt b/emoji2/emoji2/api/public_plus_experimental_current.txt
index f723bb9..b8f6783 100644
--- a/emoji2/emoji2/api/public_plus_experimental_current.txt
+++ b/emoji2/emoji2/api/public_plus_experimental_current.txt
@@ -23,6 +23,7 @@
method @CheckResult public CharSequence? process(CharSequence?, @IntRange(from=0) int, @IntRange(from=0) int, @IntRange(from=0) int, int);
method public void registerInitCallback(androidx.emoji2.text.EmojiCompat.InitCallback);
method public void unregisterInitCallback(androidx.emoji2.text.EmojiCompat.InitCallback);
+ method public void updateEditorInfo(android.view.inputmethod.EditorInfo);
field public static final String EDITOR_INFO_METAVERSION_KEY = "android.support.text.emoji.emojiCompat_metadataVersion";
field public static final String EDITOR_INFO_REPLACE_ALL_KEY = "android.support.text.emoji.emojiCompat_replaceAll";
field public static final int LOAD_STATE_DEFAULT = 3; // 0x3
diff --git a/emoji2/emoji2/api/restricted_current.txt b/emoji2/emoji2/api/restricted_current.txt
index f723bb9..b8f6783 100644
--- a/emoji2/emoji2/api/restricted_current.txt
+++ b/emoji2/emoji2/api/restricted_current.txt
@@ -23,6 +23,7 @@
method @CheckResult public CharSequence? process(CharSequence?, @IntRange(from=0) int, @IntRange(from=0) int, @IntRange(from=0) int, int);
method public void registerInitCallback(androidx.emoji2.text.EmojiCompat.InitCallback);
method public void unregisterInitCallback(androidx.emoji2.text.EmojiCompat.InitCallback);
+ method public void updateEditorInfo(android.view.inputmethod.EditorInfo);
field public static final String EDITOR_INFO_METAVERSION_KEY = "android.support.text.emoji.emojiCompat_metadataVersion";
field public static final String EDITOR_INFO_REPLACE_ALL_KEY = "android.support.text.emoji.emojiCompat_replaceAll";
field public static final int LOAD_STATE_DEFAULT = 3; // 0x3
diff --git a/emoji2/emoji2/src/main/java/androidx/emoji2/text/EmojiCompat.java b/emoji2/emoji2/src/main/java/androidx/emoji2/text/EmojiCompat.java
index e45f2d6..e7d350e 100644
--- a/emoji2/emoji2/src/main/java/androidx/emoji2/text/EmojiCompat.java
+++ b/emoji2/emoji2/src/main/java/androidx/emoji2/text/EmojiCompat.java
@@ -19,10 +19,12 @@
import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import static androidx.annotation.RestrictTo.Scope.TESTS;
+import android.app.Application;
import android.content.Context;
import android.graphics.Color;
import android.graphics.Paint;
import android.os.Build;
+import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.text.Editable;
@@ -56,28 +58,54 @@
/**
* Main class to keep Android devices up to date with the newest emojis by adding {@link EmojiSpan}s
- * to a given {@link CharSequence}. It is a singleton class that can be configured using a {@link
- * EmojiCompat.Config} instance.
+ * to a given {@link CharSequence}.
* <p/>
- * EmojiCompat has to be initialized using {@link #init(EmojiCompat.Config)} function before it can
- * process a {@link CharSequence}.
- * <pre><code>EmojiCompat.init(/* a config instance */);</code></pre>
+ * By default, EmojiCompat is initialized by {@link EmojiCompatInitializer}, which performs
+ * deferred font loading to avoid potential app startup delays. The default behavior is to load
+ * the font shortly after the first Activity resumes. EmojiCompatInitializer will configure
+ * EmojiCompat to use the system emoji font provider via {@link DefaultEmojiCompatConfig} and
+ * always creates a new background thread for font loading.
* <p/>
- * It is suggested to make the initialization as early as possible in your app. Please check {@link
- * EmojiCompat.Config} for more configuration parameters. Once {@link #init(EmojiCompat.Config)} is
- * called a singleton instance will be created. Any call after that will not create a new instance
- * and will return immediately.
+ * EmojiCompat will only allow one instance to be initialized and any calls to
+ * {@link #init(Config)} after the first one will have no effect. As a result, configuration options
+ * may not be provided when using {@link EmojiCompatInitializer}. To provide a custom configuration,
+ * disable {@link EmojiCompatInitializer} in the manifest with:
+ *
+ * <pre>
+ * <provider
+ * android:name="androidx.startup.InitializationProvider"
+ * android:authorities="${applicationId}.androidx-startup"
+ * android:exported="false"
+ * tools:node="merge">
+ * <meta-data android:name="androidx.emoji2.text.EmojiCompatInitializer"
+ * tools:node="remove" />
+ * </provider>
+ * </pre>
+ *
+ * When not using EmojiCompatInitializer, EmojiCompat must to be initialized manually using
+ * {@link #init(EmojiCompat.Config)}. It is recommended to make the initialization as early as
+ * possible in your app, such as from {@link Application#onCreate()}.
* <p/>
- * During initialization information about emojis is loaded on a background thread. Before the
- * EmojiCompat instance is initialized, calls to functions such as {@link
- * EmojiCompat#process(CharSequence)} will throw an exception. You can use the {@link InitCallback}
- * class to be informed about the state of initialization.
+ * {@link #init(Config)} is fast and may be called from the main thread on the path to
+ * displaying the first activity. However, loading the emoji font takes significant resources on a
+ * background thread, so it is suggested to use {@link #LOAD_STRATEGY_MANUAL} in all manual
+ * configurations to defer font loading until after the first screen displays. Font loading may
+ * be started by calling {@link #load()}}. See the implementation {@link EmojiCompatInitializer}
+ * for ideas when building a manual configuration.
* <p/>
* After initialization the {@link #get()} function can be used to get the configured instance and
* the {@link #process(CharSequence)} function can be used to update a CharSequence with emoji
* EmojiSpans.
* <p/>
* <pre><code>CharSequence processedSequence = EmojiCompat.get().process("some string")</pre>
+ * <p/>
+ * During loading information about emojis is not available. Before the
+ * EmojiCompat instance has finished loading, calls to functions such as {@link
+ * EmojiCompat#process(CharSequence)} will throw an exception. It is safe to call process when
+ * {@link #getLoadState()} returns {@link #LOAD_STATE_SUCCEEDED}. To register a callback when
+ * loading completes use {@link InitCallback}.
+ * <p/>
+
*/
@AnyThread
public class EmojiCompat {
@@ -270,6 +298,39 @@
@SuppressWarnings("WeakerAccess") /* synthetic access */
private final GlyphChecker mGlyphChecker;
+ private static final String NOT_INITIALIZED_ERROR_TEXT = "EmojiCompat is not initialized.\n"
+ + "\n"
+ + "You must initialize EmojiCompat prior to referencing the EmojiCompat instance.\n"
+ + "\n"
+ + "The most likely cause of this error is disabling the EmojiCompatInitializer\n"
+ + "either explicitly in AndroidManifest.xml, or by including\n"
+ + "androidx.emoji2:emoji2-bundled.\n"
+ + "\n"
+ + "Automatic initialization is typically performed by EmojiCompatInitializer. If\n"
+ + "you are not expecting to initialize EmojiCompat manually in your application,\n"
+ + "please check to ensure it has not been removed from your APK's manifest. You can\n"
+ + "do this in Android Studio using Build > Analyze APK.\n"
+ + "\n"
+ + "In the APK Analyzer, ensure that the startup entry for\n"
+ + "EmojiCompatInitializer and InitializationProvider is present in\n"
+ + " AndroidManifest.xml. If it is missing or contains tools:node=\"remove\", and you\n"
+ + "intend to use automatic configuration, verify:\n"
+ + "\n"
+ + " 1. Your application does not include emoji2-bundled\n"
+ + " 2. All modules do not contain an exclusion manifest rule for\n"
+ + " EmojiCompatInitializer or InitializationProvider. For more information\n"
+ + " about manifest exclusions see the documentation for the androidx startup\n"
+ + " library.\n"
+ + "\n"
+ + "If you intend to use emoji2-bundled, please call EmojiCompat.init. You can\n"
+ + "learn more in the documentation for BundledEmojiCompatConfig.\n"
+ + "\n"
+ + "If you intended to perform manual configuration, it is recommended that you call\n"
+ + "EmojiCompat.init immediately on application startup.\n"
+ + "\n"
+ + "If you still cannot resolve this issue, please open a bug with your specific\n"
+ + "configuration to help improve error message.";
+
/**
* Private constructor for singleton instance.
*
@@ -466,8 +527,7 @@
public static EmojiCompat get() {
synchronized (INSTANCE_LOCK) {
EmojiCompat localInstance = sInstance;
- Preconditions.checkState(localInstance != null,
- "EmojiCompat is not initialized. Please call EmojiCompat.init() first");
+ Preconditions.checkState(localInstance != null, NOT_INITIALIZED_ERROR_TEXT);
return localInstance;
}
}
@@ -914,20 +974,27 @@
* Updates the EditorInfo attributes in order to communicate information to Keyboards. When
* used on devices running API 18 or below, does not update EditorInfo attributes.
*
+ * This is called from EditText integrations that use EmojiEditTextHelper. Custom
+ * widgets that allow IME not subclassing EditText should call this method when creating an
+ * input connection.
+ *
+ * When EmojiCompat is not in {@link #LOAD_STATE_SUCCEEDED}, this method has no effect.
+ *
* @param outAttrs EditorInfo instance passed to
* {@link android.widget.TextView#onCreateInputConnection(EditorInfo)}
*
* @see #EDITOR_INFO_METAVERSION_KEY
* @see #EDITOR_INFO_REPLACE_ALL_KEY
- *
- * @hide
*/
- @RestrictTo(LIBRARY_GROUP)
- public void updateEditorInfoAttrs(@NonNull final EditorInfo outAttrs) {
+ public void updateEditorInfo(@NonNull final EditorInfo outAttrs) {
//noinspection ConstantConditions
- if (isInitialized() && outAttrs != null && outAttrs.extras != null) {
- mHelper.updateEditorInfoAttrs(outAttrs);
+ if (!isInitialized() || outAttrs == null) {
+ return;
}
+ if (outAttrs.extras == null) {
+ outAttrs.extras = new Bundle();
+ }
+ mHelper.updateEditorInfoAttrs(outAttrs);
}
/**
diff --git a/emoji2/emoji2/src/main/java/androidx/emoji2/text/EmojiMetadata.java b/emoji2/emoji2/src/main/java/androidx/emoji2/text/EmojiMetadata.java
index 7244296..906ee6f 100644
--- a/emoji2/emoji2/src/main/java/androidx/emoji2/text/EmojiMetadata.java
+++ b/emoji2/emoji2/src/main/java/androidx/emoji2/text/EmojiMetadata.java
@@ -16,6 +16,7 @@
package androidx.emoji2.text;
import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
+import static androidx.annotation.RestrictTo.Scope.TESTS;
import android.annotation.SuppressLint;
import android.graphics.Canvas;
@@ -190,6 +191,19 @@
}
/**
+ * Reset any cached values of hasGlyph on this metadata.
+ *
+ * This is only useful for testing EmojiMetadata, and will make the next display of this
+ * emoji slower.
+ *
+ * @hide
+ */
+ @RestrictTo(TESTS)
+ public void resetHasGlyphCache() {
+ mHasGlyph = HAS_GLYPH_UNKNOWN;
+ }
+
+ /**
* Set whether the system can render the emoji.
*
* @param hasGlyph {@code true} if system can render the emoji
diff --git a/emoji2/integration-tests/init-disabled-macrobenchmark-target/src/main/AndroidManifest.xml b/emoji2/integration-tests/init-disabled-macrobenchmark-target/src/main/AndroidManifest.xml
index cffda4d..09a6be3 100644
--- a/emoji2/integration-tests/init-disabled-macrobenchmark-target/src/main/AndroidManifest.xml
+++ b/emoji2/integration-tests/init-disabled-macrobenchmark-target/src/main/AndroidManifest.xml
@@ -26,7 +26,6 @@
tools:ignore="MissingApplicationIcon">
<!-- Profileable to enable macrobenchmark profiling -->
- <!--suppress AndroidElementNotAllowed -->
<profileable android:shell="true"/>
<!--
diff --git a/emoji2/integration-tests/init-enabled-macrobenchmark-target/src/main/AndroidManifest.xml b/emoji2/integration-tests/init-enabled-macrobenchmark-target/src/main/AndroidManifest.xml
index eff5f4c..2dfe314 100644
--- a/emoji2/integration-tests/init-enabled-macrobenchmark-target/src/main/AndroidManifest.xml
+++ b/emoji2/integration-tests/init-enabled-macrobenchmark-target/src/main/AndroidManifest.xml
@@ -26,7 +26,6 @@
tools:ignore="MissingApplicationIcon">
<!-- Profileable to enable macrobenchmark profiling -->
- <!--suppress AndroidElementNotAllowed -->
<profileable android:shell="true"/>
<!--
diff --git a/fragment/buildSrc b/fragment/buildSrc
new file mode 120000
index 0000000..053a423
--- /dev/null
+++ b/fragment/buildSrc
@@ -0,0 +1 @@
+../buildSrc
\ No newline at end of file
diff --git a/fragment/fragment-lint/src/main/java/androidx/fragment/lint/FragmentIssueRegistry.kt b/fragment/fragment-lint/src/main/java/androidx/fragment/lint/FragmentIssueRegistry.kt
index bba9973..e045232 100644
--- a/fragment/fragment-lint/src/main/java/androidx/fragment/lint/FragmentIssueRegistry.kt
+++ b/fragment/fragment-lint/src/main/java/androidx/fragment/lint/FragmentIssueRegistry.kt
@@ -24,7 +24,7 @@
*/
class FragmentIssueRegistry : IssueRegistry() {
// tests are run with this version. We ensure that with ApiLintVersionsTest
- override val api = 10
+ override val api = 11
override val minApi = CURRENT_API
override val issues get() = listOf(
FragmentTagDetector.ISSUE,
diff --git a/fragment/fragment-lint/src/main/java/androidx/fragment/lint/UseRequireInsteadOfGet.kt b/fragment/fragment-lint/src/main/java/androidx/fragment/lint/UseRequireInsteadOfGet.kt
index 5e67b91..9529d0c 100644
--- a/fragment/fragment-lint/src/main/java/androidx/fragment/lint/UseRequireInsteadOfGet.kt
+++ b/fragment/fragment-lint/src/main/java/androidx/fragment/lint/UseRequireInsteadOfGet.kt
@@ -38,6 +38,8 @@
import org.jetbrains.uast.USimpleNameReferenceExpression
import org.jetbrains.uast.getContainingUClass
import org.jetbrains.uast.kotlin.KotlinUFunctionCallExpression
+import org.jetbrains.uast.skipParenthesizedExprDown
+import org.jetbrains.uast.skipParenthesizedExprUp
import org.jetbrains.uast.toUElement
import org.jetbrains.uast.tryResolve
import java.util.Locale
@@ -103,7 +105,7 @@
/** This covers Kotlin accessor syntax expressions like "fragment.arguments" */
override fun visitSimpleNameReferenceExpression(node: USimpleNameReferenceExpression) {
- val parent = node.uastParent
+ val parent = skipParenthesizedExprUp(node.uastParent)
if (parent is UQualifiedReferenceExpression) {
checkReferenceExpression(parent, node.identifier) {
parent.receiver.getExpressionType()
@@ -157,7 +159,7 @@
) {
// Note we go up potentially two parents - the first one may just be the qualified reference expression
val nearestNonQualifiedReferenceParent =
- node.nearestNonQualifiedReferenceParent ?: return
+ skipParenthesizedExprUp(node.nearestNonQualifiedReferenceParent) ?: return
if (isKotlin && nearestNonQualifiedReferenceParent.isNullCheckBlock()) {
// We're a double-bang expression (!!)
val parentSourceToReplace =
@@ -167,17 +169,20 @@
"$targetExpression!!",
targetMethodName
)
- if (correctMethod == parentSourceToReplace) {
- correctMethod = parentSourceToReplace.replace(
- "$targetExpression?",
- "$targetExpression!!"
+ if (correctMethod == parentSourceToReplace.removeSingleParentheses()) {
+ correctMethod = parentSourceToReplace.removeSingleParentheses().replace(
+ "$targetExpression?", "$targetExpression!!"
).replaceFirstOccurrenceAfter("!!", "", "$targetExpression!!")
}
report(nearestNonQualifiedReferenceParent, parentSourceToReplace, correctMethod)
} else if (nearestNonQualifiedReferenceParent is UCallExpression) {
// See if we're in a "requireNotNull(...)" or similar expression
val enclosingMethodCall =
- nearestNonQualifiedReferenceParent.resolve() ?: return
+ (
+ skipParenthesizedExprUp(
+ nearestNonQualifiedReferenceParent
+ ) as UCallExpression
+ ).resolve() ?: return
if (enclosingMethodCall.name in KNOWN_NULLCHECKS) {
// Only match for single (specified) parameter. If existing code had a
@@ -191,7 +196,7 @@
if (singleParameterSpecified) {
// Grab the source of this argument as it's represented.
val source = nearestNonQualifiedReferenceParent.valueArguments[0]
- .asSourceString()
+ .skipParenthesizedExprDown()!!.asSourceString()
val parentToReplace =
nearestNonQualifiedReferenceParent.fullyQualifiedNearestParent()
.asSourceString()
@@ -222,7 +227,7 @@
targetExpression: String,
targetMethodName: String
): String {
- return source.replace(
+ return source.removeSingleParentheses().replace(
targetExpression,
"require${targetMethodName.removePrefix("get").capitalize(Locale.US)}()"
)
@@ -290,3 +295,8 @@
internal fun UElement.isNullCheckBlock(): Boolean {
return this is UPostfixExpression && operator.text == "!!"
}
+
+internal fun String.removeSingleParentheses(): String {
+ return this.replace("[(](?=[^)])".toRegex(), "")
+ .replace("(?<![(])[)]".toRegex(), "")
+}
diff --git a/fragment/fragment-testing-lint/src/main/java/androidx/fragment/testing/lint/FragmentTestingIssueRegistry.kt b/fragment/fragment-testing-lint/src/main/java/androidx/fragment/testing/lint/FragmentTestingIssueRegistry.kt
index 8303419..d37356a 100644
--- a/fragment/fragment-testing-lint/src/main/java/androidx/fragment/testing/lint/FragmentTestingIssueRegistry.kt
+++ b/fragment/fragment-testing-lint/src/main/java/androidx/fragment/testing/lint/FragmentTestingIssueRegistry.kt
@@ -20,7 +20,7 @@
import com.android.tools.lint.detector.api.CURRENT_API
class FragmentTestingIssueRegistry : IssueRegistry() {
- override val api = 10
+ override val api = 11
override val minApi = CURRENT_API
override val issues get() = listOf(GradleConfigurationDetector.ISSUE)
}
diff --git a/fragment/fragment/src/androidTest/java/androidx/fragment/app/FragmentReceiveResultTest.kt b/fragment/fragment/src/androidTest/java/androidx/fragment/app/FragmentReceiveResultTest.kt
index e47dfbb..df4978c 100644
--- a/fragment/fragment/src/androidTest/java/androidx/fragment/app/FragmentReceiveResultTest.kt
+++ b/fragment/fragment/src/androidTest/java/androidx/fragment/app/FragmentReceiveResultTest.kt
@@ -184,7 +184,9 @@
intent.putExtra(FragmentResultActivity.EXTRA_RESULT_CODE, resultCode)
intent.putExtra(FragmentResultActivity.EXTRA_RESULT_CONTENT, content)
- val pendingIntent = PendingIntent.getActivity(activity, requestCode, intent, 0)
+ val pendingIntent = PendingIntent.getActivity(
+ activity, requestCode, intent, PendingIntent.FLAG_IMMUTABLE
+ )
try {
fragment.startIntentSenderForResult(
diff --git a/glance/glance-appwidget/api/current.txt b/glance/glance-appwidget/api/current.txt
new file mode 100644
index 0000000..c95c400
--- /dev/null
+++ b/glance/glance-appwidget/api/current.txt
@@ -0,0 +1,11 @@
+// Signature format: 4.0
+package androidx.glance.appwidget {
+
+ public final class CoroutineBroadcastReceiverKt {
+ }
+
+ public final class RemoteViewsTranslatorKt {
+ }
+
+}
+
diff --git a/glance/glance-appwidget/api/public_plus_experimental_current.txt b/glance/glance-appwidget/api/public_plus_experimental_current.txt
new file mode 100644
index 0000000..c95c400
--- /dev/null
+++ b/glance/glance-appwidget/api/public_plus_experimental_current.txt
@@ -0,0 +1,11 @@
+// Signature format: 4.0
+package androidx.glance.appwidget {
+
+ public final class CoroutineBroadcastReceiverKt {
+ }
+
+ public final class RemoteViewsTranslatorKt {
+ }
+
+}
+
diff --git a/appsearch/debug-view/api/res-current.txt b/glance/glance-appwidget/api/res-current.txt
similarity index 100%
copy from appsearch/debug-view/api/res-current.txt
copy to glance/glance-appwidget/api/res-current.txt
diff --git a/glance/glance-appwidget/api/restricted_current.txt b/glance/glance-appwidget/api/restricted_current.txt
new file mode 100644
index 0000000..c95c400
--- /dev/null
+++ b/glance/glance-appwidget/api/restricted_current.txt
@@ -0,0 +1,11 @@
+// Signature format: 4.0
+package androidx.glance.appwidget {
+
+ public final class CoroutineBroadcastReceiverKt {
+ }
+
+ public final class RemoteViewsTranslatorKt {
+ }
+
+}
+
diff --git a/glance/glance-appwidget/build.gradle b/glance/glance-appwidget/build.gradle
new file mode 100644
index 0000000..136e1ef
--- /dev/null
+++ b/glance/glance-appwidget/build.gradle
@@ -0,0 +1,68 @@
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * 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.
+ */
+
+import androidx.build.LibraryGroups
+import androidx.build.LibraryType
+import androidx.build.Publish
+import androidx.build.RunApiTasks
+import androidx.build.AndroidXComposePlugin
+
+plugins {
+ id("AndroidXPlugin")
+ id("com.android.library")
+ id("AndroidXComposePlugin")
+}
+
+// Disable multi-platform; this will only be used on Android.
+AndroidXComposePlugin.applyAndConfigureKotlinPlugin(project, /* isMultiplatformEnabled= */false)
+
+dependencies {
+ implementation project(path: ':annotation:annotation')
+ kotlinPlugin(project(":compose:compiler:compiler"))
+
+ api(project(":glance:glance"))
+ api("androidx.annotation:annotation:1.1.0")
+
+ implementation(libs.kotlinStdlib)
+ implementation(project(":compose:runtime:runtime"))
+
+ testImplementation(libs.testRules)
+ testImplementation(libs.testRunner)
+ testImplementation(libs.junit)
+ testImplementation(libs.testCore)
+ testImplementation(libs.truth)
+ testImplementation(libs.robolectric)
+ testImplementation(libs.kotlinCoroutinesTest)
+}
+
+android {
+ defaultConfig {
+ minSdkVersion 23
+ }
+ // Use Robolectric 4.+
+ testOptions.unitTests.includeAndroidResources = true
+}
+
+androidx {
+ name = "Glance For App Widgets"
+ type = LibraryType.PUBLISHED_LIBRARY
+ publish = Publish.NONE
+ mavenGroup = LibraryGroups.GLANCE
+ inceptionYear = "2021"
+ description = "Glance-appwidgets allows developers to build layouts for Android AppWidgets " +
+ "using a Jetpack Compose-style API."
+ targetsJavaConsumers = false
+}
diff --git a/glance/glance-appwidget/src/androidMain/AndroidManifest.xml b/glance/glance-appwidget/src/androidMain/AndroidManifest.xml
new file mode 100644
index 0000000..d3cb1fc
--- /dev/null
+++ b/glance/glance-appwidget/src/androidMain/AndroidManifest.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright 2021 The Android Open Source Project
+
+ 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.
+ -->
+<manifest package="androidx.glance.appwidget" />
diff --git a/glance/glance-appwidget/src/androidMain/kotlin/androidx/glance/appwidget/CoroutineBroadcastReceiver.kt b/glance/glance-appwidget/src/androidMain/kotlin/androidx/glance/appwidget/CoroutineBroadcastReceiver.kt
new file mode 100644
index 0000000..aa10381
--- /dev/null
+++ b/glance/glance-appwidget/src/androidMain/kotlin/androidx/glance/appwidget/CoroutineBroadcastReceiver.kt
@@ -0,0 +1,48 @@
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * 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.
+ */
+
+package androidx.glance.appwidget
+
+import android.content.BroadcastReceiver
+import kotlinx.coroutines.CoroutineScope
+import kotlinx.coroutines.Dispatchers
+import kotlinx.coroutines.SupervisorJob
+import kotlinx.coroutines.cancel
+import kotlinx.coroutines.launch
+import kotlin.coroutines.CoroutineContext
+
+/**
+ * Execute the block asynchronously in a scope with the lifetime of the broadcast.
+ *
+ * The coroutine scope will finish once the block return, as the broadcast will finish at that
+ * point too, allowing the system to kill the broadcast.
+ */
+internal fun BroadcastReceiver.goAsync(
+ coroutineContext: CoroutineContext = Dispatchers.Default,
+ block: suspend CoroutineScope.() -> Unit,
+) {
+ val coroutineScope = CoroutineScope(SupervisorJob() + coroutineContext)
+ val pendingResult = goAsync()
+
+ coroutineScope.launch {
+ try {
+ block()
+ } finally {
+ pendingResult.finish()
+ coroutineScope.cancel()
+ }
+ }
+}
\ No newline at end of file
diff --git a/glance/glance-appwidget/src/androidMain/kotlin/androidx/glance/appwidget/RemoteViewsRoot.kt b/glance/glance-appwidget/src/androidMain/kotlin/androidx/glance/appwidget/RemoteViewsRoot.kt
new file mode 100644
index 0000000..40eab01
--- /dev/null
+++ b/glance/glance-appwidget/src/androidMain/kotlin/androidx/glance/appwidget/RemoteViewsRoot.kt
@@ -0,0 +1,30 @@
+@file:OptIn(GlanceInternalApi::class)
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * 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.
+ */
+
+package androidx.glance.appwidget
+
+import androidx.glance.EmittableWithChildren
+import androidx.glance.GlanceInternalApi
+import androidx.glance.Modifier
+
+/**
+ * Root view, with a maximum depth. No default value is specified, as the exact value depends on
+ * specific circumstances.
+ */
+internal class RemoteViewsRoot(maxDepth: Int) : EmittableWithChildren(maxDepth) {
+ override var modifier: Modifier = Modifier
+}
diff --git a/glance/glance-appwidget/src/androidMain/kotlin/androidx/glance/appwidget/RemoteViewsTranslator.kt b/glance/glance-appwidget/src/androidMain/kotlin/androidx/glance/appwidget/RemoteViewsTranslator.kt
new file mode 100644
index 0000000..bad1551
--- /dev/null
+++ b/glance/glance-appwidget/src/androidMain/kotlin/androidx/glance/appwidget/RemoteViewsTranslator.kt
@@ -0,0 +1,110 @@
+@file:OptIn(GlanceInternalApi::class)
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * 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.
+ */
+
+package androidx.glance.appwidget
+
+import android.content.Context
+import android.content.res.Resources
+import android.util.DisplayMetrics
+import android.util.TypedValue
+import android.view.Gravity
+import android.view.View
+import android.widget.RemoteViews
+import androidx.annotation.LayoutRes
+import androidx.glance.Emittable
+import androidx.glance.GlanceInternalApi
+import androidx.glance.Modifier
+import androidx.glance.layout.Alignment
+import androidx.glance.layout.EmittableBox
+import androidx.glance.layout.PaddingModifier
+import androidx.glance.unit.Dp
+import kotlin.math.floor
+
+private fun Alignment.Horizontal.toGravity(): Int =
+ when (this) {
+ Alignment.Horizontal.Start -> Gravity.START
+ Alignment.Horizontal.End -> Gravity.END
+ Alignment.Horizontal.CenterHorizontally -> Gravity.CENTER_HORIZONTAL
+ else -> throw IllegalArgumentException("Unknown horizontal alignment: $this")
+ }
+
+private fun Alignment.Vertical.toGravity(): Int =
+ when (this) {
+ Alignment.Vertical.Top -> Gravity.TOP
+ Alignment.Vertical.Bottom -> Gravity.BOTTOM
+ Alignment.Vertical.CenterVertically -> Gravity.CENTER_VERTICAL
+ else -> throw IllegalArgumentException("Unknown vertical alignment: $this")
+ }
+
+private fun Alignment.toGravity() = horizontal.toGravity() or vertical.toGravity()
+
+private fun applyPadding(
+ rv: RemoteViews,
+ modifier: PaddingModifier,
+ resources: Resources
+) {
+ val displayMetrics = resources.displayMetrics
+ val isRtl = modifier.rtlAware &&
+ resources.configuration.layoutDirection == View.LAYOUT_DIRECTION_RTL
+ val start = dpToPixel(modifier.start, displayMetrics)
+ val end = dpToPixel(modifier.end, displayMetrics)
+ rv.setViewPadding(
+ R.id.glanceView,
+ if (isRtl) end else start,
+ dpToPixel(modifier.top, displayMetrics),
+ if (isRtl) start else end,
+ dpToPixel(modifier.bottom, displayMetrics),
+ )
+}
+
+private fun applyModifiers(context: Context, rv: RemoteViews, modifiers: Modifier) {
+ modifiers.foldOut(Unit) { modifier, _ ->
+ when (modifier) {
+ is PaddingModifier -> applyPadding(rv, modifier, context.resources)
+ }
+ }
+}
+
+private fun translateEmittableBox(context: Context, element: EmittableBox): RemoteViews =
+ remoteViews(context, R.layout.box_layout)
+ .also { rv ->
+ rv.setInt(R.id.glanceView, "setGravity", element.contentAlignment.toGravity())
+ applyModifiers(context, rv, element.modifier)
+ element.children.forEach {
+ rv.addView(R.id.glanceView, translateChild(context, it))
+ }
+ }
+
+private fun translateChild(context: Context, element: Emittable): RemoteViews {
+ return when (element) {
+ is EmittableBox -> translateEmittableBox(context, element)
+ else -> throw IllegalArgumentException("Unknown element type ${element::javaClass}")
+ }
+}
+
+private fun dpToPixel(dp: Dp, displayMetrics: DisplayMetrics) =
+ floor(TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dp.value, displayMetrics)).toInt()
+
+private fun remoteViews(context: Context, @LayoutRes layoutId: Int) =
+ RemoteViews(context.packageName, layoutId)
+
+internal fun translateComposition(context: Context, element: RemoteViewsRoot): RemoteViews {
+ if (element.children.size == 1) {
+ return translateChild(context, element.children[0])
+ }
+ return translateChild(context, EmittableBox().also { it.children.addAll(element.children) })
+}
diff --git a/glance/glance-appwidget/src/androidMain/res/layout/box_layout.xml b/glance/glance-appwidget/src/androidMain/res/layout/box_layout.xml
new file mode 100644
index 0000000..27a0ae1
--- /dev/null
+++ b/glance/glance-appwidget/src/androidMain/res/layout/box_layout.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?><!--
+ Copyright 2021 The Android Open Source Project
+
+ 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.
+ -->
+
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@id/glanceView"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent" />
diff --git a/glance/glance-appwidget/src/androidMain/res/values/ids.xml b/glance/glance-appwidget/src/androidMain/res/values/ids.xml
new file mode 100644
index 0000000..ddee48c
--- /dev/null
+++ b/glance/glance-appwidget/src/androidMain/res/values/ids.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?><!--
+ Copyright 2021 The Android Open Source Project
+
+ 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.
+ -->
+
+<resources>
+ <id name="glanceView"/>
+</resources>
\ No newline at end of file
diff --git a/glance/glance-appwidget/src/test/kotlin/androidx/glance/appwidget/CoroutineBroadcastReceiverTest.kt b/glance/glance-appwidget/src/test/kotlin/androidx/glance/appwidget/CoroutineBroadcastReceiverTest.kt
new file mode 100644
index 0000000..a5589ee
--- /dev/null
+++ b/glance/glance-appwidget/src/test/kotlin/androidx/glance/appwidget/CoroutineBroadcastReceiverTest.kt
@@ -0,0 +1,93 @@
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * 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.
+ */
+
+package androidx.glance.appwidget
+
+import android.content.BroadcastReceiver
+import android.content.Context
+import android.content.Intent
+import android.content.IntentFilter
+import android.os.Looper.getMainLooper
+import androidx.glance.GlanceInternalApi
+import androidx.test.core.app.ApplicationProvider
+import androidx.test.filters.MediumTest
+import com.google.common.truth.Truth.assertThat
+import com.google.common.truth.Truth.assertWithMessage
+import kotlinx.coroutines.CancellationException
+import kotlinx.coroutines.awaitCancellation
+import kotlinx.coroutines.launch
+import org.junit.Test
+import org.junit.runner.RunWith
+import org.robolectric.RobolectricTestRunner
+import org.robolectric.Shadows.shadowOf
+import java.util.concurrent.CountDownLatch
+import java.util.concurrent.TimeUnit
+import java.util.concurrent.atomic.AtomicReference
+
+@OptIn(GlanceInternalApi::class)
+@RunWith(RobolectricTestRunner::class)
+class CoroutineBroadcastReceiverTest {
+
+ private val context = ApplicationProvider.getApplicationContext<Context>()
+
+ private class TestBroadcast : BroadcastReceiver() {
+ val extraValue = AtomicReference("")
+ val broadcastExecuted = CountDownLatch(1)
+ val scopeCancelled = CountDownLatch(1)
+
+ override fun onReceive(context: Context, intent: Intent) {
+ goAsync {
+ extraValue.set(intent.getStringExtra(EXTRA_STRING))
+ launch {
+ try {
+ awaitCancellation()
+ } catch (ex: CancellationException) {
+ scopeCancelled.countDown()
+ throw ex
+ }
+ }
+ broadcastExecuted.countDown()
+ }
+ }
+ }
+
+ @MediumTest
+ @Test
+ fun onReceive() {
+ val broadcastReceiver = TestBroadcast()
+ context.registerReceiver(
+ broadcastReceiver,
+ IntentFilter(BROADCAST_ACTION)
+ )
+
+ val value = "value"
+ context.sendBroadcast(Intent(BROADCAST_ACTION).putExtra(EXTRA_STRING, value))
+ shadowOf(getMainLooper()).idle()
+
+ assertWithMessage("Broadcast receiver did not execute")
+ .that(broadcastReceiver.broadcastExecuted.await(1, TimeUnit.SECONDS))
+ .isTrue()
+ assertWithMessage("Coroutine scope did not get cancelled")
+ .that(broadcastReceiver.scopeCancelled.await(1, TimeUnit.SECONDS))
+ .isTrue()
+ assertThat(broadcastReceiver.extraValue.get()).isEqualTo(value)
+ }
+
+ private companion object {
+ const val BROADCAST_ACTION = "androidx.glance.appwidget.utils.TEST_ACTION"
+ const val EXTRA_STRING = "extra_string"
+ }
+}
\ No newline at end of file
diff --git a/glance/glance-appwidget/src/test/kotlin/androidx/glance/appwidget/RemoteViewsTranslatorKtTest.kt b/glance/glance-appwidget/src/test/kotlin/androidx/glance/appwidget/RemoteViewsTranslatorKtTest.kt
new file mode 100644
index 0000000..8b971c6
--- /dev/null
+++ b/glance/glance-appwidget/src/test/kotlin/androidx/glance/appwidget/RemoteViewsTranslatorKtTest.kt
@@ -0,0 +1,213 @@
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * 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.
+ */
+
+package androidx.glance.appwidget
+
+import android.content.Context
+import android.content.res.Configuration
+import android.text.TextUtils
+import android.util.TypedValue
+import android.view.Gravity
+import android.view.View
+import android.widget.FrameLayout
+import android.widget.RelativeLayout
+import android.widget.RemoteViews
+import androidx.compose.runtime.Composable
+import androidx.glance.GlanceInternalApi
+import androidx.glance.Modifier
+import androidx.glance.layout.Alignment
+import androidx.glance.layout.Box
+import androidx.glance.layout.absolutePadding
+import androidx.glance.layout.padding
+import androidx.glance.unit.Dp
+import androidx.glance.unit.dp
+import androidx.test.core.app.ApplicationProvider
+import com.google.common.truth.Truth.assertThat
+import kotlinx.coroutines.ExperimentalCoroutinesApi
+import kotlinx.coroutines.test.TestCoroutineScope
+import kotlinx.coroutines.test.runBlockingTest
+import org.junit.Before
+import org.junit.Test
+import org.junit.runner.RunWith
+import org.robolectric.RobolectricTestRunner
+import java.util.Locale
+import kotlin.math.floor
+
+@OptIn(GlanceInternalApi::class, ExperimentalCoroutinesApi::class)
+@RunWith(RobolectricTestRunner::class)
+class RemoteViewsTranslatorKtTest {
+
+ private lateinit var fakeCoroutineScope: TestCoroutineScope
+ private val context = ApplicationProvider.getApplicationContext<Context>()
+ private val displayMetrics = context.resources.displayMetrics
+
+ @Before
+ fun setUp() {
+ fakeCoroutineScope = TestCoroutineScope()
+ }
+
+ @Test
+ fun canTranslateBox() = fakeCoroutineScope.runBlockingTest {
+ val rv = runAndTranslate { Box {} }
+ val view = applyRemoteViews(rv)
+
+ assertThat(view).isInstanceOf(RelativeLayout::class.java)
+ require(view is RelativeLayout)
+ assertThat(view.childCount).isEqualTo(0)
+ }
+
+ @Test
+ fun canTranslateBoxWithAlignment() = fakeCoroutineScope.runBlockingTest {
+ val rv = runAndTranslate {
+ Box(contentAlignment = Alignment.BottomEnd) { }
+ }
+ val view = applyRemoteViews(rv)
+
+ assertThat(view).isInstanceOf(RelativeLayout::class.java)
+ require(view is RelativeLayout)
+ assertThat(view.gravity).isEqualTo(Gravity.BOTTOM or Gravity.END)
+ }
+
+ @Test
+ fun canTranslateBoxWithChildren() = fakeCoroutineScope.runBlockingTest {
+ val rv = runAndTranslate {
+ Box {
+ Box(contentAlignment = Alignment.Center) {}
+ Box(contentAlignment = Alignment.BottomEnd) {}
+ }
+ }
+ val view = applyRemoteViews(rv)
+
+ assertThat(view).isInstanceOf(RelativeLayout::class.java)
+ require(view is RelativeLayout)
+ assertThat(view.childCount).isEqualTo(2)
+ assertThat(view.getChildAt(0)).isInstanceOf(RelativeLayout::class.java)
+ assertThat(view.getChildAt(1)).isInstanceOf(RelativeLayout::class.java)
+ val child1 = view.getChildAt(0) as RelativeLayout
+ assertThat(child1.gravity).isEqualTo(Gravity.CENTER)
+ val child2 = view.getChildAt(1) as RelativeLayout
+ assertThat(child2.gravity).isEqualTo(Gravity.BOTTOM or Gravity.END)
+ }
+
+ @Test
+ fun canTranslateMultipleNodes() = fakeCoroutineScope.runBlockingTest {
+ val rv = runAndTranslate {
+ Box(contentAlignment = Alignment.Center) {}
+ Box(contentAlignment = Alignment.BottomEnd) {}
+ }
+ val view = applyRemoteViews(rv)
+
+ assertThat(view).isInstanceOf(RelativeLayout::class.java)
+ require(view is RelativeLayout)
+ assertThat(view.childCount).isEqualTo(2)
+ assertThat(view.getChildAt(0)).isInstanceOf(RelativeLayout::class.java)
+ assertThat(view.getChildAt(1)).isInstanceOf(RelativeLayout::class.java)
+ val child1 = view.getChildAt(0) as RelativeLayout
+ assertThat(child1.gravity).isEqualTo(Gravity.CENTER)
+ val child2 = view.getChildAt(1) as RelativeLayout
+ assertThat(child2.gravity).isEqualTo(Gravity.BOTTOM or Gravity.END)
+ }
+
+ @Test
+ fun canTranslatePaddingModifier() = fakeCoroutineScope.runBlockingTest {
+ val rv = runAndTranslate {
+ Box(
+ modifier = Modifier.padding(
+ start = 4.dp,
+ end = 5.dp,
+ top = 6.dp,
+ bottom = 7.dp,
+ )
+ ) { }
+ }
+ val view = applyRemoteViews(rv)
+
+ assertThat(view).isInstanceOf(RelativeLayout::class.java)
+ assertThat(view.paddingLeft).isEqualTo(dpToPixel(4.dp))
+ assertThat(view.paddingRight).isEqualTo(dpToPixel(5.dp))
+ assertThat(view.paddingTop).isEqualTo(dpToPixel(6.dp))
+ assertThat(view.paddingBottom).isEqualTo(dpToPixel(7.dp))
+ }
+
+ @Test
+ fun canTranslatePaddingRTL() = fakeCoroutineScope.runBlockingTest {
+ val rv = runAndTranslateInRtl {
+ Box(
+ modifier = Modifier.padding(
+ start = 4.dp,
+ end = 5.dp,
+ top = 6.dp,
+ bottom = 7.dp,
+ )
+ ) { }
+ }
+ val view = applyRemoteViews(rv)
+
+ assertThat(view).isInstanceOf(RelativeLayout::class.java)
+ assertThat(view.paddingLeft).isEqualTo(dpToPixel(5.dp))
+ assertThat(view.paddingRight).isEqualTo(dpToPixel(4.dp))
+ assertThat(view.paddingTop).isEqualTo(dpToPixel(6.dp))
+ assertThat(view.paddingBottom).isEqualTo(dpToPixel(7.dp))
+ }
+
+ @Test
+ fun canTranslateAbsolutePaddingRTL() = fakeCoroutineScope.runBlockingTest {
+ val rv = runAndTranslateInRtl {
+ Box(
+ modifier = Modifier.absolutePadding(
+ left = 4.dp,
+ right = 5.dp,
+ top = 6.dp,
+ bottom = 7.dp,
+ )
+ ) { }
+ }
+ val view = applyRemoteViews(rv)
+
+ assertThat(view).isInstanceOf(RelativeLayout::class.java)
+ assertThat(view.paddingLeft).isEqualTo(dpToPixel(4.dp))
+ assertThat(view.paddingRight).isEqualTo(dpToPixel(5.dp))
+ assertThat(view.paddingTop).isEqualTo(dpToPixel(6.dp))
+ assertThat(view.paddingBottom).isEqualTo(dpToPixel(7.dp))
+ }
+
+ private suspend fun runAndTranslate(
+ context: Context = this.context,
+ content: @Composable () -> Unit
+ ): RemoteViews {
+ val root = runTestingComposition(content)
+ return translateComposition(context, root)
+ }
+
+ private suspend fun runAndTranslateInRtl(content: @Composable () -> Unit): RemoteViews {
+ val rtlLocale = Locale.getAvailableLocales().first {
+ TextUtils.getLayoutDirectionFromLocale(it) == View.LAYOUT_DIRECTION_RTL
+ }
+ val rtlContext = context.createConfigurationContext(
+ Configuration(context.resources.configuration).also {
+ it.setLayoutDirection(rtlLocale)
+ }
+ )
+ return runAndTranslate(rtlContext, content)
+ }
+
+ private fun applyRemoteViews(rv: RemoteViews) =
+ rv.apply(context, FrameLayout(context))
+
+ private fun dpToPixel(dp: Dp) =
+ floor(TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dp.value, displayMetrics))
+ .toInt()
+}
\ No newline at end of file
diff --git a/glance/glance-appwidget/src/test/kotlin/androidx/glance/appwidget/Utils.kt b/glance/glance-appwidget/src/test/kotlin/androidx/glance/appwidget/Utils.kt
new file mode 100644
index 0000000..3e4cd69
--- /dev/null
+++ b/glance/glance-appwidget/src/test/kotlin/androidx/glance/appwidget/Utils.kt
@@ -0,0 +1,46 @@
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * 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.
+ */
+
+package androidx.glance.appwidget
+
+import androidx.compose.runtime.BroadcastFrameClock
+import androidx.compose.runtime.Composable
+import androidx.compose.runtime.Composition
+import androidx.compose.runtime.Recomposer
+import androidx.glance.Applier
+import androidx.glance.GlanceInternalApi
+import kotlinx.coroutines.coroutineScope
+import kotlinx.coroutines.currentCoroutineContext
+import kotlinx.coroutines.launch
+
+@OptIn(GlanceInternalApi::class)
+internal suspend fun runTestingComposition(content: @Composable () -> Unit): RemoteViewsRoot =
+ coroutineScope {
+ val root = RemoteViewsRoot(10)
+ val applier = Applier(root)
+ val recomposer = Recomposer(currentCoroutineContext())
+ val composition = Composition(applier, recomposer)
+ val frameClock = BroadcastFrameClock()
+
+ composition.setContent { content() }
+
+ launch(frameClock) { recomposer.runRecomposeAndApplyChanges() }
+
+ recomposer.close()
+ recomposer.join()
+
+ root
+ }
diff --git a/glance/glance-appwidget/src/test/resources/robolectric.properties b/glance/glance-appwidget/src/test/resources/robolectric.properties
new file mode 100644
index 0000000..ab64ba7
--- /dev/null
+++ b/glance/glance-appwidget/src/test/resources/robolectric.properties
@@ -0,0 +1,3 @@
+# Robolectric currently doesn't support API 31, so we have to explicitly specify 30 as the target
+# sdk for now. Remove when no longer necessary.
+sdk=30
diff --git a/glance/glance-wear/api/current.txt b/glance/glance-wear/api/current.txt
new file mode 100644
index 0000000..7fcdb4e
--- /dev/null
+++ b/glance/glance-wear/api/current.txt
@@ -0,0 +1,16 @@
+// Signature format: 4.0
+package androidx.glance.wear {
+
+ public final class WearCompositionTranslatorKt {
+ }
+
+}
+
+package androidx.glance.wear.layout {
+
+ public final class BackgroundKt {
+ method public static androidx.glance.Modifier background(androidx.glance.Modifier, int color);
+ }
+
+}
+
diff --git a/glance/glance-wear/api/public_plus_experimental_current.txt b/glance/glance-wear/api/public_plus_experimental_current.txt
new file mode 100644
index 0000000..7fcdb4e
--- /dev/null
+++ b/glance/glance-wear/api/public_plus_experimental_current.txt
@@ -0,0 +1,16 @@
+// Signature format: 4.0
+package androidx.glance.wear {
+
+ public final class WearCompositionTranslatorKt {
+ }
+
+}
+
+package androidx.glance.wear.layout {
+
+ public final class BackgroundKt {
+ method public static androidx.glance.Modifier background(androidx.glance.Modifier, int color);
+ }
+
+}
+
diff --git a/work/workmanager/api/res-current.txt b/glance/glance-wear/api/res-current.txt
similarity index 100%
copy from work/workmanager/api/res-current.txt
copy to glance/glance-wear/api/res-current.txt
diff --git a/glance/glance-wear/api/restricted_current.txt b/glance/glance-wear/api/restricted_current.txt
new file mode 100644
index 0000000..7fcdb4e
--- /dev/null
+++ b/glance/glance-wear/api/restricted_current.txt
@@ -0,0 +1,16 @@
+// Signature format: 4.0
+package androidx.glance.wear {
+
+ public final class WearCompositionTranslatorKt {
+ }
+
+}
+
+package androidx.glance.wear.layout {
+
+ public final class BackgroundKt {
+ method public static androidx.glance.Modifier background(androidx.glance.Modifier, int color);
+ }
+
+}
+
diff --git a/glance/glance-wear/build.gradle b/glance/glance-wear/build.gradle
new file mode 100644
index 0000000..335d2ea
--- /dev/null
+++ b/glance/glance-wear/build.gradle
@@ -0,0 +1,65 @@
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * 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.
+ */
+
+import androidx.build.LibraryGroups
+import androidx.build.LibraryType
+import androidx.build.Publish
+import androidx.build.RunApiTasks
+import androidx.build.AndroidXComposePlugin
+
+plugins {
+ id("AndroidXPlugin")
+ id("com.android.library")
+ id("AndroidXComposePlugin")
+}
+
+// Disable multi-platform; this will only be used on Android.
+AndroidXComposePlugin.applyAndConfigureKotlinPlugin(project, /* isMultiplatformEnabled= */false)
+
+dependencies {
+ kotlinPlugin(project(":compose:compiler:compiler"))
+
+ api(project(":glance:glance"))
+ api(project(":wear:tiles:tiles"))
+
+ implementation(libs.kotlinStdlib)
+ implementation(project(":compose:runtime:runtime"))
+
+ testImplementation(libs.testRules)
+ testImplementation(libs.testRunner)
+ testImplementation(libs.truth)
+ testImplementation(libs.junit)
+ testImplementation(libs.kotlinCoroutinesTest)
+}
+
+android {
+ defaultConfig {
+ minSdkVersion 26
+ }
+ // Use Robolectric 4.+
+ testOptions.unitTests.includeAndroidResources = true
+}
+
+androidx {
+ name = "Glance for Wear Tiles"
+ type = LibraryType.PUBLISHED_LIBRARY
+ publish = Publish.NONE
+ mavenGroup = LibraryGroups.GLANCE
+ inceptionYear = "2021"
+ description = "Glance allows developers to build layouts for Wear Tiles using a Jetpack " +
+ "Compose-style API."
+ targetsJavaConsumers = false
+}
diff --git a/glance/glance-wear/src/androidMain/AndroidManifest.xml b/glance/glance-wear/src/androidMain/AndroidManifest.xml
new file mode 100644
index 0000000..c6a7dbc
--- /dev/null
+++ b/glance/glance-wear/src/androidMain/AndroidManifest.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright 2021 The Android Open Source Project
+
+ 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.
+ -->
+<manifest package="androidx.glance.wear" />
diff --git a/glance/glance-wear/src/androidMain/kotlin/androidx/glance/wear/WearCompositionTranslator.kt b/glance/glance-wear/src/androidMain/kotlin/androidx/glance/wear/WearCompositionTranslator.kt
new file mode 100644
index 0000000..0b522aa
--- /dev/null
+++ b/glance/glance-wear/src/androidMain/kotlin/androidx/glance/wear/WearCompositionTranslator.kt
@@ -0,0 +1,187 @@
+@file:OptIn(GlanceInternalApi::class)
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * 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.
+ */
+
+package androidx.glance.wear
+
+import androidx.glance.Emittable
+import androidx.glance.GlanceInternalApi
+import androidx.glance.Modifier
+import androidx.glance.findModifier
+import androidx.glance.layout.Alignment
+import androidx.glance.layout.Dimension
+import androidx.glance.layout.EmittableBox
+import androidx.glance.layout.EmittableColumn
+import androidx.glance.layout.EmittableRow
+import androidx.glance.layout.HeightModifier
+import androidx.glance.layout.PaddingModifier
+import androidx.glance.layout.WidthModifier
+import androidx.glance.wear.layout.BackgroundModifier
+import androidx.wear.tiles.ColorBuilders.argb
+import androidx.wear.tiles.DimensionBuilders
+import androidx.wear.tiles.DimensionBuilders.dp
+import androidx.wear.tiles.DimensionBuilders.expand
+import androidx.wear.tiles.DimensionBuilders.wrap
+import androidx.wear.tiles.LayoutElementBuilders
+import androidx.wear.tiles.LayoutElementBuilders.HORIZONTAL_ALIGN_CENTER
+import androidx.wear.tiles.LayoutElementBuilders.HORIZONTAL_ALIGN_END
+import androidx.wear.tiles.LayoutElementBuilders.HORIZONTAL_ALIGN_START
+import androidx.wear.tiles.LayoutElementBuilders.HorizontalAlignment
+import androidx.wear.tiles.LayoutElementBuilders.VERTICAL_ALIGN_BOTTOM
+import androidx.wear.tiles.LayoutElementBuilders.VERTICAL_ALIGN_CENTER
+import androidx.wear.tiles.LayoutElementBuilders.VERTICAL_ALIGN_TOP
+import androidx.wear.tiles.LayoutElementBuilders.VerticalAlignment
+import androidx.wear.tiles.ModifiersBuilders
+
+@VerticalAlignment
+private fun Alignment.Vertical.toProto(): Int =
+ when (this) {
+ Alignment.Vertical.Top -> VERTICAL_ALIGN_TOP
+ Alignment.Vertical.CenterVertically -> VERTICAL_ALIGN_CENTER
+ Alignment.Vertical.Bottom -> VERTICAL_ALIGN_BOTTOM
+ else -> throw IllegalArgumentException("Unknown vertical alignment type $this")
+ }
+
+@HorizontalAlignment
+private fun Alignment.Horizontal.toProto(): Int =
+ when (this) {
+ Alignment.Horizontal.Start -> HORIZONTAL_ALIGN_START
+ Alignment.Horizontal.CenterHorizontally -> HORIZONTAL_ALIGN_CENTER
+ Alignment.Horizontal.End -> HORIZONTAL_ALIGN_END
+ else -> throw IllegalArgumentException("Unknown horizontal alignment type $this")
+ }
+
+private fun PaddingModifier.toProto(): ModifiersBuilders.Padding =
+ ModifiersBuilders.Padding.Builder()
+ .setStart(dp(this.start.value))
+ .setTop(dp(this.top.value))
+ .setEnd(dp(this.end.value))
+ .setBottom(dp(this.bottom.value))
+ .setRtlAware(this.rtlAware)
+ .build()
+
+private fun BackgroundModifier.toProto(): ModifiersBuilders.Background =
+ ModifiersBuilders.Background.Builder()
+ .setColor(argb(this.color.value.toInt()))
+ .build()
+
+private fun Dimension.toContainerDimension(): DimensionBuilders.ContainerDimension =
+ when (this) {
+ is Dimension.Wrap -> wrap()
+ is Dimension.Expand -> expand()
+ is Dimension.Dp -> dp(this.dp.value)
+ }
+
+private fun Modifier.getWidth(
+ default: Dimension = Dimension.Wrap
+): Dimension = findModifier<WidthModifier>()?.width ?: default
+
+private fun Modifier.getHeight(
+ default: Dimension = Dimension.Wrap
+): Dimension = findModifier<HeightModifier>()?.height ?: default
+
+private fun translateEmittableBox(element: EmittableBox) = LayoutElementBuilders.Box.Builder()
+ .setVerticalAlignment(element.contentAlignment.vertical.toProto())
+ .setHorizontalAlignment(element.contentAlignment.horizontal.toProto())
+ .setModifiers(translateModifiers(element.modifier))
+ .setWidth(element.modifier.getWidth().toContainerDimension())
+ .setHeight(element.modifier.getHeight().toContainerDimension())
+ .also { box -> element.children.forEach { box.addContent(translateComposition(it)) } }
+ .build()
+
+private fun translateEmittableRow(element: EmittableRow): LayoutElementBuilders.LayoutElement {
+ val width = element.modifier.getWidth()
+ val height = element.modifier.getHeight()
+
+ val baseRowBuilder = LayoutElementBuilders.Row.Builder()
+ .setHeight(height.toContainerDimension())
+ .setVerticalAlignment(element.verticalAlignment.toProto())
+ .also { row -> element.children.forEach { row.addContent(translateComposition(it)) } }
+
+ // Do we need to wrap it in a column to set the horizontal alignment?
+ return if (element.horizontalAlignment != Alignment.Horizontal.Start &&
+ width !is Dimension.Wrap
+ ) {
+ LayoutElementBuilders.Column.Builder()
+ .setHorizontalAlignment(element.horizontalAlignment.toProto())
+ .setModifiers(translateModifiers(element.modifier))
+ .setWidth(width.toContainerDimension())
+ .setHeight(height.toContainerDimension())
+ .addContent(baseRowBuilder.setWidth(wrap()).build())
+ .build()
+ } else {
+ baseRowBuilder
+ .setModifiers(translateModifiers(element.modifier))
+ .setWidth(width.toContainerDimension())
+ .build()
+ }
+}
+
+private fun translateEmittableColumn(
+ element: EmittableColumn
+): LayoutElementBuilders.LayoutElement {
+ val width = element.modifier.getWidth()
+ val height = element.modifier.getHeight()
+
+ val baseColumnBuilder = LayoutElementBuilders.Column.Builder()
+ .setWidth(width.toContainerDimension())
+ .setHorizontalAlignment(element.horizontalAlignment.toProto())
+ .also { column -> element.children.forEach { column.addContent(translateComposition(it)) } }
+
+ // Do we need to wrap it in a row to set the vertical alignment?
+ return if (element.verticalAlignment != Alignment.Vertical.Top &&
+ height !is Dimension.Wrap
+ ) {
+ LayoutElementBuilders.Row.Builder()
+ .setVerticalAlignment(element.verticalAlignment.toProto())
+ .setModifiers(translateModifiers(element.modifier))
+ .setWidth(width.toContainerDimension())
+ .setHeight(height.toContainerDimension())
+ .addContent(baseColumnBuilder.setHeight(wrap()).build())
+ .build()
+ } else {
+ baseColumnBuilder
+ .setModifiers(translateModifiers(element.modifier))
+ .setHeight(height.toContainerDimension())
+ .build()
+ }
+}
+
+private fun translateModifiers(modifier: Modifier): ModifiersBuilders.Modifiers = modifier
+ .foldOut(ModifiersBuilders.Modifiers.Builder()) { element, builder ->
+ when (element) {
+ is PaddingModifier -> builder.setPadding(element.toProto())
+ is BackgroundModifier -> builder.setBackground(element.toProto())
+ is WidthModifier -> builder /* Skip for now, handled elsewhere. */
+ is HeightModifier -> builder /* Skip for now, handled elsewhere. */
+ else -> throw IllegalArgumentException("Unknown modifier type")
+ }
+ }.build()
+
+/**
+ * Translates a Glance Composition to a Wear Tile.
+ *
+ * @throws IllegalArgumentException If the provided Emittable is not recognised (e.g. it is an
+ * element which this translator doesn't understand).
+ */
+internal fun translateComposition(element: Emittable): LayoutElementBuilders.LayoutElement {
+ return when (element) {
+ is EmittableBox -> translateEmittableBox(element)
+ is EmittableRow -> translateEmittableRow(element)
+ is EmittableColumn -> translateEmittableColumn(element)
+ else -> throw IllegalArgumentException("Unknown element $element")
+ }
+}
diff --git a/glance/glance-wear/src/androidMain/kotlin/androidx/glance/wear/layout/Background.kt b/glance/glance-wear/src/androidMain/kotlin/androidx/glance/wear/layout/Background.kt
new file mode 100644
index 0000000..2a76d45
--- /dev/null
+++ b/glance/glance-wear/src/androidMain/kotlin/androidx/glance/wear/layout/Background.kt
@@ -0,0 +1,31 @@
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * 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.
+ */
+
+package androidx.glance.wear.layout
+
+import androidx.glance.Modifier
+import androidx.glance.unit.Color
+
+internal class BackgroundModifier(public val color: Color) : Modifier.Element {
+ override fun toString(): String = "BackgroundModifier(color=$color)"
+}
+
+/**
+ * Apply a background color to the element this modifier is attached to. This will cause the
+ * element to paint the specified [Color] as its background, which will fill the bounds of the
+ * element.
+ */
+public fun Modifier.background(color: Color): Modifier = this.then(BackgroundModifier(color))
diff --git a/glance/glance-wear/src/test/kotlin/androidx/glance/wear/Utils.kt b/glance/glance-wear/src/test/kotlin/androidx/glance/wear/Utils.kt
new file mode 100644
index 0000000..75b2c03
--- /dev/null
+++ b/glance/glance-wear/src/test/kotlin/androidx/glance/wear/Utils.kt
@@ -0,0 +1,46 @@
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * 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.
+ */
+
+package androidx.glance.wear
+
+import androidx.compose.runtime.BroadcastFrameClock
+import androidx.compose.runtime.Composable
+import androidx.compose.runtime.Composition
+import androidx.compose.runtime.Recomposer
+import androidx.glance.Applier
+import androidx.glance.GlanceInternalApi
+import androidx.glance.layout.EmittableBox
+import kotlinx.coroutines.coroutineScope
+import kotlinx.coroutines.currentCoroutineContext
+import kotlinx.coroutines.launch
+
+@OptIn(GlanceInternalApi::class)
+suspend fun runTestingComposition(content: @Composable () -> Unit): EmittableBox = coroutineScope {
+ val root = EmittableBox()
+ val applier = Applier(root)
+ val recomposer = Recomposer(currentCoroutineContext())
+ val composition = Composition(applier, recomposer)
+ val frameClock = BroadcastFrameClock()
+
+ composition.setContent { content() }
+
+ launch(frameClock) { recomposer.runRecomposeAndApplyChanges() }
+
+ recomposer.close()
+ recomposer.join()
+
+ root
+}
diff --git a/glance/glance-wear/src/test/kotlin/androidx/glance/wear/WearCompositionTranslatorTest.kt b/glance/glance-wear/src/test/kotlin/androidx/glance/wear/WearCompositionTranslatorTest.kt
new file mode 100644
index 0000000..a428694
--- /dev/null
+++ b/glance/glance-wear/src/test/kotlin/androidx/glance/wear/WearCompositionTranslatorTest.kt
@@ -0,0 +1,264 @@
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * 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.
+ */
+
+package androidx.glance.wear
+
+import androidx.compose.runtime.Composable
+import androidx.glance.GlanceInternalApi
+import androidx.glance.Modifier
+import androidx.glance.layout.Alignment
+import androidx.glance.layout.Box
+import androidx.glance.layout.Column
+import androidx.glance.layout.Row
+import androidx.glance.layout.expandHeight
+import androidx.glance.layout.expandWidth
+import androidx.glance.layout.height
+import androidx.glance.layout.padding
+import androidx.glance.layout.width
+import androidx.glance.unit.Color
+import androidx.glance.unit.dp
+import androidx.glance.wear.layout.background
+import androidx.wear.tiles.DimensionBuilders
+import androidx.wear.tiles.LayoutElementBuilders
+import androidx.wear.tiles.LayoutElementBuilders.HORIZONTAL_ALIGN_CENTER
+import androidx.wear.tiles.LayoutElementBuilders.HORIZONTAL_ALIGN_END
+import androidx.wear.tiles.LayoutElementBuilders.VERTICAL_ALIGN_BOTTOM
+import androidx.wear.tiles.LayoutElementBuilders.VERTICAL_ALIGN_CENTER
+import androidx.wear.tiles.LayoutElementBuilders.VERTICAL_ALIGN_TOP
+import com.google.common.truth.Truth.assertThat
+import kotlinx.coroutines.ExperimentalCoroutinesApi
+import kotlinx.coroutines.test.TestCoroutineScope
+import kotlinx.coroutines.test.runBlockingTest
+import org.junit.Before
+import org.junit.Test
+
+@OptIn(GlanceInternalApi::class, ExperimentalCoroutinesApi::class)
+class WearCompositionTranslatorTest {
+ private lateinit var fakeCoroutineScope: TestCoroutineScope
+
+ @Before
+ fun setUp() {
+ fakeCoroutineScope = TestCoroutineScope()
+ }
+
+ @Test
+ fun canTranslateBox() = fakeCoroutineScope.runBlockingTest {
+ val content = runAndTranslate {
+ Box {}
+ }
+
+ // runAndTranslate wraps the result in a Box...ensure that the layout generated two Boxes
+ val outerBox = content as LayoutElementBuilders.Box
+ assertThat(outerBox.contents).hasSize(1)
+
+ assertThat(outerBox.contents[0]).isInstanceOf(LayoutElementBuilders.Box::class.java)
+ }
+
+ @Test
+ fun canTranslateBoxWithAlignment() = fakeCoroutineScope.runBlockingTest {
+ val content = runAndTranslate {
+ Box(contentAlignment = Alignment.Center) {}
+ }
+
+ val innerBox =
+ (content as LayoutElementBuilders.Box).contents[0] as LayoutElementBuilders.Box
+
+ assertThat(innerBox.verticalAlignment!!.value).isEqualTo(VERTICAL_ALIGN_CENTER)
+ assertThat(innerBox.horizontalAlignment!!.value).isEqualTo(HORIZONTAL_ALIGN_CENTER)
+ }
+
+ @Test
+ fun canTranslateBoxWithChildren() = fakeCoroutineScope.runBlockingTest {
+ val content = runAndTranslate {
+ Box {
+ Box(contentAlignment = Alignment.TopCenter) {}
+ Box(contentAlignment = Alignment.BottomEnd) {}
+ }
+ }
+
+ val innerBox =
+ (content as LayoutElementBuilders.Box).contents[0] as LayoutElementBuilders.Box
+ val leaf0 = innerBox.contents[0] as LayoutElementBuilders.Box
+ val leaf1 = innerBox.contents[1] as LayoutElementBuilders.Box
+
+ assertThat(leaf0.verticalAlignment!!.value).isEqualTo(VERTICAL_ALIGN_TOP)
+ assertThat(leaf0.horizontalAlignment!!.value).isEqualTo(HORIZONTAL_ALIGN_CENTER)
+
+ assertThat(leaf1.verticalAlignment!!.value).isEqualTo(VERTICAL_ALIGN_BOTTOM)
+ assertThat(leaf1.horizontalAlignment!!.value).isEqualTo(HORIZONTAL_ALIGN_END)
+ }
+
+ @Test
+ fun canTranslatePaddingModifier() = fakeCoroutineScope.runBlockingTest {
+ val content = runAndTranslate {
+ Box(modifier = Modifier.padding(start = 1.dp, top = 2.dp, end = 3.dp, bottom = 4.dp)) {}
+ }
+
+ val innerBox =
+ (content as LayoutElementBuilders.Box).contents[0] as LayoutElementBuilders.Box
+ val padding = requireNotNull(innerBox.modifiers!!.padding)
+
+ assertThat(padding.start!!.value).isEqualTo(1f)
+ assertThat(padding.top!!.value).isEqualTo(2f)
+ assertThat(padding.end!!.value).isEqualTo(3f)
+ assertThat(padding.bottom!!.value).isEqualTo(4f)
+ }
+
+ @Test
+ fun canTranslateBackgroundModifier() = fakeCoroutineScope.runBlockingTest {
+ val content = runAndTranslate {
+ Box(modifier = Modifier.background(Color(0x11223344))) {}
+ }
+
+ val innerBox =
+ (content as LayoutElementBuilders.Box).contents[0] as LayoutElementBuilders.Box
+ val background = requireNotNull(innerBox.modifiers!!.background)
+
+ assertThat(background.color!!.argb).isEqualTo(0x11223344)
+ }
+
+ @Test
+ fun canTranslateRow() = fakeCoroutineScope.runBlockingTest {
+ val content = runAndTranslate {
+ Row(verticalAlignment = Alignment.Vertical.CenterVertically) {
+ Box(contentAlignment = Alignment.TopCenter) {}
+ Box(contentAlignment = Alignment.BottomEnd) {}
+ }
+ }
+
+ val innerRow =
+ (content as LayoutElementBuilders.Box).contents[0] as LayoutElementBuilders.Row
+
+ assertThat(innerRow.verticalAlignment!!.value).isEqualTo(VERTICAL_ALIGN_CENTER)
+
+ val leaf0 = innerRow.contents[0] as LayoutElementBuilders.Box
+ val leaf1 = innerRow.contents[1] as LayoutElementBuilders.Box
+
+ assertThat(leaf0.verticalAlignment!!.value).isEqualTo(VERTICAL_ALIGN_TOP)
+ assertThat(leaf0.horizontalAlignment!!.value).isEqualTo(HORIZONTAL_ALIGN_CENTER)
+
+ assertThat(leaf1.verticalAlignment!!.value).isEqualTo(VERTICAL_ALIGN_BOTTOM)
+ assertThat(leaf1.horizontalAlignment!!.value).isEqualTo(HORIZONTAL_ALIGN_END)
+ }
+
+ @Test
+ fun rowWithHorizontalAlignmentInflatesInColumn() = fakeCoroutineScope.runBlockingTest {
+ val content = runAndTranslate {
+ Row(
+ verticalAlignment = Alignment.Vertical.CenterVertically,
+ horizontalAlignment = Alignment.Horizontal.CenterHorizontally,
+ modifier = Modifier.expandWidth().height(100.dp).background(Color(0x11223344))
+ ) {}
+ }
+
+ val innerColumn =
+ (content as LayoutElementBuilders.Box).contents[0] as LayoutElementBuilders.Column
+ val innerRow = innerColumn.contents[0] as LayoutElementBuilders.Row
+
+ assertThat(innerColumn.horizontalAlignment!!.value).isEqualTo(HORIZONTAL_ALIGN_CENTER)
+
+ // Column should inherit the size of the inner Row
+ assertThat(innerColumn.width).isInstanceOf(
+ DimensionBuilders.ExpandedDimensionProp::class.java
+ )
+ assertThat((innerColumn.height as DimensionBuilders.DpProp).value).isEqualTo(100f)
+
+ // Column should also inherit the modifiers
+ assertThat(innerColumn.modifiers!!.background!!.color!!.argb).isEqualTo(0x11223344)
+
+ // The row should have a wrapped width, but still use the height
+ assertThat(innerRow.width).isInstanceOf(
+ DimensionBuilders.WrappedDimensionProp::class.java
+ )
+ assertThat((innerRow.height as DimensionBuilders.DpProp).value).isEqualTo(100f)
+
+ // And no modifiers.
+ assertThat(innerRow.modifiers).isNull()
+
+ // Should have the vertical alignment set still though
+ assertThat(innerRow.verticalAlignment!!.value).isEqualTo(VERTICAL_ALIGN_CENTER)
+ }
+
+ @Test
+ fun canTranslateColumn() = fakeCoroutineScope.runBlockingTest {
+ val content = runAndTranslate {
+ Column(horizontalAlignment = Alignment.Horizontal.CenterHorizontally) {
+ Box(contentAlignment = Alignment.TopCenter) {}
+ Box(contentAlignment = Alignment.BottomEnd) {}
+ }
+ }
+
+ val innerColumn =
+ (content as LayoutElementBuilders.Box).contents[0] as LayoutElementBuilders.Column
+
+ assertThat(innerColumn.horizontalAlignment!!.value).isEqualTo(HORIZONTAL_ALIGN_CENTER)
+
+ val leaf0 = innerColumn.contents[0] as LayoutElementBuilders.Box
+ val leaf1 = innerColumn.contents[1] as LayoutElementBuilders.Box
+
+ assertThat(leaf0.verticalAlignment!!.value).isEqualTo(VERTICAL_ALIGN_TOP)
+ assertThat(leaf0.horizontalAlignment!!.value).isEqualTo(HORIZONTAL_ALIGN_CENTER)
+
+ assertThat(leaf1.verticalAlignment!!.value).isEqualTo(VERTICAL_ALIGN_BOTTOM)
+ assertThat(leaf1.horizontalAlignment!!.value).isEqualTo(HORIZONTAL_ALIGN_END)
+ }
+
+ @Test
+ fun columnWithVerticalAlignmentInflatesInRow() = fakeCoroutineScope.runBlockingTest {
+ val content = runAndTranslate {
+ Column(
+ verticalAlignment = Alignment.Vertical.CenterVertically,
+ horizontalAlignment = Alignment.Horizontal.CenterHorizontally,
+ modifier = Modifier.expandHeight().width(100.dp).background(Color(0x11223344))
+ ) {}
+ }
+
+ val innerRow =
+ (content as LayoutElementBuilders.Box).contents[0] as LayoutElementBuilders.Row
+ val innerColumn = innerRow.contents[0] as LayoutElementBuilders.Column
+
+ assertThat(innerRow.verticalAlignment!!.value).isEqualTo(VERTICAL_ALIGN_CENTER)
+
+ // Row should inherit the size of the inner Row
+ assertThat((innerRow.width as DimensionBuilders.DpProp).value).isEqualTo(100f)
+ assertThat(innerRow.height).isInstanceOf(
+ DimensionBuilders.ExpandedDimensionProp::class.java
+ )
+
+ // Row should also inherit the modifiers
+ assertThat(innerRow.modifiers!!.background!!.color!!.argb).isEqualTo(0x11223344)
+
+ // The Column should have a wrapped width, but still use the height
+ assertThat((innerColumn.width as DimensionBuilders.DpProp).value).isEqualTo(100f)
+ assertThat(innerColumn.height).isInstanceOf(
+ DimensionBuilders.WrappedDimensionProp::class.java
+ )
+
+ // And no modifiers.
+ assertThat(innerColumn.modifiers).isNull()
+
+ // Should have the horizontal alignment set still though
+ assertThat(innerColumn.horizontalAlignment!!.value).isEqualTo(HORIZONTAL_ALIGN_CENTER)
+ }
+
+ private suspend fun runAndTranslate(
+ content: @Composable () -> Unit
+ ): LayoutElementBuilders.LayoutElement {
+ val root = runTestingComposition(content)
+
+ return translateComposition(root)
+ }
+}
\ No newline at end of file
diff --git a/glance/glance-wear/src/test/kotlin/androidx/glance/wear/layout/BackgroundTest.kt b/glance/glance-wear/src/test/kotlin/androidx/glance/wear/layout/BackgroundTest.kt
new file mode 100644
index 0000000..44ade66
--- /dev/null
+++ b/glance/glance-wear/src/test/kotlin/androidx/glance/wear/layout/BackgroundTest.kt
@@ -0,0 +1,36 @@
+@file:OptIn(GlanceInternalApi::class)
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * 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.
+ */
+
+package androidx.glance.wear.layout
+
+import androidx.glance.GlanceInternalApi
+import androidx.glance.Modifier
+import androidx.glance.findModifier
+import androidx.glance.unit.Color
+import com.google.common.truth.Truth.assertThat
+import org.junit.Test
+
+class BackgroundTest {
+ @Test
+ fun canUseBackgroundModifier() {
+ val modifier = Modifier.background(color = Color(0xFF223344u))
+
+ val addedModifier = requireNotNull(modifier.findModifier<BackgroundModifier>())
+
+ assertThat(addedModifier.color.value).isEqualTo(0xFF223344u)
+ }
+}
diff --git a/glance/glance/api/current.txt b/glance/glance/api/current.txt
new file mode 100644
index 0000000..2fd4d39
--- /dev/null
+++ b/glance/glance/api/current.txt
@@ -0,0 +1,301 @@
+// Signature format: 4.0
+package androidx.glance {
+
+ public final class CombinedModifier implements androidx.glance.Modifier {
+ ctor public CombinedModifier(androidx.glance.Modifier outer, androidx.glance.Modifier inner);
+ method public boolean all(kotlin.jvm.functions.Function1<? super androidx.glance.Modifier.Element,java.lang.Boolean> predicate);
+ method public boolean any(kotlin.jvm.functions.Function1<? super androidx.glance.Modifier.Element,java.lang.Boolean> predicate);
+ method public <R> R! foldIn(R? initial, kotlin.jvm.functions.Function2<? super R,? super androidx.glance.Modifier.Element,? extends R> operation);
+ method public <R> R! foldOut(R? initial, kotlin.jvm.functions.Function2<? super androidx.glance.Modifier.Element,? super R,? extends R> operation);
+ }
+
+ @androidx.compose.runtime.Stable public interface Modifier {
+ method public boolean all(kotlin.jvm.functions.Function1<? super androidx.glance.Modifier.Element,java.lang.Boolean> predicate);
+ method public boolean any(kotlin.jvm.functions.Function1<? super androidx.glance.Modifier.Element,java.lang.Boolean> predicate);
+ method public <R> R! foldIn(R? initial, kotlin.jvm.functions.Function2<? super R,? super androidx.glance.Modifier.Element,? extends R> operation);
+ method public <R> R! foldOut(R? initial, kotlin.jvm.functions.Function2<? super androidx.glance.Modifier.Element,? super R,? extends R> operation);
+ method public default infix androidx.glance.Modifier then(androidx.glance.Modifier other);
+ field public static final androidx.glance.Modifier.Companion Companion;
+ }
+
+ public static final class Modifier.Companion implements androidx.glance.Modifier {
+ method public boolean all(kotlin.jvm.functions.Function1<? super androidx.glance.Modifier.Element,java.lang.Boolean> predicate);
+ method public boolean any(kotlin.jvm.functions.Function1<? super androidx.glance.Modifier.Element,java.lang.Boolean> predicate);
+ method public <R> R! foldIn(R? initial, kotlin.jvm.functions.Function2<? super R,? super androidx.glance.Modifier.Element,? extends R> operation);
+ method public <R> R! foldOut(R? initial, kotlin.jvm.functions.Function2<? super androidx.glance.Modifier.Element,? super R,? extends R> operation);
+ }
+
+ public static interface Modifier.Element extends androidx.glance.Modifier {
+ method public default boolean all(kotlin.jvm.functions.Function1<? super androidx.glance.Modifier.Element,java.lang.Boolean> predicate);
+ method public default boolean any(kotlin.jvm.functions.Function1<? super androidx.glance.Modifier.Element,java.lang.Boolean> predicate);
+ method public default <R> R! foldIn(R? initial, kotlin.jvm.functions.Function2<? super R,? super androidx.glance.Modifier.Element,? extends R> operation);
+ method public default <R> R! foldOut(R? initial, kotlin.jvm.functions.Function2<? super androidx.glance.Modifier.Element,? super R,? extends R> operation);
+ }
+
+ public final class UtilsKt {
+ }
+
+}
+
+package androidx.glance.layout {
+
+ public final class Alignment {
+ ctor public Alignment(int horizontal, int vertical);
+ method public int getHorizontal();
+ method public int getVertical();
+ property public final int horizontal;
+ property public final int vertical;
+ field public static final androidx.glance.layout.Alignment.Companion Companion;
+ }
+
+ public static final class Alignment.Companion {
+ method public int getBottom();
+ method public androidx.glance.layout.Alignment getBottomCenter();
+ method public androidx.glance.layout.Alignment getBottomEnd();
+ method public androidx.glance.layout.Alignment getBottomStart();
+ method public androidx.glance.layout.Alignment getCenter();
+ method public androidx.glance.layout.Alignment getCenterEnd();
+ method public int getCenterHorizontally();
+ method public androidx.glance.layout.Alignment getCenterStart();
+ method public int getCenterVertically();
+ method public int getEnd();
+ method public int getStart();
+ method public int getTop();
+ method public androidx.glance.layout.Alignment getTopCenter();
+ method public androidx.glance.layout.Alignment getTopEnd();
+ method public androidx.glance.layout.Alignment getTopStart();
+ property public final int Bottom;
+ property public final androidx.glance.layout.Alignment BottomCenter;
+ property public final androidx.glance.layout.Alignment BottomEnd;
+ property public final androidx.glance.layout.Alignment BottomStart;
+ property public final androidx.glance.layout.Alignment Center;
+ property public final androidx.glance.layout.Alignment CenterEnd;
+ property public final int CenterHorizontally;
+ property public final androidx.glance.layout.Alignment CenterStart;
+ property public final int CenterVertically;
+ property public final int End;
+ property public final int Start;
+ property public final int Top;
+ property public final androidx.glance.layout.Alignment TopCenter;
+ property public final androidx.glance.layout.Alignment TopEnd;
+ property public final androidx.glance.layout.Alignment TopStart;
+ }
+
+ public static final inline class Alignment.Horizontal {
+ ctor public Alignment.Horizontal();
+ }
+
+ public static final class Alignment.Horizontal.Companion {
+ method public int getCenterHorizontally();
+ method public int getEnd();
+ method public int getStart();
+ property public final int CenterHorizontally;
+ property public final int End;
+ property public final int Start;
+ }
+
+ public static final inline class Alignment.Vertical {
+ ctor public Alignment.Vertical();
+ }
+
+ public static final class Alignment.Vertical.Companion {
+ method public int getBottom();
+ method public int getCenterVertically();
+ method public int getTop();
+ property public final int Bottom;
+ property public final int CenterVertically;
+ property public final int Top;
+ }
+
+ public final class BoxKt {
+ method @androidx.compose.runtime.Composable public static void Box(optional androidx.glance.Modifier modifier, optional androidx.glance.layout.Alignment contentAlignment, kotlin.jvm.functions.Function0<kotlin.Unit> content);
+ }
+
+ public final class ColumnKt {
+ method @androidx.compose.runtime.Composable public static void Column(optional androidx.glance.Modifier modifier, optional int verticalAlignment, optional int horizontalAlignment, kotlin.jvm.functions.Function0<kotlin.Unit> content);
+ }
+
+ public final class DimensionKt {
+ method public static androidx.glance.Modifier expandHeight(androidx.glance.Modifier);
+ method public static androidx.glance.Modifier expandWidth(androidx.glance.Modifier);
+ method public static androidx.glance.Modifier height(androidx.glance.Modifier, float height);
+ method public static androidx.glance.Modifier size(androidx.glance.Modifier, float size);
+ method public static androidx.glance.Modifier size(androidx.glance.Modifier, float width, float height);
+ method public static androidx.glance.Modifier width(androidx.glance.Modifier, float width);
+ method public static androidx.glance.Modifier wrapHeight(androidx.glance.Modifier);
+ method public static androidx.glance.Modifier wrapWidth(androidx.glance.Modifier);
+ }
+
+ public final inline class FontStyle {
+ ctor public FontStyle();
+ }
+
+ public static final class FontStyle.Companion {
+ method public int getItalic();
+ method public int getNormal();
+ method public java.util.List<androidx.glance.layout.FontStyle> values();
+ property public final int Italic;
+ property public final int Normal;
+ }
+
+ public final inline class FontWeight {
+ ctor public FontWeight();
+ }
+
+ public static final class FontWeight.Companion {
+ method public int getBold();
+ method public int getMedium();
+ method public int getNormal();
+ property public final int Bold;
+ property public final int Medium;
+ property public final int Normal;
+ }
+
+ public final class PaddingKt {
+ method public static androidx.glance.Modifier absolutePadding(androidx.glance.Modifier, optional float left, optional float top, optional float right, optional float bottom);
+ method public static androidx.glance.Modifier padding(androidx.glance.Modifier, optional float start, optional float top, optional float end, optional float bottom);
+ method public static androidx.glance.Modifier padding(androidx.glance.Modifier, optional float horizontal, optional float vertical);
+ method public static androidx.glance.Modifier padding(androidx.glance.Modifier, float all);
+ }
+
+ public final class RowKt {
+ method @androidx.compose.runtime.Composable public static void Row(optional androidx.glance.Modifier modifier, optional int horizontalAlignment, optional int verticalAlignment, kotlin.jvm.functions.Function0<kotlin.Unit> content);
+ }
+
+ public final inline class TextDecoration {
+ ctor public TextDecoration();
+ }
+
+ public static final class TextDecoration.Companion {
+ method public int combine(java.util.List<androidx.glance.layout.TextDecoration> decorations);
+ method public int getLineThrough();
+ method public int getNone();
+ method public int getUnderline();
+ property public final int LineThrough;
+ property public final int None;
+ property public final int Underline;
+ }
+
+ public final class TextKt {
+ method @androidx.compose.runtime.Composable public static void Text(String text, optional androidx.glance.Modifier modifier, optional androidx.glance.layout.TextStyle? style);
+ }
+
+ @androidx.compose.runtime.Immutable public final class TextStyle {
+ ctor public TextStyle(optional androidx.glance.unit.Sp? size, optional androidx.glance.layout.FontWeight? fontWeight, optional androidx.glance.layout.FontStyle? fontStyle, optional androidx.glance.layout.TextDecoration? textDecoration);
+ method public androidx.glance.layout.FontStyle? getFontStyle();
+ method public androidx.glance.layout.FontWeight? getFontWeight();
+ method public androidx.glance.unit.Sp? getSize();
+ method public androidx.glance.layout.TextDecoration? getTextDecoration();
+ property public final androidx.glance.layout.FontStyle? fontStyle;
+ property public final androidx.glance.layout.FontWeight? fontWeight;
+ property public final androidx.glance.unit.Sp? size;
+ property public final androidx.glance.layout.TextDecoration? textDecoration;
+ }
+
+}
+
+package androidx.glance.unit {
+
+ public final inline class Color {
+ ctor public Color();
+ method public int getValue();
+ property public final int value;
+ }
+
+ public static final class Color.Companion {
+ method public int getBlack();
+ method public int getBlue();
+ method public int getCyan();
+ method public int getDarkGray();
+ method public int getGray();
+ method public int getGreen();
+ method public int getLightGray();
+ method public int getMagenta();
+ method public int getRed();
+ method public int getTransparent();
+ method public int getWhite();
+ method public int getYellow();
+ property public final int Black;
+ property public final int Blue;
+ property public final int Cyan;
+ property public final int DarkGray;
+ property public final int Gray;
+ property public final int Green;
+ property public final int LightGray;
+ property public final int Magenta;
+ property public final int Red;
+ property public final int Transparent;
+ property public final int White;
+ property public final int Yellow;
+ }
+
+ public final class ColorKt {
+ method @androidx.compose.runtime.Stable public static int Color(float red, float green, float blue, optional float alpha);
+ }
+
+ public final inline class Dp implements java.lang.Comparable<androidx.glance.unit.Dp> {
+ ctor public Dp();
+ method public operator int compareTo(float other);
+ method public float getValue();
+ property public final float value;
+ }
+
+ public final class DpKt {
+ method public static inline float getDp(int);
+ method public static inline float getDp(double);
+ method public static inline float getDp(float);
+ method public static float max(float a, float b);
+ method public static float min(float a, float b);
+ method public static operator float times(float, float other);
+ method public static operator float times(double, float other);
+ method public static operator float times(int, float other);
+ }
+
+ @androidx.compose.runtime.Immutable public final class DpSize {
+ ctor public DpSize(float width, float height);
+ method @androidx.compose.runtime.Stable public operator float component1();
+ method @androidx.compose.runtime.Stable public operator float component2();
+ method public androidx.glance.unit.DpSize copy(optional float width, optional float height);
+ method @androidx.compose.runtime.Stable public operator androidx.glance.unit.DpSize div(int other);
+ method @androidx.compose.runtime.Stable public operator androidx.glance.unit.DpSize div(float other);
+ method public float getHeight();
+ method public float getWidth();
+ method @androidx.compose.runtime.Stable public operator androidx.glance.unit.DpSize minus(androidx.glance.unit.DpSize other);
+ method @androidx.compose.runtime.Stable public operator androidx.glance.unit.DpSize plus(androidx.glance.unit.DpSize other);
+ method @androidx.compose.runtime.Stable public operator androidx.glance.unit.DpSize times(int other);
+ method @androidx.compose.runtime.Stable public operator androidx.glance.unit.DpSize times(float other);
+ property public final float height;
+ property public final float width;
+ field public static final androidx.glance.unit.DpSize.Companion Companion;
+ }
+
+ public static final class DpSize.Companion {
+ method public androidx.glance.unit.DpSize getZero();
+ property public final androidx.glance.unit.DpSize Zero;
+ }
+
+ public final class DpSizeKt {
+ method @androidx.compose.runtime.Stable public static operator androidx.glance.unit.DpSize times(int, androidx.glance.unit.DpSize size);
+ method @androidx.compose.runtime.Stable public static operator androidx.glance.unit.DpSize times(float, androidx.glance.unit.DpSize size);
+ }
+
+ public final inline class Sp implements java.lang.Comparable<androidx.glance.unit.Sp> {
+ ctor public Sp();
+ method public operator int compareTo(float other);
+ method public float getValue();
+ property public final float value;
+ }
+
+ public final class SpKt {
+ method public static inline float getSp(int);
+ method public static inline float getSp(double);
+ method public static inline float getSp(float);
+ method public static float max(float a, float b);
+ method public static float min(float a, float b);
+ method public static operator float times(float, float other);
+ method public static operator float times(double, float other);
+ method public static operator float times(int, float other);
+ }
+
+}
+
diff --git a/glance/glance/api/public_plus_experimental_current.txt b/glance/glance/api/public_plus_experimental_current.txt
new file mode 100644
index 0000000..88fb690
--- /dev/null
+++ b/glance/glance/api/public_plus_experimental_current.txt
@@ -0,0 +1,419 @@
+// Signature format: 4.0
+package androidx.glance {
+
+ @androidx.glance.GlanceInternalApi public final class Applier extends androidx.compose.runtime.AbstractApplier<androidx.glance.Emittable> {
+ ctor public Applier(androidx.glance.EmittableWithChildren root);
+ method public void insertBottomUp(int index, androidx.glance.Emittable instance);
+ method public void insertTopDown(int index, androidx.glance.Emittable instance);
+ method public void move(int from, int to, int count);
+ method protected void onClear();
+ method public void remove(int index, int count);
+ }
+
+ public final class CombinedModifier implements androidx.glance.Modifier {
+ ctor public CombinedModifier(androidx.glance.Modifier outer, androidx.glance.Modifier inner);
+ method public boolean all(kotlin.jvm.functions.Function1<? super androidx.glance.Modifier.Element,java.lang.Boolean> predicate);
+ method public boolean any(kotlin.jvm.functions.Function1<? super androidx.glance.Modifier.Element,java.lang.Boolean> predicate);
+ method public <R> R! foldIn(R? initial, kotlin.jvm.functions.Function2<? super R,? super androidx.glance.Modifier.Element,? extends R> operation);
+ method public <R> R! foldOut(R? initial, kotlin.jvm.functions.Function2<? super androidx.glance.Modifier.Element,? super R,? extends R> operation);
+ }
+
+ @androidx.glance.GlanceInternalApi public interface Emittable {
+ method public androidx.glance.Modifier getModifier();
+ method public void setModifier(androidx.glance.Modifier modifier);
+ property public abstract androidx.glance.Modifier modifier;
+ }
+
+ @androidx.glance.GlanceInternalApi public abstract class EmittableWithChildren implements androidx.glance.Emittable {
+ ctor public EmittableWithChildren(optional int maxDepth);
+ method protected final String childrenToString();
+ method public final java.util.List<androidx.glance.Emittable> getChildren();
+ property public final java.util.List<androidx.glance.Emittable> children;
+ }
+
+ @kotlin.RequiresOptIn(message="This API is used for the implementation of androidx.glance, and should " + "not be used by API consumers.") @kotlin.annotation.Retention(kotlin.annotation.AnnotationRetention) @kotlin.annotation.Target(allowedTargets={kotlin.annotation.AnnotationTarget, kotlin.annotation.AnnotationTarget}) public @interface GlanceInternalApi {
+ }
+
+ @androidx.compose.runtime.Stable public interface Modifier {
+ method public boolean all(kotlin.jvm.functions.Function1<? super androidx.glance.Modifier.Element,java.lang.Boolean> predicate);
+ method public boolean any(kotlin.jvm.functions.Function1<? super androidx.glance.Modifier.Element,java.lang.Boolean> predicate);
+ method public <R> R! foldIn(R? initial, kotlin.jvm.functions.Function2<? super R,? super androidx.glance.Modifier.Element,? extends R> operation);
+ method public <R> R! foldOut(R? initial, kotlin.jvm.functions.Function2<? super androidx.glance.Modifier.Element,? super R,? extends R> operation);
+ method public default infix androidx.glance.Modifier then(androidx.glance.Modifier other);
+ field public static final androidx.glance.Modifier.Companion Companion;
+ }
+
+ public static final class Modifier.Companion implements androidx.glance.Modifier {
+ method public boolean all(kotlin.jvm.functions.Function1<? super androidx.glance.Modifier.Element,java.lang.Boolean> predicate);
+ method public boolean any(kotlin.jvm.functions.Function1<? super androidx.glance.Modifier.Element,java.lang.Boolean> predicate);
+ method public <R> R! foldIn(R? initial, kotlin.jvm.functions.Function2<? super R,? super androidx.glance.Modifier.Element,? extends R> operation);
+ method public <R> R! foldOut(R? initial, kotlin.jvm.functions.Function2<? super androidx.glance.Modifier.Element,? super R,? extends R> operation);
+ }
+
+ public static interface Modifier.Element extends androidx.glance.Modifier {
+ method public default boolean all(kotlin.jvm.functions.Function1<? super androidx.glance.Modifier.Element,java.lang.Boolean> predicate);
+ method public default boolean any(kotlin.jvm.functions.Function1<? super androidx.glance.Modifier.Element,java.lang.Boolean> predicate);
+ method public default <R> R! foldIn(R? initial, kotlin.jvm.functions.Function2<? super R,? super androidx.glance.Modifier.Element,? extends R> operation);
+ method public default <R> R! foldOut(R? initial, kotlin.jvm.functions.Function2<? super androidx.glance.Modifier.Element,? super R,? extends R> operation);
+ }
+
+ public final class UtilsKt {
+ method @androidx.glance.GlanceInternalApi public static inline <reified T> T! findModifier(androidx.glance.Modifier);
+ }
+
+}
+
+package androidx.glance.layout {
+
+ public final class Alignment {
+ ctor public Alignment(int horizontal, int vertical);
+ method public int getHorizontal();
+ method public int getVertical();
+ property public final int horizontal;
+ property public final int vertical;
+ field public static final androidx.glance.layout.Alignment.Companion Companion;
+ }
+
+ public static final class Alignment.Companion {
+ method public int getBottom();
+ method public androidx.glance.layout.Alignment getBottomCenter();
+ method public androidx.glance.layout.Alignment getBottomEnd();
+ method public androidx.glance.layout.Alignment getBottomStart();
+ method public androidx.glance.layout.Alignment getCenter();
+ method public androidx.glance.layout.Alignment getCenterEnd();
+ method public int getCenterHorizontally();
+ method public androidx.glance.layout.Alignment getCenterStart();
+ method public int getCenterVertically();
+ method public int getEnd();
+ method public int getStart();
+ method public int getTop();
+ method public androidx.glance.layout.Alignment getTopCenter();
+ method public androidx.glance.layout.Alignment getTopEnd();
+ method public androidx.glance.layout.Alignment getTopStart();
+ property public final int Bottom;
+ property public final androidx.glance.layout.Alignment BottomCenter;
+ property public final androidx.glance.layout.Alignment BottomEnd;
+ property public final androidx.glance.layout.Alignment BottomStart;
+ property public final androidx.glance.layout.Alignment Center;
+ property public final androidx.glance.layout.Alignment CenterEnd;
+ property public final int CenterHorizontally;
+ property public final androidx.glance.layout.Alignment CenterStart;
+ property public final int CenterVertically;
+ property public final int End;
+ property public final int Start;
+ property public final int Top;
+ property public final androidx.glance.layout.Alignment TopCenter;
+ property public final androidx.glance.layout.Alignment TopEnd;
+ property public final androidx.glance.layout.Alignment TopStart;
+ }
+
+ public static final inline class Alignment.Horizontal {
+ ctor public Alignment.Horizontal();
+ }
+
+ public static final class Alignment.Horizontal.Companion {
+ method public int getCenterHorizontally();
+ method public int getEnd();
+ method public int getStart();
+ property public final int CenterHorizontally;
+ property public final int End;
+ property public final int Start;
+ }
+
+ public static final inline class Alignment.Vertical {
+ ctor public Alignment.Vertical();
+ }
+
+ public static final class Alignment.Vertical.Companion {
+ method public int getBottom();
+ method public int getCenterVertically();
+ method public int getTop();
+ property public final int Bottom;
+ property public final int CenterVertically;
+ property public final int Top;
+ }
+
+ public final class BoxKt {
+ method @androidx.compose.runtime.Composable public static void Box(optional androidx.glance.Modifier modifier, optional androidx.glance.layout.Alignment contentAlignment, kotlin.jvm.functions.Function0<kotlin.Unit> content);
+ }
+
+ public final class ColumnKt {
+ method @androidx.compose.runtime.Composable public static void Column(optional androidx.glance.Modifier modifier, optional int verticalAlignment, optional int horizontalAlignment, kotlin.jvm.functions.Function0<kotlin.Unit> content);
+ }
+
+ @androidx.glance.GlanceInternalApi public abstract sealed class Dimension {
+ }
+
+ public static final class Dimension.Dp extends androidx.glance.layout.Dimension {
+ ctor public Dimension.Dp(float dp);
+ method public float getDp();
+ property public final float dp;
+ }
+
+ public static final class Dimension.Expand extends androidx.glance.layout.Dimension {
+ field public static final androidx.glance.layout.Dimension.Expand INSTANCE;
+ }
+
+ public static final class Dimension.Wrap extends androidx.glance.layout.Dimension {
+ field public static final androidx.glance.layout.Dimension.Wrap INSTANCE;
+ }
+
+ public final class DimensionKt {
+ method public static androidx.glance.Modifier expandHeight(androidx.glance.Modifier);
+ method public static androidx.glance.Modifier expandWidth(androidx.glance.Modifier);
+ method public static androidx.glance.Modifier height(androidx.glance.Modifier, float height);
+ method public static androidx.glance.Modifier size(androidx.glance.Modifier, float size);
+ method public static androidx.glance.Modifier size(androidx.glance.Modifier, float width, float height);
+ method public static androidx.glance.Modifier width(androidx.glance.Modifier, float width);
+ method public static androidx.glance.Modifier wrapHeight(androidx.glance.Modifier);
+ method public static androidx.glance.Modifier wrapWidth(androidx.glance.Modifier);
+ }
+
+ @androidx.glance.GlanceInternalApi public final class EmittableBox extends androidx.glance.EmittableWithChildren {
+ ctor public EmittableBox();
+ method public androidx.glance.layout.Alignment getContentAlignment();
+ method public androidx.glance.Modifier getModifier();
+ method public void setContentAlignment(androidx.glance.layout.Alignment contentAlignment);
+ method public void setModifier(androidx.glance.Modifier modifier);
+ property public final androidx.glance.layout.Alignment contentAlignment;
+ property public androidx.glance.Modifier modifier;
+ }
+
+ @androidx.glance.GlanceInternalApi public final class EmittableColumn extends androidx.glance.EmittableWithChildren {
+ ctor public EmittableColumn();
+ method public int getHorizontalAlignment();
+ method public androidx.glance.Modifier getModifier();
+ method public int getVerticalAlignment();
+ method public void setHorizontalAlignment(int horizontalAlignment);
+ method public void setModifier(androidx.glance.Modifier modifier);
+ method public void setVerticalAlignment(int verticalAlignment);
+ property public final int horizontalAlignment;
+ property public androidx.glance.Modifier modifier;
+ property public final int verticalAlignment;
+ }
+
+ @androidx.glance.GlanceInternalApi public final class EmittableRow extends androidx.glance.EmittableWithChildren {
+ ctor public EmittableRow();
+ method public int getHorizontalAlignment();
+ method public androidx.glance.Modifier getModifier();
+ method public int getVerticalAlignment();
+ method public void setHorizontalAlignment(int horizontalAlignment);
+ method public void setModifier(androidx.glance.Modifier modifier);
+ method public void setVerticalAlignment(int verticalAlignment);
+ property public final int horizontalAlignment;
+ property public androidx.glance.Modifier modifier;
+ property public final int verticalAlignment;
+ }
+
+ @androidx.glance.GlanceInternalApi public final class EmittableText implements androidx.glance.Emittable {
+ ctor public EmittableText();
+ method public androidx.glance.Modifier getModifier();
+ method public androidx.glance.layout.TextStyle? getStyle();
+ method public String getText();
+ method public void setModifier(androidx.glance.Modifier modifier);
+ method public void setStyle(androidx.glance.layout.TextStyle? style);
+ method public void setText(String text);
+ property public androidx.glance.Modifier modifier;
+ property public final androidx.glance.layout.TextStyle? style;
+ property public final String text;
+ }
+
+ public final inline class FontStyle {
+ ctor public FontStyle();
+ }
+
+ public static final class FontStyle.Companion {
+ method public int getItalic();
+ method public int getNormal();
+ method public java.util.List<androidx.glance.layout.FontStyle> values();
+ property public final int Italic;
+ property public final int Normal;
+ }
+
+ public final inline class FontWeight {
+ ctor public FontWeight();
+ }
+
+ public static final class FontWeight.Companion {
+ method public int getBold();
+ method public int getMedium();
+ method public int getNormal();
+ property public final int Bold;
+ property public final int Medium;
+ property public final int Normal;
+ }
+
+ @androidx.glance.GlanceInternalApi public final class HeightModifier implements androidx.glance.Modifier.Element {
+ ctor public HeightModifier(androidx.glance.layout.Dimension height);
+ method public androidx.glance.layout.Dimension getHeight();
+ property public final androidx.glance.layout.Dimension height;
+ }
+
+ public final class PaddingKt {
+ method public static androidx.glance.Modifier absolutePadding(androidx.glance.Modifier, optional float left, optional float top, optional float right, optional float bottom);
+ method public static androidx.glance.Modifier padding(androidx.glance.Modifier, optional float start, optional float top, optional float end, optional float bottom);
+ method public static androidx.glance.Modifier padding(androidx.glance.Modifier, optional float horizontal, optional float vertical);
+ method public static androidx.glance.Modifier padding(androidx.glance.Modifier, float all);
+ }
+
+ @androidx.glance.GlanceInternalApi public final class PaddingModifier implements androidx.glance.Modifier.Element {
+ ctor public PaddingModifier(optional float start, optional float top, optional float end, optional float bottom, boolean rtlAware);
+ method public float getBottom();
+ method public float getEnd();
+ method public boolean getRtlAware();
+ method public float getStart();
+ method public float getTop();
+ property public final float bottom;
+ property public final float end;
+ property public final boolean rtlAware;
+ property public final float start;
+ property public final float top;
+ }
+
+ public final class RowKt {
+ method @androidx.compose.runtime.Composable public static void Row(optional androidx.glance.Modifier modifier, optional int horizontalAlignment, optional int verticalAlignment, kotlin.jvm.functions.Function0<kotlin.Unit> content);
+ }
+
+ public final inline class TextDecoration {
+ ctor public TextDecoration();
+ }
+
+ public static final class TextDecoration.Companion {
+ method public int combine(java.util.List<androidx.glance.layout.TextDecoration> decorations);
+ method public int getLineThrough();
+ method public int getNone();
+ method public int getUnderline();
+ property public final int LineThrough;
+ property public final int None;
+ property public final int Underline;
+ }
+
+ public final class TextKt {
+ method @androidx.compose.runtime.Composable public static void Text(String text, optional androidx.glance.Modifier modifier, optional androidx.glance.layout.TextStyle? style);
+ }
+
+ @androidx.compose.runtime.Immutable public final class TextStyle {
+ ctor public TextStyle(optional androidx.glance.unit.Sp? size, optional androidx.glance.layout.FontWeight? fontWeight, optional androidx.glance.layout.FontStyle? fontStyle, optional androidx.glance.layout.TextDecoration? textDecoration);
+ method public androidx.glance.layout.FontStyle? getFontStyle();
+ method public androidx.glance.layout.FontWeight? getFontWeight();
+ method public androidx.glance.unit.Sp? getSize();
+ method public androidx.glance.layout.TextDecoration? getTextDecoration();
+ property public final androidx.glance.layout.FontStyle? fontStyle;
+ property public final androidx.glance.layout.FontWeight? fontWeight;
+ property public final androidx.glance.unit.Sp? size;
+ property public final androidx.glance.layout.TextDecoration? textDecoration;
+ }
+
+ @androidx.glance.GlanceInternalApi public final class WidthModifier implements androidx.glance.Modifier.Element {
+ ctor public WidthModifier(androidx.glance.layout.Dimension width);
+ method public androidx.glance.layout.Dimension getWidth();
+ property public final androidx.glance.layout.Dimension width;
+ }
+
+}
+
+package androidx.glance.unit {
+
+ public final inline class Color {
+ ctor public Color();
+ method public int getValue();
+ property public final int value;
+ }
+
+ public static final class Color.Companion {
+ method public int getBlack();
+ method public int getBlue();
+ method public int getCyan();
+ method public int getDarkGray();
+ method public int getGray();
+ method public int getGreen();
+ method public int getLightGray();
+ method public int getMagenta();
+ method public int getRed();
+ method public int getTransparent();
+ method public int getWhite();
+ method public int getYellow();
+ property public final int Black;
+ property public final int Blue;
+ property public final int Cyan;
+ property public final int DarkGray;
+ property public final int Gray;
+ property public final int Green;
+ property public final int LightGray;
+ property public final int Magenta;
+ property public final int Red;
+ property public final int Transparent;
+ property public final int White;
+ property public final int Yellow;
+ }
+
+ public final class ColorKt {
+ method @androidx.compose.runtime.Stable public static int Color(float red, float green, float blue, optional float alpha);
+ }
+
+ public final inline class Dp implements java.lang.Comparable<androidx.glance.unit.Dp> {
+ ctor public Dp();
+ method public operator int compareTo(float other);
+ method public float getValue();
+ property public final float value;
+ }
+
+ public final class DpKt {
+ method public static inline float getDp(int);
+ method public static inline float getDp(double);
+ method public static inline float getDp(float);
+ method public static float max(float a, float b);
+ method public static float min(float a, float b);
+ method public static operator float times(float, float other);
+ method public static operator float times(double, float other);
+ method public static operator float times(int, float other);
+ }
+
+ @androidx.compose.runtime.Immutable public final class DpSize {
+ ctor public DpSize(float width, float height);
+ method @androidx.compose.runtime.Stable public operator float component1();
+ method @androidx.compose.runtime.Stable public operator float component2();
+ method public androidx.glance.unit.DpSize copy(optional float width, optional float height);
+ method @androidx.compose.runtime.Stable public operator androidx.glance.unit.DpSize div(int other);
+ method @androidx.compose.runtime.Stable public operator androidx.glance.unit.DpSize div(float other);
+ method public float getHeight();
+ method public float getWidth();
+ method @androidx.compose.runtime.Stable public operator androidx.glance.unit.DpSize minus(androidx.glance.unit.DpSize other);
+ method @androidx.compose.runtime.Stable public operator androidx.glance.unit.DpSize plus(androidx.glance.unit.DpSize other);
+ method @androidx.compose.runtime.Stable public operator androidx.glance.unit.DpSize times(int other);
+ method @androidx.compose.runtime.Stable public operator androidx.glance.unit.DpSize times(float other);
+ property public final float height;
+ property public final float width;
+ field public static final androidx.glance.unit.DpSize.Companion Companion;
+ }
+
+ public static final class DpSize.Companion {
+ method public androidx.glance.unit.DpSize getZero();
+ property public final androidx.glance.unit.DpSize Zero;
+ }
+
+ public final class DpSizeKt {
+ method @androidx.compose.runtime.Stable public static operator androidx.glance.unit.DpSize times(int, androidx.glance.unit.DpSize size);
+ method @androidx.compose.runtime.Stable public static operator androidx.glance.unit.DpSize times(float, androidx.glance.unit.DpSize size);
+ }
+
+ public final inline class Sp implements java.lang.Comparable<androidx.glance.unit.Sp> {
+ ctor public Sp();
+ method public operator int compareTo(float other);
+ method public float getValue();
+ property public final float value;
+ }
+
+ public final class SpKt {
+ method public static inline float getSp(int);
+ method public static inline float getSp(double);
+ method public static inline float getSp(float);
+ method public static float max(float a, float b);
+ method public static float min(float a, float b);
+ method public static operator float times(float, float other);
+ method public static operator float times(double, float other);
+ method public static operator float times(int, float other);
+ }
+
+}
+
diff --git a/appsearch/debug-view/api/res-current.txt b/glance/glance/api/res-current.txt
similarity index 100%
copy from appsearch/debug-view/api/res-current.txt
copy to glance/glance/api/res-current.txt
diff --git a/glance/glance/api/restricted_current.txt b/glance/glance/api/restricted_current.txt
new file mode 100644
index 0000000..2fd4d39
--- /dev/null
+++ b/glance/glance/api/restricted_current.txt
@@ -0,0 +1,301 @@
+// Signature format: 4.0
+package androidx.glance {
+
+ public final class CombinedModifier implements androidx.glance.Modifier {
+ ctor public CombinedModifier(androidx.glance.Modifier outer, androidx.glance.Modifier inner);
+ method public boolean all(kotlin.jvm.functions.Function1<? super androidx.glance.Modifier.Element,java.lang.Boolean> predicate);
+ method public boolean any(kotlin.jvm.functions.Function1<? super androidx.glance.Modifier.Element,java.lang.Boolean> predicate);
+ method public <R> R! foldIn(R? initial, kotlin.jvm.functions.Function2<? super R,? super androidx.glance.Modifier.Element,? extends R> operation);
+ method public <R> R! foldOut(R? initial, kotlin.jvm.functions.Function2<? super androidx.glance.Modifier.Element,? super R,? extends R> operation);
+ }
+
+ @androidx.compose.runtime.Stable public interface Modifier {
+ method public boolean all(kotlin.jvm.functions.Function1<? super androidx.glance.Modifier.Element,java.lang.Boolean> predicate);
+ method public boolean any(kotlin.jvm.functions.Function1<? super androidx.glance.Modifier.Element,java.lang.Boolean> predicate);
+ method public <R> R! foldIn(R? initial, kotlin.jvm.functions.Function2<? super R,? super androidx.glance.Modifier.Element,? extends R> operation);
+ method public <R> R! foldOut(R? initial, kotlin.jvm.functions.Function2<? super androidx.glance.Modifier.Element,? super R,? extends R> operation);
+ method public default infix androidx.glance.Modifier then(androidx.glance.Modifier other);
+ field public static final androidx.glance.Modifier.Companion Companion;
+ }
+
+ public static final class Modifier.Companion implements androidx.glance.Modifier {
+ method public boolean all(kotlin.jvm.functions.Function1<? super androidx.glance.Modifier.Element,java.lang.Boolean> predicate);
+ method public boolean any(kotlin.jvm.functions.Function1<? super androidx.glance.Modifier.Element,java.lang.Boolean> predicate);
+ method public <R> R! foldIn(R? initial, kotlin.jvm.functions.Function2<? super R,? super androidx.glance.Modifier.Element,? extends R> operation);
+ method public <R> R! foldOut(R? initial, kotlin.jvm.functions.Function2<? super androidx.glance.Modifier.Element,? super R,? extends R> operation);
+ }
+
+ public static interface Modifier.Element extends androidx.glance.Modifier {
+ method public default boolean all(kotlin.jvm.functions.Function1<? super androidx.glance.Modifier.Element,java.lang.Boolean> predicate);
+ method public default boolean any(kotlin.jvm.functions.Function1<? super androidx.glance.Modifier.Element,java.lang.Boolean> predicate);
+ method public default <R> R! foldIn(R? initial, kotlin.jvm.functions.Function2<? super R,? super androidx.glance.Modifier.Element,? extends R> operation);
+ method public default <R> R! foldOut(R? initial, kotlin.jvm.functions.Function2<? super androidx.glance.Modifier.Element,? super R,? extends R> operation);
+ }
+
+ public final class UtilsKt {
+ }
+
+}
+
+package androidx.glance.layout {
+
+ public final class Alignment {
+ ctor public Alignment(int horizontal, int vertical);
+ method public int getHorizontal();
+ method public int getVertical();
+ property public final int horizontal;
+ property public final int vertical;
+ field public static final androidx.glance.layout.Alignment.Companion Companion;
+ }
+
+ public static final class Alignment.Companion {
+ method public int getBottom();
+ method public androidx.glance.layout.Alignment getBottomCenter();
+ method public androidx.glance.layout.Alignment getBottomEnd();
+ method public androidx.glance.layout.Alignment getBottomStart();
+ method public androidx.glance.layout.Alignment getCenter();
+ method public androidx.glance.layout.Alignment getCenterEnd();
+ method public int getCenterHorizontally();
+ method public androidx.glance.layout.Alignment getCenterStart();
+ method public int getCenterVertically();
+ method public int getEnd();
+ method public int getStart();
+ method public int getTop();
+ method public androidx.glance.layout.Alignment getTopCenter();
+ method public androidx.glance.layout.Alignment getTopEnd();
+ method public androidx.glance.layout.Alignment getTopStart();
+ property public final int Bottom;
+ property public final androidx.glance.layout.Alignment BottomCenter;
+ property public final androidx.glance.layout.Alignment BottomEnd;
+ property public final androidx.glance.layout.Alignment BottomStart;
+ property public final androidx.glance.layout.Alignment Center;
+ property public final androidx.glance.layout.Alignment CenterEnd;
+ property public final int CenterHorizontally;
+ property public final androidx.glance.layout.Alignment CenterStart;
+ property public final int CenterVertically;
+ property public final int End;
+ property public final int Start;
+ property public final int Top;
+ property public final androidx.glance.layout.Alignment TopCenter;
+ property public final androidx.glance.layout.Alignment TopEnd;
+ property public final androidx.glance.layout.Alignment TopStart;
+ }
+
+ public static final inline class Alignment.Horizontal {
+ ctor public Alignment.Horizontal();
+ }
+
+ public static final class Alignment.Horizontal.Companion {
+ method public int getCenterHorizontally();
+ method public int getEnd();
+ method public int getStart();
+ property public final int CenterHorizontally;
+ property public final int End;
+ property public final int Start;
+ }
+
+ public static final inline class Alignment.Vertical {
+ ctor public Alignment.Vertical();
+ }
+
+ public static final class Alignment.Vertical.Companion {
+ method public int getBottom();
+ method public int getCenterVertically();
+ method public int getTop();
+ property public final int Bottom;
+ property public final int CenterVertically;
+ property public final int Top;
+ }
+
+ public final class BoxKt {
+ method @androidx.compose.runtime.Composable public static void Box(optional androidx.glance.Modifier modifier, optional androidx.glance.layout.Alignment contentAlignment, kotlin.jvm.functions.Function0<kotlin.Unit> content);
+ }
+
+ public final class ColumnKt {
+ method @androidx.compose.runtime.Composable public static void Column(optional androidx.glance.Modifier modifier, optional int verticalAlignment, optional int horizontalAlignment, kotlin.jvm.functions.Function0<kotlin.Unit> content);
+ }
+
+ public final class DimensionKt {
+ method public static androidx.glance.Modifier expandHeight(androidx.glance.Modifier);
+ method public static androidx.glance.Modifier expandWidth(androidx.glance.Modifier);
+ method public static androidx.glance.Modifier height(androidx.glance.Modifier, float height);
+ method public static androidx.glance.Modifier size(androidx.glance.Modifier, float size);
+ method public static androidx.glance.Modifier size(androidx.glance.Modifier, float width, float height);
+ method public static androidx.glance.Modifier width(androidx.glance.Modifier, float width);
+ method public static androidx.glance.Modifier wrapHeight(androidx.glance.Modifier);
+ method public static androidx.glance.Modifier wrapWidth(androidx.glance.Modifier);
+ }
+
+ public final inline class FontStyle {
+ ctor public FontStyle();
+ }
+
+ public static final class FontStyle.Companion {
+ method public int getItalic();
+ method public int getNormal();
+ method public java.util.List<androidx.glance.layout.FontStyle> values();
+ property public final int Italic;
+ property public final int Normal;
+ }
+
+ public final inline class FontWeight {
+ ctor public FontWeight();
+ }
+
+ public static final class FontWeight.Companion {
+ method public int getBold();
+ method public int getMedium();
+ method public int getNormal();
+ property public final int Bold;
+ property public final int Medium;
+ property public final int Normal;
+ }
+
+ public final class PaddingKt {
+ method public static androidx.glance.Modifier absolutePadding(androidx.glance.Modifier, optional float left, optional float top, optional float right, optional float bottom);
+ method public static androidx.glance.Modifier padding(androidx.glance.Modifier, optional float start, optional float top, optional float end, optional float bottom);
+ method public static androidx.glance.Modifier padding(androidx.glance.Modifier, optional float horizontal, optional float vertical);
+ method public static androidx.glance.Modifier padding(androidx.glance.Modifier, float all);
+ }
+
+ public final class RowKt {
+ method @androidx.compose.runtime.Composable public static void Row(optional androidx.glance.Modifier modifier, optional int horizontalAlignment, optional int verticalAlignment, kotlin.jvm.functions.Function0<kotlin.Unit> content);
+ }
+
+ public final inline class TextDecoration {
+ ctor public TextDecoration();
+ }
+
+ public static final class TextDecoration.Companion {
+ method public int combine(java.util.List<androidx.glance.layout.TextDecoration> decorations);
+ method public int getLineThrough();
+ method public int getNone();
+ method public int getUnderline();
+ property public final int LineThrough;
+ property public final int None;
+ property public final int Underline;
+ }
+
+ public final class TextKt {
+ method @androidx.compose.runtime.Composable public static void Text(String text, optional androidx.glance.Modifier modifier, optional androidx.glance.layout.TextStyle? style);
+ }
+
+ @androidx.compose.runtime.Immutable public final class TextStyle {
+ ctor public TextStyle(optional androidx.glance.unit.Sp? size, optional androidx.glance.layout.FontWeight? fontWeight, optional androidx.glance.layout.FontStyle? fontStyle, optional androidx.glance.layout.TextDecoration? textDecoration);
+ method public androidx.glance.layout.FontStyle? getFontStyle();
+ method public androidx.glance.layout.FontWeight? getFontWeight();
+ method public androidx.glance.unit.Sp? getSize();
+ method public androidx.glance.layout.TextDecoration? getTextDecoration();
+ property public final androidx.glance.layout.FontStyle? fontStyle;
+ property public final androidx.glance.layout.FontWeight? fontWeight;
+ property public final androidx.glance.unit.Sp? size;
+ property public final androidx.glance.layout.TextDecoration? textDecoration;
+ }
+
+}
+
+package androidx.glance.unit {
+
+ public final inline class Color {
+ ctor public Color();
+ method public int getValue();
+ property public final int value;
+ }
+
+ public static final class Color.Companion {
+ method public int getBlack();
+ method public int getBlue();
+ method public int getCyan();
+ method public int getDarkGray();
+ method public int getGray();
+ method public int getGreen();
+ method public int getLightGray();
+ method public int getMagenta();
+ method public int getRed();
+ method public int getTransparent();
+ method public int getWhite();
+ method public int getYellow();
+ property public final int Black;
+ property public final int Blue;
+ property public final int Cyan;
+ property public final int DarkGray;
+ property public final int Gray;
+ property public final int Green;
+ property public final int LightGray;
+ property public final int Magenta;
+ property public final int Red;
+ property public final int Transparent;
+ property public final int White;
+ property public final int Yellow;
+ }
+
+ public final class ColorKt {
+ method @androidx.compose.runtime.Stable public static int Color(float red, float green, float blue, optional float alpha);
+ }
+
+ public final inline class Dp implements java.lang.Comparable<androidx.glance.unit.Dp> {
+ ctor public Dp();
+ method public operator int compareTo(float other);
+ method public float getValue();
+ property public final float value;
+ }
+
+ public final class DpKt {
+ method public static inline float getDp(int);
+ method public static inline float getDp(double);
+ method public static inline float getDp(float);
+ method public static float max(float a, float b);
+ method public static float min(float a, float b);
+ method public static operator float times(float, float other);
+ method public static operator float times(double, float other);
+ method public static operator float times(int, float other);
+ }
+
+ @androidx.compose.runtime.Immutable public final class DpSize {
+ ctor public DpSize(float width, float height);
+ method @androidx.compose.runtime.Stable public operator float component1();
+ method @androidx.compose.runtime.Stable public operator float component2();
+ method public androidx.glance.unit.DpSize copy(optional float width, optional float height);
+ method @androidx.compose.runtime.Stable public operator androidx.glance.unit.DpSize div(int other);
+ method @androidx.compose.runtime.Stable public operator androidx.glance.unit.DpSize div(float other);
+ method public float getHeight();
+ method public float getWidth();
+ method @androidx.compose.runtime.Stable public operator androidx.glance.unit.DpSize minus(androidx.glance.unit.DpSize other);
+ method @androidx.compose.runtime.Stable public operator androidx.glance.unit.DpSize plus(androidx.glance.unit.DpSize other);
+ method @androidx.compose.runtime.Stable public operator androidx.glance.unit.DpSize times(int other);
+ method @androidx.compose.runtime.Stable public operator androidx.glance.unit.DpSize times(float other);
+ property public final float height;
+ property public final float width;
+ field public static final androidx.glance.unit.DpSize.Companion Companion;
+ }
+
+ public static final class DpSize.Companion {
+ method public androidx.glance.unit.DpSize getZero();
+ property public final androidx.glance.unit.DpSize Zero;
+ }
+
+ public final class DpSizeKt {
+ method @androidx.compose.runtime.Stable public static operator androidx.glance.unit.DpSize times(int, androidx.glance.unit.DpSize size);
+ method @androidx.compose.runtime.Stable public static operator androidx.glance.unit.DpSize times(float, androidx.glance.unit.DpSize size);
+ }
+
+ public final inline class Sp implements java.lang.Comparable<androidx.glance.unit.Sp> {
+ ctor public Sp();
+ method public operator int compareTo(float other);
+ method public float getValue();
+ property public final float value;
+ }
+
+ public final class SpKt {
+ method public static inline float getSp(int);
+ method public static inline float getSp(double);
+ method public static inline float getSp(float);
+ method public static float max(float a, float b);
+ method public static float min(float a, float b);
+ method public static operator float times(float, float other);
+ method public static operator float times(double, float other);
+ method public static operator float times(int, float other);
+ }
+
+}
+
diff --git a/glance/glance/build.gradle b/glance/glance/build.gradle
index 91e7e82..a543845 100644
--- a/glance/glance/build.gradle
+++ b/glance/glance/build.gradle
@@ -39,6 +39,8 @@
testImplementation(libs.testRunner)
testImplementation(libs.truth)
testImplementation(libs.junit)
+ testImplementation(libs.kotlinCoroutinesTest)
+ testImplementation(libs.kotlinTest)
}
android {
@@ -58,5 +60,4 @@
description = "Glance allows developers to build layouts for remote surfaces using a Jetpack " +
"Compose-style API."
targetsJavaConsumers = false
- runApiTasks = new RunApiTasks.No("API tracking disabled while we write the core API surface.")
}
diff --git a/glance/glance/src/androidMain/kotlin/androidx/glance/Applier.kt b/glance/glance/src/androidMain/kotlin/androidx/glance/Applier.kt
index 78e8dea..8929334 100644
--- a/glance/glance/src/androidMain/kotlin/androidx/glance/Applier.kt
+++ b/glance/glance/src/androidMain/kotlin/androidx/glance/Applier.kt
@@ -21,7 +21,7 @@
/** Applier for the Glance composition. */
@GlanceInternalApi
-class Applier(root: EmittableWithChildren) : AbstractApplier<Emittable>(root) {
+public class Applier(root: EmittableWithChildren) : AbstractApplier<Emittable>(root) {
override fun onClear() {
(root as EmittableWithChildren).children.clear()
}
@@ -31,6 +31,12 @@
}
override fun insertTopDown(index: Int, instance: Emittable) {
+ val parent = current as EmittableWithChildren
+ require(parent.maxDepth > 0) {
+ "Too many embedded views for the current surface. The maximum depth is: " +
+ "${(root as EmittableWithChildren).maxDepth}"
+ }
+ if (instance is EmittableWithChildren) instance.maxDepth = parent.maxDepth - 1
currentChildren.add(index, instance)
}
diff --git a/glance/glance/src/androidMain/kotlin/androidx/glance/Emittables.kt b/glance/glance/src/androidMain/kotlin/androidx/glance/Emittables.kt
index ea7123d..f395dcc 100644
--- a/glance/glance/src/androidMain/kotlin/androidx/glance/Emittables.kt
+++ b/glance/glance/src/androidMain/kotlin/androidx/glance/Emittables.kt
@@ -17,13 +17,15 @@
package androidx.glance
@GlanceInternalApi
-interface Emittable {
- var modifier: Modifier
+public interface Emittable {
+ public var modifier: Modifier
}
@GlanceInternalApi
-abstract class EmittableWithChildren : Emittable {
- val children = mutableListOf<Emittable>()
+public abstract class EmittableWithChildren(
+ internal var maxDepth: Int = Int.MAX_VALUE
+) : Emittable {
+ public val children: MutableList<Emittable> = mutableListOf<Emittable>()
protected fun childrenToString(): String =
children.joinToString(",\n").prependIndent(" ")
diff --git a/glance/glance/src/androidMain/kotlin/androidx/glance/GlanceInternalApi.kt b/glance/glance/src/androidMain/kotlin/androidx/glance/GlanceInternalApi.kt
index 606ac67..2efdf25 100644
--- a/glance/glance/src/androidMain/kotlin/androidx/glance/GlanceInternalApi.kt
+++ b/glance/glance/src/androidMain/kotlin/androidx/glance/GlanceInternalApi.kt
@@ -11,4 +11,4 @@
)
@Retention(AnnotationRetention.BINARY)
@Target(AnnotationTarget.CLASS, AnnotationTarget.FUNCTION)
-annotation class GlanceInternalApi
+public annotation class GlanceInternalApi
diff --git a/glance/glance/src/androidMain/kotlin/androidx/glance/Modifier.kt b/glance/glance/src/androidMain/kotlin/androidx/glance/Modifier.kt
index a7f989c..e818fa8 100644
--- a/glance/glance/src/androidMain/kotlin/androidx/glance/Modifier.kt
+++ b/glance/glance/src/androidMain/kotlin/androidx/glance/Modifier.kt
@@ -23,7 +23,7 @@
* This plays the same role as [androidx.compose.ui.Modifier], but for the Glance composables.
*/
@Stable
-interface Modifier {
+public interface Modifier {
/**
* Accumulates a value starting with [initial] and applying [operation] to the current value
* and each element from outside in.
@@ -33,7 +33,7 @@
* of the elements that appear after it. [foldIn] may be used to accumulate a value starting
* from the parent or head of the modifier chain to the final wrapped child.
*/
- fun <R> foldIn(initial: R, operation: (R, Element) -> R): R
+ public fun <R> foldIn(initial: R, operation: (R, Element) -> R): R
/**
* Accumulates a value starting with [initial] and applying [operation] to the current value
@@ -44,31 +44,31 @@
* of the elements that appear after it. [foldOut] may be used to accumulate a value starting
* from the child or tail of the modifier chain up to the parent or head of the chain.
*/
- fun <R> foldOut(initial: R, operation: (Element, R) -> R): R
+ public fun <R> foldOut(initial: R, operation: (Element, R) -> R): R
/**
* Returns `true` if [predicate] returns true for any [Element] in this [Modifier].
*/
- fun any(predicate: (Element) -> Boolean): Boolean
+ public fun any(predicate: (Element) -> Boolean): Boolean
/**
* Returns `true` if [predicate] returns true for all [Element]s in this [Modifier] or if
* this [Modifier] contains no [Element]s.
*/
- fun all(predicate: (Element) -> Boolean): Boolean
+ public fun all(predicate: (Element) -> Boolean): Boolean
/**
* Concatenates this modifier with another.
*
* Returns a [Modifier] representing this modifier followed by [other] in sequence.
*/
- infix fun then(other: Modifier): Modifier =
+ public infix fun then(other: Modifier): Modifier =
if (other === Modifier) this else CombinedModifier(this, other)
/**
* A single element contained within a [Modifier] chain.
*/
- interface Element : Modifier {
+ public interface Element : Modifier {
override fun <R> foldIn(initial: R, operation: (R, Element) -> R): R =
operation(initial, this)
@@ -86,13 +86,13 @@
*/
// The companion object implements `Modifier` so that it may be used as the start of a
// modifier extension factory expression.
- companion object : Modifier {
+ public companion object : Modifier {
override fun <R> foldIn(initial: R, operation: (R, Element) -> R): R = initial
override fun <R> foldOut(initial: R, operation: (Element, R) -> R): R = initial
override fun any(predicate: (Element) -> Boolean): Boolean = false
override fun all(predicate: (Element) -> Boolean): Boolean = true
override infix fun then(other: Modifier): Modifier = other
- override fun toString() = "Modifier"
+ override fun toString(): String = "Modifier"
}
}
@@ -100,7 +100,7 @@
* A node in a [Modifier] chain. A CombinedModifier always contains at least two elements;
* a Modifier [outer] that wraps around the Modifier [inner].
*/
-class CombinedModifier(
+public class CombinedModifier(
private val outer: Modifier,
private val inner: Modifier
) : Modifier {
@@ -120,7 +120,7 @@
other is CombinedModifier && outer == other.outer && inner == other.inner
override fun hashCode(): Int = outer.hashCode() + 31 * inner.hashCode()
- override fun toString() = "[" + foldIn("") { acc, element ->
+ override fun toString(): String = "[" + foldIn("") { acc, element ->
if (acc.isEmpty()) element.toString() else "$acc, $element"
} + "]"
}
\ No newline at end of file
diff --git a/development/project-creator/compose-template/groupId/artifactId/src/main/groupId/package-info.java b/glance/glance/src/androidMain/kotlin/androidx/glance/Utils.kt
similarity index 68%
copy from development/project-creator/compose-template/groupId/artifactId/src/main/groupId/package-info.java
copy to glance/glance/src/androidMain/kotlin/androidx/glance/Utils.kt
index a51e68c..c7d2e38 100644
--- a/development/project-creator/compose-template/groupId/artifactId/src/main/groupId/package-info.java
+++ b/glance/glance/src/androidMain/kotlin/androidx/glance/Utils.kt
@@ -1,5 +1,7 @@
+package androidx.glance
+
/*
- * Copyright (C) <YEAR> The Android Open Source Project
+ * Copyright 2021 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -14,7 +16,11 @@
* limitations under the License.
*/
-/**
- * Insert package level documentation here
- */
-package <PACKAGE>;
+@GlanceInternalApi
+inline fun <reified T> Modifier.findModifier(): T? = this.foldOut<T?>(null) { cur, acc ->
+ if (cur is T) {
+ cur
+ } else {
+ acc
+ }
+}
diff --git a/glance/glance/src/androidMain/kotlin/androidx/glance/layout/Alignment.kt b/glance/glance/src/androidMain/kotlin/androidx/glance/layout/Alignment.kt
new file mode 100644
index 0000000..beee6c1
--- /dev/null
+++ b/glance/glance/src/androidMain/kotlin/androidx/glance/layout/Alignment.kt
@@ -0,0 +1,97 @@
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * 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.
+ */
+
+package androidx.glance.layout
+
+/**
+ * A class used to specify the position of a sized box inside an available space. This is often used
+ * to specify how a parent layout should place its children.
+ */
+
+public class Alignment(public val horizontal: Horizontal, public val vertical: Vertical) {
+ /**
+ * Specifies how a parent should lay its children out horizontally, if the child has a width
+ * smaller than the parent.
+ */
+ @Suppress("INLINE_CLASS_DEPRECATED")
+ public inline class Horizontal private constructor (private val value: Int) {
+ public companion object {
+ public val Start: Horizontal = Horizontal(0)
+ public val CenterHorizontally: Horizontal = Horizontal(1)
+ public val End: Horizontal = Horizontal(2)
+ }
+ }
+
+ /**
+ * Specifies how a parent should lay its children out vertically, if the child has a height
+ * smaller than the parent.
+ */
+ @Suppress("INLINE_CLASS_DEPRECATED")
+ public inline class Vertical private constructor (private val value: Int) {
+ public companion object {
+ public val Top: Vertical = Vertical(0)
+ public val CenterVertically: Vertical = Vertical(1)
+ public val Bottom: Vertical = Vertical(2)
+ }
+ }
+
+ /** Common [Alignment] options used in layouts. */
+ public companion object {
+ public val TopStart: Alignment = Alignment(Horizontal.Start, Vertical.Top)
+ public val TopCenter: Alignment = Alignment(Horizontal.CenterHorizontally, Vertical.Top)
+ public val TopEnd: Alignment = Alignment(Horizontal.End, Vertical.Top)
+
+ public val CenterStart: Alignment = Alignment(Horizontal.Start, Vertical.CenterVertically)
+ public val Center: Alignment =
+ Alignment(Horizontal.CenterHorizontally, Vertical.CenterVertically)
+ public val CenterEnd: Alignment = Alignment(Horizontal.End, Vertical.CenterVertically)
+
+ public val BottomStart: Alignment = Alignment(Horizontal.Start, Vertical.Bottom)
+ public val BottomCenter: Alignment =
+ Alignment(Horizontal.CenterHorizontally, Vertical.Bottom)
+ public val BottomEnd: Alignment = Alignment(Horizontal.End, Vertical.Bottom)
+
+ public val Top: Vertical = Vertical.Top
+ public val CenterVertically: Vertical = Vertical.CenterVertically
+ public val Bottom: Vertical = Vertical.Bottom
+
+ public val Start: Horizontal = Horizontal.Start
+ public val CenterHorizontally: Horizontal = Horizontal.CenterHorizontally
+ public val End: Horizontal = Horizontal.End
+ }
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) return true
+ if (javaClass != other?.javaClass) return false
+
+ other as Alignment
+
+ if (horizontal != other.horizontal) return false
+ if (vertical != other.vertical) return false
+
+ return true
+ }
+
+ override fun hashCode(): Int {
+ var result = horizontal.hashCode()
+ result = 31 * result + vertical.hashCode()
+ return result
+ }
+
+ override fun toString(): String {
+ return "Alignment(horizontal=$horizontal, vertical=$vertical)"
+ }
+}
diff --git a/glance/glance/src/androidMain/kotlin/androidx/glance/layout/Box.kt b/glance/glance/src/androidMain/kotlin/androidx/glance/layout/Box.kt
new file mode 100644
index 0000000..37a8d1c
--- /dev/null
+++ b/glance/glance/src/androidMain/kotlin/androidx/glance/layout/Box.kt
@@ -0,0 +1,63 @@
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * 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.
+ */
+
+package androidx.glance.layout
+
+import androidx.compose.runtime.Composable
+import androidx.compose.runtime.ComposeNode
+import androidx.glance.Applier
+import androidx.glance.EmittableWithChildren
+import androidx.glance.GlanceInternalApi
+import androidx.glance.Modifier
+
+@GlanceInternalApi
+public class EmittableBox : EmittableWithChildren() {
+ override var modifier: Modifier = Modifier
+ public var contentAlignment: Alignment = Alignment.TopStart
+
+ override fun toString(): String {
+ return "EmittableBox(modifier=$modifier, contentAlignment=$contentAlignment)"
+ }
+}
+
+/**
+ * A layout composable with [content].
+ *
+ * By default, the [Box] will size itself to fit the content, unless a [Dimension] constraint has
+ * been provided. When the children are smaller than the [Box], they will be placed within the box
+ * subject to the [contentAlignment]. When the [content] has more than one layout child, all of
+ * the children will be stacked on top of each other in the composition order.
+ *
+ * @param modifier The modifier to be applied to the layout.
+ * @param contentAlignment The alignment of children within the [Box].
+ * @param content The content inside the [Box].
+ */
+@OptIn(GlanceInternalApi::class)
+@Composable
+public fun Box(
+ modifier: Modifier = Modifier,
+ contentAlignment: Alignment = Alignment.TopStart,
+ content: @Composable() () -> Unit
+) {
+ ComposeNode<EmittableBox, Applier>(
+ factory = ::EmittableBox,
+ update = {
+ this.set(modifier) { this.modifier = it }
+ this.set(contentAlignment) { this.contentAlignment = it }
+ },
+ content = content
+ )
+}
diff --git a/glance/glance/src/androidMain/kotlin/androidx/glance/layout/Column.kt b/glance/glance/src/androidMain/kotlin/androidx/glance/layout/Column.kt
new file mode 100644
index 0000000..7048406
--- /dev/null
+++ b/glance/glance/src/androidMain/kotlin/androidx/glance/layout/Column.kt
@@ -0,0 +1,65 @@
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * 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.
+ */
+
+package androidx.glance.layout
+
+import androidx.compose.runtime.Composable
+import androidx.compose.runtime.ComposeNode
+import androidx.glance.Applier
+import androidx.glance.EmittableWithChildren
+import androidx.glance.GlanceInternalApi
+import androidx.glance.Modifier
+
+@GlanceInternalApi
+public class EmittableColumn : EmittableWithChildren() {
+ override var modifier: Modifier = Modifier
+ public var verticalAlignment: Alignment.Vertical = Alignment.Top
+ public var horizontalAlignment: Alignment.Horizontal = Alignment.Start
+}
+
+/**
+ * A layout composable with [content], which lays its children out in a Column.
+ *
+ * By default, the [Column] will size itself to fit the content, unless a [Dimension] constraint has
+ * been provided. When children are smaller than the size of the [Column], they will be placed
+ * within the available space subject to [horizontalAlignment] and [verticalAlignment].
+ *
+ * @param modifier The modifier to be applied to the layout.
+ * @param verticalAlignment The vertical alignment to apply to the set of children, when they do not
+ * consume the full height of the [Column] (i.e. whether to push the children towards the top,
+ * center or bottom of the [Column]).
+ * @param horizontalAlignment The horizontal alignment to apply to children when they are smaller
+ * than the width of the [Column]
+ * @param content The content inside the [Column]
+ */
+@OptIn(GlanceInternalApi::class)
+@Composable
+public fun Column(
+ modifier: Modifier = Modifier,
+ verticalAlignment: Alignment.Vertical = Alignment.Top,
+ horizontalAlignment: Alignment.Horizontal = Alignment.Start,
+ content: @Composable () -> Unit
+) {
+ ComposeNode<EmittableColumn, Applier>(
+ factory = ::EmittableColumn,
+ update = {
+ this.set(modifier) { this.modifier = it }
+ this.set(horizontalAlignment) { this.horizontalAlignment = it }
+ this.set(verticalAlignment) { this.verticalAlignment = it }
+ },
+ content = content
+ )
+}
diff --git a/glance/glance/src/androidMain/kotlin/androidx/glance/layout/Dimension.kt b/glance/glance/src/androidMain/kotlin/androidx/glance/layout/Dimension.kt
new file mode 100644
index 0000000..504ccd8
--- /dev/null
+++ b/glance/glance/src/androidMain/kotlin/androidx/glance/layout/Dimension.kt
@@ -0,0 +1,75 @@
+@file:OptIn(GlanceInternalApi::class)
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * 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.
+ */
+
+package androidx.glance.layout
+
+import androidx.glance.GlanceInternalApi
+import androidx.glance.Modifier
+import androidx.glance.unit.Dp
+
+/**
+ * Dimension types. This contains all the dimension types which are supported by androidx.glance.
+ *
+ * These should only be used internally; developers should be using the width/height Modifiers
+ * below rather than this class directly.
+ */
+@GlanceInternalApi
+public sealed class Dimension {
+ public class Dp(public val dp: androidx.glance.unit.Dp) : Dimension()
+ public object Wrap : Dimension()
+ public object Expand : Dimension()
+}
+
+/** Modifier to represent the width of an element. */
+@GlanceInternalApi
+public class WidthModifier(public val width: Dimension) : Modifier.Element
+
+/** Sets the absolute width of an element, in [Dp]. */
+public fun Modifier.width(width: Dp): Modifier = this.then(WidthModifier(Dimension.Dp(width)))
+
+/** Specifies that the width of the element should wrap its contents. */
+public fun Modifier.wrapWidth(): Modifier = this.then(WidthModifier(Dimension.Wrap))
+
+/**
+ * Specifies that the width of the element should expand to the size of its parent. Note that if
+ * multiple elements within a linear container (e.g. Row or Column) have their width as expandWidth,
+ * then they will all share the remaining space.
+ */
+public fun Modifier.expandWidth(): Modifier = this.then(WidthModifier(Dimension.Expand))
+
+/** Modifier to represent the height of an element. */
+@GlanceInternalApi
+public class HeightModifier(public val height: Dimension) : Modifier.Element
+
+/** Sets the absolute height of an element, in [Dp]. */
+public fun Modifier.height(height: Dp): Modifier = this.then(HeightModifier(Dimension.Dp(height)))
+
+/** Specifies that the height of the element should wrap its contents. */
+public fun Modifier.wrapHeight(): Modifier = this.then(HeightModifier(Dimension.Wrap))
+
+/**
+ * Specifies that the height of the element should expand to the size of its parent. Note that if
+ * multiple elements within a linear container (e.g. Row or Column) have their height as
+ * expandHeight, then they will all share the remaining space.
+ */
+public fun Modifier.expandHeight(): Modifier = this.then(HeightModifier(Dimension.Expand))
+
+/** Sets both the width and height of an element, in [Dp]. */
+public fun Modifier.size(size: Dp): Modifier = this.width(size).height(size)
+
+/** Sets both the width and height of an element, in [Dp]. */
+public fun Modifier.size(width: Dp, height: Dp): Modifier = this.width(width).height(height)
diff --git a/glance/glance/src/androidMain/kotlin/androidx/glance/layout/Padding.kt b/glance/glance/src/androidMain/kotlin/androidx/glance/layout/Padding.kt
new file mode 100644
index 0000000..2cfa1d4
--- /dev/null
+++ b/glance/glance/src/androidMain/kotlin/androidx/glance/layout/Padding.kt
@@ -0,0 +1,106 @@
+@file:OptIn(GlanceInternalApi::class)
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * 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.
+ */
+package androidx.glance.layout
+
+import androidx.glance.unit.Dp
+import androidx.glance.unit.dp
+import androidx.glance.GlanceInternalApi
+import androidx.glance.Modifier
+
+/**
+ * Apply additional space along each edge of the content in [Dp]: [start], [top], [end] and
+ * [bottom]. The start and end edges will be determined by layout direction of the current locale.
+ * Padding is applied before content measurement and takes precedence; content may only be as large
+ * as the remaining space.
+ */
+public fun Modifier.padding(
+ start: Dp = 0.dp,
+ top: Dp = 0.dp,
+ end: Dp = 0.dp,
+ bottom: Dp = 0.dp
+): Modifier = this.then(
+ PaddingModifier(
+ start = start,
+ top = top,
+ end = end,
+ bottom = bottom,
+ rtlAware = true
+ )
+)
+
+/**
+ * Apply [horizontal] dp space along the left and right edges of the content, and [vertical] dp
+ * space along the top and bottom edges.
+ */
+public fun Modifier.padding(
+ horizontal: Dp = 0.dp,
+ vertical: Dp = 0.dp
+): Modifier = this.then(
+ PaddingModifier(
+ start = horizontal,
+ top = vertical,
+ end = horizontal,
+ bottom = vertical,
+ rtlAware = true
+ )
+)
+
+/**
+ * Apply [all] dp of additional space along each edge of the content, left, top, right and bottom.
+ */
+public fun Modifier.padding(all: Dp): Modifier = this.then(
+ PaddingModifier(
+ start = all,
+ top = all,
+ end = all,
+ bottom = all,
+ rtlAware = true
+ )
+)
+
+/**
+ * Apply additional space along each edge of the content in [Dp]: [left], [top], [right] and
+ * [bottom], ignoring the current locale's layout direction.
+ */
+public fun Modifier.absolutePadding(
+ left: Dp = 0.dp,
+ top: Dp = 0.dp,
+ right: Dp = 0.dp,
+ bottom: Dp = 0.dp
+): Modifier = this.then(
+ PaddingModifier(
+ start = left,
+ top = top,
+ end = right,
+ bottom = bottom,
+ rtlAware = false
+ )
+)
+
+@GlanceInternalApi
+public class PaddingModifier(
+ public val start: Dp = 0.dp,
+ public val top: Dp = 0.dp,
+ public val end: Dp = 0.dp,
+ public val bottom: Dp = 0.dp,
+ public val rtlAware: Boolean
+) : Modifier.Element {
+ override fun toString(): String {
+ return "PaddingModifier(start=$start, top=$top, end=$end, bottom=$bottom, " +
+ "rtlAware=$rtlAware)"
+ }
+}
diff --git a/glance/glance/src/androidMain/kotlin/androidx/glance/layout/Row.kt b/glance/glance/src/androidMain/kotlin/androidx/glance/layout/Row.kt
new file mode 100644
index 0000000..b997716
--- /dev/null
+++ b/glance/glance/src/androidMain/kotlin/androidx/glance/layout/Row.kt
@@ -0,0 +1,65 @@
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * 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.
+ */
+
+package androidx.glance.layout
+
+import androidx.compose.runtime.Composable
+import androidx.compose.runtime.ComposeNode
+import androidx.glance.Applier
+import androidx.glance.EmittableWithChildren
+import androidx.glance.GlanceInternalApi
+import androidx.glance.Modifier
+
+@GlanceInternalApi
+public class EmittableRow : EmittableWithChildren() {
+ override var modifier: Modifier = Modifier
+ public var horizontalAlignment: Alignment.Horizontal = Alignment.Start
+ public var verticalAlignment: Alignment.Vertical = Alignment.Top
+}
+
+/**
+ * A layout composable with [content], which lays its children out in a Row.
+ *
+ * By default, the [Row] will size itself to fit the content, unless a [Dimension] constraint has
+ * been provided. When children are smaller than the size of the [Row], they will be placed
+ * within the available space subject to [verticalAlignment] and [horizontalAlignment].
+ *
+ * @param modifier The modifier to be applied to the layout.
+ * @param horizontalAlignment The horizontal alignment to apply to the set of children, when they do
+ * not consume the full width of the [Row] (i.e. whether to push the children towards the start,
+ * center or end of the [Row]).
+ * @param verticalAlignment The horizontal alignment to apply to children when they are smaller
+ * than the height of the [Row]
+ * @param content The content inside the [Row]
+ */
+@OptIn(GlanceInternalApi::class)
+@Composable
+public fun Row(
+ modifier: Modifier = Modifier,
+ horizontalAlignment: Alignment.Horizontal = Alignment.Start,
+ verticalAlignment: Alignment.Vertical = Alignment.Top,
+ content: @Composable () -> Unit
+) {
+ ComposeNode<EmittableRow, Applier>(
+ factory = ::EmittableRow,
+ update = {
+ this.set(modifier) { this.modifier = it }
+ this.set(verticalAlignment) { this.verticalAlignment = it }
+ this.set(horizontalAlignment) { this.horizontalAlignment = it }
+ },
+ content = content
+ )
+}
diff --git a/glance/glance/src/androidMain/kotlin/androidx/glance/layout/Text.kt b/glance/glance/src/androidMain/kotlin/androidx/glance/layout/Text.kt
new file mode 100644
index 0000000..d93cc4cc
--- /dev/null
+++ b/glance/glance/src/androidMain/kotlin/androidx/glance/layout/Text.kt
@@ -0,0 +1,194 @@
+@file:OptIn(GlanceInternalApi::class)
+
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * 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.
+ */
+
+package androidx.glance.layout
+
+import androidx.compose.runtime.Composable
+import androidx.compose.runtime.ComposeNode
+import androidx.compose.runtime.Immutable
+import androidx.compose.runtime.Stable
+import androidx.glance.Applier
+import androidx.glance.Emittable
+import androidx.glance.GlanceInternalApi
+import androidx.glance.Modifier
+import androidx.glance.unit.Sp
+
+/**
+ * Adds a text view to the glance view.
+ */
+@Composable
+public fun Text(text: String, modifier: Modifier = Modifier, style: TextStyle? = null) {
+ ComposeNode<EmittableText, Applier>(
+ factory = ::EmittableText,
+ update = {
+ this.set(text) { this.text = it }
+ this.set(modifier) { this.modifier = it }
+ this.set(style) { this.style = it }
+ }
+ )
+}
+
+/**
+ * Description of a text style for the [Text] composable.
+ */
+@Immutable
+public class TextStyle(
+ public val size: Sp? = null,
+ public val fontWeight: FontWeight? = null,
+ public val fontStyle: FontStyle? = null,
+ public val textDecoration: TextDecoration? = null
+) {
+ override fun equals(other: Any?): Boolean {
+ if (this === other) return true
+ if (javaClass != other?.javaClass) return false
+
+ other as TextStyle
+
+ if (size != other.size) return false
+ if (fontWeight != other.fontWeight) return false
+ if (fontStyle != other.fontStyle) return false
+ if (textDecoration != other.textDecoration) return false
+
+ return true
+ }
+
+ override fun hashCode(): Int {
+ var result = size.hashCode()
+ result = 31 * result + fontWeight.hashCode()
+ result = 31 * result + fontStyle.hashCode()
+ result = 31 * result + textDecoration.hashCode()
+ return result
+ }
+
+ override fun toString() =
+ "TextStyle(size=$size, fontWeight=$fontWeight, fontStyle=$fontStyle, " +
+ "textDecoration=$textDecoration)"
+}
+
+/**
+ * Weight of a font.
+ */
+@Suppress("INLINE_CLASS_DEPRECATED")
+public inline class FontWeight private constructor(private val weight: Int) {
+ public companion object {
+ public val Normal: FontWeight = FontWeight(400)
+ public val Medium: FontWeight = FontWeight(500)
+ public val Bold: FontWeight = FontWeight(700)
+ }
+}
+
+/**
+ * Describes the style of the font: [Normal]] or [Italic].
+ */
+@Suppress("INLINE_CLASS_DEPRECATED")
+public inline class FontStyle private constructor(private val style: Int) {
+ public companion object {
+ /** Use the upright glyphs */
+ public val Normal: FontStyle = FontStyle(0)
+
+ /** Use glyphs designed for slanting */
+ public val Italic: FontStyle = FontStyle(1)
+
+ /** Returns a list of possible values of [FontStyle]. */
+ public fun values(): List<FontStyle> = listOf(Normal, Italic)
+ }
+
+ override fun toString(): String {
+ return when (this) {
+ Normal -> "Normal"
+ Italic -> "Italic"
+ else -> "Invalid"
+ }
+ }
+}
+
+/**
+ * Defines a horizontal line to be drawn on the text.
+ */
+@Suppress("INLINE_CLASS_DEPRECATED")
+public inline class TextDecoration internal constructor(private val mask: Int) {
+ public companion object {
+ public val None: TextDecoration = TextDecoration(0x0)
+
+ /**
+ * Draws a horizontal line below the text.
+ */
+ public val Underline: TextDecoration = TextDecoration(0x1)
+
+ /**
+ * Draws a horizontal line over the text.
+ *
+ * Note: This will have no effect if used on Wear Tiles.
+ */
+ public val LineThrough: TextDecoration = TextDecoration(0x2)
+
+ /**
+ * Creates a decoration that includes all the given decorations.
+ *
+ * @param decorations The decorations to be added
+ */
+ public fun combine(decorations: List<TextDecoration>): TextDecoration {
+ val mask = decorations.fold(0) { acc, decoration ->
+ acc or decoration.mask
+ }
+ return TextDecoration(mask)
+ }
+ }
+ /**
+ * Creates a decoration that includes both of the TextDecorations.
+ */
+ @Stable
+ public operator fun plus(decoration: TextDecoration): TextDecoration {
+ return TextDecoration(this.mask or decoration.mask)
+ }
+
+ /**
+ * Check whether this [TextDecoration] contains the given decoration.
+ */
+ @Stable
+ public operator fun contains(other: TextDecoration): Boolean {
+ return (mask or other.mask) == mask
+ }
+
+ override fun toString(): String {
+ if (mask == 0) {
+ return "TextDecoration.None"
+ }
+
+ val values: MutableList<String> = mutableListOf()
+ if ((mask and Underline.mask) != 0) {
+ values.add("Underline")
+ }
+ if ((mask and LineThrough.mask) != 0) {
+ values.add("LineThrough")
+ }
+ if ((values.size == 1)) {
+ return "TextDecoration.${values[0]}"
+ }
+ return "TextDecoration[${values.joinToString(separator = ", ")}]"
+ }
+}
+
+@GlanceInternalApi
+public class EmittableText : Emittable {
+ override var modifier: Modifier = Modifier
+ public var text: String = ""
+ public var style: TextStyle? = null
+
+ override fun toString(): String = "EmittableText($text, style=$style, modifier=$modifier)"
+}
diff --git a/glance/glance/src/androidMain/kotlin/androidx/glance/unit/Color.kt b/glance/glance/src/androidMain/kotlin/androidx/glance/unit/Color.kt
new file mode 100644
index 0000000..6ecabae
--- /dev/null
+++ b/glance/glance/src/androidMain/kotlin/androidx/glance/unit/Color.kt
@@ -0,0 +1,131 @@
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * 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.
+ */
+
+package androidx.glance.unit
+
+import androidx.compose.runtime.Stable
+
+/**
+ * The [Color] class contains color information to be used while drawing elements. [Color] supports
+ * colors encoded in the ARGB format.
+ */
+@Suppress("INLINE_CLASS_DEPRECATED")
+public inline class Color(public val value: UInt) {
+ public constructor(value: Long) : this(value.toUInt())
+
+ /**
+ * Returns the value of the red component of this [Color]. Return values are in the range
+ * 0.0 - 1.0.
+ */
+ @Stable
+ public val red: Float
+ get() {
+ return ((value shr 16) and 0xFFu).toFloat() / 255.0f
+ }
+
+ /**
+ * Returns the value of the green component of this [Color]. Return values are in the range
+ * 0.0 - 1.0.
+ */
+ @Stable
+ public val green: Float
+ get() {
+ return ((value shr 8) and 0xFFu).toFloat() / 255.0f
+ }
+
+ /**
+ * Returns the value of the blue component of this [Color]. Return values are in the range
+ * 0.0 - 1.0.
+ */
+ @Stable
+ public val blue: Float
+ get() {
+ return ((value shr 0) and 0xFFu).toFloat() / 255.0f
+ }
+
+ /**
+ * Returns the value of the alpha] component of this [Color]. Return values are in the range
+ * 0.0 - 1.0.
+ */
+ @Stable
+ public val alpha: Float
+ get() {
+ return ((value shr 24) and 0xFFu).toFloat() / 255.0f
+ }
+
+ override fun toString(): String {
+ return "Color($red, $green, $blue, $alpha)"
+ }
+
+ public companion object {
+ @Stable
+ public val Black: Color = Color(0xFF000000u)
+
+ @Stable
+ public val DarkGray: Color = Color(0xFF444444u)
+
+ @Stable
+ public val Gray: Color = Color(0xFF888888u)
+
+ @Stable
+ public val LightGray: Color = Color(0xFFCCCCCCu)
+
+ @Stable
+ public val White: Color = Color(0xFFFFFFFFu)
+
+ @Stable
+ public val Red: Color = Color(0xFFFF0000u)
+
+ @Stable
+ public val Green: Color = Color(0xFF00FF00u)
+
+ @Stable
+ public val Blue: Color = Color(0xFF0000FFu)
+
+ @Stable
+ public val Yellow: Color = Color(0xFFFFFF00u)
+
+ @Stable
+ public val Cyan: Color = Color(0xFF00FFFFu)
+
+ @Stable
+ public val Magenta: Color = Color(0xFFFF00FFu)
+
+ @Stable
+ public val Transparent: Color = Color(0x00000000u)
+ }
+}
+
+/**
+ * Create a [Color] by passing individual [red], [green], [blue] and [alpha] components. The
+ * default [alpha] is `1.0` if omitted.
+ */
+@Stable
+public fun Color(
+ red: Float,
+ green: Float,
+ blue: Float,
+ alpha: Float = 1.0f
+): Color {
+ val argb = (
+ ((alpha * 255.0f + 0.5f).toInt() shl 24) or
+ ((red * 255.0f + 0.5f).toInt() shl 16) or
+ ((green * 255.0f + 0.5f).toInt() shl 8) or
+ (blue * 255.0f + 0.5f).toInt()
+ )
+
+ return Color(value = argb.toUInt())
+}
diff --git a/glance/glance/src/androidMain/kotlin/androidx/glance/unit/Dp.kt b/glance/glance/src/androidMain/kotlin/androidx/glance/unit/Dp.kt
new file mode 100644
index 0000000..c56dedf
--- /dev/null
+++ b/glance/glance/src/androidMain/kotlin/androidx/glance/unit/Dp.kt
@@ -0,0 +1,120 @@
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * 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.
+ */
+
+package androidx.glance.unit
+
+import kotlin.math.max
+import kotlin.math.min
+
+/**
+ * Dimension value representing device-independent pixels (dp). Component APIs specify their
+ * dimensions such as line thickness in DP with Dp objects. Dp are normally defined using [dp],
+ * which can be applied to [Int], [Double], and [Float].
+ * val leftMargin = 10.dp
+ * val rightMargin = 10f.dp
+ * val topMargin = 20.0.dp
+ * val bottomMargin = 10.dp
+ */
+@Suppress("INLINE_CLASS_DEPRECATED", "EXPERIMENTAL_FEATURE_WARNING")
+public inline class Dp(public val value: Float) : Comparable<Dp> {
+ /**
+ * Add two [Dp]s together.
+ */
+ public operator fun plus(other: Dp): Dp =
+ Dp(value = this.value + other.value)
+
+ /**
+ * Subtract a Dp from another one.
+ */
+ public operator fun minus(other: Dp): Dp =
+ Dp(value = this.value - other.value)
+
+ /**
+ * This is the same as multiplying the Dp by -1.0.
+ */
+ public operator fun unaryMinus(): Dp = Dp(-value)
+
+ /**
+ * Divide a Dp by a scalar.
+ */
+ public operator fun div(other: Float): Dp =
+ Dp(value = value / other)
+
+ public operator fun div(other: Int): Dp =
+ Dp(value = value / other)
+
+ /**
+ * Divide by another Dp to get a scalar.
+ */
+ public operator fun div(other: Dp): Float = value / other.value
+
+ /**
+ * Multiply a Dp by a scalar.
+ */
+ public operator fun times(other: Float): Dp =
+ Dp(value = value * other)
+
+ public operator fun times(other: Int): Dp =
+ Dp(value = value * other)
+
+ /**
+ * Support comparing Dimensions with comparison operators.
+ */
+ override /* TODO: inline */ operator fun compareTo(other: Dp): Int =
+ value.compareTo(other.value)
+
+ override fun toString(): String = "$value.dp"
+}
+
+/**
+ * Create a [Dp] using an [Int]:
+ * val left = 10
+ * val x = left.dp
+ * // -- or --
+ * val y = 10.dp
+ */
+public inline val Int.dp: Dp get() = Dp(value = this.toFloat())
+
+/**
+ * Create a [Dp] using a [Double]:
+ * val left = 10.0
+ * val x = left.dp
+ * // -- or --
+ * val y = 10.0.dp
+ */
+public inline val Double.dp: Dp get() = Dp(value = this.toFloat())
+
+/**
+ * Create a [Dp] using a [Float]:
+ * val left = 10f
+ * val x = left.dp
+ * // -- or --
+ * val y = 10f.dp
+ */
+public inline val Float.dp: Dp get() = Dp(value = this)
+
+public operator fun Float.times(other: Dp): Dp =
+ Dp(this * other.value)
+
+public operator fun Double.times(other: Dp): Dp =
+ Dp(this.toFloat() * other.value)
+
+public operator fun Int.times(other: Dp): Dp =
+ Dp(this * other.value)
+
+public fun min(a: Dp, b: Dp): Dp = Dp(value = min(a.value, b.value))
+
+public fun max(a: Dp, b: Dp): Dp = Dp(value = max(a.value, b.value))
diff --git a/glance/glance/src/androidMain/kotlin/androidx/glance/unit/DpSize.kt b/glance/glance/src/androidMain/kotlin/androidx/glance/unit/DpSize.kt
new file mode 100644
index 0000000..61e803d
--- /dev/null
+++ b/glance/glance/src/androidMain/kotlin/androidx/glance/unit/DpSize.kt
@@ -0,0 +1,124 @@
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * 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.
+ */
+
+package androidx.glance.unit
+
+import androidx.compose.runtime.Immutable
+import androidx.compose.runtime.Stable
+
+/**
+ * A two-dimensional Size using [Dp] for units.
+ *
+ * @property width The horizontal aspect of the size in [Dp]
+ * @property height The vertical aspect of the size in [Dp]
+ */
+@Immutable
+public class DpSize(
+ public val width: Dp,
+ public val height: Dp,
+) {
+ override fun equals(other: Any?): Boolean {
+ if (this === other) return true
+ if (javaClass != other?.javaClass) return false
+
+ other as DpSize
+
+ if (width != other.width) return false
+ if (height != other.height) return false
+
+ return true
+ }
+
+ override fun hashCode(): Int {
+ var result = width.hashCode()
+ result = 31 * result + height.hashCode()
+ return result
+ }
+
+ override fun toString(): String {
+ return "DpSize(width=$width, height=$height)"
+ }
+
+ /**
+ * Returns a copy of this [DpSize] instance optionally overriding the
+ * width or height parameter
+ */
+ fun copy(width: Dp = this.width, height: Dp = this.height) =
+ DpSize(width, height)
+
+ /**
+ * Adds a [DpSize] to another one.
+ */
+ @Stable
+ public operator fun plus(other: DpSize): DpSize =
+ DpSize(width + other.width, height + other.height)
+
+ /**
+ * Subtracts a [DpSize] from another one.
+ */
+ @Stable
+ public operator fun minus(other: DpSize): DpSize =
+ DpSize(width - other.width, height - other.height)
+
+ @Stable
+ public operator fun component1(): Dp = width
+
+ @Stable
+ public operator fun component2(): Dp = height
+
+ /**
+ * Multiplies the components of a [DpSize] by a constant factor.
+ */
+ @Stable
+ public operator fun times(other: Int): DpSize = DpSize(width * other, height * other)
+
+ /**
+ * Multiplies the components of a [DpSize] by a constant factor.
+ */
+ @Stable
+ public operator fun times(other: Float): DpSize = DpSize(width * other, height * other)
+
+ /**
+ * Divides the components of a [DpSize] by a constant factor.
+ */
+ @Stable
+ public operator fun div(other: Int): DpSize = DpSize(width / other, height / other)
+
+ /**
+ * Divides the components of a [DpSize] by a constant factor.
+ */
+ @Stable
+ public operator fun div(other: Float): DpSize = DpSize(width / other, height / other)
+
+ companion object {
+ /**
+ * A [DpSize] with 0 DP [width] and 0 DP [height] values.
+ */
+ val Zero = DpSize(0.dp, 0.dp)
+ }
+}
+
+/**
+ * Multiplies the components of a [DpSize] by a constant factor.
+ */
+@Stable
+public operator fun Int.times(size: DpSize) = size * this
+
+/**
+ * Multiplies the components of a [DpSize] by a constant factor.
+ */
+@Stable
+public operator fun Float.times(size: DpSize) = size * this
diff --git a/glance/glance/src/androidMain/kotlin/androidx/glance/unit/Sp.kt b/glance/glance/src/androidMain/kotlin/androidx/glance/unit/Sp.kt
new file mode 100644
index 0000000..ba77e7e
--- /dev/null
+++ b/glance/glance/src/androidMain/kotlin/androidx/glance/unit/Sp.kt
@@ -0,0 +1,120 @@
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * 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.
+ */
+
+package androidx.glance.unit
+
+import kotlin.math.max
+import kotlin.math.min
+
+/**
+ * Dimension value representing scale-independent pixels (sp). Component APIs specify their
+ * text size in SP with Sp objects. Sp are normally defined using [sp], which can be applied to
+ * [Int], [Double], and [Float].
+ * val titleSize = 10.sp
+ * val rightMargin = 10f.sp
+ * val topMargin = 20.0.sp
+ * val bottomMargin = 10.sp
+ */
+@Suppress("INLINE_CLASS_DEPRECATED", "EXPERIMENTAL_FEATURE_WARNING")
+public inline class Sp(public val value: Float) : Comparable<Sp> {
+ /**
+ * Add two [Sp]s together.
+ */
+ public operator fun plus(other: Sp): Sp =
+ Sp(value = this.value + other.value)
+
+ /**
+ * Subtract a Sp from another one.
+ */
+ public operator fun minus(other: Sp): Sp =
+ Sp(value = this.value - other.value)
+
+ /**
+ * This is the same as multiplying the Sp by -1.0.
+ */
+ public operator fun unaryMinus(): Sp = Sp(-value)
+
+ /**
+ * Divide a Sp by a scalar.
+ */
+ public operator fun div(other: Float): Sp =
+ Sp(value = value / other)
+
+ public operator fun div(other: Int): Sp =
+ Sp(value = value / other)
+
+ /**
+ * Divide by another Sp to get a scalar.
+ */
+ public operator fun div(other: Sp): Float = value / other.value
+
+ /**
+ * Multiply a Sp by a scalar.
+ */
+ public operator fun times(other: Float): Sp =
+ Sp(value = value * other)
+
+ public operator fun times(other: Int): Sp =
+ Sp(value = value * other)
+
+ /**
+ * Support comparing Dimensions with comparison operators.
+ */
+ override /* TODO: inline */ operator fun compareTo(other: Sp): Int =
+ value.compareTo(other.value)
+
+ override fun toString(): String = "$value.dp"
+}
+
+/**
+ * Create a [Sp] using an [Int]:
+ * val left = 10
+ * val x = left.dp
+ * // -- or --
+ * val y = 10.dp
+ */
+public inline val Int.sp: Sp get() = Sp(value = this.toFloat())
+
+/**
+ * Create a [Sp] using a [Double]:
+ * val left = 10.0
+ * val x = left.dp
+ * // -- or --
+ * val y = 10.0.dp
+ */
+public inline val Double.sp: Sp get() = Sp(value = this.toFloat())
+
+/**
+ * Create a [Sp] using a [Float]:
+ * val left = 10f
+ * val x = left.dp
+ * // -- or --
+ * val y = 10f.dp
+ */
+public inline val Float.sp: Sp get() = Sp(value = this)
+
+public operator fun Float.times(other: Sp): Sp =
+ Sp(this * other.value)
+
+public operator fun Double.times(other: Sp): Sp =
+ Sp(this.toFloat() * other.value)
+
+public operator fun Int.times(other: Sp): Sp =
+ Sp(this * other.value)
+
+public fun min(a: Sp, b: Sp): Sp = Sp(value = min(a.value, b.value))
+
+public fun max(a: Sp, b: Sp): Sp = Sp(value = max(a.value, b.value))
diff --git a/glance/glance/src/test/kotlin/androidx/glance/ApplierTest.kt b/glance/glance/src/test/kotlin/androidx/glance/ApplierTest.kt
index 740994c..7184429 100644
--- a/glance/glance/src/test/kotlin/androidx/glance/ApplierTest.kt
+++ b/glance/glance/src/test/kotlin/androidx/glance/ApplierTest.kt
@@ -18,8 +18,12 @@
package androidx.glance
import com.google.common.truth.Truth.assertThat
+import kotlinx.coroutines.ExperimentalCoroutinesApi
import org.junit.Test
+import java.lang.IllegalArgumentException
+import kotlin.test.assertFailsWith
+@OptIn(GlanceInternalApi::class, ExperimentalCoroutinesApi::class)
class ApplierTest {
@Test
@@ -86,6 +90,24 @@
assertThat(root.children[0]).isInstanceOf(LeafEmittable::class.java)
}
+ @Test
+ fun limitDepth() {
+ val root = RootEmittable(maxDepth = 1)
+ val applier = Applier(root)
+
+ applier.insertTopDown(0, LeafEmittable())
+ val m = MiddleEmittable()
+ applier.insertTopDown(1, m)
+ applier.down(m)
+ val ex = assertFailsWith<IllegalArgumentException> {
+ applier.insertTopDown(0, LeafEmittable())
+ }
+ assertThat(ex.message).isEqualTo(
+ "Too many embedded views for the current surface. " +
+ "The maximum depth is: 1"
+ )
+ }
+
private companion object {
fun updateApplier(applier: Applier) {
val middle = MiddleEmittable()
@@ -98,7 +120,7 @@
}
}
-private class RootEmittable : EmittableWithChildren() {
+private class RootEmittable(maxDepth: Int = Int.MAX_VALUE) : EmittableWithChildren(maxDepth) {
override var modifier: Modifier = Modifier
}
diff --git a/glance/glance/src/test/kotlin/androidx/glance/layout/BoxTest.kt b/glance/glance/src/test/kotlin/androidx/glance/layout/BoxTest.kt
new file mode 100644
index 0000000..4c7f9d9
--- /dev/null
+++ b/glance/glance/src/test/kotlin/androidx/glance/layout/BoxTest.kt
@@ -0,0 +1,96 @@
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * 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.
+ */
+
+package androidx.glance.layout
+
+import androidx.glance.GlanceInternalApi
+import androidx.glance.Modifier
+import androidx.glance.findModifier
+import androidx.glance.unit.dp
+import com.google.common.truth.Truth.assertThat
+import kotlinx.coroutines.ExperimentalCoroutinesApi
+import kotlinx.coroutines.test.TestCoroutineScope
+import kotlinx.coroutines.test.runBlockingTest
+import org.junit.Before
+import org.junit.Test
+
+@OptIn(GlanceInternalApi::class, ExperimentalCoroutinesApi::class)
+class BoxTest {
+ private lateinit var fakeCoroutineScope: TestCoroutineScope
+
+ @Before
+ fun setUp() {
+ fakeCoroutineScope = TestCoroutineScope()
+ }
+
+ @Test
+ fun createComposableBox() = fakeCoroutineScope.runBlockingTest {
+ val root = runTestingComposition {
+ Box {}
+ }
+
+ // Outer box (added by runTestingComposition) should have a single child box.
+ assertThat(root.children).hasSize(1)
+ assertThat(root.children[0]).isInstanceOf(EmittableBox::class.java)
+
+ // The Box added above should not have any other children.
+ assertThat((root.children[0] as EmittableBox).children).hasSize(0)
+ }
+
+ @Test
+ fun createComposableBoxWithModifier() = fakeCoroutineScope.runBlockingTest {
+ val root = runTestingComposition {
+ Box(modifier = Modifier.padding(1.dp)) {}
+ }
+
+ val innerBox = root.children[0] as EmittableBox
+ val paddingModifier = requireNotNull(innerBox.modifier.findModifier<PaddingModifier>())
+
+ // Don't need to test all elements, that's covered in PaddingTest
+ assertThat(paddingModifier.top).isEqualTo(1.dp)
+ }
+
+ @Test
+ fun createComposableBoxWithAlignment() = fakeCoroutineScope.runBlockingTest {
+ val root = runTestingComposition {
+ Box(contentAlignment = Alignment.Center) {}
+ }
+
+ val innerBox = root.children[0] as EmittableBox
+
+ assertThat(innerBox.contentAlignment).isEqualTo(Alignment.Center)
+ }
+
+ @Test
+ fun createComposableBoxWithChildren() = fakeCoroutineScope.runBlockingTest {
+ val root = runTestingComposition {
+ Box(contentAlignment = Alignment.Center) {
+ Box(contentAlignment = Alignment.BottomCenter) {}
+ Box(contentAlignment = Alignment.TopCenter) {}
+ }
+ }
+
+ val innerBox = root.children[0] as EmittableBox
+
+ assertThat(innerBox.children).hasSize(2)
+
+ val leafBox0 = innerBox.children[0] as EmittableBox
+ val leafBox1 = innerBox.children[1] as EmittableBox
+
+ assertThat(leafBox0.contentAlignment).isEqualTo(Alignment.BottomCenter)
+ assertThat(leafBox1.contentAlignment).isEqualTo(Alignment.TopCenter)
+ }
+}
\ No newline at end of file
diff --git a/glance/glance/src/test/kotlin/androidx/glance/layout/ColumnTest.kt b/glance/glance/src/test/kotlin/androidx/glance/layout/ColumnTest.kt
new file mode 100644
index 0000000..80532e9
--- /dev/null
+++ b/glance/glance/src/test/kotlin/androidx/glance/layout/ColumnTest.kt
@@ -0,0 +1,83 @@
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * 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.
+ */
+
+package androidx.glance.layout
+
+import androidx.glance.GlanceInternalApi
+import androidx.glance.Modifier
+import androidx.glance.findModifier
+import androidx.glance.unit.dp
+import com.google.common.truth.Truth.assertThat
+import kotlinx.coroutines.ExperimentalCoroutinesApi
+import kotlinx.coroutines.test.TestCoroutineScope
+import kotlinx.coroutines.test.runBlockingTest
+import org.junit.Before
+import org.junit.Test
+
+@OptIn(GlanceInternalApi::class, ExperimentalCoroutinesApi::class)
+class ColumnTest {
+ private lateinit var fakeCoroutineScope: TestCoroutineScope
+
+ @Before
+ fun setUp() {
+ fakeCoroutineScope = TestCoroutineScope()
+ }
+
+ @Test
+ fun createComposableRow() = fakeCoroutineScope.runBlockingTest {
+ val root = runTestingComposition {
+ Column {}
+ }
+
+ assertThat(root.children).hasSize(1)
+ assertThat(root.children[0]).isInstanceOf(EmittableColumn::class.java)
+ assertThat((root.children[0] as EmittableColumn).children).hasSize(0)
+ }
+
+ @Test
+ fun createComposableRowWithParams() = fakeCoroutineScope.runBlockingTest {
+ val root = runTestingComposition {
+ Column(
+ modifier = Modifier.padding(2.dp),
+ horizontalAlignment = Alignment.CenterHorizontally,
+ verticalAlignment = Alignment.CenterVertically
+ ) {}
+ }
+
+ val innerColumn = root.children[0] as EmittableColumn
+ val paddingModifier = requireNotNull(innerColumn.modifier.findModifier<PaddingModifier>())
+ assertThat(paddingModifier.top).isEqualTo(2.dp)
+ assertThat(innerColumn.horizontalAlignment).isEqualTo(Alignment.CenterHorizontally)
+ assertThat(innerColumn.verticalAlignment).isEqualTo(Alignment.CenterVertically)
+ }
+
+ @Test
+ fun createComposableRowWithChildren() = fakeCoroutineScope.runBlockingTest {
+ val root = runTestingComposition {
+ Column {
+ Box(contentAlignment = Alignment.BottomCenter) {}
+ Box(contentAlignment = Alignment.TopCenter) {}
+ }
+ }
+
+ val innerColumn = root.children[0] as EmittableColumn
+ val leafBox0 = innerColumn.children[0] as EmittableBox
+ val leafBox1 = innerColumn.children[1] as EmittableBox
+
+ assertThat(leafBox0.contentAlignment).isEqualTo(Alignment.BottomCenter)
+ assertThat(leafBox1.contentAlignment).isEqualTo(Alignment.TopCenter)
+ }
+}
\ No newline at end of file
diff --git a/glance/glance/src/test/kotlin/androidx/glance/layout/DimensionTest.kt b/glance/glance/src/test/kotlin/androidx/glance/layout/DimensionTest.kt
new file mode 100644
index 0000000..394c9de
--- /dev/null
+++ b/glance/glance/src/test/kotlin/androidx/glance/layout/DimensionTest.kt
@@ -0,0 +1,107 @@
+@file:OptIn(GlanceInternalApi::class)
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * 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.
+ */
+
+package androidx.glance.layout
+
+import androidx.glance.GlanceInternalApi
+import androidx.glance.Modifier
+import androidx.glance.findModifier
+import androidx.glance.unit.dp
+import com.google.common.truth.Truth.assertThat
+import org.junit.Test
+
+class DimensionTest {
+ @Test
+ fun absoluteWidthModifier() {
+ val modifier = Modifier.width(5.dp)
+
+ val widthModifier = checkNotNull(modifier.findModifier<WidthModifier>())
+
+ val width = widthModifier.width as Dimension.Dp
+ assertThat(width.dp).isEqualTo(5.dp)
+ }
+
+ @Test
+ fun wrapWidthModifier() {
+ val modifier = Modifier.wrapWidth()
+
+ val widthModifier = checkNotNull(modifier.findModifier<WidthModifier>())
+ assertThat(widthModifier.width).isInstanceOf(Dimension.Wrap::class.java)
+ }
+
+ @Test
+ fun expandWidthModifier() {
+ val modifier = Modifier.expandWidth()
+
+ val widthModifier = checkNotNull(modifier.findModifier<WidthModifier>())
+ assertThat(widthModifier.width).isInstanceOf(Dimension.Expand::class.java)
+ }
+
+ @Test
+ fun absoluteHeightModifier() {
+ val modifier = Modifier.height(5.dp)
+
+ val heightModifier = checkNotNull(modifier.findModifier<HeightModifier>())
+
+ val height = heightModifier.height as Dimension.Dp
+ assertThat(height.dp).isEqualTo(5.dp)
+ }
+
+ @Test
+ fun wrapHeightModifier() {
+ val modifier = Modifier.wrapHeight()
+
+ val heightModifier = checkNotNull(modifier.findModifier<HeightModifier>())
+ assertThat(heightModifier.height).isInstanceOf(Dimension.Wrap::class.java)
+ }
+
+ @Test
+ fun expandHeightModifier() {
+ val modifier = Modifier.expandHeight()
+
+ val heightModifier = checkNotNull(modifier.findModifier<HeightModifier>())
+ assertThat(heightModifier.height).isInstanceOf(Dimension.Expand::class.java)
+ }
+
+ @Test
+ fun sizeModifier() {
+ val modifier = Modifier.size(1.dp, 2.dp)
+
+ val widthModifier = checkNotNull(modifier.findModifier<WidthModifier>())
+ val heightModifier = checkNotNull(modifier.findModifier<HeightModifier>())
+
+ val width = widthModifier.width as Dimension.Dp
+ val height = heightModifier.height as Dimension.Dp
+
+ assertThat(width.dp).isEqualTo(1.dp)
+ assertThat(height.dp).isEqualTo(2.dp)
+ }
+
+ @Test
+ fun combinedSizeModifier() {
+ val modifier = Modifier.size(10.dp)
+
+ val widthModifier = checkNotNull(modifier.findModifier<WidthModifier>())
+ val heightModifier = checkNotNull(modifier.findModifier<HeightModifier>())
+
+ val width = widthModifier.width as Dimension.Dp
+ val height = heightModifier.height as Dimension.Dp
+
+ assertThat(width.dp).isEqualTo(10.dp)
+ assertThat(height.dp).isEqualTo(10.dp)
+ }
+}
diff --git a/glance/glance/src/test/kotlin/androidx/glance/layout/PaddingTest.kt b/glance/glance/src/test/kotlin/androidx/glance/layout/PaddingTest.kt
new file mode 100644
index 0000000..51d72a1
--- /dev/null
+++ b/glance/glance/src/test/kotlin/androidx/glance/layout/PaddingTest.kt
@@ -0,0 +1,87 @@
+@file:OptIn(GlanceInternalApi::class)
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * 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.
+ */
+package androidx.glance.layout
+
+import androidx.glance.GlanceInternalApi
+import androidx.glance.Modifier
+import androidx.glance.findModifier
+import androidx.glance.unit.dp
+import com.google.common.truth.Truth.assertThat
+import org.junit.Test
+
+class PaddingTest {
+ @Test
+ fun buildPadding() {
+ val modifiers = Modifier.padding(
+ start = 1.dp,
+ top = 2.dp,
+ end = 3.dp,
+ bottom = 4.dp
+ )
+
+ // Find the padding modifier...
+ val paddingModifier = checkNotNull(modifiers.findModifier<PaddingModifier>())
+
+ assertThat(paddingModifier.rtlAware).isTrue()
+ assertThat(paddingModifier.start).isEqualTo(1.dp)
+ assertThat(paddingModifier.top).isEqualTo(2.dp)
+ assertThat(paddingModifier.end).isEqualTo(3.dp)
+ assertThat(paddingModifier.bottom).isEqualTo(4.dp)
+ }
+
+ @Test
+ fun buildVerticalHorizontalPadding() {
+ val modifiers = Modifier.padding(vertical = 2.dp, horizontal = 4.dp)
+
+ val paddingModifier = checkNotNull(modifiers.findModifier<PaddingModifier>())
+
+ assertThat(paddingModifier.start).isEqualTo(4.dp)
+ assertThat(paddingModifier.top).isEqualTo(2.dp)
+ assertThat(paddingModifier.end).isEqualTo(4.dp)
+ assertThat(paddingModifier.bottom).isEqualTo(2.dp)
+ }
+
+ @Test
+ fun buildAllPadding() {
+ val modifiers = Modifier.padding(all = 5.dp)
+
+ val paddingModifier = checkNotNull(modifiers.findModifier<PaddingModifier>())
+
+ assertThat(paddingModifier.start).isEqualTo(5.dp)
+ assertThat(paddingModifier.top).isEqualTo(5.dp)
+ assertThat(paddingModifier.end).isEqualTo(5.dp)
+ assertThat(paddingModifier.bottom).isEqualTo(5.dp)
+ }
+
+ @Test
+ fun buildAbsolutePadding() {
+ val modifiers = Modifier.absolutePadding(
+ left = 1.dp,
+ top = 2.dp,
+ right = 3.dp,
+ bottom = 4.dp
+ )
+
+ val paddingModifier = checkNotNull(modifiers.findModifier<PaddingModifier>())
+
+ assertThat(paddingModifier.rtlAware).isFalse()
+ assertThat(paddingModifier.start).isEqualTo(1.dp)
+ assertThat(paddingModifier.top).isEqualTo(2.dp)
+ assertThat(paddingModifier.end).isEqualTo(3.dp)
+ assertThat(paddingModifier.bottom).isEqualTo(4.dp)
+ }
+}
diff --git a/glance/glance/src/test/kotlin/androidx/glance/layout/RowTest.kt b/glance/glance/src/test/kotlin/androidx/glance/layout/RowTest.kt
new file mode 100644
index 0000000..44296f3
--- /dev/null
+++ b/glance/glance/src/test/kotlin/androidx/glance/layout/RowTest.kt
@@ -0,0 +1,83 @@
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * 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.
+ */
+
+package androidx.glance.layout
+
+import androidx.glance.GlanceInternalApi
+import androidx.glance.Modifier
+import androidx.glance.findModifier
+import androidx.glance.unit.dp
+import com.google.common.truth.Truth.assertThat
+import kotlinx.coroutines.ExperimentalCoroutinesApi
+import kotlinx.coroutines.test.TestCoroutineScope
+import kotlinx.coroutines.test.runBlockingTest
+import org.junit.Before
+import org.junit.Test
+
+@OptIn(GlanceInternalApi::class, ExperimentalCoroutinesApi::class)
+class RowTest {
+ private lateinit var fakeCoroutineScope: TestCoroutineScope
+
+ @Before
+ fun setUp() {
+ fakeCoroutineScope = TestCoroutineScope()
+ }
+
+ @Test
+ fun createComposableRow() = fakeCoroutineScope.runBlockingTest {
+ val root = runTestingComposition {
+ Row {}
+ }
+
+ assertThat(root.children).hasSize(1)
+ assertThat(root.children[0]).isInstanceOf(EmittableRow::class.java)
+ assertThat((root.children[0] as EmittableRow).children).hasSize(0)
+ }
+
+ @Test
+ fun createComposableRowWithParams() = fakeCoroutineScope.runBlockingTest {
+ val root = runTestingComposition {
+ Row(
+ modifier = Modifier.padding(2.dp),
+ verticalAlignment = Alignment.Bottom,
+ horizontalAlignment = Alignment.End
+ ) {}
+ }
+
+ val innerRow = root.children[0] as EmittableRow
+ val paddingModifier = requireNotNull(innerRow.modifier.findModifier<PaddingModifier>())
+ assertThat(paddingModifier.top).isEqualTo(2.dp)
+ assertThat(innerRow.verticalAlignment).isEqualTo(Alignment.Bottom)
+ assertThat(innerRow.horizontalAlignment).isEqualTo(Alignment.End)
+ }
+
+ @Test
+ fun createComposableRowWithChildren() = fakeCoroutineScope.runBlockingTest {
+ val root = runTestingComposition {
+ Row {
+ Box(contentAlignment = Alignment.BottomCenter) {}
+ Box(contentAlignment = Alignment.TopCenter) {}
+ }
+ }
+
+ val innerRow = root.children[0] as EmittableRow
+ val leafBox0 = innerRow.children[0] as EmittableBox
+ val leafBox1 = innerRow.children[1] as EmittableBox
+
+ assertThat(leafBox0.contentAlignment).isEqualTo(Alignment.BottomCenter)
+ assertThat(leafBox1.contentAlignment).isEqualTo(Alignment.TopCenter)
+ }
+}
\ No newline at end of file
diff --git a/glance/glance/src/test/kotlin/androidx/glance/layout/TextTest.kt b/glance/glance/src/test/kotlin/androidx/glance/layout/TextTest.kt
new file mode 100644
index 0000000..2cdf56b
--- /dev/null
+++ b/glance/glance/src/test/kotlin/androidx/glance/layout/TextTest.kt
@@ -0,0 +1,103 @@
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * 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.
+ */
+
+package androidx.glance.layout
+
+import androidx.glance.GlanceInternalApi
+import androidx.glance.Modifier
+import androidx.glance.findModifier
+import androidx.glance.unit.sp
+import com.google.common.truth.Truth.assertThat
+import kotlinx.coroutines.ExperimentalCoroutinesApi
+import kotlinx.coroutines.test.TestCoroutineScope
+import kotlinx.coroutines.test.runBlockingTest
+import org.junit.Before
+import org.junit.Test
+
+@OptIn(GlanceInternalApi::class, ExperimentalCoroutinesApi::class)
+class TextTest {
+ private lateinit var fakeCoroutineScope: TestCoroutineScope
+
+ @Before
+ fun setUp() {
+ fakeCoroutineScope = TestCoroutineScope()
+ }
+
+ @Test
+ fun createComposableText() = fakeCoroutineScope.runBlockingTest {
+ val root = runTestingComposition {
+ Text("text")
+ }
+
+ assertThat(root.children).hasSize(1)
+ assertThat(root.children[0]).isInstanceOf(EmittableText::class.java)
+ assertThat((root.children[0] as EmittableText).text).isEqualTo("text")
+ }
+
+ @Test
+ fun createComposableTextWithStyle() = fakeCoroutineScope.runBlockingTest {
+ val root = runTestingComposition {
+ Text(
+ "text",
+ style = TextStyle(
+ 20.sp,
+ fontStyle = FontStyle.Italic,
+ fontWeight = FontWeight.Medium
+ )
+ )
+ }
+
+ assertThat(root.children).hasSize(1)
+ assertThat(root.children[0]).isInstanceOf(EmittableText::class.java)
+ val text = root.children[0] as EmittableText
+ assertThat(text.text).isEqualTo("text")
+ assertThat(text.style)
+ .isEqualTo(
+ TextStyle(
+ 20.sp,
+ fontStyle = FontStyle.Italic,
+ fontWeight = FontWeight.Medium
+ )
+ )
+ }
+
+ @Test
+ fun createComposableTextWithModifiers() = fakeCoroutineScope.runBlockingTest {
+ val root = runTestingComposition {
+ Text("text", modifier = Modifier.expandWidth())
+ }
+
+ assertThat(root.children).hasSize(1)
+ assertThat(root.children[0]).isInstanceOf(EmittableText::class.java)
+ assertThat(root.children[0].modifier.findModifier<WidthModifier>()?.width)
+ .isEqualTo(Dimension.Expand)
+ }
+
+ @Test
+ fun textDecoration_plus() {
+ val combined = TextDecoration.LineThrough + TextDecoration.Underline
+ assertThat(TextDecoration.LineThrough in combined).isTrue()
+ assertThat(TextDecoration.Underline in combined).isTrue()
+ }
+
+ @Test
+ fun textDecoration_combine() {
+ val combined =
+ TextDecoration.combine(listOf(TextDecoration.LineThrough, TextDecoration.Underline))
+ assertThat(TextDecoration.LineThrough in combined).isTrue()
+ assertThat(TextDecoration.Underline in combined).isTrue()
+ }
+}
\ No newline at end of file
diff --git a/glance/glance/src/test/kotlin/androidx/glance/layout/Utils.kt b/glance/glance/src/test/kotlin/androidx/glance/layout/Utils.kt
new file mode 100644
index 0000000..b905668
--- /dev/null
+++ b/glance/glance/src/test/kotlin/androidx/glance/layout/Utils.kt
@@ -0,0 +1,45 @@
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * 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.
+ */
+
+package androidx.glance.layout
+
+import androidx.compose.runtime.BroadcastFrameClock
+import androidx.compose.runtime.Composable
+import androidx.compose.runtime.Composition
+import androidx.compose.runtime.Recomposer
+import androidx.glance.Applier
+import androidx.glance.GlanceInternalApi
+import kotlinx.coroutines.coroutineScope
+import kotlinx.coroutines.currentCoroutineContext
+import kotlinx.coroutines.launch
+
+@OptIn(GlanceInternalApi::class)
+suspend fun runTestingComposition(content: @Composable () -> Unit): EmittableBox = coroutineScope {
+ val root = EmittableBox()
+ val applier = Applier(root)
+ val recomposer = Recomposer(currentCoroutineContext())
+ val composition = Composition(applier, recomposer)
+ val frameClock = BroadcastFrameClock()
+
+ composition.setContent { content() }
+
+ launch(frameClock) { recomposer.runRecomposeAndApplyChanges() }
+
+ recomposer.close()
+ recomposer.join()
+
+ root
+}
diff --git a/glance/glance/src/test/kotlin/androidx/glance/unit/DpSizeTest.kt b/glance/glance/src/test/kotlin/androidx/glance/unit/DpSizeTest.kt
new file mode 100644
index 0000000..e134c93
--- /dev/null
+++ b/glance/glance/src/test/kotlin/androidx/glance/unit/DpSizeTest.kt
@@ -0,0 +1,66 @@
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * 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.
+ */
+
+package androidx.glance.unit
+
+import com.google.common.truth.Truth.assertThat
+import org.junit.Test
+
+class DpSizeTest {
+
+ @Test
+ fun identity() {
+ assertThat(DpSize(1.dp, 2.dp)).isEqualTo(DpSize(1.dp, 2.dp))
+ assertThat(DpSize(1.dp, 2.dp)).isNotEqualTo(DpSize(2.dp, 1.dp))
+ }
+
+ @Test
+ fun copy() {
+ assertThat(DpSize.Zero.copy(height = 2.dp)).isEqualTo(DpSize(0.dp, 2.dp))
+ assertThat(DpSize.Zero.copy(width = 2.dp)).isEqualTo(DpSize(2.dp, 0.dp))
+ }
+
+ @Test
+ fun plus() {
+ assertThat(DpSize(1.dp, 2.dp) + DpSize(3.dp, 4.dp)).isEqualTo(DpSize(4.dp, 6.dp))
+ }
+
+ @Test
+ fun minus() {
+ assertThat(DpSize(1.dp, 2.dp) - DpSize(3.dp, 4.dp)).isEqualTo(DpSize(-2.dp, -2.dp))
+ }
+
+ @Test
+ fun components() {
+ val (width, height) = DpSize(1.dp, 2.dp)
+ assertThat(width).isEqualTo(1.dp)
+ assertThat(height).isEqualTo(2.dp)
+ }
+
+ @Test
+ fun times() {
+ assertThat(DpSize(1.dp, 2.dp) * 2).isEqualTo(DpSize(2.dp, 4.dp))
+ assertThat(DpSize(1.dp, 2.dp) * 2.5f).isEqualTo(DpSize(2.5.dp, 5.dp))
+ assertThat(2 * DpSize(1.dp, 2.dp)).isEqualTo(DpSize(2.dp, 4.dp))
+ assertThat(2.5f * DpSize(1.dp, 2.dp)).isEqualTo(DpSize(2.5.dp, 5.dp))
+ }
+
+ @Test
+ fun div() {
+ assertThat(DpSize(1.dp, 2.dp) / 2).isEqualTo(DpSize(0.5.dp, 1.dp))
+ assertThat(DpSize(2.5.dp, 5.dp) / 2.5f).isEqualTo(DpSize(1.dp, 2.dp))
+ }
+}
\ No newline at end of file
diff --git a/glance/glance/src/test/kotlin/androidx/glance/unit/DpTest.kt b/glance/glance/src/test/kotlin/androidx/glance/unit/DpTest.kt
new file mode 100644
index 0000000..80a27dc
--- /dev/null
+++ b/glance/glance/src/test/kotlin/androidx/glance/unit/DpTest.kt
@@ -0,0 +1,149 @@
+/*
+ * Copyright 2018 The Android Open Source Project
+ *
+ * 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.
+ */
+
+package androidx.glance.unit
+
+import org.junit.Assert.assertEquals
+import org.junit.Assert.assertTrue
+import org.junit.Assert.fail
+import org.junit.Test
+import org.junit.runner.RunWith
+import org.junit.runners.JUnit4
+
+@RunWith(JUnit4::class)
+class DpTest {
+ @Test
+ fun constructor() {
+ val dim1 = Dp(value = 5f)
+ assertEquals(5f, dim1.value, 0f)
+
+ val dim2 = Dp(value = Float.POSITIVE_INFINITY)
+ assertEquals(Float.POSITIVE_INFINITY, dim2.value, 0f)
+
+ val dim3 = Dp(value = Float.NaN)
+ assertEquals(Float.NaN, dim3.value, 0f)
+ }
+
+ @Test
+ fun dpIntegerConstruction() {
+ val dim = 10.dp
+ assertEquals(10f, dim.value, 0f)
+ }
+
+ @Test
+ fun dpFloatConstruction() {
+ val dim = 10f.dp
+ assertEquals(10f, dim.value, 0f)
+ }
+
+ @Test
+ fun dpDoubleConstruction() {
+ val dim = 10.0.dp
+ assertEquals(10f, dim.value, 0f)
+ }
+
+ @Test
+ fun subtractOperator() {
+ assertEquals(-1f, (3.dp - 4.dp).value)
+ assertEquals(1f, (10.dp - 9.dp).value, 0f)
+ }
+
+ @Test
+ fun addOperator() {
+ assertEquals(2f, (1.dp + 1.dp).value, 0f)
+ assertEquals(10f, (6.dp + 4.dp).value, 0f)
+ }
+
+ @Test
+ fun multiplyOperator() {
+ assertEquals(0f, (1.dp * 0f).value, 0f)
+ assertEquals(10f, (1.dp * 10f).value, 0f)
+ }
+
+ @Test
+ fun multiplyOperatorScalar() {
+ assertEquals(10f, 10f * 1.dp.value, 0f)
+ assertEquals(10f, 10 * 1.dp.value, 0f)
+ assertEquals(10f, (10.0 * 1.dp).value, 0f)
+ }
+
+ @Test
+ fun divideOperator() {
+ assertEquals(10f, 100.dp / 10f.dp, 0f)
+ assertEquals(0f, 0.dp / 10f.dp, 0f)
+ }
+
+ @Test
+ fun divideToScalar() {
+ assertEquals(1f, 1.dp / 1.dp, 0f)
+ }
+
+ @Suppress("DIVISION_BY_ZERO")
+ @Test
+ fun compare() {
+ assertTrue(0.dp < Float.MIN_VALUE.dp)
+ assertTrue(1.dp < 3.dp)
+ assertEquals(0, 1.dp.compareTo(1.dp))
+ assertTrue(1.dp > 0.dp)
+ assertTrue(Float.NEGATIVE_INFINITY.dp < 0.dp)
+
+ val zeroNaN = 0f / 0f
+ val infNaN = Float.POSITIVE_INFINITY / Float.NEGATIVE_INFINITY
+ assertEquals(0, zeroNaN.dp.compareTo(zeroNaN.dp))
+ assertEquals(0, infNaN.dp.compareTo(infNaN.dp))
+ }
+
+ @Test
+ fun minTest() {
+ assertEquals(10f, min(10.dp, 20.dp).value, 0f)
+ assertEquals(10f, min(20.dp, 10.dp).value, 0f)
+ assertEquals(10f, min(10.dp, 10.dp).value, 0f)
+ }
+
+ @Test
+ fun maxTest() {
+ assertEquals(20f, max(10.dp, 20.dp).value, 0f)
+ assertEquals(20f, max(20.dp, 10.dp).value, 0f)
+ assertEquals(20f, max(20.dp, 20.dp).value, 0f)
+ }
+
+ @Test
+ fun coerceIn() {
+ assertEquals(10f, 10.dp.coerceIn(0.dp, 20.dp).value, 0f)
+ assertEquals(10f, 20.dp.coerceIn(0.dp, 10.dp).value, 0f)
+ assertEquals(10f, 0.dp.coerceIn(10.dp, 20.dp).value, 0f)
+ try {
+ 10.dp.coerceIn(20.dp, 10.dp)
+ fail("Expected an exception here")
+ } catch (e: IllegalArgumentException) {
+ // success!
+ }
+ }
+
+ @Test
+ fun coerceAtLeast() {
+ assertEquals(10f, 0.dp.coerceAtLeast(10.dp).value, 0f)
+ assertEquals(10f, 10.dp.coerceAtLeast(5.dp).value, 0f)
+ assertEquals(10f, 10.dp.coerceAtLeast(10.dp).value, 0f)
+ }
+
+ @Test
+ fun coerceAtMost() {
+ assertEquals(10f, 100.dp.coerceAtMost(10.dp).value, 0f)
+ assertEquals(10f, 10.dp.coerceAtMost(20.dp).value, 0f)
+ assertEquals(10f, 10.dp.coerceAtMost(10.dp).value, 0f)
+ }
+}
\ No newline at end of file
diff --git a/glance/glance/src/test/kotlin/androidx/glance/unit/SpTest.kt b/glance/glance/src/test/kotlin/androidx/glance/unit/SpTest.kt
new file mode 100644
index 0000000..4c2fbd1
--- /dev/null
+++ b/glance/glance/src/test/kotlin/androidx/glance/unit/SpTest.kt
@@ -0,0 +1,149 @@
+/*
+ * Copyright 2018 The Android Open Source Project
+ *
+ * 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.
+ */
+
+package androidx.glance.unit
+
+import org.junit.Assert.assertEquals
+import org.junit.Assert.assertTrue
+import org.junit.Assert.fail
+import org.junit.Test
+import org.junit.runner.RunWith
+import org.junit.runners.JUnit4
+
+@RunWith(JUnit4::class)
+class SpTest {
+ @Test
+ fun constructor() {
+ val dim1 = Sp(value = 5f)
+ assertEquals(5f, dim1.value, 0f)
+
+ val dim2 = Sp(value = Float.POSITIVE_INFINITY)
+ assertEquals(Float.POSITIVE_INFINITY, dim2.value, 0f)
+
+ val dim3 = Sp(value = Float.NaN)
+ assertEquals(Float.NaN, dim3.value, 0f)
+ }
+
+ @Test
+ fun spIntegerConstruction() {
+ val dim = 10.sp
+ assertEquals(10f, dim.value, 0f)
+ }
+
+ @Test
+ fun spFloatConstruction() {
+ val dim = 10f.sp
+ assertEquals(10f, dim.value, 0f)
+ }
+
+ @Test
+ fun spDoubleConstruction() {
+ val dim = 10.0.sp
+ assertEquals(10f, dim.value, 0f)
+ }
+
+ @Test
+ fun subtractOperator() {
+ assertEquals(-1f, (3.sp - 4.sp).value)
+ assertEquals(1f, (10.sp - 9.sp).value, 0f)
+ }
+
+ @Test
+ fun addOperator() {
+ assertEquals(2f, (1.sp + 1.sp).value, 0f)
+ assertEquals(10f, (6.sp + 4.sp).value, 0f)
+ }
+
+ @Test
+ fun multiplyOperator() {
+ assertEquals(0f, (1.sp * 0f).value, 0f)
+ assertEquals(10f, (1.sp * 10f).value, 0f)
+ }
+
+ @Test
+ fun multiplyOperatorScalar() {
+ assertEquals(10f, 10f * 1.sp.value, 0f)
+ assertEquals(10f, 10 * 1.sp.value, 0f)
+ assertEquals(10f, (10.0 * 1.sp).value, 0f)
+ }
+
+ @Test
+ fun divideOperator() {
+ assertEquals(10f, 100.sp / 10f.sp, 0f)
+ assertEquals(0f, 0.sp / 10f.sp, 0f)
+ }
+
+ @Test
+ fun divideToScalar() {
+ assertEquals(1f, 1.sp / 1.sp, 0f)
+ }
+
+ @Suppress("DIVISION_BY_ZERO")
+ @Test
+ fun compare() {
+ assertTrue(0.sp < Float.MIN_VALUE.sp)
+ assertTrue(1.sp < 3.sp)
+ assertEquals(0, 1.sp.compareTo(1.sp))
+ assertTrue(1.sp > 0.sp)
+ assertTrue(Float.NEGATIVE_INFINITY.sp < 0.sp)
+
+ val zeroNaN = 0f / 0f
+ val infNaN = Float.POSITIVE_INFINITY / Float.NEGATIVE_INFINITY
+ assertEquals(0, zeroNaN.sp.compareTo(zeroNaN.sp))
+ assertEquals(0, infNaN.sp.compareTo(infNaN.sp))
+ }
+
+ @Test
+ fun minTest() {
+ assertEquals(10f, min(10.sp, 20.sp).value, 0f)
+ assertEquals(10f, min(20.sp, 10.sp).value, 0f)
+ assertEquals(10f, min(10.sp, 10.sp).value, 0f)
+ }
+
+ @Test
+ fun maxTest() {
+ assertEquals(20f, max(10.sp, 20.sp).value, 0f)
+ assertEquals(20f, max(20.sp, 10.sp).value, 0f)
+ assertEquals(20f, max(20.sp, 20.sp).value, 0f)
+ }
+
+ @Test
+ fun coerceIn() {
+ assertEquals(10f, 10.sp.coerceIn(0.sp, 20.sp).value, 0f)
+ assertEquals(10f, 20.sp.coerceIn(0.sp, 10.sp).value, 0f)
+ assertEquals(10f, 0.sp.coerceIn(10.sp, 20.sp).value, 0f)
+ try {
+ 10.sp.coerceIn(20.sp, 10.sp)
+ fail("Expected an exception here")
+ } catch (e: IllegalArgumentException) {
+ // success!
+ }
+ }
+
+ @Test
+ fun coerceAtLeast() {
+ assertEquals(10f, 0.sp.coerceAtLeast(10.sp).value, 0f)
+ assertEquals(10f, 10.sp.coerceAtLeast(5.sp).value, 0f)
+ assertEquals(10f, 10.sp.coerceAtLeast(10.sp).value, 0f)
+ }
+
+ @Test
+ fun coerceAtMost() {
+ assertEquals(10f, 100.sp.coerceAtMost(10.sp).value, 0f)
+ assertEquals(10f, 10.sp.coerceAtMost(20.sp).value, 0f)
+ assertEquals(10f, 10.sp.coerceAtMost(10.sp).value, 0f)
+ }
+}
\ No newline at end of file
diff --git a/gradle.properties b/gradle.properties
index 64c9a2b..731a310 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -34,3 +34,7 @@
# Disallow resolving dependencies at configuration time, which is a slight performance problem
android.dependencyResolutionAtConfigurationTime.disallow=true
+android.suppressUnsupportedOptionWarnings=android.suppressUnsupportedOptionWarnings,android.dependencyResolutionAtConfigurationTime.disallow
+
+# Workaround for b/162074215
+android.includeDependencyInfoInApks=false
\ No newline at end of file
diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml
index 7adf9d4..fe1a2072 100644
--- a/gradle/libs.versions.toml
+++ b/gradle/libs.versions.toml
@@ -2,13 +2,13 @@
# -----------------------------------------------------------------------------
# All of the following should be updated in sync.
# -----------------------------------------------------------------------------
-androidGradlePlugin = "7.1.0-alpha07"
+androidGradlePlugin = "7.1.0-alpha08"
# NOTE: When updating the lint version we also need to update the `api` version
# supported by `IssueRegistry`'s.' For e.g. r.android.com/1331903
-androidLint = "30.1.0-alpha07"
+androidLint = "30.1.0-alpha08"
# Once you have a chosen version of AGP to upgrade to, go to
# https://developer.android.com/studio/archive and find the matching version of Studio.
-androidStudio = "2021.1.1.7"
+androidStudio = "2021.1.1.8"
# -----------------------------------------------------------------------------
androidLintMin = "27.2.1"
@@ -18,16 +18,16 @@
atomicFu = "0.14.4"
autoService = "1.0-rc6"
autoValue = "1.6.3"
-dagger = "2.35"
+dagger = "2.38.1"
dexmaker = "2.25.0"
espresso = "3.3.0"
guavaJre = "29.0-jre"
-hilt = "2.36"
+hilt = "2.38.1"
incap = "0.2"
kotlin = "1.5.21"
kotlinCompileTesting = "1.4.1"
kotlinCoroutines = "1.5.0"
-ksp = "1.5.20-1.0.0-beta04"
+ksp = "1.5.21-1.0.0-beta07"
leakcanary = "2.2"
mockito = "2.25.0"
skiko = "0.3.9"
@@ -102,6 +102,7 @@
kotlinCoroutinesRx2 = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-rx2", version.ref = "kotlinCoroutines" }
kotlinCoroutinesRx3 = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-rx3", version.ref = "kotlinCoroutines" }
kotlinDaemonEmbeddable = { module = "org.jetbrains.kotlin:kotlin-daemon-embeddable", version.ref = "kotlin" }
+kotlinKlibCommonizer = { module = "org.jetbrains.kotlin:kotlin-klib-commonizer", version.ref = "kotlin" }
kotlinMetadataJvm = { module = "org.jetbrains.kotlinx:kotlinx-metadata-jvm", version = "0.3.0" }
kotlinStdlib = { module = "org.jetbrains.kotlin:kotlin-stdlib", version.ref = "kotlin" }
kotlinStdlibCommon = { module = "org.jetbrains.kotlin:kotlin-stdlib-common", version.ref = "kotlin" }
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
index ec105fe..9c3e116 100644
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -5,4 +5,4 @@
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
-distributionUrl=../../../../tools/external/gradle/gradle-7.2-rc-2-bin.zip
+distributionUrl=../../../../tools/external/gradle/gradle-7.2-bin.zip
diff --git a/gradlew b/gradlew
index bc83001..eb5905f 100755
--- a/gradlew
+++ b/gradlew
@@ -45,6 +45,8 @@
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+JAVA_OPTS="$JAVA_OPTS -Dkotlin.incremental.compilation=true" # b/188565660
+
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
diff --git a/health/health-services-client/lint-baseline.xml b/health/health-services-client/lint-baseline.xml
index 2569c46..5171b78 100644
--- a/health/health-services-client/lint-baseline.xml
+++ b/health/health-services-client/lint-baseline.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<issues format="6" by="lint 7.1.0-alpha02" type="baseline" client="cli" name="Lint" variant="all" version="7.1.0-alpha02">
+<issues format="6" by="lint 7.1.0-dev" type="baseline" client="gradle" dependencies="false" name="AGP (7.1.0-dev)" variant="all" version="7.1.0-dev">
<issue
id="BanKeepAnnotation"
@@ -475,6 +475,17 @@
</issue>
<issue
+ id="VisibleForTests"
+ message="This method should only be accessed from tests or within private scope"
+ errorLine1=" get() = ServiceBackedMeasureClient.getClient(applicationContext)"
+ errorLine2=" ~~~~~~~~~">
+ <location
+ file="src/main/java/androidx/health/services/client/impl/ServiceBackedHealthServicesClient.kt"
+ line="46"
+ column="44"/>
+ </issue>
+
+ <issue
id="SyntheticAccessor"
message="Access to `private` method `createQueueOperation` of class `Client` requires synthetic accessor"
errorLine1=" createQueueOperation("
diff --git a/hilt/hilt-navigation-compose/build.gradle b/hilt/hilt-navigation-compose/build.gradle
index 078d991..8620508 100644
--- a/hilt/hilt-navigation-compose/build.gradle
+++ b/hilt/hilt-navigation-compose/build.gradle
@@ -56,6 +56,10 @@
androidTestImplementation projectOrArtifact(":compose:test-utils")
}
+hilt {
+ enableAggregatingTask = true
+}
+
androidx {
name = "Navigation Compose Hilt Integration"
publish = Publish.SNAPSHOT_AND_RELEASE
diff --git a/hilt/hilt-navigation-fragment/build.gradle b/hilt/hilt-navigation-fragment/build.gradle
index 9eb592d..9fbbf92 100644
--- a/hilt/hilt-navigation-fragment/build.gradle
+++ b/hilt/hilt-navigation-fragment/build.gradle
@@ -52,6 +52,10 @@
})
}
+hilt {
+ enableAggregatingTask = true
+}
+
androidx {
name = "Android Navigation Fragment Hilt Extension"
publish = Publish.SNAPSHOT_AND_RELEASE
diff --git a/hilt/integration-tests/viewmodelapp/build.gradle b/hilt/integration-tests/viewmodelapp/build.gradle
index f40a4d4..368be6b 100644
--- a/hilt/integration-tests/viewmodelapp/build.gradle
+++ b/hilt/integration-tests/viewmodelapp/build.gradle
@@ -48,3 +48,7 @@
androidTestImplementation(libs.hiltAndroidTesting)
kaptAndroidTest(libs.hiltCompiler)
}
+
+hilt {
+ enableAggregatingTask = true
+}
diff --git a/hilt/integration-tests/workerapp/build.gradle b/hilt/integration-tests/workerapp/build.gradle
index 5e4e839..aaecd82 100644
--- a/hilt/integration-tests/workerapp/build.gradle
+++ b/hilt/integration-tests/workerapp/build.gradle
@@ -51,3 +51,7 @@
androidTestImplementation(libs.hiltAndroidTesting)
kaptAndroidTest(libs.hiltCompiler)
}
+
+hilt {
+ enableAggregatingTask = true
+}
\ No newline at end of file
diff --git a/jetifier/jetifier/migration.config b/jetifier/jetifier/migration.config
index 395976ec..758d728 100644
--- a/jetifier/jetifier/migration.config
+++ b/jetifier/jetifier/migration.config
@@ -317,11 +317,11 @@
"to": "ignore"
},
{
- "from": "androidx/core/content/CustomUnusedAppRestrictionsBackportService(.*)",
+ "from": "androidx/core/content/UnusedAppRestrictionsBackportCallback(.*)",
"to": "ignore"
},
{
- "from": "androidx/core/content/UnusedAppRestrictionsBackportCallback(.*)",
+ "from": "androidx/core/content/UnusedAppRestrictionsBackportService(.*)",
"to": "ignore"
},
{
diff --git a/leanback/leanback/build.gradle b/leanback/leanback/build.gradle
index b6dc59a..8da3f9a 100644
--- a/leanback/leanback/build.gradle
+++ b/leanback/leanback/build.gradle
@@ -7,6 +7,12 @@
id("com.android.library")
}
+android {
+ defaultConfig {
+ multiDexEnabled true
+ }
+}
+
dependencies {
api("androidx.annotation:annotation:1.1.0")
api("androidx.interpolator:interpolator:1.0.0")
@@ -26,6 +32,7 @@
androidTestImplementation(libs.testCore)
androidTestImplementation(libs.testRunner)
androidTestImplementation(libs.testRules)
+ androidTestImplementation(libs.multidex)
androidTestImplementation(libs.espressoCore, excludes.espresso)
androidTestImplementation(libs.mockitoCore, excludes.bytebuddy) // DexMaker has it"s own MockMaker
androidTestImplementation(libs.dexmakerMockito, excludes.bytebuddy) // DexMaker has it"s own MockMaker
diff --git a/leanback/leanback/src/main/res/values-te/strings.xml b/leanback/leanback/src/main/res/values-te/strings.xml
index b3b1751..e56c5cb 100644
--- a/leanback/leanback/src/main/res/values-te/strings.xml
+++ b/leanback/leanback/src/main/res/values-te/strings.xml
@@ -43,8 +43,8 @@
<string name="lb_playback_controls_repeat_one" msgid="676658705837320560">"ఒకదాన్ని పునరావృతం చేయి"</string>
<string name="lb_playback_controls_shuffle_enable" msgid="5151681938752704485">"షఫుల్ చేయడాన్ని ప్రారంభించు"</string>
<string name="lb_playback_controls_shuffle_disable" msgid="6793109999253893369">"షఫుల్ చేయడాన్ని నిలిపివేయి"</string>
- <string name="lb_playback_controls_high_quality_enable" msgid="3057698527166674705">"అధిక నాణ్యతను ప్రారంభించు"</string>
- <string name="lb_playback_controls_high_quality_disable" msgid="1209119371486219736">"అధిక నాణ్యతను నిలిపివేయి"</string>
+ <string name="lb_playback_controls_high_quality_enable" msgid="3057698527166674705">"అధిక క్వాలిటీని ప్రారంభించు"</string>
+ <string name="lb_playback_controls_high_quality_disable" msgid="1209119371486219736">"అధిక క్వాలిటీని నిలిపివేయి"</string>
<string name="lb_playback_controls_closed_captioning_enable" msgid="2346334170216706076">"మూసివేసిన శీర్షికలను ప్రారంభించు"</string>
<string name="lb_playback_controls_closed_captioning_disable" msgid="8691966842977635128">"మూసివేసిన శీర్షికలను నిలిపివేయి"</string>
<string name="lb_playback_controls_picture_in_picture" msgid="5770668162543767702">"చిత్రంలో చిత్రం మోడ్లోకి ప్రవేశించు"</string>
diff --git a/lifecycle/buildSrc b/lifecycle/buildSrc
new file mode 120000
index 0000000..053a423
--- /dev/null
+++ b/lifecycle/buildSrc
@@ -0,0 +1 @@
+../buildSrc
\ No newline at end of file
diff --git a/lifecycle/lifecycle-livedata-core-ktx-lint/src/main/java/androidx/lifecycle/lint/LiveDataCoreIssueRegistry.kt b/lifecycle/lifecycle-livedata-core-ktx-lint/src/main/java/androidx/lifecycle/lint/LiveDataCoreIssueRegistry.kt
index 23ad130..3b1db66 100644
--- a/lifecycle/lifecycle-livedata-core-ktx-lint/src/main/java/androidx/lifecycle/lint/LiveDataCoreIssueRegistry.kt
+++ b/lifecycle/lifecycle-livedata-core-ktx-lint/src/main/java/androidx/lifecycle/lint/LiveDataCoreIssueRegistry.kt
@@ -21,6 +21,6 @@
class LiveDataCoreIssueRegistry : IssueRegistry() {
override val minApi = CURRENT_API
- override val api = 10
+ override val api = 11
override val issues get() = listOf(NonNullableMutableLiveDataDetector.ISSUE)
}
diff --git a/lifecycle/lifecycle-livedata-core-ktx-lint/src/test/java/androidx/lifecycle/lint/ApiLintVersionsTest.kt b/lifecycle/lifecycle-livedata-core-ktx-lint/src/test/java/androidx/lifecycle/livedata/core/lint/ApiLintVersionsTest.kt
similarity index 93%
rename from lifecycle/lifecycle-livedata-core-ktx-lint/src/test/java/androidx/lifecycle/lint/ApiLintVersionsTest.kt
rename to lifecycle/lifecycle-livedata-core-ktx-lint/src/test/java/androidx/lifecycle/livedata/core/lint/ApiLintVersionsTest.kt
index 24e2a9d..20dba68 100644
--- a/lifecycle/lifecycle-livedata-core-ktx-lint/src/test/java/androidx/lifecycle/lint/ApiLintVersionsTest.kt
+++ b/lifecycle/lifecycle-livedata-core-ktx-lint/src/test/java/androidx/lifecycle/livedata/core/lint/ApiLintVersionsTest.kt
@@ -16,8 +16,9 @@
@file:Suppress("UnstableApiUsage")
-package androidx.lifecycle.lint
+package androidx.lifecycle.livedata.core.lint
+import androidx.lifecycle.lint.LiveDataCoreIssueRegistry
import com.android.tools.lint.client.api.LintClient
import com.android.tools.lint.detector.api.CURRENT_API
import org.junit.Assert.assertEquals
diff --git a/lifecycle/lifecycle-livedata-core-ktx-lint/src/test/java/androidx/lifecycle/lint/NonNullableMutableLiveDataDetectorTest.kt b/lifecycle/lifecycle-livedata-core-ktx-lint/src/test/java/androidx/lifecycle/livedata/core/lint/NonNullableMutableLiveDataDetectorTest.kt
similarity index 97%
rename from lifecycle/lifecycle-livedata-core-ktx-lint/src/test/java/androidx/lifecycle/lint/NonNullableMutableLiveDataDetectorTest.kt
rename to lifecycle/lifecycle-livedata-core-ktx-lint/src/test/java/androidx/lifecycle/livedata/core/lint/NonNullableMutableLiveDataDetectorTest.kt
index ea4c012..b6c0412 100644
--- a/lifecycle/lifecycle-livedata-core-ktx-lint/src/test/java/androidx/lifecycle/lint/NonNullableMutableLiveDataDetectorTest.kt
+++ b/lifecycle/lifecycle-livedata-core-ktx-lint/src/test/java/androidx/lifecycle/livedata/core/lint/NonNullableMutableLiveDataDetectorTest.kt
@@ -16,9 +16,10 @@
@file:Suppress("UnstableApiUsage")
-package androidx.lifecycle.lint
+package androidx.lifecycle.livedata.core.lint
-import androidx.lifecycle.lint.stubs.STUBS
+import androidx.lifecycle.lint.NonNullableMutableLiveDataDetector
+import androidx.lifecycle.livedata.core.lint.stubs.STUBS
import com.android.tools.lint.checks.infrastructure.LintDetectorTest
import com.android.tools.lint.checks.infrastructure.TestFile
import com.android.tools.lint.checks.infrastructure.TestLintResult
@@ -100,6 +101,7 @@
).expectClean()
}
+ @Ignore("b/196832482")
@Test
fun helperMethodFails() {
check(
@@ -130,6 +132,7 @@
)
}
+ @Ignore("b/196832482")
@Test
fun variableAssignmentFails() {
check(
@@ -167,6 +170,7 @@
)
}
+ @Ignore("b/196832482")
@Test
fun nullLiteralFailField() {
check(
@@ -193,6 +197,7 @@
)
}
+ @Ignore("b/196832482")
@Test
fun nullLiteralFailMultipleFields() {
check(
@@ -250,6 +255,7 @@
).expectClean()
}
+ @Ignore("b/196832482")
@Test
fun nullLiteralFailMultipleAssignment() {
check(
@@ -277,6 +283,7 @@
)
}
+ @Ignore("b/196832482")
@Test
fun nullLiteralFailFieldAndIgnore() {
check(
@@ -349,6 +356,7 @@
).expectClean()
}
+ @Ignore("b/196832482")
@Test
fun nullLiteralFailFieldAndLocalVariable() {
check(
@@ -380,6 +388,7 @@
)
}
+ @Ignore("b/196832482")
@Test
fun nullLiteralQuickFix() {
check(
@@ -405,6 +414,7 @@
)
}
+ @Ignore("b/196832482")
@Test
fun classHierarchyTest() {
check(
@@ -447,6 +457,7 @@
)
}
+ @Ignore("b/196832482")
@Test
fun differentClassSameFieldTestFirstNull() {
check(
@@ -497,6 +508,7 @@
)
}
+ @Ignore("b/196832482")
@Test
fun differentClassSameFieldTestSecondNull() {
check(
@@ -547,6 +559,7 @@
)
}
+ @Ignore("b/196832482")
@Test
fun nestedClassSameFieldTest() {
check(
@@ -590,6 +603,7 @@
)
}
+ @Ignore("b/196832482")
@Test
fun modifiersFieldTest() {
check(
@@ -630,6 +644,7 @@
)
}
+ @Ignore("b/196832482")
@Test
fun implementationClassTest() {
check(
diff --git a/lifecycle/lifecycle-livedata-core-ktx-lint/src/test/java/androidx/lifecycle/lint/stubs/Stubs.kt b/lifecycle/lifecycle-livedata-core-ktx-lint/src/test/java/androidx/lifecycle/livedata/core/lint/stubs/Stubs.kt
similarity index 96%
rename from lifecycle/lifecycle-livedata-core-ktx-lint/src/test/java/androidx/lifecycle/lint/stubs/Stubs.kt
rename to lifecycle/lifecycle-livedata-core-ktx-lint/src/test/java/androidx/lifecycle/livedata/core/lint/stubs/Stubs.kt
index 1fcf974..dbd5ed0 100644
--- a/lifecycle/lifecycle-livedata-core-ktx-lint/src/test/java/androidx/lifecycle/lint/stubs/Stubs.kt
+++ b/lifecycle/lifecycle-livedata-core-ktx-lint/src/test/java/androidx/lifecycle/livedata/core/lint/stubs/Stubs.kt
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package androidx.lifecycle.lint.stubs
+package androidx.lifecycle.livedata.core.lint.stubs
import com.android.tools.lint.checks.infrastructure.LintDetectorTest.java
diff --git a/lifecycle/lifecycle-runtime-ktx-lint/src/main/java/androidx/lifecycle/lint/LifecycleRuntimeIssueRegistry.kt b/lifecycle/lifecycle-runtime-ktx-lint/src/main/java/androidx/lifecycle/lint/LifecycleRuntimeIssueRegistry.kt
index d107f47..418a680 100644
--- a/lifecycle/lifecycle-runtime-ktx-lint/src/main/java/androidx/lifecycle/lint/LifecycleRuntimeIssueRegistry.kt
+++ b/lifecycle/lifecycle-runtime-ktx-lint/src/main/java/androidx/lifecycle/lint/LifecycleRuntimeIssueRegistry.kt
@@ -21,7 +21,7 @@
class LifecycleRuntimeIssueRegistry : IssueRegistry() {
// tests are run with this version. We ensure that with ApiLintVersionsTest
- override val api = 10
+ override val api = 11
override val minApi = CURRENT_API
override val issues get() = listOf(
LifecycleWhenChecks.ISSUE,
diff --git a/lifecycle/lifecycle-runtime-ktx-lint/src/test/java/androidx/lifecycle/lint/ApiLintVersionsTest.kt b/lifecycle/lifecycle-runtime-ktx-lint/src/test/java/androidx/lifecycle/runtime/lint/ApiLintVersionsTest.kt
similarity index 92%
rename from lifecycle/lifecycle-runtime-ktx-lint/src/test/java/androidx/lifecycle/lint/ApiLintVersionsTest.kt
rename to lifecycle/lifecycle-runtime-ktx-lint/src/test/java/androidx/lifecycle/runtime/lint/ApiLintVersionsTest.kt
index a917fde5..5d9c5d7 100644
--- a/lifecycle/lifecycle-runtime-ktx-lint/src/test/java/androidx/lifecycle/lint/ApiLintVersionsTest.kt
+++ b/lifecycle/lifecycle-runtime-ktx-lint/src/test/java/androidx/lifecycle/runtime/lint/ApiLintVersionsTest.kt
@@ -14,8 +14,9 @@
* limitations under the License.
*/
-package androidx.lifecycle.lint
+package androidx.lifecycle.runtime.lint
+import androidx.lifecycle.lint.LifecycleRuntimeIssueRegistry
import com.android.tools.lint.client.api.LintClient
import com.android.tools.lint.detector.api.CURRENT_API
import org.junit.Assert
diff --git a/lifecycle/lifecycle-runtime-ktx-lint/src/test/java/androidx/lifecycle/lint/LifecycleWhenChecksTest.kt b/lifecycle/lifecycle-runtime-ktx-lint/src/test/java/androidx/lifecycle/runtime/lint/LifecycleWhenChecksTest.kt
similarity index 97%
rename from lifecycle/lifecycle-runtime-ktx-lint/src/test/java/androidx/lifecycle/lint/LifecycleWhenChecksTest.kt
rename to lifecycle/lifecycle-runtime-ktx-lint/src/test/java/androidx/lifecycle/runtime/lint/LifecycleWhenChecksTest.kt
index a8ad935..c264180 100644
--- a/lifecycle/lifecycle-runtime-ktx-lint/src/test/java/androidx/lifecycle/lint/LifecycleWhenChecksTest.kt
+++ b/lifecycle/lifecycle-runtime-ktx-lint/src/test/java/androidx/lifecycle/runtime/lint/LifecycleWhenChecksTest.kt
@@ -14,12 +14,13 @@
* limitations under the License.
*/
-package androidx.lifecycle.lint
+package androidx.lifecycle.runtime.lint
import androidx.lifecycle.lint.LifecycleWhenChecks.Companion.ISSUE
-import androidx.lifecycle.lint.stubs.COROUTINES_STUB
-import androidx.lifecycle.lint.stubs.LIFECYCLE_STUB
-import androidx.lifecycle.lint.stubs.VIEW_STUB
+import androidx.lifecycle.lint.errorMessage
+import androidx.lifecycle.runtime.lint.stubs.COROUTINES_STUB
+import androidx.lifecycle.runtime.lint.stubs.LIFECYCLE_STUB
+import androidx.lifecycle.runtime.lint.stubs.VIEW_STUB
import com.android.tools.lint.checks.infrastructure.TestFiles.kt
import com.android.tools.lint.checks.infrastructure.TestLintResult
import com.android.tools.lint.checks.infrastructure.TestLintTask
diff --git a/lifecycle/lifecycle-runtime-ktx-lint/src/test/java/androidx/lifecycle/lint/RepeatOnLifecycleDetectorTest.kt b/lifecycle/lifecycle-runtime-ktx-lint/src/test/java/androidx/lifecycle/runtime/lint/RepeatOnLifecycleDetectorTest.kt
similarity index 97%
rename from lifecycle/lifecycle-runtime-ktx-lint/src/test/java/androidx/lifecycle/lint/RepeatOnLifecycleDetectorTest.kt
rename to lifecycle/lifecycle-runtime-ktx-lint/src/test/java/androidx/lifecycle/runtime/lint/RepeatOnLifecycleDetectorTest.kt
index e58858c..cce75cd 100644
--- a/lifecycle/lifecycle-runtime-ktx-lint/src/test/java/androidx/lifecycle/lint/RepeatOnLifecycleDetectorTest.kt
+++ b/lifecycle/lifecycle-runtime-ktx-lint/src/test/java/androidx/lifecycle/runtime/lint/RepeatOnLifecycleDetectorTest.kt
@@ -14,9 +14,10 @@
* limitations under the License.
*/
-package androidx.lifecycle.lint
+package androidx.lifecycle.runtime.lint
-import androidx.lifecycle.lint.stubs.REPEAT_ON_LIFECYCLE_STUBS
+import androidx.lifecycle.lint.RepeatOnLifecycleDetector
+import androidx.lifecycle.runtime.lint.stubs.REPEAT_ON_LIFECYCLE_STUBS
import com.android.tools.lint.checks.infrastructure.TestFiles
import com.android.tools.lint.checks.infrastructure.TestLintResult
import com.android.tools.lint.checks.infrastructure.TestLintTask
diff --git a/lifecycle/lifecycle-runtime-ktx-lint/src/test/java/androidx/lifecycle/lint/WhenMethodsTest.kt b/lifecycle/lifecycle-runtime-ktx-lint/src/test/java/androidx/lifecycle/runtime/lint/WhenMethodsTest.kt
similarity index 90%
rename from lifecycle/lifecycle-runtime-ktx-lint/src/test/java/androidx/lifecycle/lint/WhenMethodsTest.kt
rename to lifecycle/lifecycle-runtime-ktx-lint/src/test/java/androidx/lifecycle/runtime/lint/WhenMethodsTest.kt
index 3d16dd3..5b26766 100644
--- a/lifecycle/lifecycle-runtime-ktx-lint/src/test/java/androidx/lifecycle/lint/WhenMethodsTest.kt
+++ b/lifecycle/lifecycle-runtime-ktx-lint/src/test/java/androidx/lifecycle/runtime/lint/WhenMethodsTest.kt
@@ -14,11 +14,13 @@
* limitations under the License.
*/
-package androidx.lifecycle.lint
+package androidx.lifecycle.runtime.lint
-import androidx.lifecycle.lint.stubs.COROUTINES_STUB
-import androidx.lifecycle.lint.stubs.LIFECYCLE_STUB
-import androidx.lifecycle.lint.stubs.VIEW_STUB
+import androidx.lifecycle.lint.LifecycleWhenChecks
+import androidx.lifecycle.lint.errorMessage
+import androidx.lifecycle.runtime.lint.stubs.COROUTINES_STUB
+import androidx.lifecycle.runtime.lint.stubs.LIFECYCLE_STUB
+import androidx.lifecycle.runtime.lint.stubs.VIEW_STUB
import com.android.tools.lint.checks.infrastructure.TestFiles
import com.android.tools.lint.checks.infrastructure.TestLintResult
import com.android.tools.lint.checks.infrastructure.TestLintTask
diff --git a/lifecycle/lifecycle-runtime-ktx-lint/src/test/java/androidx/lifecycle/lint/stubs/Stubs.kt b/lifecycle/lifecycle-runtime-ktx-lint/src/test/java/androidx/lifecycle/runtime/lint/stubs/Stubs.kt
similarity index 98%
rename from lifecycle/lifecycle-runtime-ktx-lint/src/test/java/androidx/lifecycle/lint/stubs/Stubs.kt
rename to lifecycle/lifecycle-runtime-ktx-lint/src/test/java/androidx/lifecycle/runtime/lint/stubs/Stubs.kt
index 6c04c7f..0518863 100644
--- a/lifecycle/lifecycle-runtime-ktx-lint/src/test/java/androidx/lifecycle/lint/stubs/Stubs.kt
+++ b/lifecycle/lifecycle-runtime-ktx-lint/src/test/java/androidx/lifecycle/runtime/lint/stubs/Stubs.kt
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package androidx.lifecycle.lint.stubs
+package androidx.lifecycle.runtime.lint.stubs
import com.android.tools.lint.checks.infrastructure.LintDetectorTest
import com.android.tools.lint.checks.infrastructure.TestFiles
diff --git a/lifecycle/lifecycle-runtime/proguard-rules.pro b/lifecycle/lifecycle-runtime/proguard-rules.pro
index ab57e11c..e4b2c95 100644
--- a/lifecycle/lifecycle-runtime/proguard-rules.pro
+++ b/lifecycle/lifecycle-runtime/proguard-rules.pro
@@ -1,4 +1,7 @@
--keepattributes *Annotation*
+-keepattributes AnnotationDefault,
+ RuntimeVisibleAnnotations,
+ RuntimeVisibleParameterAnnotations,
+ RuntimeVisibleTypeAnnotations
-keepclassmembers enum androidx.lifecycle.Lifecycle$Event {
<fields>;
diff --git a/lint-checks/src/main/java/androidx/build/lint/AndroidXIssueRegistry.kt b/lint-checks/src/main/java/androidx/build/lint/AndroidXIssueRegistry.kt
index 6f93b40..66c8f24 100644
--- a/lint-checks/src/main/java/androidx/build/lint/AndroidXIssueRegistry.kt
+++ b/lint-checks/src/main/java/androidx/build/lint/AndroidXIssueRegistry.kt
@@ -24,7 +24,7 @@
class AndroidXIssueRegistry : IssueRegistry() {
override val minApi = CURRENT_API
- override val api = 10
+ override val api = 11
override val issues get(): List<Issue> {
return Issues
}
diff --git a/media/version-compat-tests/current/client/src/androidTest/java/android/support/mediacompat/client/MediaControllerCompatCallbackTest.java b/media/version-compat-tests/current/client/src/androidTest/java/android/support/mediacompat/client/MediaControllerCompatCallbackTest.java
index e8dfcba..c7ad62f 100644
--- a/media/version-compat-tests/current/client/src/androidTest/java/android/support/mediacompat/client/MediaControllerCompatCallbackTest.java
+++ b/media/version-compat-tests/current/client/src/androidTest/java/android/support/mediacompat/client/MediaControllerCompatCallbackTest.java
@@ -382,7 +382,7 @@
final int requestCode = 555;
final PendingIntent pi =
PendingIntent.getActivity(getApplicationContext(), requestCode, intent,
- PendingIntent.FLAG_IMMUTABLE);
+ Build.VERSION.SDK_INT >= 23 ? PendingIntent.FLAG_IMMUTABLE : 0);
callMediaSessionMethod(SET_SESSION_ACTIVITY, pi, getApplicationContext());
new PollingCheck(TIME_OUT_MS) {
diff --git a/media/version-compat-tests/previous/client/build.gradle b/media/version-compat-tests/previous/client/build.gradle
index 542924e..a7fe5f5 100644
--- a/media/version-compat-tests/previous/client/build.gradle
+++ b/media/version-compat-tests/previous/client/build.gradle
@@ -20,7 +20,7 @@
}
dependencies {
- androidTestImplementation("androidx.media:media:1.3.0")
+ androidTestImplementation("androidx.media:media:1.4.1")
androidTestImplementation(project(":media:version-compat-tests:lib"))
androidTestImplementation(libs.testExtJunit)
diff --git a/media/version-compat-tests/previous/client/src/androidTest/java/android/support/mediacompat/client/MediaControllerCompatCallbackTest.java b/media/version-compat-tests/previous/client/src/androidTest/java/android/support/mediacompat/client/MediaControllerCompatCallbackTest.java
index e8dfcba..c7ad62f 100644
--- a/media/version-compat-tests/previous/client/src/androidTest/java/android/support/mediacompat/client/MediaControllerCompatCallbackTest.java
+++ b/media/version-compat-tests/previous/client/src/androidTest/java/android/support/mediacompat/client/MediaControllerCompatCallbackTest.java
@@ -382,7 +382,7 @@
final int requestCode = 555;
final PendingIntent pi =
PendingIntent.getActivity(getApplicationContext(), requestCode, intent,
- PendingIntent.FLAG_IMMUTABLE);
+ Build.VERSION.SDK_INT >= 23 ? PendingIntent.FLAG_IMMUTABLE : 0);
callMediaSessionMethod(SET_SESSION_ACTIVITY, pi, getApplicationContext());
new PollingCheck(TIME_OUT_MS) {
diff --git a/media/version-compat-tests/previous/service/build.gradle b/media/version-compat-tests/previous/service/build.gradle
index 542924e..a7fe5f5 100644
--- a/media/version-compat-tests/previous/service/build.gradle
+++ b/media/version-compat-tests/previous/service/build.gradle
@@ -20,7 +20,7 @@
}
dependencies {
- androidTestImplementation("androidx.media:media:1.3.0")
+ androidTestImplementation("androidx.media:media:1.4.1")
androidTestImplementation(project(":media:version-compat-tests:lib"))
androidTestImplementation(libs.testExtJunit)
diff --git a/media2/media2-common/build.gradle b/media2/media2-common/build.gradle
index 1fb355b..2aac36f 100644
--- a/media2/media2-common/build.gradle
+++ b/media2/media2-common/build.gradle
@@ -26,7 +26,7 @@
dependencies {
api("androidx.core:core:1.6.0")
- api("androidx.media:media:1.2.0")
+ api("androidx.media:media:1.4.1")
// TODO(b/177296655): Remove versionedparcelable dependency after the transitive dependency
// through media which depends on core is updated.
api("androidx.versionedparcelable:versionedparcelable:1.1.1")
diff --git a/media2/media2-session/lint-baseline.xml b/media2/media2-session/lint-baseline.xml
index de1bd63..af17e24 100644
--- a/media2/media2-session/lint-baseline.xml
+++ b/media2/media2-session/lint-baseline.xml
@@ -1,5 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
-<issues format="6" by="lint 7.1.0-alpha03" type="baseline" client="gradle" name="AGP (7.1.0-alpha03)" variant="all" version="7.1.0-alpha03">
+<issues format="6" by="lint 7.1.0-dev" type="baseline" client="gradle" dependencies="false" name="AGP (7.1.0-dev)" variant="all" version="7.1.0-dev">
+
+ <issue
+ id="WrongConstant"
+ message="Must be one of: VolumeProviderCompat.VOLUME_CONTROL_FIXED, VolumeProviderCompat.VOLUME_CONTROL_RELATIVE, VolumeProviderCompat.VOLUME_CONTROL_ABSOLUTE"
+ errorLine1=" return new VolumeProviderCompat(player.getVolumeControlType(), player.getMaxVolume(),"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/java/androidx/media2/session/MediaSessionLegacyStub.java"
+ line="630"
+ column="41"/>
+ </issue>
<issue
id="WrongConstant"
diff --git a/media2/media2-session/src/androidTest/java/androidx/media2/session/MediaControllerTest.java b/media2/media2-session/src/androidTest/java/androidx/media2/session/MediaControllerTest.java
index afb8ca9..7911f95 100644
--- a/media2/media2-session/src/androidTest/java/androidx/media2/session/MediaControllerTest.java
+++ b/media2/media2-session/src/androidTest/java/androidx/media2/session/MediaControllerTest.java
@@ -99,7 +99,8 @@
super.setUp();
final Intent sessionActivity = new Intent(mContext, MockActivity.class);
// Create this test specific MediaSession to use our own Handler.
- mIntent = PendingIntent.getActivity(mContext, 0, sessionActivity, 0);
+ mIntent = PendingIntent.getActivity(mContext, 0, sessionActivity,
+ Build.VERSION.SDK_INT >= 23 ? PendingIntent.FLAG_IMMUTABLE : 0);
mPlayer = new MockPlayer(1);
mSession = new MediaSession.Builder(mContext, mPlayer)
diff --git a/media2/media2-session/src/main/java/androidx/media2/session/MediaNotificationHandler.java b/media2/media2-session/src/main/java/androidx/media2/session/MediaNotificationHandler.java
index 9f64020..fc411f0 100644
--- a/media2/media2-session/src/main/java/androidx/media2/session/MediaNotificationHandler.java
+++ b/media2/media2-session/src/main/java/androidx/media2/session/MediaNotificationHandler.java
@@ -230,12 +230,14 @@
intent.setComponent(new ComponentName(mServiceInstance, mServiceInstance.getClass()));
intent.putExtra(Intent.EXTRA_KEY_EVENT, new KeyEvent(KeyEvent.ACTION_DOWN, keyCode));
- if (Build.VERSION.SDK_INT >= 26 && action != ACTION_PAUSE) {
+ if (Build.VERSION.SDK_INT >= 26 && action != ACTION_PAUSE && action != ACTION_STOP) {
return ClassVerificationHelper.PendingIntent.Api26.getForegroundService(
- mServiceInstance, keyCode /* requestCode */, intent, 0 /* flags */);
+ mServiceInstance, keyCode /* requestCode */, intent,
+ PendingIntent.FLAG_IMMUTABLE);
} else {
return PendingIntent.getService(
- mServiceInstance, keyCode /* requestCode */, intent, 0 /* flags */);
+ mServiceInstance, keyCode /* requestCode */, intent,
+ Build.VERSION.SDK_INT >= 23 ? PendingIntent.FLAG_IMMUTABLE : 0);
}
}
diff --git a/media2/media2-session/src/main/java/androidx/media2/session/MediaSessionImplBase.java b/media2/media2-session/src/main/java/androidx/media2/session/MediaSessionImplBase.java
index 10b784d..20d9a96 100644
--- a/media2/media2-session/src/main/java/androidx/media2/session/MediaSessionImplBase.java
+++ b/media2/media2-session/src/main/java/androidx/media2/session/MediaSessionImplBase.java
@@ -184,13 +184,14 @@
}
mbrComponent = sServiceComponentName;
}
+ int pendingIntentFlagMutable = Build.VERSION.SDK_INT >= 31 ? PendingIntent.FLAG_MUTABLE : 0;
if (mbrComponent == null) {
// No service to revive playback after it's dead.
// Create a PendingIntent that points to the runtime broadcast receiver.
Intent intent = new Intent(Intent.ACTION_MEDIA_BUTTON, mSessionUri);
intent.setPackage(context.getPackageName());
mMediaButtonIntent = PendingIntent.getBroadcast(
- context, 0 /* requestCode */, intent, 0 /* flags */);
+ context, 0 /* requestCode */, intent, pendingIntentFlagMutable);
// Creates a fake ComponentName for MediaSessionCompat in pre-L.
// TODO: Replace this with the MediaButtonReceiver class.
@@ -210,9 +211,10 @@
if (Build.VERSION.SDK_INT >= 26) {
mMediaButtonIntent =
ClassVerificationHelper.PendingIntent.Api26.getForegroundService(
- mContext, 0, intent, 0);
+ mContext, 0, intent, pendingIntentFlagMutable);
} else {
- mMediaButtonIntent = PendingIntent.getService(mContext, 0, intent, 0);
+ mMediaButtonIntent = PendingIntent.getService(
+ mContext, 0, intent, pendingIntentFlagMutable);
}
mBroadcastReceiver = null;
}
diff --git a/media2/media2-session/version-compat-tests/current/client/src/androidTest/java/androidx/media2/test/client/tests/MediaControllerLegacyTest.java b/media2/media2-session/version-compat-tests/current/client/src/androidTest/java/androidx/media2/test/client/tests/MediaControllerLegacyTest.java
index f432881..3114603 100644
--- a/media2/media2-session/version-compat-tests/current/client/src/androidTest/java/androidx/media2/test/client/tests/MediaControllerLegacyTest.java
+++ b/media2/media2-session/version-compat-tests/current/client/src/androidTest/java/androidx/media2/test/client/tests/MediaControllerLegacyTest.java
@@ -158,7 +158,8 @@
@Test
public void getSessionActivity() throws Exception {
final Intent sessionActivity = new Intent(mContext, MockActivity.class);
- PendingIntent pi = PendingIntent.getActivity(mContext, 0, sessionActivity, 0);
+ PendingIntent pi = PendingIntent.getActivity(mContext, 0, sessionActivity,
+ Build.VERSION.SDK_INT >= 23 ? PendingIntent.FLAG_IMMUTABLE : 0);
mSession.setSessionActivity(pi);
mController = createController(mSession.getSessionToken());
diff --git a/media2/media2-session/version-compat-tests/current/service/src/androidTest/java/androidx/media2/test/service/MediaSessionProviderService.java b/media2/media2-session/version-compat-tests/current/service/src/androidTest/java/androidx/media2/test/service/MediaSessionProviderService.java
index 207705e..990efd1 100644
--- a/media2/media2-session/version-compat-tests/current/service/src/androidTest/java/androidx/media2/test/service/MediaSessionProviderService.java
+++ b/media2/media2-session/version-compat-tests/current/service/src/androidTest/java/androidx/media2/test/service/MediaSessionProviderService.java
@@ -43,6 +43,7 @@
import android.app.Service;
import android.content.Intent;
import android.graphics.Bitmap;
+import android.os.Build;
import android.os.Bundle;
import android.os.IBinder;
import android.os.ParcelFileDescriptor;
@@ -136,7 +137,8 @@
PendingIntent pendingIntent = PendingIntent.getActivity(
MediaSessionProviderService.this,
0 /* requestCode */,
- sessionActivity, 0 /* flags */);
+ sessionActivity,
+ Build.VERSION.SDK_INT >= 23 ? PendingIntent.FLAG_IMMUTABLE : 0);
builder.setSessionActivity(pendingIntent);
break;
}
diff --git a/media2/media2-session/version-compat-tests/current/service/src/androidTest/java/androidx/media2/test/service/tests/MediaSessionCallbackWithMediaControllerCompatTest.java b/media2/media2-session/version-compat-tests/current/service/src/androidTest/java/androidx/media2/test/service/tests/MediaSessionCallbackWithMediaControllerCompatTest.java
index 2b66ba4..236caaa 100644
--- a/media2/media2-session/version-compat-tests/current/service/src/androidTest/java/androidx/media2/test/service/tests/MediaSessionCallbackWithMediaControllerCompatTest.java
+++ b/media2/media2-session/version-compat-tests/current/service/src/androidTest/java/androidx/media2/test/service/tests/MediaSessionCallbackWithMediaControllerCompatTest.java
@@ -100,7 +100,8 @@
super.setUp();
final Intent sessionActivity = new Intent(mContext, MockActivity.class);
// Create this test specific MediaSession to use our own Handler.
- mIntent = PendingIntent.getActivity(mContext, 0, sessionActivity, 0);
+ mIntent = PendingIntent.getActivity(mContext, 0, sessionActivity,
+ Build.VERSION.SDK_INT >= 23 ? PendingIntent.FLAG_IMMUTABLE : 0);
mPlayer = new MockPlayer(1);
if (mSession != null && !mSession.isClosed()) {
diff --git a/media2/media2-session/version-compat-tests/current/service/src/androidTest/java/androidx/media2/test/service/tests/MediaSessionCompatCallbackWithMediaControllerTest.java b/media2/media2-session/version-compat-tests/current/service/src/androidTest/java/androidx/media2/test/service/tests/MediaSessionCompatCallbackWithMediaControllerTest.java
index 16bc4536..5eb0390 100644
--- a/media2/media2-session/version-compat-tests/current/service/src/androidTest/java/androidx/media2/test/service/tests/MediaSessionCompatCallbackWithMediaControllerTest.java
+++ b/media2/media2-session/version-compat-tests/current/service/src/androidTest/java/androidx/media2/test/service/tests/MediaSessionCompatCallbackWithMediaControllerTest.java
@@ -97,7 +97,8 @@
super.setUp();
final Intent sessionActivity = new Intent(mContext, MockActivity.class);
// Create this test specific MediaSession to use our own Handler.
- mIntent = PendingIntent.getActivity(mContext, 0, sessionActivity, 0);
+ mIntent = PendingIntent.getActivity(mContext, 0, sessionActivity,
+ Build.VERSION.SDK_INT >= 23 ? PendingIntent.FLAG_IMMUTABLE : 0);
mSessionCallback = new MediaSessionCallback();
mSession = new MediaSessionCompat(mContext, TAG + "Compat");
diff --git a/media2/media2-session/version-compat-tests/previous/client/src/androidTest/java/androidx/media2/test/client/tests/MediaControllerLegacyTest.java b/media2/media2-session/version-compat-tests/previous/client/src/androidTest/java/androidx/media2/test/client/tests/MediaControllerLegacyTest.java
index 7b0ca0a..217c979 100644
--- a/media2/media2-session/version-compat-tests/previous/client/src/androidTest/java/androidx/media2/test/client/tests/MediaControllerLegacyTest.java
+++ b/media2/media2-session/version-compat-tests/previous/client/src/androidTest/java/androidx/media2/test/client/tests/MediaControllerLegacyTest.java
@@ -137,7 +137,8 @@
public void getSessionActivity() throws Exception {
prepareLooper();
final Intent sessionActivity = new Intent(mContext, MockActivity.class);
- PendingIntent pi = PendingIntent.getActivity(mContext, 0, sessionActivity, 0);
+ PendingIntent pi = PendingIntent.getActivity(mContext, 0, sessionActivity,
+ Build.VERSION.SDK_INT >= 23 ? PendingIntent.FLAG_IMMUTABLE : 0);
mSession.setSessionActivity(pi);
mController = createController(mSession.getSessionToken());
diff --git a/media2/media2-session/version-compat-tests/previous/service/src/androidTest/java/androidx/media2/test/service/MediaSessionProviderService.java b/media2/media2-session/version-compat-tests/previous/service/src/androidTest/java/androidx/media2/test/service/MediaSessionProviderService.java
index 1ab4d15..844e6f7 100644
--- a/media2/media2-session/version-compat-tests/previous/service/src/androidTest/java/androidx/media2/test/service/MediaSessionProviderService.java
+++ b/media2/media2-session/version-compat-tests/previous/service/src/androidTest/java/androidx/media2/test/service/MediaSessionProviderService.java
@@ -41,6 +41,7 @@
import android.app.Service;
import android.content.Intent;
import android.graphics.Bitmap;
+import android.os.Build;
import android.os.Bundle;
import android.os.IBinder;
import android.os.ParcelFileDescriptor;
@@ -134,7 +135,8 @@
PendingIntent pendingIntent = PendingIntent.getActivity(
MediaSessionProviderService.this,
0 /* requestCode */,
- sessionActivity, 0 /* flags */);
+ sessionActivity,
+ Build.VERSION.SDK_INT >= 23 ? PendingIntent.FLAG_IMMUTABLE : 0);
builder.setSessionActivity(pendingIntent);
break;
}
diff --git a/media2/media2-session/version-compat-tests/previous/service/src/androidTest/java/androidx/media2/test/service/tests/MediaSessionCallbackWithMediaControllerCompatTest.java b/media2/media2-session/version-compat-tests/previous/service/src/androidTest/java/androidx/media2/test/service/tests/MediaSessionCallbackWithMediaControllerCompatTest.java
index 883db40f..2ad0d53 100644
--- a/media2/media2-session/version-compat-tests/previous/service/src/androidTest/java/androidx/media2/test/service/tests/MediaSessionCallbackWithMediaControllerCompatTest.java
+++ b/media2/media2-session/version-compat-tests/previous/service/src/androidTest/java/androidx/media2/test/service/tests/MediaSessionCallbackWithMediaControllerCompatTest.java
@@ -100,7 +100,8 @@
super.setUp();
final Intent sessionActivity = new Intent(mContext, MockActivity.class);
// Create this test specific MediaSession to use our own Handler.
- mIntent = PendingIntent.getActivity(mContext, 0, sessionActivity, 0);
+ mIntent = PendingIntent.getActivity(mContext, 0, sessionActivity,
+ Build.VERSION.SDK_INT >= 23 ? PendingIntent.FLAG_IMMUTABLE : 0);
mPlayer = new MockPlayer(1);
if (mSession != null && !mSession.isClosed()) {
diff --git a/media2/media2-session/version-compat-tests/previous/service/src/androidTest/java/androidx/media2/test/service/tests/MediaSessionCompatCallbackWithMediaControllerTest.java b/media2/media2-session/version-compat-tests/previous/service/src/androidTest/java/androidx/media2/test/service/tests/MediaSessionCompatCallbackWithMediaControllerTest.java
index 34c30d96..9ee62b8 100644
--- a/media2/media2-session/version-compat-tests/previous/service/src/androidTest/java/androidx/media2/test/service/tests/MediaSessionCompatCallbackWithMediaControllerTest.java
+++ b/media2/media2-session/version-compat-tests/previous/service/src/androidTest/java/androidx/media2/test/service/tests/MediaSessionCompatCallbackWithMediaControllerTest.java
@@ -88,7 +88,8 @@
super.setUp();
final Intent sessionActivity = new Intent(mContext, MockActivity.class);
// Create this test specific MediaSession to use our own Handler.
- mIntent = PendingIntent.getActivity(mContext, 0, sessionActivity, 0);
+ mIntent = PendingIntent.getActivity(mContext, 0, sessionActivity,
+ Build.VERSION.SDK_INT >= 23 ? PendingIntent.FLAG_IMMUTABLE : 0);
mSessionCallback = new MediaSessionCallback();
mSession = new MediaSessionCompat(mContext, TAG + "Compat");
diff --git a/media2/media2-widget/src/main/res/values-mr/strings.xml b/media2/media2-widget/src/main/res/values-mr/strings.xml
index 1d23598..845623764 100644
--- a/media2/media2-widget/src/main/res/values-mr/strings.xml
+++ b/media2/media2-widget/src/main/res/values-mr/strings.xml
@@ -33,7 +33,7 @@
<string name="mcv2_error_dialog_button" msgid="5940167897992933850">"ओके"</string>
<string name="mcv2_back_button_desc" msgid="1540894858499118373">"मागे जा"</string>
<string name="mcv2_overflow_left_button_desc" msgid="2749567167276435888">"बटणांच्या मागील सूचीवर परत जा"</string>
- <string name="mcv2_overflow_right_button_desc" msgid="7388732945289831383">"आणखी बटणे पाहा"</string>
+ <string name="mcv2_overflow_right_button_desc" msgid="7388732945289831383">"आणखी बटणे पहा"</string>
<string name="mcv2_seek_bar_desc" msgid="24915699029009384">"प्लेबॅकची प्रगती"</string>
<string name="mcv2_settings_button_desc" msgid="811917224044739656">"सेटिंग्ज"</string>
<string name="mcv2_cc_is_on" msgid="5427119422911561783">"सबटायटल सुरू आहे. लपवण्यासाठी क्लिक करा."</string>
diff --git a/mediarouter/mediarouter/build.gradle b/mediarouter/mediarouter/build.gradle
index 376ccad..f1278e0 100644
--- a/mediarouter/mediarouter/build.gradle
+++ b/mediarouter/mediarouter/build.gradle
@@ -23,7 +23,7 @@
}
dependencies {
- api("androidx.media:media:1.2.0")
+ api("androidx.media:media:1.4.1")
api(libs.guavaListenableFuture)
implementation("androidx.core:core:1.6.0-rc01")
diff --git a/mediarouter/mediarouter/src/main/java/androidx/mediarouter/app/MediaRouteControllerDialog.java b/mediarouter/mediarouter/src/main/java/androidx/mediarouter/app/MediaRouteControllerDialog.java
index 80f12b8..5c7095f 100644
--- a/mediarouter/mediarouter/src/main/java/androidx/mediarouter/app/MediaRouteControllerDialog.java
+++ b/mediarouter/mediarouter/src/main/java/androidx/mediarouter/app/MediaRouteControllerDialog.java
@@ -236,6 +236,10 @@
return mRoute;
}
+ private boolean isGroup() {
+ return mRoute.isGroup() && mRoute.getMemberRoutes().size() > 1;
+ }
+
/**
* Provides the subclass an opportunity to create a view that will replace the default media
* controls for the currently playing content.
@@ -407,7 +411,7 @@
mGroupMemberRoutesAnimatingWithBitmap = new HashSet<>();
MediaRouterThemeHelper.setMediaControlsBackgroundColor(mContext,
- mMediaMainControlLayout, mVolumeGroupList, mRoute.isGroup());
+ mMediaMainControlLayout, mVolumeGroupList, isGroup());
MediaRouterThemeHelper.setVolumeSliderColor(mContext,
(MediaRouteVolumeSlider) mVolumeSlider, mMediaMainControlLayout);
mVolumeSliderMap = new HashMap<>();
@@ -625,7 +629,7 @@
int mainControllerHeight = getMainControllerHeight(canShowPlaybackControlLayout());
int volumeGroupListCount = mGroupMemberRoutes.size();
// Scale down volume group list items in landscape mode.
- int expandedGroupListHeight = mRoute.isGroup()
+ int expandedGroupListHeight = isGroup()
? mVolumeGroupListItemHeight * mRoute.getMemberRoutes().size() : 0;
if (volumeGroupListCount > 0) {
expandedGroupListHeight += mVolumeGroupListPaddingTop;
@@ -731,7 +735,7 @@
}
private void updateVolumeControlLayout() {
- if (!mEnableGroupVolumeUX && mRoute.isGroup()) {
+ if (!mEnableGroupVolumeUX && isGroup()) {
mVolumeControlLayout.setVisibility(View.GONE);
mIsGroupExpanded = true;
mVolumeGroupList.setVisibility(View.VISIBLE);
@@ -746,8 +750,7 @@
mVolumeControlLayout.setVisibility(View.VISIBLE);
mVolumeSlider.setMax(mRoute.getVolumeMax());
mVolumeSlider.setProgress(mRoute.getVolume());
- mGroupExpandCollapseButton.setVisibility(mRoute.isGroup()
- ? View.VISIBLE : View.GONE);
+ mGroupExpandCollapseButton.setVisibility(isGroup() ? View.VISIBLE : View.GONE);
}
}
}
@@ -1101,7 +1104,7 @@
void updateArtIconIfNeeded() {
if (mCustomControlView != null || !isIconChanged()
- || (mRoute.isGroup() && !mEnableGroupVolumeUX)) {
+ || (isGroup() && !mEnableGroupVolumeUX)) {
return;
}
if (mFetchArtTask != null) {
diff --git a/mediarouter/mediarouter/src/main/java/androidx/mediarouter/media/RemotePlaybackClient.java b/mediarouter/mediarouter/src/main/java/androidx/mediarouter/media/RemotePlaybackClient.java
index 01b10cb..6cb2428 100644
--- a/mediarouter/mediarouter/src/main/java/androidx/mediarouter/media/RemotePlaybackClient.java
+++ b/mediarouter/mediarouter/src/main/java/androidx/mediarouter/media/RemotePlaybackClient.java
@@ -82,17 +82,17 @@
Intent itemStatusIntent = new Intent(ActionReceiver.ACTION_ITEM_STATUS_CHANGED);
itemStatusIntent.setPackage(context.getPackageName());
mItemStatusPendingIntent = PendingIntent.getBroadcast(
- context, 0, itemStatusIntent, 0);
+ context, 0, itemStatusIntent, PendingIntent.FLAG_IMMUTABLE);
Intent sessionStatusIntent = new Intent(ActionReceiver.ACTION_SESSION_STATUS_CHANGED);
sessionStatusIntent.setPackage(context.getPackageName());
mSessionStatusPendingIntent = PendingIntent.getBroadcast(
- context, 0, sessionStatusIntent, 0);
+ context, 0, sessionStatusIntent, PendingIntent.FLAG_IMMUTABLE);
Intent messageIntent = new Intent(ActionReceiver.ACTION_MESSAGE_RECEIVED);
messageIntent.setPackage(context.getPackageName());
mMessagePendingIntent = PendingIntent.getBroadcast(
- context, 0, messageIntent, 0);
+ context, 0, messageIntent, PendingIntent.FLAG_IMMUTABLE);
detectFeatures();
}
diff --git a/navigation/buildSrc b/navigation/buildSrc
new file mode 120000
index 0000000..053a423
--- /dev/null
+++ b/navigation/buildSrc
@@ -0,0 +1 @@
+../buildSrc
\ No newline at end of file
diff --git a/navigation/navigation-benchmark/src/androidTest/AndroidManifest.xml b/navigation/navigation-benchmark/src/androidTest/AndroidManifest.xml
index 358a851..b16e9d9 100644
--- a/navigation/navigation-benchmark/src/androidTest/AndroidManifest.xml
+++ b/navigation/navigation-benchmark/src/androidTest/AndroidManifest.xml
@@ -16,15 +16,9 @@
-->
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:tools="http://schemas.android.com/tools"
package="androidx.navigation.benchmark.test">
-
- <!-- Important: disable debuggable for accurate performance results -->
- <application
- android:debuggable="false"
- tools:replace="android:debuggable">
- <!-- enable profileableByShell for non-intrusive profiling tools -->
- <!--suppress AndroidElementNotAllowed -->
+ <application>
+ <!-- enable profiling by shell for non-intrusive profiling tools -->
<profileable android:shell="true"/>
</application>
</manifest>
diff --git a/navigation/navigation-common/api/current.txt b/navigation/navigation-common/api/current.txt
index 9f26538..66b0df7 100644
--- a/navigation/navigation-common/api/current.txt
+++ b/navigation/navigation-common/api/current.txt
@@ -376,14 +376,15 @@
}
public abstract class NavType<T> {
+ ctor public NavType(boolean isNullableAllowed);
method public static androidx.navigation.NavType<?> fromArgType(String? type, String? packageName);
method public abstract operator T? get(android.os.Bundle bundle, String key);
- method public abstract String getName();
+ method public String getName();
method public boolean isNullableAllowed();
method public abstract T! parseValue(String value);
method public abstract void put(android.os.Bundle bundle, String key, T? value);
property public boolean isNullableAllowed;
- property public abstract String name;
+ property public String name;
field public static final androidx.navigation.NavType<boolean[]> BoolArrayType;
field public static final androidx.navigation.NavType<java.lang.Boolean> BoolType;
field public static final androidx.navigation.NavType.Companion Companion;
@@ -410,7 +411,6 @@
public static final class NavType.ParcelableArrayType<D extends android.os.Parcelable> extends androidx.navigation.NavType<D[]> {
ctor public NavType.ParcelableArrayType(Class<D> type);
method public D![]? get(android.os.Bundle bundle, String key);
- method public String getName();
method public D![] parseValue(String value);
method public void put(android.os.Bundle bundle, String key, D![]? value);
property public String name;
@@ -419,7 +419,6 @@
public static final class NavType.ParcelableType<D> extends androidx.navigation.NavType<D> {
ctor public NavType.ParcelableType(Class<D> type);
method public D? get(android.os.Bundle bundle, String key);
- method public String getName();
method public D! parseValue(String value);
method public void put(android.os.Bundle bundle, String key, D? value);
property public String name;
@@ -428,7 +427,6 @@
public static final class NavType.SerializableArrayType<D extends java.io.Serializable> extends androidx.navigation.NavType<D[]> {
ctor public NavType.SerializableArrayType(Class<D> type);
method public D![]? get(android.os.Bundle bundle, String key);
- method public String getName();
method public D![] parseValue(String value);
method public void put(android.os.Bundle bundle, String key, D![]? value);
property public String name;
@@ -437,7 +435,6 @@
public static class NavType.SerializableType<D extends java.io.Serializable> extends androidx.navigation.NavType<D> {
ctor public NavType.SerializableType(Class<D> type);
method public D? get(android.os.Bundle bundle, String key);
- method public String getName();
method public D parseValue(String value);
method public void put(android.os.Bundle bundle, String key, D value);
property public String name;
diff --git a/navigation/navigation-common/api/public_plus_experimental_current.txt b/navigation/navigation-common/api/public_plus_experimental_current.txt
index 9f26538..66b0df7 100644
--- a/navigation/navigation-common/api/public_plus_experimental_current.txt
+++ b/navigation/navigation-common/api/public_plus_experimental_current.txt
@@ -376,14 +376,15 @@
}
public abstract class NavType<T> {
+ ctor public NavType(boolean isNullableAllowed);
method public static androidx.navigation.NavType<?> fromArgType(String? type, String? packageName);
method public abstract operator T? get(android.os.Bundle bundle, String key);
- method public abstract String getName();
+ method public String getName();
method public boolean isNullableAllowed();
method public abstract T! parseValue(String value);
method public abstract void put(android.os.Bundle bundle, String key, T? value);
property public boolean isNullableAllowed;
- property public abstract String name;
+ property public String name;
field public static final androidx.navigation.NavType<boolean[]> BoolArrayType;
field public static final androidx.navigation.NavType<java.lang.Boolean> BoolType;
field public static final androidx.navigation.NavType.Companion Companion;
@@ -410,7 +411,6 @@
public static final class NavType.ParcelableArrayType<D extends android.os.Parcelable> extends androidx.navigation.NavType<D[]> {
ctor public NavType.ParcelableArrayType(Class<D> type);
method public D![]? get(android.os.Bundle bundle, String key);
- method public String getName();
method public D![] parseValue(String value);
method public void put(android.os.Bundle bundle, String key, D![]? value);
property public String name;
@@ -419,7 +419,6 @@
public static final class NavType.ParcelableType<D> extends androidx.navigation.NavType<D> {
ctor public NavType.ParcelableType(Class<D> type);
method public D? get(android.os.Bundle bundle, String key);
- method public String getName();
method public D! parseValue(String value);
method public void put(android.os.Bundle bundle, String key, D? value);
property public String name;
@@ -428,7 +427,6 @@
public static final class NavType.SerializableArrayType<D extends java.io.Serializable> extends androidx.navigation.NavType<D[]> {
ctor public NavType.SerializableArrayType(Class<D> type);
method public D![]? get(android.os.Bundle bundle, String key);
- method public String getName();
method public D![] parseValue(String value);
method public void put(android.os.Bundle bundle, String key, D![]? value);
property public String name;
@@ -437,7 +435,6 @@
public static class NavType.SerializableType<D extends java.io.Serializable> extends androidx.navigation.NavType<D> {
ctor public NavType.SerializableType(Class<D> type);
method public D? get(android.os.Bundle bundle, String key);
- method public String getName();
method public D parseValue(String value);
method public void put(android.os.Bundle bundle, String key, D value);
property public String name;
diff --git a/navigation/navigation-common/api/restricted_current.txt b/navigation/navigation-common/api/restricted_current.txt
index 9f26538..66b0df7 100644
--- a/navigation/navigation-common/api/restricted_current.txt
+++ b/navigation/navigation-common/api/restricted_current.txt
@@ -376,14 +376,15 @@
}
public abstract class NavType<T> {
+ ctor public NavType(boolean isNullableAllowed);
method public static androidx.navigation.NavType<?> fromArgType(String? type, String? packageName);
method public abstract operator T? get(android.os.Bundle bundle, String key);
- method public abstract String getName();
+ method public String getName();
method public boolean isNullableAllowed();
method public abstract T! parseValue(String value);
method public abstract void put(android.os.Bundle bundle, String key, T? value);
property public boolean isNullableAllowed;
- property public abstract String name;
+ property public String name;
field public static final androidx.navigation.NavType<boolean[]> BoolArrayType;
field public static final androidx.navigation.NavType<java.lang.Boolean> BoolType;
field public static final androidx.navigation.NavType.Companion Companion;
@@ -410,7 +411,6 @@
public static final class NavType.ParcelableArrayType<D extends android.os.Parcelable> extends androidx.navigation.NavType<D[]> {
ctor public NavType.ParcelableArrayType(Class<D> type);
method public D![]? get(android.os.Bundle bundle, String key);
- method public String getName();
method public D![] parseValue(String value);
method public void put(android.os.Bundle bundle, String key, D![]? value);
property public String name;
@@ -419,7 +419,6 @@
public static final class NavType.ParcelableType<D> extends androidx.navigation.NavType<D> {
ctor public NavType.ParcelableType(Class<D> type);
method public D? get(android.os.Bundle bundle, String key);
- method public String getName();
method public D! parseValue(String value);
method public void put(android.os.Bundle bundle, String key, D? value);
property public String name;
@@ -428,7 +427,6 @@
public static final class NavType.SerializableArrayType<D extends java.io.Serializable> extends androidx.navigation.NavType<D[]> {
ctor public NavType.SerializableArrayType(Class<D> type);
method public D![]? get(android.os.Bundle bundle, String key);
- method public String getName();
method public D![] parseValue(String value);
method public void put(android.os.Bundle bundle, String key, D![]? value);
property public String name;
@@ -437,7 +435,6 @@
public static class NavType.SerializableType<D extends java.io.Serializable> extends androidx.navigation.NavType<D> {
ctor public NavType.SerializableType(Class<D> type);
method public D? get(android.os.Bundle bundle, String key);
- method public String getName();
method public D parseValue(String value);
method public void put(android.os.Bundle bundle, String key, D value);
property public String name;
diff --git a/navigation/navigation-common/src/androidTest/java/androidx/navigation/NavDeepLinkTest.kt b/navigation/navigation-common/src/androidTest/java/androidx/navigation/NavDeepLinkTest.kt
index 9991594..02bd167 100644
--- a/navigation/navigation-common/src/androidTest/java/androidx/navigation/NavDeepLinkTest.kt
+++ b/navigation/navigation-common/src/androidTest/java/androidx/navigation/NavDeepLinkTest.kt
@@ -210,10 +210,7 @@
val id = 211
val matchArgs = deepLink.getMatchingArguments(
Uri.parse(deepLinkArgument.replace("{id}", id.toString())),
- mapOf(
- "id" to intArgument(),
- "myarg" to stringArgument()
- )
+ mapOf("id" to intArgument())
)
assertWithMessage("Args should not be null")
.that(matchArgs)
@@ -332,7 +329,7 @@
val matchArgs = deepLink.getMatchingArguments(
Uri.parse("$DEEP_LINK_EXACT_HTTPS/users"),
- mapOf("myarg" to nullableStringArgument())
+ mapOf("myarg" to nullableStringArgument(null))
)
assertWithMessage("Args should not be null")
.that(matchArgs)
@@ -369,7 +366,7 @@
val matchArgs = deepLink.getMatchingArguments(
Uri.parse(deepLinkArgument),
- mapOf("myarg" to nullableStringArgument())
+ mapOf("myarg" to nullableStringArgument(null))
)
assertWithMessage("Args should not be null")
.that(matchArgs)
@@ -442,7 +439,7 @@
Uri.parse("$DEEP_LINK_EXACT_HTTPS/users?id={id}".replace("{id}", id.toString())),
mapOf(
"id" to intArgument(),
- "optional" to nullableStringArgument()
+ "optional" to nullableStringArgument(null)
)
)
assertWithMessage("Args should not be null")
@@ -536,7 +533,7 @@
val matchArgs = deepLink.getMatchingArguments(
Uri.parse("$DEEP_LINK_EXACT_HTTPS/users?id={id}&extraParam={extraParam}"),
- mapOf("myarg" to nullableStringArgument())
+ mapOf("myarg" to nullableStringArgument(null))
)
assertWithMessage("Args should not be null")
.that(matchArgs)
@@ -574,7 +571,7 @@
val matchArgs = deepLink.getMatchingArguments(
Uri.parse("$DEEP_LINK_EXACT_HTTPS/users"),
- mapOf("myarg" to nullableStringArgument())
+ mapOf("myarg" to nullableStringArgument(null))
)
assertWithMessage("Args should not be null")
.that(matchArgs)
@@ -627,7 +624,7 @@
val matchArgs = deepLink.getMatchingArguments(
Uri.parse("$DEEP_LINK_EXACT_HTTPS/users"),
- mapOf("myarg" to nullableStringArgument())
+ mapOf("myarg" to nullableStringArgument(null))
)
assertWithMessage("Args should not be null")
.that(matchArgs)
@@ -738,8 +735,8 @@
val matchArgs = deepLink.getMatchingArguments(
Uri.parse("$DEEP_LINK_EXACT_HTTPS/users"),
mapOf(
- "first" to nullableStringArgument(),
- "last" to nullableStringArgument()
+ "first" to nullableStringArgument(null),
+ "last" to nullableStringArgument(null)
)
)
assertWithMessage("Args should not be null")
@@ -799,7 +796,7 @@
val matchArgs = deepLink.getMatchingArguments(
Uri.parse("$DEEP_LINK_EXACT_HTTPS/users?productId=wildCardMatch-{myarg}"),
- mapOf("myarg" to nullableStringArgument())
+ mapOf("myarg" to nullableStringArgument(null))
)
assertWithMessage("Args should not be null")
.that(matchArgs)
@@ -913,7 +910,7 @@
val matchArgs = deepLink.getMatchingArguments(
Uri.parse("$DEEP_LINK_EXACT_HTTPS/users"),
- mapOf("path" to nullableStringArgument())
+ mapOf("path" to nullableStringArgument(null))
)
assertWithMessage("Args should not be null")
.that(matchArgs)
@@ -1113,10 +1110,46 @@
.replace("{param}", param.toString())
val matchArgs = deepLink.getMatchingArguments(
Uri.parse(deepLinkUpper),
- mapOf("param" to intArgument())
+ mapOf("param" to intArgument(0))
)
- assertWithMessage("Args should be not be null")
+ assertWithMessage("Args should not be null")
+ .that(matchArgs)
+ .isNotNull()
+ assertWithMessage("Args bundle should be empty")
+ .that(matchArgs?.isEmpty)
+ .isTrue()
+ }
+
+ @Test
+ fun deepLinkMissingRequiredArgument() {
+ val deepLinkString = "$DEEP_LINK_EXACT_HTTPS/greeting?title={title}&text={text}"
+ val deepLink = NavDeepLink(deepLinkString)
+
+ val matchArgs = deepLink.getMatchingArguments(
+ Uri.parse("$DEEP_LINK_EXACT_HTTPS/greeting?title=No%20text"),
+ mapOf(
+ "title" to stringArgument(),
+ "text" to stringArgument()
+ )
+ )
+
+ assertWithMessage("Args should be null")
+ .that(matchArgs)
+ .isNull()
+ }
+
+ @Test
+ fun deepLinkMissingOptionalArgument() {
+ val deepLinkString = "$DEEP_LINK_EXACT_HTTPS/greeting?text={text}"
+ val deepLink = NavDeepLink(deepLinkString)
+
+ val matchArgs = deepLink.getMatchingArguments(
+ Uri.parse("$DEEP_LINK_EXACT_HTTPS/greeting"),
+ mapOf("text" to stringArgument("Default greeting"))
+ )
+
+ assertWithMessage("Args should not be null")
.that(matchArgs)
.isNotNull()
assertWithMessage("Args bundle should be empty")
diff --git a/navigation/navigation-common/src/androidTest/java/androidx/navigation/NavDestinationAndroidTest.kt b/navigation/navigation-common/src/androidTest/java/androidx/navigation/NavDestinationAndroidTest.kt
index 3341e59..d3d15c1 100644
--- a/navigation/navigation-common/src/androidTest/java/androidx/navigation/NavDestinationAndroidTest.kt
+++ b/navigation/navigation-common/src/androidTest/java/androidx/navigation/NavDestinationAndroidTest.kt
@@ -21,6 +21,7 @@
import androidx.core.net.toUri
import androidx.navigation.NavDestination.Companion.createRoute
import androidx.navigation.test.intArgument
+import androidx.navigation.test.nullableStringArgument
import androidx.navigation.test.stringArgument
import androidx.test.filters.SmallTest
import com.google.common.truth.Truth.assertThat
@@ -116,7 +117,7 @@
destination.addDeepLink("www.example.com/users/index.html")
- destination.addArgument("name", stringArgument())
+ destination.addArgument("name", nullableStringArgument(null))
destination.addDeepLink("www.example.com/users/{name}")
val match = destination.matchDeepLink(
@@ -138,7 +139,7 @@
destination.addArgument("tab", stringArgument())
destination.addDeepLink("www.example.com/users/anonymous?tab={tab}")
- destination.addArgument("name", stringArgument())
+ destination.addArgument("name", nullableStringArgument(null))
destination.addDeepLink("www.example.com/users/{name}?tab={tab}")
val match = destination.matchDeepLink(
@@ -224,7 +225,7 @@
fun matchDeepLinkBestMimeType() {
val destination = NoOpNavigator().createDestination()
- destination.addArgument("deeplink1", stringArgument())
+ destination.addArgument("deeplink1", nullableStringArgument(null))
destination.addDeepLink(
NavDeepLink(
"www.example.com/users/{deeplink1}",
@@ -232,7 +233,7 @@
)
)
- destination.addArgument("deeplink2", stringArgument())
+ destination.addArgument("deeplink2", nullableStringArgument(null))
destination.addDeepLink(
NavDeepLink(
"www.example.com/users/{deeplink2}",
@@ -281,9 +282,8 @@
val destination = NoOpNavigator().createDestination()
destination.addArgument("testString", stringArgument())
destination.addDeepLink("android-app://androidx.navigation.test/{testString}")
- val deepLink = Uri.parse("android-app://androidx.navigation.test/test")
- destination.addDeepLink(deepLink.toString())
+ val deepLink = Uri.parse("android-app://androidx.navigation.test/test")
assertWithMessage("Deep link should match")
.that(destination.hasDeepLink(deepLink)).isTrue()
}
diff --git a/navigation/navigation-common/src/androidTest/java/androidx/navigation/NavGraphAndroidTest.kt b/navigation/navigation-common/src/androidTest/java/androidx/navigation/NavGraphAndroidTest.kt
index d47d5f2..23e0834 100644
--- a/navigation/navigation-common/src/androidTest/java/androidx/navigation/NavGraphAndroidTest.kt
+++ b/navigation/navigation-common/src/androidTest/java/androidx/navigation/NavGraphAndroidTest.kt
@@ -17,6 +17,7 @@
package androidx.navigation
import android.net.Uri
+import androidx.navigation.test.nullableStringArgument
import androidx.test.filters.SmallTest
import com.google.common.truth.Truth.assertThat
import com.google.common.truth.Truth.assertWithMessage
@@ -70,11 +71,8 @@
graph.addDeepLink("www.example.com/users/index.html")
- val idArgument = NavArgument.Builder()
- .setType(NavType.StringType)
- .build()
- graph.addArgument("id", idArgument)
- graph.addDeepLink("www.example.com/users/{name}")
+ graph.addArgument("id", nullableStringArgument(null))
+ graph.addDeepLink("www.example.com/users/{id}")
val match = graph.matchDeepLink(
Uri.parse("https://www.example.com/users/index.html")
@@ -155,16 +153,10 @@
val graph = navigatorProvider.getNavigator(NavGraphNavigator::class.java)
.createDestination()
- val codeArgument = NavArgument.Builder()
- .setType(NavType.StringType)
- .build()
- graph.addArgument("code", codeArgument)
+ graph.addArgument("code", nullableStringArgument(null))
graph.addDeepLink("www.example.com/users?code={code}")
- val idArgument = NavArgument.Builder()
- .setType(NavType.StringType)
- .build()
- graph.addArgument("id", idArgument)
+ graph.addArgument("id", nullableStringArgument(null))
graph.addDeepLink("www.example.com/users?id={id}")
val match = graph.matchDeepLink(
diff --git a/navigation/navigation-common/src/androidTest/java/androidx/navigation/test/NavArgument.kt b/navigation/navigation-common/src/androidTest/java/androidx/navigation/test/NavArgument.kt
index 760817c..a357518 100644
--- a/navigation/navigation-common/src/androidTest/java/androidx/navigation/test/NavArgument.kt
+++ b/navigation/navigation-common/src/androidTest/java/androidx/navigation/test/NavArgument.kt
@@ -77,8 +77,11 @@
.setDefaultValue(defaultValue)
.build()
-fun nullableStringArgument() = NavArgument.Builder().setType(StringType)
+fun nullableStringArgument(
+ defaultValue: String?
+) = NavArgument.Builder().setType(StringType)
.setIsNullable(true)
+ .setDefaultValue(defaultValue)
.build()
// endregion
@@ -89,4 +92,4 @@
.setIsNullable(true)
.setDefaultValue(defaultValue)
.build()
-// endregion
\ No newline at end of file
+// endregion
diff --git a/navigation/navigation-common/src/main/java/androidx/navigation/NavDeepLink.kt b/navigation/navigation-common/src/main/java/androidx/navigation/NavDeepLink.kt
index ea99d5e..b2ce511 100644
--- a/navigation/navigation-common/src/main/java/androidx/navigation/NavDeepLink.kt
+++ b/navigation/navigation-common/src/main/java/androidx/navigation/NavDeepLink.kt
@@ -54,6 +54,10 @@
private var mimeTypePattern: Pattern? = null
+ /** Arguments present in the deep link, including both path and query arguments. */
+ internal val argumentsNames: List<String>
+ get() = arguments + paramArgMap.keys
+
public var isExactDeepLink: Boolean = false
/** @suppress */
@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
@@ -192,6 +196,13 @@
}
}
}
+
+ // Check that all required arguments are present in bundle
+ for ((argName, argument) in arguments.entries) {
+ val argumentIsRequired = argument != null && !argument.isDefaultValuePresent
+ if (argumentIsRequired && !bundle.containsKey(argName)) return null
+ }
+
return bundle
}
@@ -283,7 +294,8 @@
public class Builder {
/** @suppress */
- @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP) public constructor()
+ @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
+ public constructor()
private var uriPattern: String? = null
private var action: String? = null
diff --git a/navigation/navigation-common/src/main/java/androidx/navigation/NavDestination.kt b/navigation/navigation-common/src/main/java/androidx/navigation/NavDestination.kt
index c92d8f7..e068943 100644
--- a/navigation/navigation-common/src/main/java/androidx/navigation/NavDestination.kt
+++ b/navigation/navigation-common/src/main/java/androidx/navigation/NavDestination.kt
@@ -315,6 +315,14 @@
* @see NavController.navigate
*/
public fun addDeepLink(navDeepLink: NavDeepLink) {
+ val missingRequiredArguments = arguments.filterValues { !it.isDefaultValuePresent }
+ .keys
+ .filter { it !in navDeepLink.argumentsNames }
+ require(missingRequiredArguments.isEmpty()) {
+ "Deep link ${navDeepLink.uriPattern} can't be used to open destination $this.\n" +
+ "Following required arguments are missing: $missingRequiredArguments"
+ }
+
deepLinks.add(navDeepLink)
}
diff --git a/navigation/navigation-common/src/main/java/androidx/navigation/NavType.kt b/navigation/navigation-common/src/main/java/androidx/navigation/NavType.kt
index 48618f9..96452f0 100644
--- a/navigation/navigation-common/src/main/java/androidx/navigation/NavType.kt
+++ b/navigation/navigation-common/src/main/java/androidx/navigation/NavType.kt
@@ -31,7 +31,7 @@
*
* @param T the type of the data that is supported by this NavType
*/
-public abstract class NavType<T> internal constructor(
+public abstract class NavType<T>(
/**
* Check if an argument with this type can hold a null value.
* @return Returns true if this type allows null values, false otherwise.
@@ -89,7 +89,7 @@
*
* @return name of this type
*/
- public abstract val name: String
+ public open val name: String = "nav_type"
override fun toString(): String {
return name
diff --git a/navigation/navigation-runtime/src/androidTest/java/androidx/navigation/NavControllerActivityTest.kt b/navigation/navigation-runtime/src/androidTest/java/androidx/navigation/NavControllerActivityTest.kt
index efcee15..7765c96 100644
--- a/navigation/navigation-runtime/src/androidTest/java/androidx/navigation/NavControllerActivityTest.kt
+++ b/navigation/navigation-runtime/src/androidTest/java/androidx/navigation/NavControllerActivityTest.kt
@@ -75,7 +75,7 @@
navController.setGraph(R.navigation.nav_simple)
navController.handleDeepLink(
Intent().apply {
- data = Uri.parse("android-app://androidx.navigation.test/test")
+ data = Uri.parse("android-app://androidx.navigation.test/test/arg2")
}
)
assertThat(navController.currentDestination?.id)
@@ -97,7 +97,7 @@
val activity = activityRule.activity
val intent = Intent().apply {
- data = Uri.parse("android-app://androidx.navigation.test/test")
+ data = Uri.parse("android-app://androidx.navigation.test/test/arg2")
}
activity.intent = intent
diff --git a/navigation/navigation-runtime/src/androidTest/java/androidx/navigation/NavControllerRouteTest.kt b/navigation/navigation-runtime/src/androidTest/java/androidx/navigation/NavControllerRouteTest.kt
index 654ffd9..8b6f14a 100644
--- a/navigation/navigation-runtime/src/androidTest/java/androidx/navigation/NavControllerRouteTest.kt
+++ b/navigation/navigation-runtime/src/androidTest/java/androidx/navigation/NavControllerRouteTest.kt
@@ -23,6 +23,7 @@
import android.os.Parcel
import androidx.activity.OnBackPressedDispatcher
import androidx.activity.addCallback
+import androidx.core.os.bundleOf
import androidx.lifecycle.Lifecycle
import androidx.lifecycle.ViewModelStore
import androidx.lifecycle.testing.TestLifecycleOwner
@@ -65,14 +66,14 @@
test("start_test_with_default_arg") {
argument("defaultArg") { defaultValue = true }
}
- test("second_test") {
+ test("second_test/{arg2}") {
argument("arg2") { type = NavType.StringType }
argument("defaultArg") {
type = NavType.StringType
defaultValue = "defaultValue"
}
deepLink {
- uriPattern = "android-app://androidx.navigation.test/test"
+ uriPattern = "android-app://androidx.navigation.test/test/{arg2}"
action = "test.action"
mimeType = "type/test"
}
@@ -185,7 +186,7 @@
fun testGetPreviousBackStackEntry() {
val navController = createNavController()
navController.graph = nav_simple_route_graph
- navController.navigate("second_test")
+ navController.navigate("second_test/arg2")
assertThat(navController.previousBackStackEntry?.destination?.route).isEqualTo("start_test")
}
@@ -319,8 +320,8 @@
assertThat(navController.currentDestination?.route).isEqualTo("start_test")
assertThat(navigator.backStack.size).isEqualTo(1)
- navController.navigate("second_test")
- assertThat(navController.currentDestination?.route).isEqualTo("second_test")
+ navController.navigate("second_test/arg2")
+ assertThat(navController.currentDestination?.route).isEqualTo("second_test/{arg2}")
assertThat(navigator.backStack.size).isEqualTo(2)
}
@@ -330,10 +331,10 @@
val navController = createNavController()
navController.graph = nav_simple_route_graph
val navigator = navController.navigatorProvider.getNavigator(TestNavigator::class.java)
- val deepLink = Uri.parse("android-app://androidx.navigation.test/test")
+ val deepLink = Uri.parse("android-app://androidx.navigation.test/test/arg2")
navController.navigate(deepLink)
- assertThat(navController.currentDestination?.route).isEqualTo("second_test")
+ assertThat(navController.currentDestination?.route).isEqualTo("second_test/{arg2}")
assertThat(navigator.backStack.size).isEqualTo(2)
val intent = navigator.current.arguments?.getParcelable<Intent>(
NavController.KEY_DEEP_LINK_INTENT
@@ -347,12 +348,12 @@
val navController = createNavController()
navController.graph = nav_simple_route_graph
val navigator = navController.navigatorProvider.getNavigator(TestNavigator::class.java)
- val deepLink = Uri.parse("android-app://androidx.navigation.test/test")
+ val deepLink = Uri.parse("android-app://androidx.navigation.test/test/arg2")
navController.navigate(deepLink)
val destination = navController.currentDestination
- assertThat(destination?.route).isEqualTo("second_test")
+ assertThat(destination?.route).isEqualTo("second_test/{arg2}")
assertThat(navigator.backStack.size).isEqualTo(2)
assertThat(destination?.arguments?.get("defaultArg")?.defaultValue.toString())
.isEqualTo("defaultValue")
@@ -367,7 +368,7 @@
val deepLink = NavDeepLinkRequest(Uri.parse("invalidDeepLink.com"), "test.action", null)
navController.navigate(deepLink)
- assertThat(navController.currentDestination?.route).isEqualTo("second_test")
+ assertThat(navController.currentDestination?.route).isEqualTo("second_test/{arg2}")
assertThat(navigator.backStack.size).isEqualTo(2)
}
@@ -380,7 +381,7 @@
val deepLink = NavDeepLinkRequest(Uri.parse("invalidDeepLink.com"), null, "type/test")
navController.navigate(deepLink)
- assertThat(navController.currentDestination?.route).isEqualTo("second_test")
+ assertThat(navController.currentDestination?.route).isEqualTo("second_test/{arg2}")
assertThat(navigator.backStack.size).isEqualTo(2)
}
@@ -447,7 +448,7 @@
val navController = createNavController()
navController.graph = nav_simple_route_graph
val navigator = navController.navigatorProvider.getNavigator(TestNavigator::class.java)
- val deepLink = Uri.parse("android-app://androidx.navigation.test/test")
+ val deepLink = Uri.parse("android-app://androidx.navigation.test/test/arg2")
navController.navigate(
deepLink,
@@ -455,7 +456,7 @@
popUpTo("nav_root") { inclusive = true }
}
)
- assertThat(navController.currentDestination?.route).isEqualTo("second_test")
+ assertThat(navController.currentDestination?.route).isEqualTo("second_test/{arg2}")
assertThat(navigator.backStack.size).isEqualTo(1)
}
@@ -570,7 +571,8 @@
val navigator =
navController.navigatorProvider.getNavigator(TestNavigator::class.java)
- assertThat(navController.currentDestination?.route).isEqualTo("second_test")
+ assertThat(navController.currentDestination?.route)
+ .isEqualTo("second_test/{arg2}")
// Only the leaf destination should be on the stack.
assertThat(navigator.backStack.size).isEqualTo(1)
@@ -619,7 +621,7 @@
var navigator = SaveStateTestNavigator()
navController.navigatorProvider.addNavigator(navigator)
navController.graph = nav_simple_route_graph
- navController.navigate("second_test")
+ navController.navigate("second_test/arg2")
val savedState = navController.saveState()
navController = NavController(context)
@@ -632,7 +634,7 @@
// Explicitly setting a graph then restores the state
navController.graph = nav_simple_route_graph
- assertThat(navController.currentDestination?.route).isEqualTo("second_test")
+ assertThat(navController.currentDestination?.route).isEqualTo("second_test/{arg2}")
assertThat(navigator.backStack.size).isEqualTo(2)
// Save state should be called on the navigator exactly once
assertThat(navigator.saveStateCount).isEqualTo(1)
@@ -679,7 +681,7 @@
var navigator = TestNavigator()
navController.navigatorProvider.addNavigator(navigator)
navController.graph = nav_simple_route_graph
- navController.navigate("second_test")
+ navController.navigate("second_test/arg2")
val savedState = navController.saveState()
navController = NavController(context)
@@ -692,7 +694,7 @@
// Explicitly setting a graph then restores the state
navController.graph = nav_simple_route_graph
- assertThat(navController.currentDestination?.route).isEqualTo("second_test")
+ assertThat(navController.currentDestination?.route).isEqualTo("second_test/{arg2}")
assertThat(navigator.backStack.size).isEqualTo(2)
}
@@ -926,8 +928,8 @@
assertThat(navController.currentDestination?.route).isEqualTo("start_test")
assertThat(navigator.backStack.size).isEqualTo(1)
- navController.navigate("second_test")
- assertThat(navController.currentDestination?.route).isEqualTo("second_test")
+ navController.navigate("second_test/arg2")
+ assertThat(navController.currentDestination?.route).isEqualTo("second_test/{arg2}")
assertThat(navigator.backStack.size).isEqualTo(2)
val popped = navController.popBackStack()
@@ -947,15 +949,15 @@
assertThat(navController.currentDestination?.route).isEqualTo("start_test")
assertThat(navigator.backStack.size).isEqualTo(1)
- navController.navigate("second_test")
- assertThat(navController.currentDestination?.route).isEqualTo("second_test")
+ navController.navigate("second_test/arg2")
+ assertThat(navController.currentDestination?.route).isEqualTo("second_test/{arg2}")
assertThat(navigator.backStack.size).isEqualTo(2)
val popped = navController.popBackStack(UNKNOWN_DESTINATION_ID, false)
assertWithMessage("Popping to an invalid destination should return false")
.that(popped)
.isFalse()
- assertThat(navController.currentDestination?.route).isEqualTo("second_test")
+ assertThat(navController.currentDestination?.route).isEqualTo("second_test/{arg2}")
assertThat(navigator.backStack.size).isEqualTo(2)
}
@@ -968,10 +970,10 @@
assertThat(navController.currentDestination?.route).isEqualTo("start_test")
assertThat(navigator.backStack.size).isEqualTo(1)
- navController.navigate("second_test") {
+ navController.navigate("second_test/arg2") {
popUpTo("start_test") { inclusive = true }
}
- assertThat(navController.currentDestination?.route).isEqualTo("second_test")
+ assertThat(navController.currentDestination?.route).isEqualTo("second_test/{arg2}")
assertThat(navigator.backStack.size).isEqualTo(1)
}
@@ -984,10 +986,10 @@
assertThat(navController.currentDestination?.route).isEqualTo("start_test")
assertThat(navigator.backStack.size).isEqualTo(1)
- navController.navigate("second_test") {
+ navController.navigate("second_test/arg2") {
popUpTo("nav_root") { inclusive = true }
}
- assertThat(navController.currentDestination?.route).isEqualTo("second_test")
+ assertThat(navController.currentDestination?.route).isEqualTo("second_test/{arg2}")
assertThat(navigator.backStack.size).isEqualTo(1)
}
@@ -1000,8 +1002,8 @@
assertThat(navController.currentDestination?.route).isEqualTo("start_test")
assertThat(navigator.backStack.size).isEqualTo(1)
- navController.navigate("second_test")
- assertThat(navController.currentDestination?.route).isEqualTo("second_test")
+ navController.navigate("second_test/arg2")
+ assertThat(navController.currentDestination?.route).isEqualTo("second_test/{arg2}")
assertThat(navigator.backStack.size).isEqualTo(2)
// This should function identically to popBackStack()
@@ -1021,8 +1023,8 @@
assertThat(navController.currentDestination?.route).isEqualTo("start_test")
assertThat(navigator.backStack.size).isEqualTo(1)
- navController.navigate("second_test")
- assertThat(navController.currentDestination?.route).isEqualTo("second_test")
+ navController.navigate("second_test/arg2")
+ assertThat(navController.currentDestination?.route).isEqualTo("second_test/{arg2}")
assertThat(navigator.backStack.size).isEqualTo(2)
navController.navigate("start_test_with_default_arg")
@@ -1033,7 +1035,7 @@
val success = navController.navigateUp()
assertThat(success).isTrue()
val destination = navController.currentDestination
- assertThat(destination?.route).isEqualTo("second_test")
+ assertThat(destination?.route).isEqualTo("second_test/{arg2}")
assertThat(navigator.backStack.size).isEqualTo(2)
assertThat(destination?.arguments?.get("defaultArg")?.defaultValue.toString())
.isEqualTo("defaultValue")
@@ -1046,7 +1048,8 @@
navController.graph = nav_simple_route_graph
val taskStackBuilder = navController.createDeepLink()
- .setDestination("second_test")
+ .setDestination("second_test/{arg2}")
+ .setArguments(bundleOf("arg2" to "value"))
.createTaskStackBuilder()
assertThat(taskStackBuilder).isNotNull()
assertThat(taskStackBuilder.intentCount).isEqualTo(1)
@@ -1058,10 +1061,12 @@
val navController = createNavController()
navController.graph = nav_simple_route_graph
- val args = Bundle()
- args.putString("test", "test")
+ val args = bundleOf(
+ "test" to "test",
+ "arg2" to "value",
+ )
val taskStackBuilder = navController.createDeepLink()
- .setDestination("second_test")
+ .setDestination("second_test/{arg2}")
.setArguments(args)
.createTaskStackBuilder()
@@ -1081,7 +1086,8 @@
navController.graph = nav_simple_route_graph
val taskStackBuilder = navController.createDeepLink()
- .setDestination("second_test")
+ .setDestination("second_test/{arg2}")
+ .setArguments(bundleOf("arg2" to "value"))
.createTaskStackBuilder()
val intent = taskStackBuilder.editIntentAt(0)
@@ -1093,7 +1099,7 @@
intent!!.writeToParcel(p, 0)
val destination = navController.currentDestination
- assertThat(destination?.route).isEqualTo("second_test")
+ assertThat(destination?.route).isEqualTo("second_test/{arg2}")
assertThat(destination?.arguments?.get("defaultArg")?.defaultValue.toString())
.isEqualTo("defaultValue")
}
@@ -1109,7 +1115,8 @@
}
val taskStackBuilder = navController.createDeepLink()
- .setDestination("second_test")
+ .setDestination("second_test/{arg2}")
+ .setArguments(bundleOf("arg2" to "value"))
.createTaskStackBuilder()
val intent = taskStackBuilder.editIntentAt(0)
@@ -1119,7 +1126,7 @@
.isTrue()
// Verify that we navigated down to the deep link
assertThat(collectedDestinationIds)
- .containsExactly("start_test", "start_test", "second_test")
+ .containsExactly("start_test", "start_test", "second_test/{arg2}")
.inOrder()
}
@@ -1311,7 +1318,7 @@
navController.setOnBackPressedDispatcher(dispatcher)
navController.graph = nav_simple_route_graph
- navController.navigate("second_test")
+ navController.navigate("second_test/arg2")
assertThat(navController.previousBackStackEntry?.destination?.route)
.isEqualTo("start_test")
@@ -1329,6 +1336,27 @@
assertThat(backPressedIntercepted).isTrue()
}
+ @UiThreadTest
+ @Test
+ fun testSetGraph13Entries() {
+ val navController = createNavController()
+ val lifecycleOwner = TestLifecycleOwner()
+ val dispatcher = OnBackPressedDispatcher()
+
+ navController.setLifecycleOwner(lifecycleOwner)
+ navController.setOnBackPressedDispatcher(dispatcher)
+
+ val navRepeatedGraph =
+ createNavController().createGraph(route = "nav_root", startDestination = "0") {
+ repeat(13) { index ->
+ test("$index")
+ }
+ }
+
+ navController.graph = navRepeatedGraph
+ navController.graph = navRepeatedGraph
+ }
+
private fun createNavController(): NavController {
val navController = NavController(ApplicationProvider.getApplicationContext())
val navigator = TestNavigator()
diff --git a/navigation/navigation-runtime/src/androidTest/java/androidx/navigation/NavControllerTest.kt b/navigation/navigation-runtime/src/androidTest/java/androidx/navigation/NavControllerTest.kt
index 737c656..c24cf4c 100644
--- a/navigation/navigation-runtime/src/androidTest/java/androidx/navigation/NavControllerTest.kt
+++ b/navigation/navigation-runtime/src/androidTest/java/androidx/navigation/NavControllerTest.kt
@@ -396,7 +396,7 @@
val navController = createNavController()
navController.setGraph(R.navigation.nav_simple)
val navigator = navController.navigatorProvider.getNavigator(TestNavigator::class.java)
- val deepLink = Uri.parse("android-app://androidx.navigation.test/test")
+ val deepLink = Uri.parse("android-app://androidx.navigation.test/test/arg2")
navController.navigate(deepLink)
assertThat(navController.currentDestination?.id ?: 0).isEqualTo(R.id.second_test)
@@ -413,7 +413,7 @@
val navController = createNavController()
navController.setGraph(R.navigation.nav_simple)
val navigator = navController.navigatorProvider.getNavigator(TestNavigator::class.java)
- val deepLink = Uri.parse("android-app://androidx.navigation.test/test")
+ val deepLink = Uri.parse("android-app://androidx.navigation.test/test/arg2")
navController.navigate(deepLink)
@@ -549,7 +549,7 @@
val navController = createNavController()
navController.setGraph(R.navigation.nav_simple)
val navigator = navController.navigatorProvider.getNavigator(TestNavigator::class.java)
- val deepLink = Uri.parse("android-app://androidx.navigation.test/test")
+ val deepLink = Uri.parse("android-app://androidx.navigation.test/test/arg2")
navController.navigate(
deepLink,
diff --git a/navigation/navigation-runtime/src/androidTest/java/androidx/navigation/NavDeepLinkBuilderTest.kt b/navigation/navigation-runtime/src/androidTest/java/androidx/navigation/NavDeepLinkBuilderTest.kt
index 2dcd971..b53c19f 100644
--- a/navigation/navigation-runtime/src/androidTest/java/androidx/navigation/NavDeepLinkBuilderTest.kt
+++ b/navigation/navigation-runtime/src/androidTest/java/androidx/navigation/NavDeepLinkBuilderTest.kt
@@ -50,7 +50,7 @@
defaultValue = "defaultValue"
}
deepLink {
- uriPattern = "android-app://androidx.navigation.test/test"
+ uriPattern = "android-app://androidx.navigation.test/test/{arg2}"
action = "test.action"
mimeType = "type/test"
}
diff --git a/navigation/navigation-runtime/src/androidTest/java/androidx/navigation/NavInflaterTest.kt b/navigation/navigation-runtime/src/androidTest/java/androidx/navigation/NavInflaterTest.kt
index ae4d0f9..bda9a3a 100644
--- a/navigation/navigation-runtime/src/androidTest/java/androidx/navigation/NavInflaterTest.kt
+++ b/navigation/navigation-runtime/src/androidTest/java/androidx/navigation/NavInflaterTest.kt
@@ -86,7 +86,7 @@
assertThat(graph).isNotNull()
val expectedUri = Uri.parse(
"android-app://" +
- instrumentation.targetContext.packageName + "/test"
+ instrumentation.targetContext.packageName + "/test/arg2"
)
val expectedDeepLinkRequest = NavDeepLinkRequest.Builder.fromUri(expectedUri).build()
val result = graph.matchDeepLink(expectedDeepLinkRequest)
diff --git a/navigation/navigation-runtime/src/androidTest/res/navigation/nav_simple.xml b/navigation/navigation-runtime/src/androidTest/res/navigation/nav_simple.xml
index aff0067..951239d 100644
--- a/navigation/navigation-runtime/src/androidTest/res/navigation/nav_simple.xml
+++ b/navigation/navigation-runtime/src/androidTest/res/navigation/nav_simple.xml
@@ -38,7 +38,7 @@
<action android:id="@+id/finish" app:popUpTo="@id/start_test" />
<action android:id="@+id/finish_self" app:popUpTo="@id/second_test"
app:popUpToInclusive="true" />
- <deepLink app:uri="android-app://androidx.navigation.test/test"
+ <deepLink app:uri="android-app://androidx.navigation.test/test/{arg2}"
app:action="test.action" app:mimeType="type/test"/>
<deepLink app:uri="android-app://androidx.navigation.test/test/{arg1}/{arg2}"
app:action="" />
diff --git a/navigation/navigation-runtime/src/main/java/androidx/navigation/NavController.kt b/navigation/navigation-runtime/src/main/java/androidx/navigation/NavController.kt
index d0b75d8..bef31737 100644
--- a/navigation/navigation-runtime/src/main/java/androidx/navigation/NavController.kt
+++ b/navigation/navigation-runtime/src/main/java/androidx/navigation/NavController.kt
@@ -55,7 +55,7 @@
*
* Navigation flows and destinations are determined by the
* [navigation graph][NavGraph] owned by the controller. These graphs are typically
- * [inflated][getNavInflater] from an Android resource, but, like views, they can also
+ * [inflated][navInflater] from an Android resource, but, like views, they can also
* be constructed or combined programmatically or for the case of dynamic navigation structure.
* (For example, if the navigation structure of the application is determined by live data obtained'
* from a remote server.)
@@ -944,7 +944,7 @@
_graph = graph
onGraphCreated(startDestinationArgs)
} else {
- for (i in 0..graph.nodes.size()) {
+ for (i in 0 until graph.nodes.size()) {
val newDestination = graph.nodes.valueAt(i)
_graph!!.nodes.replace(i, newDestination)
backQueue.filter { currentEntry ->
diff --git a/navigation/navigation-safe-args-generator/src/main/kotlin/androidx/navigation/safe/args/generator/java/JavaNavWriter.kt b/navigation/navigation-safe-args-generator/src/main/kotlin/androidx/navigation/safe/args/generator/java/JavaNavWriter.kt
index 95b5031..4ec2cfb 100644
--- a/navigation/navigation-safe-args-generator/src/main/kotlin/androidx/navigation/safe/args/generator/java/JavaNavWriter.kt
+++ b/navigation/navigation-safe-args-generator/src/main/kotlin/androidx/navigation/safe/args/generator/java/JavaNavWriter.kt
@@ -250,7 +250,11 @@
val copyConstructor = MethodSpec.constructorBuilder()
.addAnnotation(specs.suppressAnnotationSpec)
.addModifiers(Modifier.PUBLIC)
- .addParameter(className, "original")
+ .addParameter(
+ ParameterSpec.builder(className, "original")
+ .addAnnotation(specs.androidAnnotations.NONNULL_CLASSNAME)
+ .build()
+ )
.addCode(specs.copyMapContents("this", "original"))
.build()
@@ -281,13 +285,13 @@
val builderClassName = ClassName.get("", "Builder")
val builderTypeSpec = TypeSpec.classBuilder("Builder")
- .addModifiers(Modifier.PUBLIC, Modifier.STATIC)
+ .addModifiers(Modifier.PUBLIC, Modifier.STATIC, Modifier.FINAL)
.addField(specs.hashMapFieldSpec)
.addMethod(copyConstructor)
.addMethod(specs.constructor())
.addMethod(buildMethod)
.addMethods(specs.setters(builderClassName))
- .addMethods(specs.getters())
+ .addMethods(specs.getters(true))
.build()
val typeSpec = TypeSpec.classBuilder(className)
@@ -482,10 +486,18 @@
hashMapFieldSpec.name
).build()
- fun getters() = args.map { arg ->
+ fun getters(isBuilder: Boolean = false) = args.map { arg ->
MethodSpec.methodBuilder(getterFromArgName(arg.sanitizedName)).apply {
addModifiers(Modifier.PUBLIC)
- addAnnotation(suppressAnnotationSpec)
+ if (!isBuilder) {
+ addAnnotation(suppressAnnotationSpec)
+ } else {
+ addAnnotation(
+ AnnotationSpec.builder(SuppressWarnings::class.java)
+ .addMember("value", "{$S,$S}", "unchecked", "GetterOnBuilder")
+ .build()
+ )
+ }
if (arg.type.allowsNullable()) {
if (arg.isNullable) {
addAnnotation(androidAnnotations.NULLABLE_CLASSNAME)
diff --git a/navigation/navigation-safe-args-generator/src/main/kotlin/androidx/navigation/safe/args/generator/kotlin/KotlinNavWriter.kt b/navigation/navigation-safe-args-generator/src/main/kotlin/androidx/navigation/safe/args/generator/kotlin/KotlinNavWriter.kt
index b811e53..46cd09b 100644
--- a/navigation/navigation-safe-args-generator/src/main/kotlin/androidx/navigation/safe/args/generator/kotlin/KotlinNavWriter.kt
+++ b/navigation/navigation-safe-args-generator/src/main/kotlin/androidx/navigation/safe/args/generator/kotlin/KotlinNavWriter.kt
@@ -58,7 +58,7 @@
defaultValue(it.write())
}
}.build()
- }
+ }.sortedBy { it.defaultValue != null }
FunSpec.builder(action.id.javaIdentifier.toCamelCaseAsVar()).apply {
returns(NAV_DIRECTION_CLASSNAME)
addParameters(parameters)
@@ -163,7 +163,7 @@
defaultValue(it.write())
}
}.build()
- }
+ }.sortedBy { it.defaultValue != null }
)
.build()
diff --git a/navigation/navigation-safe-args-generator/src/test/kotlin/androidx/navigation/safe/args/generator/KotlinNavWriterTest.kt b/navigation/navigation-safe-args-generator/src/test/kotlin/androidx/navigation/safe/args/generator/KotlinNavWriterTest.kt
index 0bf214c..d643978 100644
--- a/navigation/navigation-safe-args-generator/src/test/kotlin/androidx/navigation/safe/args/generator/KotlinNavWriterTest.kt
+++ b/navigation/navigation-safe-args-generator/src/test/kotlin/androidx/navigation/safe/args/generator/KotlinNavWriterTest.kt
@@ -113,6 +113,29 @@
}
@Test
+ fun testDirectionsClassGenerationDefaultParamOrder() {
+ val nextAction = Action(
+ id("next"), id("destA"),
+ listOf(
+ Argument("optional", StringType, StringValue("bla")),
+ Argument("optionalFloat", FloatType, FloatValue("0.1")),
+ Argument("main", StringType),
+ Argument("optionalInt", IntType, IntValue("1"))
+ )
+ )
+
+ val prevAction = Action(id("previous"), id("destB"), emptyList())
+
+ val dest = Destination(
+ null, ClassName.get("a.b", "MainFragmentDefaultParam"), "fragment", listOf(),
+ listOf(prevAction, nextAction)
+ )
+
+ val actual = generateDirectionsCodeFile(dest, emptyList(), false)
+ assertThat(actual.toString()).parsesAs("a.b.MainFragmentDefaultParamDirections")
+ }
+
+ @Test
fun testDirectionsClassGeneration_withKeywordId() {
val funAction = Action(
ResReference("fun.is.in", "id", "next"), id("destA"),
diff --git a/navigation/navigation-safe-args-generator/src/test/test-data/expected/java_nav_writer_test/MainFragment$InnerFragmentArgs.java b/navigation/navigation-safe-args-generator/src/test/test-data/expected/java_nav_writer_test/MainFragment$InnerFragmentArgs.java
index 8344e2f..0ccab40 100644
--- a/navigation/navigation-safe-args-generator/src/test/test-data/expected/java_nav_writer_test/MainFragment$InnerFragmentArgs.java
+++ b/navigation/navigation-safe-args-generator/src/test/test-data/expected/java_nav_writer_test/MainFragment$InnerFragmentArgs.java
@@ -1,19 +1,3 @@
-/*
- * Copyright 2018 The Android Open Source Project
- *
- * 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.
- */
-
package a.b;
import android.os.Bundle;
@@ -134,11 +118,11 @@
+ "}";
}
- public static class Builder {
+ public static final class Builder {
private final HashMap arguments = new HashMap();
@SuppressWarnings("unchecked")
- public Builder(MainFragment$InnerFragmentArgs original) {
+ public Builder(@NonNull MainFragment$InnerFragmentArgs original) {
this.arguments.putAll(original.arguments);
}
@@ -166,7 +150,7 @@
return this;
}
- @SuppressWarnings("unchecked")
+ @SuppressWarnings({"unchecked","GetterOnBuilder"})
@NonNull
public String getMainArg() {
return (String) arguments.get("mainArg");
diff --git a/navigation/navigation-safe-args-generator/src/test/test-data/expected/java_nav_writer_test/MainFragmentArgs.java b/navigation/navigation-safe-args-generator/src/test/test-data/expected/java_nav_writer_test/MainFragmentArgs.java
index e447edd..246b480 100644
--- a/navigation/navigation-safe-args-generator/src/test/test-data/expected/java_nav_writer_test/MainFragmentArgs.java
+++ b/navigation/navigation-safe-args-generator/src/test/test-data/expected/java_nav_writer_test/MainFragmentArgs.java
@@ -526,11 +526,11 @@
+ "}";
}
- public static class Builder {
+ public static final class Builder {
private final HashMap arguments = new HashMap();
@SuppressWarnings("unchecked")
- public Builder(MainFragmentArgs original) {
+ public Builder(@NonNull MainFragmentArgs original) {
this.arguments.putAll(original.arguments);
}
@@ -639,59 +639,59 @@
return this;
}
- @SuppressWarnings("unchecked")
+ @SuppressWarnings({"unchecked","GetterOnBuilder"})
@NonNull
public String getMain() {
return (String) arguments.get("main");
}
- @SuppressWarnings("unchecked")
+ @SuppressWarnings({"unchecked","GetterOnBuilder"})
public int getOptional() {
return (int) arguments.get("optional");
}
- @SuppressWarnings("unchecked")
+ @SuppressWarnings({"unchecked","GetterOnBuilder"})
public int getReference() {
return (int) arguments.get("reference");
}
- @SuppressWarnings("unchecked")
+ @SuppressWarnings({"unchecked","GetterOnBuilder"})
public int getReferenceZeroDefaultValue() {
return (int) arguments.get("referenceZeroDefaultValue");
}
- @SuppressWarnings("unchecked")
+ @SuppressWarnings({"unchecked","GetterOnBuilder"})
public float getFloatArg() {
return (float) arguments.get("floatArg");
}
- @SuppressWarnings("unchecked")
+ @SuppressWarnings({"unchecked","GetterOnBuilder"})
@NonNull
public float[] getFloatArrayArg() {
return (float[]) arguments.get("floatArrayArg");
}
- @SuppressWarnings("unchecked")
+ @SuppressWarnings({"unchecked","GetterOnBuilder"})
@NonNull
public ActivityInfo[] getObjectArrayArg() {
return (ActivityInfo[]) arguments.get("objectArrayArg");
}
- @SuppressWarnings("unchecked")
+ @SuppressWarnings({"unchecked","GetterOnBuilder"})
public boolean getBoolArg() {
return (boolean) arguments.get("boolArg");
}
- @SuppressWarnings("unchecked")
+ @SuppressWarnings({"unchecked","GetterOnBuilder"})
@Nullable
public ActivityInfo getOptionalParcelable() {
return (ActivityInfo) arguments.get("optionalParcelable");
}
- @SuppressWarnings("unchecked")
+ @SuppressWarnings({"unchecked","GetterOnBuilder"})
@NonNull
public AccessMode getEnumArg() {
return (AccessMode) arguments.get("enumArg");
}
}
-}
+}
\ No newline at end of file
diff --git a/navigation/navigation-safe-args-generator/src/test/test-data/expected/java_nav_writer_test/SanitizedMainFragmentArgs.java b/navigation/navigation-safe-args-generator/src/test/test-data/expected/java_nav_writer_test/SanitizedMainFragmentArgs.java
index 710408c..b5254f3 100644
--- a/navigation/navigation-safe-args-generator/src/test/test-data/expected/java_nav_writer_test/SanitizedMainFragmentArgs.java
+++ b/navigation/navigation-safe-args-generator/src/test/test-data/expected/java_nav_writer_test/SanitizedMainFragmentArgs.java
@@ -1,19 +1,3 @@
-/*
- * Copyright 2018 The Android Open Source Project
- *
- * 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.
- */
-
package a.b;
import android.os.Bundle;
@@ -197,11 +181,11 @@
+ "}";
}
- public static class Builder {
+ public static final class Builder {
private final HashMap arguments = new HashMap();
@SuppressWarnings("unchecked")
- public Builder(SanitizedMainFragmentArgs original) {
+ public Builder(@NonNull SanitizedMainFragmentArgs original) {
this.arguments.putAll(original.arguments);
}
@@ -239,17 +223,17 @@
return this;
}
- @SuppressWarnings("unchecked")
+ @SuppressWarnings({"unchecked","GetterOnBuilder"})
public int getNameWithDot() {
return (int) arguments.get("name.with.dot");
}
- @SuppressWarnings("unchecked")
+ @SuppressWarnings({"unchecked","GetterOnBuilder"})
public int getNameWithUnderscore() {
return (int) arguments.get("name_with_underscore");
}
- @SuppressWarnings("unchecked")
+ @SuppressWarnings({"unchecked","GetterOnBuilder"})
public int getNameWithSpaces() {
return (int) arguments.get("name with spaces");
}
diff --git a/navigation/navigation-safe-args-generator/src/test/test-data/expected/kotlin_nav_writer_test/MainFragmentDefaultParamDirections.kt b/navigation/navigation-safe-args-generator/src/test/test-data/expected/kotlin_nav_writer_test/MainFragmentDefaultParamDirections.kt
new file mode 100644
index 0000000..93138da
--- /dev/null
+++ b/navigation/navigation-safe-args-generator/src/test/test-data/expected/kotlin_nav_writer_test/MainFragmentDefaultParamDirections.kt
@@ -0,0 +1,40 @@
+package a.b
+
+import android.os.Bundle
+import androidx.navigation.ActionOnlyNavDirections
+import androidx.navigation.NavDirections
+import kotlin.Float
+import kotlin.Int
+import kotlin.String
+
+public class MainFragmentDefaultParamDirections private constructor() {
+ private data class Next(
+ public val main: String,
+ public val optional: String = "bla",
+ public val optionalFloat: Float = 0.1F,
+ public val optionalInt: Int = 1
+ ) : NavDirections {
+ public override val actionId: Int = R.id.next
+
+ public override val arguments: Bundle
+ get() {
+ val result = Bundle()
+ result.putString("optional", this.optional)
+ result.putFloat("optionalFloat", this.optionalFloat)
+ result.putString("main", this.main)
+ result.putInt("optionalInt", this.optionalInt)
+ return result
+ }
+ }
+
+ public companion object {
+ public fun previous(): NavDirections = ActionOnlyNavDirections(R.id.previous)
+
+ public fun next(
+ main: String,
+ optional: String = "bla",
+ optionalFloat: Float = 0.1F,
+ optionalInt: Int = 1
+ ): NavDirections = Next(main, optional, optionalFloat, optionalInt)
+ }
+}
diff --git a/navigation/navigation-safe-args-generator/src/test/test-data/expected/kotlin_nav_writer_test/Next.kt b/navigation/navigation-safe-args-generator/src/test/test-data/expected/kotlin_nav_writer_test/Next.kt
index 10a9e3c..1dd5230 100644
--- a/navigation/navigation-safe-args-generator/src/test/test-data/expected/kotlin_nav_writer_test/Next.kt
+++ b/navigation/navigation-safe-args-generator/src/test/test-data/expected/kotlin_nav_writer_test/Next.kt
@@ -13,11 +13,11 @@
private data class Next(
public val main: String,
public val mainInt: Int,
+ public val parcelable: ActivityInfo,
+ public val innerData: ActivityInfo.WindowLayout,
public val optional: String = "bla",
public val optionalInt: Int = 239,
- public val optionalParcelable: ActivityInfo? = null,
- public val parcelable: ActivityInfo,
- public val innerData: ActivityInfo.WindowLayout
+ public val optionalParcelable: ActivityInfo? = null
) : NavDirections {
public override val actionId: Int = R.id.next
diff --git a/paging/buildSrc b/paging/buildSrc
new file mode 120000
index 0000000..053a423
--- /dev/null
+++ b/paging/buildSrc
@@ -0,0 +1 @@
+../buildSrc
\ No newline at end of file
diff --git a/paging/paging-compose/integration-tests/paging-demos/build.gradle b/paging/paging-compose/integration-tests/paging-demos/build.gradle
index 8786d85..4d9005b5 100644
--- a/paging/paging-compose/integration-tests/paging-demos/build.gradle
+++ b/paging/paging-compose/integration-tests/paging-demos/build.gradle
@@ -34,11 +34,9 @@
implementation(projectOrArtifact(":paging:paging-compose"))
implementation(projectOrArtifact(":paging:paging-compose:paging-compose-samples"))
- def room_version = "2.4.0-alpha04"
- api("androidx.room:room-runtime:$room_version")
- kapt("androidx.room:room-compiler:$room_version")
- implementation("androidx.room:room-ktx:$room_version")
- implementation("androidx.room:room-paging:$room_version")
+ kapt(projectOrArtifact(":room:room-compiler"))
+ implementation(projectOrArtifact(":room:room-ktx"))
+ implementation(projectOrArtifact(":room:room-paging"))
}
androidx {
diff --git a/playground-common/gradle/wrapper/gradle-wrapper.properties b/playground-common/gradle/wrapper/gradle-wrapper.properties
index 81350b5..a0f7639 100644
--- a/playground-common/gradle/wrapper/gradle-wrapper.properties
+++ b/playground-common/gradle/wrapper/gradle-wrapper.properties
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-rc-2-all.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
diff --git a/playground-common/out.gradle b/playground-common/out.gradle
deleted file mode 100644
index 6ef6d52..0000000
--- a/playground-common/out.gradle
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Copyright (C) 2020 The Android Open Source Project
- *
- * 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 init = new Properties()
-ext.init = init
-
-def chooseOutDir(subdir = "") {
- def outDir = new File("${buildscript.getSourceFile().parent}/../out${subdir}")
- project.ext.outDir = outDir
- buildDir = new File(outDir, "$project.name/build").getCanonicalFile()
- subprojects {
- // Change buildDir first so that all plugins pick up the new value.
- project.buildDir = new File("$project.parent.buildDir/../$project.name/build")
- }
-}
-
-ext.init.chooseOutDir = this.&chooseOutDir
diff --git a/playground-common/playground-build.gradle b/playground-common/playground-build.gradle
index 9e82386..f7e03b9 100644
--- a/playground-common/playground-build.gradle
+++ b/playground-common/playground-build.gradle
@@ -60,14 +60,13 @@
classpath(libs.kotlinGradlePluginz)
classpath(libs.kspGradlePluginz)
classpath(libs.gson)
- classpath "androidx.build:gradle-plugin:0.1.0"
classpath(libs.shadow)
classpath(libs.japicmpPluginz)
}
}
apply from: "$supportRootFolder/buildSrc/dependencies.gradle"
-apply from: "$supportRootFolder/playground-common/out.gradle"
+apply from: "$supportRootFolder/buildSrc/out.gradle"
init.chooseOutDir("/${rootProject.name}")
apply plugin: AndroidXRootPlugin
diff --git a/playground-common/playground-include-settings.gradle b/playground-common/playground-include-settings.gradle
index 524d2fc..5948bd4 100644
--- a/playground-common/playground-include-settings.gradle
+++ b/playground-common/playground-include-settings.gradle
@@ -56,14 +56,6 @@
}
settings.ext.supportRootDir = supportRoot
settings.rootProject.buildFileName = relativePathToBuild
- settings.pluginManagement {
- repositories {
- google()
- mavenCentral()
- jcenter()
- gradlePluginPortal()
- }
- }
settings.enableFeaturePreview("VERSION_CATALOGS")
settings.dependencyResolutionManagement {
versionCatalogs {
@@ -72,7 +64,6 @@
}
}
}
- settings.includeBuild(new File(supportRoot, "androidx-plugin"))
settings.includeProject(":lint-checks", new File(supportRoot, "lint-checks"))
settings.includeProject(":lint-checks:integration-tests",
new File(supportRoot, "lint-checks/integration-tests"))
@@ -117,7 +108,7 @@
if (name == ":compose:lint:internal-lint-checks") return true
if (name == ":compose:test-utils") return true
if (name == ":compose:lint:common-test") return true
- if (name == ":test:screenshot:test-screenshot") return true
+ if (name == ":test:screenshot:screenshot") return true
return false
}
@@ -144,3 +135,9 @@
Current version: $jvmVersion
Current JAVA HOME: ${System.getProperty("java.home")}""".stripIndent());
}
+
+// allow public repositories
+System.setProperty("ALLOW_PUBLIC_REPOS", "true")
+
+// specify out dir location
+System.setProperty("CHECKOUT_ROOT", "${buildscript.sourceFile.parent}/..")
diff --git a/playground-common/playground.properties b/playground-common/playground.properties
index 5e47960..c200504 100644
--- a/playground-common/playground.properties
+++ b/playground-common/playground.properties
@@ -26,7 +26,7 @@
kotlin.code.style=official
# Disable docs
androidx.enableDocumentation=false
-androidx.playground.snapshotBuildId=7599279
+androidx.playground.snapshotBuildId=7649979
androidx.playground.metalavaBuildId=7610917
androidx.playground.dokkaBuildId=7472101
androidx.studio.type=playground
diff --git a/playground-common/setup-playground.sh b/playground-common/setup-playground.sh
index e7430953..73849fa 100755
--- a/playground-common/setup-playground.sh
+++ b/playground-common/setup-playground.sh
@@ -19,6 +19,8 @@
ln -s "${PLAYGROUND_REL_PATH}/gradlew.bat" gradlew.bat
rm -rf gradle.properties
ln -s "${PLAYGROUND_REL_PATH}/androidx-shared.properties" gradle.properties
+rm -rf buildSrc
+ln -s "${PLAYGROUND_REL_PATH}/../buildSrc" buildSrc
ANDROIDX_IDEA_DIR="${PLAYGROUND_REL_PATH}/../.idea"
@@ -45,4 +47,4 @@
ln -s $REL_PATH $IDEA_CONFIG_FILE
# forse add the file to git
git add -f $IDEA_CONFIG_FILE
-done
\ No newline at end of file
+done
diff --git a/playground/.gitignore b/playground/.gitignore
deleted file mode 100644
index 603b140..0000000
--- a/playground/.gitignore
+++ /dev/null
@@ -1,14 +0,0 @@
-*.iml
-.gradle
-/local.properties
-/.idea/caches
-/.idea/libraries
-/.idea/modules.xml
-/.idea/workspace.xml
-/.idea/navEditor.xml
-/.idea/assetWizardSettings.xml
-.DS_Store
-/build
-/captures
-.externalNativeBuild
-.cxx
diff --git a/playground/.idea/codeStyles/Project.xml b/playground/.idea/codeStyles/Project.xml
deleted file mode 120000
index b52b28c..0000000
--- a/playground/.idea/codeStyles/Project.xml
+++ /dev/null
@@ -1 +0,0 @@
-../../../.idea/codeStyles/Project.xml
\ No newline at end of file
diff --git a/playground/.idea/codeStyles/codeStyleConfig.xml b/playground/.idea/codeStyles/codeStyleConfig.xml
deleted file mode 120000
index 19c4848..0000000
--- a/playground/.idea/codeStyles/codeStyleConfig.xml
+++ /dev/null
@@ -1 +0,0 @@
-../../../.idea/codeStyles/codeStyleConfig.xml
\ No newline at end of file
diff --git a/playground/.idea/copyright/AndroidCopyright.xml b/playground/.idea/copyright/AndroidCopyright.xml
deleted file mode 120000
index afbbd04..0000000
--- a/playground/.idea/copyright/AndroidCopyright.xml
+++ /dev/null
@@ -1 +0,0 @@
-../../../.idea/copyright/AndroidCopyright.xml
\ No newline at end of file
diff --git a/playground/.idea/copyright/profiles_settings.xml b/playground/.idea/copyright/profiles_settings.xml
deleted file mode 120000
index 5996ccd..0000000
--- a/playground/.idea/copyright/profiles_settings.xml
+++ /dev/null
@@ -1 +0,0 @@
-../../../.idea/copyright/profiles_settings.xml
\ No newline at end of file
diff --git a/playground/.idea/inspectionProfiles/Project_Default.xml b/playground/.idea/inspectionProfiles/Project_Default.xml
deleted file mode 120000
index a7481f4..0000000
--- a/playground/.idea/inspectionProfiles/Project_Default.xml
+++ /dev/null
@@ -1 +0,0 @@
-../../../.idea/inspectionProfiles/Project_Default.xml
\ No newline at end of file
diff --git a/playground/.idea/scopes/Ignore_API_Files.xml b/playground/.idea/scopes/Ignore_API_Files.xml
deleted file mode 120000
index 3361ee1..0000000
--- a/playground/.idea/scopes/Ignore_API_Files.xml
+++ /dev/null
@@ -1 +0,0 @@
-../../../.idea/scopes/Ignore_API_Files.xml
\ No newline at end of file
diff --git a/playground/.idea/scopes/buildSrc.xml b/playground/.idea/scopes/buildSrc.xml
deleted file mode 120000
index 25b7d3b..0000000
--- a/playground/.idea/scopes/buildSrc.xml
+++ /dev/null
@@ -1 +0,0 @@
-../../../.idea/scopes/buildSrc.xml
\ No newline at end of file
diff --git a/playground/OWNERS b/playground/OWNERS
deleted file mode 100644
index b967a70..0000000
--- a/playground/OWNERS
+++ /dev/null
@@ -1,3 +0,0 @@
-dustinlam@google.com
-rahulrav@google.com
-yboyar@google.com
diff --git a/playground/gradle b/playground/gradle
deleted file mode 120000
index 1c936b3..0000000
--- a/playground/gradle
+++ /dev/null
@@ -1 +0,0 @@
-../playground-common/gradle
\ No newline at end of file
diff --git a/playground/gradle.properties b/playground/gradle.properties
deleted file mode 120000
index d952fb0..0000000
--- a/playground/gradle.properties
+++ /dev/null
@@ -1 +0,0 @@
-../playground-common/androidx-shared.properties
\ No newline at end of file
diff --git a/playground/gradlew b/playground/gradlew
deleted file mode 120000
index 05b75179..0000000
--- a/playground/gradlew
+++ /dev/null
@@ -1 +0,0 @@
-../playground-common/gradlew
\ No newline at end of file
diff --git a/playground/gradlew.bat b/playground/gradlew.bat
deleted file mode 120000
index b20877e..0000000
--- a/playground/gradlew.bat
+++ /dev/null
@@ -1 +0,0 @@
-../playground-common/gradlew.bat
\ No newline at end of file
diff --git a/playground/settings.gradle b/playground/settings.gradle
deleted file mode 100644
index 8151e6a..0000000
--- a/playground/settings.gradle
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * Copyright 2020 The Android Open Source Project
- *
- * 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.
- */
-rootProject.name = "playground"
-apply from: "../playground-common/playground-include-settings.gradle"
-setupPlayground(this, "..")
-
-includeProject(":benchmark:benchmark-common", "../benchmark/common")
-includeProject(":lint-checks:tests", "../lint-checks/tests")
-includeProject(":mppsample:mppsample-library", "../mppsample/mppsample-library")
-includeProject(":mppsample:mppsample-executable", "../mppsample/mppsample-executable")
-includeProject(":tracing:tracing", "../tracing/tracing")
-includeProject(":tracing:tracing-ktx", "../tracing/tracing-ktx")
diff --git a/profileinstaller/integration-tests/init-macrobenchmark-target/src/main/AndroidManifest.xml b/profileinstaller/integration-tests/init-macrobenchmark-target/src/main/AndroidManifest.xml
index f2fbc15..7e904e6 100644
--- a/profileinstaller/integration-tests/init-macrobenchmark-target/src/main/AndroidManifest.xml
+++ b/profileinstaller/integration-tests/init-macrobenchmark-target/src/main/AndroidManifest.xml
@@ -25,7 +25,6 @@
tools:ignore="MissingApplicationIcon">
<!-- Profileable to enable macrobenchmark profiling -->
- <!--suppress AndroidElementNotAllowed -->
<profileable android:shell="true"/>
<!--
diff --git a/profileinstaller/profileinstaller-benchmark/src/androidTest/AndroidManifest.xml b/profileinstaller/profileinstaller-benchmark/src/androidTest/AndroidManifest.xml
index 249b21d..604941e 100644
--- a/profileinstaller/profileinstaller-benchmark/src/androidTest/AndroidManifest.xml
+++ b/profileinstaller/profileinstaller-benchmark/src/androidTest/AndroidManifest.xml
@@ -16,15 +16,9 @@
-->
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:tools="http://schemas.android.com/tools"
package="androidx.profileinstaller.benchmark">
-
- <!-- Important: disable debuggable for accurate performance results -->
- <application
- android:debuggable="false"
- tools:replace="android:debuggable">
- <!-- enable profileableByShell for non-intrusive profiling tools -->
- <!--suppress AndroidElementNotAllowed -->
+ <application>
+ <!-- enable profiling by shell for non-intrusive profiling tools -->
<profileable android:shell="true"/>
</application>
</manifest>
diff --git a/recyclerview/recyclerview-benchmark/src/androidTest/AndroidManifest.xml b/recyclerview/recyclerview-benchmark/src/androidTest/AndroidManifest.xml
index 8653650..d79a491 100644
--- a/recyclerview/recyclerview-benchmark/src/androidTest/AndroidManifest.xml
+++ b/recyclerview/recyclerview-benchmark/src/androidTest/AndroidManifest.xml
@@ -16,16 +16,11 @@
-->
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:tools="http://schemas.android.com/tools"
package="androidx.recyclerview.benchmark">
-
- <!-- Important: disable debuggable for accurate performance results -->
- <application
- android:debuggable="false"
- tools:replace="android:debuggable">
- <!-- enable profileableByShell for non-intrusive profiling tools -->
- <!--suppress AndroidElementNotAllowed -->
+ <application>
+ <!-- enable profiling by shell for non-intrusive profiling tools -->
<profileable android:shell="true"/>
+
<activity
android:name=".RecyclerViewActivity"
android:theme="@style/BenchmarkTheme"/>
diff --git a/recyclerview/recyclerview-lint/src/main/java/androidx/recyclerview/lint/RecyclerViewIssueRegistry.kt b/recyclerview/recyclerview-lint/src/main/java/androidx/recyclerview/lint/RecyclerViewIssueRegistry.kt
index 5290049..51a9d9d 100644
--- a/recyclerview/recyclerview-lint/src/main/java/androidx/recyclerview/lint/RecyclerViewIssueRegistry.kt
+++ b/recyclerview/recyclerview-lint/src/main/java/androidx/recyclerview/lint/RecyclerViewIssueRegistry.kt
@@ -24,7 +24,7 @@
class RecyclerViewIssueRegistry : IssueRegistry() {
override val minApi = CURRENT_API
- override val api = 10
+ override val api = 11
override val issues: List<Issue>
get() = listOf(
InvalidSetHasFixedSizeDetector.ISSUE
diff --git a/remotecallback/remotecallback/lint-baseline.xml b/remotecallback/remotecallback/lint-baseline.xml
index bbc44f4..7e104d2 100644
--- a/remotecallback/remotecallback/lint-baseline.xml
+++ b/remotecallback/remotecallback/lint-baseline.xml
@@ -1,5 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
-<issues format="6" by="lint 7.1.0-alpha02" type="baseline" client="cli" name="Lint" variant="all" version="7.1.0-alpha02">
+<issues format="6" by="lint 7.1.0-dev" type="baseline" client="gradle" dependencies="false" name="AGP (7.1.0-dev)" variant="all" version="7.1.0-dev">
+
+ <issue
+ id="WrongConstant"
+ message="Must be one of: RemoteCallback.TYPE_RECEIVER, RemoteCallback.TYPE_PROVIDER"
+ errorLine1=" public static final RemoteCallback LOCAL = new RemoteCallback(null, -1, null, null, null) {"
+ errorLine2=" ~~">
+ <location
+ file="src/main/java/androidx/remotecallback/RemoteCallback.java"
+ line="151"
+ column="73"/>
+ </issue>
<issue
id="LambdaLast"
@@ -19,7 +30,7 @@
errorLine2=" ~~~~~~~">
<location
file="src/main/java/androidx/remotecallback/AppWidgetProviderWithCallbacks.java"
- line="40"
+ line="41"
column="27"/>
</issue>
@@ -30,7 +41,7 @@
errorLine2=" ~~~~~~">
<location
file="src/main/java/androidx/remotecallback/AppWidgetProviderWithCallbacks.java"
- line="40"
+ line="41"
column="44"/>
</issue>
@@ -41,7 +52,7 @@
errorLine2=" ~~~~~~~">
<location
file="src/main/java/androidx/remotecallback/AppWidgetProviderWithCallbacks.java"
- line="49"
+ line="50"
column="35"/>
</issue>
@@ -52,7 +63,7 @@
errorLine2=" ~~~~~~~~~~~~~~">
<location
file="src/main/java/androidx/remotecallback/AppWidgetProviderWithCallbacks.java"
- line="58"
+ line="59"
column="12"/>
</issue>
@@ -63,7 +74,7 @@
errorLine2=" ~~~~~~~~">
<location
file="src/main/java/androidx/remotecallback/AppWidgetProviderWithCallbacks.java"
- line="58"
+ line="59"
column="44"/>
</issue>
@@ -74,7 +85,7 @@
errorLine2=" ~~~~~~~">
<location
file="src/main/java/androidx/remotecallback/AppWidgetProviderWithCallbacks.java"
- line="58"
+ line="59"
column="58"/>
</issue>
@@ -85,7 +96,7 @@
errorLine2=" ~~~~~~">
<location
file="src/main/java/androidx/remotecallback/AppWidgetProviderWithCallbacks.java"
- line="58"
+ line="59"
column="75"/>
</issue>
@@ -96,7 +107,7 @@
errorLine2=" ~~~~~~">
<location
file="src/main/java/androidx/remotecallback/AppWidgetProviderWithCallbacks.java"
- line="59"
+ line="60"
column="13"/>
</issue>
@@ -107,7 +118,7 @@
errorLine2=" ~~~~~~">
<location
file="src/main/java/androidx/remotecallback/AppWidgetProviderWithCallbacks.java"
- line="59"
+ line="60"
column="26"/>
</issue>
@@ -118,7 +129,7 @@
errorLine2=" ~~~~~~~">
<location
file="src/main/java/androidx/remotecallback/BroadcastReceiverWithCallbacks.java"
- line="48"
+ line="49"
column="27"/>
</issue>
@@ -129,7 +140,7 @@
errorLine2=" ~~~~~~">
<location
file="src/main/java/androidx/remotecallback/BroadcastReceiverWithCallbacks.java"
- line="48"
+ line="49"
column="44"/>
</issue>
@@ -140,7 +151,7 @@
errorLine2=" ~~~~~~~">
<location
file="src/main/java/androidx/remotecallback/BroadcastReceiverWithCallbacks.java"
- line="55"
+ line="56"
column="35"/>
</issue>
@@ -151,7 +162,7 @@
errorLine2=" ~~~~~~~~~~~~~~">
<location
file="src/main/java/androidx/remotecallback/BroadcastReceiverWithCallbacks.java"
- line="64"
+ line="65"
column="12"/>
</issue>
@@ -162,7 +173,7 @@
errorLine2=" ~~~~~~~~">
<location
file="src/main/java/androidx/remotecallback/BroadcastReceiverWithCallbacks.java"
- line="64"
+ line="65"
column="44"/>
</issue>
@@ -173,7 +184,7 @@
errorLine2=" ~~~~~~~">
<location
file="src/main/java/androidx/remotecallback/BroadcastReceiverWithCallbacks.java"
- line="64"
+ line="65"
column="58"/>
</issue>
@@ -184,7 +195,7 @@
errorLine2=" ~~~~~~">
<location
file="src/main/java/androidx/remotecallback/BroadcastReceiverWithCallbacks.java"
- line="64"
+ line="65"
column="75"/>
</issue>
@@ -195,7 +206,7 @@
errorLine2=" ~~~~~~">
<location
file="src/main/java/androidx/remotecallback/BroadcastReceiverWithCallbacks.java"
- line="65"
+ line="66"
column="13"/>
</issue>
@@ -206,7 +217,7 @@
errorLine2=" ~~~~~~">
<location
file="src/main/java/androidx/remotecallback/BroadcastReceiverWithCallbacks.java"
- line="65"
+ line="66"
column="26"/>
</issue>
@@ -481,7 +492,7 @@
errorLine2=" ~~~~~~~">
<location
file="src/main/java/androidx/remotecallback/ContentProviderWithCallbacks.java"
- line="47"
+ line="48"
column="28"/>
</issue>
@@ -492,7 +503,7 @@
errorLine2=" ~~~~~~~~~~~~">
<location
file="src/main/java/androidx/remotecallback/ContentProviderWithCallbacks.java"
- line="47"
+ line="48"
column="45"/>
</issue>
@@ -503,7 +514,7 @@
errorLine2=" ~~~~~~">
<location
file="src/main/java/androidx/remotecallback/ContentProviderWithCallbacks.java"
- line="53"
+ line="54"
column="12"/>
</issue>
@@ -514,7 +525,7 @@
errorLine2=" ~~~~~~">
<location
file="src/main/java/androidx/remotecallback/ContentProviderWithCallbacks.java"
- line="53"
+ line="54"
column="24"/>
</issue>
@@ -525,7 +536,7 @@
errorLine2=" ~~~~~~">
<location
file="src/main/java/androidx/remotecallback/ContentProviderWithCallbacks.java"
- line="53"
+ line="54"
column="39"/>
</issue>
@@ -536,7 +547,7 @@
errorLine2=" ~~~~~~">
<location
file="src/main/java/androidx/remotecallback/ContentProviderWithCallbacks.java"
- line="53"
+ line="54"
column="51"/>
</issue>
@@ -547,7 +558,7 @@
errorLine2=" ~~~~~~~">
<location
file="src/main/java/androidx/remotecallback/ContentProviderWithCallbacks.java"
- line="62"
+ line="63"
column="35"/>
</issue>
@@ -558,7 +569,7 @@
errorLine2=" ~~~~~~~~~~~~~~">
<location
file="src/main/java/androidx/remotecallback/ContentProviderWithCallbacks.java"
- line="71"
+ line="72"
column="12"/>
</issue>
@@ -569,7 +580,7 @@
errorLine2=" ~~~~~~~~">
<location
file="src/main/java/androidx/remotecallback/ContentProviderWithCallbacks.java"
- line="71"
+ line="72"
column="44"/>
</issue>
@@ -580,7 +591,7 @@
errorLine2=" ~~~~~~~">
<location
file="src/main/java/androidx/remotecallback/ContentProviderWithCallbacks.java"
- line="71"
+ line="72"
column="58"/>
</issue>
@@ -591,7 +602,7 @@
errorLine2=" ~~~~~~">
<location
file="src/main/java/androidx/remotecallback/ContentProviderWithCallbacks.java"
- line="71"
+ line="72"
column="75"/>
</issue>
@@ -602,7 +613,7 @@
errorLine2=" ~~~~~~">
<location
file="src/main/java/androidx/remotecallback/ContentProviderWithCallbacks.java"
- line="72"
+ line="73"
column="13"/>
</issue>
@@ -613,7 +624,7 @@
errorLine2=" ~~~~~~">
<location
file="src/main/java/androidx/remotecallback/ContentProviderWithCallbacks.java"
- line="72"
+ line="73"
column="26"/>
</issue>
diff --git a/resourceinspection/resourceinspection-processor/src/main/kotlin/androidx/resourceinspection/processor/InspectionCompanionGeneration.kt b/resourceinspection/resourceinspection-processor/src/main/kotlin/androidx/resourceinspection/processor/InspectionCompanionGeneration.kt
index 22ca3db..43c19d5 100644
--- a/resourceinspection/resourceinspection-processor/src/main/kotlin/androidx/resourceinspection/processor/InspectionCompanionGeneration.kt
+++ b/resourceinspection/resourceinspection-processor/src/main/kotlin/androidx/resourceinspection/processor/InspectionCompanionGeneration.kt
@@ -184,7 +184,7 @@
addStatement("final \$T flags = new \$T()", stringSet, stringHashSet)
attribute.intMapping.forEach { (name, value, mask) ->
- if (mask == 0) {
+ if (value == mask || mask == 0) {
beginControlFlow("if (value == \$L)", value)
} else {
beginControlFlow("if ((value & \$L) == \$L)", mask, value)
diff --git a/resourceinspection/resourceinspection-processor/src/main/kotlin/androidx/resourceinspection/processor/LayoutInspectionStep.kt b/resourceinspection/resourceinspection-processor/src/main/kotlin/androidx/resourceinspection/processor/LayoutInspectionStep.kt
index 5a2dfb8..8cfdaf5 100644
--- a/resourceinspection/resourceinspection-processor/src/main/kotlin/androidx/resourceinspection/processor/LayoutInspectionStep.kt
+++ b/resourceinspection/resourceinspection-processor/src/main/kotlin/androidx/resourceinspection/processor/LayoutInspectionStep.kt
@@ -55,7 +55,13 @@
override fun process(
elementsByAnnotation: ImmutableSetMultimap<String, Element>
): Set<Element> {
- // TODO(b/180039277): Validate that linked APIs (e.g. InspectionCompanion) are present
+ if (!isViewInspectorApiPresent()) {
+ printError(
+ "View inspector (android.view.inspector) API is not present. " +
+ "Please ensure compile SDK is 29 or greater."
+ )
+ return emptySet()
+ }
val views = mergeViews(
elementsByAnnotation[ATTRIBUTE]
@@ -71,6 +77,13 @@
return emptySet()
}
+ /** Checks if the view inspector API is present in the compile class path */
+ private fun isViewInspectorApiPresent(): Boolean {
+ return VIEW_INSPECTOR_CLASSES.all { className ->
+ processingEnv.elementUtils.getTypeElement(className) != null
+ }
+ }
+
/** Merge shadowed and regular attributes into [View] models. */
private fun mergeViews(
viewsWithGetters: Map<TypeElement, List<ExecutableElement>>,
@@ -127,20 +140,26 @@
val annotation = getter.getAnnotationMirror(ATTRIBUTE)!!
val annotationValue = getAnnotationValue(annotation, "value")
val value = annotationValue.value as String
+ var hasError = false
if (getter.parameters.isNotEmpty() || getter.returnType.kind == TypeKind.VOID) {
printError("@Attribute must annotate a getter", getter, annotation)
- return null
+ hasError = true
}
if (effectiveVisibilityOfElement(getter) != Visibility.PUBLIC) {
printError("@Attribute getter must be public", getter, annotation)
- return null
+ hasError = true
}
if (!getter.enclosingElement.asType().isAssignableTo(VIEW)) {
printError("@Attribute must be on a subclass of android.view.View", getter, annotation)
- return null
+ hasError = true
+ }
+
+ val intMapping = parseIntMapping(annotation)
+ if (!validateIntMapping(getter, intMapping)) {
+ hasError = true
}
val match = ATTRIBUTE_VALUE.matchEntire(value)
@@ -151,11 +170,14 @@
} else {
printError("Invalid attribute name", getter, annotation, annotationValue)
}
+ return null // Returning here since there's no more checks we can do
+ }
+
+ if (hasError) {
return null
}
val (namespace, name) = match.destructured
- val intMapping = parseIntMapping(annotation)
val type = inferAttributeType(getter, intMapping)
if (!isAttributeInRFile(namespace, name)) {
@@ -163,8 +185,6 @@
return null
}
- // TODO(b/180041633): Validate consistency of int mapping
-
return GetterAttribute(getter, annotation, namespace, name, type, intMapping)
}
@@ -177,10 +197,93 @@
name = getAnnotationValue(intMapAnnotation, "name").value as String,
value = getAnnotationValue(intMapAnnotation, "value").value as Int,
mask = getAnnotationValue(intMapAnnotation, "mask").value as Int,
+ annotation = intMapAnnotation
)
}.sortedBy { it.value }
}
+ /** Check that int mapping is valid and consistent */
+ private fun validateIntMapping(element: Element, intMapping: List<IntMap>): Boolean {
+ if (intMapping.isEmpty()) {
+ return true // Return early for the common case of no int mapping
+ }
+
+ var result = true
+ val isEnum = intMapping.all { it.mask == 0 }
+
+ // Check for duplicate names for both flags and enums
+ val duplicateNames = intMapping.groupBy { it.name }.values.filter { it.size > 1 }
+ duplicateNames.flatten().forEach { intMap ->
+ printError(
+ "Duplicate int ${if (isEnum) "enum" else "flag"} entry name: \"${intMap.name}\"",
+ element,
+ intMap.annotation,
+ intMap.annotation?.let { getAnnotationValue(it, "name") }
+ )
+ }
+ if (duplicateNames.isNotEmpty()) {
+ result = false
+ }
+
+ if (isEnum) {
+ // Check for duplicate enum values
+ val duplicateValues = intMapping.groupBy { it.value }.values.filter { it.size > 1 }
+ duplicateValues.forEach { group ->
+ group.forEach { intMap ->
+ val others = (group - intMap).joinToString { "\"${it.name}\"" }
+ printError(
+ "Int enum value ${intMap.value} is duplicated on entries $others",
+ element,
+ intMap.annotation,
+ intMap.annotation?.let { getAnnotationValue(it, "value") }
+ )
+ }
+ }
+ if (duplicateValues.isNotEmpty()) {
+ result = false
+ }
+ } else {
+ // Check for invalid flags, with masks that obscure part of the value. Note that a mask
+ // of 0 is a special case which implies that the mask is equal to the value as in enums.
+ intMapping.forEach { intMap ->
+ if (intMap.mask and intMap.value != intMap.value && intMap.mask != 0) {
+ printError(
+ "Int flag mask 0x${intMap.mask.toString(16)} does not reveal value " +
+ "0x${intMap.value.toString(16)}",
+ element,
+ intMap.annotation
+ )
+ result = false
+ }
+ }
+
+ // Check for duplicate flags
+ val duplicatePairs = intMapping
+ .groupBy { Pair(if (it.mask != 0) it.mask else it.value, it.value) }
+ .values
+ .filter { it.size > 1 }
+
+ duplicatePairs.forEach { group ->
+ group.forEach { intMap ->
+ val others = (group - intMap).joinToString { "\"${it.name}\"" }
+ val mask = if (intMap.mask != 0) intMap.mask else intMap.value
+ printError(
+ "Int flag mask 0x${mask.toString(16)} and value " +
+ "0x${intMap.value.toString(16)} is duplicated on entries $others",
+ element,
+ intMap.annotation
+ )
+ }
+ }
+
+ if (duplicatePairs.isNotEmpty()) {
+ result = false
+ }
+ }
+
+ return result
+ }
+
/** Map the getter's annotations and return type to the internal attribute type. */
private fun inferAttributeType(
getter: ExecutableElement,
@@ -277,7 +380,7 @@
/** Convenience wrapper for [javax.annotation.processing.Messager.printMessage]. */
private fun printError(
message: String,
- element: Element?,
+ element: Element? = null,
annotation: AnnotationMirror? = null,
value: AnnotationValue? = null
) {
@@ -317,7 +420,7 @@
const val APP_COMPAT_SHADOWED_ATTRIBUTES =
"androidx.resourceinspection.annotation.AppCompatShadowedAttributes"
- /** Fully qualified name of the platform's Color class */
+ /** Fully qualified name of the platform's `Color` class */
const val COLOR = "android.graphics.Color"
/** Fully qualified name of `ColorInt` */
@@ -332,6 +435,13 @@
/** Fully qualified name of the platform's View class */
const val VIEW = "android.view.View"
+ /** Fully qualified names of the view inspector classes introduced in API 29 */
+ val VIEW_INSPECTOR_CLASSES = listOf(
+ "android.view.inspector.InspectionCompanion",
+ "android.view.inspector.PropertyReader",
+ "android.view.inspector.PropertyMapper"
+ )
+
/**
* Map of compat interface names in `androidx.core` to the AppCompat attributes they
* shadow. These virtual attributes are added to the inspection companion for views within
diff --git a/resourceinspection/resourceinspection-processor/src/main/kotlin/androidx/resourceinspection/processor/Models.kt b/resourceinspection/resourceinspection-processor/src/main/kotlin/androidx/resourceinspection/processor/Models.kt
index 761d783..197a5a1 100644
--- a/resourceinspection/resourceinspection-processor/src/main/kotlin/androidx/resourceinspection/processor/Models.kt
+++ b/resourceinspection/resourceinspection-processor/src/main/kotlin/androidx/resourceinspection/processor/Models.kt
@@ -70,7 +70,8 @@
internal data class IntMap(
val name: String,
val value: Int,
- val mask: Int = 0
+ val mask: Int = 0,
+ val annotation: AnnotationMirror? = null
)
/** Represents the type of the attribute, determined from context and the annotation itself. */
diff --git a/resourceinspection/resourceinspection-processor/src/test/kotlin/androidx/resourceinspection/processor/ResourceInspectionProcessorTest.kt b/resourceinspection/resourceinspection-processor/src/test/kotlin/androidx/resourceinspection/processor/ResourceInspectionProcessorTest.kt
index ee8b0a2..203501d 100644
--- a/resourceinspection/resourceinspection-processor/src/test/kotlin/androidx/resourceinspection/processor/ResourceInspectionProcessorTest.kt
+++ b/resourceinspection/resourceinspection-processor/src/test/kotlin/androidx/resourceinspection/processor/ResourceInspectionProcessorTest.kt
@@ -23,6 +23,7 @@
import com.google.testing.compile.JavaFileObjects
import org.intellij.lang.annotations.Language
import org.junit.Test
+import java.io.File
import javax.lang.model.SourceVersion
import javax.tools.JavaFileObject
@@ -607,8 +608,8 @@
@Attribute(value = "androidx.pkg:intFlag", intMapping = {
@Attribute.IntMap(value = 1, mask = 3, name = "ONE"),
@Attribute.IntMap(value = 2, mask = 3, name = "TWO"),
- @Attribute.IntMap(value = 4, mask = 4, name = "FOUR"),
- @Attribute.IntMap(value = 5, name = "FIVE")
+ @Attribute.IntMap(value = 3, mask = 3, name = "THREE"),
+ @Attribute.IntMap(value = 4, name = "FOUR"),
})
public int getIntFlag() {
return 0;
@@ -666,11 +667,11 @@
if ((value & 3) == 2) {
flags.add("TWO");
}
- if ((value & 4) == 4) {
- flags.add("FOUR");
+ if (value == 3) {
+ flags.add("THREE");
}
- if (value == 5) {
- flags.add("FIVE");
+ if (value == 4) {
+ flags.add("FOUR");
}
return flags;
}
@@ -1585,6 +1586,181 @@
)
}
+ @Test
+ fun `fails when view inspection API is missing`() {
+ val source = java(
+ "androidx.pkg.MissingViewInspectorApiTestClass",
+ """
+ package androidx.pkg;
+
+ import androidx.resourceinspection.annotation.Attribute;
+
+ public final class MissingViewInspectorApiTestClass {
+ @Attribute("androidx.pkg:attribute")
+ public int getAttribute() {
+ return 1;
+ }
+ }
+ """
+ )
+
+ val classpath = System.getProperty("java.class.path")
+ .split(File.pathSeparator)
+ .map { File(it) }
+ .filterNot { it.name == "android.jar" }
+
+ assertThat(
+ javac()
+ .withClasspath(classpath)
+ .withProcessors(ResourceInspectionProcessor())
+ .compile(source)
+ ).hadErrorContaining(
+ "View inspector (android.view.inspector) API is not present. Please ensure compile " +
+ "SDK is 29 or greater."
+ )
+ }
+
+ @Test
+ fun `fails on duplicate int map names`() {
+ assertThat(
+ compile(
+ fakeR("androidx.pkg", "attribute"),
+ java(
+ "androidx.pkg.DuplicateIntMapNameTestView",
+ """
+ package androidx.pkg;
+
+ import android.content.Context;
+ import android.util.AttributeSet;
+ import android.view.View;
+ import androidx.resourceinspection.annotation.Attribute;
+
+ public final class DuplicateIntMapNameTestView extends View {
+ public DuplicateIntMapNameTestView(
+ Context context, AttributeSet attrs) {
+ super(context, attrs);
+ }
+
+ @Attribute(value = "androidx.pkg:attribute", intMapping = {
+ @Attribute.IntMap(name = "duplicated", value = 1),
+ @Attribute.IntMap(name = "duplicated", value = 2)
+ })
+ public int getAttribute() {
+ return 1;
+ }
+ }
+ """
+ )
+ )
+ ).hadErrorContaining("Duplicate int enum entry name: \"duplicated\"")
+ }
+
+ @Test
+ fun `fails on duplicate int enum value`() {
+ assertThat(
+ compile(
+ fakeR("androidx.pkg", "attribute"),
+ java(
+ "androidx.pkg.DuplicateIntEnumValueTestView",
+ """
+ package androidx.pkg;
+
+ import android.content.Context;
+ import android.util.AttributeSet;
+ import android.view.View;
+ import androidx.resourceinspection.annotation.Attribute;
+
+ public final class DuplicateIntEnumValueTestView extends View {
+ public DuplicateIntEnumValueTestView(
+ Context context, AttributeSet attrs) {
+ super(context, attrs);
+ }
+
+ @Attribute(value = "androidx.pkg:attribute", intMapping = {
+ @Attribute.IntMap(name = "FOO", value = 1),
+ @Attribute.IntMap(name = "BAR", value = 1),
+ @Attribute.IntMap(name = "BAZ", value = 1)
+ })
+ public int getAttribute() {
+ return 1;
+ }
+ }
+ """
+ )
+ )
+ ).hadErrorContaining("Int enum value 1 is duplicated on entries \"FOO\", \"BAR\"")
+ }
+
+ @Test
+ fun `fails on invalid int flag mask`() {
+ assertThat(
+ compile(
+ fakeR("androidx.pkg", "attribute"),
+ java(
+ "androidx.pkg.InvalidIntFlagTestView",
+ """
+ package androidx.pkg;
+
+ import android.content.Context;
+ import android.util.AttributeSet;
+ import android.view.View;
+ import androidx.resourceinspection.annotation.Attribute;
+
+ public final class InvalidIntFlagTestView extends View {
+ public InvalidIntFlagTestView(Context context, AttributeSet attrs) {
+ super(context, attrs);
+ }
+
+ @Attribute(value = "androidx.pkg:attribute", intMapping = {
+ @Attribute.IntMap(name = "BAD", value = 3, mask = 1)
+ })
+ public int getAttribute() {
+ return 1;
+ }
+ }
+ """
+ )
+ )
+ ).hadErrorContaining("Int flag mask 0x1 does not reveal value 0x3")
+ }
+
+ @Test
+ fun `fails on duplicate int flag mask and value`() {
+ assertThat(
+ compile(
+ fakeR("androidx.pkg", "attribute"),
+ java(
+ "androidx.pkg.DuplicateIntFlagTestView",
+ """
+ package androidx.pkg;
+
+ import android.content.Context;
+ import android.util.AttributeSet;
+ import android.view.View;
+ import androidx.resourceinspection.annotation.Attribute;
+
+ public final class DuplicateIntFlagTestView extends View {
+ public DuplicateIntFlagTestView(Context context, AttributeSet attrs) {
+ super(context, attrs);
+ }
+
+ @Attribute(value = "androidx.pkg:attribute", intMapping = {
+ @Attribute.IntMap(name = "FOO", value = 3, mask = 3),
+ @Attribute.IntMap(name = "BAR", value = 3, mask = 3),
+ @Attribute.IntMap(name = "BAZ", value = 3)
+ })
+ public int getAttribute() {
+ return 1;
+ }
+ }
+ """
+ )
+ )
+ ).hadErrorContaining(
+ "Int flag mask 0x3 and value 0x3 is duplicated on entries \"FOO\", \"BAR\""
+ )
+ }
+
private fun compile(vararg sources: JavaFileObject): Compilation {
return javac()
.withProcessors(ResourceInspectionProcessor())
diff --git a/room/benchmark/src/androidTest/AndroidManifest.xml b/room/benchmark/src/androidTest/AndroidManifest.xml
index 23bc3af..42ea1a8 100644
--- a/room/benchmark/src/androidTest/AndroidManifest.xml
+++ b/room/benchmark/src/androidTest/AndroidManifest.xml
@@ -16,15 +16,9 @@
-->
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:tools="http://schemas.android.com/tools"
package="androidx.room.benchmark">
-
- <!-- Important: disable debuggable for accurate performance results -->
- <application
- android:debuggable="false"
- tools:replace="android:debuggable">
- <!-- enable profileableByShell for non-intrusive profiling tools -->
- <!--suppress AndroidElementNotAllowed -->
+ <application>
+ <!-- enable profiling by shell for non-intrusive profiling tools -->
<profileable android:shell="true"/>
</application>
</manifest>
diff --git a/room/buildSrc b/room/buildSrc
new file mode 120000
index 0000000..053a423
--- /dev/null
+++ b/room/buildSrc
@@ -0,0 +1 @@
+../buildSrc
\ No newline at end of file
diff --git a/room/integration-tests/kotlintestapp/build.gradle b/room/integration-tests/kotlintestapp/build.gradle
index 18c7191..79da109 100644
--- a/room/integration-tests/kotlintestapp/build.gradle
+++ b/room/integration-tests/kotlintestapp/build.gradle
@@ -24,18 +24,10 @@
id("AndroidXPlugin")
id("com.android.application")
id("kotlin-android")
+ // both ksp and kapt are applied. each run in their own variant.
+ id("com.google.devtools.ksp")
+ id("kotlin-kapt")
}
-// If set to `true`, we'll use KSP instead of KAPT.
-// Note that the CI does not run tests with KSP yet so this is only for local usage.
-// Once variants are properly supported by both ksp and AndroidX, we'll add support for this.
-// (b/153917176)
-def useKsp = project.properties.getOrDefault("useKsp", "false").toBoolean()
-if (useKsp) {
- apply plugin: "com.google.devtools.ksp"
-} else {
- apply plugin: "kotlin-kapt"
-}
-
android {
buildFeatures {
buildConfig = true
@@ -45,41 +37,31 @@
javaCompileOptions {
annotationProcessorOptions {
arguments = [
- "room.schemaLocation" : "$projectDir/schemas".toString(),
- "room.expandProjection": "true"
+ "room.schemaLocation" : "$projectDir/schemas".toString()
]
}
}
- buildConfigField("boolean", "KSP", "$useKsp")
}
sourceSets {
- androidTest.assets.srcDirs += files("$projectDir/schemas".toString())
+ androidTestWithKapt.assets.srcDirs += files("$projectDir/schemas".toString())
+ androidTestWithKsp.assets.srcDirs += files("$projectDir/schemas-ksp".toString())
}
flavorDimensions "processorConfiguration"
productFlavors {
- withExpandProjection {
+ withKapt {
dimension "processorConfiguration"
javaCompileOptions {
annotationProcessorOptions {
arguments = [
"room.schemaLocation" : "$projectDir/schemas".toString(),
- "room.expandProjection" : "true"
]
}
}
}
- withoutExpandProjection {
+ withKsp {
dimension "processorConfiguration"
- javaCompileOptions {
- annotationProcessorOptions {
- arguments = [
- "room.schemaLocation" : "$projectDir/schemas".toString(),
- "room.expandProjection" : "false"
- ]
- }
- }
}
}
}
@@ -96,15 +78,12 @@
implementation(libs.multidex)
// depend on the shadowed version so that it tests with the shipped artifact
// this is a temporary attribute until KSP and AndroidX plugin supports variants.
- if (useKsp) {
- kspAndroidTest(
- project(path: ":room:room-compiler", configuration: "shadowAndImplementation")
- )
- } else {
- kaptAndroidTest(
- project(path: ":room:room-compiler", configuration: "shadowAndImplementation")
- )
- }
+ kspAndroidTestWithKsp(
+ project(path: ":room:room-compiler", configuration: "shadowAndImplementation")
+ )
+ kaptAndroidTestWithKapt(
+ project(path: ":room:room-compiler", configuration: "shadowAndImplementation")
+ )
androidTestImplementation(projectOrArtifact(":lifecycle:lifecycle-livedata-ktx"))
androidTestImplementation(projectOrArtifact(":arch:core:core-runtime")) // Added for b/155802460
androidTestImplementation(libs.testExtJunit)
@@ -125,6 +104,7 @@
androidTestImplementation(project(":room:room-rxjava2"))
androidTestImplementation(project(":room:room-rxjava3"))
androidTestImplementation(project(":room:room-ktx"))
+ androidTestImplementation(project(":internal-testutils-common"))
androidTestImplementation("androidx.arch.core:core-testing:2.0.1")
androidTestImplementation(projectOrArtifact(":paging:paging-runtime"))
androidTestImplementation(libs.guavaAndroid)
@@ -132,11 +112,9 @@
testImplementation(libs.mockitoCore)
}
-if (useKsp) {
- ksp {
- arg("room.schemaLocation","$projectDir/schemas".toString())
- arg("room.expandProjection", "true")
- }
+// KSP does not support argument per flavor so we set it to global instead.
+ksp {
+ arg("room.schemaLocation","$projectDir/schemas-ksp".toString())
}
// Allow usage of Kotlin's @OptIn.
diff --git a/room/integration-tests/kotlintestapp/schemas-ksp/androidx.room.integration.kotlintestapp.migration.MigrationDbKotlin/1.json b/room/integration-tests/kotlintestapp/schemas-ksp/androidx.room.integration.kotlintestapp.migration.MigrationDbKotlin/1.json
new file mode 100644
index 0000000..e05f095
--- /dev/null
+++ b/room/integration-tests/kotlintestapp/schemas-ksp/androidx.room.integration.kotlintestapp.migration.MigrationDbKotlin/1.json
@@ -0,0 +1,38 @@
+{
+ "formatVersion": 1,
+ "database": {
+ "version": 1,
+ "identityHash": "2f3557e56d7f665363f3e20d14787a59",
+ "entities": [
+ {
+ "tableName": "Entity1",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER NOT NULL, `name` TEXT, PRIMARY KEY(`id`))",
+ "fields": [
+ {
+ "fieldPath": "id",
+ "columnName": "id",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "name",
+ "columnName": "name",
+ "affinity": "TEXT",
+ "notNull": false
+ }
+ ],
+ "primaryKey": {
+ "columnNames": [
+ "id"
+ ],
+ "autoGenerate": false
+ },
+ "indices": []
+ }
+ ],
+ "setupQueries": [
+ "CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)",
+ "INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, \"2f3557e56d7f665363f3e20d14787a59\")"
+ ]
+ }
+}
\ No newline at end of file
diff --git a/room/integration-tests/kotlintestapp/schemas-ksp/androidx.room.integration.kotlintestapp.migration.MigrationDbKotlin/2.json b/room/integration-tests/kotlintestapp/schemas-ksp/androidx.room.integration.kotlintestapp.migration.MigrationDbKotlin/2.json
new file mode 100644
index 0000000..8982d4f
--- /dev/null
+++ b/room/integration-tests/kotlintestapp/schemas-ksp/androidx.room.integration.kotlintestapp.migration.MigrationDbKotlin/2.json
@@ -0,0 +1,63 @@
+{
+ "formatVersion": 1,
+ "database": {
+ "version": 2,
+ "identityHash": "aee9a6eed720c059df0f2ee0d6e96d89",
+ "entities": [
+ {
+ "tableName": "Entity1",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER NOT NULL, `name` TEXT, PRIMARY KEY(`id`))",
+ "fields": [
+ {
+ "fieldPath": "id",
+ "columnName": "id",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "name",
+ "columnName": "name",
+ "affinity": "TEXT",
+ "notNull": false
+ }
+ ],
+ "primaryKey": {
+ "columnNames": [
+ "id"
+ ],
+ "autoGenerate": false
+ },
+ "indices": []
+ },
+ {
+ "tableName": "Entity2",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER NOT NULL, `name` TEXT, PRIMARY KEY(`id`))",
+ "fields": [
+ {
+ "fieldPath": "id",
+ "columnName": "id",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "name",
+ "columnName": "name",
+ "affinity": "TEXT",
+ "notNull": false
+ }
+ ],
+ "primaryKey": {
+ "columnNames": [
+ "id"
+ ],
+ "autoGenerate": false
+ },
+ "indices": []
+ }
+ ],
+ "setupQueries": [
+ "CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)",
+ "INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, \"aee9a6eed720c059df0f2ee0d6e96d89\")"
+ ]
+ }
+}
\ No newline at end of file
diff --git a/room/integration-tests/kotlintestapp/schemas-ksp/androidx.room.integration.kotlintestapp.migration.MigrationDbKotlin/3.json b/room/integration-tests/kotlintestapp/schemas-ksp/androidx.room.integration.kotlintestapp.migration.MigrationDbKotlin/3.json
new file mode 100644
index 0000000..3bf0f03
--- /dev/null
+++ b/room/integration-tests/kotlintestapp/schemas-ksp/androidx.room.integration.kotlintestapp.migration.MigrationDbKotlin/3.json
@@ -0,0 +1,69 @@
+{
+ "formatVersion": 1,
+ "database": {
+ "version": 3,
+ "identityHash": "3f2a99b6d768af0184e077808f7348fe",
+ "entities": [
+ {
+ "tableName": "Entity1",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER NOT NULL, `name` TEXT, PRIMARY KEY(`id`))",
+ "fields": [
+ {
+ "fieldPath": "id",
+ "columnName": "id",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "name",
+ "columnName": "name",
+ "affinity": "TEXT",
+ "notNull": false
+ }
+ ],
+ "primaryKey": {
+ "columnNames": [
+ "id"
+ ],
+ "autoGenerate": false
+ },
+ "indices": []
+ },
+ {
+ "tableName": "Entity2",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER NOT NULL, `addedInV3` TEXT, `name` TEXT, PRIMARY KEY(`id`))",
+ "fields": [
+ {
+ "fieldPath": "id",
+ "columnName": "id",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "addedInV3",
+ "columnName": "addedInV3",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "name",
+ "columnName": "name",
+ "affinity": "TEXT",
+ "notNull": false
+ }
+ ],
+ "primaryKey": {
+ "columnNames": [
+ "id"
+ ],
+ "autoGenerate": false
+ },
+ "indices": []
+ }
+ ],
+ "setupQueries": [
+ "CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)",
+ "INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, \"3f2a99b6d768af0184e077808f7348fe\")"
+ ]
+ }
+}
\ No newline at end of file
diff --git a/room/integration-tests/kotlintestapp/schemas-ksp/androidx.room.integration.kotlintestapp.migration.MigrationDbKotlin/4.json b/room/integration-tests/kotlintestapp/schemas-ksp/androidx.room.integration.kotlintestapp.migration.MigrationDbKotlin/4.json
new file mode 100644
index 0000000..e899a02
--- /dev/null
+++ b/room/integration-tests/kotlintestapp/schemas-ksp/androidx.room.integration.kotlintestapp.migration.MigrationDbKotlin/4.json
@@ -0,0 +1,100 @@
+{
+ "formatVersion": 1,
+ "database": {
+ "version": 4,
+ "identityHash": "abbae5f17d94ff7c2c7e05ca217ccc31",
+ "entities": [
+ {
+ "tableName": "Entity1",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER NOT NULL, `name` TEXT, PRIMARY KEY(`id`))",
+ "fields": [
+ {
+ "fieldPath": "id",
+ "columnName": "id",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "name",
+ "columnName": "name",
+ "affinity": "TEXT",
+ "notNull": false
+ }
+ ],
+ "primaryKey": {
+ "columnNames": [
+ "id"
+ ],
+ "autoGenerate": false
+ },
+ "indices": []
+ },
+ {
+ "tableName": "Entity2",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER NOT NULL, `addedInV3` TEXT, `name` TEXT, PRIMARY KEY(`id`))",
+ "fields": [
+ {
+ "fieldPath": "id",
+ "columnName": "id",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "addedInV3",
+ "columnName": "addedInV3",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "name",
+ "columnName": "name",
+ "affinity": "TEXT",
+ "notNull": false
+ }
+ ],
+ "primaryKey": {
+ "columnNames": [
+ "id"
+ ],
+ "autoGenerate": false
+ },
+ "indices": []
+ },
+ {
+ "tableName": "Entity3",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER, `removedInV5` TEXT, `name` TEXT, PRIMARY KEY(`id`))",
+ "fields": [
+ {
+ "fieldPath": "id",
+ "columnName": "id",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "removedInV5",
+ "columnName": "removedInV5",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "name",
+ "columnName": "name",
+ "affinity": "TEXT",
+ "notNull": false
+ }
+ ],
+ "primaryKey": {
+ "columnNames": [
+ "id"
+ ],
+ "autoGenerate": false
+ },
+ "indices": []
+ }
+ ],
+ "setupQueries": [
+ "CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)",
+ "INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, \"abbae5f17d94ff7c2c7e05ca217ccc31\")"
+ ]
+ }
+}
\ No newline at end of file
diff --git a/room/integration-tests/kotlintestapp/schemas-ksp/androidx.room.integration.kotlintestapp.migration.MigrationDbKotlin/5.json b/room/integration-tests/kotlintestapp/schemas-ksp/androidx.room.integration.kotlintestapp.migration.MigrationDbKotlin/5.json
new file mode 100644
index 0000000..801fdb5
--- /dev/null
+++ b/room/integration-tests/kotlintestapp/schemas-ksp/androidx.room.integration.kotlintestapp.migration.MigrationDbKotlin/5.json
@@ -0,0 +1,94 @@
+{
+ "formatVersion": 1,
+ "database": {
+ "version": 5,
+ "identityHash": "5543c44fe679f4cf8f03093d66838068",
+ "entities": [
+ {
+ "tableName": "Entity1",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER NOT NULL, `name` TEXT, PRIMARY KEY(`id`))",
+ "fields": [
+ {
+ "fieldPath": "id",
+ "columnName": "id",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "name",
+ "columnName": "name",
+ "affinity": "TEXT",
+ "notNull": false
+ }
+ ],
+ "primaryKey": {
+ "columnNames": [
+ "id"
+ ],
+ "autoGenerate": false
+ },
+ "indices": []
+ },
+ {
+ "tableName": "Entity2",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER NOT NULL, `addedInV3` TEXT, `name` TEXT, PRIMARY KEY(`id`))",
+ "fields": [
+ {
+ "fieldPath": "id",
+ "columnName": "id",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "addedInV3",
+ "columnName": "addedInV3",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "name",
+ "columnName": "name",
+ "affinity": "TEXT",
+ "notNull": false
+ }
+ ],
+ "primaryKey": {
+ "columnNames": [
+ "id"
+ ],
+ "autoGenerate": false
+ },
+ "indices": []
+ },
+ {
+ "tableName": "Entity3",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER NOT NULL, `name` TEXT, PRIMARY KEY(`id`))",
+ "fields": [
+ {
+ "fieldPath": "id",
+ "columnName": "id",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "name",
+ "columnName": "name",
+ "affinity": "TEXT",
+ "notNull": false
+ }
+ ],
+ "primaryKey": {
+ "columnNames": [
+ "id"
+ ],
+ "autoGenerate": false
+ },
+ "indices": []
+ }
+ ],
+ "setupQueries": [
+ "CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)",
+ "INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, \"5543c44fe679f4cf8f03093d66838068\")"
+ ]
+ }
+}
\ No newline at end of file
diff --git a/room/integration-tests/kotlintestapp/schemas-ksp/androidx.room.integration.kotlintestapp.migration.MigrationDbKotlin/6.json b/room/integration-tests/kotlintestapp/schemas-ksp/androidx.room.integration.kotlintestapp.migration.MigrationDbKotlin/6.json
new file mode 100644
index 0000000..a6fdf5b
--- /dev/null
+++ b/room/integration-tests/kotlintestapp/schemas-ksp/androidx.room.integration.kotlintestapp.migration.MigrationDbKotlin/6.json
@@ -0,0 +1,69 @@
+{
+ "formatVersion": 1,
+ "database": {
+ "version": 6,
+ "identityHash": "3f2a99b6d768af0184e077808f7348fe",
+ "entities": [
+ {
+ "tableName": "Entity1",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER NOT NULL, `name` TEXT, PRIMARY KEY(`id`))",
+ "fields": [
+ {
+ "fieldPath": "id",
+ "columnName": "id",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "name",
+ "columnName": "name",
+ "affinity": "TEXT",
+ "notNull": false
+ }
+ ],
+ "primaryKey": {
+ "columnNames": [
+ "id"
+ ],
+ "autoGenerate": false
+ },
+ "indices": []
+ },
+ {
+ "tableName": "Entity2",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER NOT NULL, `addedInV3` TEXT, `name` TEXT, PRIMARY KEY(`id`))",
+ "fields": [
+ {
+ "fieldPath": "id",
+ "columnName": "id",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "addedInV3",
+ "columnName": "addedInV3",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "name",
+ "columnName": "name",
+ "affinity": "TEXT",
+ "notNull": false
+ }
+ ],
+ "primaryKey": {
+ "columnNames": [
+ "id"
+ ],
+ "autoGenerate": false
+ },
+ "indices": []
+ }
+ ],
+ "setupQueries": [
+ "CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)",
+ "INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, \"3f2a99b6d768af0184e077808f7348fe\")"
+ ]
+ }
+}
\ No newline at end of file
diff --git a/room/integration-tests/kotlintestapp/schemas-ksp/androidx.room.integration.kotlintestapp.migration.MigrationDbKotlin/7.json b/room/integration-tests/kotlintestapp/schemas-ksp/androidx.room.integration.kotlintestapp.migration.MigrationDbKotlin/7.json
new file mode 100644
index 0000000..78ce189
--- /dev/null
+++ b/room/integration-tests/kotlintestapp/schemas-ksp/androidx.room.integration.kotlintestapp.migration.MigrationDbKotlin/7.json
@@ -0,0 +1,118 @@
+{
+ "formatVersion": 1,
+ "database": {
+ "version": 7,
+ "identityHash": "5653c29453937d8e34dc031af1ab4c7d",
+ "entities": [
+ {
+ "tableName": "Entity1",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER NOT NULL, `name` TEXT, PRIMARY KEY(`id`))",
+ "fields": [
+ {
+ "fieldPath": "id",
+ "columnName": "id",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "name",
+ "columnName": "name",
+ "affinity": "TEXT",
+ "notNull": false
+ }
+ ],
+ "primaryKey": {
+ "columnNames": [
+ "id"
+ ],
+ "autoGenerate": false
+ },
+ "indices": [
+ {
+ "name": "index_Entity1_name",
+ "unique": true,
+ "columnNames": [
+ "name"
+ ],
+ "createSql": "CREATE UNIQUE INDEX `index_Entity1_name` ON `${TABLE_NAME}` (`name`)"
+ }
+ ],
+ "foreignKeys": []
+ },
+ {
+ "tableName": "Entity2",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER NOT NULL, `addedInV3` TEXT, `name` TEXT, PRIMARY KEY(`id`))",
+ "fields": [
+ {
+ "fieldPath": "id",
+ "columnName": "id",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "addedInV3",
+ "columnName": "addedInV3",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "name",
+ "columnName": "name",
+ "affinity": "TEXT",
+ "notNull": false
+ }
+ ],
+ "primaryKey": {
+ "columnNames": [
+ "id"
+ ],
+ "autoGenerate": false
+ },
+ "indices": [],
+ "foreignKeys": []
+ },
+ {
+ "tableName": "Entity4",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER NOT NULL, `name` TEXT, PRIMARY KEY(`id`), FOREIGN KEY(`name`) REFERENCES `Entity1`(`name`) ON UPDATE NO ACTION ON DELETE NO ACTION DEFERRABLE INITIALLY DEFERRED)",
+ "fields": [
+ {
+ "fieldPath": "id",
+ "columnName": "id",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "name",
+ "columnName": "name",
+ "affinity": "TEXT",
+ "notNull": false
+ }
+ ],
+ "primaryKey": {
+ "columnNames": [
+ "id"
+ ],
+ "autoGenerate": false
+ },
+ "indices": [],
+ "foreignKeys": [
+ {
+ "table": "Entity1",
+ "onDelete": "NO ACTION",
+ "onUpdate": "NO ACTION",
+ "columns": [
+ "name"
+ ],
+ "referencedColumns": [
+ "name"
+ ]
+ }
+ ]
+ }
+ ],
+ "setupQueries": [
+ "CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)",
+ "INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, \"5653c29453937d8e34dc031af1ab4c7d\")"
+ ]
+ }
+}
\ No newline at end of file
diff --git a/room/integration-tests/kotlintestapp/src/androidTest/java/androidx/room/integration/kotlintestapp/RoomTestConfig.kt b/room/integration-tests/kotlintestapp/src/androidTest/java/androidx/room/integration/kotlintestapp/RoomTestConfig.kt
index 7895e3c9..1d20a98 100644
--- a/room/integration-tests/kotlintestapp/src/androidTest/java/androidx/room/integration/kotlintestapp/RoomTestConfig.kt
+++ b/room/integration-tests/kotlintestapp/src/androidTest/java/androidx/room/integration/kotlintestapp/RoomTestConfig.kt
@@ -27,7 +27,7 @@
* This can help enable/disable certain tests for ksp
*/
val isKsp
- get() = BuildConfig.KSP
+ get() = BuildConfig.FLAVOR == "withKsp"
}
/**
diff --git a/room/integration-tests/kotlintestapp/src/androidTest/java/androidx/room/integration/kotlintestapp/dao/BooksDao.kt b/room/integration-tests/kotlintestapp/src/androidTest/java/androidx/room/integration/kotlintestapp/dao/BooksDao.kt
index 49ee2911..7842512 100644
--- a/room/integration-tests/kotlintestapp/src/androidTest/java/androidx/room/integration/kotlintestapp/dao/BooksDao.kt
+++ b/room/integration-tests/kotlintestapp/src/androidTest/java/androidx/room/integration/kotlintestapp/dao/BooksDao.kt
@@ -433,4 +433,7 @@
}
suspend fun concreteSuspendFunctionWithParams(num: Int, text: String) = "$num - $text"
+
+ // This is a private method to validate b/194706278
+ private fun getNullAuthor(): Author? = null
}
diff --git a/room/integration-tests/kotlintestapp/src/androidTest/java/androidx/room/integration/kotlintestapp/dao/DerivedDao.kt b/room/integration-tests/kotlintestapp/src/androidTest/java/androidx/room/integration/kotlintestapp/dao/DerivedDao.kt
index 851263c..7084bfc 100644
--- a/room/integration-tests/kotlintestapp/src/androidTest/java/androidx/room/integration/kotlintestapp/dao/DerivedDao.kt
+++ b/room/integration-tests/kotlintestapp/src/androidTest/java/androidx/room/integration/kotlintestapp/dao/DerivedDao.kt
@@ -25,4 +25,4 @@
@Query("SELECT * FROM author WHERE authorId = :authorId")
fun getAuthor(authorId: String): Author
-}
\ No newline at end of file
+}
diff --git a/room/integration-tests/kotlintestapp/src/androidTest/java/androidx/room/integration/kotlintestapp/test/PagingSourceTest.kt b/room/integration-tests/kotlintestapp/src/androidTest/java/androidx/room/integration/kotlintestapp/test/PagingSourceTest.kt
index f9c8afa..f54371b 100644
--- a/room/integration-tests/kotlintestapp/src/androidTest/java/androidx/room/integration/kotlintestapp/test/PagingSourceTest.kt
+++ b/room/integration-tests/kotlintestapp/src/androidTest/java/androidx/room/integration/kotlintestapp/test/PagingSourceTest.kt
@@ -43,6 +43,8 @@
import androidx.test.espresso.base.MainThread
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.MediumTest
+import androidx.testutils.FilteringExecutor
+import androidx.testutils.withTestTimeout
import com.google.common.truth.Truth.assertThat
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
@@ -62,17 +64,11 @@
import kotlinx.coroutines.launch
import kotlinx.coroutines.runBlocking
import kotlinx.coroutines.withContext
-import kotlinx.coroutines.withTimeout
import kotlinx.coroutines.yield
import org.junit.After
import org.junit.Before
import org.junit.Test
import org.junit.runner.RunWith
-import java.util.concurrent.Executor
-import java.util.concurrent.Executors
-import java.util.concurrent.TimeUnit
-import java.util.concurrent.locks.ReentrantLock
-import kotlin.concurrent.withLock
import kotlin.test.assertFailsWith
import kotlin.test.assertFalse
import kotlin.test.assertTrue
@@ -948,64 +944,6 @@
val changeCount: Int = 0
)
- /**
- * An executor that can block some known runnables. We use it to slow down database
- * invalidation events.
- */
- private class FilteringExecutor : Executor {
- private val delegate = Executors.newSingleThreadExecutor()
- private val deferred = mutableListOf<Runnable>()
- private val deferredSize = MutableStateFlow(0)
- private val lock = ReentrantLock()
-
- var filterFunction: (Runnable) -> Boolean = { true }
- set(value) {
- field = value
- reEnqueueDeferred()
- }
-
- suspend fun awaitDeferredSizeAtLeast(min: Int) = withTestTimeout {
- deferredSize.mapLatest {
- it >= min
- }.first()
- }
-
- private fun reEnqueueDeferred() {
- val copy = lock.withLock {
- val copy = deferred.toMutableList()
- deferred.clear()
- deferredSize.value = 0
- copy
- }
- copy.forEach(this::execute)
- }
-
- fun deferredSize(): Int {
- return deferred.size
- }
-
- fun executeAll() {
- while (deferred.isNotEmpty()) {
- deferred.removeFirst().run()
- }
- }
-
- fun executeLatestDeferred() {
- deferred.removeLast().run()
- }
-
- override fun execute(command: Runnable) {
- lock.withLock {
- if (filterFunction(command)) {
- delegate.execute(command)
- } else {
- deferred.add(command)
- deferredSize.value += 1
- }
- }
- }
- }
-
companion object {
private val CONFIG = PagingConfig(
pageSize = 3,
@@ -1013,16 +951,4 @@
enablePlaceholders = true,
)
}
-}
-
-private suspend fun <T> withTestTimeout(block: suspend () -> T): T {
- try {
- return withTimeout(
- timeMillis = TimeUnit.SECONDS.toMillis(3)
- ) {
- block()
- }
- } catch (err: Throwable) {
- throw AssertionError("didn't complete in expected time", err)
- }
-}
+}
\ No newline at end of file
diff --git a/room/integration-tests/testapp/src/androidTest/java/androidx/room/integration/testapp/MusicTestDatabase.java b/room/integration-tests/testapp/src/androidTest/java/androidx/room/integration/testapp/MusicTestDatabase.java
index f9b4e1a..bd3f9d2 100644
--- a/room/integration-tests/testapp/src/androidTest/java/androidx/room/integration/testapp/MusicTestDatabase.java
+++ b/room/integration-tests/testapp/src/androidTest/java/androidx/room/integration/testapp/MusicTestDatabase.java
@@ -18,19 +18,23 @@
import androidx.room.Database;
import androidx.room.RoomDatabase;
+import androidx.room.TypeConverters;
import androidx.room.integration.testapp.dao.MusicDao;
import androidx.room.integration.testapp.vo.Album;
import androidx.room.integration.testapp.vo.Artist;
+import androidx.room.integration.testapp.vo.Image;
import androidx.room.integration.testapp.vo.Playlist;
import androidx.room.integration.testapp.vo.PlaylistMultiSongXRefView;
import androidx.room.integration.testapp.vo.PlaylistSongXRef;
import androidx.room.integration.testapp.vo.Song;
@Database(
- entities = {Song.class, Playlist.class, PlaylistSongXRef.class, Artist.class, Album.class},
+ entities = {Song.class, Playlist.class, PlaylistSongXRef.class, Artist.class, Album.class,
+ Image.class},
views = {PlaylistMultiSongXRefView.class},
version = 1,
exportSchema = false)
+@TypeConverters({TestDatabase.Converters.class})
public abstract class MusicTestDatabase extends RoomDatabase {
public abstract MusicDao getDao();
}
diff --git a/room/integration-tests/testapp/src/androidTest/java/androidx/room/integration/testapp/dao/MusicDao.java b/room/integration-tests/testapp/src/androidTest/java/androidx/room/integration/testapp/dao/MusicDao.java
index 816b32b..a8d63c4 100644
--- a/room/integration-tests/testapp/src/androidTest/java/androidx/room/integration/testapp/dao/MusicDao.java
+++ b/room/integration-tests/testapp/src/androidTest/java/androidx/room/integration/testapp/dao/MusicDao.java
@@ -19,13 +19,17 @@
import androidx.lifecycle.LiveData;
import androidx.room.Dao;
import androidx.room.Insert;
+import androidx.room.MapInfo;
import androidx.room.Query;
import androidx.room.RawQuery;
+import androidx.room.RewriteQueriesToDropUnusedColumns;
import androidx.room.Transaction;
import androidx.room.integration.testapp.vo.Album;
import androidx.room.integration.testapp.vo.AlbumNameAndBandName;
import androidx.room.integration.testapp.vo.AlbumWithSongs;
import androidx.room.integration.testapp.vo.Artist;
+import androidx.room.integration.testapp.vo.Image;
+import androidx.room.integration.testapp.vo.ImageFormat;
import androidx.room.integration.testapp.vo.MultiSongPlaylistWithSongs;
import androidx.room.integration.testapp.vo.Playlist;
import androidx.room.integration.testapp.vo.PlaylistSongXRef;
@@ -39,6 +43,8 @@
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSetMultimap;
+import java.nio.ByteBuffer;
+import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -46,6 +52,7 @@
import io.reactivex.Flowable;
@Dao
+@SuppressWarnings("ROOM_EXPAND_PROJECTION_WITH_UNUSED_COLUMNS")
public interface MusicDao {
@Insert
@@ -63,6 +70,9 @@
@Insert
void addPlaylistSongRelation(PlaylistSongXRef... relations);
+ @Insert
+ void addImages(Image... images);
+
@Transaction
@Query("SELECT * FROM Playlist")
List<PlaylistWithSongs> getAllPlaylistWithSongs();
@@ -183,4 +193,97 @@
@Query("SELECT * FROM Artist JOIN Song ON Artist.mArtistName = Song.mArtist")
LiveData<ImmutableListMultimap<Artist, Song>>
getAllArtistAndTheirSongsAsLiveDataGuavaImmutableListMultimap();
+
+ @RewriteQueriesToDropUnusedColumns
+ @MapInfo(keyColumn = "mArtistName")
+ @Query("SELECT * FROM Artist JOIN Song ON Artist.mArtistName = Song.mArtist")
+ Map<String, List<Song>> getArtistNameToSongs();
+
+ @RewriteQueriesToDropUnusedColumns
+ @MapInfo(keyColumn = "mReleasedYear", valueColumn = "mReleasedYear")
+ @Query("SELECT * FROM Album JOIN Song ON Song.mReleasedYear = Album.mAlbumReleaseYear")
+ Map<Integer, List<Song>> getReleaseYearToAlbums();
+
+ @RewriteQueriesToDropUnusedColumns
+ @MapInfo(keyColumn = "mReleasedYear", valueColumn = "mTitle")
+ @Query("SELECT * FROM Album JOIN Song ON Song.mReleasedYear = Album.mAlbumReleaseYear")
+ Map<Integer, List<String>> getReleaseYearToSongNames();
+
+ @RewriteQueriesToDropUnusedColumns
+ @MapInfo(keyColumn = "mArtistName", valueColumn = "mArtist")
+ @RawQuery
+ Map<String, List<Song>> getArtistNameToSongsRawQuery(SupportSQLiteQuery query);
+
+ @RewriteQueriesToDropUnusedColumns
+ @MapInfo(keyColumn = "mReleasedYear", valueColumn = "mReleasedYear")
+ @RawQuery
+ Map<Integer, List<Song>> getReleaseYearToAlbumsRawQuery(SupportSQLiteQuery query);
+
+ @RewriteQueriesToDropUnusedColumns
+ @MapInfo(keyColumn = "mReleasedYear", valueColumn = "mTitle")
+ @RawQuery
+ Map<Integer, List<String>> getReleaseYearToSongNamesRawQuery(SupportSQLiteQuery query);
+
+ @RewriteQueriesToDropUnusedColumns
+ @MapInfo(valueColumn = "songCount")
+ @Query("SELECT *, COUNT(mSongId) as songCount FROM Artist JOIN Song ON Artist.mArtistName = "
+ + "Song.mArtist GROUP BY mArtistName")
+ Map<Artist, Integer> getArtistAndSongCountMap();
+
+ @RewriteQueriesToDropUnusedColumns
+ @MapInfo(valueColumn = "songCount")
+ @RawQuery
+ Map<Artist, Integer> getArtistAndSongCountMapRawQuery(SupportSQLiteQuery query);
+
+ // Other Map Key/Value Types
+ @RewriteQueriesToDropUnusedColumns
+ @MapInfo(valueColumn = "mAlbumCover")
+ @Query("SELECT * FROM Artist JOIN Image ON Artist.mArtistName = Image.mArtistInImage")
+ ImmutableMap<Artist, ByteBuffer> getAllArtistsWithAlbumCovers();
+
+ @MapInfo(valueColumn = "mAlbumCover")
+ @RawQuery
+ ImmutableMap<Artist, ByteBuffer> getAllArtistsWithAlbumCoversRawQuery(SupportSQLiteQuery query);
+
+ @RewriteQueriesToDropUnusedColumns
+
+ @MapInfo(valueColumn = "mImageYear")
+ @Query("SELECT * FROM Artist JOIN Image ON Artist.mArtistName = Image.mArtistInImage")
+ ImmutableMap<Artist, Long> getAllArtistsWithAlbumCoverYear();
+
+ @MapInfo(keyColumn = "mImageYear")
+ @RawQuery
+ ImmutableMap<Long, Artist> getAllAlbumCoverYearToArtistsWithRawQuery(SupportSQLiteQuery query);
+
+ @MapInfo(keyColumn = "mAlbumCover", valueColumn = "mIsActive")
+ @Query("SELECT * FROM Image JOIN Artist ON Artist.mArtistName = Image.mArtistInImage")
+ ImmutableMap<ByteBuffer, Boolean> getAlbumCoversWithBandActivity();
+
+ @MapInfo(keyColumn = "mAlbumCover", valueColumn = "mIsActive")
+ @RawQuery
+ ImmutableMap<ByteBuffer, Boolean> getAlbumCoversWithBandActivityRawQuery(
+ SupportSQLiteQuery query
+ );
+
+ @MapInfo(keyColumn = "mDateReleased", valueColumn = "mIsActive")
+ @Query("SELECT * FROM Image JOIN Artist ON Artist.mArtistName = Image.mArtistInImage")
+ ImmutableMap<Date, Boolean> getAlbumDateWithBandActivity();
+
+ @MapInfo(keyColumn = "mDateReleased", valueColumn = "mIsActive")
+ @RawQuery
+ ImmutableMap<Date, Boolean> getAlbumDateWithBandActivityRawQuery(SupportSQLiteQuery query);
+
+ @MapInfo(keyColumn = "mFormat", valueColumn = "mIsActive")
+ @Query("SELECT * FROM Image JOIN Artist ON Artist.mArtistName = Image.mArtistInImage")
+ ImmutableMap<ImageFormat, Boolean> getImageFormatWithBandActivity();
+
+ @MapInfo(keyColumn = "mFormat", valueColumn = "mIsActive")
+ @RawQuery
+ ImmutableMap<ImageFormat, Boolean> getImageFormatWithBandActivityRawQuery(
+ SupportSQLiteQuery query
+ );
+
+ @MapInfo(keyColumn = "dog", valueColumn = "cat")
+ @RawQuery
+ Map<Artist, Integer> getMapWithInvalidColumnRawQuery(SupportSQLiteQuery query);
}
diff --git a/room/integration-tests/testapp/src/androidTest/java/androidx/room/integration/testapp/test/MultimapQueryTest.java b/room/integration-tests/testapp/src/androidTest/java/androidx/room/integration/testapp/test/MultimapQueryTest.java
index 7a3db63..090db86 100644
--- a/room/integration-tests/testapp/src/androidTest/java/androidx/room/integration/testapp/test/MultimapQueryTest.java
+++ b/room/integration-tests/testapp/src/androidTest/java/androidx/room/integration/testapp/test/MultimapQueryTest.java
@@ -34,6 +34,8 @@
import androidx.room.integration.testapp.vo.AlbumNameAndBandName;
import androidx.room.integration.testapp.vo.AlbumWithSongs;
import androidx.room.integration.testapp.vo.Artist;
+import androidx.room.integration.testapp.vo.Image;
+import androidx.room.integration.testapp.vo.ImageFormat;
import androidx.room.integration.testapp.vo.ReleasedAlbum;
import androidx.room.integration.testapp.vo.Song;
import androidx.sqlite.db.SimpleSQLiteQuery;
@@ -54,7 +56,9 @@
import org.junit.Test;
import org.junit.runner.RunWith;
+import java.nio.ByteBuffer;
import java.util.Arrays;
+import java.util.Date;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
@@ -105,47 +109,69 @@
private final Artist mRhcp = new Artist(
1,
- "Red Hot Chili Peppers"
+ "Red Hot Chili Peppers",
+ true
);
private final Artist mAcDc = new Artist(
2,
- "AC/DC"
+ "AC/DC",
+ true
);
private final Artist mTheClash = new Artist(
3,
- "The Clash"
+ "The Clash",
+ false
);
private final Artist mPinkFloyd = new Artist(
4,
- "Pink Floyd"
+ "Pink Floyd",
+ false
);
private final Album mStadiumArcadium = new Album(
1,
"Stadium Arcadium",
"Red Hot Chili Peppers",
- "2006"
+ 2006
);
private final Album mCalifornication = new Album(
2,
"Californication",
"Red Hot Chili Peppers",
- "1999"
+ 1999
);
private final Album mHighwayToHell = new Album(
3,
"Highway to Hell",
"AC/DC",
- "1979"
+ 1979
);
private final Album mTheDarkSideOfTheMoon = new Album(
4,
"The Dark Side of the Moon",
"Pink Floyd",
- "1973"
+ 1973
+ );
+
+ private final Image mPinkFloydAlbumCover = new Image(
+ 1,
+ 1973L,
+ "Pink Floyd",
+ "dark_side_of_the_moon_image".getBytes(),
+ new Date(101779200000L),
+ ImageFormat.JPG
+ );
+
+ private final Image mRhcpAlbumCover = new Image(
+ 2,
+ 2006L,
+ "Red Hot Chili Peppers",
+ "stadium_arcadium_image".getBytes(),
+ new Date(1146787200000L),
+ ImageFormat.MPEG
);
@Rule
@@ -705,6 +731,320 @@
assertContentsOfResultMapWithSet(observer.get());
}
+ @Test
+ public void testStringToListOfSongs() {
+ mMusicDao.addSongs(mRhcpSong1, mRhcpSong2, mAcdcSong1, mPinkFloydSong1);
+ mMusicDao.addArtists(mRhcp, mAcDc, mTheClash, mPinkFloyd);
+
+ Map<String, List<Song>> artistNameToSongsMap = mMusicDao.getArtistNameToSongs();
+ assertThat(artistNameToSongsMap.containsKey("Pink Floyd")).isTrue();
+ assertThat(artistNameToSongsMap.get("Red Hot Chili Peppers")).containsExactlyElementsIn(
+ Arrays.asList(mRhcpSong1, mRhcpSong2)
+ );
+ }
+
+ @Test
+ public void testIntegerToListOfAlbums() {
+ mMusicDao.addSongs(mRhcpSong1, mRhcpSong2, mAcdcSong1, mPinkFloydSong1);
+ mMusicDao.addAlbums(
+ mStadiumArcadium,
+ mCalifornication,
+ mTheDarkSideOfTheMoon,
+ mHighwayToHell
+ );
+
+ Map<Integer, List<Song>> releaseYearToAlbumsMap = mMusicDao.getReleaseYearToAlbums();
+ assertThat(releaseYearToAlbumsMap.containsKey(2006)).isTrue();
+ assertThat(releaseYearToAlbumsMap.get(2006)).containsExactlyElementsIn(
+ Arrays.asList(mRhcpSong1, mRhcpSong2)
+ );
+ assertThat(releaseYearToAlbumsMap.get(1979)).containsExactlyElementsIn(
+ Arrays.asList(mAcdcSong1)
+ );
+ }
+
+ @Test
+ public void testIntegerToStringOfAlbumNames() {
+ mMusicDao.addSongs(mRhcpSong1, mRhcpSong2, mAcdcSong1, mPinkFloydSong1);
+ mMusicDao.addAlbums(
+ mStadiumArcadium,
+ mCalifornication,
+ mTheDarkSideOfTheMoon,
+ mHighwayToHell
+ );
+
+ Map<Integer, List<String>> releaseYearToAlbumNameMap =
+ mMusicDao.getReleaseYearToSongNames();
+ assertThat(releaseYearToAlbumNameMap.containsKey(2006)).isTrue();
+ assertThat(releaseYearToAlbumNameMap.get(2006)).containsExactlyElementsIn(
+ Arrays.asList("Snow (Hey Oh)", "Dani California")
+ );
+ }
+
+ @Test
+ public void testStringToListOfSongsRawQuery() {
+ mMusicDao.addSongs(mRhcpSong1, mRhcpSong2, mAcdcSong1, mPinkFloydSong1);
+ mMusicDao.addArtists(mRhcp, mAcDc, mTheClash, mPinkFloyd);
+
+ Map<String, List<Song>> artistNameToSongsMap = mMusicDao.getArtistNameToSongsRawQuery(
+ new SimpleSQLiteQuery(
+ "SELECT * FROM Artist JOIN Song ON Artist.mArtistName = Song.mArtist"
+ )
+ );
+ assertThat(artistNameToSongsMap.containsKey("Pink Floyd")).isTrue();
+ assertThat(artistNameToSongsMap.get("Red Hot Chili Peppers")).containsExactlyElementsIn(
+ Arrays.asList(mRhcpSong1, mRhcpSong2)
+ );
+ }
+
+ @Test
+ public void testIntegerToListOfAlbumsRawQuery() {
+ mMusicDao.addSongs(mRhcpSong1, mRhcpSong2, mAcdcSong1, mPinkFloydSong1);
+ mMusicDao.addAlbums(
+ mStadiumArcadium,
+ mCalifornication,
+ mTheDarkSideOfTheMoon,
+ mHighwayToHell
+ );
+
+ Map<Integer, List<Song>> releaseYearToAlbumsMap = mMusicDao.getReleaseYearToAlbumsRawQuery(
+ new SimpleSQLiteQuery(
+ "SELECT * FROM Album JOIN Song ON Song.mReleasedYear = Album"
+ + ".mAlbumReleaseYear"
+ )
+ );
+ assertThat(releaseYearToAlbumsMap.containsKey(2006)).isTrue();
+ assertThat(releaseYearToAlbumsMap.get(2006)).containsExactlyElementsIn(
+ Arrays.asList(mRhcpSong1, mRhcpSong2)
+ );
+ assertThat(releaseYearToAlbumsMap.get(1979)).containsExactlyElementsIn(
+ Arrays.asList(mAcdcSong1)
+ );
+ }
+
+ @Test
+ public void testIntegerToStringOfAlbumNamesRawQuery() {
+ mMusicDao.addSongs(mRhcpSong1, mRhcpSong2, mAcdcSong1, mPinkFloydSong1);
+ mMusicDao.addAlbums(
+ mStadiumArcadium,
+ mCalifornication,
+ mTheDarkSideOfTheMoon,
+ mHighwayToHell
+ );
+
+ Map<Integer, List<String>> releaseYearToAlbumNameMap =
+ mMusicDao.getReleaseYearToSongNamesRawQuery(
+ new SimpleSQLiteQuery(
+ "SELECT * FROM Album JOIN Song ON Song.mReleasedYear = Album"
+ + ".mAlbumReleaseYear"
+ )
+ );
+ assertThat(releaseYearToAlbumNameMap.containsKey(2006)).isTrue();
+ assertThat(releaseYearToAlbumNameMap.get(2006)).containsExactlyElementsIn(
+ Arrays.asList("Snow (Hey Oh)", "Dani California")
+ );
+ }
+
+ @Test
+ public void testArtistToSongCount() {
+ mMusicDao.addSongs(mRhcpSong1, mRhcpSong2, mAcdcSong1, mPinkFloydSong1);
+ mMusicDao.addArtists(mRhcp, mAcDc, mTheClash, mPinkFloyd);
+
+ Map<Artist, Integer> artistNameToSongsMap = mMusicDao.getArtistAndSongCountMap();
+
+ assertThat(artistNameToSongsMap.containsKey(mPinkFloyd)).isTrue();
+ assertThat(artistNameToSongsMap.get(mRhcp)).isEqualTo(2);
+ }
+
+ @Test
+ public void testArtistToSongCountWithRawQuery() {
+ mMusicDao.addSongs(mRhcpSong1, mRhcpSong2, mAcdcSong1, mPinkFloydSong1);
+ mMusicDao.addArtists(mRhcp, mAcDc, mTheClash, mPinkFloyd);
+
+ Map<Artist, Integer> artistNameToSongsMap = mMusicDao.getArtistAndSongCountMapRawQuery(
+ new SimpleSQLiteQuery(
+ "SELECT *, COUNT(mSongId) as songCount FROM Artist JOIN Song ON Artist"
+ + ".mArtistName = Song.mArtist GROUP BY mArtistName"
+ )
+ );
+ assertThat(artistNameToSongsMap.containsKey(mPinkFloyd)).isTrue();
+ assertThat(artistNameToSongsMap.get(mRhcp)).isEqualTo(2);
+ }
+
+ @Test
+ public void testArtistToImage() {
+ mMusicDao.addArtists(mRhcp, mAcDc, mTheClash, mPinkFloyd);
+ mMusicDao.addImages(mPinkFloydAlbumCover, mRhcpAlbumCover);
+
+ ImmutableMap<Artist, ByteBuffer> artistNameToImagesMap =
+ mMusicDao.getAllArtistsWithAlbumCovers();
+
+ assertThat(artistNameToImagesMap.containsKey(mPinkFloyd)).isTrue();
+ assertThat(artistNameToImagesMap.get(mRhcp)).isEqualTo(
+ ByteBuffer.wrap("stadium_arcadium_image".getBytes())
+ );
+ }
+
+ @Test
+ public void testArtistToImageRawQuery() {
+ mMusicDao.addArtists(mRhcp, mAcDc, mTheClash, mPinkFloyd);
+ mMusicDao.addImages(mPinkFloydAlbumCover, mRhcpAlbumCover);
+
+ ImmutableMap<Artist, ByteBuffer> artistNameToImagesMap =
+ mMusicDao.getAllArtistsWithAlbumCoversRawQuery(
+ new SimpleSQLiteQuery(
+ "SELECT * FROM Artist JOIN Image ON Artist.mArtistName = Image"
+ + ".mArtistInImage"
+ )
+ );
+
+ assertThat(artistNameToImagesMap.containsKey(mPinkFloyd)).isTrue();
+ assertThat(artistNameToImagesMap.get(mRhcp)).isEqualTo(
+ ByteBuffer.wrap("stadium_arcadium_image".getBytes())
+ );
+ }
+
+ @Test
+ public void testArtistToImageYear() {
+ mMusicDao.addArtists(mRhcp, mAcDc, mTheClash, mPinkFloyd);
+ mMusicDao.addImages(mPinkFloydAlbumCover, mRhcpAlbumCover);
+
+ ImmutableMap<Artist, Long> artistNameToImagesMap =
+ mMusicDao.getAllArtistsWithAlbumCoverYear();
+
+ assertThat(artistNameToImagesMap.get(mRhcp)).isEqualTo(2006L);
+ }
+
+ @Test
+ public void testImageYearToArtistRawQuery() {
+ mMusicDao.addArtists(mRhcp, mAcDc, mTheClash, mPinkFloyd);
+ mMusicDao.addImages(mPinkFloydAlbumCover, mRhcpAlbumCover);
+
+ ImmutableMap<Long, Artist> imageToArtistsMap =
+ mMusicDao.getAllAlbumCoverYearToArtistsWithRawQuery(
+ new SimpleSQLiteQuery(
+ "SELECT * FROM Image JOIN Artist ON Artist.mArtistName = Image"
+ + ".mArtistInImage"
+ )
+ );
+
+ assertThat(imageToArtistsMap.get(2006L)).isEqualTo(mRhcp);
+ assertThat(
+ imageToArtistsMap.keySet()).containsExactlyElementsIn(Arrays.asList(2006L, 1973L)
+ );
+ }
+
+ @Test
+ public void testAlbumCoversWithBandActivity() {
+ mMusicDao.addArtists(mRhcp, mAcDc, mTheClash, mPinkFloyd);
+ mMusicDao.addImages(mPinkFloydAlbumCover, mRhcpAlbumCover);
+
+ ImmutableMap<ByteBuffer, Boolean> imageToArtistsMap =
+ mMusicDao.getAlbumCoversWithBandActivity();
+
+ assertThat(
+ imageToArtistsMap.get(ByteBuffer.wrap("stadium_arcadium_image".getBytes()))
+ ).isEqualTo(true);
+ assertThat(
+ imageToArtistsMap.get(ByteBuffer.wrap("dark_side_of_the_moon_image".getBytes()))
+ ).isEqualTo(false);
+ }
+
+ @Test
+ public void testAlbumCoversWithBandActivityRawQuery() {
+ mMusicDao.addArtists(mRhcp, mAcDc, mTheClash, mPinkFloyd);
+ mMusicDao.addImages(mPinkFloydAlbumCover, mRhcpAlbumCover);
+
+ ImmutableMap<ByteBuffer, Boolean> imageToArtistsMap =
+ mMusicDao.getAlbumCoversWithBandActivityRawQuery(
+ new SimpleSQLiteQuery(
+ "SELECT * FROM Image JOIN Artist ON Artist.mArtistName = Image"
+ + ".mArtistInImage"
+ )
+ );
+
+ assertThat(imageToArtistsMap.get(
+ ByteBuffer.wrap("stadium_arcadium_image".getBytes()))).isEqualTo(true);
+ assertThat(
+ imageToArtistsMap.get(ByteBuffer.wrap("dark_side_of_the_moon_image".getBytes()))
+ ).isEqualTo(false);
+ }
+
+ @Test
+ public void testAlbumReleaseDateWithBandActivity() {
+ mMusicDao.addArtists(mRhcp, mAcDc, mTheClash, mPinkFloyd);
+ mMusicDao.addImages(mPinkFloydAlbumCover, mRhcpAlbumCover);
+
+ ImmutableMap<Date, Boolean> imageToArtistsMap =
+ mMusicDao.getAlbumDateWithBandActivity();
+
+ assertThat(imageToArtistsMap.get(new Date(101779200000L))).isEqualTo(false);
+ assertThat(imageToArtistsMap.get(new Date(1146787200000L))).isEqualTo(true);
+ }
+
+ @Test
+ public void testAlbumReleaseDateWithBandActivityRawQuery() {
+ mMusicDao.addArtists(mRhcp, mAcDc, mTheClash, mPinkFloyd);
+ mMusicDao.addImages(mPinkFloydAlbumCover, mRhcpAlbumCover);
+
+ ImmutableMap<Date, Boolean> imageToArtistsMap =
+ mMusicDao.getAlbumDateWithBandActivityRawQuery(
+ new SimpleSQLiteQuery(
+ "SELECT * FROM Image JOIN Artist ON Artist.mArtistName = Image"
+ + ".mArtistInImage"
+ )
+ );
+
+ assertThat(imageToArtistsMap.get(new Date(101779200000L))).isEqualTo(false);
+ assertThat(imageToArtistsMap.get(new Date(1146787200000L))).isEqualTo(true);
+ }
+
+ @Test
+ public void testEnumMap() {
+ mMusicDao.addArtists(mRhcp, mAcDc, mTheClash, mPinkFloyd);
+ mMusicDao.addImages(mPinkFloydAlbumCover, mRhcpAlbumCover);
+
+ ImmutableMap<ImageFormat, Boolean> imageToArtistsMap =
+ mMusicDao.getImageFormatWithBandActivity();
+
+ assertThat(imageToArtistsMap.get(ImageFormat.JPG)).isEqualTo(false);
+ assertThat(imageToArtistsMap.get(ImageFormat.MPEG)).isEqualTo(true);
+ }
+
+ @Test
+ public void testEnumMapWithRawQuery() {
+ mMusicDao.addArtists(mRhcp, mAcDc, mTheClash, mPinkFloyd);
+ mMusicDao.addImages(mPinkFloydAlbumCover, mRhcpAlbumCover);
+
+ ImmutableMap<ImageFormat, Boolean> imageToArtistsMap =
+ mMusicDao.getImageFormatWithBandActivityRawQuery(
+ new SimpleSQLiteQuery(
+ "SELECT * FROM Image JOIN Artist ON Artist.mArtistName = Image"
+ + ".mArtistInImage"
+ )
+ );
+
+ assertThat(imageToArtistsMap.get(ImageFormat.JPG)).isEqualTo(false);
+ assertThat(imageToArtistsMap.get(ImageFormat.MPEG)).isEqualTo(true);
+ }
+
+ @Test
+ public void testInvalidMapInfoColumnsWithRawQuery() {
+ mMusicDao.addSongs(mRhcpSong1, mRhcpSong2, mAcdcSong1, mPinkFloydSong1);
+ mMusicDao.addArtists(mRhcp, mAcDc, mTheClash, mPinkFloyd);
+
+ try {
+ Map<Artist, Integer> artistNameToSongsMap = mMusicDao.getMapWithInvalidColumnRawQuery(
+ new SimpleSQLiteQuery(
+ "SELECT *, COUNT(mSongId) as songCount FROM Artist JOIN Song ON Artist"
+ + ".mArtistName = Song.mArtist GROUP BY mArtistName"
+ )
+ );
+ } catch (IllegalArgumentException e) {
+ assertThat(e.getMessage().contains("column 'cat' does not exist"));
+ }
+ }
+
/**
* Checks that the contents of the map are as expected.
*
diff --git a/room/integration-tests/testapp/src/androidTest/java/androidx/room/integration/testapp/vo/Album.java b/room/integration-tests/testapp/src/androidTest/java/androidx/room/integration/testapp/vo/Album.java
index 4c445d4..af6bd6e 100644
--- a/room/integration-tests/testapp/src/androidTest/java/androidx/room/integration/testapp/vo/Album.java
+++ b/room/integration-tests/testapp/src/androidTest/java/androidx/room/integration/testapp/vo/Album.java
@@ -25,9 +25,9 @@
public final int mAlbumId;
public final String mAlbumName;
public final String mAlbumArtist;
- public final String mAlbumReleaseYear;
+ public final int mAlbumReleaseYear;
- public Album(int albumId, String albumName, String albumArtist, String albumReleaseYear) {
+ public Album(int albumId, String albumName, String albumArtist, int albumReleaseYear) {
mAlbumId = albumId;
mAlbumName = albumName;
mAlbumArtist = albumArtist;
@@ -50,19 +50,15 @@
album.mAlbumArtist != null) {
return false;
}
- if (mAlbumReleaseYear != null ? !mAlbumReleaseYear.equals(album.mAlbumReleaseYear) :
- album.mAlbumReleaseYear != null) {
- return false;
- }
+ if (mAlbumReleaseYear != album.mAlbumReleaseYear) return false;
return true;
}
@Override
public int hashCode() {
- int result = mAlbumId;
+ int result = mAlbumId + mAlbumReleaseYear;
result = 31 * result + (mAlbumName != null ? mAlbumName.hashCode() : 0);
result = 31 * result + (mAlbumArtist != null ? mAlbumArtist.hashCode() : 0);
- result = 31 * result + (mAlbumReleaseYear != null ? mAlbumReleaseYear.hashCode() : 0);
return result;
}
}
diff --git a/room/integration-tests/testapp/src/androidTest/java/androidx/room/integration/testapp/vo/Artist.java b/room/integration-tests/testapp/src/androidTest/java/androidx/room/integration/testapp/vo/Artist.java
index 1454ad6..6217445 100644
--- a/room/integration-tests/testapp/src/androidTest/java/androidx/room/integration/testapp/vo/Artist.java
+++ b/room/integration-tests/testapp/src/androidTest/java/androidx/room/integration/testapp/vo/Artist.java
@@ -24,10 +24,12 @@
@PrimaryKey
public final int mArtistId;
public final String mArtistName;
+ public final boolean mIsActive;
- public Artist(int artistId, String artistName) {
+ public Artist(int artistId, String artistName, boolean isActive) {
mArtistId = artistId;
mArtistName = artistName;
+ mIsActive = isActive;
}
@Override
@@ -39,7 +41,7 @@
if (mArtistId != artist.mArtistId) return false;
if (mArtistName != null ? !mArtistName.equals(artist.mArtistName) :
- artist.mArtistName != null) {
+ artist.mArtistName != null && mIsActive == artist.mIsActive) {
return false;
}
return true;
diff --git a/room/integration-tests/testapp/src/androidTest/java/androidx/room/integration/testapp/vo/Image.java b/room/integration-tests/testapp/src/androidTest/java/androidx/room/integration/testapp/vo/Image.java
new file mode 100644
index 0000000..e0094f8
--- /dev/null
+++ b/room/integration-tests/testapp/src/androidTest/java/androidx/room/integration/testapp/vo/Image.java
@@ -0,0 +1,43 @@
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * 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.
+ */
+
+package androidx.room.integration.testapp.vo;
+
+import androidx.room.Entity;
+import androidx.room.PrimaryKey;
+
+import java.util.Date;
+
+@Entity
+public class Image {
+ @PrimaryKey
+ public final int mImageId;
+ public final Long mImageYear;
+ public final String mArtistInImage;
+ public final byte[] mAlbumCover;
+ public final Date mDateReleased;
+ public final ImageFormat mFormat;
+
+ public Image(int imageId, Long imageYear, String artistInImage, byte[] albumCover,
+ Date dateReleased, ImageFormat format) {
+ mImageId = imageId;
+ mImageYear = imageYear;
+ mArtistInImage = artistInImage;
+ mAlbumCover = albumCover;
+ mDateReleased = dateReleased;
+ mFormat = format;
+ }
+}
diff --git a/development/project-creator/compose-template/groupId/artifactId/src/main/groupId/package-info.java b/room/integration-tests/testapp/src/androidTest/java/androidx/room/integration/testapp/vo/ImageFormat.java
similarity index 78%
copy from development/project-creator/compose-template/groupId/artifactId/src/main/groupId/package-info.java
copy to room/integration-tests/testapp/src/androidTest/java/androidx/room/integration/testapp/vo/ImageFormat.java
index a51e68c..c073e75 100644
--- a/development/project-creator/compose-template/groupId/artifactId/src/main/groupId/package-info.java
+++ b/room/integration-tests/testapp/src/androidTest/java/androidx/room/integration/testapp/vo/ImageFormat.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) <YEAR> The Android Open Source Project
+ * Copyright 2017 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -14,7 +14,10 @@
* limitations under the License.
*/
-/**
- * Insert package level documentation here
- */
-package <PACKAGE>;
+package androidx.room.integration.testapp.vo;
+
+public enum ImageFormat {
+ JPG,
+ GIF,
+ MPEG
+}
diff --git a/room/integration-tests/testapp/src/androidTest/java/androidx/room/integration/testapp/vo/ReleasedAlbum.java b/room/integration-tests/testapp/src/androidTest/java/androidx/room/integration/testapp/vo/ReleasedAlbum.java
index c79e8a2..dfdbb45 100644
--- a/room/integration-tests/testapp/src/androidTest/java/androidx/room/integration/testapp/vo/ReleasedAlbum.java
+++ b/room/integration-tests/testapp/src/androidTest/java/androidx/room/integration/testapp/vo/ReleasedAlbum.java
@@ -18,16 +18,16 @@
public class ReleasedAlbum {
- private String mReleaseYear;
+ private int mReleaseYear;
private String mAlbumName;
- public ReleasedAlbum(String releaseYear, String albumName) {
+ public ReleasedAlbum(int releaseYear, String albumName) {
mReleaseYear = releaseYear;
mAlbumName = albumName;
}
- public String getReleaseYear() {
+ public int getReleaseYear() {
return mReleaseYear;
}
@@ -42,16 +42,13 @@
if (o == null || getClass() != o.getClass()) return false;
ReleasedAlbum that = (ReleasedAlbum) o;
- if (mReleaseYear != null ? !mReleaseYear.equals(that.mReleaseYear) :
- that.mReleaseYear != null) {
- return false;
- }
+ if (mReleaseYear != that.mReleaseYear) return false;
return mAlbumName != null ? mAlbumName.equals(that.mAlbumName) : that.mAlbumName == null;
}
@Override
public int hashCode() {
- int result = mReleaseYear != null ? mReleaseYear.hashCode() : 0;
+ int result = mReleaseYear;
result = 31 * result + (mAlbumName != null ? mAlbumName.hashCode() : 0);
return result;
}
diff --git a/room/room-common/api/current.txt b/room/room-common/api/current.txt
index 89127f9..2cd806f 100644
--- a/room/room-common/api/current.txt
+++ b/room/room-common/api/current.txt
@@ -160,6 +160,11 @@
method public abstract Class<?> value();
}
+ @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target(java.lang.annotation.ElementType.METHOD) public @interface MapInfo {
+ method public abstract String keyColumn() default "";
+ method public abstract String valueColumn() default "";
+ }
+
@IntDef({androidx.room.OnConflictStrategy.REPLACE, androidx.room.OnConflictStrategy.ROLLBACK, androidx.room.OnConflictStrategy.ABORT, androidx.room.OnConflictStrategy.FAIL, androidx.room.OnConflictStrategy.IGNORE}) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) public @interface OnConflictStrategy {
field public static final int ABORT = 3; // 0x3
field @Deprecated public static final int FAIL = 4; // 0x4
diff --git a/room/room-common/api/public_plus_experimental_current.txt b/room/room-common/api/public_plus_experimental_current.txt
index 89127f9..2cd806f 100644
--- a/room/room-common/api/public_plus_experimental_current.txt
+++ b/room/room-common/api/public_plus_experimental_current.txt
@@ -160,6 +160,11 @@
method public abstract Class<?> value();
}
+ @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target(java.lang.annotation.ElementType.METHOD) public @interface MapInfo {
+ method public abstract String keyColumn() default "";
+ method public abstract String valueColumn() default "";
+ }
+
@IntDef({androidx.room.OnConflictStrategy.REPLACE, androidx.room.OnConflictStrategy.ROLLBACK, androidx.room.OnConflictStrategy.ABORT, androidx.room.OnConflictStrategy.FAIL, androidx.room.OnConflictStrategy.IGNORE}) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) public @interface OnConflictStrategy {
field public static final int ABORT = 3; // 0x3
field @Deprecated public static final int FAIL = 4; // 0x4
diff --git a/room/room-common/api/restricted_current.txt b/room/room-common/api/restricted_current.txt
index dbdc6af..9cbd3b8 100644
--- a/room/room-common/api/restricted_current.txt
+++ b/room/room-common/api/restricted_current.txt
@@ -160,6 +160,11 @@
method public abstract Class<?> value();
}
+ @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target(java.lang.annotation.ElementType.METHOD) public @interface MapInfo {
+ method public abstract String keyColumn() default "";
+ method public abstract String valueColumn() default "";
+ }
+
@IntDef({androidx.room.OnConflictStrategy.REPLACE, androidx.room.OnConflictStrategy.ROLLBACK, androidx.room.OnConflictStrategy.ABORT, androidx.room.OnConflictStrategy.FAIL, androidx.room.OnConflictStrategy.IGNORE}) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) public @interface OnConflictStrategy {
field public static final int ABORT = 3; // 0x3
field @Deprecated public static final int FAIL = 4; // 0x4
diff --git a/room/room-common/src/main/java/androidx/room/MapInfo.java b/room/room-common/src/main/java/androidx/room/MapInfo.java
new file mode 100644
index 0000000..549d1f5
--- /dev/null
+++ b/room/room-common/src/main/java/androidx/room/MapInfo.java
@@ -0,0 +1,67 @@
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * 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.
+ */
+
+package androidx.room;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * Declares which column(s) are used to build a map or multimap return value in a {@link Dao}
+ * query method.
+ * <p>
+ * This annotation is required when the key or value of the Map is a single column of one of the
+ * built in types (primitives, boxed primitives, enum, String, byte[], ByteBuffer) or a type with a
+ * converter (e.g. Date, UUID, etc).
+ * <p>
+ * The use of this annotation provides clarity on which column should be used in retrieving
+ * information required by the return type.
+ * <p>
+ * Example:
+ * <pre>
+ * {@literal @}MapInfo(keyColumn = "artistName", valueColumn = "songName")
+ * {@literal @}Query("SELECT * FROM Artist JOIN Song ON Artist.artistName = Song.artist")
+ * Map<String, List<String>> getArtistNameToSongNames();
+ *
+ * {@literal @}MapInfo(valueColumn = "songCount")
+ * {@literal @}Query("SELECT *, COUNT(mSongId) as songCount FROM Artist JOIN Song ON
+ * Artist.artistName = Song.artist GROUP BY artistName")
+ * Map<Artist, Integer> getArtistAndSongCounts();
+ * </pre>
+ * <p>
+ * To use the @MapInfo annotation, you must provide either the key column name, value column
+ * name, or both, based on the {@link Dao}'s method return type. Column(s) specified in the
+ * provided @MapInfo annotation must be present in the query result.
+ */
+@Target(ElementType.METHOD)
+@Retention(RetentionPolicy.CLASS)
+public @interface MapInfo {
+ /**
+ * The name of the column to be used for the map's keys.
+ *
+ * @return The key column name.
+ */
+ String keyColumn() default "";
+
+ /**
+ * The name of the column to be used for the map's values.
+ *
+ * @return The value column name.
+ */
+ String valueColumn() default "";
+}
diff --git a/room/room-compiler-processing-testing/build.gradle b/room/room-compiler-processing-testing/build.gradle
index c09c633..9657ee2 100644
--- a/room/room-compiler-processing-testing/build.gradle
+++ b/room/room-compiler-processing-testing/build.gradle
@@ -30,7 +30,6 @@
implementation(libs.kotlinStdlibJdk8) // KSP defines older version as dependency, force update.
implementation(libs.ksp)
implementation(libs.googleCompileTesting)
- implementation(libs.kotlinCompileTesting)
// specify these to match the kotlin compiler version in AndroidX rather than what KSP or KCT
// uses
implementation(libs.kotlinCompilerEmbeddable)
diff --git a/room/room-compiler-processing-testing/src/main/java/androidx/room/compiler/processing/SyntheticProcessor.kt b/room/room-compiler-processing-testing/src/main/java/androidx/room/compiler/processing/SyntheticProcessor.kt
index 0be69b3..159e83a 100644
--- a/room/room-compiler-processing-testing/src/main/java/androidx/room/compiler/processing/SyntheticProcessor.kt
+++ b/room/room-compiler-processing-testing/src/main/java/androidx/room/compiler/processing/SyntheticProcessor.kt
@@ -15,7 +15,6 @@
*/
package androidx.room.compiler.processing
-import androidx.room.compiler.processing.util.RecordingXMessager
import androidx.room.compiler.processing.util.XTestInvocation
/**
@@ -32,11 +31,6 @@
val invocationInstances: List<XTestInvocation>
/**
- * The recorder for messages where we'll grab the diagnostics.
- */
- val messageWatcher: RecordingXMessager
-
- /**
* Should return any assertion error that happened during processing.
*
* When assertions fail, we don't fail the compilation to keep the stack trace, instead,
@@ -61,7 +55,6 @@
private var result: Result<Unit>? = null
override val invocationInstances = mutableListOf<XTestInvocation>()
private val nextRunHandlers = handlers.toMutableList()
- override val messageWatcher = RecordingXMessager()
internal fun processingSteps() = listOf<XProcessingStep>(
// A processing step that just ensures we're run every round.
@@ -118,7 +111,6 @@
}
val handler = nextRunHandlers.removeAt(0)
invocationInstances.add(invocation)
- invocation.processingEnv.messager.addMessageWatcher(messageWatcher)
result = kotlin.runCatching {
handler(invocation)
invocation.dispose()
diff --git a/room/room-compiler-processing-testing/src/main/java/androidx/room/compiler/processing/util/CompilationResultSubject.kt b/room/room-compiler-processing-testing/src/main/java/androidx/room/compiler/processing/util/CompilationResultSubject.kt
index 3a7b940..4a4e63f 100644
--- a/room/room-compiler-processing-testing/src/main/java/androidx/room/compiler/processing/util/CompilationResultSubject.kt
+++ b/room/room-compiler-processing-testing/src/main/java/androidx/room/compiler/processing/util/CompilationResultSubject.kt
@@ -19,6 +19,7 @@
import androidx.room.compiler.processing.ExperimentalProcessingApi
import androidx.room.compiler.processing.SyntheticJavacProcessor
import androidx.room.compiler.processing.SyntheticProcessor
+import androidx.room.compiler.processing.util.compiler.TestCompilationResult
import androidx.room.compiler.processing.util.runner.CompilationTestRunner
import com.google.common.truth.Fact.fact
import com.google.common.truth.Fact.simpleFact
@@ -27,8 +28,6 @@
import com.google.common.truth.Subject.Factory
import com.google.common.truth.Truth
import com.google.testing.compile.Compilation
-import com.tschuchort.compiletesting.KotlinCompilation
-import java.io.File
import javax.tools.Diagnostic
/**
@@ -37,7 +36,7 @@
@ExperimentalProcessingApi
abstract class CompilationResult internal constructor(
/**
- * The test infra which run this test
+ * The test infra dwhich run this test
*/
internal val testRunnerName: String,
/**
@@ -48,10 +47,18 @@
* True if compilation result was success.
*/
internal val successfulCompilation: Boolean,
+
+ /**
+ * List of diagnostics that were reported during compilation
+ */
+ diagnostics: Map<Diagnostic.Kind, List<DiagnosticMessage>>
) {
+
internal abstract val generatedSources: List<Source>
- private val diagnostics = processor.messageWatcher.diagnostics()
+ val diagnostics = diagnostics.mapValues {
+ it.value.filterNot { it.isIgnored() }
+ }
fun diagnosticsOfKind(kind: Diagnostic.Kind) = diagnostics[kind].orEmpty()
@@ -82,6 +89,25 @@
appendLine(rawOutput())
}
}
+
+ internal companion object {
+ fun DiagnosticMessage.isIgnored() = FILTERED_MESSAGE_PREFIXES.any {
+ msg.startsWith(it)
+ }
+
+ /**
+ * These messages are mostly verbose and not helpful for testing.
+ */
+ private val FILTERED_MESSAGE_PREFIXES = listOf(
+ "No processor claimed any of these annotations:",
+ "The following options were not recognized by any processor:",
+ "Using Kotlin home directory",
+ "Scripting plugin will not be loaded: not",
+ "Using JVM IR backend",
+ "Configuring the compilation environment",
+ "Loading modules:"
+ )
+ }
}
/**
@@ -151,7 +177,7 @@
* @see hasError
* @see hasNote
*/
- fun hasWarning(expected: String) = apply {
+ fun hasWarning(expected: String) =
hasDiagnosticWithMessage(
kind = Diagnostic.Kind.WARNING,
expected = expected,
@@ -159,7 +185,6 @@
) {
"expected warning: $expected"
}
- }
/**
* Asserts that compilation has a warning that contains the given text.
@@ -167,7 +192,7 @@
* @see hasErrorContaining
* @see hasNoteContaining
*/
- fun hasWarningContaining(expected: String) = apply {
+ fun hasWarningContaining(expected: String) =
hasDiagnosticWithMessage(
kind = Diagnostic.Kind.WARNING,
expected = expected,
@@ -175,7 +200,6 @@
) {
"expected warning: $expected"
}
- }
/**
* Asserts that compilation has a note with the given text.
@@ -183,7 +207,7 @@
* @see hasError
* @see hasWarning
*/
- fun hasNote(expected: String) = apply {
+ fun hasNote(expected: String) =
hasDiagnosticWithMessage(
kind = Diagnostic.Kind.NOTE,
expected = expected,
@@ -191,7 +215,6 @@
) {
"expected note: $expected"
}
- }
/**
* Asserts that compilation has a note that contains the given text.
@@ -199,7 +222,7 @@
* @see hasErrorContaining
* @see hasWarningContaining
*/
- fun hasNoteContaining(expected: String) = apply {
+ fun hasNoteContaining(expected: String) =
hasDiagnosticWithMessage(
kind = Diagnostic.Kind.NOTE,
expected = expected,
@@ -207,7 +230,6 @@
) {
"expected note: $expected"
}
- }
/**
* Asserts that compilation has an error with the given text.
@@ -215,9 +237,9 @@
* @see hasWarning
* @see hasNote
*/
- fun hasError(expected: String) = apply {
+ fun hasError(expected: String): DiagnosticMessageSubject {
shouldSucceed = false
- hasDiagnosticWithMessage(
+ return hasDiagnosticWithMessage(
kind = Diagnostic.Kind.ERROR,
expected = expected,
acceptPartialMatch = false
@@ -232,9 +254,9 @@
* @see hasWarningContaining
* @see hasNoteContaining
*/
- fun hasErrorContaining(expected: String) = apply {
+ fun hasErrorContaining(expected: String): DiagnosticMessageSubject {
shouldSucceed = false
- hasDiagnosticWithMessage(
+ return hasDiagnosticWithMessage(
kind = Diagnostic.Kind.ERROR,
expected = expected,
acceptPartialMatch = true
@@ -346,15 +368,21 @@
expected: String,
acceptPartialMatch: Boolean,
buildErrorMessage: () -> String
- ) {
+ ): DiagnosticMessageSubject {
val diagnostics = compilationResult.diagnosticsOfKind(kind)
- if (diagnostics.any { it.msg == expected }) {
- return
+ var diagnostic = diagnostics.firstOrNull {
+ it.msg == expected
}
- if (acceptPartialMatch && diagnostics.any { it.msg.contains(expected) }) {
- return
+ if (diagnostic == null && acceptPartialMatch) {
+ diagnostic = diagnostics.firstOrNull {
+ it.msg.contains(expected)
+ }
+ }
+ diagnostic?.let {
+ return DiagnosticMessageSubject.assertThat(it)
}
failWithActual(simpleFact(buildErrorMessage()))
+ error("unreachable")
}
/**
@@ -391,65 +419,41 @@
testRunner: CompilationTestRunner,
@Suppress("unused")
private val delegate: Compilation,
- processor: SyntheticJavacProcessor
+ processor: SyntheticJavacProcessor,
+ diagnostics: Map<Diagnostic.Kind, List<DiagnosticMessage>>,
+ override val generatedSources: List<Source>
) : CompilationResult(
testRunnerName = testRunner.name,
processor = processor,
- successfulCompilation = delegate.status() == Compilation.Status.SUCCESS
+ successfulCompilation = delegate.status() == Compilation.Status.SUCCESS,
+ diagnostics = diagnostics
) {
- override val generatedSources: List<Source> by lazy {
- if (successfulCompilation) {
- delegate.generatedSourceFiles().map(Source::fromJavaFileObject)
- } else {
- // java compile testing does not provide access to generated files when compilation
- // fails
- emptyList()
- }
- }
-
override fun rawOutput(): String {
return delegate.diagnostics().joinToString {
it.toString()
}
}
}
+
@ExperimentalProcessingApi
-internal class KotlinCompileTestingCompilationResult(
+internal class KotlinCompilationResult constructor(
testRunner: CompilationTestRunner,
- @Suppress("unused")
- private val delegate: KotlinCompilation.Result,
processor: SyntheticProcessor,
- successfulCompilation: Boolean,
- outputSourceDirs: List<File>,
- private val rawOutput: String,
+ private val delegate: TestCompilationResult
) : CompilationResult(
testRunnerName = testRunner.name,
processor = processor,
- successfulCompilation = successfulCompilation
+ successfulCompilation = delegate.success,
+ diagnostics = delegate.diagnostics
) {
- override val generatedSources: List<Source> by lazy {
- outputSourceDirs.flatMap { srcRoot ->
- srcRoot.walkTopDown().mapNotNull { sourceFile ->
- when {
- sourceFile.name.endsWith(".java") -> {
- val qName = sourceFile.absolutePath.substringAfter(
- srcRoot.absolutePath
- ).dropWhile { it == '/' }
- .replace('/', '.')
- .dropLast(".java".length)
- Source.loadJavaSource(sourceFile, qName)
- }
- sourceFile.name.endsWith(".kt") -> {
- val relativePath = sourceFile.absolutePath.substringAfter(
- srcRoot.absolutePath
- ).dropWhile { it == '/' }
- Source.loadKotlinSource(sourceFile, relativePath)
- }
- else -> null
- }
- }
+ override val generatedSources: List<Source>
+ get() = delegate.generatedSources
+
+ override fun rawOutput(): String {
+ return delegate.diagnostics.flatMap {
+ it.value
+ }.joinToString {
+ it.toString()
}
}
-
- override fun rawOutput() = rawOutput
-}
+}
\ No newline at end of file
diff --git a/room/room-compiler-processing-testing/src/main/java/androidx/room/compiler/processing/util/DiagnosticMessage.kt b/room/room-compiler-processing-testing/src/main/java/androidx/room/compiler/processing/util/DiagnosticMessage.kt
index da8e542..438396e 100644
--- a/room/room-compiler-processing-testing/src/main/java/androidx/room/compiler/processing/util/DiagnosticMessage.kt
+++ b/room/room-compiler-processing-testing/src/main/java/androidx/room/compiler/processing/util/DiagnosticMessage.kt
@@ -16,16 +16,23 @@
package androidx.room.compiler.processing.util
-import androidx.room.compiler.processing.XAnnotation
-import androidx.room.compiler.processing.XAnnotationValue
-import androidx.room.compiler.processing.XElement
+import javax.tools.Diagnostic
/**
* Holder for diagnostics messages
*/
data class DiagnosticMessage(
+ val kind: Diagnostic.Kind,
val msg: String,
- val element: XElement?,
- val annotation: XAnnotation?,
- val annotationValue: XAnnotationValue?
+ val location: DiagnosticLocation? = null,
+)
+
+/**
+ * Location of a diagnostic message.
+ * Note that, when run with KAPT this location might be on the stubs or may not exactly match the
+ * kotlin source file (KAPT's stub to source mapping is not very fine grained)
+ */
+data class DiagnosticLocation(
+ val source: Source?,
+ val line: Int,
)
\ No newline at end of file
diff --git a/room/room-compiler-processing-testing/src/main/java/androidx/room/compiler/processing/util/DiagnosticMessageSubject.kt b/room/room-compiler-processing-testing/src/main/java/androidx/room/compiler/processing/util/DiagnosticMessageSubject.kt
new file mode 100644
index 0000000..ba817ef
--- /dev/null
+++ b/room/room-compiler-processing-testing/src/main/java/androidx/room/compiler/processing/util/DiagnosticMessageSubject.kt
@@ -0,0 +1,101 @@
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * 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.
+ */
+
+package androidx.room.compiler.processing.util
+
+import com.google.common.truth.Fact.simpleFact
+import com.google.common.truth.FailureMetadata
+import com.google.common.truth.Subject
+import com.google.common.truth.Subject.Factory
+import com.google.common.truth.Truth
+
+/**
+ * Truth subject for diagnostic messages
+ */
+class DiagnosticMessageSubject internal constructor(
+ failureMetadata: FailureMetadata,
+ private val diagnosticMessage: DiagnosticMessage,
+) : Subject<DiagnosticMessageSubject, DiagnosticMessage>(
+ failureMetadata, diagnosticMessage
+) {
+ private val lineContent by lazy {
+ val location = diagnosticMessage.location ?: return@lazy null
+ location.source?.contents?.lines()?.getOrNull(
+ location.line - 1
+ )
+ }
+
+ /**
+ * Checks the location of the diagnostic message against the given [lineNumber].
+ */
+ fun onLine(lineNumber: Int) = apply {
+ if (diagnosticMessage.location?.line != lineNumber) {
+ failWithActual(
+ simpleFact(
+ "expected line $lineNumber but it was ${diagnosticMessage.location}"
+ )
+ )
+ }
+ }
+
+ /**
+ * Checks the contents of the line from the original file against the given [content].
+ */
+ fun onLineContaining(content: String) = apply {
+ if (lineContent == null) {
+ failWithActual(
+ simpleFact("Cannot validate line content due to missing location information")
+ )
+ }
+ if (lineContent?.contains(content) != true) {
+ failWithActual(
+ simpleFact("expected line content with $content but was $lineContent")
+ )
+ }
+ }
+
+ /**
+ * Checks the contents of the source where the diagnostic message was reported on, against
+ * the given [source].
+ */
+ fun onSource(source: Source) = apply {
+ if (diagnosticMessage.location?.source != source) {
+ failWithActual(
+ simpleFact(
+ """
+ Expected diagnostic to be on $source but found it on
+ ${diagnosticMessage.location?.source}
+ """.trimIndent()
+ )
+ )
+ }
+ }
+
+ companion object {
+ private val FACTORY =
+ Factory<DiagnosticMessageSubject, DiagnosticMessage> { metadata, actual ->
+ DiagnosticMessageSubject(metadata, actual)
+ }
+
+ fun assertThat(
+ diagnosticMessage: DiagnosticMessage
+ ): DiagnosticMessageSubject {
+ return Truth.assertAbout(FACTORY).that(
+ diagnosticMessage
+ )
+ }
+ }
+}
\ No newline at end of file
diff --git a/room/room-compiler-processing-testing/src/main/java/androidx/room/compiler/processing/util/KotlinCompilationUtil.kt b/room/room-compiler-processing-testing/src/main/java/androidx/room/compiler/processing/util/KotlinCompilationUtil.kt
deleted file mode 100644
index 6da8f93..0000000
--- a/room/room-compiler-processing-testing/src/main/java/androidx/room/compiler/processing/util/KotlinCompilationUtil.kt
+++ /dev/null
@@ -1,133 +0,0 @@
-/*
- * Copyright 2021 The Android Open Source Project
- *
- * 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.
- */
-
-package androidx.room.compiler.processing.util
-
-import com.tschuchort.compiletesting.KotlinCompilation
-import org.jetbrains.kotlin.config.JvmTarget
-import java.io.File
-import java.io.OutputStream
-import java.net.URLClassLoader
-
-/**
- * Helper class for Kotlin Compile Testing library to have common setup for room.
- */
-internal object KotlinCompilationUtil {
- fun prepareCompilation(
- sources: List<Source>,
- outputStream: OutputStream,
- classpaths: List<File> = emptyList()
- ): KotlinCompilation {
- val compilation = KotlinCompilation()
- val srcRoot = compilation.workingDir.resolve("ksp/srcInput")
- val javaSrcRoot = srcRoot.resolve("java")
- val kotlinSrcRoot = srcRoot.resolve("kotlin")
- compilation.sources = sources.map {
- when (it) {
- is Source.JavaSource -> it.toKotlinSourceFile(javaSrcRoot)
- is Source.KotlinSource -> it.toKotlinSourceFile(kotlinSrcRoot)
- }
- }
- // workaround for https://github.com/tschuchortdev/kotlin-compile-testing/issues/105
- compilation.kotlincArguments += "-Xjava-source-roots=${javaSrcRoot.absolutePath}"
- compilation.jvmDefault = "enable"
- compilation.jvmTarget = JvmTarget.JVM_1_8.description
- compilation.inheritClassPath = false
- compilation.verbose = false
- compilation.classpaths = Classpaths.inheritedClasspath + classpaths
- compilation.messageOutputStream = outputStream
- compilation.kotlinStdLibJar = Classpaths.kotlinStdLibJar
- compilation.kotlinStdLibCommonJar = Classpaths.kotlinStdLibCommonJar
- compilation.kotlinStdLibJdkJar = Classpaths.kotlinStdLibJdkJar
- compilation.kotlinReflectJar = Classpaths.kotlinReflectJar
- compilation.kotlinScriptRuntimeJar = Classpaths.kotlinScriptRuntimeJar
- return compilation
- }
-
- /**
- * Helper object to persist common classpaths resolved by KCT to make sure it does not
- * re-resolve host classpath repeatedly and also runs compilation with a smaller classpath.
- * see: https://github.com/tschuchortdev/kotlin-compile-testing/issues/113
- */
- private object Classpaths {
-
- val inheritedClasspath: List<File>
-
- /**
- * These jars are files that Kotlin Compile Testing discovers from classpath. It uses a
- * rather expensive way of discovering these so we cache them here for now.
- *
- * We can remove this cache once we update to a version that includes the fix in KCT:
- * https://github.com/tschuchortdev/kotlin-compile-testing/pull/114
- */
- val kotlinStdLibJar: File?
- val kotlinStdLibCommonJar: File?
- val kotlinStdLibJdkJar: File?
- val kotlinReflectJar: File?
- val kotlinScriptRuntimeJar: File?
-
- init {
- // create a KotlinCompilation to resolve common jars
- val compilation = KotlinCompilation()
- kotlinStdLibJar = compilation.kotlinStdLibJar
- kotlinStdLibCommonJar = compilation.kotlinStdLibCommonJar
- kotlinStdLibJdkJar = compilation.kotlinStdLibJdkJar
- kotlinReflectJar = compilation.kotlinReflectJar
- kotlinScriptRuntimeJar = compilation.kotlinScriptRuntimeJar
-
- inheritedClasspath = getClasspathFromClassloader(
- KotlinCompilationUtil::class.java.classLoader
- )
- }
- }
-
- // ported from https://github.com/google/compile-testing/blob/master/src/main/java/com
- // /google/testing/compile/Compiler.java#L231
- private fun getClasspathFromClassloader(referenceClassLoader: ClassLoader): List<File> {
- val platformClassLoader: ClassLoader = ClassLoader.getPlatformClassLoader()
- var currentClassloader = referenceClassLoader
- val systemClassLoader = ClassLoader.getSystemClassLoader()
-
- // Concatenate search paths from all classloaders in the hierarchy
- // 'till the system classloader.
- val classpaths: MutableSet<String> = LinkedHashSet()
- while (true) {
- if (currentClassloader === systemClassLoader) {
- classpaths.addAll(getSystemClasspaths())
- break
- }
- if (currentClassloader === platformClassLoader) {
- break
- }
- check(currentClassloader is URLClassLoader) {
- """Classpath for compilation could not be extracted
- since $currentClassloader is not an instance of URLClassloader
- """.trimIndent()
- }
- // We only know how to extract classpaths from URLClassloaders.
- currentClassloader.urLs.forEach { url ->
- check(url.protocol == "file") {
- """Given classloader consists of classpaths which are unsupported for
- compilation.
- """.trimIndent()
- }
- classpaths.add(url.path)
- }
- currentClassloader = currentClassloader.parent
- }
- return classpaths.map { File(it) }.filter { it.exists() }
- }
-}
diff --git a/room/room-compiler-processing-testing/src/main/java/androidx/room/compiler/processing/util/ProcessorTestExt.kt b/room/room-compiler-processing-testing/src/main/java/androidx/room/compiler/processing/util/ProcessorTestExt.kt
index 6b53b5c..c02ec44 100644
--- a/room/room-compiler-processing-testing/src/main/java/androidx/room/compiler/processing/util/ProcessorTestExt.kt
+++ b/room/room-compiler-processing-testing/src/main/java/androidx/room/compiler/processing/util/ProcessorTestExt.kt
@@ -19,18 +19,17 @@
import androidx.room.compiler.processing.ExperimentalProcessingApi
import androidx.room.compiler.processing.XProcessingStep
import androidx.room.compiler.processing.XTypeElement
+import androidx.room.compiler.processing.util.compiler.TestCompilationArguments
+import androidx.room.compiler.processing.util.compiler.compile
import androidx.room.compiler.processing.util.runner.CompilationTestRunner
import androidx.room.compiler.processing.util.runner.JavacCompilationTestRunner
import androidx.room.compiler.processing.util.runner.KaptCompilationTestRunner
import androidx.room.compiler.processing.util.runner.KspCompilationTestRunner
import androidx.room.compiler.processing.util.runner.TestCompilationParameters
+import com.google.common.io.Files
import com.google.common.truth.Truth.assertThat
import com.google.common.truth.Truth.assertWithMessage
import com.google.devtools.ksp.processing.SymbolProcessorProvider
-import com.tschuchort.compiletesting.KotlinCompilation
-import com.tschuchort.compiletesting.kspArgs
-import com.tschuchort.compiletesting.symbolProcessorProviders
-import java.io.ByteArrayOutputStream
import java.io.File
import javax.annotation.processing.Processor
@@ -41,21 +40,23 @@
) {
val runCount = runners.count { runner ->
if (runner.canRun(params)) {
- val compilationResult = runner.compile(params)
- val subject = CompilationResultSubject.assertThat(compilationResult)
- // if any assertion failed, throw first those.
- subject.assertNoProcessorAssertionErrors()
- compilationResult.processor.invocationInstances.forEach {
- it.runPostCompilationChecks(subject)
- }
- assertWithMessage(
- "compilation should've run the processor callback at least once"
- ).that(
- compilationResult.processor.invocationInstances
- ).isNotEmpty()
+ withTempDir { tmpDir ->
+ val compilationResult = runner.compile(tmpDir, params)
+ val subject = CompilationResultSubject.assertThat(compilationResult)
+ // if any assertion failed, throw first those.
+ subject.assertNoProcessorAssertionErrors()
+ compilationResult.processor.invocationInstances.forEach {
+ it.runPostCompilationChecks(subject)
+ }
+ assertWithMessage(
+ "compilation should've run the processor callback at least once"
+ ).that(
+ compilationResult.processor.invocationInstances
+ ).isNotEmpty()
- subject.assertCompilationResult()
- subject.assertAllExpectedRoundsAreCompleted()
+ subject.assertCompilationResult()
+ subject.assertAllExpectedRoundsAreCompleted()
+ }
true
} else {
false
@@ -88,7 +89,7 @@
sources = sources,
classpath = classpath,
options = options,
- handlers = listOf(handler)
+ handlers = listOf(handler),
),
JavacCompilationTestRunner,
KaptCompilationTestRunner
@@ -323,23 +324,34 @@
symbolProcessorProviders: List<SymbolProcessorProvider> = emptyList(),
javacArguments: List<String> = emptyList()
): List<File> {
- val outputStream = ByteArrayOutputStream()
- val compilation = KotlinCompilationUtil.prepareCompilation(
- sources = sources,
- outputStream = outputStream
+ val workingDir = Files.createTempDir()
+ val result = compile(
+ workingDir = workingDir,
+ arguments = TestCompilationArguments(
+ sources = sources,
+ kaptProcessors = annotationProcessors,
+ symbolProcessorProviders = symbolProcessorProviders,
+ processorOptions = options,
+ javacArguments = javacArguments
+ )
)
- if (annotationProcessors.isNotEmpty()) {
- compilation.kaptArgs.putAll(options)
- }
- if (symbolProcessorProviders.isNotEmpty()) {
- compilation.kspArgs.putAll(options)
- }
- compilation.javacArguments.addAll(javacArguments)
- compilation.annotationProcessors = annotationProcessors
- compilation.symbolProcessorProviders = symbolProcessorProviders
- val result = compilation.compile()
- check(result.exitCode == KotlinCompilation.ExitCode.OK) {
- "compilation failed: ${outputStream.toString(Charsets.UTF_8)}"
- }
- return listOf(compilation.classesDir) + compilation.classpaths
+ assertThat(result.success).isTrue()
+ return result.outputClasspath + getSystemClasspathFiles()
}
+
+/**
+ * Runs a block in a temporary directory and cleans it up afterwards.
+ *
+ * This method intentionally returns Unit to make it harder to return something that might
+ * reference the temporary directory.
+ */
+private inline fun withTempDir(
+ block: (tmpDir: File) -> Unit
+) {
+ val tmpDir = Files.createTempDir()
+ try {
+ return block(tmpDir)
+ } finally {
+ tmpDir.deleteRecursively()
+ }
+}
\ No newline at end of file
diff --git a/room/room-compiler-processing-testing/src/main/java/androidx/room/compiler/processing/util/RecordingXMessager.kt b/room/room-compiler-processing-testing/src/main/java/androidx/room/compiler/processing/util/RecordingXMessager.kt
deleted file mode 100644
index ed481d6..0000000
--- a/room/room-compiler-processing-testing/src/main/java/androidx/room/compiler/processing/util/RecordingXMessager.kt
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright 2020 The Android Open Source Project
- *
- * 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.
- */
-
-package androidx.room.compiler.processing.util
-
-import androidx.room.compiler.processing.XAnnotation
-import androidx.room.compiler.processing.XAnnotationValue
-import androidx.room.compiler.processing.XElement
-import androidx.room.compiler.processing.XMessager
-import javax.tools.Diagnostic
-
-/**
- * An XMessager implementation that holds onto dispatched diagnostics.
- */
-class RecordingXMessager : XMessager() {
- private val diagnostics = mutableMapOf<Diagnostic.Kind, MutableList<DiagnosticMessage>>()
-
- fun diagnostics(): Map<Diagnostic.Kind, List<DiagnosticMessage>> = diagnostics
-
- override fun onPrintMessage(
- kind: Diagnostic.Kind,
- msg: String,
- element: XElement?,
- annotation: XAnnotation?,
- annotationValue: XAnnotationValue?
- ) {
- diagnostics.getOrPut(
- kind
- ) {
- mutableListOf()
- }.add(
- DiagnosticMessage(
- msg = msg,
- element = element,
- annotation = annotation,
- annotationValue = annotationValue
- )
- )
- }
-}
\ No newline at end of file
diff --git a/room/room-compiler-processing-testing/src/main/java/androidx/room/compiler/processing/util/Source.kt b/room/room-compiler-processing-testing/src/main/java/androidx/room/compiler/processing/util/Source.kt
index 1f28f13..b800570 100644
--- a/room/room-compiler-processing-testing/src/main/java/androidx/room/compiler/processing/util/Source.kt
+++ b/room/room-compiler-processing-testing/src/main/java/androidx/room/compiler/processing/util/Source.kt
@@ -17,7 +17,6 @@
package androidx.room.compiler.processing.util
import com.google.testing.compile.JavaFileObjects
-import com.tschuchort.compiletesting.SourceFile
import org.intellij.lang.annotations.Language
import java.io.File
import javax.tools.JavaFileObject
@@ -29,12 +28,27 @@
abstract val relativePath: String
abstract val contents: String
abstract fun toJFO(): JavaFileObject
- abstract fun toKotlinSourceFile(srcRoot: File): SourceFile
override fun toString(): String {
return "SourceFile[$relativePath]"
}
+ override fun equals(other: Any?): Boolean {
+ if (this === other) return true
+ if (other !is Source) return false
+
+ if (relativePath != other.relativePath) return false
+ if (contents != other.contents) return false
+
+ return true
+ }
+
+ override fun hashCode(): Int {
+ var result = relativePath.hashCode()
+ result = 31 * result + contents.hashCode()
+ return result
+ }
+
class JavaSource(
val qName: String,
override val contents: String
@@ -46,15 +60,6 @@
)
}
- override fun toKotlinSourceFile(srcRoot: File): SourceFile {
- val outFile = srcRoot.resolve(relativePath)
- .also {
- it.parentFile.mkdirs()
- it.writeText(contents)
- }
- return SourceFile.fromPath(outFile)
- }
-
override val relativePath
get() = qName.replace(".", "/") + ".java"
}
@@ -66,16 +71,6 @@
override fun toJFO(): JavaFileObject {
throw IllegalStateException("cannot include kotlin code in javac compilation")
}
-
- override fun toKotlinSourceFile(srcRoot: File): SourceFile {
- val outFile = srcRoot.resolve(relativePath).also {
- it.parentFile.mkdirs()
- it.writeText(contents)
- }
- return SourceFile.fromPath(
- outFile
- )
- }
}
companion object {
@@ -147,7 +142,7 @@
relativePath: String
): Source {
check(file.exists()) {
- "file does not exist: ${file.absolutePath}"
+ "file does not exist: ${file.canonicalPath}"
}
return when {
file.name.endsWith(".kt") -> loadKotlinSource(file, relativePath)
diff --git a/room/room-compiler-processing-testing/src/main/java/androidx/room/compiler/processing/util/TestUilts.kt b/room/room-compiler-processing-testing/src/main/java/androidx/room/compiler/processing/util/TestUilts.kt
index bf96270..e912ce9 100644
--- a/room/room-compiler-processing-testing/src/main/java/androidx/room/compiler/processing/util/TestUilts.kt
+++ b/room/room-compiler-processing-testing/src/main/java/androidx/room/compiler/processing/util/TestUilts.kt
@@ -17,6 +17,9 @@
package androidx.room.compiler.processing.util
import java.io.File
+import java.util.Locale
+import javax.tools.Diagnostic
+import javax.tools.JavaFileObject
/**
* Returns the list of File's in the system classpath
@@ -35,4 +38,30 @@
fun getSystemClasspaths(): Set<String> {
val pathSeparator = System.getProperty("path.separator")!!
return System.getProperty("java.class.path")!!.split(pathSeparator).toSet()
+}
+
+/**
+ * Converts java compilation diagnostic messages into [DiagnosticMessage] objects.
+ */
+internal fun List<Diagnostic<out JavaFileObject>>.toDiagnosticMessages(
+ javaSources: Map<JavaFileObject, Source>
+): List<DiagnosticMessage> {
+ return this.map { diagnostic ->
+ val source = diagnostic.source?.let {
+ javaSources[it]
+ }
+ val location = if (source == null) {
+ null
+ } else {
+ DiagnosticLocation(
+ source = source,
+ line = diagnostic.lineNumber.toInt(),
+ )
+ }
+ DiagnosticMessage(
+ kind = diagnostic.kind,
+ msg = diagnostic.getMessage(Locale.US),
+ location = location,
+ )
+ }
}
\ No newline at end of file
diff --git a/room/room-compiler-processing-testing/src/main/java/androidx/room/compiler/processing/util/compiler/DelegatingTestRegistrar.kt b/room/room-compiler-processing-testing/src/main/java/androidx/room/compiler/processing/util/compiler/DelegatingTestRegistrar.kt
new file mode 100644
index 0000000..ae10928
--- /dev/null
+++ b/room/room-compiler-processing-testing/src/main/java/androidx/room/compiler/processing/util/compiler/DelegatingTestRegistrar.kt
@@ -0,0 +1,103 @@
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * 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.
+ */
+
+package androidx.room.compiler.processing.util.compiler
+
+import androidx.room.compiler.processing.util.compiler.DelegatingTestRegistrar.Companion.runCompilation
+import org.jetbrains.kotlin.cli.common.ExitCode
+import org.jetbrains.kotlin.cli.common.arguments.K2JVMCompilerArguments
+import org.jetbrains.kotlin.cli.common.messages.MessageCollector
+import org.jetbrains.kotlin.cli.jvm.K2JVMCompiler
+import org.jetbrains.kotlin.cli.jvm.plugins.ServiceLoaderLite
+import org.jetbrains.kotlin.com.intellij.mock.MockProject
+import org.jetbrains.kotlin.compiler.plugin.ComponentRegistrar
+import org.jetbrains.kotlin.config.CompilerConfiguration
+import org.jetbrains.kotlin.config.Services
+import java.net.URI
+import java.nio.file.Paths
+
+/**
+ * A component registrar for Kotlin Compiler that delegates to a list of thread local delegates.
+ *
+ * see [runCompilation] for usages.
+ */
+internal class DelegatingTestRegistrar : ComponentRegistrar {
+ override fun registerProjectComponents(
+ project: MockProject,
+ configuration: CompilerConfiguration
+ ) {
+ delegates.get()?.let {
+ it.forEach {
+ it.registerProjectComponents(project, configuration)
+ }
+ }
+ }
+
+ companion object {
+ private const val REGISTRAR_CLASSPATH =
+ "META-INF/services/org.jetbrains.kotlin.compiler.plugin.ComponentRegistrar"
+
+ private val resourcePathForSelfClassLoader by lazy {
+ this::class.java.classLoader.getResources(REGISTRAR_CLASSPATH)
+ .asSequence()
+ .mapNotNull { url ->
+ val uri = URI.create(url.toString().removeSuffix("/$REGISTRAR_CLASSPATH"))
+ when (uri.scheme) {
+ "jar" -> Paths.get(URI.create(uri.schemeSpecificPart.removeSuffix("!")))
+ "file" -> Paths.get(uri)
+ else -> return@mapNotNull null
+ }.toAbsolutePath()
+ }
+ .find { resourcesPath ->
+ ServiceLoaderLite.findImplementations(
+ ComponentRegistrar::class.java,
+ listOf(resourcesPath.toFile())
+ ).any { implementation ->
+ implementation == DelegatingTestRegistrar::class.java.name
+ }
+ }?.toString()
+ ?: throw AssertionError(
+ """
+ Could not find the ComponentRegistrar class loader that should load
+ ${DelegatingTestRegistrar::class.qualifiedName}
+ """.trimIndent()
+ )
+ }
+ private val delegates = ThreadLocal<List<ComponentRegistrar>>()
+ fun runCompilation(
+ compiler: K2JVMCompiler,
+ messageCollector: MessageCollector,
+ arguments: K2JVMCompilerArguments,
+ pluginRegistrars: List<ComponentRegistrar>
+ ): ExitCode {
+ try {
+ arguments.addDelegatingTestRegistrar()
+ delegates.set(pluginRegistrars)
+ return compiler.exec(
+ messageCollector = messageCollector,
+ services = Services.EMPTY,
+ arguments = arguments
+ )
+ } finally {
+ delegates.remove()
+ }
+ }
+
+ private fun K2JVMCompilerArguments.addDelegatingTestRegistrar() {
+ pluginClasspaths = (pluginClasspaths ?: arrayOf()) + resourcePathForSelfClassLoader
+ }
+ }
+}
\ No newline at end of file
diff --git a/room/room-compiler-processing-testing/src/main/java/androidx/room/compiler/processing/util/compiler/DiagnosticsMessageCollector.kt b/room/room-compiler-processing-testing/src/main/java/androidx/room/compiler/processing/util/compiler/DiagnosticsMessageCollector.kt
new file mode 100644
index 0000000..e991f25
--- /dev/null
+++ b/room/room-compiler-processing-testing/src/main/java/androidx/room/compiler/processing/util/compiler/DiagnosticsMessageCollector.kt
@@ -0,0 +1,147 @@
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * 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.
+ */
+
+package androidx.room.compiler.processing.util.compiler
+
+import androidx.room.compiler.processing.util.compiler.steps.RawDiagnosticMessage
+import org.jetbrains.kotlin.cli.common.messages.CompilerMessageSeverity
+import org.jetbrains.kotlin.cli.common.messages.CompilerMessageSourceLocation
+import org.jetbrains.kotlin.cli.common.messages.MessageCollector
+import javax.tools.Diagnostic
+
+/**
+ * Custom message collector for Kotlin compilation that collects messages into
+ * [RawDiagnosticMessage] objects.
+ *
+ * Neither KAPT nor KSP report location in the `location` parameter of the callback, instead,
+ * they embed location into the messages. This collector parses these messages to recover the
+ * location.
+ */
+internal class DiagnosticsMessageCollector : MessageCollector {
+ private val diagnostics = mutableListOf<RawDiagnosticMessage>()
+
+ fun getDiagnostics(): List<RawDiagnosticMessage> = diagnostics
+
+ override fun clear() {
+ diagnostics.clear()
+ }
+
+ override fun hasErrors(): Boolean {
+ return diagnostics.any {
+ it.kind == Diagnostic.Kind.ERROR
+ }
+ }
+
+ override fun report(
+ severity: CompilerMessageSeverity,
+ message: String,
+ location: CompilerMessageSourceLocation?
+ ) {
+ // Both KSP and KAPT reports null location but instead put the location into the message.
+ // We parse it back here to recover the location.
+ val (strippedMessage, rawLocation) = if (location == null) {
+ message.parseLocation() ?: message.stripPrefixes() to null
+ } else {
+ message.stripPrefixes() to location.toRawLocation()
+ }
+ diagnostics.add(
+ RawDiagnosticMessage(
+ kind = severity.kind,
+ message = strippedMessage,
+ location = rawLocation
+ )
+ )
+ }
+
+ /**
+ * Parses the location out of a diagnostic message.
+ *
+ * Note that this is tailor made for KSP and KAPT where the location is reported in the first
+ * line of the message.
+ *
+ * If location is found, this method will return the location along with the message without
+ * location. Otherwise, it will return `null`.
+ */
+ private fun String.parseLocation(): Pair<String, RawDiagnosticMessage.Location>? {
+ val firstLine = lineSequence().firstOrNull() ?: return null
+ val match =
+ KSP_LOCATION_REGEX.find(firstLine) ?: KAPT_LOCATION_AND_KIND_REGEX.find(firstLine)
+ ?: return null
+ if (match.groups.size != 4) return null
+ return substring(match.range.last + 1) to RawDiagnosticMessage.Location(
+ path = match.groupValues[1],
+ line = match.groupValues[3].toInt(),
+ )
+ }
+
+ /**
+ * Removes prefixes added by kapt / ksp from the message
+ */
+ private fun String.stripPrefixes(): String {
+ return stripKind().stripKspPrefix()
+ }
+
+ /**
+ * KAPT prepends the message kind to the message, we'll remove it here.
+ */
+ private fun String.stripKind(): String {
+ val firstLine = lineSequence().firstOrNull() ?: return this
+ val match = KIND_REGEX.find(firstLine) ?: return this
+ return substring(match.range.last + 1)
+ }
+
+ /**
+ * KSP prepends ksp to each message, we'll strip it here.
+ */
+ private fun String.stripKspPrefix(): String {
+ val firstLine = lineSequence().firstOrNull() ?: return this
+ val match = KSP_PREFIX_REGEX.find(firstLine) ?: return this
+ return substring(match.range.last + 1)
+ }
+
+ private fun CompilerMessageSourceLocation.toRawLocation(): RawDiagnosticMessage.Location {
+ return RawDiagnosticMessage.Location(
+ line = this.line,
+ path = this.path
+ )
+ }
+
+ private val CompilerMessageSeverity.kind
+ get() = when (this) {
+ CompilerMessageSeverity.ERROR,
+ CompilerMessageSeverity.EXCEPTION -> Diagnostic.Kind.ERROR
+ CompilerMessageSeverity.INFO,
+ CompilerMessageSeverity.LOGGING -> Diagnostic.Kind.NOTE
+ CompilerMessageSeverity.WARNING,
+ CompilerMessageSeverity.STRONG_WARNING -> Diagnostic.Kind.WARNING
+ else -> Diagnostic.Kind.OTHER
+ }
+
+ companion object {
+ // example: foo/bar/Subject.kt:2: warning: the real message
+ private val KAPT_LOCATION_AND_KIND_REGEX = """^(.*\.(kt|java)):(\d+): \w+: """.toRegex()
+ // example: [ksp] /foo/bar/Subject.kt:3: the real message
+ private val KSP_LOCATION_REGEX = """^\[ksp] (.*\.(kt|java)):(\d+): """.toRegex()
+
+ // detect things like "Note: " to be stripped from the message.
+ // We could limit this to known diagnostic kinds (instead of matching \w:) but it is always
+ // added so not really necessary until we hit a parser bug :)
+ // example: "error: the real message"
+ private val KIND_REGEX = """^\w+: """.toRegex()
+ // example: "[ksp] the real message"
+ private val KSP_PREFIX_REGEX = """^\[ksp] """.toRegex()
+ }
+}
\ No newline at end of file
diff --git a/room/room-compiler-processing-testing/src/main/java/androidx/room/compiler/processing/util/compiler/KotlinCliRunner.kt b/room/room-compiler-processing-testing/src/main/java/androidx/room/compiler/processing/util/compiler/KotlinCliRunner.kt
new file mode 100644
index 0000000..1343fc0
--- /dev/null
+++ b/room/room-compiler-processing-testing/src/main/java/androidx/room/compiler/processing/util/compiler/KotlinCliRunner.kt
@@ -0,0 +1,171 @@
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * 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.
+ */
+
+package androidx.room.compiler.processing.util.compiler
+
+import androidx.room.compiler.processing.util.compiler.steps.CompilationStepArguments
+import androidx.room.compiler.processing.util.compiler.steps.RawDiagnosticMessage
+import androidx.room.compiler.processing.util.getSystemClasspaths
+import org.jetbrains.kotlin.cli.common.ExitCode
+import org.jetbrains.kotlin.cli.common.arguments.K2JVMCompilerArguments
+import org.jetbrains.kotlin.cli.jvm.K2JVMCompiler
+import org.jetbrains.kotlin.compiler.plugin.ComponentRegistrar
+import org.jetbrains.kotlin.config.JvmDefaultMode
+import org.jetbrains.kotlin.config.JvmTarget
+import java.io.File
+import java.net.URLClassLoader
+
+/**
+ * Utility object to run kotlin compiler via its CLI API.
+ */
+internal object KotlinCliRunner {
+ private val compiler = K2JVMCompiler()
+ private fun List<SourceSet>.existingRootPaths() = this.asSequence()
+ .map { it.root }
+ .filter { it.exists() }
+ .map { it.canonicalPath }
+ .distinct()
+
+ private fun CompilationStepArguments.copyToCliArguments(cliArguments: K2JVMCompilerArguments) {
+ // stdlib is in the classpath so no need to specify it here.
+ cliArguments.noStdlib = true
+ cliArguments.noReflect = true
+ cliArguments.jvmTarget = JvmTarget.JVM_1_8.description
+ cliArguments.noOptimize = true
+ // useJavac & compileJava are experimental so lets not use it for now.
+ cliArguments.useJavac = false
+ cliArguments.compileJava = false
+ cliArguments.jvmDefault = JvmDefaultMode.ENABLE.description
+ cliArguments.allowNoSourceFiles = true
+ cliArguments.javacArguments = javacArguments.toTypedArray()
+ val inherited = if (inheritClasspaths) {
+ inheritedClasspath
+ } else {
+ emptyList()
+ }
+ cliArguments.classpath = (additionalClasspaths + inherited)
+ .filter { it.exists() }
+ .distinct()
+ .joinToString(
+ separator = File.pathSeparator
+ ) {
+ it.canonicalPath
+ }
+ cliArguments.javaSourceRoots = this.sourceSets.filter {
+ it.hasJavaSource
+ }.existingRootPaths()
+ .toList()
+ .toTypedArray()
+ cliArguments.freeArgs += this.sourceSets.filter {
+ it.hasKotlinSource
+ }.existingRootPaths()
+ }
+
+ /**
+ * Runs the kotlin cli API with the given arguments.
+ */
+ fun runKotlinCli(
+ /**
+ * Compilation arguments (sources, classpaths etc)
+ */
+ arguments: CompilationStepArguments,
+ /**
+ * Destination directory where generated class files will be written to
+ */
+ destinationDir: File,
+ /**
+ * List of component registrars for the compilation.
+ */
+ pluginRegistrars: List<ComponentRegistrar>
+ ): KotlinCliResult {
+ val cliArguments = compiler.createArguments()
+ destinationDir.mkdirs()
+ cliArguments.destination = destinationDir.absolutePath
+ arguments.copyToCliArguments(cliArguments)
+
+ val diagnosticsMessageCollector = DiagnosticsMessageCollector()
+ val exitCode = DelegatingTestRegistrar.runCompilation(
+ compiler = compiler,
+ messageCollector = diagnosticsMessageCollector,
+ arguments = cliArguments,
+ pluginRegistrars = pluginRegistrars
+ )
+ return KotlinCliResult(
+ exitCode = exitCode,
+ diagnostics = diagnosticsMessageCollector.getDiagnostics(),
+ compiledClasspath = destinationDir
+ )
+ }
+
+ /**
+ * Result of a kotlin compilation request
+ */
+ internal class KotlinCliResult(
+ /**
+ * The exit code reported by the compiler
+ */
+ val exitCode: ExitCode,
+ /**
+ * List of diagnostic messages reported by the compiler
+ */
+ val diagnostics: List<RawDiagnosticMessage>,
+ /**
+ * The output classpath for the compiled files.
+ */
+ val compiledClasspath: File
+ )
+
+ private val inheritedClasspath by lazy(LazyThreadSafetyMode.NONE) {
+ getClasspathFromClassloader(KotlinCliRunner::class.java.classLoader)
+ }
+
+ // ported from https://github.com/google/compile-testing/blob/master/src/main/java/com
+ // /google/testing/compile/Compiler.java#L231
+ private fun getClasspathFromClassloader(referenceClassLoader: ClassLoader): List<File> {
+ val platformClassLoader: ClassLoader = ClassLoader.getPlatformClassLoader()
+ var currentClassloader = referenceClassLoader
+ val systemClassLoader = ClassLoader.getSystemClassLoader()
+
+ // Concatenate search paths from all classloaders in the hierarchy
+ // 'till the system classloader.
+ val classpaths: MutableSet<String> = LinkedHashSet()
+ while (true) {
+ if (currentClassloader === systemClassLoader) {
+ classpaths.addAll(getSystemClasspaths())
+ break
+ }
+ if (currentClassloader === platformClassLoader) {
+ break
+ }
+ check(currentClassloader is URLClassLoader) {
+ """Classpath for compilation could not be extracted
+ since $currentClassloader is not an instance of URLClassloader
+ """.trimIndent()
+ }
+ // We only know how to extract classpaths from URLClassloaders.
+ currentClassloader.urLs.forEach { url ->
+ check(url.protocol == "file") {
+ """Given classloader consists of classpaths which are unsupported for
+ compilation.
+ """.trimIndent()
+ }
+ classpaths.add(url.path)
+ }
+ currentClassloader = currentClassloader.parent
+ }
+ return classpaths.map { File(it) }.filter { it.exists() }
+ }
+}
\ No newline at end of file
diff --git a/room/room-compiler-processing-testing/src/main/java/androidx/room/compiler/processing/util/compiler/SourceSet.kt b/room/room-compiler-processing-testing/src/main/java/androidx/room/compiler/processing/util/compiler/SourceSet.kt
new file mode 100644
index 0000000..f83b60c
--- /dev/null
+++ b/room/room-compiler-processing-testing/src/main/java/androidx/room/compiler/processing/util/compiler/SourceSet.kt
@@ -0,0 +1,119 @@
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * 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.
+ */
+
+package androidx.room.compiler.processing.util.compiler
+
+import androidx.room.compiler.processing.util.Source
+import java.io.File
+
+/**
+ * Represents sources that are positioned in the [root] folder.
+ * see: [fromExistingFiles]
+ */
+internal class SourceSet(
+ /**
+ * The root source folder for the given sources
+ */
+ root: File,
+ /**
+ * List of actual sources in the folder
+ */
+ val sources: List<Source>
+) {
+ // always use canonical files
+ val root = root.canonicalFile
+
+ init {
+ check(root.isDirectory) {
+ "$root must be a directory"
+ }
+ }
+
+ val hasJavaSource by lazy {
+ javaSources.isNotEmpty()
+ }
+
+ val hasKotlinSource by lazy {
+ kotlinSources.isNotEmpty()
+ }
+
+ val javaSources by lazy {
+ sources.filterIsInstance<Source.JavaSource>()
+ }
+
+ val kotlinSources by lazy {
+ sources.filterIsInstance<Source.KotlinSource>()
+ }
+
+ /**
+ * Finds the source file matching the given relative path (from root)
+ */
+ fun findSourceFile(
+ path: String
+ ): Source? {
+ val file = File(path).canonicalFile
+ if (!file.path.startsWith(root.path)) {
+ return null
+ }
+ val relativePath = path.substringAfter(root.canonicalPath + "/")
+ return sources.firstOrNull {
+ it.relativePath == relativePath
+ }
+ }
+
+ companion object {
+ /**
+ * Creates a new SourceSet from the given files.
+ */
+ fun fromExistingFiles(
+ root: File
+ ) = SourceSet(
+ root = root,
+ sources = root.collectSources().toList()
+ )
+ }
+}
+
+/**
+ * Collects all java/kotlin sources in a given directory.
+ * Note that the package name for java sources are inherited from the given relative path.
+ */
+private fun File.collectSources(): Sequence<Source> {
+ val root = this
+ return walkTopDown().mapNotNull { file ->
+ when (file.extension) {
+ "java" -> Source.loadJavaSource(
+ file = file,
+ qName = file.relativeTo(root).path
+ .replace('/', '.')
+ .substringBeforeLast('.') // drop .java
+ )
+ "kt" -> Source.loadKotlinSource(
+ file = file,
+ relativePath = file.relativeTo(root).path
+ )
+ else -> null
+ }
+ }
+}
+/**
+ * Converts the file to a [SourceSet] if and only if it is a directory.
+ */
+internal fun File.toSourceSet() = if (isDirectory) {
+ SourceSet.fromExistingFiles(this)
+} else {
+ null
+}
\ No newline at end of file
diff --git a/room/room-compiler-processing-testing/src/main/java/androidx/room/compiler/processing/util/compiler/TestKapt3Registrar.kt b/room/room-compiler-processing-testing/src/main/java/androidx/room/compiler/processing/util/compiler/TestKapt3Registrar.kt
new file mode 100644
index 0000000..d794e56
--- /dev/null
+++ b/room/room-compiler-processing-testing/src/main/java/androidx/room/compiler/processing/util/compiler/TestKapt3Registrar.kt
@@ -0,0 +1,127 @@
+/*
+ * Copyright 2010-2016 JetBrains s.r.o.
+ * Copyright 2021 The Android Open Source Project
+ *
+ * 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.
+ */
+
+package androidx.room.compiler.processing.util.compiler
+
+import org.jetbrains.kotlin.base.kapt3.KaptFlag
+import org.jetbrains.kotlin.base.kapt3.KaptOptions
+import org.jetbrains.kotlin.base.kapt3.logString
+import org.jetbrains.kotlin.cli.common.CLIConfigurationKeys
+import org.jetbrains.kotlin.cli.common.messages.MessageCollector
+import org.jetbrains.kotlin.cli.jvm.config.JavaSourceRoot
+import org.jetbrains.kotlin.cli.jvm.config.JvmClasspathRoot
+import org.jetbrains.kotlin.com.intellij.mock.MockProject
+import org.jetbrains.kotlin.compiler.plugin.ComponentRegistrar
+import org.jetbrains.kotlin.config.CompilerConfiguration
+import org.jetbrains.kotlin.config.JVMConfigurationKeys
+import org.jetbrains.kotlin.container.StorageComponentContainer
+import org.jetbrains.kotlin.container.useInstance
+import org.jetbrains.kotlin.descriptors.ModuleDescriptor
+import org.jetbrains.kotlin.extensions.StorageComponentContainerContributor
+import org.jetbrains.kotlin.kapt3.AbstractKapt3Extension
+import org.jetbrains.kotlin.kapt3.KaptAnonymousTypeTransformer
+import org.jetbrains.kotlin.kapt3.base.LoadedProcessors
+import org.jetbrains.kotlin.kapt3.base.incremental.DeclaredProcType
+import org.jetbrains.kotlin.kapt3.base.incremental.IncrementalProcessor
+import org.jetbrains.kotlin.kapt3.util.MessageCollectorBackedKaptLogger
+import org.jetbrains.kotlin.platform.TargetPlatform
+import org.jetbrains.kotlin.platform.jvm.isJvm
+import org.jetbrains.kotlin.resolve.jvm.extensions.AnalysisHandlerExtension
+import org.jetbrains.kotlin.resolve.jvm.extensions.PartialAnalysisHandlerExtension
+import java.io.File
+import javax.annotation.processing.Processor
+
+/**
+ * Registers the KAPT component for the kotlin compilation.
+ *
+ * mostly taken from
+ * https://github.com/JetBrains/kotlin/blob/master/plugins/kapt3/kapt3-compiler/src/
+ * org/jetbrains/kotlin/kapt3/Kapt3Plugin.kt
+ */
+internal class TestKapt3Registrar(
+ val processors: List<Processor>,
+ val baseOptions: KaptOptions.Builder,
+ val messageCollector: MessageCollector
+) : ComponentRegistrar {
+ override fun registerProjectComponents(
+ project: MockProject,
+ configuration: CompilerConfiguration
+ ) {
+ val contentRoots = configuration[CLIConfigurationKeys.CONTENT_ROOTS] ?: emptyList()
+
+ val optionsBuilder = baseOptions.apply {
+ projectBaseDir = project.basePath?.let(::File)
+ compileClasspath.addAll(
+ contentRoots.filterIsInstance<JvmClasspathRoot>().map { it.file }
+ )
+ javaSourceRoots.addAll(contentRoots.filterIsInstance<JavaSourceRoot>().map { it.file })
+ classesOutputDir =
+ classesOutputDir ?: configuration.get(JVMConfigurationKeys.OUTPUT_DIRECTORY)
+ }
+
+ val logger = MessageCollectorBackedKaptLogger(
+ isVerbose = optionsBuilder.flags.contains(KaptFlag.VERBOSE),
+ isInfoAsWarnings = optionsBuilder.flags.contains(KaptFlag.INFO_AS_WARNINGS),
+ messageCollector = messageCollector
+ )
+
+ val options = optionsBuilder.build()
+
+ options.sourcesOutputDir.mkdirs()
+
+ if (options[KaptFlag.VERBOSE]) {
+ logger.info(options.logString())
+ }
+
+ val kapt3AnalysisCompletedHandlerExtension = object : AbstractKapt3Extension(
+ options = options,
+ logger = logger,
+ compilerConfiguration = configuration
+ ) {
+ override fun loadProcessors(): LoadedProcessors {
+ return LoadedProcessors(
+ processors = processors.map {
+ IncrementalProcessor(
+ processor = it,
+ kind = DeclaredProcType.NON_INCREMENTAL,
+ logger = logger
+ )
+ },
+ classLoader = TestKapt3Registrar::class.java.classLoader
+ )
+ }
+ }
+
+ AnalysisHandlerExtension.registerExtension(project, kapt3AnalysisCompletedHandlerExtension)
+ StorageComponentContainerContributor.registerExtension(
+ project,
+ KaptComponentContributor(kapt3AnalysisCompletedHandlerExtension)
+ )
+ }
+
+ class KaptComponentContributor(private val analysisExtension: PartialAnalysisHandlerExtension) :
+ StorageComponentContainerContributor {
+ override fun registerModuleComponents(
+ container: StorageComponentContainer,
+ platform: TargetPlatform,
+ moduleDescriptor: ModuleDescriptor
+ ) {
+ if (!platform.isJvm()) return
+ container.useInstance(KaptAnonymousTypeTransformer(analysisExtension))
+ }
+ }
+}
\ No newline at end of file
diff --git a/room/room-compiler-processing-testing/src/main/java/androidx/room/compiler/processing/util/compiler/TestKotlinCompiler.kt b/room/room-compiler-processing-testing/src/main/java/androidx/room/compiler/processing/util/compiler/TestKotlinCompiler.kt
new file mode 100644
index 0000000..2c72b64
--- /dev/null
+++ b/room/room-compiler-processing-testing/src/main/java/androidx/room/compiler/processing/util/compiler/TestKotlinCompiler.kt
@@ -0,0 +1,229 @@
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * 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.
+ */
+
+package androidx.room.compiler.processing.util.compiler
+
+import androidx.room.compiler.processing.util.DiagnosticMessage
+import androidx.room.compiler.processing.util.Source
+import androidx.room.compiler.processing.util.compiler.steps.CompilationStepArguments
+import androidx.room.compiler.processing.util.compiler.steps.CompilationStepResult
+import androidx.room.compiler.processing.util.compiler.steps.JavaSourceCompilationStep
+import androidx.room.compiler.processing.util.compiler.steps.KaptCompilationStep
+import androidx.room.compiler.processing.util.compiler.steps.KotlinSourceCompilationStep
+import androidx.room.compiler.processing.util.compiler.steps.KspCompilationStep
+import com.google.devtools.ksp.processing.SymbolProcessorProvider
+import java.io.File
+import javax.annotation.processing.Processor
+import javax.tools.Diagnostic
+
+/**
+ * Compilation runner for kotlin using kotlin CLI tool
+ */
+data class TestCompilationArguments(
+ /**
+ * List of source files for the compilation
+ */
+ val sources: List<Source>,
+ /**
+ * Additional classpath for the compilation
+ */
+ val classpath: List<File> = emptyList(),
+ /**
+ * If `true` (default), the classpath of the current process will be included in the
+ * classpath list.
+ */
+ val inheritClasspath: Boolean = true,
+ /**
+ * Arguments for the java compiler. This will be used when both running KAPT and also java
+ * compiler.
+ */
+ val javacArguments: List<String> = emptyList(),
+ /**
+ * List of annotation processors to be run by KAPT.
+ */
+ val kaptProcessors: List<Processor> = emptyList(),
+ /**
+ * List of symbol processor providers to be run by KSP.
+ */
+ val symbolProcessorProviders: List<SymbolProcessorProvider> = emptyList(),
+ /**
+ * Map of annotation/symbol processor options. Used for both KAPT and KSP.
+ */
+ val processorOptions: Map<String, String> = emptyMap()
+)
+
+/**
+ * Result of a test compilation.
+ */
+data class TestCompilationResult(
+ /**
+ * true if the compilation succeeded, false otherwise.
+ */
+ val success: Boolean,
+ /**
+ * List of generated source files by the compilation.
+ */
+ val generatedSources: List<Source>,
+ /**
+ * Diagnostic messages that were reported during compilation.
+ */
+ val diagnostics: Map<Diagnostic.Kind, List<DiagnosticMessage>>,
+ /**
+ * List of classpath folders that contain the produced .class files.
+ */
+ val outputClasspath: List<File>
+)
+
+/**
+ * Ensures the list of sources has at least 1 kotlin file, if not, adds one.
+ */
+internal fun TestCompilationArguments.withAtLeastOneKotlinSource(): TestCompilationArguments {
+ val hasKotlinSource = sources.any {
+ it is Source.KotlinSource
+ }
+ if (hasKotlinSource) return this
+ return copy(
+ sources = sources + Source.kotlin(
+ "SyntheticSource",
+ code = """
+ package xprocessing.generated
+ class SyntheticKotlinSource
+ """.trimIndent()
+ )
+ )
+}
+
+/**
+ * Copies the [Source] file into the given root directories based on file type.
+ */
+private fun Source.copyTo(
+ kotlinRootDir: File,
+ javaRootDir: File
+): File {
+ val locationRoot = when (this) {
+ is Source.KotlinSource -> kotlinRootDir
+ is Source.JavaSource -> javaRootDir
+ }
+ val location = locationRoot.resolve(relativePath)
+ check(!location.exists()) {
+ "duplicate source file: $location ($this)"
+ }
+ location.parentFile.mkdirs()
+ location.writeText(contents, Charsets.UTF_8)
+ return location
+}
+
+/**
+ * Converts [TestCompilationArguments] into the internal [CompilationStepArguments] type.
+ *
+ * This involves copying sources into the working directory.
+ */
+private fun TestCompilationArguments.toInternal(
+ workingDir: File
+): CompilationStepArguments {
+ val (kotlinRoot, javaRoot) = workingDir.resolve("src").let {
+ it.resolve("kotlin") to it.resolve("java")
+ }
+ // copy sources based on type.
+ sources.map {
+ it.copyTo(kotlinRootDir = kotlinRoot, javaRootDir = javaRoot)
+ }
+ return CompilationStepArguments(
+ sourceSets = listOfNotNull(
+ javaRoot.toSourceSet(),
+ kotlinRoot.toSourceSet()
+ ),
+ additionalClasspaths = classpath,
+ inheritClasspaths = inheritClasspath,
+ javacArguments = javacArguments
+ )
+}
+
+/**
+ * Executes a build for the given [TestCompilationArguments].
+ */
+fun compile(
+ /**
+ * The temporary directory to use during compilation
+ */
+ workingDir: File,
+ /**
+ * The compilation arguments
+ */
+ arguments: TestCompilationArguments,
+): TestCompilationResult {
+ val steps = listOf(
+ KaptCompilationStep(arguments.kaptProcessors, arguments.processorOptions),
+ KspCompilationStep(arguments.symbolProcessorProviders, arguments.processorOptions),
+ KotlinSourceCompilationStep,
+ JavaSourceCompilationStep
+ )
+ workingDir.ensureEmptyDirectory()
+
+ val initialArgs = arguments.toInternal(workingDir.resolve("input"))
+ val initial = listOf(
+ CompilationStepResult(
+ success = true,
+ generatedSourceRoots = emptyList(),
+ diagnostics = emptyList(),
+ nextCompilerArguments = initialArgs,
+ outputClasspath = emptyList()
+ )
+ )
+ val resultFromEachStep = steps.fold(initial) { prevResults, step ->
+ val prev = prevResults.last()
+ if (prev.success) {
+ prevResults + step.execute(
+ workingDir = workingDir.resolve(step.name),
+ arguments = prev.nextCompilerArguments
+ )
+ } else {
+ prevResults
+ }
+ }
+ val combinedDiagnostics = mutableMapOf<Diagnostic.Kind, MutableList<DiagnosticMessage>>()
+ resultFromEachStep.forEach { result ->
+ result.diagnostics.forEach { diagnostic ->
+ combinedDiagnostics.getOrPut(
+ diagnostic.kind
+ ) {
+ mutableListOf()
+ }.add(diagnostic)
+ }
+ }
+ return TestCompilationResult(
+ success = resultFromEachStep.all { it.success },
+ generatedSources = resultFromEachStep.flatMap { it.generatedSources },
+ diagnostics = combinedDiagnostics,
+ outputClasspath = resultFromEachStep.flatMap { it.outputClasspath }
+ )
+}
+
+internal fun File.ensureEmptyDirectory() {
+ if (exists()) {
+ check(isDirectory) {
+ "$this cannot be a file"
+ }
+ val existingFiles = listFiles()
+ check(existingFiles == null || existingFiles.isEmpty()) {
+ "$this must be empty, found: ${existingFiles?.joinToString("\n")}"
+ }
+ } else {
+ check(this.mkdirs()) {
+ "failed to create working directory ($this)"
+ }
+ }
+}
\ No newline at end of file
diff --git a/room/room-compiler-processing-testing/src/main/java/androidx/room/compiler/processing/util/compiler/TestKspRegistrar.kt b/room/room-compiler-processing-testing/src/main/java/androidx/room/compiler/processing/util/compiler/TestKspRegistrar.kt
new file mode 100644
index 0000000..53d12aa
--- /dev/null
+++ b/room/room-compiler-processing-testing/src/main/java/androidx/room/compiler/processing/util/compiler/TestKspRegistrar.kt
@@ -0,0 +1,117 @@
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * 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.
+ */
+
+package androidx.room.compiler.processing.util.compiler
+
+import com.google.devtools.ksp.AbstractKotlinSymbolProcessingExtension
+import com.google.devtools.ksp.KspCliOption
+import com.google.devtools.ksp.KspOptions
+import com.google.devtools.ksp.processing.KSPLogger
+import com.google.devtools.ksp.processing.SymbolProcessorProvider
+import com.google.devtools.ksp.processing.impl.MessageCollectorBasedKSPLogger
+import org.jetbrains.kotlin.cli.common.CLIConfigurationKeys
+import org.jetbrains.kotlin.cli.common.messages.MessageCollector
+import org.jetbrains.kotlin.cli.jvm.config.JavaSourceRoot
+import org.jetbrains.kotlin.cli.jvm.config.JvmClasspathRoot
+import org.jetbrains.kotlin.com.intellij.core.CoreApplicationEnvironment
+import org.jetbrains.kotlin.com.intellij.mock.MockProject
+import org.jetbrains.kotlin.com.intellij.psi.PsiTreeChangeAdapter
+import org.jetbrains.kotlin.com.intellij.psi.PsiTreeChangeListener
+import org.jetbrains.kotlin.compiler.plugin.ComponentRegistrar
+import org.jetbrains.kotlin.config.CompilerConfiguration
+import org.jetbrains.kotlin.resolve.extensions.AnalysisHandlerExtension
+import java.io.File
+
+/**
+ * Registers the KSP component for the kotlin compilation.
+ */
+internal class TestKspRegistrar(
+ val kspWorkingDir: File,
+ val baseOptions: KspOptions.Builder,
+
+ val processorProviders: List<SymbolProcessorProvider>,
+ val messageCollector: MessageCollector
+) : ComponentRegistrar {
+ override fun registerProjectComponents(
+ project: MockProject,
+ configuration: CompilerConfiguration
+ ) {
+ baseOptions.apply {
+ projectBaseDir = project.basePath?.let {
+ File(it)
+ } ?: kspWorkingDir
+ incremental = false
+ incrementalLog = false
+ // NOT supported yet, hence we set a default
+ classOutputDir = classOutputDir ?: kspWorkingDir.resolve(
+ KspCliOption
+ .CLASS_OUTPUT_DIR_OPTION.optionName
+ )
+ // NOT supported yet, hence we set a default
+ resourceOutputDir = resourceOutputDir ?: kspWorkingDir.resolve(
+ KspCliOption.RESOURCE_OUTPUT_DIR_OPTION.optionName
+ )
+ cachesDir = cachesDir ?: kspWorkingDir.resolve(
+ KspCliOption.CACHES_DIR_OPTION.optionName
+ )
+
+ kspOutputDir = kspOutputDir ?: kspWorkingDir.resolve(
+ KspCliOption.KSP_OUTPUT_DIR_OPTION.optionName
+ )
+ val contentRoots = configuration[CLIConfigurationKeys.CONTENT_ROOTS] ?: emptyList()
+
+ compileClasspath.addAll(
+ contentRoots.filterIsInstance<JvmClasspathRoot>().map { it.file }
+ )
+
+ javaSourceRoots.addAll(
+ contentRoots.filterIsInstance<JavaSourceRoot>().map { it.file }
+ )
+ }
+ val logger = MessageCollectorBasedKSPLogger(
+ messageCollector = messageCollector
+ )
+ val options = baseOptions.build()
+ AnalysisHandlerExtension.registerExtension(
+ project,
+ TestKspExtension(
+ options = options,
+ processorProviders = processorProviders,
+ logger = logger
+ )
+ )
+ // Placeholder extension point; Required by dropPsiCaches().
+ CoreApplicationEnvironment.registerExtensionPoint(
+ project.extensionArea,
+ PsiTreeChangeListener.EP.name,
+ PsiTreeChangeAdapter::class.java
+ )
+ }
+
+ private class TestKspExtension(
+ options: KspOptions,
+ processorProviders: List<SymbolProcessorProvider>,
+ logger: KSPLogger
+ ) : AbstractKotlinSymbolProcessingExtension(
+ options = options,
+ logger = logger,
+ testMode = false
+ ) {
+ private val loadedProviders = processorProviders
+
+ override fun loadProviders() = loadedProviders
+ }
+}
\ No newline at end of file
diff --git a/room/room-compiler-processing-testing/src/main/java/androidx/room/compiler/processing/util/compiler/steps/JavaSourceCompilationStep.kt b/room/room-compiler-processing-testing/src/main/java/androidx/room/compiler/processing/util/compiler/steps/JavaSourceCompilationStep.kt
new file mode 100644
index 0000000..27b3e95
--- /dev/null
+++ b/room/room-compiler-processing-testing/src/main/java/androidx/room/compiler/processing/util/compiler/steps/JavaSourceCompilationStep.kt
@@ -0,0 +1,96 @@
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * 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.
+ */
+
+package androidx.room.compiler.processing.util.compiler.steps
+
+import androidx.room.compiler.processing.util.Source
+import androidx.room.compiler.processing.util.getSystemClasspathFiles
+import androidx.room.compiler.processing.util.toDiagnosticMessages
+import com.google.testing.compile.Compilation
+import com.google.testing.compile.Compiler
+import java.io.File
+import javax.tools.JavaFileObject
+
+/**
+ * Compiles java sources. Note that this does not run java annotation processors. They are run in
+ * the KAPT step for consistency. When a test is run with purely java sources, it uses the google
+ * compile testing library directly instead of the kotlin compilation pipeline.
+ */
+internal object JavaSourceCompilationStep : KotlinCompilationStep {
+ override val name = "javaSourceCompilation"
+
+ override fun execute(
+ workingDir: File,
+ arguments: CompilationStepArguments
+ ): CompilationStepResult {
+ val javaSources: Map<JavaFileObject, Source> = arguments.sourceSets
+ .asSequence()
+ .flatMap {
+ it.javaSources
+ }.associateBy {
+ it.toJFO()
+ }
+ if (javaSources.isEmpty()) {
+ return CompilationStepResult.skip(arguments)
+ }
+ val classpaths = if (arguments.inheritClasspaths) {
+ arguments.additionalClasspaths + getSystemClasspathFiles()
+ } else {
+ arguments.additionalClasspaths
+ }.filter { it.exists() }
+
+ val compiler = Compiler.javac()
+ .withOptions(arguments.javacArguments + "-Xlint")
+ .withClasspath(classpaths)
+
+ val result = compiler.compile(javaSources.keys)
+
+ val generatedClasses = if (result.status() == Compilation.Status.SUCCESS) {
+ val classpathOut = workingDir.resolve(GEN_CLASS_OUT)
+ result.generatedFiles().map {
+ val targetFile = classpathOut.resolve(
+ it.toUri().path.substringAfter("CLASS_OUTPUT/")
+ ).also { file ->
+ file.parentFile.mkdirs()
+ }
+ it.openInputStream().use { inputStream ->
+ targetFile.outputStream().use { outputStream ->
+ inputStream.transferTo(outputStream)
+ }
+ }
+ }
+ listOf(
+ classpathOut
+ )
+ } else {
+ emptyList()
+ }
+
+ return CompilationStepResult(
+ success = result.status() == Compilation.Status.SUCCESS,
+ generatedSourceRoots = emptyList(),
+ diagnostics = result.diagnostics().toDiagnosticMessages(javaSources),
+ nextCompilerArguments = arguments.copy(
+ // NOTE: ideally, we should remove java sources but we know that there are no next
+ // steps so we skip unnecessary work
+ sourceSets = arguments.sourceSets
+ ),
+ outputClasspath = generatedClasses
+ )
+ }
+
+ private const val GEN_CLASS_OUT = "classOut"
+}
\ No newline at end of file
diff --git a/room/room-compiler-processing-testing/src/main/java/androidx/room/compiler/processing/util/compiler/steps/KaptCompilationStep.kt b/room/room-compiler-processing-testing/src/main/java/androidx/room/compiler/processing/util/compiler/steps/KaptCompilationStep.kt
new file mode 100644
index 0000000..e07117e
--- /dev/null
+++ b/room/room-compiler-processing-testing/src/main/java/androidx/room/compiler/processing/util/compiler/steps/KaptCompilationStep.kt
@@ -0,0 +1,105 @@
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * 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.
+ */
+
+package androidx.room.compiler.processing.util.compiler.steps
+
+import androidx.room.compiler.processing.util.compiler.DiagnosticsMessageCollector
+import androidx.room.compiler.processing.util.compiler.KotlinCliRunner
+import androidx.room.compiler.processing.util.compiler.TestKapt3Registrar
+import androidx.room.compiler.processing.util.compiler.toSourceSet
+import org.jetbrains.kotlin.base.kapt3.AptMode
+import org.jetbrains.kotlin.base.kapt3.KaptFlag
+import org.jetbrains.kotlin.base.kapt3.KaptOptions
+import org.jetbrains.kotlin.cli.common.ExitCode
+import java.io.File
+import javax.annotation.processing.Processor
+
+/**
+ * Runs KAPT to run annotation processors.
+ */
+internal class KaptCompilationStep(
+ private val annotationProcessors: List<Processor>,
+ private val processorOptions: Map<String, String>,
+) : KotlinCompilationStep {
+ override val name = "kapt"
+ private fun createKaptArgs(
+ workingDir: File,
+ ): KaptOptions.Builder {
+ return KaptOptions.Builder().also {
+ it.stubsOutputDir = workingDir.resolve("kapt-stubs") // IGNORED
+ it.sourcesOutputDir = workingDir.resolve(JAVA_SRC_OUT_FOLDER_NAME)
+ it.classesOutputDir = workingDir.resolve("kapt-classes-out") // IGNORED
+ it.projectBaseDir = workingDir
+ it.processingOptions["kapt.kotlin.generated"] =
+ workingDir.resolve(KOTLIN_SRC_OUT_FOLDER_NAME)
+ .also {
+ it.mkdirs()
+ }
+ .canonicalPath
+ it.processingOptions.putAll(processorOptions)
+ it.mode = AptMode.STUBS_AND_APT
+ it.processors.addAll(annotationProcessors.map { it::class.java.name })
+ // NOTE: this does not work very well until the following bug is fixed
+ // https://youtrack.jetbrains.com/issue/KT-47934
+ it.flags.add(KaptFlag.MAP_DIAGNOSTIC_LOCATIONS)
+ }
+ }
+
+ override fun execute(
+ workingDir: File,
+ arguments: CompilationStepArguments
+ ): CompilationStepResult {
+ if (annotationProcessors.isEmpty()) {
+ return CompilationStepResult.skip(arguments)
+ }
+ val kaptMessages = DiagnosticsMessageCollector()
+ val result = KotlinCliRunner.runKotlinCli(
+ arguments = arguments, // output is ignored,
+ destinationDir = workingDir.resolve(CLASS_OUT_FOLDER_NAME),
+ pluginRegistrars = listOf(
+ TestKapt3Registrar(
+ processors = annotationProcessors,
+ baseOptions = createKaptArgs(workingDir),
+ messageCollector = kaptMessages
+ )
+ )
+ )
+ val generatedSources = listOfNotNull(
+ workingDir.resolve(JAVA_SRC_OUT_FOLDER_NAME).toSourceSet(),
+ workingDir.resolve(KOTLIN_SRC_OUT_FOLDER_NAME).toSourceSet()
+ )
+
+ val diagnostics = resolveDiagnostics(
+ diagnostics = result.diagnostics + kaptMessages.getDiagnostics(),
+ sourceSets = arguments.sourceSets + generatedSources
+ )
+ return CompilationStepResult(
+ success = result.exitCode == ExitCode.OK,
+ generatedSourceRoots = generatedSources,
+ diagnostics = diagnostics,
+ nextCompilerArguments = arguments.copy(
+ sourceSets = arguments.sourceSets + generatedSources
+ ),
+ outputClasspath = listOf(result.compiledClasspath)
+ )
+ }
+
+ companion object {
+ private const val JAVA_SRC_OUT_FOLDER_NAME = "kapt-java-src-out"
+ private const val KOTLIN_SRC_OUT_FOLDER_NAME = "kapt-kotlin-src-out"
+ private const val CLASS_OUT_FOLDER_NAME = "class-out"
+ }
+}
\ No newline at end of file
diff --git a/room/room-compiler-processing-testing/src/main/java/androidx/room/compiler/processing/util/compiler/steps/KotlinCompilationStep.kt b/room/room-compiler-processing-testing/src/main/java/androidx/room/compiler/processing/util/compiler/steps/KotlinCompilationStep.kt
new file mode 100644
index 0000000..1d4ba58
--- /dev/null
+++ b/room/room-compiler-processing-testing/src/main/java/androidx/room/compiler/processing/util/compiler/steps/KotlinCompilationStep.kt
@@ -0,0 +1,174 @@
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * 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.
+ */
+
+package androidx.room.compiler.processing.util.compiler.steps
+
+import androidx.room.compiler.processing.util.DiagnosticLocation
+import androidx.room.compiler.processing.util.DiagnosticMessage
+import androidx.room.compiler.processing.util.Source
+import androidx.room.compiler.processing.util.compiler.SourceSet
+import java.io.File
+import javax.tools.Diagnostic
+
+/**
+ * Kotlin compilation is run in multiple steps:
+ * process KSP
+ * process KAPT
+ * compile kotlin sources
+ * compile java sources
+ *
+ * Each step implements the [KotlinCompilationStep] interfaces and provides the arguments for
+ * the following step.
+ */
+internal interface KotlinCompilationStep {
+ /**
+ * A name to identify the step.
+ */
+ val name: String
+
+ fun execute(
+ /**
+ * Temporary folder that can be used by the step
+ */
+ workingDir: File,
+ /**
+ * Compilation parameters for the step.
+ */
+ arguments: CompilationStepArguments
+ ): CompilationStepResult
+}
+
+/**
+ * Diagnostic message that was captured from the compiler, before it is processed.
+ */
+internal data class RawDiagnosticMessage(
+ val kind: Diagnostic.Kind,
+ val message: String,
+ val location: Location?
+) {
+ data class Location(
+ val path: String,
+ val line: Int,
+ )
+}
+
+/**
+ * Parameters for each compilation step
+ */
+internal data class CompilationStepArguments(
+ /**
+ * List of source sets. Each source set has a root folder that can be used to pass to the
+ * compiler.
+ */
+ val sourceSets: List<SourceSet>,
+ /**
+ * Any additional classpath provided to the compilation
+ */
+ val additionalClasspaths: List<File>,
+ /**
+ * If `true`, the classpath of the test application should be provided to the compiler
+ */
+ val inheritClasspaths: Boolean,
+ /**
+ * Arguments to pass to the java compiler. This is also important for KAPT where part of the
+ * compilation is run by javac.
+ */
+ val javacArguments: List<String>,
+)
+
+/**
+ * Result of a compilation step.
+ */
+internal data class CompilationStepResult(
+ /**
+ * Whether it succeeded or not.
+ */
+ val success: Boolean,
+ /**
+ * List of source sets generated by this step
+ */
+ val generatedSourceRoots: List<SourceSet>,
+ /**
+ * List of diagnotic messages created by this step
+ */
+ val diagnostics: List<DiagnosticMessage>,
+ /**
+ * Arguments for the next compilation step. Current step might've modified its own parameters
+ * (e.g. add generated sources etc) for this one.
+ */
+ val nextCompilerArguments: CompilationStepArguments,
+ /**
+ * If the step compiled sources, this field includes the list of Files for each classpath.
+ */
+ val outputClasspath: List<File>
+) {
+ val generatedSources: List<Source> by lazy {
+ generatedSourceRoots.flatMap { it.sources }
+ }
+
+ companion object {
+ /**
+ * Creates a [CompilationStepResult] that does not create any outputs but instead simply
+ * passes the arguments to the next step.
+ */
+ fun skip(arguments: CompilationStepArguments) = CompilationStepResult(
+ success = true,
+ generatedSourceRoots = emptyList(),
+ diagnostics = emptyList(),
+ nextCompilerArguments = arguments,
+ outputClasspath = emptyList()
+ )
+ }
+}
+
+/**
+ * Associates [RawDiagnosticMessage]s with sources and creates [DiagnosticMessage]s.
+ */
+internal fun resolveDiagnostics(
+ diagnostics: List<RawDiagnosticMessage>,
+ sourceSets: List<SourceSet>,
+): List<DiagnosticMessage> {
+ return diagnostics.map { rawDiagnostic ->
+ // match it to source
+ val location = rawDiagnostic.location
+ if (location == null) {
+ DiagnosticMessage(
+ kind = rawDiagnostic.kind,
+ msg = rawDiagnostic.message,
+ location = null,
+ )
+ } else {
+ // find matching source file
+ val source = sourceSets.firstNotNullOfOrNull {
+ it.findSourceFile(location.path)
+ }
+
+ // source might be null for KAPT if it failed to match the diagnostic to a real
+ // source file (e.g. error is reported on the stub)
+ check(source != null || location.path.contains("kapt")) {
+ "Cannot find source file for the diagnostic :/ $rawDiagnostic"
+ }
+ DiagnosticMessage(
+ kind = rawDiagnostic.kind,
+ msg = rawDiagnostic.message,
+ location = DiagnosticLocation(
+ source = source,
+ line = location.line,
+ ),
+ )
+ }
+ }
+}
diff --git a/room/room-compiler-processing-testing/src/main/java/androidx/room/compiler/processing/util/compiler/steps/KotlinSourceCompilationStep.kt b/room/room-compiler-processing-testing/src/main/java/androidx/room/compiler/processing/util/compiler/steps/KotlinSourceCompilationStep.kt
new file mode 100644
index 0000000..dcfe22bf
--- /dev/null
+++ b/room/room-compiler-processing-testing/src/main/java/androidx/room/compiler/processing/util/compiler/steps/KotlinSourceCompilationStep.kt
@@ -0,0 +1,63 @@
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * 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.
+ */
+
+package androidx.room.compiler.processing.util.compiler.steps
+
+import androidx.room.compiler.processing.util.compiler.KotlinCliRunner
+import org.jetbrains.kotlin.cli.common.ExitCode
+import java.io.File
+
+/**
+ * Compiles kotlin sources.
+ *
+ * Note that annotation/symbol processors are not run by this step.
+ */
+internal object KotlinSourceCompilationStep : KotlinCompilationStep {
+ override val name = "kotlinSourceCompilation"
+
+ override fun execute(
+ workingDir: File,
+ arguments: CompilationStepArguments
+ ): CompilationStepResult {
+ if (arguments.sourceSets.none { it.hasKotlinSource }) {
+ return CompilationStepResult.skip(arguments)
+ }
+ val result = KotlinCliRunner.runKotlinCli(
+ arguments = arguments,
+ destinationDir = workingDir.resolve(CLASS_OUT_FOLDER_NAME),
+ pluginRegistrars = emptyList()
+ )
+ val diagnostics = resolveDiagnostics(
+ diagnostics = result.diagnostics,
+ sourceSets = arguments.sourceSets
+ )
+ return CompilationStepResult(
+ success = result.exitCode == ExitCode.OK,
+ generatedSourceRoots = emptyList(),
+ diagnostics = diagnostics,
+ nextCompilerArguments = arguments.copy(
+ additionalClasspaths = listOf(workingDir.resolve(CLASS_OUT_FOLDER_NAME)) +
+ arguments.additionalClasspaths,
+ // NOTE: ideally, we should remove kotlin sources but we know that there are no more
+ // kotlin steps so we skip unnecessary work
+ sourceSets = arguments.sourceSets
+ ),
+ outputClasspath = listOf(result.compiledClasspath)
+ )
+ }
+
+ private const val CLASS_OUT_FOLDER_NAME = "class-out"
+}
\ No newline at end of file
diff --git a/room/room-compiler-processing-testing/src/main/java/androidx/room/compiler/processing/util/compiler/steps/KspCompilationStep.kt b/room/room-compiler-processing-testing/src/main/java/androidx/room/compiler/processing/util/compiler/steps/KspCompilationStep.kt
new file mode 100644
index 0000000..2f8ed26
--- /dev/null
+++ b/room/room-compiler-processing-testing/src/main/java/androidx/room/compiler/processing/util/compiler/steps/KspCompilationStep.kt
@@ -0,0 +1,92 @@
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * 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.
+ */
+
+package androidx.room.compiler.processing.util.compiler.steps
+
+import androidx.room.compiler.processing.util.compiler.DiagnosticsMessageCollector
+import androidx.room.compiler.processing.util.compiler.KotlinCliRunner
+import androidx.room.compiler.processing.util.compiler.TestKspRegistrar
+import androidx.room.compiler.processing.util.compiler.toSourceSet
+import com.google.devtools.ksp.KspOptions
+import com.google.devtools.ksp.processing.SymbolProcessorProvider
+import org.jetbrains.kotlin.cli.common.ExitCode
+import java.io.File
+
+/**
+ * Runs the Symbol Processors
+ */
+internal class KspCompilationStep(
+ private val symbolProcessorProviders: List<SymbolProcessorProvider>,
+ private val processorOptions: Map<String, String>
+) : KotlinCompilationStep {
+ override val name: String = "ksp"
+
+ private fun createKspOptions(
+ workingDir: File
+ ): KspOptions.Builder {
+ return KspOptions.Builder().apply {
+ this.javaOutputDir = workingDir.resolve(JAVA_OUT_DIR)
+ this.kotlinOutputDir = workingDir.resolve(KOTLIN_OUT_DIR)
+ this.processingOptions.putAll(processorOptions)
+ }
+ }
+
+ override fun execute(
+ workingDir: File,
+ arguments: CompilationStepArguments
+ ): CompilationStepResult {
+ if (symbolProcessorProviders.isEmpty()) {
+ return CompilationStepResult.skip(arguments)
+ }
+ val kspMessages = DiagnosticsMessageCollector()
+ val result = KotlinCliRunner.runKotlinCli(
+ arguments = arguments,
+ destinationDir = workingDir.resolve(CLASS_OUT_FOLDER_NAME),
+ pluginRegistrars = listOf(
+ TestKspRegistrar(
+ kspWorkingDir = workingDir.resolve("ksp-compiler"),
+ baseOptions = createKspOptions(workingDir),
+ processorProviders = symbolProcessorProviders,
+ messageCollector = kspMessages
+ )
+ )
+ )
+
+ val generatedSources = listOfNotNull(
+ workingDir.resolve(KOTLIN_OUT_DIR).toSourceSet(),
+ workingDir.resolve(JAVA_OUT_DIR).toSourceSet(),
+ )
+ val diagnostics = resolveDiagnostics(
+ diagnostics = result.diagnostics + kspMessages.getDiagnostics(),
+ sourceSets = arguments.sourceSets + generatedSources
+ )
+ return CompilationStepResult(
+ success = result.exitCode == ExitCode.OK,
+ generatedSourceRoots = generatedSources,
+ diagnostics = diagnostics,
+ nextCompilerArguments = arguments.copy(
+ sourceSets = arguments.sourceSets + generatedSources
+ ),
+ outputClasspath = listOf(result.compiledClasspath)
+ )
+ }
+
+ companion object {
+ private const val JAVA_OUT_DIR = "generatedJava"
+ private const val KOTLIN_OUT_DIR = "generatedKotlin"
+ private const val CLASS_OUT_FOLDER_NAME = "class-out"
+ }
+}
\ No newline at end of file
diff --git a/room/room-compiler-processing-testing/src/main/java/androidx/room/compiler/processing/util/runner/CompilationTestRunner.kt b/room/room-compiler-processing-testing/src/main/java/androidx/room/compiler/processing/util/runner/CompilationTestRunner.kt
index 844bb20..b3f574f 100644
--- a/room/room-compiler-processing-testing/src/main/java/androidx/room/compiler/processing/util/runner/CompilationTestRunner.kt
+++ b/room/room-compiler-processing-testing/src/main/java/androidx/room/compiler/processing/util/runner/CompilationTestRunner.kt
@@ -32,7 +32,7 @@
fun canRun(params: TestCompilationParameters): Boolean
- fun compile(params: TestCompilationParameters): CompilationResult
+ fun compile(workingDir: File, params: TestCompilationParameters): CompilationResult
}
@ExperimentalProcessingApi
diff --git a/room/room-compiler-processing-testing/src/main/java/androidx/room/compiler/processing/util/runner/JavacCompilationTestRunner.kt b/room/room-compiler-processing-testing/src/main/java/androidx/room/compiler/processing/util/runner/JavacCompilationTestRunner.kt
index d3bd3a8..9b797e3 100644
--- a/room/room-compiler-processing-testing/src/main/java/androidx/room/compiler/processing/util/runner/JavacCompilationTestRunner.kt
+++ b/room/room-compiler-processing-testing/src/main/java/androidx/room/compiler/processing/util/runner/JavacCompilationTestRunner.kt
@@ -19,9 +19,13 @@
import androidx.room.compiler.processing.ExperimentalProcessingApi
import androidx.room.compiler.processing.SyntheticJavacProcessor
import androidx.room.compiler.processing.util.CompilationResult
+import androidx.room.compiler.processing.util.DiagnosticMessage
import androidx.room.compiler.processing.util.JavaCompileTestingCompilationResult
import androidx.room.compiler.processing.util.Source
+import androidx.room.compiler.processing.util.toDiagnosticMessages
+import com.google.testing.compile.Compilation
import com.google.testing.compile.Compiler
+import java.io.File
@ExperimentalProcessingApi
internal object JavacCompilationTestRunner : CompilationTestRunner {
@@ -32,7 +36,7 @@
return params.sources.all { it is Source.JavaSource }
}
- override fun compile(params: TestCompilationParameters): CompilationResult {
+ override fun compile(workingDir: File, params: TestCompilationParameters): CompilationResult {
val syntheticJavacProcessor = SyntheticJavacProcessor(params.handlers)
val sources = if (params.sources.isEmpty()) {
// synthesize a source to trigger compilation
@@ -63,14 +67,30 @@
it
}
}
- val javaFileObjects = sources.map {
- it.toJFO()
+ val javaFileObjects = sources.associateBy { it.toJFO() }
+ val compilation = compiler.compile(javaFileObjects.keys)
+ val generatedSources = if (compilation.status() == Compilation.Status.SUCCESS) {
+ compilation.generatedSourceFiles().associate {
+ it to Source.fromJavaFileObject(it)
+ }
+ } else {
+ compilation.diagnostics().mapNotNull {
+ it.source
+ }.associate {
+ it to Source.fromJavaFileObject(it)
+ }
}
- val compilation = compiler.compile(javaFileObjects)
+
+ val diagnostics: List<DiagnosticMessage> = compilation.diagnostics().toDiagnosticMessages(
+ javaFileObjects + generatedSources
+ )
+
return JavaCompileTestingCompilationResult(
testRunner = this,
delegate = compilation,
- processor = syntheticJavacProcessor
+ processor = syntheticJavacProcessor,
+ diagnostics = diagnostics.groupBy { it.kind },
+ generatedSources = generatedSources.values.toList()
)
}
}
\ No newline at end of file
diff --git a/room/room-compiler-processing-testing/src/main/java/androidx/room/compiler/processing/util/runner/KaptCompilationTestRunner.kt b/room/room-compiler-processing-testing/src/main/java/androidx/room/compiler/processing/util/runner/KaptCompilationTestRunner.kt
index 651d73b..2878067 100644
--- a/room/room-compiler-processing-testing/src/main/java/androidx/room/compiler/processing/util/runner/KaptCompilationTestRunner.kt
+++ b/room/room-compiler-processing-testing/src/main/java/androidx/room/compiler/processing/util/runner/KaptCompilationTestRunner.kt
@@ -1,5 +1,5 @@
/*
- * Copyright 2020 The Android Open Source Project
+ * Copyright 2021 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -19,40 +19,36 @@
import androidx.room.compiler.processing.ExperimentalProcessingApi
import androidx.room.compiler.processing.SyntheticJavacProcessor
import androidx.room.compiler.processing.util.CompilationResult
-import androidx.room.compiler.processing.util.KotlinCompilationUtil
-import androidx.room.compiler.processing.util.KotlinCompileTestingCompilationResult
-import com.tschuchort.compiletesting.KotlinCompilation
-import java.io.ByteArrayOutputStream
+import androidx.room.compiler.processing.util.KotlinCompilationResult
+import androidx.room.compiler.processing.util.compiler.TestCompilationArguments
+import androidx.room.compiler.processing.util.compiler.compile
+import androidx.room.compiler.processing.util.compiler.withAtLeastOneKotlinSource
+import java.io.File
@ExperimentalProcessingApi
internal object KaptCompilationTestRunner : CompilationTestRunner {
-
override val name: String = "kapt"
override fun canRun(params: TestCompilationParameters): Boolean {
return true
}
- override fun compile(params: TestCompilationParameters): CompilationResult {
+ override fun compile(workingDir: File, params: TestCompilationParameters): CompilationResult {
val syntheticJavacProcessor = SyntheticJavacProcessor(params.handlers)
- val outputStream = ByteArrayOutputStream()
- val compilation = KotlinCompilationUtil.prepareCompilation(
+ val args = TestCompilationArguments(
sources = params.sources,
- outputStream = outputStream,
- classpaths = params.classpath
+ classpath = params.classpath,
+ kaptProcessors = listOf(syntheticJavacProcessor),
+ processorOptions = params.options
+ ).withAtLeastOneKotlinSource()
+ val result = compile(
+ workingDir = workingDir,
+ arguments = args
)
- compilation.kaptArgs.putAll(params.options)
- compilation.annotationProcessors = listOf(syntheticJavacProcessor)
- val result = compilation.compile()
- return KotlinCompileTestingCompilationResult(
+ return KotlinCompilationResult(
testRunner = this,
- delegate = result,
processor = syntheticJavacProcessor,
- successfulCompilation = result.exitCode == KotlinCompilation.ExitCode.OK,
- outputSourceDirs = listOf(
- compilation.kaptSourceDir, compilation.kaptKotlinGeneratedDir
- ),
- rawOutput = outputStream.toString(Charsets.UTF_8),
+ delegate = result
)
}
}
\ No newline at end of file
diff --git a/room/room-compiler-processing-testing/src/main/java/androidx/room/compiler/processing/util/runner/KspCompilationTestRunner.kt b/room/room-compiler-processing-testing/src/main/java/androidx/room/compiler/processing/util/runner/KspCompilationTestRunner.kt
index 88c206d..9d7bbfe 100644
--- a/room/room-compiler-processing-testing/src/main/java/androidx/room/compiler/processing/util/runner/KspCompilationTestRunner.kt
+++ b/room/room-compiler-processing-testing/src/main/java/androidx/room/compiler/processing/util/runner/KspCompilationTestRunner.kt
@@ -1,5 +1,5 @@
/*
- * Copyright 2020 The Android Open Source Project
+ * Copyright 2021 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -19,41 +19,24 @@
import androidx.room.compiler.processing.ExperimentalProcessingApi
import androidx.room.compiler.processing.SyntheticKspProcessor
import androidx.room.compiler.processing.util.CompilationResult
-import androidx.room.compiler.processing.util.KotlinCompilationUtil
-import androidx.room.compiler.processing.util.KotlinCompileTestingCompilationResult
-import androidx.room.compiler.processing.util.CompilationTestCapabilities
-import androidx.room.compiler.processing.util.Source
+import androidx.room.compiler.processing.util.KotlinCompilationResult
+import androidx.room.compiler.processing.util.compiler.TestCompilationArguments
+import androidx.room.compiler.processing.util.compiler.compile
+import androidx.room.compiler.processing.util.compiler.withAtLeastOneKotlinSource
import com.google.devtools.ksp.processing.SymbolProcessor
import com.google.devtools.ksp.processing.SymbolProcessorEnvironment
import com.google.devtools.ksp.processing.SymbolProcessorProvider
-import com.tschuchort.compiletesting.KotlinCompilation
-import com.tschuchort.compiletesting.SourceFile
-import com.tschuchort.compiletesting.kspArgs
-import com.tschuchort.compiletesting.kspSourcesDir
-import com.tschuchort.compiletesting.symbolProcessorProviders
-import java.io.ByteArrayOutputStream
import java.io.File
-import javax.tools.Diagnostic
@ExperimentalProcessingApi
internal object KspCompilationTestRunner : CompilationTestRunner {
-
override val name: String = "ksp"
override fun canRun(params: TestCompilationParameters): Boolean {
- return CompilationTestCapabilities.canTestWithKsp
+ return true
}
- override fun compile(params: TestCompilationParameters): CompilationResult {
- @Suppress("NAME_SHADOWING")
- val sources = if (params.sources.none { it is Source.KotlinSource }) {
- // looks like this requires a kotlin source file
- // see: https://github.com/tschuchortdev/kotlin-compile-testing/issues/57
- params.sources + Source.kotlin("placeholder.kt", "")
- } else {
- params.sources
- }
-
+ override fun compile(workingDir: File, params: TestCompilationParameters): CompilationResult {
val processorProvider = object : SymbolProcessorProvider {
lateinit var processor: SyntheticKspProcessor
@@ -61,63 +44,20 @@
return SyntheticKspProcessor(environment, params.handlers).also { processor = it }
}
}
-
- val combinedOutputStream = ByteArrayOutputStream()
- val kspCompilation = KotlinCompilationUtil.prepareCompilation(
- sources = sources,
- outputStream = combinedOutputStream,
- classpaths = params.classpath
+ val args = TestCompilationArguments(
+ sources = params.sources,
+ classpath = params.classpath,
+ symbolProcessorProviders = listOf(processorProvider),
+ processorOptions = params.options
+ ).withAtLeastOneKotlinSource()
+ val result = compile(
+ workingDir = workingDir,
+ arguments = args
)
- kspCompilation.kspArgs.putAll(params.options)
- kspCompilation.symbolProcessorProviders = listOf(processorProvider)
- kspCompilation.compile()
- // ignore KSP result for now because KSP stops compilation, which might create false
- // negatives when java code accesses kotlin code.
- // TODO: fix once https://github.com/tschuchortdev/kotlin-compile-testing/issues/72 is
- // fixed
-
- // after ksp, compile without ksp with KSP's output as input
- val finalCompilation = KotlinCompilationUtil.prepareCompilation(
- sources = sources,
- outputStream = combinedOutputStream,
- classpaths = params.classpath,
- )
- // build source files from generated code
- finalCompilation.sources += kspCompilation.kspJavaSourceDir.collectSourceFiles() +
- kspCompilation.kspKotlinSourceDir.collectSourceFiles()
- val result = finalCompilation.compile()
- val syntheticKspProcessor = processorProvider.processor
- // workaround for: https://github.com/google/ksp/issues/122
- // KSP does not fail compilation for error diagnostics hence we do it here.
- val hasErrorDiagnostics = syntheticKspProcessor.messageWatcher
- .diagnostics()[Diagnostic.Kind.ERROR].orEmpty().isNotEmpty()
- return KotlinCompileTestingCompilationResult(
+ return KotlinCompilationResult(
testRunner = this,
- delegate = result,
- processor = syntheticKspProcessor,
- successfulCompilation = result.exitCode == KotlinCompilation.ExitCode.OK &&
- !hasErrorDiagnostics,
- outputSourceDirs = listOf(
- kspCompilation.kspJavaSourceDir,
- kspCompilation.kspKotlinSourceDir
- ),
- rawOutput = combinedOutputStream.toString(Charsets.UTF_8),
+ processor = processorProvider.processor,
+ delegate = result
)
}
-
- // TODO get rid of these once kotlin compile testing supports two step compilation for KSP.
- // https://github.com/tschuchortdev/kotlin-compile-testing/issues/72
- private val KotlinCompilation.kspJavaSourceDir: File
- get() = kspSourcesDir.resolve("java")
-
- private val KotlinCompilation.kspKotlinSourceDir: File
- get() = kspSourcesDir.resolve("kotlin")
-
- private fun File.collectSourceFiles(): List<SourceFile> {
- return walkTopDown().filter {
- it.isFile
- }.map { file ->
- SourceFile.fromPath(file)
- }.toList()
- }
}
\ No newline at end of file
diff --git a/room/room-compiler-processing-testing/src/main/java/com/tschuchort/compiletesting/KspKotlinCompileTesting.kt b/room/room-compiler-processing-testing/src/main/java/com/tschuchort/compiletesting/KspKotlinCompileTesting.kt
deleted file mode 100644
index 8ac19ff..0000000
--- a/room/room-compiler-processing-testing/src/main/java/com/tschuchort/compiletesting/KspKotlinCompileTesting.kt
+++ /dev/null
@@ -1,211 +0,0 @@
-/*
- * Copyright 2021 The Android Open Source Project
- *
- * 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.
- */
-
-/**
- * This file replicates the KSP support in KotlinCompileTesting as a workaround not to wait for
- * the library to take KSP beta05 update.
- *
- * Ideally, this file should either disappear and replaced with the KCT library OR moved to a
- * real AndroidX library as a replacement for KCT.
- */
-
-package com.tschuchort.compiletesting
-
-import com.google.devtools.ksp.AbstractKotlinSymbolProcessingExtension
-import com.google.devtools.ksp.KspOptions
-import com.google.devtools.ksp.processing.KSPLogger
-import com.google.devtools.ksp.processing.SymbolProcessorProvider
-import com.google.devtools.ksp.processing.impl.MessageCollectorBasedKSPLogger
-import org.jetbrains.kotlin.cli.common.CLIConfigurationKeys
-import org.jetbrains.kotlin.cli.common.messages.MessageRenderer
-import org.jetbrains.kotlin.cli.common.messages.PrintingMessageCollector
-import org.jetbrains.kotlin.cli.jvm.config.JavaSourceRoot
-import org.jetbrains.kotlin.com.intellij.core.CoreApplicationEnvironment
-import org.jetbrains.kotlin.com.intellij.mock.MockProject
-import org.jetbrains.kotlin.com.intellij.psi.PsiTreeChangeAdapter
-import org.jetbrains.kotlin.com.intellij.psi.PsiTreeChangeListener
-import org.jetbrains.kotlin.compiler.plugin.ComponentRegistrar
-import org.jetbrains.kotlin.config.CompilerConfiguration
-import org.jetbrains.kotlin.resolve.jvm.extensions.AnalysisHandlerExtension
-import org.jetbrains.kotlin.utils.addToStdlib.firstIsInstanceOrNull
-import java.io.File
-
-/**
- * The list of symbol processors for the kotlin compilation.
- * https://goo.gle/ksp
- */
-var KotlinCompilation.symbolProcessorProviders: List<SymbolProcessorProvider>
- get() = getKspRegistrar().providers
- set(value) {
- val registrar = getKspRegistrar()
- registrar.providers = value
- }
-
-/**
- * The directory where generated KSP sources are written
- */
-val KotlinCompilation.kspSourcesDir: File
- get() = kspWorkingDir.resolve("sources")
-
-/**
- * Arbitrary arguments to be passed to ksp
- */
-var KotlinCompilation.kspArgs: MutableMap<String, String>
- get() = getKspRegistrar().options
- set(value) {
- val registrar = getKspRegistrar()
- registrar.options = value
- }
-
-private val KotlinCompilation.kspJavaSourceDir: File
- get() = kspSourcesDir.resolve("java")
-
-private val KotlinCompilation.kspKotlinSourceDir: File
- get() = kspSourcesDir.resolve("kotlin")
-
-private val KotlinCompilation.kspResources: File
- get() = kspSourcesDir.resolve("resources")
-
-/**
- * The working directory for KSP
- */
-private val KotlinCompilation.kspWorkingDir: File
- get() = workingDir.resolve("ksp")
-
-/**
- * The directory where compiled KSP classes are written
- */
-// TODO this seems to be ignored by KSP and it is putting classes into regular classes directory
-// but we still need to provide it in the KSP options builder as it is required
-// once it works, we should make the property public.
-private val KotlinCompilation.kspClassesDir: File
- get() = kspWorkingDir.resolve("classes")
-
-/**
- * The directory where compiled KSP caches are written
- */
-private val KotlinCompilation.kspCachesDir: File
- get() = kspWorkingDir.resolve("caches")
-
-/**
- * Custom subclass of [AbstractKotlinSymbolProcessingExtension] where processors are pre-defined instead of being
- * loaded via ServiceLocator.
- */
-private class KspTestExtension(
- options: KspOptions,
- processorProviders: List<SymbolProcessorProvider>,
- logger: KSPLogger
-) : AbstractKotlinSymbolProcessingExtension(
- options = options,
- logger = logger,
- testMode = false
-) {
- private val loadedProviders = processorProviders
-
- override fun loadProviders() = loadedProviders
-}
-
-/**
- * Registers the [KspTestExtension] to load the given list of processors.
- */
-private class KspCompileTestingComponentRegistrar(
- private val compilation: KotlinCompilation
-) : ComponentRegistrar {
- var providers = emptyList<SymbolProcessorProvider>()
-
- var options: MutableMap<String, String> = mutableMapOf()
-
- var incremental: Boolean = false
- var incrementalLog: Boolean = false
-
- override fun registerProjectComponents(
- project: MockProject,
- configuration: CompilerConfiguration
- ) {
- if (providers.isEmpty()) {
- return
- }
- val options = KspOptions.Builder().apply {
- this.projectBaseDir = compilation.kspWorkingDir
-
- this.processingOptions.putAll(compilation.kspArgs)
-
- this.incremental = this@KspCompileTestingComponentRegistrar.incremental
- this.incrementalLog = this@KspCompileTestingComponentRegistrar.incrementalLog
-
- this.cachesDir = compilation.kspCachesDir.also {
- it.deleteRecursively()
- it.mkdirs()
- }
- this.kspOutputDir = compilation.kspSourcesDir.also {
- it.deleteRecursively()
- it.mkdirs()
- }
- this.classOutputDir = compilation.kspClassesDir.also {
- it.deleteRecursively()
- it.mkdirs()
- }
- this.javaOutputDir = compilation.kspJavaSourceDir.also {
- it.deleteRecursively()
- it.mkdirs()
- }
- this.kotlinOutputDir = compilation.kspKotlinSourceDir.also {
- it.deleteRecursively()
- it.mkdirs()
- }
- this.resourceOutputDir = compilation.kspResources.also {
- it.deleteRecursively()
- it.mkdirs()
- }
- configuration[CLIConfigurationKeys.CONTENT_ROOTS]
- ?.filterIsInstance<JavaSourceRoot>()
- ?.forEach {
- this.javaSourceRoots.add(it.file)
- }
- }.build()
-
- // Temporary until friend-paths is fully supported https://youtrack.jetbrains.com/issue/KT-34102
- @Suppress("invisible_member")
- val messageCollectorBasedKSPLogger = MessageCollectorBasedKSPLogger(
- PrintingMessageCollector(
- compilation.internalMessageStreamAccess,
- MessageRenderer.GRADLE_STYLE,
- compilation.verbose
- )
- )
- // Placeholder extension point; Required by dropPsiCaches().
- @Suppress("UnstableApiUsage")
- CoreApplicationEnvironment.registerExtensionPoint(
- project.extensionArea,
- PsiTreeChangeListener.EP.name,
- PsiTreeChangeAdapter::class.java
- )
- val registrar = KspTestExtension(options, providers, messageCollectorBasedKSPLogger)
- AnalysisHandlerExtension.registerExtension(project, registrar)
- }
-}
-
-/**
- * Gets the test registrar from the plugin list or adds if it does not exist.
- */
-private fun KotlinCompilation.getKspRegistrar(): KspCompileTestingComponentRegistrar {
- compilerPlugins.firstIsInstanceOrNull<KspCompileTestingComponentRegistrar>()?.let {
- return it
- }
- val kspRegistrar = KspCompileTestingComponentRegistrar(this)
- compilerPlugins = compilerPlugins + kspRegistrar
- return kspRegistrar
-}
\ No newline at end of file
diff --git a/room/room-compiler-processing-testing/src/main/resources/META-INF/services/org.jetbrains.kotlin.compiler.plugin.ComponentRegistrar b/room/room-compiler-processing-testing/src/main/resources/META-INF/services/org.jetbrains.kotlin.compiler.plugin.ComponentRegistrar
new file mode 100644
index 0000000..ffaca31
--- /dev/null
+++ b/room/room-compiler-processing-testing/src/main/resources/META-INF/services/org.jetbrains.kotlin.compiler.plugin.ComponentRegistrar
@@ -0,0 +1,17 @@
+#
+# Copyright 2021 The Android Open Source Project
+#
+# 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.
+#
+
+androidx.room.compiler.processing.util.compiler.DelegatingTestRegistrar
\ No newline at end of file
diff --git a/room/room-compiler-processing-testing/src/test/java/androidx/room/compiler/processing/util/DiagnosticMessageCollectorTest.kt b/room/room-compiler-processing-testing/src/test/java/androidx/room/compiler/processing/util/DiagnosticMessageCollectorTest.kt
new file mode 100644
index 0000000..e62ba38
--- /dev/null
+++ b/room/room-compiler-processing-testing/src/test/java/androidx/room/compiler/processing/util/DiagnosticMessageCollectorTest.kt
@@ -0,0 +1,192 @@
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * 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.
+ */
+
+package androidx.room.compiler.processing.util
+
+import androidx.room.compiler.processing.util.compiler.DiagnosticsMessageCollector
+import androidx.room.compiler.processing.util.compiler.steps.RawDiagnosticMessage
+import androidx.room.compiler.processing.util.compiler.steps.RawDiagnosticMessage.Location
+import com.google.common.truth.Truth.assertThat
+import org.jetbrains.kotlin.cli.common.messages.CompilerMessageSeverity
+import org.junit.Test
+import org.junit.runner.RunWith
+import org.junit.runners.Parameterized
+import javax.tools.Diagnostic
+
+@RunWith(Parameterized::class)
+internal class DiagnosticMessageCollectorTest(
+ private val params: TestParams
+) {
+ @Test
+ fun parseDiagnosticMessage() {
+ val collector = DiagnosticsMessageCollector()
+ collector.report(
+ severity = params.severity,
+ message = params.message
+ )
+ assertThat(
+ collector.getDiagnostics().firstOrNull()
+ ).isEqualTo(params.expected)
+ }
+
+ internal class TestParams(
+ val message: String,
+ val severity: CompilerMessageSeverity,
+ val expected: RawDiagnosticMessage
+ ) {
+ override fun toString(): String {
+ return message
+ }
+ }
+ companion object {
+ @get:JvmStatic
+ @get:Parameterized.Parameters(name = "{0}")
+ internal val testCases = listOf(
+ // ksp kotlin
+ TestParams(
+ message = "[ksp] /foo/bar/Subject.kt:3: the real message",
+ severity = CompilerMessageSeverity.ERROR,
+ expected = RawDiagnosticMessage(
+ kind = Diagnostic.Kind.ERROR,
+ message = "the real message",
+ location = Location(
+ path = "/foo/bar/Subject.kt",
+ line = 3
+ )
+ )
+ ),
+ // ksp java
+ TestParams(
+ message = "[ksp] /foo/bar/Subject.java:3: the real message",
+ severity = CompilerMessageSeverity.ERROR,
+ expected = RawDiagnosticMessage(
+ kind = Diagnostic.Kind.ERROR,
+ message = "the real message",
+ location = Location(
+ path = "/foo/bar/Subject.java",
+ line = 3
+ )
+ )
+ ),
+ // ksp not a kotlin file - bad extension
+ TestParams(
+ message = "[ksp] /foo/bar/Subject.ktn:3: the real message",
+ severity = CompilerMessageSeverity.ERROR,
+ expected = RawDiagnosticMessage(
+ kind = Diagnostic.Kind.ERROR,
+ message = "/foo/bar/Subject.ktn:3: the real message",
+ location = null
+ )
+ ),
+ // ksp not a kotlin file - no dot
+ TestParams(
+ message = "[ksp] /foo/bar/Subjectkt:3: the real message",
+ severity = CompilerMessageSeverity.ERROR,
+ expected = RawDiagnosticMessage(
+ kind = Diagnostic.Kind.ERROR,
+ message = "/foo/bar/Subjectkt:3: the real message",
+ location = null
+ )
+ ),
+ // ksp not a java file - bad extension
+ TestParams(
+ message = "[ksp] /foo/bar/Subject.javax:3: the real message",
+ severity = CompilerMessageSeverity.ERROR,
+ expected = RawDiagnosticMessage(
+ kind = Diagnostic.Kind.ERROR,
+ message = "/foo/bar/Subject.javax:3: the real message",
+ location = null
+ )
+ ),
+ // ksp not a java file - no dot
+ TestParams(
+ message = "[ksp] /foo/bar/Subjectjava:3: the real message",
+ severity = CompilerMessageSeverity.ERROR,
+ expected = RawDiagnosticMessage(
+ kind = Diagnostic.Kind.ERROR,
+ message = "/foo/bar/Subjectjava:3: the real message",
+ location = null
+ )
+ ),
+ // kapt kotlin
+ TestParams(
+ message = "/foo/bar/Subject.kt:2: warning: the real message",
+ severity = CompilerMessageSeverity.WARNING,
+ expected = RawDiagnosticMessage(
+ kind = Diagnostic.Kind.WARNING,
+ message = "the real message",
+ location = Location(
+ path = "/foo/bar/Subject.kt",
+ line = 2
+ )
+ )
+ ),
+ // kapt java
+ TestParams(
+ message = "/foo/bar/Subject.java:2: warning: the real message",
+ severity = CompilerMessageSeverity.WARNING,
+ expected = RawDiagnosticMessage(
+ kind = Diagnostic.Kind.WARNING,
+ message = "the real message",
+ location = Location(
+ path = "/foo/bar/Subject.java",
+ line = 2
+ )
+ )
+ ),
+ // kapt not a kotlin file - bad extension
+ TestParams(
+ message = "/foo/bar/Subject.ktn:2: warning: the real message",
+ severity = CompilerMessageSeverity.WARNING,
+ expected = RawDiagnosticMessage(
+ kind = Diagnostic.Kind.WARNING,
+ message = "/foo/bar/Subject.ktn:2: warning: the real message",
+ location = null
+ )
+ ),
+ // kapt not a kotlin file - no dot
+ TestParams(
+ message = "/foo/bar/Subjectkt:2: warning: the real message",
+ severity = CompilerMessageSeverity.WARNING,
+ expected = RawDiagnosticMessage(
+ kind = Diagnostic.Kind.WARNING,
+ message = "/foo/bar/Subjectkt:2: warning: the real message",
+ location = null
+ )
+ ),
+ // kapt not a java file - bad extension
+ TestParams(
+ message = "/foo/bar/Subject.javan:2: warning: the real message",
+ severity = CompilerMessageSeverity.WARNING,
+ expected = RawDiagnosticMessage(
+ kind = Diagnostic.Kind.WARNING,
+ message = "/foo/bar/Subject.javan:2: warning: the real message",
+ location = null
+ )
+ ),
+ // kapt not a java file - no dot
+ TestParams(
+ message = "/foo/bar/Subjectjava:2: warning: the real message",
+ severity = CompilerMessageSeverity.WARNING,
+ expected = RawDiagnosticMessage(
+ kind = Diagnostic.Kind.WARNING,
+ message = "/foo/bar/Subjectjava:2: warning: the real message",
+ location = null
+ )
+ ),
+ )
+ }
+}
\ No newline at end of file
diff --git a/room/room-compiler-processing-testing/src/test/java/androidx/room/compiler/processing/util/DiagnosticsTest.kt b/room/room-compiler-processing-testing/src/test/java/androidx/room/compiler/processing/util/DiagnosticsTest.kt
new file mode 100644
index 0000000..196b794
--- /dev/null
+++ b/room/room-compiler-processing-testing/src/test/java/androidx/room/compiler/processing/util/DiagnosticsTest.kt
@@ -0,0 +1,220 @@
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * 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.
+ */
+
+package androidx.room.compiler.processing.util
+
+import androidx.room.compiler.processing.ExperimentalProcessingApi
+import com.google.common.truth.Truth.assertThat
+import org.junit.Test
+import org.junit.runner.RunWith
+import org.junit.runners.Parameterized
+import javax.tools.Diagnostic
+
+@RunWith(Parameterized::class)
+@OptIn(ExperimentalProcessingApi::class)
+class DiagnosticsTest internal constructor(
+ private val runTest: TestRunner
+) : MultiBackendTest() {
+
+ @Test
+ fun diagnosticsMessagesWithoutSource() {
+ runTest { invocation ->
+ invocation.processingEnv.messager.run {
+ printMessage(Diagnostic.Kind.NOTE, "note 1")
+ printMessage(Diagnostic.Kind.WARNING, "warn 1")
+ printMessage(Diagnostic.Kind.ERROR, "error 1")
+ }
+ invocation.assertCompilationResult {
+ hasNote("note 1")
+ hasWarning("warn 1")
+ hasError("error 1")
+ hasNoteContaining("ote")
+ hasWarningContaining("arn")
+ hasErrorContaining("rror")
+ // these should fail:
+ assertThat(
+ runCatching { hasNote("note") }.isFailure
+ ).isTrue()
+ assertThat(
+ runCatching { hasWarning("warn") }.isFailure
+ ).isTrue()
+ assertThat(
+ runCatching { hasError("error") }.isFailure
+ ).isTrue()
+ assertThat(
+ runCatching { hasNoteContaining("error") }.isFailure
+ ).isTrue()
+ assertThat(
+ runCatching { hasWarningContaining("note") }.isFailure
+ ).isTrue()
+ assertThat(
+ runCatching { hasErrorContaining("warning") }.isFailure
+ ).isTrue()
+ }
+ }
+ }
+
+ @Test
+ fun diagnoticMessageOnKotlinSource() {
+ runTest.assumeCanCompileKotlin()
+ val source = Source.kotlin(
+ "Subject.kt",
+ """
+ package foo.bar
+ class Subject {
+ val field: String = "foo"
+ }
+ """.trimIndent()
+ )
+ runTest(listOf(source)) { invocation ->
+ val field = invocation.processingEnv.requireTypeElement("foo.bar.Subject")
+ .getDeclaredFields().first()
+ invocation.processingEnv.messager.printMessage(
+ kind = Diagnostic.Kind.WARNING,
+ msg = "warning on field",
+ element = field
+ )
+ val expectedLine = if (invocation.isKsp) {
+ 3
+ } else {
+ // KAPT fails to report lines properly in certain cases
+ // (e.g. when searching for field, it uses its parent rather than itself)
+ // Hopefully, once it is fixed, this test will break and we can remove this if/else
+ // https://youtrack.jetbrains.com/issue/KT-47934
+ 2
+ }
+ invocation.assertCompilationResult {
+ hasWarningContaining("on field")
+ .onLine(expectedLine)
+ .onSource(source)
+ }
+ }
+ }
+
+ @Test
+ fun diagnoticMessageOnJavaSource() {
+ val source = Source.java(
+ "foo.bar.Subject",
+ """
+ package foo.bar;
+ public class Subject {
+ String field = "";
+ }
+ """.trimIndent()
+ )
+ runTest(listOf(source)) { invocation ->
+ val field = invocation.processingEnv.requireTypeElement("foo.bar.Subject")
+ .getDeclaredFields().first()
+ invocation.processingEnv.messager.printMessage(
+ kind = Diagnostic.Kind.WARNING,
+ msg = "warning on field",
+ element = field
+ )
+ invocation.assertCompilationResult {
+ hasWarningContaining("on field")
+ .onLine(3)
+ .onSource(source)
+ }
+ }
+ }
+
+ @Test
+ fun cleanJavaCompilationHasNoWarnings() {
+ val javaSource = Source.java(
+ "foo.bar.Subject",
+ """
+ package foo.bar;
+ public class Subject {
+ }
+ """.trimIndent()
+ )
+ cleanCompilationHasNoWarnings(javaSource)
+ cleanCompilationHasNoWarnings(
+ options = mapOf("foo" to "bar"),
+ javaSource
+ )
+ }
+
+ @Test
+ fun cleanKotlinCompilationHasNoWarnings() {
+ val kotlinSource = Source.kotlin(
+ "Subject",
+ """
+ package foo.bar
+ class Subject {
+ }
+ """.trimIndent()
+ )
+ cleanCompilationHasNoWarnings(kotlinSource)
+ cleanCompilationHasNoWarnings(
+ options = mapOf("foo" to "bar"),
+ kotlinSource
+ )
+ }
+
+ @Test
+ fun cleanJavaCompilationWithSomeAnnotationsHasNoWarnings() {
+ val annotation = Source.java(
+ "foo.bar.MyAnnotation",
+ """
+ package foo.bar;
+ public @interface MyAnnotation {}
+ """.trimIndent()
+ )
+ val source = Source.java(
+ "foo.bar.Subject",
+ """
+ package foo.bar;
+ @MyAnnotation
+ public class Subject {}
+ """.trimIndent()
+ )
+ cleanCompilationHasNoWarnings(annotation, source)
+ }
+
+ @Test
+ fun cleanKotlinCompilationWithSomeAnnotationsHasNoWarnings() {
+ val source = Source.kotlin(
+ "Foo.kt",
+ """
+ annotation class MyAnnotation
+
+ @MyAnnotation
+ class Subject {}
+ """.trimIndent()
+ )
+ cleanCompilationHasNoWarnings(source)
+ }
+
+ private fun cleanCompilationHasNoWarnings(
+ vararg source: Source
+ ) = cleanCompilationHasNoWarnings(options = emptyMap(), source = source)
+
+ private fun cleanCompilationHasNoWarnings(
+ options: Map<String, String>,
+ vararg source: Source
+ ) {
+ if (source.any { it is Source.KotlinSource }) {
+ runTest.assumeCanCompileKotlin()
+ }
+ runTest(options = options, sources = source.toList()) {
+ // no report
+ it.assertCompilationResult {
+ hasNoWarnings()
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/room/room-compiler-processing-testing/src/test/java/androidx/room/compiler/processing/util/GeneratedCodeMatchTest.kt b/room/room-compiler-processing-testing/src/test/java/androidx/room/compiler/processing/util/GeneratedCodeMatchTest.kt
index 87a28e2..08b0e61 100644
--- a/room/room-compiler-processing-testing/src/test/java/androidx/room/compiler/processing/util/GeneratedCodeMatchTest.kt
+++ b/room/room-compiler-processing-testing/src/test/java/androidx/room/compiler/processing/util/GeneratedCodeMatchTest.kt
@@ -16,6 +16,7 @@
package androidx.room.compiler.processing.util
+import androidx.room.compiler.processing.ExperimentalProcessingApi
import com.google.common.truth.Truth.assertThat
import com.squareup.javapoet.JavaFile
import com.squareup.javapoet.TypeName
@@ -29,6 +30,7 @@
import org.junit.runners.Parameterized
@RunWith(Parameterized::class)
+@OptIn(ExperimentalProcessingApi::class)
class GeneratedCodeMatchTest internal constructor(
private val runTest: TestRunner
) : MultiBackendTest() {
@@ -119,9 +121,7 @@
@Test
fun successfulGeneratedKotlinCodeMatch() {
// java environment will not generate kotlin files
- if (runTest.toString() == "java") {
- throw AssumptionViolatedException("javaAP won't generate kotlin code.")
- }
+ runTest.assumeCanCompileKotlin()
val file = FileSpec.builder("foo.bar", "Baz")
.addType(KTypeSpec.classBuilder("Baz").build())
@@ -141,9 +141,7 @@
@Test
fun missingGeneratedKotlinCode_mismatch() {
// java environment will not generate kotlin files
- if (runTest.toString() == "java") {
- throw AssumptionViolatedException("javaAP won't generate kotlin code.")
- }
+ runTest.assumeCanCompileKotlin()
val generated = FileSpec.builder("foo.bar", "Baz")
.addType(
diff --git a/room/room-compiler-processing-testing/src/test/java/androidx/room/compiler/processing/util/MultiBackendTest.kt b/room/room-compiler-processing-testing/src/test/java/androidx/room/compiler/processing/util/MultiBackendTest.kt
index 80e2465..80d423f 100644
--- a/room/room-compiler-processing-testing/src/test/java/androidx/room/compiler/processing/util/MultiBackendTest.kt
+++ b/room/room-compiler-processing-testing/src/test/java/androidx/room/compiler/processing/util/MultiBackendTest.kt
@@ -16,15 +16,37 @@
package androidx.room.compiler.processing.util
+import androidx.room.compiler.processing.ExperimentalProcessingApi
+import org.junit.AssumptionViolatedException
import org.junit.runners.Parameterized
+@OptIn(ExperimentalProcessingApi::class)
class TestRunner(
private val name: String,
- private val runner: (List<(XTestInvocation) -> Unit>) -> Unit
+ private val runner: (
+ sources: List<Source>,
+ options: Map<String, String>,
+ handlers: List<(XTestInvocation) -> Unit>
+ ) -> Unit
) {
- operator fun invoke(handlers: List<(XTestInvocation) -> Unit>) = runner(handlers)
- operator fun invoke(handler: (XTestInvocation) -> Unit) = runner(listOf(handler))
+ operator fun invoke(handlers: List<(XTestInvocation) -> Unit>) =
+ runner(emptyList(), emptyMap(), handlers)
+
+ operator fun invoke(handler: (XTestInvocation) -> Unit) =
+ runner(emptyList(), emptyMap(), listOf(handler))
+
+ operator fun invoke(
+ sources: List<Source>,
+ options: Map<String, String> = emptyMap(),
+ handler: (XTestInvocation) -> Unit
+ ) = runner(sources, options, listOf(handler))
+
override fun toString() = name
+ fun assumeCanCompileKotlin() {
+ if (name == "java") {
+ throw AssumptionViolatedException("cannot compile kotlin sources")
+ }
+ }
}
/**
@@ -32,18 +54,19 @@
*/
abstract class MultiBackendTest {
companion object {
+ @OptIn(ExperimentalProcessingApi::class)
@JvmStatic
@Parameterized.Parameters(name = "{0}")
fun runners(): List<TestRunner> = listOfNotNull(
- TestRunner("java") {
- runJavaProcessorTest(sources = emptyList(), handlers = it)
+ TestRunner("java") { sources, options, handlers ->
+ runJavaProcessorTest(sources = sources, options = options, handlers = handlers)
},
- TestRunner("kapt") {
- runKaptTest(sources = emptyList(), handlers = it)
+ TestRunner("kapt") { sources, options, handlers ->
+ runKaptTest(sources = sources, options = options, handlers = handlers)
},
if (CompilationTestCapabilities.canTestWithKsp) {
- TestRunner("ksp") {
- runKspTest(sources = emptyList(), handlers = it)
+ TestRunner("ksp") { sources, options, handlers ->
+ runKspTest(sources = sources, options = options, handlers = handlers)
}
} else {
null
diff --git a/room/room-compiler-processing-testing/src/test/java/androidx/room/compiler/processing/util/TestRunnerTest.kt b/room/room-compiler-processing-testing/src/test/java/androidx/room/compiler/processing/util/TestRunnerTest.kt
index 6ba44be..4bbab5b 100644
--- a/room/room-compiler-processing-testing/src/test/java/androidx/room/compiler/processing/util/TestRunnerTest.kt
+++ b/room/room-compiler-processing-testing/src/test/java/androidx/room/compiler/processing/util/TestRunnerTest.kt
@@ -17,16 +17,110 @@
package androidx.room.compiler.processing.util
import androidx.room.compiler.processing.ExperimentalProcessingApi
+import androidx.room.compiler.processing.SyntheticJavacProcessor
+import androidx.room.compiler.processing.SyntheticKspProcessor
+import androidx.room.compiler.processing.util.compiler.TestCompilationArguments
+import androidx.room.compiler.processing.util.compiler.compile
import com.google.common.truth.Truth.assertThat
+import com.google.devtools.ksp.processing.SymbolProcessor
+import com.google.devtools.ksp.processing.SymbolProcessorEnvironment
+import com.google.devtools.ksp.processing.SymbolProcessorProvider
import com.squareup.javapoet.CodeBlock
import com.squareup.javapoet.JavaFile
import com.squareup.javapoet.TypeSpec
+import com.squareup.kotlinpoet.FileSpec
+import com.squareup.kotlinpoet.KModifier
import org.junit.Test
+import java.net.URLClassLoader
+import java.nio.file.Files
+import javax.lang.model.element.Modifier
import javax.tools.Diagnostic
@OptIn(ExperimentalProcessingApi::class)
class TestRunnerTest {
@Test
+ fun compileFilesForClasspath() {
+ val kotlinSource = Source.kotlin(
+ "Foo.kt",
+ """
+ class KotlinClass1
+ class KotlinClass2
+ """.trimIndent()
+ )
+ val javaSource = Source.java(
+ "foo.bar.JavaClass1",
+ """
+ package foo.bar;
+ public class JavaClass1 {}
+ """.trimIndent()
+ )
+
+ val kspProcessorProvider = object : SymbolProcessorProvider {
+ override fun create(environment: SymbolProcessorEnvironment): SymbolProcessor {
+ return SyntheticKspProcessor(
+ environment,
+ listOf { invocation ->
+ if (
+ invocation.processingEnv.findTypeElement("gen.GeneratedKotlin")
+ == null
+ ) {
+ invocation.processingEnv.filer.write(
+ FileSpec.builder("gen", "KotlinGen")
+ .addType(
+ com.squareup.kotlinpoet.TypeSpec.classBuilder
+ ("GeneratedKotlin").build()
+ )
+ .build()
+ )
+ }
+ }
+ )
+ }
+ }
+
+ val javaProcessor = SyntheticJavacProcessor(
+ listOf { invocation ->
+ if (
+ invocation.processingEnv.findTypeElement("gen.GeneratedJava")
+ == null
+ ) {
+ invocation.processingEnv.filer.write(
+ JavaFile.builder(
+ "gen",
+ TypeSpec.classBuilder
+ ("GeneratedJava").build()
+ ).build()
+ )
+ }
+ }
+ )
+ val classpaths = compile(
+ workingDir = Files.createTempDirectory("test-runner").toFile(),
+ arguments = TestCompilationArguments(
+ sources = listOf(kotlinSource, javaSource),
+ symbolProcessorProviders = listOf(
+ kspProcessorProvider
+ ),
+ kaptProcessors = listOf(
+ javaProcessor
+ )
+ )
+ ).outputClasspath
+ val classLoader = URLClassLoader.newInstance(
+ classpaths.map {
+ it.toURI().toURL()
+ }.toTypedArray()
+ )
+
+ // try loading generated classes. If any of them fails, it will throw and fail the test
+ classLoader.loadClass("KotlinClass1")
+ classLoader.loadClass("KotlinClass2")
+ classLoader.loadClass("foo.bar.JavaClass1")
+ classLoader.loadClass("gen.GeneratedKotlin")
+ classLoader.loadClass("gen.GeneratedJava")
+ }
+
+ @Test
fun generatedBadCode_expected() = generatedBadCode(assertFailure = true)
@Test(expected = AssertionError::class)
@@ -38,22 +132,35 @@
"a" to "b",
"c" to "d"
)
- runProcessorTest(
- options = testOptions
- ) {
+ val handler: (XTestInvocation) -> Unit = {
assertThat(it.processingEnv.options).containsAtLeastEntriesIn(testOptions)
}
+ runJavaProcessorTest(
+ sources = emptyList(),
+ options = testOptions,
+ handler = handler
+ )
+ runKaptTest(
+ sources = emptyList(),
+ options = testOptions,
+ handler = handler
+ )
+ runKspTest(
+ sources = emptyList(),
+ options = testOptions,
+ handler = handler
+ )
}
private fun generatedBadCode(assertFailure: Boolean) {
+ val badCode = TypeSpec.classBuilder("Foo").apply {
+ addStaticBlock(
+ CodeBlock.of("bad code")
+ )
+ }.build()
+ val badGeneratedFile = JavaFile.builder("foo", badCode).build()
runProcessorTest {
if (it.processingEnv.findTypeElement("foo.Foo") == null) {
- val badCode = TypeSpec.classBuilder("Foo").apply {
- addStaticBlock(
- CodeBlock.of("bad code")
- )
- }.build()
- val badGeneratedFile = JavaFile.builder("foo", badCode).build()
it.processingEnv.filer.write(
badGeneratedFile
)
@@ -61,6 +168,8 @@
if (assertFailure) {
it.assertCompilationResult {
compilationDidFail()
+ hasErrorContaining("';' expected")
+ .onSource(Source.java("foo.Foo", badGeneratedFile.toString()))
}
}
}
@@ -72,44 +181,6 @@
@Test(expected = AssertionError::class)
fun reportedError_unexpected() = reportedError(assertFailure = false)
- @Test
- fun diagnosticsMessages() {
- runProcessorTest { invocation ->
- invocation.processingEnv.messager.run {
- printMessage(Diagnostic.Kind.NOTE, "note 1")
- printMessage(Diagnostic.Kind.WARNING, "warn 1")
- printMessage(Diagnostic.Kind.ERROR, "error 1")
- }
- invocation.assertCompilationResult {
- hasNote("note 1")
- hasWarning("warn 1")
- hasError("error 1")
- hasNoteContaining("ote")
- hasWarningContaining("arn")
- hasErrorContaining("rror")
- // these should fail:
- assertThat(
- runCatching { hasNote("note") }.isFailure
- ).isTrue()
- assertThat(
- runCatching { hasWarning("warn") }.isFailure
- ).isTrue()
- assertThat(
- runCatching { hasError("error") }.isFailure
- ).isTrue()
- assertThat(
- runCatching { hasNoteContaining("error") }.isFailure
- ).isTrue()
- assertThat(
- runCatching { hasWarningContaining("note") }.isFailure
- ).isTrue()
- assertThat(
- runCatching { hasErrorContaining("warning") }.isFailure
- ).isTrue()
- }
- }
- }
-
private fun reportedError(assertFailure: Boolean) {
runProcessorTest {
it.processingEnv.messager.printMessage(
@@ -125,6 +196,56 @@
}
@Test
+ fun accessGeneratedCode() {
+ val kotlinSource = Source.kotlin(
+ "KotlinSubject.kt",
+ """
+ val x: ToBeGeneratedKotlin? = null
+ val y: ToBeGeneratedJava? = null
+ """.trimIndent()
+ )
+ val javaSource = Source.java(
+ "JavaSubject",
+ """
+ public class JavaSubject {
+ public static ToBeGeneratedKotlin x;
+ public static ToBeGeneratedJava y;
+ }
+ """.trimIndent()
+ )
+ runProcessorTest(
+ sources = listOf(kotlinSource, javaSource)
+ ) { invocation ->
+ invocation.processingEnv.findTypeElement("ToBeGeneratedJava").let {
+ if (it == null) {
+ invocation.processingEnv.filer.write(
+ JavaFile.builder(
+ "",
+ TypeSpec.classBuilder("ToBeGeneratedJava").apply {
+ addModifiers(Modifier.PUBLIC)
+ }.build()
+ ).build()
+ )
+ }
+ }
+ invocation.processingEnv.findTypeElement("ToBeGeneratedKotlin").let {
+ if (it == null) {
+ invocation.processingEnv.filer.write(
+ FileSpec.builder("", "Foo")
+ .addType(
+ com.squareup.kotlinpoet.TypeSpec.classBuilder(
+ "ToBeGeneratedKotlin"
+ ).apply {
+ addModifiers(KModifier.PUBLIC)
+ }.build()
+ ).build()
+ )
+ }
+ }
+ }
+ }
+
+ @Test
fun syntacticErrorsAreVisibleInTheErrorMessage_java() {
val src = Source.java(
"test.Foo",
@@ -134,7 +255,7 @@
public static class Foo {}
""".trimIndent()
)
- val errorMessage = "error: modifier static not allowed here"
+ val errorMessage = "modifier static not allowed here"
val javapResult = runCatching {
runJavaProcessorTest(
sources = listOf(src),
diff --git a/room/room-compiler-processing/build.gradle b/room/room-compiler-processing/build.gradle
index 4715bac..d63f0af 100644
--- a/room/room-compiler-processing/build.gradle
+++ b/room/room-compiler-processing/build.gradle
@@ -40,7 +40,6 @@
testImplementation(libs.googleCompileTesting)
testImplementation(libs.junit)
testImplementation(libs.jsr250)
- testImplementation(libs.kotlinCompileTesting)
testImplementation(libs.ksp)
testImplementation(project(":room:room-compiler-processing-testing"))
}
diff --git a/room/room-compiler-processing/src/main/java/androidx/room/compiler/processing/InternalXAnnotated.kt b/room/room-compiler-processing/src/main/java/androidx/room/compiler/processing/InternalXAnnotated.kt
index 815df3f..f49f654 100644
--- a/room/room-compiler-processing/src/main/java/androidx/room/compiler/processing/InternalXAnnotated.kt
+++ b/room/room-compiler-processing/src/main/java/androidx/room/compiler/processing/InternalXAnnotated.kt
@@ -29,7 +29,6 @@
* this internal wrapper, we handle that inconsistency by finding the container class and
* asking implementers to implement the 2 arg version instead.
*
- * see: https://github.com/google/ksp/issues/356
* see: https://github.com/google/ksp/issues/358
* see: https://youtrack.jetbrains.com/issue/KT-12794
*
diff --git a/room/room-compiler-processing/src/main/java/androidx/room/compiler/processing/XProcessingEnv.kt b/room/room-compiler-processing/src/main/java/androidx/room/compiler/processing/XProcessingEnv.kt
index 9a9c0a9..93c740f 100644
--- a/room/room-compiler-processing/src/main/java/androidx/room/compiler/processing/XProcessingEnv.kt
+++ b/room/room-compiler-processing/src/main/java/androidx/room/compiler/processing/XProcessingEnv.kt
@@ -157,7 +157,8 @@
* @param packageName the package name to look up.
*
* @return A list of [XTypeElement] with matching package name. This will return declarations
- * from both dependencies and source.
+ * from both dependencies and source. If the package is not found an empty list will be
+ * returned.
*/
fun getTypeElementsFromPackage(packageName: String): List<XTypeElement>
diff --git a/room/room-compiler-processing/src/main/java/androidx/room/compiler/processing/javac/JavacProcessingEnv.kt b/room/room-compiler-processing/src/main/java/androidx/room/compiler/processing/javac/JavacProcessingEnv.kt
index aa80f8c..9f94777 100644
--- a/room/room-compiler-processing/src/main/java/androidx/room/compiler/processing/javac/JavacProcessingEnv.kt
+++ b/room/room-compiler-processing/src/main/java/androidx/room/compiler/processing/javac/JavacProcessingEnv.kt
@@ -77,6 +77,7 @@
// Note, to support Java Modules we would need to use "getAllPackageElements",
// but that is only available in Java 9+.
val packageElement = delegate.elementUtils.getPackageElement(packageName)
+ ?: return emptyList()
return packageElement.enclosedElements
.filterIsInstance<TypeElement>()
diff --git a/room/room-compiler-processing/src/main/java/androidx/room/compiler/processing/ksp/KSAsMemberOf.kt b/room/room-compiler-processing/src/main/java/androidx/room/compiler/processing/ksp/KSAsMemberOf.kt
index 1fd802b..53cd24a 100644
--- a/room/room-compiler-processing/src/main/java/androidx/room/compiler/processing/ksp/KSAsMemberOf.kt
+++ b/room/room-compiler-processing/src/main/java/androidx/room/compiler/processing/ksp/KSAsMemberOf.kt
@@ -16,13 +16,10 @@
package androidx.room.compiler.processing.ksp
-import com.google.devtools.ksp.symbol.KSFunction
import com.google.devtools.ksp.symbol.KSFunctionDeclaration
import com.google.devtools.ksp.symbol.KSPropertyDeclaration
import com.google.devtools.ksp.symbol.KSType
-import com.google.devtools.ksp.symbol.KSTypeParameter
import com.google.devtools.ksp.symbol.KSValueParameter
-import java.lang.UnsupportedOperationException
/**
* Returns the type of a property as if it is member of the given [ksType].
@@ -67,7 +64,7 @@
if (ksType == null) {
return resolved
}
- val asMember = functionDeclaration.safeAsMemberOf(
+ val asMember = functionDeclaration.asMemberOf(
containing = ksType
)
// TODO b/173224718
@@ -89,42 +86,8 @@
// object
resolved
}
- else -> this.safeAsMemberOf(
+ else -> this.asMemberOf(
containing = ksType
).returnType
} ?: error("cannot find return type for $this")
}
-
-/**
- * Runs asMemberOf while working around a KSP bug where if a java method overrides a property,
- * calling as member of fails it.
- */
-private fun KSFunctionDeclaration.safeAsMemberOf(
- containing: KSType
-): KSFunction {
- return try {
- asMemberOf(containing)
- } catch (unsupported: UnsupportedOperationException) {
- SyntheticKSFunction(this)
- }
-}
-
-/**
- * Workaround for https://github.com/google/ksp/issues/462
- */
-private class SyntheticKSFunction(
- val declaration: KSFunctionDeclaration
-) : KSFunction {
- override val extensionReceiverType: KSType?
- get() = declaration.extensionReceiver?.resolve()
- override val isError: Boolean
- get() = false
- override val parameterTypes: List<KSType?>
- get() = declaration.parameters.map { param ->
- param.type.resolve()
- }
- override val returnType: KSType?
- get() = declaration.returnType?.resolve()
- override val typeParameters: List<KSTypeParameter>
- get() = declaration.typeParameters
-}
\ No newline at end of file
diff --git a/room/room-compiler-processing/src/main/java/androidx/room/compiler/processing/ksp/KspMessager.kt b/room/room-compiler-processing/src/main/java/androidx/room/compiler/processing/ksp/KspMessager.kt
index 2acd207..c03ee6a 100644
--- a/room/room-compiler-processing/src/main/java/androidx/room/compiler/processing/ksp/KspMessager.kt
+++ b/room/room-compiler-processing/src/main/java/androidx/room/compiler/processing/ksp/KspMessager.kt
@@ -42,15 +42,16 @@
// In Javac, the Messager requires all preceding parameters to report an error.
// In KSP, the KspLogger only needs the last so ignore the preceding parameters.
- val ksNode = if (annotationValue != null) {
- (annotationValue as KspAnnotationValue).valueArgument
- } else if (annotation != null) {
- (annotation as KspAnnotation).ksAnnotated
- } else {
- (element as KspElement).declaration
- }
-
- if (ksNode.location == NonExistLocation) {
+ val nodes = sequence {
+ yield((annotationValue as? KspAnnotationValue)?.valueArgument)
+ yield((annotation as? KspAnnotation)?.ksAnnotated)
+ yield((element as? KspElement)?.declaration)
+ }.filterNotNull()
+ val ksNode = nodes.firstOrNull {
+ // pick first node with a location, if possible
+ it.location != NonExistLocation
+ } ?: nodes.firstOrNull() // fallback to the first non-null argument
+ if (ksNode == null || ksNode.location == NonExistLocation) {
internalPrintMessage(kind, "$msg - ${element.fallbackLocationText}", ksNode)
} else {
internalPrintMessage(kind, msg, ksNode)
diff --git a/room/room-compiler-processing/src/main/java/androidx/room/compiler/processing/ksp/KspMethodElement.kt b/room/room-compiler-processing/src/main/java/androidx/room/compiler/processing/ksp/KspMethodElement.kt
index 22811c2..e0fa644 100644
--- a/room/room-compiler-processing/src/main/java/androidx/room/compiler/processing/ksp/KspMethodElement.kt
+++ b/room/room-compiler-processing/src/main/java/androidx/room/compiler/processing/ksp/KspMethodElement.kt
@@ -41,7 +41,7 @@
@OptIn(KspExperimental::class)
override val name: String by lazy {
- env.resolver.safeGetJvmName(declaration)
+ env.resolver.getJvmName(declaration) ?: declaration.simpleName.asString()
}
override val executableType: XMethodType by lazy {
@@ -68,11 +68,12 @@
override fun hasKotlinDefaultImpl(): Boolean {
val parentDeclaration = declaration.parentDeclaration
- // if parent declaration is an interface and we are not marked as an abstract method,
- // we should have a default implementation
+ // if parent declaration is an interface and we are not marked as an abstract method nor
+ // we are a private function, then we should have a default implementation
return parentDeclaration is KSClassDeclaration &&
parentDeclaration.classKind == ClassKind.INTERFACE &&
- !declaration.isAbstract
+ !declaration.isAbstract &&
+ !isPrivate()
}
override fun overrides(other: XMethodElement, owner: XTypeElement): Boolean {
diff --git a/room/room-compiler-processing/src/main/java/androidx/room/compiler/processing/ksp/ResolverExt.kt b/room/room-compiler-processing/src/main/java/androidx/room/compiler/processing/ksp/ResolverExt.kt
index 8a290f1..9b9a9eb 100644
--- a/room/room-compiler-processing/src/main/java/androidx/room/compiler/processing/ksp/ResolverExt.kt
+++ b/room/room-compiler-processing/src/main/java/androidx/room/compiler/processing/ksp/ResolverExt.kt
@@ -19,7 +19,6 @@
import androidx.room.compiler.processing.XExecutableElement
import androidx.room.compiler.processing.XMethodElement
import androidx.room.compiler.processing.ksp.synthetic.KspSyntheticPropertyMethodElement
-import com.google.devtools.ksp.KspExperimental
import com.google.devtools.ksp.processing.Resolver
import com.google.devtools.ksp.symbol.KSDeclaration
import com.google.devtools.ksp.symbol.KSFunctionDeclaration
@@ -107,16 +106,3 @@
}
return true
}
-
-@OptIn(KspExperimental::class)
-internal fun Resolver.safeGetJvmName(
- declaration: KSFunctionDeclaration
-): String {
- return try {
- getJvmName(declaration) ?: declaration.simpleName.asString()
- } catch (cannotFindDeclaration: IllegalStateException) {
- // TODO remove this catch once that issue is fixed.
- // workaround for https://github.com/google/ksp/issues/240
- return declaration.simpleName.asString()
- }
-}
diff --git a/room/room-compiler-processing/src/main/java/androidx/room/compiler/processing/ksp/synthetic/KspSyntheticPropertyMethodElement.kt b/room/room-compiler-processing/src/main/java/androidx/room/compiler/processing/ksp/synthetic/KspSyntheticPropertyMethodElement.kt
index ca2508b..9c9e4f9 100644
--- a/room/room-compiler-processing/src/main/java/androidx/room/compiler/processing/ksp/synthetic/KspSyntheticPropertyMethodElement.kt
+++ b/room/room-compiler-processing/src/main/java/androidx/room/compiler/processing/ksp/synthetic/KspSyntheticPropertyMethodElement.kt
@@ -93,15 +93,15 @@
override val docComment: String?
get() = null
- override val thrownTypes: List<XType>
- get() {
- // TODO replace with the Resolver method when it is available. This solution works only
- // in sources.
- // https://github.com/google/ksp/issues/505
- return getAnnotation(Throws::class)
- ?.getAsTypeList("exceptionClasses")
- ?: emptyList()
- }
+ @OptIn(KspExperimental::class)
+ override val thrownTypes: List<XType> by lazy {
+ env.resolver.getJvmCheckedException(accessor).map {
+ env.wrap(
+ ksType = it,
+ allowPrimitives = false
+ )
+ }.toList()
+ }
final override fun asMemberOf(other: XType): XMethodType {
return KspSyntheticPropertyMethodType.create(
diff --git a/room/room-compiler-processing/src/test/java/androidx/room/compiler/processing/XAnnotationBoxTest.kt b/room/room-compiler-processing/src/test/java/androidx/room/compiler/processing/XAnnotationBoxTest.kt
index 9518163..7296fe5 100644
--- a/room/room-compiler-processing/src/test/java/androidx/room/compiler/processing/XAnnotationBoxTest.kt
+++ b/room/room-compiler-processing/src/test/java/androidx/room/compiler/processing/XAnnotationBoxTest.kt
@@ -239,17 +239,12 @@
.let { other ->
assertThat(other.value.value).isEqualTo("other single")
}
- if (invocation.isKsp) {
- // TODO fix when KSP support them
- // https://github.com/google/ksp/issues/356
- } else {
- annotation.getAsAnnotationBoxArray<OtherAnnotation>("otherAnnotationArray")
- .let { boxArray ->
- assertThat(boxArray).hasLength(2)
- assertThat(boxArray[0].value.value).isEqualTo("other list 1")
- assertThat(boxArray[1].value.value).isEqualTo("other list 2")
- }
- }
+ annotation.getAsAnnotationBoxArray<OtherAnnotation>("otherAnnotationArray")
+ .let { boxArray ->
+ assertThat(boxArray).hasLength(2)
+ assertThat(boxArray[0].value.value).isEqualTo("other list 1")
+ assertThat(boxArray[1].value.value).isEqualTo("other list 2")
+ }
}
}
}
@@ -625,26 +620,21 @@
listOf("JavaSubject", "KotlinSubject")
.map(invocation.processingEnv::requireTypeElement)
.forEach { subject ->
- if (invocation.isKsp && preCompiled) {
- // TODO remove once https://github.com/google/ksp/issues/356 is fixed
- // KSP cannot read array of annotation values in compiled code
- } else {
- val annotations = subject.getAnnotations(
+ val annotations = subject.getAnnotations(
+ RepeatableJavaAnnotation::class
+ )
+ assertThat(
+ subject.hasAnnotation(
RepeatableJavaAnnotation::class
)
- assertThat(
- subject.hasAnnotation(
- RepeatableJavaAnnotation::class
- )
- ).isTrue()
- val values = annotations
- .map {
- it.value.value
- }
- assertWithMessage(subject.qualifiedName)
- .that(values)
- .containsExactly("x", "y", "z")
- }
+ ).isTrue()
+ val values = annotations
+ .map {
+ it.value.value
+ }
+ assertWithMessage(subject.qualifiedName)
+ .that(values)
+ .containsExactly("x", "y", "z")
}
}
}
@@ -673,26 +663,21 @@
listOf("JavaSubject", "KotlinSubject")
.map(invocation.processingEnv::requireTypeElement)
.forEach { subject ->
- if (invocation.isKsp && preCompiled) {
- // TODO remove once https://github.com/google/ksp/issues/356 is fixed
- // KSP cannot read array of annotation values in compiled code
- } else {
- val annotations = subject.getAnnotations(
+ val annotations = subject.getAnnotations(
+ RepeatableJavaAnnotation::class
+ )
+ assertThat(
+ subject.hasAnnotation(
RepeatableJavaAnnotation::class
)
- assertThat(
- subject.hasAnnotation(
- RepeatableJavaAnnotation::class
- )
- ).isTrue()
- val values = annotations
- .map {
- it.value.value
- }
- assertWithMessage(subject.qualifiedName)
- .that(values)
- .containsExactly("x")
- }
+ ).isTrue()
+ val values = annotations
+ .map {
+ it.value.value
+ }
+ assertWithMessage(subject.qualifiedName)
+ .that(values)
+ .containsExactly("x")
}
}
}
diff --git a/room/room-compiler-processing/src/test/java/androidx/room/compiler/processing/XExecutableElementTest.kt b/room/room-compiler-processing/src/test/java/androidx/room/compiler/processing/XExecutableElementTest.kt
index 9f9a1df..1c8c910 100644
--- a/room/room-compiler-processing/src/test/java/androidx/room/compiler/processing/XExecutableElementTest.kt
+++ b/room/room-compiler-processing/src/test/java/androidx/room/compiler/processing/XExecutableElementTest.kt
@@ -128,26 +128,29 @@
val subject = Source.kotlin(
"Baz.kt",
"""
- package foo.bar;
- import java.util.List;
+ package foo.bar
+
interface Baz {
fun noDefault()
fun withDefault(): Int {
- return 3;
+ return 3
}
fun nameMatch()
fun nameMatch(param:Int) {}
fun withDefaultWithParams(param1:Int, param2:String) {}
fun withDefaultWithTypeArgs(param1: List<String>): String {
- return param1.first();
+ return param1.first()
+ }
+ private fun privateWithDefault(): String {
+ return ""
}
}
""".trimIndent()
)
runProcessorTest(
sources = listOf(subject)
- ) {
- val element = it.processingEnv.requireTypeElement("foo.bar.Baz")
+ ) { invocation ->
+ val element = invocation.processingEnv.requireTypeElement("foo.bar.Baz")
element.getDeclaredMethod("noDefault").let { method ->
assertThat(method.hasKotlinDefaultImpl()).isFalse()
}
@@ -173,6 +176,12 @@
element.getDeclaredMethod("withDefaultWithTypeArgs").let { method ->
assertThat(method.hasKotlinDefaultImpl()).isTrue()
}
+ // private functions in interfaces don't appear in kapt stubs
+ if (invocation.isKsp) {
+ element.getDeclaredMethod("privateWithDefault").let { method ->
+ assertThat(method.hasKotlinDefaultImpl()).isFalse()
+ }
+ }
}
}
@@ -770,6 +779,7 @@
}
// TODO
// add lib here once https://github.com/google/ksp/issues/507 is fixed
+ // also need https://github.com/google/ksp/issues/505 to be fixed for accessors.
listOf("app").forEach { pkg ->
invocation.processingEnv.requireTypeElement("$pkg.KotlinSubject").let { subject ->
assertWithMessage(subject.qualifiedName).that(
diff --git a/room/room-compiler-processing/src/test/java/androidx/room/compiler/processing/XMessagerTest.kt b/room/room-compiler-processing/src/test/java/androidx/room/compiler/processing/XMessagerTest.kt
index 7777a76..4091a00 100644
--- a/room/room-compiler-processing/src/test/java/androidx/room/compiler/processing/XMessagerTest.kt
+++ b/room/room-compiler-processing/src/test/java/androidx/room/compiler/processing/XMessagerTest.kt
@@ -121,7 +121,8 @@
compilationDidFail()
hasErrorCount(1)
hasWarningCount(0)
- hasError("intentional failure")
+ hasErrorContaining("intentional failure")
+ .onLineContaining("class Foo")
}
}
}
@@ -163,7 +164,8 @@
compilationDidFail()
hasErrorCount(1)
hasWarningCount(0)
- hasError("intentional failure")
+ hasErrorContaining("intentional failure")
+ .onLineContaining("@FooAnnotation")
}
}
}
@@ -212,7 +214,8 @@
compilationDidFail()
hasErrorCount(1)
hasWarningCount(0)
- hasError("intentional failure")
+ hasErrorContaining("intentional failure")
+ .onLineContaining("@FooAnnotation")
}
}
}
diff --git a/room/room-compiler-processing/src/test/java/androidx/room/compiler/processing/XProcessingStepTest.kt b/room/room-compiler-processing/src/test/java/androidx/room/compiler/processing/XProcessingStepTest.kt
index 725f89f..993a4d0 100644
--- a/room/room-compiler-processing/src/test/java/androidx/room/compiler/processing/XProcessingStepTest.kt
+++ b/room/room-compiler-processing/src/test/java/androidx/room/compiler/processing/XProcessingStepTest.kt
@@ -22,6 +22,9 @@
import androidx.room.compiler.processing.testcode.MainAnnotation
import androidx.room.compiler.processing.testcode.OtherAnnotation
import androidx.room.compiler.processing.util.CompilationTestCapabilities
+import androidx.room.compiler.processing.util.Source
+import androidx.room.compiler.processing.util.compiler.TestCompilationArguments
+import androidx.room.compiler.processing.util.compiler.compile
import com.google.common.truth.Truth.assertAbout
import com.google.common.truth.Truth.assertThat
import com.google.devtools.ksp.processing.SymbolProcessor
@@ -36,9 +39,6 @@
import com.squareup.javapoet.JavaFile
import com.squareup.javapoet.TypeName
import com.squareup.javapoet.TypeSpec
-import com.tschuchort.compiletesting.KotlinCompilation
-import com.tschuchort.compiletesting.SourceFile
-import com.tschuchort.compiletesting.symbolProcessorProviders
import org.junit.Rule
import org.junit.Test
import org.junit.rules.TemporaryFolder
@@ -348,8 +348,8 @@
@Test
fun kspProcessingEnvCaching() {
- val main = SourceFile.java(
- "Main.java",
+ val main = Source.java(
+ "foo.bar.Main",
"""
package foo.bar;
import androidx.room.compiler.processing.testcode.*;
@@ -411,14 +411,14 @@
}
}
}
- KotlinCompilation().apply {
- workingDir = temporaryFolder.root
- inheritClassPath = true
- symbolProcessorProviders = listOf(processorProvider)
- sources = listOf(main)
- verbose = false
- }.compile()
+ compile(
+ workingDir = temporaryFolder.root,
+ arguments = TestCompilationArguments(
+ sources = listOf(main),
+ symbolProcessorProviders = listOf(processorProvider)
+ )
+ )
// Makes sure processingSteps() was only called once, and that the xProcessingEnv was set.
assertThat(xProcessingEnvs).hasSize(1)
assertThat(xProcessingEnvs.get(0)).isNotNull()
@@ -517,7 +517,7 @@
}
}
}
- val main = SourceFile.kotlin(
+ val main = Source.kotlin(
"Other.kt",
"""
package foo.bar
@@ -528,13 +528,13 @@
""".trimIndent()
)
- KotlinCompilation().apply {
- workingDir = temporaryFolder.root
- inheritClassPath = true
- symbolProcessorProviders = listOf(processorProvider)
- sources = listOf(main)
- verbose = false
- }.compile()
+ compile(
+ workingDir = temporaryFolder.root,
+ arguments = TestCompilationArguments(
+ sources = listOf(main),
+ symbolProcessorProviders = listOf(processorProvider)
+ )
+ )
assertThat(returned).apply {
isNotNull()
@@ -726,7 +726,7 @@
@Test
fun kspAnnotatedElementsByStep() {
- val main = SourceFile.kotlin(
+ val main = Source.kotlin(
"Classes.kt",
"""
package foo.bar
@@ -774,13 +774,13 @@
}
}
}
- KotlinCompilation().apply {
- workingDir = temporaryFolder.root
- inheritClassPath = true
- symbolProcessorProviders = listOf(processorProvider)
- sources = listOf(main)
- verbose = false
- }.compile()
+ compile(
+ workingDir = temporaryFolder.root,
+ arguments = TestCompilationArguments(
+ sources = listOf(main),
+ symbolProcessorProviders = listOf(processorProvider)
+ )
+ )
assertThat(elementsByStep[mainStep])
.containsExactly("foo.bar.Main")
assertThat(elementsByStep[otherStep])
@@ -790,7 +790,7 @@
@Test
fun kspDeferredStep() {
// create a scenario where we defer the first round of processing
- val main = SourceFile.kotlin(
+ val main = Source.kotlin(
"Classes.kt",
"""
package foo.bar
@@ -840,14 +840,13 @@
}
}
}
- KotlinCompilation().apply {
- workingDir = temporaryFolder.root
- inheritClassPath = true
- symbolProcessorProviders = listOf(processorProvider)
- sources = listOf(main)
- verbose = false
- }.compile()
-
+ compile(
+ workingDir = temporaryFolder.root,
+ arguments = TestCompilationArguments(
+ sources = listOf(main),
+ symbolProcessorProviders = listOf(processorProvider)
+ )
+ )
// Assert that mainStep was processed twice due to deferring
assertThat(stepsProcessed).containsExactly(mainStep, mainStep)
@@ -857,7 +856,7 @@
@Test
fun kspStepOnlyCalledIfElementsToProcess() {
- val main = SourceFile.kotlin(
+ val main = Source.kotlin(
"Classes.kt",
"""
package foo.bar
@@ -900,13 +899,13 @@
}
}
}
- KotlinCompilation().apply {
- workingDir = temporaryFolder.root
- inheritClassPath = true
- symbolProcessorProviders = listOf(processorProvider)
- sources = listOf(main)
- verbose = false
- }.compile()
+ compile(
+ workingDir = temporaryFolder.root,
+ arguments = TestCompilationArguments(
+ sources = listOf(main),
+ symbolProcessorProviders = listOf(processorProvider)
+ )
+ )
assertThat(stepsProcessed).containsExactly(mainStep)
}
}
\ No newline at end of file
diff --git a/room/room-compiler-processing/src/test/java/androidx/room/compiler/processing/XRoundEnvTest.kt b/room/room-compiler-processing/src/test/java/androidx/room/compiler/processing/XRoundEnvTest.kt
index 1645db1..5e76aa8b 100644
--- a/room/room-compiler-processing/src/test/java/androidx/room/compiler/processing/XRoundEnvTest.kt
+++ b/room/room-compiler-processing/src/test/java/androidx/room/compiler/processing/XRoundEnvTest.kt
@@ -254,6 +254,17 @@
}
}
+ @Test
+ fun getElementsFromPackageReturnsEmptyListForUnknownPackage() {
+ runProcessorTest { testInvocation ->
+ val kspElements = testInvocation.processingEnv.getTypeElementsFromPackage(
+ "com.example.unknown.package"
+ )
+
+ assertThat(kspElements).isEmpty()
+ }
+ }
+
annotation class TopLevelAnnotation
@Suppress("unused") // used in tests
diff --git a/room/room-compiler-processing/src/test/java/androidx/room/compiler/processing/XTypeTest.kt b/room/room-compiler-processing/src/test/java/androidx/room/compiler/processing/XTypeTest.kt
index 812a81e..9d0d7e4 100644
--- a/room/room-compiler-processing/src/test/java/androidx/room/compiler/processing/XTypeTest.kt
+++ b/room/room-compiler-processing/src/test/java/androidx/room/compiler/processing/XTypeTest.kt
@@ -364,7 +364,7 @@
@Test
fun isVoidObject() {
val javaBase = Source.java(
- "JavaInterface.java",
+ "JavaInterface",
"""
import java.lang.Void;
interface JavaInterface {
diff --git a/room/room-compiler/src/main/kotlin/androidx/room/ext/xtype_ext.kt b/room/room-compiler/src/main/kotlin/androidx/room/ext/xtype_ext.kt
index f003876..f8fcf20 100644
--- a/room/room-compiler/src/main/kotlin/androidx/room/ext/xtype_ext.kt
+++ b/room/room-compiler/src/main/kotlin/androidx/room/ext/xtype_ext.kt
@@ -17,7 +17,9 @@
package androidx.room.ext
import androidx.room.compiler.processing.XType
+import androidx.room.compiler.processing.isArray
import androidx.room.compiler.processing.isByte
+import androidx.room.compiler.processing.isEnum
import androidx.room.compiler.processing.isKotlinUnit
import androidx.room.compiler.processing.isVoid
import androidx.room.compiler.processing.isVoidObject
@@ -56,15 +58,23 @@
/**
* Checks if the class of the provided type has the equals() and hashCode() methods declared.
+ *
+ * Certain Room types and database primitive types are considered to implements equals and
+ * hashcode.
+ *
* If they are not found at the current class level, the method recursively moves on to the
* super class level and continues to look for these declared methods.
*/
fun XType.implementsEqualsAndHashcode(): Boolean {
- if (this.typeName.isPrimitive || this.typeName.isBoxedPrimitive) {
- return true
- }
+ if (this.typeName.isPrimitive) return true
+ if (this.typeName.isBoxedPrimitive) return true
+ if (this.typeName == CommonTypeNames.STRING) return true
+ if (this.isTypeOf(ByteArray::class)) return true
+ if (this.isArray() && this.isByte()) return true
+
val typeElement = this.typeElement ?: return false
+ if (this.typeElement!!.isEnum()) return true
if (typeElement.className == ClassName.OBJECT) {
return false
}
diff --git a/room/room-compiler/src/main/kotlin/androidx/room/parser/optimization/RemoveUnusedColumnQueryRewriter.kt b/room/room-compiler/src/main/kotlin/androidx/room/parser/optimization/RemoveUnusedColumnQueryRewriter.kt
index 56264f6..d3af5f2 100644
--- a/room/room-compiler/src/main/kotlin/androidx/room/parser/optimization/RemoveUnusedColumnQueryRewriter.kt
+++ b/room/room-compiler/src/main/kotlin/androidx/room/parser/optimization/RemoveUnusedColumnQueryRewriter.kt
@@ -36,9 +36,7 @@
if (resultAdapter.mappings.isEmpty()) {
return query
}
- val usedColumns = resultAdapter.mappings.flatMap { mapping ->
- mapping.matchedFields.map { it.columnName }
- }
+ val usedColumns = resultAdapter.mappings.flatMap { it.usedColumns }
val columnNames = resultInfo.columns.map { it.name }
val unusedColumns = columnNames - usedColumns
if (unusedColumns.isEmpty()) {
diff --git a/room/room-compiler/src/main/kotlin/androidx/room/processor/ProcessorErrors.kt b/room/room-compiler/src/main/kotlin/androidx/room/processor/ProcessorErrors.kt
index e09366f..543b2fe9 100644
--- a/room/room-compiler/src/main/kotlin/androidx/room/processor/ProcessorErrors.kt
+++ b/room/room-compiler/src/main/kotlin/androidx/room/processor/ProcessorErrors.kt
@@ -134,7 +134,7 @@
fun cannotFindQueryResultAdapter(returnTypeName: TypeName) = "Not sure how to convert a " +
"Cursor to this method's return type ($returnTypeName)."
- fun classMustImplementEqualsAndHashCode(mapType: TypeName, keyType: TypeName) = "The key" +
+ fun classMustImplementEqualsAndHashCode(mapType: String, keyType: String) = "The key" +
" of the provided method's multimap return type ($mapType) must implement equals() and " +
"hashCode(). Key type is: $keyType."
@@ -144,6 +144,13 @@
val DELETION_MISSING_PARAMS = "Method annotated with" +
" @Delete but does not have any parameters to delete."
+ fun cannotMapInfoSpecifiedColumn(column: String, columnsInQuery: List<String>) =
+ "Column(s) specified in the provided @MapInfo annotation must be present in the query. " +
+ "Provided: $column. Columns Found: ${columnsInQuery.joinToString(", ")}"
+
+ val MAP_INFO_MUST_HAVE_AT_LEAST_ONE_COLUMN_PROVIDED = "To use the @MapInfo annotation, you " +
+ "must provide either the key column name, value column name, or both."
+
val CANNOT_FIND_DELETE_RESULT_ADAPTER = "Not sure how to handle delete method's " +
"return type. Currently the supported return types are void, int or Int."
diff --git a/room/room-compiler/src/main/kotlin/androidx/room/processor/QueryMethodProcessor.kt b/room/room-compiler/src/main/kotlin/androidx/room/processor/QueryMethodProcessor.kt
index 55b23e7..49c17c2 100644
--- a/room/room-compiler/src/main/kotlin/androidx/room/processor/QueryMethodProcessor.kt
+++ b/room/room-compiler/src/main/kotlin/androidx/room/processor/QueryMethodProcessor.kt
@@ -25,9 +25,11 @@
import androidx.room.parser.ParsedQuery
import androidx.room.parser.QueryType
import androidx.room.parser.SqlParser
+import androidx.room.processor.ProcessorErrors.cannotMapInfoSpecifiedColumn
import androidx.room.solver.query.result.PojoRowAdapter
import androidx.room.verifier.DatabaseVerificationErrors
import androidx.room.verifier.DatabaseVerifier
+import androidx.room.vo.MapInfo
import androidx.room.vo.QueryMethod
import androidx.room.vo.QueryParameter
import androidx.room.vo.ReadQueryMethod
@@ -201,7 +203,32 @@
returnType: XType,
query: ParsedQuery
): QueryMethod {
- val resultBinder = delegate.findResultBinder(returnType, query) { }
+ val resultBinder = delegate.findResultBinder(returnType, query) {
+ delegate.executableElement.getAnnotation(androidx.room.MapInfo::class)?.let {
+ mapInfoAnnotation ->
+ // Check if method is annotated with @MapInfo, parse annotation and put information in
+ // bag of extras, it will be later used by the TypeAdapterStore
+ val resultColumns = query.resultInfo?.columns?.map { it.name } ?: emptyList()
+ val keyColumn = mapInfoAnnotation.value.keyColumn.toString()
+ val valueColumn = mapInfoAnnotation.value.valueColumn.toString()
+ context.checker.check(
+ keyColumn.isEmpty() || resultColumns.contains(keyColumn),
+ delegate.executableElement,
+ cannotMapInfoSpecifiedColumn(keyColumn, resultColumns)
+ )
+ context.checker.check(
+ valueColumn.isEmpty() || resultColumns.contains(valueColumn),
+ delegate.executableElement,
+ cannotMapInfoSpecifiedColumn(valueColumn, resultColumns)
+ )
+ context.checker.check(
+ keyColumn.isNotEmpty() || valueColumn.isNotEmpty(),
+ executableElement,
+ ProcessorErrors.MAP_INFO_MUST_HAVE_AT_LEAST_ONE_COLUMN_PROVIDED
+ )
+ putData(MapInfo::class, MapInfo(keyColumn, valueColumn))
+ }
+ }
context.checker.check(
resultBinder.adapter != null,
executableElement,
@@ -227,20 +254,19 @@
val mappings = resultBinder.adapter?.mappings ?: return@let
// If there are no mapping (e.g. might be a primitive return type result), then we
// can't reasonable determine cursor mismatch.
- if (mappings.isEmpty()) {
+ if (mappings.isEmpty() || mappings.none { it is PojoRowAdapter.PojoMapping }) {
return@let
}
- val usedColumns = mappings.flatMap { mapping ->
- mapping.matchedFields.map { it.columnName }
- }
+ val usedColumns = mappings.flatMap { it.usedColumns }
val columnNames = queryResultInfo.columns.map { it.name }
val unusedColumns = columnNames - usedColumns
- val pojoUnusedFields = mappings
+ val pojoMappings = mappings.filterIsInstance<PojoRowAdapter.PojoMapping>()
+ val pojoUnusedFields = pojoMappings
.filter { it.unusedFields.isNotEmpty() }
.associate { it.pojo.typeName to it.unusedFields }
if (unusedColumns.isNotEmpty() || pojoUnusedFields.isNotEmpty()) {
val warningMsg = ProcessorErrors.cursorPojoMismatch(
- pojoTypeNames = mappings.map { it.pojo.typeName },
+ pojoTypeNames = pojoMappings.map { it.pojo.typeName },
unusedColumns = unusedColumns,
allColumns = columnNames,
pojoUnusedFields = pojoUnusedFields,
diff --git a/room/room-compiler/src/main/kotlin/androidx/room/processor/RawQueryMethodProcessor.kt b/room/room-compiler/src/main/kotlin/androidx/room/processor/RawQueryMethodProcessor.kt
index b8f99b74..42fe78b 100644
--- a/room/room-compiler/src/main/kotlin/androidx/room/processor/RawQueryMethodProcessor.kt
+++ b/room/room-compiler/src/main/kotlin/androidx/room/processor/RawQueryMethodProcessor.kt
@@ -26,6 +26,7 @@
import androidx.room.compiler.processing.XType
import androidx.room.compiler.processing.XVariableElement
import androidx.room.processor.ProcessorErrors.RAW_QUERY_STRING_PARAMETER_REMOVED
+import androidx.room.vo.MapInfo
import androidx.room.vo.RawQueryMethod
class RawQueryMethodProcessor(
@@ -52,7 +53,20 @@
val observedTableNames = processObservedTables()
val query = SqlParser.rawQueryForTables(observedTableNames)
// build the query but don't calculate result info since we just guessed it.
- val resultBinder = delegate.findResultBinder(returnType, query) { }
+ val resultBinder = delegate.findResultBinder(returnType, query) {
+ delegate.executableElement.getAnnotation(androidx.room.MapInfo::class)?.let {
+ val keyColumn = it.value.keyColumn.toString()
+ val valueColumn = it.value.valueColumn.toString()
+
+ context.checker.check(
+ keyColumn.isNotEmpty() || valueColumn.isNotEmpty(),
+ executableElement,
+ ProcessorErrors.MAP_INFO_MUST_HAVE_AT_LEAST_ONE_COLUMN_PROVIDED
+ )
+ putData(MapInfo::class, MapInfo(keyColumn, valueColumn))
+ }
+ }
+
val runtimeQueryParam = findRuntimeQueryParameter(delegate.extractParams())
val inTransaction = executableElement.hasAnnotation(Transaction::class)
val rawQueryMethod = RawQueryMethod(
diff --git a/room/room-compiler/src/main/kotlin/androidx/room/solver/TypeAdapterStore.kt b/room/room-compiler/src/main/kotlin/androidx/room/solver/TypeAdapterStore.kt
index 4d19b49..8816693 100644
--- a/room/room-compiler/src/main/kotlin/androidx/room/solver/TypeAdapterStore.kt
+++ b/room/room-compiler/src/main/kotlin/androidx/room/solver/TypeAdapterStore.kt
@@ -70,6 +70,7 @@
import androidx.room.solver.query.result.RowAdapter
import androidx.room.solver.query.result.SingleColumnRowAdapter
import androidx.room.solver.query.result.SingleEntityQueryResultAdapter
+import androidx.room.solver.query.result.SingleNamedColumnRowAdapter
import androidx.room.solver.shortcut.binder.DeleteOrUpdateMethodBinder
import androidx.room.solver.shortcut.binder.InsertMethodBinder
import androidx.room.solver.shortcut.binderprovider.DeleteOrUpdateMethodBinderProvider
@@ -97,6 +98,7 @@
import androidx.room.solver.types.StatementValueBinder
import androidx.room.solver.types.StringColumnTypeAdapter
import androidx.room.solver.types.TypeConverter
+import androidx.room.vo.MapInfo
import androidx.room.vo.ShortcutQueryParameter
import androidx.room.vo.Warning
import com.google.common.annotations.VisibleForTesting
@@ -454,6 +456,7 @@
if (typeMirror.isError()) {
return null
}
+
// TODO: (b/192068912) Refactor the following since this if-else cascade has gotten large
if (typeMirror.isArray() && typeMirror.componentType.isNotByte()) {
val rowAdapter =
@@ -509,6 +512,18 @@
keyTypeArg,
valueTypeArg
)
+
+ if (!keyTypeArg.implementsEqualsAndHashcode()) {
+ context.logger.w(
+ Warning.DOES_NOT_IMPLEMENT_EQUALS_HASHCODE,
+ keyTypeArg.typeElement,
+ classMustImplementEqualsAndHashCode(
+ typeMirror.typeName.toString(),
+ keyTypeArg.typeName.toString()
+ )
+ )
+ }
+
val resultAdapter = findQueryResultAdapter(mapType, query, extras) ?: return null
return ImmutableMapQueryResultAdapter(
keyTypeArg = keyTypeArg,
@@ -540,17 +555,49 @@
return null
}
+ if (!keyTypeArg.implementsEqualsAndHashcode()) {
+ context.logger.w(
+ Warning.DOES_NOT_IMPLEMENT_EQUALS_HASHCODE,
+ keyTypeArg.typeElement,
+ classMustImplementEqualsAndHashCode(
+ typeMirror.typeName.toString(),
+ keyTypeArg.typeName.toString()
+ )
+ )
+ }
+
+ // Get @MapInfo info if any (this might be null)
+ val mapInfo = extras.getData(MapInfo::class)
return GuavaImmutableMultimapQueryResultAdapter(
keyTypeArg = keyTypeArg,
valueTypeArg = valueTypeArg,
- keyRowAdapter = findRowAdapter(keyTypeArg, query) ?: return null,
- valueRowAdapter = findRowAdapter(valueTypeArg, query) ?: return null,
+ keyRowAdapter = findRowAdapter(
+ typeMirror = keyTypeArg,
+ query = query,
+ columnName = mapInfo?.keyColumnName
+ ) ?: return null,
+ valueRowAdapter = findRowAdapter(
+ typeMirror = valueTypeArg,
+ query = query,
+ columnName = mapInfo?.valueColumnName
+ ) ?: return null,
immutableClassName = immutableClassName
)
} else if (typeMirror.isTypeOf(java.util.Map::class)) {
val keyTypeArg = typeMirror.typeArguments[0].extendsBoundOrSelf()
val mapValueTypeArg = typeMirror.typeArguments[1].extendsBoundOrSelf()
+ if (!keyTypeArg.implementsEqualsAndHashcode()) {
+ context.logger.w(
+ Warning.DOES_NOT_IMPLEMENT_EQUALS_HASHCODE,
+ keyTypeArg.typeElement,
+ classMustImplementEqualsAndHashCode(
+ typeMirror.typeName.toString(),
+ keyTypeArg.typeName.toString()
+ )
+ )
+ }
+
if (mapValueTypeArg.typeElement == null) {
context.logger.e(
"Multimap 'value' collection type argument does not represent a class. " +
@@ -559,17 +606,9 @@
return null
}
// TODO: Handle nested collection values in the map
- if (!keyTypeArg.implementsEqualsAndHashcode()) {
- context.logger.w(
- Warning.DOES_NOT_IMPLEMENT_EQUALS_HASHCODE,
- keyTypeArg.typeElement,
- classMustImplementEqualsAndHashCode(
- typeMirror.typeName,
- keyTypeArg.typeName
- )
- )
- }
+ // Get @MapInfo info if any (this might be null)
+ val mapInfo = extras.getData(MapInfo::class)
val collectionTypeRaw = context.COMMON_TYPES.READONLY_COLLECTION.rawType
if (collectionTypeRaw.isAssignableFrom(mapValueTypeArg.rawType)) {
// The Map's value type argument is assignable to a Collection, we need to make
@@ -582,8 +621,16 @@
return MapQueryResultAdapter(
keyTypeArg = keyTypeArg,
valueTypeArg = valueTypeArg,
- keyRowAdapter = findRowAdapter(keyTypeArg, query) ?: return null,
- valueRowAdapter = findRowAdapter(valueTypeArg, query) ?: return null,
+ keyRowAdapter = findRowAdapter(
+ typeMirror = keyTypeArg,
+ query = query,
+ columnName = mapInfo?.keyColumnName
+ ) ?: return null,
+ valueRowAdapter = findRowAdapter(
+ typeMirror = valueTypeArg,
+ query = query,
+ columnName = mapInfo?.valueColumnName
+ ) ?: return null,
valueCollectionType = mapValueTypeArg
)
} else {
@@ -596,8 +643,16 @@
return MapQueryResultAdapter(
keyTypeArg = keyTypeArg,
valueTypeArg = mapValueTypeArg,
- keyRowAdapter = findRowAdapter(keyTypeArg, query) ?: return null,
- valueRowAdapter = findRowAdapter(mapValueTypeArg, query) ?: return null,
+ keyRowAdapter = findRowAdapter(
+ typeMirror = keyTypeArg,
+ query = query,
+ columnName = mapInfo?.keyColumnName
+ ) ?: return null,
+ valueRowAdapter = findRowAdapter(
+ typeMirror = mapValueTypeArg,
+ query = query,
+ columnName = mapInfo?.valueColumnName
+ ) ?: return null,
valueCollectionType = null
)
}
@@ -609,10 +664,15 @@
* Find a converter from cursor to the given type mirror.
* If there is information about the query result, we try to use it to accept *any* POJO.
*/
- fun findRowAdapter(typeMirror: XType, query: ParsedQuery): RowAdapter? {
+ fun findRowAdapter(
+ typeMirror: XType,
+ query: ParsedQuery,
+ columnName: String? = null
+ ): RowAdapter? {
if (typeMirror.isError()) {
return null
}
+
val typeElement = typeMirror.typeElement
if (typeElement != null && !typeMirror.typeName.isPrimitive) {
if (typeMirror.typeArguments.isNotEmpty()) {
@@ -660,6 +720,18 @@
return rowAdapter
}
+ if (columnName != null) {
+ val singleNamedColumn = findCursorValueReader(
+ typeMirror,
+ query.resultInfo?.columns?.find {
+ it.name == columnName
+ }?.type
+ )
+ if (singleNamedColumn != null) {
+ return SingleNamedColumnRowAdapter(singleNamedColumn, columnName)
+ }
+ }
+
if ((resultInfo?.columns?.size ?: 1) == 1) {
val singleColumn = findCursorValueReader(
typeMirror,
diff --git a/room/room-compiler/src/main/kotlin/androidx/room/solver/query/result/GuavaImmutableMultimapQueryResultAdapter.kt b/room/room-compiler/src/main/kotlin/androidx/room/solver/query/result/GuavaImmutableMultimapQueryResultAdapter.kt
index 612d276..b38c38a 100644
--- a/room/room-compiler/src/main/kotlin/androidx/room/solver/query/result/GuavaImmutableMultimapQueryResultAdapter.kt
+++ b/room/room-compiler/src/main/kotlin/androidx/room/solver/query/result/GuavaImmutableMultimapQueryResultAdapter.kt
@@ -24,12 +24,12 @@
import com.squareup.javapoet.ParameterizedTypeName
class GuavaImmutableMultimapQueryResultAdapter(
- private val keyTypeArg: XType,
- private val valueTypeArg: XType,
+ override val keyTypeArg: XType,
+ override val valueTypeArg: XType,
private val keyRowAdapter: RowAdapter,
private val valueRowAdapter: RowAdapter,
private val immutableClassName: ClassName
-) : QueryResultAdapter(listOf(keyRowAdapter, valueRowAdapter)) {
+) : QueryResultAdapter(listOf(keyRowAdapter, valueRowAdapter)), MultimapQueryResultAdapter {
private val mapType = ParameterizedTypeName.get(
immutableClassName,
keyTypeArg.typeName,
diff --git a/room/room-compiler/src/main/kotlin/androidx/room/solver/query/result/ImmutableMapQueryResultAdapter.kt b/room/room-compiler/src/main/kotlin/androidx/room/solver/query/result/ImmutableMapQueryResultAdapter.kt
index c28b189..81506c9 100644
--- a/room/room-compiler/src/main/kotlin/androidx/room/solver/query/result/ImmutableMapQueryResultAdapter.kt
+++ b/room/room-compiler/src/main/kotlin/androidx/room/solver/query/result/ImmutableMapQueryResultAdapter.kt
@@ -25,10 +25,10 @@
import com.squareup.javapoet.ParameterizedTypeName
class ImmutableMapQueryResultAdapter(
- private val keyTypeArg: XType,
- private val valueTypeArg: XType,
+ override val keyTypeArg: XType,
+ override val valueTypeArg: XType,
private val resultAdapter: QueryResultAdapter
-) : QueryResultAdapter(resultAdapter.rowAdapters) {
+) : QueryResultAdapter(resultAdapter.rowAdapters), MultimapQueryResultAdapter {
override fun convert(outVarName: String, cursorVarName: String, scope: CodeGenScope) {
scope.builder().apply {
val mapVarName = scope.getTmpVar("_mapResult")
diff --git a/room/room-compiler/src/main/kotlin/androidx/room/solver/query/result/MapQueryResultAdapter.kt b/room/room-compiler/src/main/kotlin/androidx/room/solver/query/result/MapQueryResultAdapter.kt
index af2e374..0328383 100644
--- a/room/room-compiler/src/main/kotlin/androidx/room/solver/query/result/MapQueryResultAdapter.kt
+++ b/room/room-compiler/src/main/kotlin/androidx/room/solver/query/result/MapQueryResultAdapter.kt
@@ -24,12 +24,12 @@
import com.squareup.javapoet.ParameterizedTypeName
class MapQueryResultAdapter(
- private val keyTypeArg: XType,
- private val valueTypeArg: XType,
+ override val keyTypeArg: XType,
+ override val valueTypeArg: XType,
private val keyRowAdapter: RowAdapter,
private val valueRowAdapter: RowAdapter,
private val valueCollectionType: XType?
-) : QueryResultAdapter(listOf(keyRowAdapter, valueRowAdapter)) {
+) : QueryResultAdapter(listOf(keyRowAdapter, valueRowAdapter)), MultimapQueryResultAdapter {
private val declaredToConcreteCollection = mapOf<ClassName, ClassName>(
ClassName.get(List::class.java) to ClassName.get(ArrayList::class.java),
ClassName.get(Set::class.java) to ClassName.get(HashSet::class.java)
diff --git a/compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/window/OwnerWindowScope.kt b/room/room-compiler/src/main/kotlin/androidx/room/solver/query/result/MultimapQueryResultAdapter.kt
similarity index 68%
rename from compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/window/OwnerWindowScope.kt
rename to room/room-compiler/src/main/kotlin/androidx/room/solver/query/result/MultimapQueryResultAdapter.kt
index b641fea..2acfb6d2 100644
--- a/compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/window/OwnerWindowScope.kt
+++ b/room/room-compiler/src/main/kotlin/androidx/room/solver/query/result/MultimapQueryResultAdapter.kt
@@ -14,17 +14,14 @@
* limitations under the License.
*/
-package androidx.compose.ui.window
+package androidx.room.solver.query.result
-import java.awt.Window
+import androidx.room.compiler.processing.XType
/**
- * Scope that is created by [application], [Window] or [Dialog] and provides an owner window of
- * this scope
+ * Common interface for Map and Multimap result adapters.
*/
-interface OwnerWindowScope {
- /**
- * Owner window of this scope
- */
- val ownerWindow: Window?
+interface MultimapQueryResultAdapter {
+ val keyTypeArg: XType
+ val valueTypeArg: XType
}
\ No newline at end of file
diff --git a/room/room-compiler/src/main/kotlin/androidx/room/solver/query/result/PojoRowAdapter.kt b/room/room-compiler/src/main/kotlin/androidx/room/solver/query/result/PojoRowAdapter.kt
index 89b89f5..03bd06d 100644
--- a/room/room-compiler/src/main/kotlin/androidx/room/solver/query/result/PojoRowAdapter.kt
+++ b/room/room-compiler/src/main/kotlin/androidx/room/solver/query/result/PojoRowAdapter.kt
@@ -46,8 +46,8 @@
private val info: QueryResultInfo?,
val pojo: Pojo,
out: XType
-) : RowAdapter(out) {
- val mapping: QueryMappedResultAdapter.Mapping
+) : RowAdapter(out), QueryMappedRowAdapter {
+ override val mapping: PojoMapping
val relationCollectors: List<RelationCollector>
// Set when cursor is ready.
@@ -92,7 +92,7 @@
}
relationCollectors = RelationCollector.createCollectors(context, pojo.relations)
- mapping = QueryMappedResultAdapter.Mapping(
+ mapping = PojoMapping(
pojo = pojo,
matchedFields = matchedFields,
unusedColumns = unusedColumns,
@@ -155,4 +155,13 @@
)
}
}
+
+ data class PojoMapping(
+ val pojo: Pojo,
+ val matchedFields: List<Field>,
+ val unusedColumns: List<String>,
+ val unusedFields: List<Field>
+ ) : QueryMappedRowAdapter.Mapping() {
+ override val usedColumns = matchedFields.map { it.columnName }
+ }
}
diff --git a/room/room-compiler/src/main/kotlin/androidx/room/solver/query/result/QueryMappedResultAdapter.kt b/room/room-compiler/src/main/kotlin/androidx/room/solver/query/result/QueryMappedResultAdapter.kt
deleted file mode 100644
index 0c54ef7..0000000
--- a/room/room-compiler/src/main/kotlin/androidx/room/solver/query/result/QueryMappedResultAdapter.kt
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright 2021 The Android Open Source Project
- *
- * 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.
- */
-
-package androidx.room.solver.query.result
-
-import androidx.room.vo.Field
-import androidx.room.vo.Pojo
-
-/**
- * Interface that defines a result adapter containing mapping information of the query and its
- * result POJOs if any.
- */
-interface QueryMappedResultAdapter {
- val mappings: List<Mapping>
-
- data class Mapping(
- val pojo: Pojo,
- val matchedFields: List<Field>,
- val unusedColumns: List<String>,
- val unusedFields: List<Field>
- )
-}
\ No newline at end of file
diff --git a/compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/window/OwnerWindowScope.kt b/room/room-compiler/src/main/kotlin/androidx/room/solver/query/result/QueryMappedRowAdapter.kt
similarity index 62%
copy from compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/window/OwnerWindowScope.kt
copy to room/room-compiler/src/main/kotlin/androidx/room/solver/query/result/QueryMappedRowAdapter.kt
index b641fea..af3f6cf 100644
--- a/compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/window/OwnerWindowScope.kt
+++ b/room/room-compiler/src/main/kotlin/androidx/room/solver/query/result/QueryMappedRowAdapter.kt
@@ -14,17 +14,19 @@
* limitations under the License.
*/
-package androidx.compose.ui.window
-
-import java.awt.Window
+package androidx.room.solver.query.result
/**
- * Scope that is created by [application], [Window] or [Dialog] and provides an owner window of
- * this scope
+ * Interface that defines a row adapter containing mapping information of the query and its
+ * result usage.
*/
-interface OwnerWindowScope {
+interface QueryMappedRowAdapter {
+ val mapping: Mapping
+
/**
- * Owner window of this scope
+ * Base class of an adapter mapping declaring the used columns by the adapter.
*/
- val ownerWindow: Window?
+ abstract class Mapping {
+ abstract val usedColumns: List<String>
+ }
}
\ No newline at end of file
diff --git a/room/room-compiler/src/main/kotlin/androidx/room/solver/query/result/QueryResultAdapter.kt b/room/room-compiler/src/main/kotlin/androidx/room/solver/query/result/QueryResultAdapter.kt
index fce3604..f6cb819 100644
--- a/room/room-compiler/src/main/kotlin/androidx/room/solver/query/result/QueryResultAdapter.kt
+++ b/room/room-compiler/src/main/kotlin/androidx/room/solver/query/result/QueryResultAdapter.kt
@@ -21,10 +21,10 @@
/**
* Gets a Cursor and converts it into the return type of a method annotated with @Query.
*/
-abstract class QueryResultAdapter(val rowAdapters: List<RowAdapter>) : QueryMappedResultAdapter {
+abstract class QueryResultAdapter(val rowAdapters: List<RowAdapter>) {
- override val mappings: List<QueryMappedResultAdapter.Mapping>
- get() = rowAdapters.filterIsInstance<PojoRowAdapter>().map { it.mapping }
+ val mappings: List<QueryMappedRowAdapter.Mapping>
+ get() = rowAdapters.filterIsInstance<QueryMappedRowAdapter>().map { it.mapping }
abstract fun convert(outVarName: String, cursorVarName: String, scope: CodeGenScope)
@@ -33,6 +33,8 @@
fun shouldCopyCursor(): Boolean =
rowAdapters.filterIsInstance<PojoRowAdapter>().any { it.relationCollectors.isNotEmpty() }
+ // Gets a list of additionally accessed table names in sub queries done by the adapter
+ // (e.g. does done to satisfy @Relation fields).
fun accessedTableNames(): List<String> =
rowAdapters.filterIsInstance<PojoRowAdapter>().flatMap { it.relationTableNames() }
}
diff --git a/room/room-compiler/src/main/kotlin/androidx/room/solver/query/result/SingleNamedColumnRowAdapter.kt b/room/room-compiler/src/main/kotlin/androidx/room/solver/query/result/SingleNamedColumnRowAdapter.kt
new file mode 100644
index 0000000..9bdbabf
--- /dev/null
+++ b/room/room-compiler/src/main/kotlin/androidx/room/solver/query/result/SingleNamedColumnRowAdapter.kt
@@ -0,0 +1,58 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * 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.
+ */
+
+package androidx.room.solver.query.result
+
+import androidx.room.ext.L
+import androidx.room.ext.RoomTypeNames
+import androidx.room.ext.S
+import androidx.room.ext.T
+import androidx.room.solver.CodeGenScope
+import androidx.room.solver.types.CursorValueReader
+import com.squareup.javapoet.TypeName
+
+/**
+ * Wraps a row adapter for a single item from a known column result.
+ */
+class SingleNamedColumnRowAdapter(
+ val reader: CursorValueReader,
+ val columnName: String,
+) : RowAdapter(reader.typeMirror()), QueryMappedRowAdapter {
+ override val mapping = SingleNamedColumnRowMapping(columnName)
+
+ override fun convert(outVarName: String, cursorVarName: String, scope: CodeGenScope) {
+ val indexVarName = scope.getTmpVar(
+ "_columnIndexOf$columnName"
+ )
+ val indexMethod = "getColumnIndexOrThrow"
+ scope.builder().addStatement(
+ "final $T $L = $T.$L($L, $S)",
+ TypeName.INT,
+ indexVarName,
+ RoomTypeNames.CURSOR_UTIL,
+ indexMethod,
+ cursorVarName,
+ columnName
+ )
+ reader.readFromCursor(outVarName, cursorVarName, indexVarName, scope)
+ }
+
+ data class SingleNamedColumnRowMapping(
+ val usedColumn: String
+ ) : QueryMappedRowAdapter.Mapping() {
+ override val usedColumns = listOf(usedColumn)
+ }
+}
diff --git a/compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/window/OwnerWindowScope.kt b/room/room-compiler/src/main/kotlin/androidx/room/vo/MapInfo.kt
similarity index 68%
copy from compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/window/OwnerWindowScope.kt
copy to room/room-compiler/src/main/kotlin/androidx/room/vo/MapInfo.kt
index b641fea..abf4d49 100644
--- a/compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/window/OwnerWindowScope.kt
+++ b/room/room-compiler/src/main/kotlin/androidx/room/vo/MapInfo.kt
@@ -14,17 +14,10 @@
* limitations under the License.
*/
-package androidx.compose.ui.window
-
-import java.awt.Window
+package androidx.room.vo
/**
- * Scope that is created by [application], [Window] or [Dialog] and provides an owner window of
- * this scope
+ * Represents the @MapInfo input of a @Query or @RawQuery method that has a return type of map or
+ * multimap.
*/
-interface OwnerWindowScope {
- /**
- * Owner window of this scope
- */
- val ownerWindow: Window?
-}
\ No newline at end of file
+data class MapInfo(val keyColumnName: String, val valueColumnName: String)
\ No newline at end of file
diff --git a/room/room-compiler/src/test/data/common/input/Artist.java b/room/room-compiler/src/test/data/common/input/Artist.java
new file mode 100644
index 0000000..4ce3d98
--- /dev/null
+++ b/room/room-compiler/src/test/data/common/input/Artist.java
@@ -0,0 +1,54 @@
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * 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.
+ */
+
+package foo.bar;
+import androidx.room.*;
+
+@Entity
+public class Artist {
+ @PrimaryKey
+ public final int mArtistId;
+ public final String mArtistName;
+ public final boolean mIsActive;
+
+ public Artist(int artistId, String artistName, boolean isActive) {
+ mArtistId = artistId;
+ mArtistName = artistName;
+ mIsActive = isActive;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
+
+ Artist artist = (Artist) o;
+
+ if (mArtistId != artist.mArtistId) return false;
+ if (mArtistName != null ? !mArtistName.equals(artist.mArtistName) :
+ artist.mArtistName != null && mIsActive == artist.mIsActive) {
+ return false;
+ }
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ int result = mArtistId;
+ result = 31 * result + (mArtistName != null ? mArtistName.hashCode() : 0);
+ return result;
+ }
+}
\ No newline at end of file
diff --git a/room/room-compiler/src/test/data/common/input/Song.java b/room/room-compiler/src/test/data/common/input/Song.java
new file mode 100644
index 0000000..1829000
--- /dev/null
+++ b/room/room-compiler/src/test/data/common/input/Song.java
@@ -0,0 +1,66 @@
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * 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.
+ */
+
+package foo.bar;
+import androidx.room.*;
+
+@Entity
+public class Song {
+ @PrimaryKey
+ public final int mSongId;
+ public final String mTitle;
+ public final String mArtist;
+ public final String mAlbum;
+ public final int mLength; // in seconds
+ public final int mReleasedYear;
+
+
+ public Song(int songId, String title, String artist, String album, int length,
+ int releasedYear) {
+ mSongId = songId;
+ mTitle = title;
+ mArtist = artist;
+ mAlbum = album;
+ mLength = length;
+ mReleasedYear = releasedYear;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
+
+ Song song = (Song) o;
+
+ if (mSongId != song.mSongId) return false;
+ if (mLength != song.mLength) return false;
+ if (mReleasedYear != song.mReleasedYear) return false;
+ if (mTitle != null ? !mTitle.equals(song.mTitle) : song.mTitle != null) return false;
+ if (mArtist != null ? !mArtist.equals(song.mArtist) : song.mArtist != null) return false;
+ return mAlbum != null ? mAlbum.equals(song.mAlbum) : song.mAlbum == null;
+ }
+
+ @Override
+ public int hashCode() {
+ int result = mSongId;
+ result = 31 * result + (mTitle != null ? mTitle.hashCode() : 0);
+ result = 31 * result + (mArtist != null ? mArtist.hashCode() : 0);
+ result = 31 * result + (mAlbum != null ? mAlbum.hashCode() : 0);
+ result = 31 * result + mLength;
+ result = 31 * result + mReleasedYear;
+ return result;
+ }
+}
\ No newline at end of file
diff --git a/room/room-compiler/src/test/kotlin/androidx/room/processor/AutoMigrationProcessorTest.kt b/room/room-compiler/src/test/kotlin/androidx/room/processor/AutoMigrationProcessorTest.kt
index 49148bb..3080136 100644
--- a/room/room-compiler/src/test/kotlin/androidx/room/processor/AutoMigrationProcessorTest.kt
+++ b/room/room-compiler/src/test/kotlin/androidx/room/processor/AutoMigrationProcessorTest.kt
@@ -55,7 +55,7 @@
toSchemaBundle = toSchemaBundle.database
).process()
invocation.assertCompilationResult {
- hasError(AUTOMIGRATION_SPEC_MISSING_NOARG_CONSTRUCTOR)
+ hasErrorContaining(AUTOMIGRATION_SPEC_MISSING_NOARG_CONSTRUCTOR)
}
}
}
@@ -80,7 +80,7 @@
toSchemaBundle = toSchemaBundle.database
).process()
invocation.assertCompilationResult {
- hasError(ProcessorErrors.AUTOMIGRATION_SPEC_MUST_BE_CLASS)
+ hasErrorContaining(ProcessorErrors.AUTOMIGRATION_SPEC_MUST_BE_CLASS)
}
}
}
@@ -111,7 +111,7 @@
toSchemaBundle = toSchemaBundle.database
).process()
invocation.assertCompilationResult {
- hasError(INNER_CLASS_AUTOMIGRATION_SPEC_MUST_BE_STATIC)
+ hasErrorContaining(INNER_CLASS_AUTOMIGRATION_SPEC_MUST_BE_STATIC)
}
}
}
@@ -138,7 +138,7 @@
toSchemaBundle = toSchemaBundle.database
).process()
invocation.assertCompilationResult {
- hasError(
+ hasErrorContaining(
ProcessorErrors.autoMigrationElementMustImplementSpec("MyAutoMigration")
)
}
diff --git a/room/room-compiler/src/test/kotlin/androidx/room/processor/DaoProcessorTest.kt b/room/room-compiler/src/test/kotlin/androidx/room/processor/DaoProcessorTest.kt
index 9600800..ddbf0b1 100644
--- a/room/room-compiler/src/test/kotlin/androidx/room/processor/DaoProcessorTest.kt
+++ b/room/room-compiler/src/test/kotlin/androidx/room/processor/DaoProcessorTest.kt
@@ -136,7 +136,8 @@
"""
) { _, invocation ->
invocation.assertCompilationResult {
- hasError(ProcessorErrors.INVALID_ANNOTATION_COUNT_IN_DAO_METHOD)
+ hasErrorContaining(ProcessorErrors.INVALID_ANNOTATION_COUNT_IN_DAO_METHOD)
+ .onLine(8)
}
}
}
@@ -306,7 +307,7 @@
`is`(false)
)
invocation.assertCompilationResult {
- hasWarning(ProcessorErrors.TRANSACTION_MISSING_ON_RELATION)
+ hasWarningContaining(ProcessorErrors.TRANSACTION_MISSING_ON_RELATION)
}
}
}
diff --git a/room/room-compiler/src/test/kotlin/androidx/room/processor/QueryMethodProcessorTest.kt b/room/room-compiler/src/test/kotlin/androidx/room/processor/QueryMethodProcessorTest.kt
index 3e9bbfd..f0e05bf 100644
--- a/room/room-compiler/src/test/kotlin/androidx/room/processor/QueryMethodProcessorTest.kt
+++ b/room/room-compiler/src/test/kotlin/androidx/room/processor/QueryMethodProcessorTest.kt
@@ -32,6 +32,7 @@
import androidx.room.parser.QueryType
import androidx.room.parser.Table
import androidx.room.processor.ProcessorErrors.DO_NOT_USE_GENERIC_IMMUTABLE_MULTIMAP
+import androidx.room.processor.ProcessorErrors.MAP_INFO_MUST_HAVE_AT_LEAST_ONE_COLUMN_PROVIDED
import androidx.room.processor.ProcessorErrors.cannotFindQueryResultAdapter
import androidx.room.solver.query.result.DataSourceFactoryQueryResultBinder
import androidx.room.solver.query.result.ListQueryResultAdapter
@@ -1303,7 +1304,7 @@
)
val commonSources = listOf(
COMMON.LIVE_DATA, COMMON.COMPUTABLE_LIVE_DATA, COMMON.USER, COMMON.BOOK,
- COMMON.NOT_AN_ENTITY
+ COMMON.NOT_AN_ENTITY, COMMON.ARTIST, COMMON.SONG
)
runProcessorTest(
sources = additionalSources + commonSources + inputSource,
@@ -1366,9 +1367,81 @@
) { _, invocation ->
invocation.assertCompilationResult {
hasErrorCount(2)
- hasError(DO_NOT_USE_GENERIC_IMMUTABLE_MULTIMAP)
+ hasErrorContaining(DO_NOT_USE_GENERIC_IMMUTABLE_MULTIMAP)
hasErrorContaining("Not sure how to convert a Cursor to this method's return type")
}
}
}
+
+ @Test
+ fun testUseMapInfoWithBothEmptyColumnsProvided() {
+ if (!enableVerification) {
+ return
+ }
+ singleQueryMethod<ReadQueryMethod>(
+ """
+ @MapInfo
+ @Query("select * from User u JOIN Book b ON u.uid == b.uid")
+ abstract Map<User, Book> getMultimap();
+ """
+ ) { _, invocation ->
+ invocation.assertCompilationResult {
+ hasErrorCount(1)
+ hasErrorContaining(MAP_INFO_MUST_HAVE_AT_LEAST_ONE_COLUMN_PROVIDED)
+ }
+ }
+ }
+
+ @Test
+ fun testDoesNotImplementEqualsAndHashcodeQuery() {
+ singleQueryMethod<ReadQueryMethod>(
+ """
+ @Query("select * from User u JOIN Book b ON u.uid == b.uid")
+ abstract Map<User, Book> getMultimap();
+ """
+ ) { _, invocation ->
+ invocation.assertCompilationResult {
+ hasWarningCount(1)
+ hasWarningContaining(
+ ProcessorErrors.classMustImplementEqualsAndHashCode(
+ "java.util.Map<foo.bar.User, foo.bar.Book>",
+ "foo.bar.User"
+ )
+ )
+ }
+ }
+ }
+
+ @Test
+ fun testUseMapInfoWithColumnsNotInQuery() {
+ if (!enableVerification) {
+ return
+ }
+ singleQueryMethod<ReadQueryMethod>(
+ """
+ @MapInfo(keyColumn="cat", valueColumn="dog")
+ @Query("select * from User u JOIN Book b ON u.uid == b.uid")
+ abstract Map<User, Book> getMultimap();
+ """
+ ) { _, invocation ->
+ invocation.assertCompilationResult {
+ hasWarningCount(1)
+ hasWarningContaining(
+ ProcessorErrors.classMustImplementEqualsAndHashCode(
+ "java.util.Map<foo.bar.User, foo.bar.Book>",
+ "foo.bar.User"
+ )
+ )
+ hasErrorCount(2)
+ hasErrorContaining(
+ "Column(s) specified in the provided @MapInfo annotation must " +
+ "be present in the query. Provided: cat."
+ )
+ hasErrorContaining(
+ "Column(s) specified in the provided @MapInfo annotation must " +
+ "be present in the query. Provided: dog."
+ )
+ }
+ }
+ }
}
diff --git a/room/room-compiler/src/test/kotlin/androidx/room/processor/RawQueryMethodProcessorTest.kt b/room/room-compiler/src/test/kotlin/androidx/room/processor/RawQueryMethodProcessorTest.kt
index 6af9b57..721c703 100644
--- a/room/room-compiler/src/test/kotlin/androidx/room/processor/RawQueryMethodProcessorTest.kt
+++ b/room/room-compiler/src/test/kotlin/androidx/room/processor/RawQueryMethodProcessorTest.kt
@@ -372,6 +372,42 @@
}
}
+ @Test
+ fun testUseMapInfoWithBothEmptyColumnsProvided() {
+ singleQueryMethod(
+ """
+ @MapInfo
+ @RawQuery
+ abstract Map<User, Book> getMultimap(SupportSQLiteQuery query);
+ """
+ ) { _, invocation ->
+ invocation.assertCompilationResult {
+ hasErrorCount(1)
+ hasErrorContaining(ProcessorErrors.MAP_INFO_MUST_HAVE_AT_LEAST_ONE_COLUMN_PROVIDED)
+ }
+ }
+ }
+
+ @Test
+ fun testDoesNotImplementEqualsAndHashcodeRawQuery() {
+ singleQueryMethod(
+ """
+ @RawQuery
+ abstract Map<User, Book> getMultimap(SupportSQLiteQuery query);
+ """
+ ) { _, invocation ->
+ invocation.assertCompilationResult {
+ hasWarningCount(1)
+ hasWarningContaining(
+ ProcessorErrors.classMustImplementEqualsAndHashCode(
+ "java.util.Map<foo.bar.User, foo.bar.Book>",
+ "foo.bar.User"
+ )
+ )
+ }
+ }
+ }
+
private fun singleQueryMethod(
vararg input: String,
handler: (RawQueryMethod, XTestInvocation) -> Unit
@@ -385,7 +421,7 @@
val commonSources = listOf(
COMMON.LIVE_DATA, COMMON.COMPUTABLE_LIVE_DATA, COMMON.USER,
COMMON.DATA_SOURCE_FACTORY, COMMON.POSITIONAL_DATA_SOURCE,
- COMMON.NOT_AN_ENTITY
+ COMMON.NOT_AN_ENTITY, COMMON.BOOK, COMMON.ARTIST, COMMON.SONG
)
runProcessorTest(
sources = commonSources + inputSource
@@ -418,6 +454,7 @@
import androidx.room.*;
import androidx.sqlite.db.SupportSQLiteQuery;
import androidx.lifecycle.LiveData;
+ import java.util.*;
@Dao
abstract class MyClass {
"""
diff --git a/room/room-compiler/src/test/kotlin/androidx/room/processor/TableEntityProcessorTest.kt b/room/room-compiler/src/test/kotlin/androidx/room/processor/TableEntityProcessorTest.kt
index 66b9271..65180f4 100644
--- a/room/room-compiler/src/test/kotlin/androidx/room/processor/TableEntityProcessorTest.kt
+++ b/room/room-compiler/src/test/kotlin/androidx/room/processor/TableEntityProcessorTest.kt
@@ -87,7 +87,7 @@
"""
) { _, invocation ->
invocation.assertCompilationResult {
- hasError(ProcessorErrors.CANNOT_FIND_GETTER_FOR_FIELD)
+ hasErrorContaining(ProcessorErrors.CANNOT_FIND_GETTER_FOR_FIELD)
}
}
}
@@ -117,8 +117,7 @@
classpathFiles = libraryClasspath
) { _, invocation ->
invocation.assertCompilationResult {
- hasError(ProcessorErrors.CANNOT_FIND_GETTER_FOR_FIELD)
- hasRawOutputContaining(
+ hasError(
ProcessorErrors.CANNOT_FIND_GETTER_FOR_FIELD +
" - id in test.library.MissingGetterEntity"
)
@@ -137,7 +136,8 @@
"""
) { _, invocation ->
invocation.assertCompilationResult {
- hasError(ProcessorErrors.CANNOT_FIND_GETTER_FOR_FIELD)
+ hasErrorContaining(ProcessorErrors.CANNOT_FIND_GETTER_FOR_FIELD)
+ .onLineContaining("int id")
}
}
}
@@ -153,7 +153,7 @@
"""
) { _, invocation ->
invocation.assertCompilationResult {
- hasError(ProcessorErrors.CANNOT_FIND_SETTER_FOR_FIELD)
+ hasErrorContaining(ProcessorErrors.CANNOT_FIND_SETTER_FOR_FIELD)
}
}
}
@@ -246,7 +246,7 @@
annotation
) { _, invocation ->
invocation.assertCompilationResult {
- hasError(ProcessorErrors.INVALID_INDEX_ORDERS_SIZE)
+ hasErrorContaining(ProcessorErrors.INVALID_INDEX_ORDERS_SIZE)
}
}
}
@@ -283,7 +283,7 @@
`is`(invocation.processingEnv.requireType(TypeName.INT).typeName)
)
invocation.assertCompilationResult {
- hasWarning(
+ hasWarningContaining(
ProcessorErrors.mismatchedSetter(
fieldName = "id",
ownerType = ClassName.bestGuess("foo.bar.MyEntity"),
@@ -325,7 +325,7 @@
"""
) { _, invocation ->
invocation.assertCompilationResult {
- hasError(ProcessorErrors.CANNOT_FIND_SETTER_FOR_FIELD)
+ hasErrorContaining(ProcessorErrors.CANNOT_FIND_SETTER_FOR_FIELD)
}
}
}
@@ -492,7 +492,7 @@
hashMapOf(Pair("tableName", "\" \""))
) { _, invocation ->
invocation.assertCompilationResult {
- hasError(ProcessorErrors.ENTITY_TABLE_NAME_CANNOT_BE_EMPTY)
+ hasErrorContaining(ProcessorErrors.ENTITY_TABLE_NAME_CANNOT_BE_EMPTY)
}
}
}
@@ -504,7 +504,7 @@
"""
) { _, invocation ->
invocation.assertCompilationResult {
- hasError(ProcessorErrors.MISSING_PRIMARY_KEY)
+ hasErrorContaining(ProcessorErrors.MISSING_PRIMARY_KEY)
}
}
}
@@ -518,7 +518,8 @@
"""
) { _, invocation ->
invocation.assertCompilationResult {
- hasError(ProcessorErrors.CANNOT_FIND_COLUMN_TYPE_ADAPTER)
+ hasErrorContaining(ProcessorErrors.CANNOT_FIND_COLUMN_TYPE_ADAPTER)
+ .onLineContaining("myDate")
}
}
}
@@ -540,7 +541,7 @@
) { entity, invocation ->
assertThat(entity.primaryKey.fields.map { it.name }, `is`(listOf("id")))
invocation.assertCompilationResult {
- hasWarning(
+ hasWarningContaining(
ProcessorErrors.embeddedPrimaryKeyIsDropped(
"foo.bar.MyEntity", "x"
)
@@ -814,7 +815,7 @@
annotation
) { _, invocation ->
invocation.assertCompilationResult {
- hasError(ProcessorErrors.INDEX_COLUMNS_CANNOT_BE_EMPTY)
+ hasErrorContaining(ProcessorErrors.INDEX_COLUMNS_CANNOT_BE_EMPTY)
}
}
}
@@ -833,7 +834,7 @@
annotation
) { _, invocation ->
invocation.assertCompilationResult {
- hasError(
+ hasErrorContaining(
ProcessorErrors.indexColumnDoesNotExist("bar", listOf("id, foo"))
)
}
@@ -855,7 +856,7 @@
annotation
) { _, invocation ->
invocation.assertCompilationResult {
- hasError(
+ hasErrorContaining(
ProcessorErrors.duplicateIndexInEntity("index_MyEntity_foo")
)
}
@@ -887,7 +888,7 @@
) { entity, invocation ->
assertThat(entity.indices.isEmpty(), `is`(true))
invocation.assertCompilationResult {
- hasWarning(
+ hasWarningContaining(
ProcessorErrors.droppedSuperClassFieldIndex(
fieldName = "name",
childEntity = "foo.bar.MyEntity",
@@ -1102,7 +1103,7 @@
) { entity, invocation ->
assertThat(entity.indices.isEmpty(), `is`(true))
invocation.assertCompilationResult {
- hasWarning(
+ hasWarningContaining(
ProcessorErrors.droppedSuperClassIndex(
childEntity = "foo.bar.MyEntity",
superEntity = "foo.bar.Base"
@@ -1136,7 +1137,7 @@
) { entity, invocation ->
assertThat(entity.indices.isEmpty(), `is`(true))
invocation.assertCompilationResult {
- hasWarning(
+ hasWarningContaining(
ProcessorErrors.droppedSuperClassIndex(
childEntity = "foo.bar.MyEntity",
superEntity = "foo.bar.Base"
@@ -1166,7 +1167,7 @@
) { entity, invocation ->
assertThat(entity.indices.isEmpty(), `is`(true))
invocation.assertCompilationResult {
- hasWarning(
+ hasWarningContaining(
ProcessorErrors.droppedEmbeddedIndex(
entityName = "foo.bar.MyEntity.Foo",
fieldPath = "foo",
@@ -1194,7 +1195,7 @@
) { entity, invocation ->
assertThat(entity.indices.isEmpty(), `is`(true))
invocation.assertCompilationResult {
- hasError(ProcessorErrors.CANNOT_USE_MORE_THAN_ONE_POJO_FIELD_ANNOTATION)
+ hasErrorContaining(ProcessorErrors.CANNOT_USE_MORE_THAN_ONE_POJO_FIELD_ANNOTATION)
}
}
}
@@ -1215,7 +1216,7 @@
) { entity, invocation ->
assertThat(entity.indices.isEmpty(), `is`(true))
invocation.assertCompilationResult {
- hasWarning(
+ hasWarningContaining(
ProcessorErrors.droppedEmbeddedFieldIndex("foo > a", "foo.bar.MyEntity")
)
}
@@ -1262,7 +1263,7 @@
attributes = mapOf("primaryKeys" to "\"id\"")
) { _, invocation ->
invocation.assertCompilationResult {
- hasError(
+ hasErrorContaining(
ProcessorErrors.multiplePrimaryKeyAnnotations(
listOf("PrimaryKey[id]", "PrimaryKey[foo]")
)
@@ -1280,7 +1281,7 @@
attributes = mapOf("primaryKeys" to "\"foo\"")
) { _, invocation ->
invocation.assertCompilationResult {
- hasError(
+ hasErrorContaining(
ProcessorErrors.primaryKeyColumnDoesNotExist("foo", listOf("id"))
)
}
@@ -1299,7 +1300,7 @@
) { entity, invocation ->
assertThat(entity.primaryKey.fields.isEmpty(), `is`(true))
invocation.assertCompilationResult {
- hasError(
+ hasErrorContaining(
ProcessorErrors.multiplePrimaryKeyAnnotations(
listOf("PrimaryKey[x]", "PrimaryKey[y]")
)
@@ -1390,7 +1391,7 @@
assertThat(entity.primaryKey.fields.firstOrNull()?.name, `is`("id"))
assertThat(entity.primaryKey.autoGenerateId, `is`(false))
invocation.assertCompilationResult {
- hasNote("PrimaryKey[baseId] is overridden by PrimaryKey[id]")
+ hasNoteContaining("PrimaryKey[baseId] is overridden by PrimaryKey[id]")
}
}
}
@@ -1420,7 +1421,7 @@
assertThat(entity.primaryKey.fields.size, `is`(1))
assertThat(entity.primaryKey.fields.firstOrNull()?.name, `is`("id"))
invocation.assertCompilationResult {
- hasNote("PrimaryKey[baseId] is overridden by PrimaryKey[id]")
+ hasNoteContaining("PrimaryKey[baseId] is overridden by PrimaryKey[id]")
}
}
}
@@ -1451,7 +1452,7 @@
assertThat(entity.primaryKey.fields.firstOrNull()?.name, `is`("id"))
assertThat(entity.primaryKey.autoGenerateId, `is`(false))
invocation.assertCompilationResult {
- hasNote("PrimaryKey[baseId] is overridden by PrimaryKey[id]")
+ hasNoteContaining("PrimaryKey[baseId] is overridden by PrimaryKey[id]")
}
}
}
@@ -1501,7 +1502,7 @@
assertThat(entity.primaryKey.fields.firstOrNull()?.name, `is`("id"))
assertThat(entity.primaryKey.autoGenerateId, `is`(true))
invocation.assertCompilationResult {
- hasError(ProcessorErrors.AUTO_INCREMENTED_PRIMARY_KEY_IS_NOT_INT)
+ hasErrorContaining(ProcessorErrors.AUTO_INCREMENTED_PRIMARY_KEY_IS_NOT_INT)
}
}
}
@@ -1602,7 +1603,9 @@
) { entity, invocation ->
assertThat(entity.primaryKey.columnNames, `is`(listOf("bar_a", "bar_b")))
invocation.assertCompilationResult {
- hasNote("PrimaryKey[baseId] is overridden by PrimaryKey[foo > a, foo > b]")
+ hasNoteContaining(
+ "PrimaryKey[baseId] is overridden by PrimaryKey[foo > a, foo > b]"
+ )
}
}
}
@@ -1641,7 +1644,7 @@
) { entity, invocation ->
assertThat(entity.primaryKey.columnNames, `is`(listOf("id")))
invocation.assertCompilationResult {
- hasNote("PrimaryKey[foo > a, foo > b] is overridden by PrimaryKey[id]")
+ hasNoteContaining("PrimaryKey[foo > a, foo > b] is overridden by PrimaryKey[id]")
}
}
}
@@ -1671,7 +1674,7 @@
assertThat(entity.primaryKey.fields.size, `is`(1))
assertThat(entity.primaryKey.fields.firstOrNull()?.name, `is`("id"))
invocation.assertCompilationResult {
- hasError(ProcessorErrors.primaryKeyNull("id"))
+ hasErrorContaining(ProcessorErrors.primaryKeyNull("id"))
}
}
}
@@ -1687,8 +1690,8 @@
"""
) { _, invocation ->
invocation.assertCompilationResult {
- hasError(ProcessorErrors.primaryKeyNull("id"))
- hasError(ProcessorErrors.primaryKeyNull("anotherId"))
+ hasErrorContaining(ProcessorErrors.primaryKeyNull("id"))
+ hasErrorContaining(ProcessorErrors.primaryKeyNull("anotherId"))
}
}
}
@@ -1705,7 +1708,7 @@
"""
) { _, invocation ->
invocation.assertCompilationResult {
- hasError(
+ hasErrorContaining(
ProcessorErrors.primaryKeyNull("anotherId")
)
}
@@ -1722,7 +1725,7 @@
attributes = mapOf("primaryKeys" to "{\"id\", \"foo\"}")
) { _, invocation ->
invocation.assertCompilationResult {
- hasError(ProcessorErrors.primaryKeyNull("foo"))
+ hasErrorContaining(ProcessorErrors.primaryKeyNull("foo"))
}
}
}
@@ -1758,7 +1761,7 @@
"""
) { _, invocation ->
invocation.assertCompilationResult {
- hasError(ProcessorErrors.primaryKeyNull("foo"))
+ hasErrorContaining(ProcessorErrors.primaryKeyNull("foo"))
}
}
}
@@ -1780,9 +1783,12 @@
"""
) { _, invocation ->
invocation.assertCompilationResult {
- hasError(ProcessorErrors.primaryKeyNull("foo > a"))
- hasError(ProcessorErrors.primaryKeyNull("foo > b"))
- hasError(ProcessorErrors.primaryKeyNull("foo"))
+ hasErrorContaining(ProcessorErrors.primaryKeyNull("foo > a"))
+ .onLineContaining("String a")
+ hasErrorContaining(ProcessorErrors.primaryKeyNull("foo > b"))
+ .onLineContaining("String b")
+ hasErrorContaining(ProcessorErrors.primaryKeyNull("foo"))
+ .onLineContaining("Foo foo")
hasErrorCount(3)
}
}
@@ -1810,10 +1816,10 @@
"""
) { _, invocation ->
invocation.assertCompilationResult {
- hasError(ProcessorErrors.primaryKeyNull("foo > a"))
- hasError(ProcessorErrors.primaryKeyNull("foo > b"))
- hasError(ProcessorErrors.primaryKeyNull("foo"))
- hasError(ProcessorErrors.primaryKeyNull("foo > a > bb"))
+ hasErrorContaining(ProcessorErrors.primaryKeyNull("foo > a"))
+ hasErrorContaining(ProcessorErrors.primaryKeyNull("foo > b"))
+ hasErrorContaining(ProcessorErrors.primaryKeyNull("foo"))
+ hasErrorContaining(ProcessorErrors.primaryKeyNull("foo > a > bb"))
hasErrorCount(4)
}
}
@@ -1850,9 +1856,9 @@
sources = listOf(parent)
) { _, invocation ->
invocation.assertCompilationResult {
- hasError(ProcessorErrors.primaryKeyNull("foo"))
- hasError(ProcessorErrors.primaryKeyNull("foo > a"))
- hasError(ProcessorErrors.primaryKeyNull("foo > b"))
+ hasErrorContaining(ProcessorErrors.primaryKeyNull("foo"))
+ hasErrorContaining(ProcessorErrors.primaryKeyNull("foo > a"))
+ hasErrorContaining(ProcessorErrors.primaryKeyNull("foo > b"))
hasErrorCount(3)
}
}
@@ -1889,10 +1895,12 @@
sources = listOf(parent)
) { _, invocation ->
invocation.assertCompilationResult {
- hasError(ProcessorErrors.primaryKeyNull("foo"))
- hasError(ProcessorErrors.primaryKeyNull("foo > a"))
- hasError(ProcessorErrors.primaryKeyNull("foo > b"))
- hasNote("PrimaryKey[baseId] is overridden by PrimaryKey[foo > a, foo > b]")
+ hasErrorContaining(ProcessorErrors.primaryKeyNull("foo"))
+ hasErrorContaining(ProcessorErrors.primaryKeyNull("foo > a"))
+ hasErrorContaining(ProcessorErrors.primaryKeyNull("foo > b"))
+ hasNoteContaining(
+ "PrimaryKey[baseId] is overridden by PrimaryKey[foo > a, foo > b]"
+ )
hasErrorCount(3)
}
}
@@ -1930,10 +1938,10 @@
sources = listOf(parent)
) { _, invocation ->
invocation.assertCompilationResult {
- hasError(ProcessorErrors.primaryKeyNull("foo"))
- hasError(ProcessorErrors.primaryKeyNull("foo > a"))
- hasError(ProcessorErrors.primaryKeyNull("foo > b"))
- hasNote("PrimaryKey[foo > a, foo > b] is overridden by PrimaryKey[id]")
+ hasErrorContaining(ProcessorErrors.primaryKeyNull("foo"))
+ hasErrorContaining(ProcessorErrors.primaryKeyNull("foo > a"))
+ hasErrorContaining(ProcessorErrors.primaryKeyNull("foo > b"))
+ hasNoteContaining("PrimaryKey[foo > a, foo > b] is overridden by PrimaryKey[id]")
hasErrorCount(3)
}
}
@@ -1970,7 +1978,7 @@
sources = listOf(parent)
) { _, invocation ->
invocation.assertCompilationResult {
- hasNote("PrimaryKey[foo > a] is overridden by PrimaryKey[id]")
+ hasNoteContaining("PrimaryKey[foo > a] is overridden by PrimaryKey[id]")
}
}
}
@@ -2006,9 +2014,9 @@
sources = listOf(parent)
) { _, invocation ->
invocation.assertCompilationResult {
- hasError(ProcessorErrors.primaryKeyNull("foo"))
- hasError(ProcessorErrors.primaryKeyNull("foo > a"))
- hasNote("PrimaryKey[foo > a] is overridden by PrimaryKey[id]")
+ hasErrorContaining(ProcessorErrors.primaryKeyNull("foo"))
+ hasErrorContaining(ProcessorErrors.primaryKeyNull("foo > a"))
+ hasNoteContaining("PrimaryKey[foo > a] is overridden by PrimaryKey[id]")
hasErrorCount(2)
}
}
@@ -2026,7 +2034,7 @@
sources = listOf(COMMON.USER)
) { _, invocation ->
invocation.assertCompilationResult {
- hasError(RELATION_IN_ENTITY)
+ hasErrorContaining(RELATION_IN_ENTITY)
}
}
}
@@ -2051,7 +2059,7 @@
attributes = annotation, sources = listOf(COMMON.USER)
) { _, invocation ->
invocation.assertCompilationResult {
- hasError(ProcessorErrors.INVALID_FOREIGN_KEY_ACTION)
+ hasErrorContaining(ProcessorErrors.INVALID_FOREIGN_KEY_ACTION)
}
}
}
@@ -2075,8 +2083,17 @@
attributes = annotation, sources = listOf(COMMON.USER)
) { _, invocation ->
invocation.assertCompilationResult {
- compilationDidFail()
- hasRawOutputContaining("cannot find symbol")
+ // KSP runs processors even when java code is not valid hence we'll get the
+ // error from room. For JavaP and Kapt, they don't run the processor when
+ // the java code has an error
+ if (invocation.isKsp) {
+ hasErrorContaining(
+ ProcessorErrors.foreignKeyNotAnEntity("<Error>")
+ ).onLine(11)
+ } else {
+ hasErrorContaining("cannot find symbol")
+ .onLine(7)
+ }
}
}
}
@@ -2100,7 +2117,7 @@
attributes = annotation, sources = listOf(COMMON.NOT_AN_ENTITY)
) { _, invocation ->
invocation.assertCompilationResult {
- hasError(
+ hasErrorContaining(
ProcessorErrors.foreignKeyNotAnEntity(
COMMON.NOT_AN_ENTITY_TYPE_NAME.toString()
)
@@ -2128,7 +2145,7 @@
attributes = annotation, sources = listOf(COMMON.USER)
) { _, invocation ->
invocation.assertCompilationResult {
- hasError(
+ hasErrorContaining(
ProcessorErrors.foreignKeyChildColumnDoesNotExist(
"namex", listOf("id", "name")
)
@@ -2156,7 +2173,7 @@
attributes = annotation, sources = listOf(COMMON.USER)
) { _, invocation ->
invocation.assertCompilationResult {
- hasError(
+ hasErrorContaining(
ProcessorErrors.foreignKeyColumnNumberMismatch(
listOf("name", "id"), listOf("lastName")
)
@@ -2184,7 +2201,7 @@
attributes = annotation, sources = listOf(COMMON.USER)
) { _, invocation ->
invocation.assertCompilationResult {
- hasError(ProcessorErrors.FOREIGN_KEY_EMPTY_CHILD_COLUMN_LIST)
+ hasErrorContaining(ProcessorErrors.FOREIGN_KEY_EMPTY_CHILD_COLUMN_LIST)
}
}
}
@@ -2208,7 +2225,7 @@
attributes = annotation, sources = listOf(COMMON.USER)
) { _, invocation ->
invocation.assertCompilationResult {
- hasError(ProcessorErrors.FOREIGN_KEY_EMPTY_PARENT_COLUMN_LIST)
+ hasErrorContaining(ProcessorErrors.FOREIGN_KEY_EMPTY_PARENT_COLUMN_LIST)
}
}
}
@@ -2356,7 +2373,7 @@
) { entity, invocation ->
assertThat(entity.indices, `is`(emptyList()))
invocation.assertCompilationResult {
- hasWarning(ProcessorErrors.foreignKeyMissingIndexInChildColumn("name"))
+ hasWarningContaining(ProcessorErrors.foreignKeyMissingIndexInChildColumn("name"))
}
}
}
@@ -2382,7 +2399,7 @@
) { entity, invocation ->
assertThat(entity.indices, `is`(emptyList()))
invocation.assertCompilationResult {
- hasWarning(
+ hasWarningContaining(
ProcessorErrors.foreignKeyMissingIndexInChildColumns(
listOf(
"lName",
@@ -2431,7 +2448,7 @@
"""
) { _, invocation ->
invocation.assertCompilationResult {
- hasError(
+ hasErrorContaining(
ProcessorErrors.RECURSIVE_REFERENCE_DETECTED.format(
"foo.bar.MyEntity -> foo.bar.MyEntity"
)
@@ -2456,7 +2473,7 @@
"""
) { _, invocation ->
invocation.assertCompilationResult {
- hasError(
+ hasErrorContaining(
ProcessorErrors.RECURSIVE_REFERENCE_DETECTED.format(
"foo.bar.MyEntity -> foo.bar.MyEntity.A -> foo.bar.MyEntity"
)
@@ -2479,7 +2496,7 @@
"""
) { _, invocation ->
invocation.assertCompilationResult {
- hasError(
+ hasErrorContaining(
ProcessorErrors.RECURSIVE_REFERENCE_DETECTED.format(
"foo.bar.MyEntity -> foo.bar.MyEntity.A -> foo.bar.MyEntity"
)
@@ -2503,7 +2520,7 @@
"""
) { _, invocation ->
invocation.assertCompilationResult {
- hasError(
+ hasErrorContaining(
ProcessorErrors.RECURSIVE_REFERENCE_DETECTED.format(
"foo.bar.MyEntity -> foo.bar.MyEntity.A -> foo.bar.MyEntity"
)
@@ -2539,7 +2556,7 @@
attributes = annotation, sources = listOf(COMMON.USER)
) { _, invocation ->
invocation.assertCompilationResult {
- hasError(ProcessorErrors.INVALID_TABLE_NAME)
+ hasErrorContaining(ProcessorErrors.INVALID_TABLE_NAME)
}
}
}
@@ -2556,7 +2573,7 @@
sources = listOf(COMMON.USER)
) { _, invocation ->
invocation.assertCompilationResult {
- hasError(ProcessorErrors.INVALID_COLUMN_NAME)
+ hasErrorContaining(ProcessorErrors.INVALID_COLUMN_NAME)
}
}
}
diff --git a/room/room-compiler/src/test/kotlin/androidx/room/solver/TypeAdapterStoreTest.kt b/room/room-compiler/src/test/kotlin/androidx/room/solver/TypeAdapterStoreTest.kt
index 3793c0c..9b0a364 100644
--- a/room/room-compiler/src/test/kotlin/androidx/room/solver/TypeAdapterStoreTest.kt
+++ b/room/room-compiler/src/test/kotlin/androidx/room/solver/TypeAdapterStoreTest.kt
@@ -131,7 +131,7 @@
val context = Context(invocation.processingEnv)
CustomConverterProcessor.Companion.findConverters(context, typeElement)
invocation.assertCompilationResult {
- hasError(ProcessorErrors.INNER_CLASS_TYPE_CONVERTER_MUST_BE_STATIC)
+ hasErrorContaining(ProcessorErrors.INNER_CLASS_TYPE_CONVERTER_MUST_BE_STATIC)
}
}
}
diff --git a/room/room-compiler/src/test/kotlin/androidx/room/testing/test_util.kt b/room/room-compiler/src/test/kotlin/androidx/room/testing/test_util.kt
index 98dda86..be1bdc8 100644
--- a/room/room-compiler/src/test/kotlin/androidx/room/testing/test_util.kt
+++ b/room/room-compiler/src/test/kotlin/androidx/room/testing/test_util.kt
@@ -45,6 +45,14 @@
import java.io.File
object COMMON {
+ val ARTIST by lazy {
+ loadJavaCode("common/input/Artist.java", "foo.bar.Artist")
+ }
+
+ val SONG by lazy {
+ loadJavaCode("common/input/Song.java", "foo.bar.Song")
+ }
+
val USER by lazy {
loadJavaCode("common/input/User.java", "foo.bar.User")
}
@@ -79,7 +87,7 @@
}
val MULTI_PKEY_ENTITY by lazy {
- loadJavaCode("common/input/MultiPKeyEntity.java", "MultiPKeyEntity")
+ loadJavaCode("common/input/MultiPKeyEntity.java", "foo.bar.MultiPKeyEntity")
}
val FLOW by lazy {
diff --git a/room/room-paging/build.gradle b/room/room-paging/build.gradle
index 0c4e5dc..363e108 100644
--- a/room/room-paging/build.gradle
+++ b/room/room-paging/build.gradle
@@ -70,6 +70,7 @@
}
androidTestImplementation(libs.truth)
androidTestImplementation("androidx.arch.core:core-testing:2.0.1")
+ androidTestImplementation(project(":internal-testutils-common"))
}
// Allow usage of Kotlin's @OptIn.
diff --git a/room/room-paging/src/androidTest/kotlin/androidx/room/InvalidationTrackerExtRoomPaging.kt b/room/room-paging/src/androidTest/kotlin/androidx/room/InvalidationTrackerExtRoomPaging.kt
new file mode 100644
index 0000000..6ba8c2a
--- /dev/null
+++ b/room/room-paging/src/androidTest/kotlin/androidx/room/InvalidationTrackerExtRoomPaging.kt
@@ -0,0 +1,45 @@
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * 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.
+ */
+package androidx.room
+
+import kotlinx.coroutines.delay
+import kotlinx.coroutines.withTimeout
+import java.util.concurrent.TimeUnit
+
+/**
+ * Makes refresh runnable accessible in tests. Used for LimitOffsetPagingSource unit tests that
+ * needs to block InvalidationTracker's invalidation notification
+ */
+val InvalidationTracker.refreshRunnable: Runnable
+ get() = this.mRefreshRunnable
+
+/**
+ * True if invalidation tracker is pending a refresh event to get database changes.
+ */
+val InvalidationTracker.pendingRefresh
+ get() = this.mPendingRefresh.get()
+
+/**
+ * Polls [InvalidationTracker] until it sets its pending refresh flag to true.
+ */
+suspend fun InvalidationTracker.awaitPendingRefresh() {
+ withTimeout(TimeUnit.SECONDS.toMillis(3)) {
+ while (true) {
+ if (pendingRefresh) return@withTimeout
+ delay(50)
+ }
+ }
+}
\ No newline at end of file
diff --git a/room/room-paging/src/androidTest/kotlin/androidx/room/paging/LimitOffsetPagingSourceTest.kt b/room/room-paging/src/androidTest/kotlin/androidx/room/paging/LimitOffsetPagingSourceTest.kt
index 4420a8b..340695c 100644
--- a/room/room-paging/src/androidTest/kotlin/androidx/room/paging/LimitOffsetPagingSourceTest.kt
+++ b/room/room-paging/src/androidTest/kotlin/androidx/room/paging/LimitOffsetPagingSourceTest.kt
@@ -26,12 +26,15 @@
import androidx.room.Room
import androidx.room.RoomDatabase
import androidx.room.RoomSQLiteQuery
+import androidx.room.awaitPendingRefresh
+import androidx.room.refreshRunnable
import androidx.room.util.CursorUtil
import androidx.test.core.app.ApplicationProvider
import androidx.test.ext.junit.runners.AndroidJUnit4
-import androidx.test.filters.FlakyTest
import androidx.test.filters.SmallTest
+import androidx.testutils.FilteringExecutor
import com.google.common.truth.Truth.assertThat
+import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.runBlocking
import org.junit.After
import org.junit.Before
@@ -43,7 +46,7 @@
import kotlin.test.assertFalse
import kotlin.test.assertTrue
-private val tableName: String = "TestItem"
+private const val tableName: String = "TestItem"
@RunWith(AndroidJUnit4::class)
@SmallTest
@@ -55,7 +58,6 @@
private lateinit var database: LimitOffsetTestDb
private lateinit var dao: TestItemDao
- private val itemsList = createItemsForDb(0, 100)
@Before
fun init() {
@@ -76,7 +78,7 @@
@Test
fun test_itemCount() {
- dao.addAllItems(itemsList)
+ dao.addAllItems(ITEMS_LIST)
val pagingSource = LimitOffsetPagingSourceImpl(database)
runBlocking {
// count query is executed on first load
@@ -88,7 +90,7 @@
@Test
fun test_itemCountWithSuppliedLimitOffset() {
- dao.addAllItems(itemsList)
+ dao.addAllItems(ITEMS_LIST)
val pagingSource = LimitOffsetPagingSourceImpl(
db = database,
queryString = "SELECT * FROM $tableName ORDER BY id ASC LIMIT 60 OFFSET 30",
@@ -103,7 +105,7 @@
@Test
fun dbInsert_pagingSourceInvalidates() {
- dao.addAllItems(itemsList)
+ dao.addAllItems(ITEMS_LIST)
val pagingSource = LimitOffsetPagingSourceImpl(database)
runBlocking {
// load once to register db observers
@@ -119,7 +121,7 @@
@Test
fun dbDelete_pagingSourceInvalidates() {
- dao.addAllItems(itemsList)
+ dao.addAllItems(ITEMS_LIST)
val pagingSource = LimitOffsetPagingSourceImpl(database)
runBlocking {
// load once to register db observers
@@ -134,7 +136,7 @@
@Test
fun invalidDbQuery_pagingSourceDoesNotInvalidate() {
- dao.addAllItems(itemsList)
+ dao.addAllItems(ITEMS_LIST)
val pagingSource = LimitOffsetPagingSourceImpl(database)
runBlocking {
// load once to register db observers
@@ -152,17 +154,16 @@
@Test
fun load_initialLoad() {
val pagingSource = LimitOffsetPagingSourceImpl(database)
- dao.addAllItems(itemsList)
+ dao.addAllItems(ITEMS_LIST)
runBlocking {
val result = pagingSource.refresh() as LoadResult.Page
assertThat(result.data).containsExactlyElementsIn(
- itemsList.subList(0, 15)
+ ITEMS_LIST.subList(0, 15)
)
}
}
- @FlakyTest(bugId = 195794422)
@Test
fun load_initialEmptyLoad() {
val pagingSource = LimitOffsetPagingSourceImpl(database)
@@ -172,7 +173,7 @@
assertTrue(result.data.isEmpty())
// now add items
- dao.addAllItems(itemsList)
+ dao.addAllItems(ITEMS_LIST)
// invalidate pagingSource to imitate invalidation from running refreshVersionSync
pagingSource.invalidate()
@@ -188,7 +189,7 @@
@Test
fun load_initialLoadWithInitialKey() {
- dao.addAllItems(itemsList)
+ dao.addAllItems(ITEMS_LIST)
val pagingSource = LimitOffsetPagingSourceImpl(database)
// refresh with initial key = 20
runBlocking {
@@ -196,14 +197,14 @@
// item in pos 21-35 (TestItemId 20-34) loaded
assertThat(result.data).containsExactlyElementsIn(
- itemsList.subList(20, 35)
+ ITEMS_LIST.subList(20, 35)
)
}
}
@Test
fun load_initialLoadWithSuppliedLimitOffset() {
- dao.addAllItems(itemsList)
+ dao.addAllItems(ITEMS_LIST)
val pagingSource = LimitOffsetPagingSourceImpl(
db = database,
queryString = "SELECT * FROM $tableName ORDER BY id ASC LIMIT 10 OFFSET 30",
@@ -214,7 +215,7 @@
// default initial loadSize = 15 starting from index 0.
// user supplied limit offset should cause initial loadSize = 10, starting from index 30
assertThat(result.data).containsExactlyElementsIn(
- itemsList.subList(30, 40)
+ ITEMS_LIST.subList(30, 40)
)
// check that no append/prepend can be triggered after this terminal load
assertThat(result.nextKey).isNull()
@@ -226,7 +227,7 @@
@Test
fun load_oneAdditionalQueryArguments() {
- dao.addAllItems(itemsList)
+ dao.addAllItems(ITEMS_LIST)
val pagingSource = LimitOffsetPagingSourceImpl(
db = database,
queryString =
@@ -238,7 +239,7 @@
// initial loadSize = 15, but limited by id < 50, should only load items 40 - 50
assertThat(result.data).containsExactlyElementsIn(
- itemsList.subList(40, 50)
+ ITEMS_LIST.subList(40, 50)
)
// should have 50 items fulfilling condition of id < 50 (TestItem id 0 - 49)
assertThat(pagingSource.itemCount.get()).isEqualTo(50)
@@ -247,7 +248,7 @@
@Test
fun load_multipleQueryArguments() {
- dao.addAllItems(itemsList)
+ dao.addAllItems(ITEMS_LIST)
val pagingSource = LimitOffsetPagingSourceImpl(
db = database,
queryString =
@@ -259,14 +260,14 @@
runBlocking {
val result = pagingSource.refresh() as LoadResult.Page
- assertThat(result.data).containsExactly(itemsList[90])
+ assertThat(result.data).containsExactly(ITEMS_LIST[90])
assertThat(pagingSource.itemCount.get()).isEqualTo(1)
}
}
@Test
fun load_InvalidUserSuppliedOffset_returnEmpty() {
- dao.addAllItems(itemsList)
+ dao.addAllItems(ITEMS_LIST)
val pagingSource = LimitOffsetPagingSourceImpl(
db = database,
queryString = "SELECT * FROM $tableName ORDER BY id ASC LIMIT 10 OFFSET 500",
@@ -288,7 +289,7 @@
@Test
fun load_UserSuppliedNegativeLimit() {
- dao.addAllItems(itemsList)
+ dao.addAllItems(ITEMS_LIST)
val pagingSource = LimitOffsetPagingSourceImpl(
db = database,
queryString = "SELECT * FROM $tableName ORDER BY id ASC LIMIT -1",
@@ -298,7 +299,7 @@
// ensure that it respects SQLite's default behavior for negative LIMIT
assertThat(result.data).containsExactlyElementsIn(
- itemsList.subList(0, 15)
+ ITEMS_LIST.subList(0, 15)
)
// should behave as if no LIMIT were set
assertThat(pagingSource.itemCount.get()).isEqualTo(100)
@@ -322,13 +323,13 @@
@Test
fun invalidInitialKey_keyTooLarge_returnsLastPage() {
val pagingSource = LimitOffsetPagingSourceImpl(database)
- dao.addAllItems(itemsList)
+ dao.addAllItems(ITEMS_LIST)
runBlocking {
val result = pagingSource.refresh(key = 101) as LoadResult.Page
// should load the last page
assertThat(result.data).containsExactlyElementsIn(
- itemsList.subList(85, 100)
+ ITEMS_LIST.subList(85, 100)
)
}
}
@@ -336,7 +337,7 @@
@Test
fun invalidInitialKey_negativeKey() {
val pagingSource = LimitOffsetPagingSourceImpl(database)
- dao.addAllItems(itemsList)
+ dao.addAllItems(ITEMS_LIST)
runBlocking {
// should throw error when initial key is negative
val expectedException = assertFailsWith<IllegalArgumentException> {
@@ -352,7 +353,7 @@
@Test
fun append_middleOfList() {
val pagingSource = LimitOffsetPagingSourceImpl(database)
- dao.addAllItems(itemsList)
+ dao.addAllItems(ITEMS_LIST)
// to bypass check for initial load and run as non-initial load
pagingSource.itemCount.set(100)
runBlocking {
@@ -360,7 +361,7 @@
// item in pos 21-25 (TestItemId 20-24) loaded
assertThat(result.data).containsExactlyElementsIn(
- itemsList.subList(20, 25)
+ ITEMS_LIST.subList(20, 25)
)
assertThat(result.nextKey).isEqualTo(25)
assertThat(result.prevKey).isEqualTo(20)
@@ -370,7 +371,7 @@
@Test
fun append_availableItemsLessThanLoadSize() {
val pagingSource = LimitOffsetPagingSourceImpl(database)
- dao.addAllItems(itemsList)
+ dao.addAllItems(ITEMS_LIST)
// to bypass check for initial load and run as non-initial load
pagingSource.itemCount.set(100)
runBlocking {
@@ -378,7 +379,7 @@
// item in pos 98-100 (TestItemId 97-99) loaded
assertThat(result.data).containsExactlyElementsIn(
- itemsList.subList(97, 100)
+ ITEMS_LIST.subList(97, 100)
)
assertThat(result.nextKey).isEqualTo(null)
assertThat(result.prevKey).isEqualTo(97)
@@ -388,7 +389,7 @@
@Test
fun load_consecutiveAppend() {
val pagingSource = LimitOffsetPagingSourceImpl(database)
- dao.addAllItems(itemsList)
+ dao.addAllItems(ITEMS_LIST)
// to bypass check for initial load and run as non-initial load
pagingSource.itemCount.set(100)
runBlocking {
@@ -397,14 +398,14 @@
// TestItemId 30-34 loaded
assertThat(result.data).containsExactlyElementsIn(
- itemsList.subList(30, 35)
+ ITEMS_LIST.subList(30, 35)
)
// second append using nextKey from previous load
val result2 = pagingSource.append(key = result.nextKey) as LoadResult.Page
// TestItemId 35 - 39 loaded
assertThat(result2.data).containsExactlyElementsIn(
- itemsList.subList(35, 40)
+ ITEMS_LIST.subList(35, 40)
)
}
}
@@ -412,7 +413,7 @@
@Test
fun append_invalidResult() {
val pagingSource = LimitOffsetPagingSourceImpl(database)
- dao.addAllItems(itemsList)
+ dao.addAllItems(ITEMS_LIST)
// to bypass check for initial load and run as non-initial load
pagingSource.itemCount.set(100)
runBlocking {
@@ -421,7 +422,7 @@
// TestItemId 30-34 loaded
assertThat(result.data).containsExactlyElementsIn(
- itemsList.subList(30, 35)
+ ITEMS_LIST.subList(30, 35)
)
// invalidate pagingSource to imitate invalidation from running refreshVersionSync
@@ -438,14 +439,14 @@
@Test
fun prepend_middleOfList() {
val pagingSource = LimitOffsetPagingSourceImpl(database)
- dao.addAllItems(itemsList)
+ dao.addAllItems(ITEMS_LIST)
// to bypass check for initial load and run as non-initial load
pagingSource.itemCount.set(100)
runBlocking {
val result = pagingSource.prepend(key = 30) as LoadResult.Page
assertThat(result.data).containsExactlyElementsIn(
- itemsList.subList(25, 30)
+ ITEMS_LIST.subList(25, 30)
)
assertThat(result.nextKey).isEqualTo(30)
assertThat(result.prevKey).isEqualTo(25)
@@ -455,7 +456,7 @@
@Test
fun prepend_availableItemsLessThanLoadSize() {
val pagingSource = LimitOffsetPagingSourceImpl(database)
- dao.addAllItems(itemsList)
+ dao.addAllItems(ITEMS_LIST)
// to bypass check for initial load and run as non-initial load
pagingSource.itemCount.set(100)
runBlocking {
@@ -463,7 +464,7 @@
// items in pos 0 - 2 (TestItemId 0 - 2) loaded
assertThat(result.data).containsExactlyElementsIn(
- itemsList.subList(0, 3)
+ ITEMS_LIST.subList(0, 3)
)
assertThat(result.nextKey).isEqualTo(3)
assertThat(result.prevKey).isEqualTo(null)
@@ -473,7 +474,7 @@
@Test
fun load_consecutivePrepend() {
val pagingSource = LimitOffsetPagingSourceImpl(database)
- dao.addAllItems(itemsList)
+ dao.addAllItems(ITEMS_LIST)
// to bypass check for initial load and run as non-initial load
pagingSource.itemCount.set(100)
runBlocking {
@@ -482,14 +483,14 @@
// items pos 16-20 (TestItemId 15-19) loaded
assertThat(result.data).containsExactlyElementsIn(
- itemsList.subList(15, 20)
+ ITEMS_LIST.subList(15, 20)
)
// second prepend using prevKey from previous load
val result2 = pagingSource.prepend(key = result.prevKey) as LoadResult.Page
// items pos 11-15 (TestItemId 10 - 14) loaded
assertThat(result2.data).containsExactlyElementsIn(
- itemsList.subList(10, 15)
+ ITEMS_LIST.subList(10, 15)
)
}
}
@@ -497,7 +498,7 @@
@Test
fun prepend_invalidResult() {
val pagingSource = LimitOffsetPagingSourceImpl(database)
- dao.addAllItems(itemsList)
+ dao.addAllItems(ITEMS_LIST)
// to bypass check for initial load and run as non-initial load
pagingSource.itemCount.set(100)
runBlocking {
@@ -506,7 +507,7 @@
// items pos 16-20 (TestItemId 15-19) loaded
assertThat(result.data).containsExactlyElementsIn(
- itemsList.subList(15, 20)
+ ITEMS_LIST.subList(15, 20)
)
// invalidate pagingSource to imitate invalidation from running refreshVersionSync
@@ -523,7 +524,7 @@
@Test
fun test_itemsBefore() {
val pagingSource = LimitOffsetPagingSourceImpl(database)
- dao.addAllItems(itemsList)
+ dao.addAllItems(ITEMS_LIST)
runBlocking {
// for initial load
val result = pagingSource.refresh(key = 50) as LoadResult.Page
@@ -548,7 +549,7 @@
@Test
fun test_itemsAfter() {
val pagingSource = LimitOffsetPagingSourceImpl(database)
- dao.addAllItems(itemsList)
+ dao.addAllItems(ITEMS_LIST)
runBlocking {
// for initial load
val result = pagingSource.refresh(key = 30) as LoadResult.Page
@@ -573,7 +574,7 @@
@Test
fun test_getRefreshKey() {
val pagingSource = LimitOffsetPagingSourceImpl(database)
- dao.addAllItems(itemsList)
+ dao.addAllItems(ITEMS_LIST)
runBlocking {
// initial load
val result = pagingSource.refresh() as LoadResult.Page
@@ -595,7 +596,7 @@
val result2 = pagingSource.append(key = result.nextKey) as LoadResult.Page
assertThat(result2.data).isEqualTo(
- itemsList.subList(15, 20)
+ ITEMS_LIST.subList(15, 20)
)
refreshKey = pagingSource.getRefreshKey(
PagingState(
@@ -615,7 +616,7 @@
@Test
fun load_refreshKeyGreaterThanItemCount_lastPage() {
val pagingSource = LimitOffsetPagingSourceImpl(database)
- dao.addAllItems(itemsList)
+ dao.addAllItems(ITEMS_LIST)
runBlocking {
pagingSource.refresh(key = 70)
@@ -636,7 +637,7 @@
// ensure that paging source can handle invalid refresh key properly
// should load last page with items 25 - 40
assertThat(result2.data).containsExactlyElementsIn(
- itemsList.subList(25, 40)
+ ITEMS_LIST.subList(25, 40)
)
// should account for updated item count to return correct itemsBefore, itemsAfter,
@@ -663,7 +664,7 @@
@Test
fun load_refreshKeyGreaterThanItemCount_firstPage() {
val pagingSource = LimitOffsetPagingSourceImpl(database)
- dao.addAllItems(itemsList)
+ dao.addAllItems(ITEMS_LIST)
runBlocking {
pagingSource.refresh()
@@ -683,7 +684,7 @@
assertThat(pagingSource2.itemCount.get()).isEqualTo(70)
// first 30 items deleted, refresh should load starting from pos 31 (item id 30 - 45)
assertThat(result2.data).containsExactlyElementsIn(
- itemsList.subList(30, 45)
+ ITEMS_LIST.subList(30, 45)
)
// should account for updated item count to return correct itemsBefore, itemsAfter,
@@ -699,7 +700,7 @@
@Test
fun load_loadSizeAndRefreshKeyGreaterThanItemCount() {
val pagingSource = LimitOffsetPagingSourceImpl(database)
- dao.addAllItems(itemsList)
+ dao.addAllItems(ITEMS_LIST)
runBlocking {
pagingSource.refresh(key = 30)
@@ -719,7 +720,7 @@
assertThat(pagingSource2.itemCount.get()).isEqualTo(5)
// only 5 items should be loaded with offset = 0
assertThat(result2.data).containsExactlyElementsIn(
- itemsList.subList(95, 100)
+ ITEMS_LIST.subList(95, 100)
)
// should recognize that this is a terminal load
@@ -735,86 +736,147 @@
val pagingSource = LimitOffsetPagingSourceImpl(database)
assertTrue(pagingSource.jumpingSupported)
}
+}
- private fun createLoadParam(
- loadType: LoadType,
- key: Int? = null,
- initialLoadSize: Int = CONFIG.initialLoadSize,
- pageSize: Int = CONFIG.pageSize,
- placeholdersEnabled: Boolean = CONFIG.enablePlaceholders
- ): PagingSource.LoadParams<Int> {
- return when (loadType) {
- LoadType.REFRESH -> {
- PagingSource.LoadParams.Refresh(
- key = key,
- loadSize = initialLoadSize,
- placeholdersEnabled = placeholdersEnabled
- )
+@RunWith(AndroidJUnit4::class)
+@SmallTest
+class LimitOffsetPagingSourceTestWithFilteringExecutor {
+
+ private lateinit var db: LimitOffsetTestDb
+ private lateinit var dao: TestItemDao
+ private val queryExecutor = FilteringExecutor()
+ private val mainThreadQueries = mutableListOf<Pair<String, String>>()
+
+ @Before
+ fun init() {
+ val mainThread: Thread = runBlocking(Dispatchers.Main) {
+ Thread.currentThread()
+ }
+ db = Room.inMemoryDatabaseBuilder(
+ ApplicationProvider.getApplicationContext(),
+ LimitOffsetTestDb::class.java
+ ).setQueryCallback(
+ { sqlQuery, _ ->
+ if (Thread.currentThread() === mainThread) {
+ mainThreadQueries.add(
+ sqlQuery to Throwable().stackTraceToString()
+ )
+ }
+ },
+ {
+ // instantly execute the log callback so that we can check the thread.
+ it.run()
}
- LoadType.APPEND -> {
- PagingSource.LoadParams.Append(
- key = key ?: -1,
- loadSize = pageSize,
- placeholdersEnabled = placeholdersEnabled
- )
+ ).setQueryExecutor(queryExecutor)
+ .build()
+
+ dao = db.dao
+ }
+
+ @After
+ fun tearDown() {
+ // Check no mainThread queries happened.
+ assertThat(mainThreadQueries).isEmpty()
+ db.close()
+ }
+
+ @Test
+ fun invalid_refresh() {
+ val pagingSource = LimitOffsetPagingSourceImpl(db)
+ runBlocking {
+ val result = pagingSource.refresh() as LoadResult.Page
+
+ assertTrue(result.data.isEmpty())
+
+ // blocks invalidation notification from Room
+ queryExecutor.filterFunction = { runnable ->
+ runnable !== db.invalidationTracker.refreshRunnable
}
- LoadType.PREPEND -> {
- PagingSource.LoadParams.Prepend(
- key = key ?: -1,
- loadSize = pageSize,
- placeholdersEnabled = placeholdersEnabled
- )
- }
+
+ // now write to database
+ dao.addAllItems(ITEMS_LIST)
+
+ // make sure room requests a refresh
+ db.invalidationTracker.awaitPendingRefresh()
+ // and that this is blocked to simulate delayed notification from room
+ queryExecutor.awaitDeferredSizeAtLeast(1)
+
+ // the db write should cause pagingSource to realize it is invalid
+ assertThat(pagingSource.refresh()).isInstanceOf(
+ LoadResult.Invalid::class.java
+ )
+ assertTrue(pagingSource.invalid)
}
}
- private fun createItemsForDb(startId: Int, count: Int): List<TestItem> {
- return List(count) {
- TestItem(
- id = it + startId,
+ @Test
+ fun invalid_append() {
+ val pagingSource = LimitOffsetPagingSourceImpl(db)
+ dao.addAllItems(ITEMS_LIST)
+
+ runBlocking {
+ val result = pagingSource.refresh() as LoadResult.Page
+
+ // initial load
+ assertThat(result.data).containsExactlyElementsIn(
+ ITEMS_LIST.subList(0, 15)
)
+
+ // blocks invalidation notification from Room
+ queryExecutor.filterFunction = { runnable ->
+ runnable !== db.invalidationTracker.refreshRunnable
+ }
+
+ // now write to the database
+ dao.deleteTestItem(ITEMS_LIST[30])
+
+ // make sure room requests a refresh
+ db.invalidationTracker.awaitPendingRefresh()
+ // and that this is blocked to simulate delayed notification from room
+ queryExecutor.awaitDeferredSizeAtLeast(1)
+
+ // the db write should cause pagingSource to realize it is invalid when it tries to
+ // append
+ assertThat(pagingSource.append(15)).isInstanceOf(
+ LoadResult.Invalid::class.java
+ )
+ assertTrue(pagingSource.invalid)
}
}
- private suspend fun PagingSource<Int, TestItem>.refresh(
- key: Int? = null,
- ): LoadResult<Int, TestItem> {
- return this.load(
- createLoadParam(
- loadType = LoadType.REFRESH,
- key = key,
- )
- )
- }
+ @Test
+ fun invalid_prepend() {
+ val pagingSource = LimitOffsetPagingSourceImpl(db)
+ dao.addAllItems(ITEMS_LIST)
- private suspend fun PagingSource<Int, TestItem>.append(
- key: Int? = -1,
- ): LoadResult<Int, TestItem> {
- return this.load(
- createLoadParam(
- loadType = LoadType.APPEND,
- key = key,
- )
- )
- }
+ runBlocking {
+ val result = pagingSource.refresh(key = 20) as LoadResult.Page
- private suspend fun PagingSource<Int, TestItem>.prepend(
- key: Int? = -1,
- ): LoadResult<Int, TestItem> {
- return this.load(
- createLoadParam(
- loadType = LoadType.PREPEND,
- key = key,
+ // initial load
+ assertThat(result.data).containsExactlyElementsIn(
+ ITEMS_LIST.subList(20, 35)
)
- )
- }
- companion object {
- val CONFIG = PagingConfig(
- pageSize = 5,
- enablePlaceholders = true,
- initialLoadSize = 15
- )
+ // blocks invalidation notification from Room
+ queryExecutor.filterFunction = { runnable ->
+ runnable !== db.invalidationTracker.refreshRunnable
+ }
+
+ // now write to the database
+ dao.deleteTestItem(ITEMS_LIST[30])
+
+ // make sure room requests a refresh
+ db.invalidationTracker.awaitPendingRefresh()
+ // and that this is blocked to simulate delayed notification from room
+ queryExecutor.awaitDeferredSizeAtLeast(1)
+
+ // the db write should cause pagingSource to realize it is invalid when it tries to
+ // append
+ assertThat(pagingSource.prepend(20)).isInstanceOf(
+ LoadResult.Invalid::class.java
+ )
+ assertTrue(pagingSource.invalid)
+ }
}
}
@@ -840,3 +902,84 @@
return data
}
}
+
+private val CONFIG = PagingConfig(
+ pageSize = 5,
+ enablePlaceholders = true,
+ initialLoadSize = 15
+)
+
+private val ITEMS_LIST = createItemsForDb(0, 100)
+
+private fun createLoadParam(
+ loadType: LoadType,
+ key: Int? = null,
+ initialLoadSize: Int = CONFIG.initialLoadSize,
+ pageSize: Int = CONFIG.pageSize,
+ placeholdersEnabled: Boolean = CONFIG.enablePlaceholders
+): PagingSource.LoadParams<Int> {
+ return when (loadType) {
+ LoadType.REFRESH -> {
+ PagingSource.LoadParams.Refresh(
+ key = key,
+ loadSize = initialLoadSize,
+ placeholdersEnabled = placeholdersEnabled
+ )
+ }
+ LoadType.APPEND -> {
+ PagingSource.LoadParams.Append(
+ key = key ?: -1,
+ loadSize = pageSize,
+ placeholdersEnabled = placeholdersEnabled
+ )
+ }
+ LoadType.PREPEND -> {
+ PagingSource.LoadParams.Prepend(
+ key = key ?: -1,
+ loadSize = pageSize,
+ placeholdersEnabled = placeholdersEnabled
+ )
+ }
+ }
+}
+
+private fun createItemsForDb(startId: Int, count: Int): List<TestItem> {
+ return List(count) {
+ TestItem(
+ id = it + startId,
+ )
+ }
+}
+
+private suspend fun PagingSource<Int, TestItem>.refresh(
+ key: Int? = null,
+): LoadResult<Int, TestItem> {
+ return this.load(
+ createLoadParam(
+ loadType = LoadType.REFRESH,
+ key = key,
+ )
+ )
+}
+
+private suspend fun PagingSource<Int, TestItem>.append(
+ key: Int? = -1,
+): LoadResult<Int, TestItem> {
+ return this.load(
+ createLoadParam(
+ loadType = LoadType.APPEND,
+ key = key,
+ )
+ )
+}
+
+private suspend fun PagingSource<Int, TestItem>.prepend(
+ key: Int? = -1,
+): LoadResult<Int, TestItem> {
+ return this.load(
+ createLoadParam(
+ loadType = LoadType.PREPEND,
+ key = key,
+ )
+ )
+}
diff --git a/room/update_ksp.sh b/room/update_ksp.sh
index 0a0a66a..f5466d4 100755
--- a/room/update_ksp.sh
+++ b/room/update_ksp.sh
@@ -46,6 +46,6 @@
development/importMaven/import_maven_artifacts.py -n com.google.devtools.ksp:symbol-processing:$KSP_VERSION
# update build version
-sed -i "s/build_versions\.ksp = .*/build_versions.ksp = \"$KSP_VERSION\"/g" buildSrc/build_dependencies.gradle
+sed -i "s/ksp = \".*\"/ksp = \"$KSP_VERSION\"/" gradle/libs.versions.toml
echo "done"
\ No newline at end of file
diff --git a/samples/Support7Demos/src/main/java/com/example/android/supportv7/media/Player.java b/samples/Support7Demos/src/main/java/com/example/android/supportv7/media/Player.java
index 678df71..1cd930a 100644
--- a/samples/Support7Demos/src/main/java/com/example/android/supportv7/media/Player.java
+++ b/samples/Support7Demos/src/main/java/com/example/android/supportv7/media/Player.java
@@ -205,7 +205,7 @@
intent.putExtra(Intent.EXTRA_KEY_EVENT, new KeyEvent(KeyEvent.ACTION_DOWN, keyCode));
return PendingIntent.getBroadcast(mContext, keyCode, intent,
- PendingIntent.FLAG_UPDATE_CURRENT);
+ PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_IMMUTABLE);
}
protected void publishState(int state) {
if (mMediaSession == null) {
diff --git a/samples/Support7Demos/src/main/java/com/example/android/supportv7/media/SampleDynamicGroupMrp.java b/samples/Support7Demos/src/main/java/com/example/android/supportv7/media/SampleDynamicGroupMrp.java
index ec9ca9a..98f27b9 100644
--- a/samples/Support7Demos/src/main/java/com/example/android/supportv7/media/SampleDynamicGroupMrp.java
+++ b/samples/Support7Demos/src/main/java/com/example/android/supportv7/media/SampleDynamicGroupMrp.java
@@ -137,7 +137,7 @@
settingsIntent.setClass(getContext(), SampleMediaRouteSettingsActivity.class)
.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
IntentSender is = PendingIntent.getActivity(getContext(), 99, settingsIntent,
- PendingIntent.FLAG_UPDATE_CURRENT).getIntentSender();
+ PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_IMMUTABLE).getIntentSender();
mVolumes.put(VARIABLE_VOLUME_BASIC_ROUTE_ID + "1", VOLUME_DEFAULT);
mVolumes.put(VARIABLE_VOLUME_BASIC_ROUTE_ID + "2", VOLUME_DEFAULT);
diff --git a/samples/Support7Demos/src/main/java/com/example/android/supportv7/media/SampleMediaRouterActivity.java b/samples/Support7Demos/src/main/java/com/example/android/supportv7/media/SampleMediaRouterActivity.java
index e1dcb3d..be0c8bf 100644
--- a/samples/Support7Demos/src/main/java/com/example/android/supportv7/media/SampleMediaRouterActivity.java
+++ b/samples/Support7Demos/src/main/java/com/example/android/supportv7/media/SampleMediaRouterActivity.java
@@ -359,7 +359,8 @@
SampleMediaButtonReceiver.class.getName());
Intent mediaButtonIntent = new Intent(Intent.ACTION_MEDIA_BUTTON);
mediaButtonIntent.setComponent(mEventReceiver);
- mMediaPendingIntent = PendingIntent.getBroadcast(this, 0, mediaButtonIntent, 0);
+ mMediaPendingIntent = PendingIntent.getBroadcast(this, /* requestCode = */0,
+ mediaButtonIntent, PendingIntent.FLAG_IMMUTABLE);
// Create and register the remote control client
createMediaSession();
diff --git a/samples/SupportLeanbackDemos/build.gradle b/samples/SupportLeanbackDemos/build.gradle
index 483f831..906fa29 100644
--- a/samples/SupportLeanbackDemos/build.gradle
+++ b/samples/SupportLeanbackDemos/build.gradle
@@ -12,10 +12,9 @@
implementation("androidx.lifecycle:lifecycle-extensions:2.2.0")
implementation(libs.constraintLayout)
- def room_version = "2.4.0-alpha04"
- implementation("androidx.room:room-paging:$room_version")
- implementation("androidx.room:room-runtime:$room_version")
- annotationProcessor("androidx.room:room-compiler:$room_version")
+ implementation(projectOrArtifact(":room:room-paging"))
+ implementation(projectOrArtifact(":room:room-runtime"))
+ annotationProcessor(projectOrArtifact(":room:room-compiler"))
}
android {
diff --git a/security/security-identity-credential/build.gradle b/security/security-identity-credential/build.gradle
index fcae685b..6f2a83c 100644
--- a/security/security-identity-credential/build.gradle
+++ b/security/security-identity-credential/build.gradle
@@ -26,12 +26,11 @@
}
dependencies {
- implementation("androidx.annotation:annotation:1.1.0")
+ implementation("androidx.annotation:annotation:1.2.0")
+ implementation("androidx.biometric:biometric:1.1.0-alpha02")
implementation("co.nstant.in:cbor:0.8")
- implementation(project(":biometric:biometric"))
implementation("org.bouncycastle:bcprov-jdk15on:1.65")
implementation("org.bouncycastle:bcpkix-jdk15on:1.56")
- implementation project(path: ':annotation:annotation')
androidTestImplementation(libs.testExtJunit)
androidTestImplementation(libs.testCore)
diff --git a/settings.gradle b/settings.gradle
index cb9c2d4..12807502 100644
--- a/settings.gradle
+++ b/settings.gradle
@@ -204,12 +204,13 @@
includeProject(":appcompat:integration-tests:receive-content-testapp", "appcompat/integration-tests/receive-content-testapp", [BuildType.MAIN])
includeProject(":appsearch:appsearch", "appsearch/appsearch", [BuildType.MAIN])
includeProject(":appsearch:appsearch-compiler", "appsearch/compiler", [BuildType.MAIN])
-includeProject(":appsearch:appsearch-debug-view", "appsearch/debug-view", [BuildType.MAIN])
-includeProject(":appsearch:appsearch-debug-view:samples", "appsearch/debug-view/samples",
+includeProject(":appsearch:appsearch-debug-view", "appsearch/appsearch-debug-view", [BuildType.MAIN])
+includeProject(":appsearch:appsearch-debug-view:samples", "appsearch/appsearch-debug-view/samples",
[BuildType.MAIN])
includeProject(":appsearch:appsearch-ktx", "appsearch/appsearch-ktx", [BuildType.MAIN])
-includeProject(":appsearch:appsearch-local-storage", "appsearch/local-storage", [BuildType.MAIN])
-includeProject(":appsearch:appsearch-platform-storage", "appsearch/platform-storage", [BuildType.MAIN])
+includeProject(":appsearch:appsearch-local-storage", "appsearch/appsearch-local-storage", [BuildType.MAIN])
+includeProject(":appsearch:appsearch-platform-storage", "appsearch/appsearch-platform-storage", [BuildType.MAIN])
+includeProject(":appsearch:appsearch-test-util", "appsearch/appsearch-test-util", [BuildType.MAIN])
includeProject(":arch:core:core-common", "arch/core/core-common", [BuildType.MAIN])
includeProject(":arch:core:core-runtime", "arch/core/core-runtime", [BuildType.MAIN])
includeProject(":arch:core:core-testing", "arch/core/core-testing", [BuildType.MAIN])
@@ -274,10 +275,11 @@
includeProject(":car:app:app-testing", "car/app/app-testing", [BuildType.MAIN])
includeProject(":cardview:cardview", "cardview/cardview", [BuildType.MAIN])
includeProject(":collection:collection", "collection/collection", [BuildType.MAIN])
-includeProject(":collection:collection2", "collection/collection2", [BuildType.MAIN])
includeProject(":collection:collection-benchmark", "collection/collection-benchmark", [BuildType.MAIN])
includeProject(":collection:collection-ktx", "collection/collection-ktx", [BuildType.MAIN])
includeProject(":collection:integration-tests:testapp", "collection/integration-tests/testapp", [BuildType.MAIN])
+includeProject(":collection2:collection2", "collection2/collection2", [BuildType.MAIN])
+includeProject(":collection2:collection2:integration-tests:publishing", "collection2/collection2/integration-tests/publishing", [BuildType.MAIN])
includeProject(":compose:animation", "compose/animation", [BuildType.COMPOSE])
includeProject(":compose:animation:animation", "compose/animation/animation", [BuildType.COMPOSE])
includeProject(":compose:animation:animation-lint", "compose/animation/animation-lint", [BuildType.COMPOSE])
@@ -293,6 +295,7 @@
includeProject(":compose:benchmark-utils", "compose/benchmark-utils", [BuildType.COMPOSE])
includeProject(":compose:benchmark-utils:benchmark-utils-benchmark", "compose/benchmark-utils/benchmark", [BuildType.COMPOSE])
includeProject(":compose:compiler:compiler", "compose/compiler/compiler", [BuildType.COMPOSE, BuildType.MAIN])
+includeProject(":compose:compiler:compiler:integration-tests", "compose/compiler/compiler/integration-tests", [BuildType.COMPOSE])
includeProject(":compose:compiler:compiler-hosted", "compose/compiler/compiler-hosted", [BuildType.COMPOSE, BuildType.MAIN])
includeProject(":compose:compiler:compiler-hosted:integration-tests", "compose/compiler/compiler-hosted/integration-tests", [BuildType.COMPOSE])
includeProject(":compose:compiler:compiler-hosted:integration-tests:kotlin-compiler-repackaged", "compose/compiler/compiler-hosted/integration-tests/kotlin-compiler-repackaged", [BuildType.COMPOSE])
@@ -397,7 +400,7 @@
includeProject(":core:core-ktx", "core/core-ktx", [BuildType.MAIN])
includeProject(":core:core-remoteviews", "core/core-remoteviews", [BuildType.MAIN])
includeProject(":core:core-splashscreen", "core/core-splashscreen", [BuildType.MAIN])
-includeProject(":core:core-splashscreen:core-splashscreen-sample", "core/core-splashscreen/core-splashscreen-sample", [BuildType.MAIN])
+includeProject(":core:core-splashscreen:core-splashscreen-samples", "core/core-splashscreen/samples", [BuildType.MAIN])
includeProject(":core:core-role", "core/core-role", [BuildType.MAIN])
includeProject(":cursoradapter:cursoradapter", "cursoradapter/cursoradapter", [BuildType.MAIN])
includeProject(":customview:customview", "customview/customview", [BuildType.MAIN])
@@ -417,6 +420,7 @@
includeProject(":datastore:datastore-rxjava3", "datastore/datastore-rxjava3", [BuildType.MAIN])
includeProject(":datastore:datastore-sampleapp", "datastore/datastore-sampleapp", [BuildType.MAIN])
includeProject(":documentfile:documentfile", "documentfile/documentfile", [BuildType.MAIN])
+includeProject(":draganddrop:draganddrop", "draganddrop/draganddrop", [BuildType.MAIN])
includeProject(":drawerlayout:drawerlayout", "drawerlayout/drawerlayout", [BuildType.MAIN])
includeProject(":dynamicanimation", "dynamicanimation", [BuildType.MAIN])
includeProject(":dynamicanimation:dynamicanimation", "dynamicanimation/dynamicanimation", [BuildType.MAIN])
@@ -445,6 +449,8 @@
includeProject(":fragment:fragment-truth", "fragment/fragment-truth", [BuildType.MAIN, BuildType.FLAN])
includeProject(":fragment:integration-tests:testapp", "fragment/integration-tests/testapp", [BuildType.MAIN, BuildType.FLAN])
includeProject(":glance:glance", "glance/glance", [BuildType.MAIN])
+includeProject(":glance:glance-appwidget", "glance/glance-appwidget", [BuildType.MAIN])
+includeProject(":glance:glance-wear", "glance/glance-wear", [BuildType.MAIN])
includeProject(":gridlayout:gridlayout", "gridlayout/gridlayout", [BuildType.MAIN])
includeProject(":health:health-services-client", "health/health-services-client", [BuildType.MAIN])
includeProject(":heifwriter:heifwriter", "heifwriter/heifwriter", [BuildType.MAIN])
@@ -569,15 +575,15 @@
includeProject(":room:integration-tests:room-testapp-kotlin", "room/integration-tests/kotlintestapp", [BuildType.MAIN])
includeProject(":room:integration-tests:room-testapp-noappcompat", "room/integration-tests/noappcompattestapp", [BuildType.MAIN])
includeProject(":room:room-benchmark", "room/benchmark", [BuildType.MAIN])
-includeProject(":room:room-common", "room/room-common", [BuildType.MAIN])
-includeProject(":room:room-compiler", "room/room-compiler", [BuildType.MAIN])
-includeProject(":room:room-compiler-processing", "room/room-compiler-processing", [BuildType.MAIN])
-includeProject(":room:room-compiler-processing-testing", "room/room-compiler-processing-testing", [BuildType.MAIN])
+includeProject(":room:room-common", "room/room-common", [BuildType.MAIN, BuildType.COMPOSE])
+includeProject(":room:room-compiler", "room/room-compiler", [BuildType.MAIN, BuildType.COMPOSE])
+includeProject(":room:room-compiler-processing", "room/room-compiler-processing", [BuildType.MAIN, BuildType.COMPOSE])
+includeProject(":room:room-compiler-processing-testing", "room/room-compiler-processing-testing", [BuildType.MAIN, BuildType.COMPOSE])
includeProject(":room:room-guava", "room/room-guava", [BuildType.MAIN])
-includeProject(":room:room-ktx", "room/room-ktx", [BuildType.MAIN])
-includeProject(":room:room-migration", "room/room-migration", [BuildType.MAIN])
-includeProject(":room:room-paging", "room/room-paging", [BuildType.MAIN])
-includeProject(":room:room-runtime", "room/room-runtime", [BuildType.MAIN])
+includeProject(":room:room-ktx", "room/room-ktx", [BuildType.MAIN, BuildType.COMPOSE])
+includeProject(":room:room-migration", "room/room-migration", [BuildType.MAIN, BuildType.COMPOSE])
+includeProject(":room:room-paging", "room/room-paging", [BuildType.MAIN, BuildType.COMPOSE])
+includeProject(":room:room-runtime", "room/room-runtime", [BuildType.MAIN, BuildType.COMPOSE])
includeProject(":room:room-rxjava2", "room/room-rxjava2", [BuildType.MAIN])
includeProject(":room:room-rxjava3", "room/room-rxjava3", [BuildType.MAIN])
includeProject(":room:room-testing", "room/room-testing", [BuildType.MAIN])
@@ -593,7 +599,7 @@
includeProject(":sharetarget:sharetarget", "sharetarget/sharetarget", [BuildType.MAIN])
includeProject(":slice:slice-benchmark", "slice/slice-benchmark", [BuildType.MAIN])
includeProject(":slice:slice-builders", "slice/slice-builders", [BuildType.MAIN])
-includeProject(":slice:slice-builders-ktx", "slice/slice-builders/ktx", [BuildType.MAIN])
+includeProject(":slice:slice-builders-ktx", "slice/slice-builders-ktx", [BuildType.MAIN])
includeProject(":slice:slice-core", "slice/slice-core", [BuildType.MAIN])
includeProject(":slice:slice-remotecallback", "slice/slice-remotecallback", [BuildType.MAIN])
includeProject(":slice:slice-test", "slice/slice-test", [BuildType.MAIN])
@@ -601,8 +607,8 @@
includeProject(":slidingpanelayout:slidingpanelayout", "slidingpanelayout/slidingpanelayout", [BuildType.MAIN, BuildType.FLAN])
includeProject(":sqlite:integration-tests:inspection-room-testapp", "sqlite/integration-tests/inspection-room-testapp", [BuildType.MAIN])
includeProject(":sqlite:integration-tests:inspection-sqldelight-testapp", "sqlite/integration-tests/inspection-sqldelight-testapp", [BuildType.MAIN])
-includeProject(":sqlite:sqlite", "sqlite/sqlite", [BuildType.MAIN])
-includeProject(":sqlite:sqlite-framework", "sqlite/sqlite-framework", [BuildType.MAIN])
+includeProject(":sqlite:sqlite", "sqlite/sqlite", [BuildType.MAIN, BuildType.COMPOSE])
+includeProject(":sqlite:sqlite-framework", "sqlite/sqlite-framework", [BuildType.MAIN, BuildType.COMPOSE])
includeProject(":sqlite:sqlite-inspection", "sqlite/sqlite-inspection", [BuildType.MAIN])
includeProject(":sqlite:sqlite-ktx", "sqlite/sqlite-ktx", [BuildType.MAIN])
includeProject(":startup:integration-tests:first-library", "startup/integration-tests/first-library", [BuildType.MAIN])
@@ -611,8 +617,8 @@
includeProject(":startup:startup-runtime", "startup/startup-runtime", [BuildType.MAIN])
includeProject(":startup:startup-runtime-lint", "startup/startup-runtime-lint", [BuildType.MAIN])
includeProject(":swiperefreshlayout:swiperefreshlayout", "swiperefreshlayout/swiperefreshlayout", [BuildType.MAIN])
-includeProject(":test:screenshot:test-screenshot", "test/screenshot")
-includeProject(":test:screenshot:test-screenshot-proto", "test/screenshot/proto", [BuildType.MAIN])
+includeProject(":test:screenshot:screenshot", "test/screenshot/screenshot")
+includeProject(":test:screenshot:screenshot-proto", "test/screenshot/screenshot/proto", [BuildType.MAIN])
includeProject(":text:text", "text/text", [BuildType.COMPOSE])
includeProject(":textclassifier:integration-tests:testapp", "textclassifier/integration-tests/testapp", [BuildType.MAIN])
includeProject(":textclassifier:textclassifier", "textclassifier/textclassifier", [BuildType.MAIN])
@@ -681,16 +687,16 @@
includeProject(":window:window-sidecar", "window/window-sidecar", [BuildType.MAIN, BuildType.FLAN])
includeProject(":window:window-testing", "window/window-testing", [BuildType.MAIN, BuildType.FLAN])
includeProject(":work:integration-tests:testapp", "work/integration-tests/testapp", [BuildType.MAIN])
-includeProject(":work:work-benchmark", "work/workmanager-benchmark", [BuildType.MAIN])
-includeProject(":work:work-gcm", "work/workmanager-gcm", [BuildType.MAIN])
-includeProject(":work:work-inspection", "work/workmanager-inspection", [BuildType.MAIN])
-includeProject(":work:work-multiprocess", "work/workmanager-multiprocess", [BuildType.MAIN])
-includeProject(":work:work-runtime", "work/workmanager", [BuildType.MAIN])
-includeProject(":work:work-runtime-ktx", "work/workmanager-ktx", [BuildType.MAIN])
-includeProject(":work:work-runtime-lint", "work/workmanager-lint", [BuildType.MAIN])
-includeProject(":work:work-rxjava2", "work/workmanager-rxjava2", [BuildType.MAIN])
-includeProject(":work:work-rxjava3", "work/workmanager-rxjava3", [BuildType.MAIN])
-includeProject(":work:work-testing", "work/workmanager-testing", [BuildType.MAIN])
+includeProject(":work:work-benchmark", "work/work-benchmark", [BuildType.MAIN])
+includeProject(":work:work-gcm", "work/work-gcm", [BuildType.MAIN])
+includeProject(":work:work-inspection", "work/work-inspection", [BuildType.MAIN])
+includeProject(":work:work-multiprocess", "work/work-multiprocess", [BuildType.MAIN])
+includeProject(":work:work-runtime", "work/work-runtime", [BuildType.MAIN])
+includeProject(":work:work-runtime-ktx", "work/work-runtime-ktx", [BuildType.MAIN])
+includeProject(":work:work-runtime-lint", "work/work-lint", [BuildType.MAIN])
+includeProject(":work:work-rxjava2", "work/work-rxjava2", [BuildType.MAIN])
+includeProject(":work:work-rxjava3", "work/work-rxjava3", [BuildType.MAIN])
+includeProject(":work:work-testing", "work/work-testing", [BuildType.MAIN])
/////////////////////////////
//
@@ -732,12 +738,12 @@
includeProject(":internal-testutils-runtime", "testutils/testutils-runtime", [BuildType.MAIN, BuildType.FLAN, BuildType.COMPOSE, BuildType.MEDIA, BuildType.WEAR])
includeProject(":internal-testutils-appcompat", "testutils/testutils-appcompat", [BuildType.MAIN])
includeProject(":internal-testutils-espresso", "testutils/testutils-espresso", [BuildType.MAIN])
-includeProject(":internal-testutils-truth", "testutils/testutils-truth", [BuildType.MAIN, BuildType.FLAN])
-includeProject(":internal-testutils-ktx", "testutils/testutils-ktx", [BuildType.MAIN, BuildType.COMPOSE])
+includeProject(":internal-testutils-truth", "testutils/testutils-truth", [BuildType.MAIN, BuildType.FLAN, BuildType.COMPOSE])
+includeProject(":internal-testutils-ktx", "testutils/testutils-ktx")
includeProject(":internal-testutils-macrobenchmark", "testutils/testutils-macrobenchmark", [BuildType.MAIN, BuildType.COMPOSE])
includeProject(":internal-testutils-navigation", "testutils/testutils-navigation", [BuildType.MAIN, BuildType.COMPOSE, BuildType.FLAN])
includeProject(":internal-testutils-paging", "testutils/testutils-paging", [BuildType.MAIN, BuildType.COMPOSE])
-includeProject(":internal-testutils-gradle-plugin", "testutils/testutils-gradle-plugin", [BuildType.MAIN, BuildType.FLAN])
+includeProject(":internal-testutils-gradle-plugin", "testutils/testutils-gradle-plugin", [BuildType.MAIN, BuildType.FLAN, BuildType.COMPOSE])
includeProject(":internal-testutils-mockito", "testutils/testutils-mockito", [BuildType.MAIN, BuildType.MEDIA])
/////////////////////////////
diff --git a/work/workmanager-gcm/api/2.5.0-beta01.txt b/sharetarget/sharetarget/api/1.2.0-beta01.txt
similarity index 100%
copy from work/workmanager-gcm/api/2.5.0-beta01.txt
copy to sharetarget/sharetarget/api/1.2.0-beta01.txt
diff --git a/work/workmanager-gcm/api/2.5.0-beta01.txt b/sharetarget/sharetarget/api/public_plus_experimental_1.2.0-beta01.txt
similarity index 100%
copy from work/workmanager-gcm/api/2.5.0-beta01.txt
copy to sharetarget/sharetarget/api/public_plus_experimental_1.2.0-beta01.txt
diff --git a/work/workmanager-gcm/api/res-2.2.0-beta01.txt b/sharetarget/sharetarget/api/res-1.2.0-beta01.txt
similarity index 100%
copy from work/workmanager-gcm/api/res-2.2.0-beta01.txt
copy to sharetarget/sharetarget/api/res-1.2.0-beta01.txt
diff --git a/sharetarget/sharetarget/api/restricted_1.2.0-beta01.txt b/sharetarget/sharetarget/api/restricted_1.2.0-beta01.txt
new file mode 100644
index 0000000..c2cb6a4
--- /dev/null
+++ b/sharetarget/sharetarget/api/restricted_1.2.0-beta01.txt
@@ -0,0 +1,18 @@
+// Signature format: 4.0
+package androidx.sharetarget {
+
+ @RequiresApi(23) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class ChooserTargetServiceCompat extends android.service.chooser.ChooserTargetService {
+ ctor public ChooserTargetServiceCompat();
+ method public java.util.List<android.service.chooser.ChooserTarget!>! onGetChooserTargets(android.content.ComponentName!, android.content.IntentFilter!);
+ }
+
+ @RequiresApi(19) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class ShortcutInfoCompatSaverImpl extends androidx.core.content.pm.ShortcutInfoCompatSaver<com.google.common.util.concurrent.ListenableFuture<java.lang.Void>> {
+ method @AnyThread public com.google.common.util.concurrent.ListenableFuture<java.lang.Void!>! addShortcuts(java.util.List<androidx.core.content.pm.ShortcutInfoCompat!>!);
+ method @AnyThread public static androidx.sharetarget.ShortcutInfoCompatSaverImpl! getInstance(android.content.Context!);
+ method @WorkerThread public androidx.core.graphics.drawable.IconCompat! getShortcutIcon(String!) throws java.lang.Exception;
+ method @AnyThread public com.google.common.util.concurrent.ListenableFuture<java.lang.Void!>! removeAllShortcuts();
+ method @AnyThread public com.google.common.util.concurrent.ListenableFuture<java.lang.Void!>! removeShortcuts(java.util.List<java.lang.String!>!);
+ }
+
+}
+
diff --git a/slice/slice-benchmark/src/androidTest/AndroidManifest.xml b/slice/slice-benchmark/src/androidTest/AndroidManifest.xml
index 570a690..ff574dd 100644
--- a/slice/slice-benchmark/src/androidTest/AndroidManifest.xml
+++ b/slice/slice-benchmark/src/androidTest/AndroidManifest.xml
@@ -16,14 +16,9 @@
-->
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:tools="http://schemas.android.com/tools"
package="androidx.slice.benchmark.test">
-
- <!-- Important: disable debuggable for accurate performance results -->
- <application
- android:debuggable="false">
- <!-- enable profileableByShell for non-intrusive profiling tools -->
- <!--suppress AndroidElementNotAllowed -->
+ <application>
+ <!-- enable profiling by shell for non-intrusive profiling tools -->
<profileable android:shell="true"/>
</application>
</manifest>
diff --git a/slice/slice-builders/ktx/OWNERS b/slice/slice-builders-ktx/OWNERS
similarity index 100%
rename from slice/slice-builders/ktx/OWNERS
rename to slice/slice-builders-ktx/OWNERS
diff --git a/slice/slice-builders/ktx/api/current.txt b/slice/slice-builders-ktx/api/current.txt
similarity index 100%
rename from slice/slice-builders/ktx/api/current.txt
rename to slice/slice-builders-ktx/api/current.txt
diff --git a/slice/slice-builders/ktx/api/public_plus_experimental_current.txt b/slice/slice-builders-ktx/api/public_plus_experimental_current.txt
similarity index 100%
rename from slice/slice-builders/ktx/api/public_plus_experimental_current.txt
rename to slice/slice-builders-ktx/api/public_plus_experimental_current.txt
diff --git a/slice/slice-builders/ktx/api/res-current.txt b/slice/slice-builders-ktx/api/res-current.txt
similarity index 100%
rename from slice/slice-builders/ktx/api/res-current.txt
rename to slice/slice-builders-ktx/api/res-current.txt
diff --git a/slice/slice-builders/ktx/api/restricted_current.txt b/slice/slice-builders-ktx/api/restricted_current.txt
similarity index 100%
rename from slice/slice-builders/ktx/api/restricted_current.txt
rename to slice/slice-builders-ktx/api/restricted_current.txt
diff --git a/slice/slice-builders/ktx/build.gradle b/slice/slice-builders-ktx/build.gradle
similarity index 100%
rename from slice/slice-builders/ktx/build.gradle
rename to slice/slice-builders-ktx/build.gradle
diff --git a/slice/slice-builders/ktx/src/androidTest/AndroidManifest.xml b/slice/slice-builders-ktx/src/androidTest/AndroidManifest.xml
similarity index 100%
rename from slice/slice-builders/ktx/src/androidTest/AndroidManifest.xml
rename to slice/slice-builders-ktx/src/androidTest/AndroidManifest.xml
diff --git a/slice/slice-builders/ktx/src/androidTest/java/androidx/slice/builders/SliceBuildersKtxTest.kt b/slice/slice-builders-ktx/src/androidTest/java/androidx/slice/builders/SliceBuildersKtxTest.kt
similarity index 100%
rename from slice/slice-builders/ktx/src/androidTest/java/androidx/slice/builders/SliceBuildersKtxTest.kt
rename to slice/slice-builders-ktx/src/androidTest/java/androidx/slice/builders/SliceBuildersKtxTest.kt
diff --git a/slice/slice-builders/ktx/src/androidTest/java/androidx/slice/builders/TestActivity.java b/slice/slice-builders-ktx/src/androidTest/java/androidx/slice/builders/TestActivity.java
similarity index 100%
rename from slice/slice-builders/ktx/src/androidTest/java/androidx/slice/builders/TestActivity.java
rename to slice/slice-builders-ktx/src/androidTest/java/androidx/slice/builders/TestActivity.java
diff --git a/slice/slice-builders/ktx/src/androidTest/res/drawable/ic_all_out_black_24dp.xml b/slice/slice-builders-ktx/src/androidTest/res/drawable/ic_all_out_black_24dp.xml
similarity index 100%
rename from slice/slice-builders/ktx/src/androidTest/res/drawable/ic_all_out_black_24dp.xml
rename to slice/slice-builders-ktx/src/androidTest/res/drawable/ic_all_out_black_24dp.xml
diff --git a/slice/slice-builders/ktx/src/androidTest/res/drawable/ic_android_black_24dp.xml b/slice/slice-builders-ktx/src/androidTest/res/drawable/ic_android_black_24dp.xml
similarity index 100%
rename from slice/slice-builders/ktx/src/androidTest/res/drawable/ic_android_black_24dp.xml
rename to slice/slice-builders-ktx/src/androidTest/res/drawable/ic_android_black_24dp.xml
diff --git a/slice/slice-builders/ktx/src/androidTest/res/drawable/ic_attach_money_black_24dp.xml b/slice/slice-builders-ktx/src/androidTest/res/drawable/ic_attach_money_black_24dp.xml
similarity index 100%
rename from slice/slice-builders/ktx/src/androidTest/res/drawable/ic_attach_money_black_24dp.xml
rename to slice/slice-builders-ktx/src/androidTest/res/drawable/ic_attach_money_black_24dp.xml
diff --git a/slice/slice-builders/ktx/src/androidTest/res/layout/activity_test.xml b/slice/slice-builders-ktx/src/androidTest/res/layout/activity_test.xml
similarity index 100%
rename from slice/slice-builders/ktx/src/androidTest/res/layout/activity_test.xml
rename to slice/slice-builders-ktx/src/androidTest/res/layout/activity_test.xml
diff --git a/slice/slice-builders/ktx/src/main/AndroidManifest.xml b/slice/slice-builders-ktx/src/main/AndroidManifest.xml
similarity index 100%
rename from slice/slice-builders/ktx/src/main/AndroidManifest.xml
rename to slice/slice-builders-ktx/src/main/AndroidManifest.xml
diff --git a/slice/slice-builders/ktx/src/main/java/androidx/slice/builders/GridRowBuilder.kt b/slice/slice-builders-ktx/src/main/java/androidx/slice/builders/GridRowBuilder.kt
similarity index 100%
rename from slice/slice-builders/ktx/src/main/java/androidx/slice/builders/GridRowBuilder.kt
rename to slice/slice-builders-ktx/src/main/java/androidx/slice/builders/GridRowBuilder.kt
diff --git a/slice/slice-builders/ktx/src/main/java/androidx/slice/builders/ListBuilder.kt b/slice/slice-builders-ktx/src/main/java/androidx/slice/builders/ListBuilder.kt
similarity index 100%
rename from slice/slice-builders/ktx/src/main/java/androidx/slice/builders/ListBuilder.kt
rename to slice/slice-builders-ktx/src/main/java/androidx/slice/builders/ListBuilder.kt
diff --git a/slice/slice-core/src/main/res-public/values-af/strings.xml b/slice/slice-core/src/main/res-public/values-af/strings.xml
index 5ddcef2..e22c8c6 100644
--- a/slice/slice-core/src/main/res-public/values-af/strings.xml
+++ b/slice/slice-core/src/main/res-public/values-af/strings.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="slice_provider" msgid="7510675753826300262">"androidx.slice.compat.SliceProviderCompat"</string>
+ <string name="slice_provider" msgid="5117956935561628360">"androidx.slice.compat.SliceProviderCompat"</string>
</resources>
diff --git a/slice/slice-core/src/main/res-public/values-am/strings.xml b/slice/slice-core/src/main/res-public/values-am/strings.xml
index 5ddcef2..e22c8c6 100644
--- a/slice/slice-core/src/main/res-public/values-am/strings.xml
+++ b/slice/slice-core/src/main/res-public/values-am/strings.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="slice_provider" msgid="7510675753826300262">"androidx.slice.compat.SliceProviderCompat"</string>
+ <string name="slice_provider" msgid="5117956935561628360">"androidx.slice.compat.SliceProviderCompat"</string>
</resources>
diff --git a/slice/slice-core/src/main/res-public/values-ar/strings.xml b/slice/slice-core/src/main/res-public/values-ar/strings.xml
index 5ddcef2..e22c8c6 100644
--- a/slice/slice-core/src/main/res-public/values-ar/strings.xml
+++ b/slice/slice-core/src/main/res-public/values-ar/strings.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="slice_provider" msgid="7510675753826300262">"androidx.slice.compat.SliceProviderCompat"</string>
+ <string name="slice_provider" msgid="5117956935561628360">"androidx.slice.compat.SliceProviderCompat"</string>
</resources>
diff --git a/slice/slice-core/src/main/res-public/values-as/strings.xml b/slice/slice-core/src/main/res-public/values-as/strings.xml
index 5ddcef2..e22c8c6 100644
--- a/slice/slice-core/src/main/res-public/values-as/strings.xml
+++ b/slice/slice-core/src/main/res-public/values-as/strings.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="slice_provider" msgid="7510675753826300262">"androidx.slice.compat.SliceProviderCompat"</string>
+ <string name="slice_provider" msgid="5117956935561628360">"androidx.slice.compat.SliceProviderCompat"</string>
</resources>
diff --git a/slice/slice-core/src/main/res-public/values-az/strings.xml b/slice/slice-core/src/main/res-public/values-az/strings.xml
index 5ddcef2..e22c8c6 100644
--- a/slice/slice-core/src/main/res-public/values-az/strings.xml
+++ b/slice/slice-core/src/main/res-public/values-az/strings.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="slice_provider" msgid="7510675753826300262">"androidx.slice.compat.SliceProviderCompat"</string>
+ <string name="slice_provider" msgid="5117956935561628360">"androidx.slice.compat.SliceProviderCompat"</string>
</resources>
diff --git a/slice/slice-core/src/main/res-public/values-b+sr+Latn/strings.xml b/slice/slice-core/src/main/res-public/values-b+sr+Latn/strings.xml
index 5ddcef2..e22c8c6 100644
--- a/slice/slice-core/src/main/res-public/values-b+sr+Latn/strings.xml
+++ b/slice/slice-core/src/main/res-public/values-b+sr+Latn/strings.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="slice_provider" msgid="7510675753826300262">"androidx.slice.compat.SliceProviderCompat"</string>
+ <string name="slice_provider" msgid="5117956935561628360">"androidx.slice.compat.SliceProviderCompat"</string>
</resources>
diff --git a/slice/slice-core/src/main/res-public/values-be/strings.xml b/slice/slice-core/src/main/res-public/values-be/strings.xml
index 5ddcef2..e22c8c6 100644
--- a/slice/slice-core/src/main/res-public/values-be/strings.xml
+++ b/slice/slice-core/src/main/res-public/values-be/strings.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="slice_provider" msgid="7510675753826300262">"androidx.slice.compat.SliceProviderCompat"</string>
+ <string name="slice_provider" msgid="5117956935561628360">"androidx.slice.compat.SliceProviderCompat"</string>
</resources>
diff --git a/slice/slice-core/src/main/res-public/values-bg/strings.xml b/slice/slice-core/src/main/res-public/values-bg/strings.xml
index 5ddcef2..e22c8c6 100644
--- a/slice/slice-core/src/main/res-public/values-bg/strings.xml
+++ b/slice/slice-core/src/main/res-public/values-bg/strings.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="slice_provider" msgid="7510675753826300262">"androidx.slice.compat.SliceProviderCompat"</string>
+ <string name="slice_provider" msgid="5117956935561628360">"androidx.slice.compat.SliceProviderCompat"</string>
</resources>
diff --git a/slice/slice-core/src/main/res-public/values-bn/strings.xml b/slice/slice-core/src/main/res-public/values-bn/strings.xml
index 5ddcef2..e22c8c6 100644
--- a/slice/slice-core/src/main/res-public/values-bn/strings.xml
+++ b/slice/slice-core/src/main/res-public/values-bn/strings.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="slice_provider" msgid="7510675753826300262">"androidx.slice.compat.SliceProviderCompat"</string>
+ <string name="slice_provider" msgid="5117956935561628360">"androidx.slice.compat.SliceProviderCompat"</string>
</resources>
diff --git a/slice/slice-core/src/main/res-public/values-bs/strings.xml b/slice/slice-core/src/main/res-public/values-bs/strings.xml
index 5ddcef2..e22c8c6 100644
--- a/slice/slice-core/src/main/res-public/values-bs/strings.xml
+++ b/slice/slice-core/src/main/res-public/values-bs/strings.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="slice_provider" msgid="7510675753826300262">"androidx.slice.compat.SliceProviderCompat"</string>
+ <string name="slice_provider" msgid="5117956935561628360">"androidx.slice.compat.SliceProviderCompat"</string>
</resources>
diff --git a/slice/slice-core/src/main/res-public/values-ca/strings.xml b/slice/slice-core/src/main/res-public/values-ca/strings.xml
index 5ddcef2..e22c8c6 100644
--- a/slice/slice-core/src/main/res-public/values-ca/strings.xml
+++ b/slice/slice-core/src/main/res-public/values-ca/strings.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="slice_provider" msgid="7510675753826300262">"androidx.slice.compat.SliceProviderCompat"</string>
+ <string name="slice_provider" msgid="5117956935561628360">"androidx.slice.compat.SliceProviderCompat"</string>
</resources>
diff --git a/slice/slice-core/src/main/res-public/values-cs/strings.xml b/slice/slice-core/src/main/res-public/values-cs/strings.xml
index 5ddcef2..e22c8c6 100644
--- a/slice/slice-core/src/main/res-public/values-cs/strings.xml
+++ b/slice/slice-core/src/main/res-public/values-cs/strings.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="slice_provider" msgid="7510675753826300262">"androidx.slice.compat.SliceProviderCompat"</string>
+ <string name="slice_provider" msgid="5117956935561628360">"androidx.slice.compat.SliceProviderCompat"</string>
</resources>
diff --git a/slice/slice-core/src/main/res-public/values-da/strings.xml b/slice/slice-core/src/main/res-public/values-da/strings.xml
index 5ddcef2..e22c8c6 100644
--- a/slice/slice-core/src/main/res-public/values-da/strings.xml
+++ b/slice/slice-core/src/main/res-public/values-da/strings.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="slice_provider" msgid="7510675753826300262">"androidx.slice.compat.SliceProviderCompat"</string>
+ <string name="slice_provider" msgid="5117956935561628360">"androidx.slice.compat.SliceProviderCompat"</string>
</resources>
diff --git a/slice/slice-core/src/main/res-public/values-de/strings.xml b/slice/slice-core/src/main/res-public/values-de/strings.xml
index 5ddcef2..e22c8c6 100644
--- a/slice/slice-core/src/main/res-public/values-de/strings.xml
+++ b/slice/slice-core/src/main/res-public/values-de/strings.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="slice_provider" msgid="7510675753826300262">"androidx.slice.compat.SliceProviderCompat"</string>
+ <string name="slice_provider" msgid="5117956935561628360">"androidx.slice.compat.SliceProviderCompat"</string>
</resources>
diff --git a/slice/slice-core/src/main/res-public/values-el/strings.xml b/slice/slice-core/src/main/res-public/values-el/strings.xml
index 5ddcef2..e22c8c6 100644
--- a/slice/slice-core/src/main/res-public/values-el/strings.xml
+++ b/slice/slice-core/src/main/res-public/values-el/strings.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="slice_provider" msgid="7510675753826300262">"androidx.slice.compat.SliceProviderCompat"</string>
+ <string name="slice_provider" msgid="5117956935561628360">"androidx.slice.compat.SliceProviderCompat"</string>
</resources>
diff --git a/slice/slice-core/src/main/res-public/values-en-rAU/strings.xml b/slice/slice-core/src/main/res-public/values-en-rAU/strings.xml
index 5ddcef2..e22c8c6 100644
--- a/slice/slice-core/src/main/res-public/values-en-rAU/strings.xml
+++ b/slice/slice-core/src/main/res-public/values-en-rAU/strings.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="slice_provider" msgid="7510675753826300262">"androidx.slice.compat.SliceProviderCompat"</string>
+ <string name="slice_provider" msgid="5117956935561628360">"androidx.slice.compat.SliceProviderCompat"</string>
</resources>
diff --git a/slice/slice-core/src/main/res-public/values-en-rCA/strings.xml b/slice/slice-core/src/main/res-public/values-en-rCA/strings.xml
index 5ddcef2..e22c8c6 100644
--- a/slice/slice-core/src/main/res-public/values-en-rCA/strings.xml
+++ b/slice/slice-core/src/main/res-public/values-en-rCA/strings.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="slice_provider" msgid="7510675753826300262">"androidx.slice.compat.SliceProviderCompat"</string>
+ <string name="slice_provider" msgid="5117956935561628360">"androidx.slice.compat.SliceProviderCompat"</string>
</resources>
diff --git a/slice/slice-core/src/main/res-public/values-en-rGB/strings.xml b/slice/slice-core/src/main/res-public/values-en-rGB/strings.xml
index 5ddcef2..e22c8c6 100644
--- a/slice/slice-core/src/main/res-public/values-en-rGB/strings.xml
+++ b/slice/slice-core/src/main/res-public/values-en-rGB/strings.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="slice_provider" msgid="7510675753826300262">"androidx.slice.compat.SliceProviderCompat"</string>
+ <string name="slice_provider" msgid="5117956935561628360">"androidx.slice.compat.SliceProviderCompat"</string>
</resources>
diff --git a/slice/slice-core/src/main/res-public/values-en-rIN/strings.xml b/slice/slice-core/src/main/res-public/values-en-rIN/strings.xml
index 5ddcef2..e22c8c6 100644
--- a/slice/slice-core/src/main/res-public/values-en-rIN/strings.xml
+++ b/slice/slice-core/src/main/res-public/values-en-rIN/strings.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="slice_provider" msgid="7510675753826300262">"androidx.slice.compat.SliceProviderCompat"</string>
+ <string name="slice_provider" msgid="5117956935561628360">"androidx.slice.compat.SliceProviderCompat"</string>
</resources>
diff --git a/slice/slice-core/src/main/res-public/values-en-rXC/strings.xml b/slice/slice-core/src/main/res-public/values-en-rXC/strings.xml
index 71c05556..e4f843c 100644
--- a/slice/slice-core/src/main/res-public/values-en-rXC/strings.xml
+++ b/slice/slice-core/src/main/res-public/values-en-rXC/strings.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="slice_provider" msgid="7510675753826300262">"androidx.slice.compat.SliceProviderCompat"</string>
+ <string name="slice_provider" msgid="5117956935561628360">"androidx.slice.compat.SliceProviderCompat"</string>
</resources>
diff --git a/slice/slice-core/src/main/res-public/values-es-rUS/strings.xml b/slice/slice-core/src/main/res-public/values-es-rUS/strings.xml
index 5ddcef2..e22c8c6 100644
--- a/slice/slice-core/src/main/res-public/values-es-rUS/strings.xml
+++ b/slice/slice-core/src/main/res-public/values-es-rUS/strings.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="slice_provider" msgid="7510675753826300262">"androidx.slice.compat.SliceProviderCompat"</string>
+ <string name="slice_provider" msgid="5117956935561628360">"androidx.slice.compat.SliceProviderCompat"</string>
</resources>
diff --git a/slice/slice-core/src/main/res-public/values-es/strings.xml b/slice/slice-core/src/main/res-public/values-es/strings.xml
index 5ddcef2..e22c8c6 100644
--- a/slice/slice-core/src/main/res-public/values-es/strings.xml
+++ b/slice/slice-core/src/main/res-public/values-es/strings.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="slice_provider" msgid="7510675753826300262">"androidx.slice.compat.SliceProviderCompat"</string>
+ <string name="slice_provider" msgid="5117956935561628360">"androidx.slice.compat.SliceProviderCompat"</string>
</resources>
diff --git a/slice/slice-core/src/main/res-public/values-et/strings.xml b/slice/slice-core/src/main/res-public/values-et/strings.xml
index 5ddcef2..e22c8c6 100644
--- a/slice/slice-core/src/main/res-public/values-et/strings.xml
+++ b/slice/slice-core/src/main/res-public/values-et/strings.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="slice_provider" msgid="7510675753826300262">"androidx.slice.compat.SliceProviderCompat"</string>
+ <string name="slice_provider" msgid="5117956935561628360">"androidx.slice.compat.SliceProviderCompat"</string>
</resources>
diff --git a/slice/slice-core/src/main/res-public/values-eu/strings.xml b/slice/slice-core/src/main/res-public/values-eu/strings.xml
index 5ddcef2..e22c8c6 100644
--- a/slice/slice-core/src/main/res-public/values-eu/strings.xml
+++ b/slice/slice-core/src/main/res-public/values-eu/strings.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="slice_provider" msgid="7510675753826300262">"androidx.slice.compat.SliceProviderCompat"</string>
+ <string name="slice_provider" msgid="5117956935561628360">"androidx.slice.compat.SliceProviderCompat"</string>
</resources>
diff --git a/slice/slice-core/src/main/res-public/values-fa/strings.xml b/slice/slice-core/src/main/res-public/values-fa/strings.xml
index 5ddcef2..e22c8c6 100644
--- a/slice/slice-core/src/main/res-public/values-fa/strings.xml
+++ b/slice/slice-core/src/main/res-public/values-fa/strings.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="slice_provider" msgid="7510675753826300262">"androidx.slice.compat.SliceProviderCompat"</string>
+ <string name="slice_provider" msgid="5117956935561628360">"androidx.slice.compat.SliceProviderCompat"</string>
</resources>
diff --git a/slice/slice-core/src/main/res-public/values-fi/strings.xml b/slice/slice-core/src/main/res-public/values-fi/strings.xml
index 5ddcef2..e22c8c6 100644
--- a/slice/slice-core/src/main/res-public/values-fi/strings.xml
+++ b/slice/slice-core/src/main/res-public/values-fi/strings.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="slice_provider" msgid="7510675753826300262">"androidx.slice.compat.SliceProviderCompat"</string>
+ <string name="slice_provider" msgid="5117956935561628360">"androidx.slice.compat.SliceProviderCompat"</string>
</resources>
diff --git a/slice/slice-core/src/main/res-public/values-fr-rCA/strings.xml b/slice/slice-core/src/main/res-public/values-fr-rCA/strings.xml
index 5ddcef2..e22c8c6 100644
--- a/slice/slice-core/src/main/res-public/values-fr-rCA/strings.xml
+++ b/slice/slice-core/src/main/res-public/values-fr-rCA/strings.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="slice_provider" msgid="7510675753826300262">"androidx.slice.compat.SliceProviderCompat"</string>
+ <string name="slice_provider" msgid="5117956935561628360">"androidx.slice.compat.SliceProviderCompat"</string>
</resources>
diff --git a/slice/slice-core/src/main/res-public/values-fr/strings.xml b/slice/slice-core/src/main/res-public/values-fr/strings.xml
index 5ddcef2..e22c8c6 100644
--- a/slice/slice-core/src/main/res-public/values-fr/strings.xml
+++ b/slice/slice-core/src/main/res-public/values-fr/strings.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="slice_provider" msgid="7510675753826300262">"androidx.slice.compat.SliceProviderCompat"</string>
+ <string name="slice_provider" msgid="5117956935561628360">"androidx.slice.compat.SliceProviderCompat"</string>
</resources>
diff --git a/slice/slice-core/src/main/res-public/values-gl/strings.xml b/slice/slice-core/src/main/res-public/values-gl/strings.xml
index 5ddcef2..e22c8c6 100644
--- a/slice/slice-core/src/main/res-public/values-gl/strings.xml
+++ b/slice/slice-core/src/main/res-public/values-gl/strings.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="slice_provider" msgid="7510675753826300262">"androidx.slice.compat.SliceProviderCompat"</string>
+ <string name="slice_provider" msgid="5117956935561628360">"androidx.slice.compat.SliceProviderCompat"</string>
</resources>
diff --git a/slice/slice-core/src/main/res-public/values-gu/strings.xml b/slice/slice-core/src/main/res-public/values-gu/strings.xml
index 5ddcef2..e22c8c6 100644
--- a/slice/slice-core/src/main/res-public/values-gu/strings.xml
+++ b/slice/slice-core/src/main/res-public/values-gu/strings.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="slice_provider" msgid="7510675753826300262">"androidx.slice.compat.SliceProviderCompat"</string>
+ <string name="slice_provider" msgid="5117956935561628360">"androidx.slice.compat.SliceProviderCompat"</string>
</resources>
diff --git a/slice/slice-core/src/main/res-public/values-hi/strings.xml b/slice/slice-core/src/main/res-public/values-hi/strings.xml
index 5ddcef2..e22c8c6 100644
--- a/slice/slice-core/src/main/res-public/values-hi/strings.xml
+++ b/slice/slice-core/src/main/res-public/values-hi/strings.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="slice_provider" msgid="7510675753826300262">"androidx.slice.compat.SliceProviderCompat"</string>
+ <string name="slice_provider" msgid="5117956935561628360">"androidx.slice.compat.SliceProviderCompat"</string>
</resources>
diff --git a/slice/slice-core/src/main/res-public/values-hr/strings.xml b/slice/slice-core/src/main/res-public/values-hr/strings.xml
index 5ddcef2..e22c8c6 100644
--- a/slice/slice-core/src/main/res-public/values-hr/strings.xml
+++ b/slice/slice-core/src/main/res-public/values-hr/strings.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="slice_provider" msgid="7510675753826300262">"androidx.slice.compat.SliceProviderCompat"</string>
+ <string name="slice_provider" msgid="5117956935561628360">"androidx.slice.compat.SliceProviderCompat"</string>
</resources>
diff --git a/slice/slice-core/src/main/res-public/values-hu/strings.xml b/slice/slice-core/src/main/res-public/values-hu/strings.xml
index 5ddcef2..e22c8c6 100644
--- a/slice/slice-core/src/main/res-public/values-hu/strings.xml
+++ b/slice/slice-core/src/main/res-public/values-hu/strings.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="slice_provider" msgid="7510675753826300262">"androidx.slice.compat.SliceProviderCompat"</string>
+ <string name="slice_provider" msgid="5117956935561628360">"androidx.slice.compat.SliceProviderCompat"</string>
</resources>
diff --git a/slice/slice-core/src/main/res-public/values-hy/strings.xml b/slice/slice-core/src/main/res-public/values-hy/strings.xml
index 5ddcef2..e22c8c6 100644
--- a/slice/slice-core/src/main/res-public/values-hy/strings.xml
+++ b/slice/slice-core/src/main/res-public/values-hy/strings.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="slice_provider" msgid="7510675753826300262">"androidx.slice.compat.SliceProviderCompat"</string>
+ <string name="slice_provider" msgid="5117956935561628360">"androidx.slice.compat.SliceProviderCompat"</string>
</resources>
diff --git a/slice/slice-core/src/main/res-public/values-in/strings.xml b/slice/slice-core/src/main/res-public/values-in/strings.xml
index 5ddcef2..e22c8c6 100644
--- a/slice/slice-core/src/main/res-public/values-in/strings.xml
+++ b/slice/slice-core/src/main/res-public/values-in/strings.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="slice_provider" msgid="7510675753826300262">"androidx.slice.compat.SliceProviderCompat"</string>
+ <string name="slice_provider" msgid="5117956935561628360">"androidx.slice.compat.SliceProviderCompat"</string>
</resources>
diff --git a/slice/slice-core/src/main/res-public/values-is/strings.xml b/slice/slice-core/src/main/res-public/values-is/strings.xml
index 5ddcef2..e22c8c6 100644
--- a/slice/slice-core/src/main/res-public/values-is/strings.xml
+++ b/slice/slice-core/src/main/res-public/values-is/strings.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="slice_provider" msgid="7510675753826300262">"androidx.slice.compat.SliceProviderCompat"</string>
+ <string name="slice_provider" msgid="5117956935561628360">"androidx.slice.compat.SliceProviderCompat"</string>
</resources>
diff --git a/slice/slice-core/src/main/res-public/values-it/strings.xml b/slice/slice-core/src/main/res-public/values-it/strings.xml
index 5ddcef2..e22c8c6 100644
--- a/slice/slice-core/src/main/res-public/values-it/strings.xml
+++ b/slice/slice-core/src/main/res-public/values-it/strings.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="slice_provider" msgid="7510675753826300262">"androidx.slice.compat.SliceProviderCompat"</string>
+ <string name="slice_provider" msgid="5117956935561628360">"androidx.slice.compat.SliceProviderCompat"</string>
</resources>
diff --git a/slice/slice-core/src/main/res-public/values-iw/strings.xml b/slice/slice-core/src/main/res-public/values-iw/strings.xml
index 5ddcef2..e22c8c6 100644
--- a/slice/slice-core/src/main/res-public/values-iw/strings.xml
+++ b/slice/slice-core/src/main/res-public/values-iw/strings.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="slice_provider" msgid="7510675753826300262">"androidx.slice.compat.SliceProviderCompat"</string>
+ <string name="slice_provider" msgid="5117956935561628360">"androidx.slice.compat.SliceProviderCompat"</string>
</resources>
diff --git a/slice/slice-core/src/main/res-public/values-ja/strings.xml b/slice/slice-core/src/main/res-public/values-ja/strings.xml
index 5ddcef2..e22c8c6 100644
--- a/slice/slice-core/src/main/res-public/values-ja/strings.xml
+++ b/slice/slice-core/src/main/res-public/values-ja/strings.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="slice_provider" msgid="7510675753826300262">"androidx.slice.compat.SliceProviderCompat"</string>
+ <string name="slice_provider" msgid="5117956935561628360">"androidx.slice.compat.SliceProviderCompat"</string>
</resources>
diff --git a/slice/slice-core/src/main/res-public/values-ka/strings.xml b/slice/slice-core/src/main/res-public/values-ka/strings.xml
index 5ddcef2..e22c8c6 100644
--- a/slice/slice-core/src/main/res-public/values-ka/strings.xml
+++ b/slice/slice-core/src/main/res-public/values-ka/strings.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="slice_provider" msgid="7510675753826300262">"androidx.slice.compat.SliceProviderCompat"</string>
+ <string name="slice_provider" msgid="5117956935561628360">"androidx.slice.compat.SliceProviderCompat"</string>
</resources>
diff --git a/slice/slice-core/src/main/res-public/values-kk/strings.xml b/slice/slice-core/src/main/res-public/values-kk/strings.xml
index 5ddcef2..e22c8c6 100644
--- a/slice/slice-core/src/main/res-public/values-kk/strings.xml
+++ b/slice/slice-core/src/main/res-public/values-kk/strings.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="slice_provider" msgid="7510675753826300262">"androidx.slice.compat.SliceProviderCompat"</string>
+ <string name="slice_provider" msgid="5117956935561628360">"androidx.slice.compat.SliceProviderCompat"</string>
</resources>
diff --git a/slice/slice-core/src/main/res-public/values-km/strings.xml b/slice/slice-core/src/main/res-public/values-km/strings.xml
index 5ddcef2..e22c8c6 100644
--- a/slice/slice-core/src/main/res-public/values-km/strings.xml
+++ b/slice/slice-core/src/main/res-public/values-km/strings.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="slice_provider" msgid="7510675753826300262">"androidx.slice.compat.SliceProviderCompat"</string>
+ <string name="slice_provider" msgid="5117956935561628360">"androidx.slice.compat.SliceProviderCompat"</string>
</resources>
diff --git a/slice/slice-core/src/main/res-public/values-kn/strings.xml b/slice/slice-core/src/main/res-public/values-kn/strings.xml
index 5ddcef2..e22c8c6 100644
--- a/slice/slice-core/src/main/res-public/values-kn/strings.xml
+++ b/slice/slice-core/src/main/res-public/values-kn/strings.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="slice_provider" msgid="7510675753826300262">"androidx.slice.compat.SliceProviderCompat"</string>
+ <string name="slice_provider" msgid="5117956935561628360">"androidx.slice.compat.SliceProviderCompat"</string>
</resources>
diff --git a/slice/slice-core/src/main/res-public/values-ko/strings.xml b/slice/slice-core/src/main/res-public/values-ko/strings.xml
index 5ddcef2..e22c8c6 100644
--- a/slice/slice-core/src/main/res-public/values-ko/strings.xml
+++ b/slice/slice-core/src/main/res-public/values-ko/strings.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="slice_provider" msgid="7510675753826300262">"androidx.slice.compat.SliceProviderCompat"</string>
+ <string name="slice_provider" msgid="5117956935561628360">"androidx.slice.compat.SliceProviderCompat"</string>
</resources>
diff --git a/slice/slice-core/src/main/res-public/values-ky/strings.xml b/slice/slice-core/src/main/res-public/values-ky/strings.xml
index 5ddcef2..e22c8c6 100644
--- a/slice/slice-core/src/main/res-public/values-ky/strings.xml
+++ b/slice/slice-core/src/main/res-public/values-ky/strings.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="slice_provider" msgid="7510675753826300262">"androidx.slice.compat.SliceProviderCompat"</string>
+ <string name="slice_provider" msgid="5117956935561628360">"androidx.slice.compat.SliceProviderCompat"</string>
</resources>
diff --git a/slice/slice-core/src/main/res-public/values-lo/strings.xml b/slice/slice-core/src/main/res-public/values-lo/strings.xml
index 5ddcef2..e22c8c6 100644
--- a/slice/slice-core/src/main/res-public/values-lo/strings.xml
+++ b/slice/slice-core/src/main/res-public/values-lo/strings.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="slice_provider" msgid="7510675753826300262">"androidx.slice.compat.SliceProviderCompat"</string>
+ <string name="slice_provider" msgid="5117956935561628360">"androidx.slice.compat.SliceProviderCompat"</string>
</resources>
diff --git a/slice/slice-core/src/main/res-public/values-lt/strings.xml b/slice/slice-core/src/main/res-public/values-lt/strings.xml
index 5ddcef2..e22c8c6 100644
--- a/slice/slice-core/src/main/res-public/values-lt/strings.xml
+++ b/slice/slice-core/src/main/res-public/values-lt/strings.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="slice_provider" msgid="7510675753826300262">"androidx.slice.compat.SliceProviderCompat"</string>
+ <string name="slice_provider" msgid="5117956935561628360">"androidx.slice.compat.SliceProviderCompat"</string>
</resources>
diff --git a/slice/slice-core/src/main/res-public/values-lv/strings.xml b/slice/slice-core/src/main/res-public/values-lv/strings.xml
index 5ddcef2..e22c8c6 100644
--- a/slice/slice-core/src/main/res-public/values-lv/strings.xml
+++ b/slice/slice-core/src/main/res-public/values-lv/strings.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="slice_provider" msgid="7510675753826300262">"androidx.slice.compat.SliceProviderCompat"</string>
+ <string name="slice_provider" msgid="5117956935561628360">"androidx.slice.compat.SliceProviderCompat"</string>
</resources>
diff --git a/slice/slice-core/src/main/res-public/values-mk/strings.xml b/slice/slice-core/src/main/res-public/values-mk/strings.xml
index 5ddcef2..e22c8c6 100644
--- a/slice/slice-core/src/main/res-public/values-mk/strings.xml
+++ b/slice/slice-core/src/main/res-public/values-mk/strings.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="slice_provider" msgid="7510675753826300262">"androidx.slice.compat.SliceProviderCompat"</string>
+ <string name="slice_provider" msgid="5117956935561628360">"androidx.slice.compat.SliceProviderCompat"</string>
</resources>
diff --git a/slice/slice-core/src/main/res-public/values-ml/strings.xml b/slice/slice-core/src/main/res-public/values-ml/strings.xml
index 5ddcef2..e22c8c6 100644
--- a/slice/slice-core/src/main/res-public/values-ml/strings.xml
+++ b/slice/slice-core/src/main/res-public/values-ml/strings.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="slice_provider" msgid="7510675753826300262">"androidx.slice.compat.SliceProviderCompat"</string>
+ <string name="slice_provider" msgid="5117956935561628360">"androidx.slice.compat.SliceProviderCompat"</string>
</resources>
diff --git a/slice/slice-core/src/main/res-public/values-mn/strings.xml b/slice/slice-core/src/main/res-public/values-mn/strings.xml
index 5ddcef2..e22c8c6 100644
--- a/slice/slice-core/src/main/res-public/values-mn/strings.xml
+++ b/slice/slice-core/src/main/res-public/values-mn/strings.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="slice_provider" msgid="7510675753826300262">"androidx.slice.compat.SliceProviderCompat"</string>
+ <string name="slice_provider" msgid="5117956935561628360">"androidx.slice.compat.SliceProviderCompat"</string>
</resources>
diff --git a/slice/slice-core/src/main/res-public/values-mr/strings.xml b/slice/slice-core/src/main/res-public/values-mr/strings.xml
index 5ddcef2..e22c8c6 100644
--- a/slice/slice-core/src/main/res-public/values-mr/strings.xml
+++ b/slice/slice-core/src/main/res-public/values-mr/strings.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="slice_provider" msgid="7510675753826300262">"androidx.slice.compat.SliceProviderCompat"</string>
+ <string name="slice_provider" msgid="5117956935561628360">"androidx.slice.compat.SliceProviderCompat"</string>
</resources>
diff --git a/slice/slice-core/src/main/res-public/values-ms/strings.xml b/slice/slice-core/src/main/res-public/values-ms/strings.xml
index 5ddcef2..e22c8c6 100644
--- a/slice/slice-core/src/main/res-public/values-ms/strings.xml
+++ b/slice/slice-core/src/main/res-public/values-ms/strings.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="slice_provider" msgid="7510675753826300262">"androidx.slice.compat.SliceProviderCompat"</string>
+ <string name="slice_provider" msgid="5117956935561628360">"androidx.slice.compat.SliceProviderCompat"</string>
</resources>
diff --git a/slice/slice-core/src/main/res-public/values-my/strings.xml b/slice/slice-core/src/main/res-public/values-my/strings.xml
index 5ddcef2..e22c8c6 100644
--- a/slice/slice-core/src/main/res-public/values-my/strings.xml
+++ b/slice/slice-core/src/main/res-public/values-my/strings.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="slice_provider" msgid="7510675753826300262">"androidx.slice.compat.SliceProviderCompat"</string>
+ <string name="slice_provider" msgid="5117956935561628360">"androidx.slice.compat.SliceProviderCompat"</string>
</resources>
diff --git a/slice/slice-core/src/main/res-public/values-nb/strings.xml b/slice/slice-core/src/main/res-public/values-nb/strings.xml
index 5ddcef2..e22c8c6 100644
--- a/slice/slice-core/src/main/res-public/values-nb/strings.xml
+++ b/slice/slice-core/src/main/res-public/values-nb/strings.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="slice_provider" msgid="7510675753826300262">"androidx.slice.compat.SliceProviderCompat"</string>
+ <string name="slice_provider" msgid="5117956935561628360">"androidx.slice.compat.SliceProviderCompat"</string>
</resources>
diff --git a/slice/slice-core/src/main/res-public/values-ne/strings.xml b/slice/slice-core/src/main/res-public/values-ne/strings.xml
index 5ddcef2..e22c8c6 100644
--- a/slice/slice-core/src/main/res-public/values-ne/strings.xml
+++ b/slice/slice-core/src/main/res-public/values-ne/strings.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="slice_provider" msgid="7510675753826300262">"androidx.slice.compat.SliceProviderCompat"</string>
+ <string name="slice_provider" msgid="5117956935561628360">"androidx.slice.compat.SliceProviderCompat"</string>
</resources>
diff --git a/slice/slice-core/src/main/res-public/values-nl/strings.xml b/slice/slice-core/src/main/res-public/values-nl/strings.xml
index 5ddcef2..e22c8c6 100644
--- a/slice/slice-core/src/main/res-public/values-nl/strings.xml
+++ b/slice/slice-core/src/main/res-public/values-nl/strings.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="slice_provider" msgid="7510675753826300262">"androidx.slice.compat.SliceProviderCompat"</string>
+ <string name="slice_provider" msgid="5117956935561628360">"androidx.slice.compat.SliceProviderCompat"</string>
</resources>
diff --git a/slice/slice-core/src/main/res-public/values-or/strings.xml b/slice/slice-core/src/main/res-public/values-or/strings.xml
index 5ddcef2..e22c8c6 100644
--- a/slice/slice-core/src/main/res-public/values-or/strings.xml
+++ b/slice/slice-core/src/main/res-public/values-or/strings.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="slice_provider" msgid="7510675753826300262">"androidx.slice.compat.SliceProviderCompat"</string>
+ <string name="slice_provider" msgid="5117956935561628360">"androidx.slice.compat.SliceProviderCompat"</string>
</resources>
diff --git a/slice/slice-core/src/main/res-public/values-pa/strings.xml b/slice/slice-core/src/main/res-public/values-pa/strings.xml
index 5ddcef2..e22c8c6 100644
--- a/slice/slice-core/src/main/res-public/values-pa/strings.xml
+++ b/slice/slice-core/src/main/res-public/values-pa/strings.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="slice_provider" msgid="7510675753826300262">"androidx.slice.compat.SliceProviderCompat"</string>
+ <string name="slice_provider" msgid="5117956935561628360">"androidx.slice.compat.SliceProviderCompat"</string>
</resources>
diff --git a/slice/slice-core/src/main/res-public/values-pl/strings.xml b/slice/slice-core/src/main/res-public/values-pl/strings.xml
index 5ddcef2..e22c8c6 100644
--- a/slice/slice-core/src/main/res-public/values-pl/strings.xml
+++ b/slice/slice-core/src/main/res-public/values-pl/strings.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="slice_provider" msgid="7510675753826300262">"androidx.slice.compat.SliceProviderCompat"</string>
+ <string name="slice_provider" msgid="5117956935561628360">"androidx.slice.compat.SliceProviderCompat"</string>
</resources>
diff --git a/slice/slice-core/src/main/res-public/values-pt-rBR/strings.xml b/slice/slice-core/src/main/res-public/values-pt-rBR/strings.xml
index 5ddcef2..e22c8c6 100644
--- a/slice/slice-core/src/main/res-public/values-pt-rBR/strings.xml
+++ b/slice/slice-core/src/main/res-public/values-pt-rBR/strings.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="slice_provider" msgid="7510675753826300262">"androidx.slice.compat.SliceProviderCompat"</string>
+ <string name="slice_provider" msgid="5117956935561628360">"androidx.slice.compat.SliceProviderCompat"</string>
</resources>
diff --git a/slice/slice-core/src/main/res-public/values-pt-rPT/strings.xml b/slice/slice-core/src/main/res-public/values-pt-rPT/strings.xml
index 5ddcef2..e22c8c6 100644
--- a/slice/slice-core/src/main/res-public/values-pt-rPT/strings.xml
+++ b/slice/slice-core/src/main/res-public/values-pt-rPT/strings.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="slice_provider" msgid="7510675753826300262">"androidx.slice.compat.SliceProviderCompat"</string>
+ <string name="slice_provider" msgid="5117956935561628360">"androidx.slice.compat.SliceProviderCompat"</string>
</resources>
diff --git a/slice/slice-core/src/main/res-public/values-pt/strings.xml b/slice/slice-core/src/main/res-public/values-pt/strings.xml
index 5ddcef2..e22c8c6 100644
--- a/slice/slice-core/src/main/res-public/values-pt/strings.xml
+++ b/slice/slice-core/src/main/res-public/values-pt/strings.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="slice_provider" msgid="7510675753826300262">"androidx.slice.compat.SliceProviderCompat"</string>
+ <string name="slice_provider" msgid="5117956935561628360">"androidx.slice.compat.SliceProviderCompat"</string>
</resources>
diff --git a/slice/slice-core/src/main/res-public/values-ro/strings.xml b/slice/slice-core/src/main/res-public/values-ro/strings.xml
index 5ddcef2..e22c8c6 100644
--- a/slice/slice-core/src/main/res-public/values-ro/strings.xml
+++ b/slice/slice-core/src/main/res-public/values-ro/strings.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="slice_provider" msgid="7510675753826300262">"androidx.slice.compat.SliceProviderCompat"</string>
+ <string name="slice_provider" msgid="5117956935561628360">"androidx.slice.compat.SliceProviderCompat"</string>
</resources>
diff --git a/slice/slice-core/src/main/res-public/values-ru/strings.xml b/slice/slice-core/src/main/res-public/values-ru/strings.xml
index 5ddcef2..e22c8c6 100644
--- a/slice/slice-core/src/main/res-public/values-ru/strings.xml
+++ b/slice/slice-core/src/main/res-public/values-ru/strings.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="slice_provider" msgid="7510675753826300262">"androidx.slice.compat.SliceProviderCompat"</string>
+ <string name="slice_provider" msgid="5117956935561628360">"androidx.slice.compat.SliceProviderCompat"</string>
</resources>
diff --git a/slice/slice-core/src/main/res-public/values-si/strings.xml b/slice/slice-core/src/main/res-public/values-si/strings.xml
index 5ddcef2..e22c8c6 100644
--- a/slice/slice-core/src/main/res-public/values-si/strings.xml
+++ b/slice/slice-core/src/main/res-public/values-si/strings.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="slice_provider" msgid="7510675753826300262">"androidx.slice.compat.SliceProviderCompat"</string>
+ <string name="slice_provider" msgid="5117956935561628360">"androidx.slice.compat.SliceProviderCompat"</string>
</resources>
diff --git a/slice/slice-core/src/main/res-public/values-sk/strings.xml b/slice/slice-core/src/main/res-public/values-sk/strings.xml
index 5ddcef2..e22c8c6 100644
--- a/slice/slice-core/src/main/res-public/values-sk/strings.xml
+++ b/slice/slice-core/src/main/res-public/values-sk/strings.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="slice_provider" msgid="7510675753826300262">"androidx.slice.compat.SliceProviderCompat"</string>
+ <string name="slice_provider" msgid="5117956935561628360">"androidx.slice.compat.SliceProviderCompat"</string>
</resources>
diff --git a/slice/slice-core/src/main/res-public/values-sl/strings.xml b/slice/slice-core/src/main/res-public/values-sl/strings.xml
index 5ddcef2..e22c8c6 100644
--- a/slice/slice-core/src/main/res-public/values-sl/strings.xml
+++ b/slice/slice-core/src/main/res-public/values-sl/strings.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="slice_provider" msgid="7510675753826300262">"androidx.slice.compat.SliceProviderCompat"</string>
+ <string name="slice_provider" msgid="5117956935561628360">"androidx.slice.compat.SliceProviderCompat"</string>
</resources>
diff --git a/slice/slice-core/src/main/res-public/values-sq/strings.xml b/slice/slice-core/src/main/res-public/values-sq/strings.xml
index 5ddcef2..e22c8c6 100644
--- a/slice/slice-core/src/main/res-public/values-sq/strings.xml
+++ b/slice/slice-core/src/main/res-public/values-sq/strings.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="slice_provider" msgid="7510675753826300262">"androidx.slice.compat.SliceProviderCompat"</string>
+ <string name="slice_provider" msgid="5117956935561628360">"androidx.slice.compat.SliceProviderCompat"</string>
</resources>
diff --git a/slice/slice-core/src/main/res-public/values-sr/strings.xml b/slice/slice-core/src/main/res-public/values-sr/strings.xml
index 5ddcef2..e22c8c6 100644
--- a/slice/slice-core/src/main/res-public/values-sr/strings.xml
+++ b/slice/slice-core/src/main/res-public/values-sr/strings.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="slice_provider" msgid="7510675753826300262">"androidx.slice.compat.SliceProviderCompat"</string>
+ <string name="slice_provider" msgid="5117956935561628360">"androidx.slice.compat.SliceProviderCompat"</string>
</resources>
diff --git a/slice/slice-core/src/main/res-public/values-sv/strings.xml b/slice/slice-core/src/main/res-public/values-sv/strings.xml
index 5ddcef2..e22c8c6 100644
--- a/slice/slice-core/src/main/res-public/values-sv/strings.xml
+++ b/slice/slice-core/src/main/res-public/values-sv/strings.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="slice_provider" msgid="7510675753826300262">"androidx.slice.compat.SliceProviderCompat"</string>
+ <string name="slice_provider" msgid="5117956935561628360">"androidx.slice.compat.SliceProviderCompat"</string>
</resources>
diff --git a/slice/slice-core/src/main/res-public/values-sw/strings.xml b/slice/slice-core/src/main/res-public/values-sw/strings.xml
index 5ddcef2..e22c8c6 100644
--- a/slice/slice-core/src/main/res-public/values-sw/strings.xml
+++ b/slice/slice-core/src/main/res-public/values-sw/strings.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="slice_provider" msgid="7510675753826300262">"androidx.slice.compat.SliceProviderCompat"</string>
+ <string name="slice_provider" msgid="5117956935561628360">"androidx.slice.compat.SliceProviderCompat"</string>
</resources>
diff --git a/slice/slice-core/src/main/res-public/values-ta/strings.xml b/slice/slice-core/src/main/res-public/values-ta/strings.xml
index 5ddcef2..e22c8c6 100644
--- a/slice/slice-core/src/main/res-public/values-ta/strings.xml
+++ b/slice/slice-core/src/main/res-public/values-ta/strings.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="slice_provider" msgid="7510675753826300262">"androidx.slice.compat.SliceProviderCompat"</string>
+ <string name="slice_provider" msgid="5117956935561628360">"androidx.slice.compat.SliceProviderCompat"</string>
</resources>
diff --git a/slice/slice-core/src/main/res-public/values-te/strings.xml b/slice/slice-core/src/main/res-public/values-te/strings.xml
index 5ddcef2..e22c8c6 100644
--- a/slice/slice-core/src/main/res-public/values-te/strings.xml
+++ b/slice/slice-core/src/main/res-public/values-te/strings.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="slice_provider" msgid="7510675753826300262">"androidx.slice.compat.SliceProviderCompat"</string>
+ <string name="slice_provider" msgid="5117956935561628360">"androidx.slice.compat.SliceProviderCompat"</string>
</resources>
diff --git a/slice/slice-core/src/main/res-public/values-th/strings.xml b/slice/slice-core/src/main/res-public/values-th/strings.xml
index 5ddcef2..e22c8c6 100644
--- a/slice/slice-core/src/main/res-public/values-th/strings.xml
+++ b/slice/slice-core/src/main/res-public/values-th/strings.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="slice_provider" msgid="7510675753826300262">"androidx.slice.compat.SliceProviderCompat"</string>
+ <string name="slice_provider" msgid="5117956935561628360">"androidx.slice.compat.SliceProviderCompat"</string>
</resources>
diff --git a/slice/slice-core/src/main/res-public/values-tl/strings.xml b/slice/slice-core/src/main/res-public/values-tl/strings.xml
index 5ddcef2..e22c8c6 100644
--- a/slice/slice-core/src/main/res-public/values-tl/strings.xml
+++ b/slice/slice-core/src/main/res-public/values-tl/strings.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="slice_provider" msgid="7510675753826300262">"androidx.slice.compat.SliceProviderCompat"</string>
+ <string name="slice_provider" msgid="5117956935561628360">"androidx.slice.compat.SliceProviderCompat"</string>
</resources>
diff --git a/slice/slice-core/src/main/res-public/values-tr/strings.xml b/slice/slice-core/src/main/res-public/values-tr/strings.xml
index 5ddcef2..e22c8c6 100644
--- a/slice/slice-core/src/main/res-public/values-tr/strings.xml
+++ b/slice/slice-core/src/main/res-public/values-tr/strings.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="slice_provider" msgid="7510675753826300262">"androidx.slice.compat.SliceProviderCompat"</string>
+ <string name="slice_provider" msgid="5117956935561628360">"androidx.slice.compat.SliceProviderCompat"</string>
</resources>
diff --git a/slice/slice-core/src/main/res-public/values-uk/strings.xml b/slice/slice-core/src/main/res-public/values-uk/strings.xml
index 5ddcef2..e22c8c6 100644
--- a/slice/slice-core/src/main/res-public/values-uk/strings.xml
+++ b/slice/slice-core/src/main/res-public/values-uk/strings.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="slice_provider" msgid="7510675753826300262">"androidx.slice.compat.SliceProviderCompat"</string>
+ <string name="slice_provider" msgid="5117956935561628360">"androidx.slice.compat.SliceProviderCompat"</string>
</resources>
diff --git a/slice/slice-core/src/main/res-public/values-ur/strings.xml b/slice/slice-core/src/main/res-public/values-ur/strings.xml
index 5ddcef2..e22c8c6 100644
--- a/slice/slice-core/src/main/res-public/values-ur/strings.xml
+++ b/slice/slice-core/src/main/res-public/values-ur/strings.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="slice_provider" msgid="7510675753826300262">"androidx.slice.compat.SliceProviderCompat"</string>
+ <string name="slice_provider" msgid="5117956935561628360">"androidx.slice.compat.SliceProviderCompat"</string>
</resources>
diff --git a/slice/slice-core/src/main/res-public/values-uz/strings.xml b/slice/slice-core/src/main/res-public/values-uz/strings.xml
index 5ddcef2..e22c8c6 100644
--- a/slice/slice-core/src/main/res-public/values-uz/strings.xml
+++ b/slice/slice-core/src/main/res-public/values-uz/strings.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="slice_provider" msgid="7510675753826300262">"androidx.slice.compat.SliceProviderCompat"</string>
+ <string name="slice_provider" msgid="5117956935561628360">"androidx.slice.compat.SliceProviderCompat"</string>
</resources>
diff --git a/slice/slice-core/src/main/res-public/values-vi/strings.xml b/slice/slice-core/src/main/res-public/values-vi/strings.xml
index 5ddcef2..e22c8c6 100644
--- a/slice/slice-core/src/main/res-public/values-vi/strings.xml
+++ b/slice/slice-core/src/main/res-public/values-vi/strings.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="slice_provider" msgid="7510675753826300262">"androidx.slice.compat.SliceProviderCompat"</string>
+ <string name="slice_provider" msgid="5117956935561628360">"androidx.slice.compat.SliceProviderCompat"</string>
</resources>
diff --git a/slice/slice-core/src/main/res-public/values-zh-rCN/strings.xml b/slice/slice-core/src/main/res-public/values-zh-rCN/strings.xml
index 5ddcef2..e22c8c6 100644
--- a/slice/slice-core/src/main/res-public/values-zh-rCN/strings.xml
+++ b/slice/slice-core/src/main/res-public/values-zh-rCN/strings.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="slice_provider" msgid="7510675753826300262">"androidx.slice.compat.SliceProviderCompat"</string>
+ <string name="slice_provider" msgid="5117956935561628360">"androidx.slice.compat.SliceProviderCompat"</string>
</resources>
diff --git a/slice/slice-core/src/main/res-public/values-zh-rHK/strings.xml b/slice/slice-core/src/main/res-public/values-zh-rHK/strings.xml
index 5ddcef2..e22c8c6 100644
--- a/slice/slice-core/src/main/res-public/values-zh-rHK/strings.xml
+++ b/slice/slice-core/src/main/res-public/values-zh-rHK/strings.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="slice_provider" msgid="7510675753826300262">"androidx.slice.compat.SliceProviderCompat"</string>
+ <string name="slice_provider" msgid="5117956935561628360">"androidx.slice.compat.SliceProviderCompat"</string>
</resources>
diff --git a/slice/slice-core/src/main/res-public/values-zh-rTW/strings.xml b/slice/slice-core/src/main/res-public/values-zh-rTW/strings.xml
index 5ddcef2..e22c8c6 100644
--- a/slice/slice-core/src/main/res-public/values-zh-rTW/strings.xml
+++ b/slice/slice-core/src/main/res-public/values-zh-rTW/strings.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="slice_provider" msgid="7510675753826300262">"androidx.slice.compat.SliceProviderCompat"</string>
+ <string name="slice_provider" msgid="5117956935561628360">"androidx.slice.compat.SliceProviderCompat"</string>
</resources>
diff --git a/slice/slice-core/src/main/res-public/values-zu/strings.xml b/slice/slice-core/src/main/res-public/values-zu/strings.xml
index 5ddcef2..e22c8c6 100644
--- a/slice/slice-core/src/main/res-public/values-zu/strings.xml
+++ b/slice/slice-core/src/main/res-public/values-zu/strings.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="slice_provider" msgid="7510675753826300262">"androidx.slice.compat.SliceProviderCompat"</string>
+ <string name="slice_provider" msgid="5117956935561628360">"androidx.slice.compat.SliceProviderCompat"</string>
</resources>
diff --git a/slice/slice-core/src/main/res/values-af/strings.xml b/slice/slice-core/src/main/res/values-af/strings.xml
index cea048b..0c1a543 100644
--- a/slice/slice-core/src/main/res/values-af/strings.xml
+++ b/slice/slice-core/src/main/res/values-af/strings.xml
@@ -17,10 +17,10 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slices_permission_request" msgid="3604847235923472451">"<xliff:g id="APP_0">%1$s</xliff:g> wil <xliff:g id="APP_2">%2$s</xliff:g>-skyfies wys"</string>
- <string name="abc_slice_permission_title" msgid="4175332421259324948">"Laat <xliff:g id="APP_0">%1$s</xliff:g> toe om <xliff:g id="APP_2">%2$s</xliff:g>-skyfies te wys?"</string>
- <string name="abc_slice_permission_text_1" msgid="4525743640399572811">"– Dit kan inligting in <xliff:g id="APP">%1$s</xliff:g> lees"</string>
- <string name="abc_slice_permission_text_2" msgid="7323565634860251794">"– Dit kan handelinge binne <xliff:g id="APP">%1$s</xliff:g> uitvoer"</string>
- <string name="abc_slice_permission_allow" msgid="5024599872061409708">"Laat toe"</string>
- <string name="abc_slice_permission_deny" msgid="3819478292430407705">"Weier"</string>
+ <string name="abc_slices_permission_request" msgid="4431189529265983653">"<xliff:g id="APP_0">%1$s</xliff:g> wil <xliff:g id="APP_2">%2$s</xliff:g>-segmente wys"</string>
+ <string name="abc_slice_permission_title" msgid="4776010267128891014">"Laat <xliff:g id="APP_0">%1$s</xliff:g> toe om <xliff:g id="APP_2">%2$s</xliff:g>-segmente te wys?"</string>
+ <string name="abc_slice_permission_text_1" msgid="9108592981418900836">"– Dit kan inligting in <xliff:g id="APP">%1$s</xliff:g> lees"</string>
+ <string name="abc_slice_permission_text_2" msgid="7135705417979137589">"– Dit kan handelinge binne <xliff:g id="APP">%1$s</xliff:g> uitvoer"</string>
+ <string name="abc_slice_permission_allow" msgid="6374752258872407887">"Laat toe"</string>
+ <string name="abc_slice_permission_deny" msgid="576316744017426251">"Weier"</string>
</resources>
diff --git a/slice/slice-core/src/main/res/values-am/strings.xml b/slice/slice-core/src/main/res/values-am/strings.xml
index 96be387..a57d24e 100644
--- a/slice/slice-core/src/main/res/values-am/strings.xml
+++ b/slice/slice-core/src/main/res/values-am/strings.xml
@@ -17,10 +17,10 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slices_permission_request" msgid="3604847235923472451">"<xliff:g id="APP_0">%1$s</xliff:g> የ<xliff:g id="APP_2">%2$s</xliff:g> ቁራጮችን ማሳየት ይፈልጋል"</string>
- <string name="abc_slice_permission_title" msgid="4175332421259324948">"<xliff:g id="APP_0">%1$s</xliff:g> የ<xliff:g id="APP_2">%2$s</xliff:g> ቁራጮችን እንዲያሳይ ይፈቀድለት?"</string>
- <string name="abc_slice_permission_text_1" msgid="4525743640399572811">"- ከ<xliff:g id="APP">%1$s</xliff:g> የመጣ መረጃን ማንበብ ይችላል"</string>
- <string name="abc_slice_permission_text_2" msgid="7323565634860251794">"- በ<xliff:g id="APP">%1$s</xliff:g> ውስጥ እርምጃዎችን መውሰድ ይችላል"</string>
- <string name="abc_slice_permission_allow" msgid="5024599872061409708">"ፍቀድ"</string>
- <string name="abc_slice_permission_deny" msgid="3819478292430407705">"ከልክል"</string>
+ <string name="abc_slices_permission_request" msgid="4431189529265983653">"<xliff:g id="APP_0">%1$s</xliff:g> የ<xliff:g id="APP_2">%2$s</xliff:g> ቁራጮችን ማሳየት ይፈልጋል"</string>
+ <string name="abc_slice_permission_title" msgid="4776010267128891014">"<xliff:g id="APP_0">%1$s</xliff:g> የ<xliff:g id="APP_2">%2$s</xliff:g> ቁራጮችን እንዲያሳይ ይፈቀድለት?"</string>
+ <string name="abc_slice_permission_text_1" msgid="9108592981418900836">"- ከ<xliff:g id="APP">%1$s</xliff:g> የመጣ መረጃን ማንበብ ይችላል"</string>
+ <string name="abc_slice_permission_text_2" msgid="7135705417979137589">"- በ<xliff:g id="APP">%1$s</xliff:g> ውስጥ እርምጃዎችን መውሰድ ይችላል"</string>
+ <string name="abc_slice_permission_allow" msgid="6374752258872407887">"ፍቀድ"</string>
+ <string name="abc_slice_permission_deny" msgid="576316744017426251">"ከልክል"</string>
</resources>
diff --git a/slice/slice-core/src/main/res/values-ar/strings.xml b/slice/slice-core/src/main/res/values-ar/strings.xml
index c195f16..8109aac 100644
--- a/slice/slice-core/src/main/res/values-ar/strings.xml
+++ b/slice/slice-core/src/main/res/values-ar/strings.xml
@@ -17,10 +17,10 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slices_permission_request" msgid="3604847235923472451">"يريد تطبيق <xliff:g id="APP_0">%1$s</xliff:g> عرض شرائح تطبيق <xliff:g id="APP_2">%2$s</xliff:g>."</string>
- <string name="abc_slice_permission_title" msgid="4175332421259324948">"هل تريد السماح لتطبيق <xliff:g id="APP_0">%1$s</xliff:g> بعرض شرائح <xliff:g id="APP_2">%2$s</xliff:g>؟"</string>
- <string name="abc_slice_permission_text_1" msgid="4525743640399572811">"- إمكانية قراءة المعلومات من <xliff:g id="APP">%1$s</xliff:g>"</string>
- <string name="abc_slice_permission_text_2" msgid="7323565634860251794">"- إمكانية اتخاذ إجراءات داخل <xliff:g id="APP">%1$s</xliff:g>"</string>
- <string name="abc_slice_permission_allow" msgid="5024599872061409708">"سماح"</string>
- <string name="abc_slice_permission_deny" msgid="3819478292430407705">"رفض"</string>
+ <string name="abc_slices_permission_request" msgid="4431189529265983653">"يريد تطبيق <xliff:g id="APP_0">%1$s</xliff:g> عرض شرائح تطبيق <xliff:g id="APP_2">%2$s</xliff:g>."</string>
+ <string name="abc_slice_permission_title" msgid="4776010267128891014">"هل تريد السماح لتطبيق <xliff:g id="APP_0">%1$s</xliff:g> بعرض شرائح التطبيق <xliff:g id="APP_2">%2$s</xliff:g>؟"</string>
+ <string name="abc_slice_permission_text_1" msgid="9108592981418900836">"- يستطيع قراءة المعلومات من <xliff:g id="APP">%1$s</xliff:g>"</string>
+ <string name="abc_slice_permission_text_2" msgid="7135705417979137589">"- يستطيع اتخاذ إجراءات داخل <xliff:g id="APP">%1$s</xliff:g>"</string>
+ <string name="abc_slice_permission_allow" msgid="6374752258872407887">"السماح"</string>
+ <string name="abc_slice_permission_deny" msgid="576316744017426251">"الرفض"</string>
</resources>
diff --git a/slice/slice-core/src/main/res/values-as/strings.xml b/slice/slice-core/src/main/res/values-as/strings.xml
index e8c88e0..29339bd 100644
--- a/slice/slice-core/src/main/res/values-as/strings.xml
+++ b/slice/slice-core/src/main/res/values-as/strings.xml
@@ -17,10 +17,10 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slices_permission_request" msgid="3604847235923472451">"<xliff:g id="APP_0">%1$s</xliff:g>এ <xliff:g id="APP_2">%2$s</xliff:g>ৰ অংশ দেখুওৱাব খুজিছে"</string>
- <string name="abc_slice_permission_title" msgid="4175332421259324948">"<xliff:g id="APP_0">%1$s</xliff:g>ক <xliff:g id="APP_2">%2$s</xliff:g>ৰ অংশ দেখুওৱাবলৈ অনুমতি দিবনে?"</string>
- <string name="abc_slice_permission_text_1" msgid="4525743640399572811">"- ই <xliff:g id="APP">%1$s</xliff:g>ৰ তথ্য পঢ়িব পাৰে"</string>
- <string name="abc_slice_permission_text_2" msgid="7323565634860251794">"- ই <xliff:g id="APP">%1$s</xliff:g>ৰ ভিতৰত কাৰ্য কৰিব পাৰে"</string>
- <string name="abc_slice_permission_allow" msgid="5024599872061409708">"অনুমতি দিয়ক"</string>
- <string name="abc_slice_permission_deny" msgid="3819478292430407705">"অস্বীকাৰ কৰক"</string>
+ <string name="abc_slices_permission_request" msgid="4431189529265983653">"<xliff:g id="APP_0">%1$s</xliff:g>এ <xliff:g id="APP_2">%2$s</xliff:g>ৰ অংশ দেখুৱাব বিচাৰিছে"</string>
+ <string name="abc_slice_permission_title" msgid="4776010267128891014">"<xliff:g id="APP_0">%1$s</xliff:g>ক <xliff:g id="APP_2">%2$s</xliff:g>ৰ অংশ দেখুৱাবলৈ অনুমতি দিবনে?"</string>
+ <string name="abc_slice_permission_text_1" msgid="9108592981418900836">"- ই <xliff:g id="APP">%1$s</xliff:g>ৰ তথ্য পঢ়িব পাৰে"</string>
+ <string name="abc_slice_permission_text_2" msgid="7135705417979137589">"- ই <xliff:g id="APP">%1$s</xliff:g>ৰ ভিতৰত কাৰ্য কৰিব পাৰে"</string>
+ <string name="abc_slice_permission_allow" msgid="6374752258872407887">"অনুমতি দিয়ক"</string>
+ <string name="abc_slice_permission_deny" msgid="576316744017426251">"অস্বীকাৰ কৰক"</string>
</resources>
diff --git a/slice/slice-core/src/main/res/values-az/strings.xml b/slice/slice-core/src/main/res/values-az/strings.xml
index bd71cb1..f44c666 100644
--- a/slice/slice-core/src/main/res/values-az/strings.xml
+++ b/slice/slice-core/src/main/res/values-az/strings.xml
@@ -17,10 +17,10 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slices_permission_request" msgid="3604847235923472451">"<xliff:g id="APP_0">%1$s</xliff:g> <xliff:g id="APP_2">%2$s</xliff:g> tətbiqindən hissələr göstərmək istəyir"</string>
- <string name="abc_slice_permission_title" msgid="4175332421259324948">"<xliff:g id="APP_0">%1$s</xliff:g> tətbiqinə <xliff:g id="APP_2">%2$s</xliff:g> hissələrini göstərmək üçün icazə verilsin?"</string>
- <string name="abc_slice_permission_text_1" msgid="4525743640399572811">"- <xliff:g id="APP">%1$s</xliff:g> tətbiqindən məlumat oxuya bilər"</string>
- <string name="abc_slice_permission_text_2" msgid="7323565634860251794">"- <xliff:g id="APP">%1$s</xliff:g> daxilində əməliyyatlar edə bilər"</string>
- <string name="abc_slice_permission_allow" msgid="5024599872061409708">"İcazə verin"</string>
- <string name="abc_slice_permission_deny" msgid="3819478292430407705">"Rədd edin"</string>
+ <string name="abc_slices_permission_request" msgid="4431189529265983653">"<xliff:g id="APP_0">%1$s</xliff:g> <xliff:g id="APP_2">%2$s</xliff:g> tətbiqindən hissələr göstərmək istəyir"</string>
+ <string name="abc_slice_permission_title" msgid="4776010267128891014">"<xliff:g id="APP_0">%1$s</xliff:g> tətbiqinə <xliff:g id="APP_2">%2$s</xliff:g> hissələrini göstərmək üçün icazə verilsin?"</string>
+ <string name="abc_slice_permission_text_1" msgid="9108592981418900836">"- <xliff:g id="APP">%1$s</xliff:g> tətbiqindən məlumat oxuya bilər"</string>
+ <string name="abc_slice_permission_text_2" msgid="7135705417979137589">"- <xliff:g id="APP">%1$s</xliff:g> daxilində əməliyyatlar edə bilər"</string>
+ <string name="abc_slice_permission_allow" msgid="6374752258872407887">"İcazə verin"</string>
+ <string name="abc_slice_permission_deny" msgid="576316744017426251">"Rədd edin"</string>
</resources>
diff --git a/slice/slice-core/src/main/res/values-b+sr+Latn/strings.xml b/slice/slice-core/src/main/res/values-b+sr+Latn/strings.xml
index 476441d..7edadbf 100644
--- a/slice/slice-core/src/main/res/values-b+sr+Latn/strings.xml
+++ b/slice/slice-core/src/main/res/values-b+sr+Latn/strings.xml
@@ -17,10 +17,10 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slices_permission_request" msgid="3604847235923472451">"Aplikacija <xliff:g id="APP_0">%1$s</xliff:g> želi da prikazuje isečke iz aplikacije <xliff:g id="APP_2">%2$s</xliff:g>"</string>
- <string name="abc_slice_permission_title" msgid="4175332421259324948">"Želite li da dozvolite aplikaciji <xliff:g id="APP_0">%1$s</xliff:g> da prikazuje isečke iz aplikacije <xliff:g id="APP_2">%2$s</xliff:g>?"</string>
- <string name="abc_slice_permission_text_1" msgid="4525743640399572811">"– Može da čita podatke iz aplikacije <xliff:g id="APP">%1$s</xliff:g>"</string>
- <string name="abc_slice_permission_text_2" msgid="7323565634860251794">"– Može da obavlja radnje u aplikaciji <xliff:g id="APP">%1$s</xliff:g>"</string>
- <string name="abc_slice_permission_allow" msgid="5024599872061409708">"Dozvoli"</string>
- <string name="abc_slice_permission_deny" msgid="3819478292430407705">"Odbij"</string>
+ <string name="abc_slices_permission_request" msgid="4431189529265983653">"Aplikacija <xliff:g id="APP_0">%1$s</xliff:g> želi da prikazuje fragmente iz aplikacije <xliff:g id="APP_2">%2$s</xliff:g>"</string>
+ <string name="abc_slice_permission_title" msgid="4776010267128891014">"Želite li da dozvolite aplikaciji <xliff:g id="APP_0">%1$s</xliff:g> da prikazuje fragmente iz aplikacije <xliff:g id="APP_2">%2$s</xliff:g>?"</string>
+ <string name="abc_slice_permission_text_1" msgid="9108592981418900836">"– Može da čita podatke iz aplikacije <xliff:g id="APP">%1$s</xliff:g>"</string>
+ <string name="abc_slice_permission_text_2" msgid="7135705417979137589">"– Može da obavlja radnje u aplikaciji <xliff:g id="APP">%1$s</xliff:g>"</string>
+ <string name="abc_slice_permission_allow" msgid="6374752258872407887">"Dozvoli"</string>
+ <string name="abc_slice_permission_deny" msgid="576316744017426251">"Odbij"</string>
</resources>
diff --git a/slice/slice-core/src/main/res/values-be/strings.xml b/slice/slice-core/src/main/res/values-be/strings.xml
index 85988a8..e1a5439 100644
--- a/slice/slice-core/src/main/res/values-be/strings.xml
+++ b/slice/slice-core/src/main/res/values-be/strings.xml
@@ -17,10 +17,10 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slices_permission_request" msgid="3604847235923472451">"Праграма <xliff:g id="APP_0">%1$s</xliff:g> запытвае дазвол на паказ фрагментаў праграмы <xliff:g id="APP_2">%2$s</xliff:g>"</string>
- <string name="abc_slice_permission_title" msgid="4175332421259324948">"Дазволіць праграме <xliff:g id="APP_0">%1$s</xliff:g> паказваць фрагменты праграмы <xliff:g id="APP_2">%2$s</xliff:g>?"</string>
- <string name="abc_slice_permission_text_1" msgid="4525743640399572811">"- Можа счытваць інфармацыю з праграмы <xliff:g id="APP">%1$s</xliff:g>"</string>
- <string name="abc_slice_permission_text_2" msgid="7323565634860251794">"- Можа выконваць дзеянні ў праграме <xliff:g id="APP">%1$s</xliff:g>"</string>
- <string name="abc_slice_permission_allow" msgid="5024599872061409708">"Дазволіць"</string>
- <string name="abc_slice_permission_deny" msgid="3819478292430407705">"Адмовіць"</string>
+ <string name="abc_slices_permission_request" msgid="4431189529265983653">"Праграма \"<xliff:g id="APP_0">%1$s</xliff:g>\" запытвае дазвол на паказ фрагментаў праграмы \"<xliff:g id="APP_2">%2$s</xliff:g>\""</string>
+ <string name="abc_slice_permission_title" msgid="4776010267128891014">"Дазволіць праграме \"<xliff:g id="APP_0">%1$s</xliff:g>\" паказваць фрагменты праграмы \"<xliff:g id="APP_2">%2$s</xliff:g>\"?"</string>
+ <string name="abc_slice_permission_text_1" msgid="9108592981418900836">"- Можа счытваць інфармацыю з праграмы \"<xliff:g id="APP">%1$s</xliff:g>\""</string>
+ <string name="abc_slice_permission_text_2" msgid="7135705417979137589">"- Можа выконваць дзеянні ў праграме \"<xliff:g id="APP">%1$s</xliff:g>\""</string>
+ <string name="abc_slice_permission_allow" msgid="6374752258872407887">"Дазволіць"</string>
+ <string name="abc_slice_permission_deny" msgid="576316744017426251">"Адмовіць"</string>
</resources>
diff --git a/slice/slice-core/src/main/res/values-bg/strings.xml b/slice/slice-core/src/main/res/values-bg/strings.xml
index 1ff6667..eade9b4 100644
--- a/slice/slice-core/src/main/res/values-bg/strings.xml
+++ b/slice/slice-core/src/main/res/values-bg/strings.xml
@@ -17,10 +17,10 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slices_permission_request" msgid="3604847235923472451">"<xliff:g id="APP_0">%1$s</xliff:g> иска да показва части от <xliff:g id="APP_2">%2$s</xliff:g>"</string>
- <string name="abc_slice_permission_title" msgid="4175332421259324948">"Ще разрешите ли на <xliff:g id="APP_0">%1$s</xliff:g> да показва части от <xliff:g id="APP_2">%2$s</xliff:g>?"</string>
- <string name="abc_slice_permission_text_1" msgid="4525743640399572811">"– Може да чете информация от <xliff:g id="APP">%1$s</xliff:g>"</string>
- <string name="abc_slice_permission_text_2" msgid="7323565634860251794">"– Може да предприема действия в/ъв <xliff:g id="APP">%1$s</xliff:g>"</string>
- <string name="abc_slice_permission_allow" msgid="5024599872061409708">"Разрешаване"</string>
- <string name="abc_slice_permission_deny" msgid="3819478292430407705">"Отказ"</string>
+ <string name="abc_slices_permission_request" msgid="4431189529265983653">"<xliff:g id="APP_0">%1$s</xliff:g> иска да показва части от <xliff:g id="APP_2">%2$s</xliff:g>"</string>
+ <string name="abc_slice_permission_title" msgid="4776010267128891014">"Ще разрешите ли на <xliff:g id="APP_0">%1$s</xliff:g> да показва части от <xliff:g id="APP_2">%2$s</xliff:g>?"</string>
+ <string name="abc_slice_permission_text_1" msgid="9108592981418900836">"– Може да чете информация от <xliff:g id="APP">%1$s</xliff:g>"</string>
+ <string name="abc_slice_permission_text_2" msgid="7135705417979137589">"– Може да предприема действия в(ъв) <xliff:g id="APP">%1$s</xliff:g>"</string>
+ <string name="abc_slice_permission_allow" msgid="6374752258872407887">"Разрешаване"</string>
+ <string name="abc_slice_permission_deny" msgid="576316744017426251">"Отказ"</string>
</resources>
diff --git a/slice/slice-core/src/main/res/values-bn/strings.xml b/slice/slice-core/src/main/res/values-bn/strings.xml
index c9556dd..2180799 100644
--- a/slice/slice-core/src/main/res/values-bn/strings.xml
+++ b/slice/slice-core/src/main/res/values-bn/strings.xml
@@ -17,10 +17,10 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slices_permission_request" msgid="3604847235923472451">"<xliff:g id="APP_0">%1$s</xliff:g> অ্যাপটি <xliff:g id="APP_2">%2$s</xliff:g> এর অংশ দেখাতে চায়"</string>
- <string name="abc_slice_permission_title" msgid="4175332421259324948">"<xliff:g id="APP_0">%1$s</xliff:g> অ্যাপটিকে <xliff:g id="APP_2">%2$s</xliff:g> এর অংশ দেখানোর অনুমতি দেবেন?"</string>
- <string name="abc_slice_permission_text_1" msgid="4525743640399572811">"- এটি <xliff:g id="APP">%1$s</xliff:g> এর তথ্য অ্যাক্সেস করতে পারবে"</string>
- <string name="abc_slice_permission_text_2" msgid="7323565634860251794">"- এটি <xliff:g id="APP">%1$s</xliff:g> এর মধ্যে কাজ করতে পারবে"</string>
- <string name="abc_slice_permission_allow" msgid="5024599872061409708">"অনুমতি দিন"</string>
- <string name="abc_slice_permission_deny" msgid="3819478292430407705">"খারিজ করুন"</string>
+ <string name="abc_slices_permission_request" msgid="4431189529265983653">"<xliff:g id="APP_0">%1$s</xliff:g> অ্যাপটি <xliff:g id="APP_2">%2$s</xliff:g> অ্যাপের বিভিন্ন অংশ দেখাতে চায়"</string>
+ <string name="abc_slice_permission_title" msgid="4776010267128891014">"<xliff:g id="APP_0">%1$s</xliff:g> অ্যাপকে <xliff:g id="APP_2">%2$s</xliff:g> অ্যাপের বিভিন্ন অংশ দেখানোর অনুমতি দেবেন?"</string>
+ <string name="abc_slice_permission_text_1" msgid="9108592981418900836">"- এটি <xliff:g id="APP">%1$s</xliff:g> অ্যাপের তথ্য অ্যাক্সেস করতে পারবে"</string>
+ <string name="abc_slice_permission_text_2" msgid="7135705417979137589">"- এটি <xliff:g id="APP">%1$s</xliff:g> অ্যাপের মধ্যে বিভিন্ন কাজ করতে পারবে"</string>
+ <string name="abc_slice_permission_allow" msgid="6374752258872407887">"অনুমতি দিন"</string>
+ <string name="abc_slice_permission_deny" msgid="576316744017426251">"বাতিল করুন"</string>
</resources>
diff --git a/slice/slice-core/src/main/res/values-bs/strings.xml b/slice/slice-core/src/main/res/values-bs/strings.xml
index ed3104d5..d6b2b74 100644
--- a/slice/slice-core/src/main/res/values-bs/strings.xml
+++ b/slice/slice-core/src/main/res/values-bs/strings.xml
@@ -17,10 +17,10 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slices_permission_request" msgid="3604847235923472451">"Aplikacija <xliff:g id="APP_0">%1$s</xliff:g> želi prikazati isječke aplikacije <xliff:g id="APP_2">%2$s</xliff:g>"</string>
- <string name="abc_slice_permission_title" msgid="4175332421259324948">"Dozvoliti aplikaciji <xliff:g id="APP_0">%1$s</xliff:g> prikazivanje isječaka aplikacije <xliff:g id="APP_2">%2$s</xliff:g>?"</string>
- <string name="abc_slice_permission_text_1" msgid="4525743640399572811">"- Može čitati informacije iz aplikacije <xliff:g id="APP">%1$s</xliff:g>"</string>
- <string name="abc_slice_permission_text_2" msgid="7323565634860251794">"- Može poduzeti radnje u aplikaciji <xliff:g id="APP">%1$s</xliff:g>"</string>
- <string name="abc_slice_permission_allow" msgid="5024599872061409708">"Dozvoli"</string>
- <string name="abc_slice_permission_deny" msgid="3819478292430407705">"Odbij"</string>
+ <string name="abc_slices_permission_request" msgid="4431189529265983653">"Aplikacija <xliff:g id="APP_0">%1$s</xliff:g> želi prikazati isječke aplikacije <xliff:g id="APP_2">%2$s</xliff:g>"</string>
+ <string name="abc_slice_permission_title" msgid="4776010267128891014">"Dozvoliti aplikaciji <xliff:g id="APP_0">%1$s</xliff:g> da prikazuje isječke aplikacije <xliff:g id="APP_2">%2$s</xliff:g>?"</string>
+ <string name="abc_slice_permission_text_1" msgid="9108592981418900836">"- Može čitati informacije iz aplikacije <xliff:g id="APP">%1$s</xliff:g>"</string>
+ <string name="abc_slice_permission_text_2" msgid="7135705417979137589">"- Može poduzeti radnje u aplikaciji <xliff:g id="APP">%1$s</xliff:g>"</string>
+ <string name="abc_slice_permission_allow" msgid="6374752258872407887">"Dozvoli"</string>
+ <string name="abc_slice_permission_deny" msgid="576316744017426251">"Odbij"</string>
</resources>
diff --git a/slice/slice-core/src/main/res/values-ca/strings.xml b/slice/slice-core/src/main/res/values-ca/strings.xml
index 5bff344..54a5378 100644
--- a/slice/slice-core/src/main/res/values-ca/strings.xml
+++ b/slice/slice-core/src/main/res/values-ca/strings.xml
@@ -17,10 +17,10 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slices_permission_request" msgid="3604847235923472451">"<xliff:g id="APP_0">%1$s</xliff:g> vol mostrar porcions de l\'aplicació <xliff:g id="APP_2">%2$s</xliff:g>"</string>
- <string name="abc_slice_permission_title" msgid="4175332421259324948">"Vols permetre que <xliff:g id="APP_0">%1$s</xliff:g> mostri porcions de l\'aplicació <xliff:g id="APP_2">%2$s</xliff:g>?"</string>
- <string name="abc_slice_permission_text_1" msgid="4525743640399572811">"- Pot llegir informació de l\'aplicació <xliff:g id="APP">%1$s</xliff:g>"</string>
- <string name="abc_slice_permission_text_2" msgid="7323565634860251794">"- Pot dur a terme accions dins de l\'aplicació <xliff:g id="APP">%1$s</xliff:g>"</string>
- <string name="abc_slice_permission_allow" msgid="5024599872061409708">"Permet"</string>
- <string name="abc_slice_permission_deny" msgid="3819478292430407705">"Denega"</string>
+ <string name="abc_slices_permission_request" msgid="4431189529265983653">"<xliff:g id="APP_0">%1$s</xliff:g> vol mostrar fragments de l\'aplicació <xliff:g id="APP_2">%2$s</xliff:g>"</string>
+ <string name="abc_slice_permission_title" msgid="4776010267128891014">"Vols permetre que <xliff:g id="APP_0">%1$s</xliff:g> mostri fragments de l\'aplicació <xliff:g id="APP_2">%2$s</xliff:g>?"</string>
+ <string name="abc_slice_permission_text_1" msgid="9108592981418900836">"- Pot llegir informació de l\'aplicació <xliff:g id="APP">%1$s</xliff:g>"</string>
+ <string name="abc_slice_permission_text_2" msgid="7135705417979137589">"- Pot dur a terme accions dins de l\'aplicació <xliff:g id="APP">%1$s</xliff:g>"</string>
+ <string name="abc_slice_permission_allow" msgid="6374752258872407887">"Permet"</string>
+ <string name="abc_slice_permission_deny" msgid="576316744017426251">"Denega"</string>
</resources>
diff --git a/slice/slice-core/src/main/res/values-cs/strings.xml b/slice/slice-core/src/main/res/values-cs/strings.xml
index 432ed94..85d465c 100644
--- a/slice/slice-core/src/main/res/values-cs/strings.xml
+++ b/slice/slice-core/src/main/res/values-cs/strings.xml
@@ -17,10 +17,10 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slices_permission_request" msgid="3604847235923472451">"Aplikace <xliff:g id="APP_0">%1$s</xliff:g> chce zobrazovat ukázky z aplikace <xliff:g id="APP_2">%2$s</xliff:g>"</string>
- <string name="abc_slice_permission_title" msgid="4175332421259324948">"Povolit aplikaci <xliff:g id="APP_0">%1$s</xliff:g> zobrazovat ukázky z aplikace <xliff:g id="APP_2">%2$s</xliff:g>?"</string>
- <string name="abc_slice_permission_text_1" msgid="4525743640399572811">"– Může číst informace z aplikace <xliff:g id="APP">%1$s</xliff:g>"</string>
- <string name="abc_slice_permission_text_2" msgid="7323565634860251794">"– Může provádět akce v aplikaci <xliff:g id="APP">%1$s</xliff:g>"</string>
- <string name="abc_slice_permission_allow" msgid="5024599872061409708">"Povolit"</string>
- <string name="abc_slice_permission_deny" msgid="3819478292430407705">"Zamítnout"</string>
+ <string name="abc_slices_permission_request" msgid="4431189529265983653">"Aplikace <xliff:g id="APP_0">%1$s</xliff:g> chce zobrazovat ukázky z aplikace <xliff:g id="APP_2">%2$s</xliff:g>"</string>
+ <string name="abc_slice_permission_title" msgid="4776010267128891014">"Povolit aplikaci <xliff:g id="APP_0">%1$s</xliff:g> zobrazovat ukázky z aplikace <xliff:g id="APP_2">%2$s</xliff:g>?"</string>
+ <string name="abc_slice_permission_text_1" msgid="9108592981418900836">"– Může číst informace z aplikace <xliff:g id="APP">%1$s</xliff:g>"</string>
+ <string name="abc_slice_permission_text_2" msgid="7135705417979137589">"– Může provádět akce v aplikaci <xliff:g id="APP">%1$s</xliff:g>"</string>
+ <string name="abc_slice_permission_allow" msgid="6374752258872407887">"Povolit"</string>
+ <string name="abc_slice_permission_deny" msgid="576316744017426251">"Zamítnout"</string>
</resources>
diff --git a/slice/slice-core/src/main/res/values-da/strings.xml b/slice/slice-core/src/main/res/values-da/strings.xml
index eb148eb..64ced72 100644
--- a/slice/slice-core/src/main/res/values-da/strings.xml
+++ b/slice/slice-core/src/main/res/values-da/strings.xml
@@ -17,10 +17,10 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slices_permission_request" msgid="3604847235923472451">"<xliff:g id="APP_0">%1$s</xliff:g> anmoder om tilladelse til at vise eksempler fra <xliff:g id="APP_2">%2$s</xliff:g>"</string>
- <string name="abc_slice_permission_title" msgid="4175332421259324948">"Vil du give <xliff:g id="APP_0">%1$s</xliff:g> tilladelse til at vise eksempler fra <xliff:g id="APP_2">%2$s</xliff:g>?"</string>
- <string name="abc_slice_permission_text_1" msgid="4525743640399572811">"- Den kan læse oplysninger fra <xliff:g id="APP">%1$s</xliff:g>"</string>
- <string name="abc_slice_permission_text_2" msgid="7323565634860251794">"- Den kan foretage handlinger i <xliff:g id="APP">%1$s</xliff:g>"</string>
- <string name="abc_slice_permission_allow" msgid="5024599872061409708">"Tillad"</string>
- <string name="abc_slice_permission_deny" msgid="3819478292430407705">"Afvis"</string>
+ <string name="abc_slices_permission_request" msgid="4431189529265983653">"<xliff:g id="APP_0">%1$s</xliff:g> anmoder om tilladelse til at vise udsnit fra <xliff:g id="APP_2">%2$s</xliff:g>"</string>
+ <string name="abc_slice_permission_title" msgid="4776010267128891014">"Vil du give <xliff:g id="APP_0">%1$s</xliff:g> tilladelse til at vise udsnit fra <xliff:g id="APP_2">%2$s</xliff:g>?"</string>
+ <string name="abc_slice_permission_text_1" msgid="9108592981418900836">"- Den kan læse oplysninger fra <xliff:g id="APP">%1$s</xliff:g>"</string>
+ <string name="abc_slice_permission_text_2" msgid="7135705417979137589">"- Den kan foretage handlinger i <xliff:g id="APP">%1$s</xliff:g>"</string>
+ <string name="abc_slice_permission_allow" msgid="6374752258872407887">"Tillad"</string>
+ <string name="abc_slice_permission_deny" msgid="576316744017426251">"Afvis"</string>
</resources>
diff --git a/slice/slice-core/src/main/res/values-de/strings.xml b/slice/slice-core/src/main/res/values-de/strings.xml
index b14bdb3..3171886 100644
--- a/slice/slice-core/src/main/res/values-de/strings.xml
+++ b/slice/slice-core/src/main/res/values-de/strings.xml
@@ -17,10 +17,10 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slices_permission_request" msgid="3604847235923472451">"<xliff:g id="APP_0">%1$s</xliff:g> möchte Teile von <xliff:g id="APP_2">%2$s</xliff:g> anzeigen"</string>
- <string name="abc_slice_permission_title" msgid="4175332421259324948">"<xliff:g id="APP_0">%1$s</xliff:g> erlauben, Teile von <xliff:g id="APP_2">%2$s</xliff:g> anzuzeigen?"</string>
- <string name="abc_slice_permission_text_1" msgid="4525743640399572811">"– Darf Informationen aus <xliff:g id="APP">%1$s</xliff:g> lesen"</string>
- <string name="abc_slice_permission_text_2" msgid="7323565634860251794">"– Darf Aktionen in <xliff:g id="APP">%1$s</xliff:g> ausführen"</string>
- <string name="abc_slice_permission_allow" msgid="5024599872061409708">"Zulassen"</string>
- <string name="abc_slice_permission_deny" msgid="3819478292430407705">"Ablehnen"</string>
+ <string name="abc_slices_permission_request" msgid="4431189529265983653">"<xliff:g id="APP_0">%1$s</xliff:g> möchte Teile von <xliff:g id="APP_2">%2$s</xliff:g> anzeigen"</string>
+ <string name="abc_slice_permission_title" msgid="4776010267128891014">"<xliff:g id="APP_0">%1$s</xliff:g> erlauben, Teile von <xliff:g id="APP_2">%2$s</xliff:g> anzuzeigen?"</string>
+ <string name="abc_slice_permission_text_1" msgid="9108592981418900836">"– Darf Informationen aus <xliff:g id="APP">%1$s</xliff:g> lesen"</string>
+ <string name="abc_slice_permission_text_2" msgid="7135705417979137589">"– Darf Aktionen in <xliff:g id="APP">%1$s</xliff:g> ausführen"</string>
+ <string name="abc_slice_permission_allow" msgid="6374752258872407887">"Zulassen"</string>
+ <string name="abc_slice_permission_deny" msgid="576316744017426251">"Ablehnen"</string>
</resources>
diff --git a/slice/slice-core/src/main/res/values-el/strings.xml b/slice/slice-core/src/main/res/values-el/strings.xml
index 8ae97bf..df7cec4 100644
--- a/slice/slice-core/src/main/res/values-el/strings.xml
+++ b/slice/slice-core/src/main/res/values-el/strings.xml
@@ -17,10 +17,10 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slices_permission_request" msgid="3604847235923472451">"Η εφαρμογή <xliff:g id="APP_0">%1$s</xliff:g> θέλει να εμφανίζει τμήματα της εφαρμογής <xliff:g id="APP_2">%2$s</xliff:g>"</string>
- <string name="abc_slice_permission_title" msgid="4175332421259324948">"Να επιτρέπεται στην εφαρμογή <xliff:g id="APP_0">%1$s</xliff:g> να εμφανίζει τμήματα της εφαρμογής <xliff:g id="APP_2">%2$s</xliff:g>;"</string>
- <string name="abc_slice_permission_text_1" msgid="4525743640399572811">"- Μπορεί να διαβάζει πληροφορίες από την εφαρμογή <xliff:g id="APP">%1$s</xliff:g>"</string>
- <string name="abc_slice_permission_text_2" msgid="7323565634860251794">"- Μπορεί να εκτελεί ενέργειες εντός της εφαρμογής <xliff:g id="APP">%1$s</xliff:g>"</string>
- <string name="abc_slice_permission_allow" msgid="5024599872061409708">"Να επιτρέπεται"</string>
- <string name="abc_slice_permission_deny" msgid="3819478292430407705">"Να μην επιτρέπεται"</string>
+ <string name="abc_slices_permission_request" msgid="4431189529265983653">"Η εφαρμογή <xliff:g id="APP_0">%1$s</xliff:g> θέλει να εμφανίζει κομμάτια της εφαρμογής <xliff:g id="APP_2">%2$s</xliff:g>."</string>
+ <string name="abc_slice_permission_title" msgid="4776010267128891014">"Να επιτρέπεται στην εφαρμογή <xliff:g id="APP_0">%1$s</xliff:g> να εμφανίζει κομμάτια της εφαρμογής <xliff:g id="APP_2">%2$s</xliff:g>;"</string>
+ <string name="abc_slice_permission_text_1" msgid="9108592981418900836">"- Μπορεί να διαβάζει πληροφορίες από την εφαρμογή <xliff:g id="APP">%1$s</xliff:g>."</string>
+ <string name="abc_slice_permission_text_2" msgid="7135705417979137589">"- Μπορεί να εκτελεί ενέργειες εντός της εφαρμογής <xliff:g id="APP">%1$s</xliff:g>."</string>
+ <string name="abc_slice_permission_allow" msgid="6374752258872407887">"Αποδοχή"</string>
+ <string name="abc_slice_permission_deny" msgid="576316744017426251">"Απόρριψη"</string>
</resources>
diff --git a/slice/slice-core/src/main/res/values-en-rAU/strings.xml b/slice/slice-core/src/main/res/values-en-rAU/strings.xml
index 753ea3e..f097b2c 100644
--- a/slice/slice-core/src/main/res/values-en-rAU/strings.xml
+++ b/slice/slice-core/src/main/res/values-en-rAU/strings.xml
@@ -17,10 +17,10 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slices_permission_request" msgid="3604847235923472451">"<xliff:g id="APP_0">%1$s</xliff:g> wants to show <xliff:g id="APP_2">%2$s</xliff:g> slices"</string>
- <string name="abc_slice_permission_title" msgid="4175332421259324948">"Allow <xliff:g id="APP_0">%1$s</xliff:g> to show <xliff:g id="APP_2">%2$s</xliff:g> slices?"</string>
- <string name="abc_slice_permission_text_1" msgid="4525743640399572811">"– It can read information from <xliff:g id="APP">%1$s</xliff:g>"</string>
- <string name="abc_slice_permission_text_2" msgid="7323565634860251794">"– It can take actions inside <xliff:g id="APP">%1$s</xliff:g>"</string>
- <string name="abc_slice_permission_allow" msgid="5024599872061409708">"Allow"</string>
- <string name="abc_slice_permission_deny" msgid="3819478292430407705">"Deny"</string>
+ <string name="abc_slices_permission_request" msgid="4431189529265983653">"<xliff:g id="APP_0">%1$s</xliff:g> wants to show <xliff:g id="APP_2">%2$s</xliff:g> slices"</string>
+ <string name="abc_slice_permission_title" msgid="4776010267128891014">"Allow <xliff:g id="APP_0">%1$s</xliff:g> to show <xliff:g id="APP_2">%2$s</xliff:g> slices?"</string>
+ <string name="abc_slice_permission_text_1" msgid="9108592981418900836">"- It can read information from <xliff:g id="APP">%1$s</xliff:g>"</string>
+ <string name="abc_slice_permission_text_2" msgid="7135705417979137589">"- It can take actions inside <xliff:g id="APP">%1$s</xliff:g>"</string>
+ <string name="abc_slice_permission_allow" msgid="6374752258872407887">"Allow"</string>
+ <string name="abc_slice_permission_deny" msgid="576316744017426251">"Deny"</string>
</resources>
diff --git a/slice/slice-core/src/main/res/values-en-rCA/strings.xml b/slice/slice-core/src/main/res/values-en-rCA/strings.xml
index 753ea3e..f097b2c 100644
--- a/slice/slice-core/src/main/res/values-en-rCA/strings.xml
+++ b/slice/slice-core/src/main/res/values-en-rCA/strings.xml
@@ -17,10 +17,10 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slices_permission_request" msgid="3604847235923472451">"<xliff:g id="APP_0">%1$s</xliff:g> wants to show <xliff:g id="APP_2">%2$s</xliff:g> slices"</string>
- <string name="abc_slice_permission_title" msgid="4175332421259324948">"Allow <xliff:g id="APP_0">%1$s</xliff:g> to show <xliff:g id="APP_2">%2$s</xliff:g> slices?"</string>
- <string name="abc_slice_permission_text_1" msgid="4525743640399572811">"– It can read information from <xliff:g id="APP">%1$s</xliff:g>"</string>
- <string name="abc_slice_permission_text_2" msgid="7323565634860251794">"– It can take actions inside <xliff:g id="APP">%1$s</xliff:g>"</string>
- <string name="abc_slice_permission_allow" msgid="5024599872061409708">"Allow"</string>
- <string name="abc_slice_permission_deny" msgid="3819478292430407705">"Deny"</string>
+ <string name="abc_slices_permission_request" msgid="4431189529265983653">"<xliff:g id="APP_0">%1$s</xliff:g> wants to show <xliff:g id="APP_2">%2$s</xliff:g> slices"</string>
+ <string name="abc_slice_permission_title" msgid="4776010267128891014">"Allow <xliff:g id="APP_0">%1$s</xliff:g> to show <xliff:g id="APP_2">%2$s</xliff:g> slices?"</string>
+ <string name="abc_slice_permission_text_1" msgid="9108592981418900836">"- It can read information from <xliff:g id="APP">%1$s</xliff:g>"</string>
+ <string name="abc_slice_permission_text_2" msgid="7135705417979137589">"- It can take actions inside <xliff:g id="APP">%1$s</xliff:g>"</string>
+ <string name="abc_slice_permission_allow" msgid="6374752258872407887">"Allow"</string>
+ <string name="abc_slice_permission_deny" msgid="576316744017426251">"Deny"</string>
</resources>
diff --git a/slice/slice-core/src/main/res/values-en-rGB/strings.xml b/slice/slice-core/src/main/res/values-en-rGB/strings.xml
index 753ea3e..f097b2c 100644
--- a/slice/slice-core/src/main/res/values-en-rGB/strings.xml
+++ b/slice/slice-core/src/main/res/values-en-rGB/strings.xml
@@ -17,10 +17,10 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slices_permission_request" msgid="3604847235923472451">"<xliff:g id="APP_0">%1$s</xliff:g> wants to show <xliff:g id="APP_2">%2$s</xliff:g> slices"</string>
- <string name="abc_slice_permission_title" msgid="4175332421259324948">"Allow <xliff:g id="APP_0">%1$s</xliff:g> to show <xliff:g id="APP_2">%2$s</xliff:g> slices?"</string>
- <string name="abc_slice_permission_text_1" msgid="4525743640399572811">"– It can read information from <xliff:g id="APP">%1$s</xliff:g>"</string>
- <string name="abc_slice_permission_text_2" msgid="7323565634860251794">"– It can take actions inside <xliff:g id="APP">%1$s</xliff:g>"</string>
- <string name="abc_slice_permission_allow" msgid="5024599872061409708">"Allow"</string>
- <string name="abc_slice_permission_deny" msgid="3819478292430407705">"Deny"</string>
+ <string name="abc_slices_permission_request" msgid="4431189529265983653">"<xliff:g id="APP_0">%1$s</xliff:g> wants to show <xliff:g id="APP_2">%2$s</xliff:g> slices"</string>
+ <string name="abc_slice_permission_title" msgid="4776010267128891014">"Allow <xliff:g id="APP_0">%1$s</xliff:g> to show <xliff:g id="APP_2">%2$s</xliff:g> slices?"</string>
+ <string name="abc_slice_permission_text_1" msgid="9108592981418900836">"- It can read information from <xliff:g id="APP">%1$s</xliff:g>"</string>
+ <string name="abc_slice_permission_text_2" msgid="7135705417979137589">"- It can take actions inside <xliff:g id="APP">%1$s</xliff:g>"</string>
+ <string name="abc_slice_permission_allow" msgid="6374752258872407887">"Allow"</string>
+ <string name="abc_slice_permission_deny" msgid="576316744017426251">"Deny"</string>
</resources>
diff --git a/slice/slice-core/src/main/res/values-en-rIN/strings.xml b/slice/slice-core/src/main/res/values-en-rIN/strings.xml
index 753ea3e..f097b2c 100644
--- a/slice/slice-core/src/main/res/values-en-rIN/strings.xml
+++ b/slice/slice-core/src/main/res/values-en-rIN/strings.xml
@@ -17,10 +17,10 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slices_permission_request" msgid="3604847235923472451">"<xliff:g id="APP_0">%1$s</xliff:g> wants to show <xliff:g id="APP_2">%2$s</xliff:g> slices"</string>
- <string name="abc_slice_permission_title" msgid="4175332421259324948">"Allow <xliff:g id="APP_0">%1$s</xliff:g> to show <xliff:g id="APP_2">%2$s</xliff:g> slices?"</string>
- <string name="abc_slice_permission_text_1" msgid="4525743640399572811">"– It can read information from <xliff:g id="APP">%1$s</xliff:g>"</string>
- <string name="abc_slice_permission_text_2" msgid="7323565634860251794">"– It can take actions inside <xliff:g id="APP">%1$s</xliff:g>"</string>
- <string name="abc_slice_permission_allow" msgid="5024599872061409708">"Allow"</string>
- <string name="abc_slice_permission_deny" msgid="3819478292430407705">"Deny"</string>
+ <string name="abc_slices_permission_request" msgid="4431189529265983653">"<xliff:g id="APP_0">%1$s</xliff:g> wants to show <xliff:g id="APP_2">%2$s</xliff:g> slices"</string>
+ <string name="abc_slice_permission_title" msgid="4776010267128891014">"Allow <xliff:g id="APP_0">%1$s</xliff:g> to show <xliff:g id="APP_2">%2$s</xliff:g> slices?"</string>
+ <string name="abc_slice_permission_text_1" msgid="9108592981418900836">"- It can read information from <xliff:g id="APP">%1$s</xliff:g>"</string>
+ <string name="abc_slice_permission_text_2" msgid="7135705417979137589">"- It can take actions inside <xliff:g id="APP">%1$s</xliff:g>"</string>
+ <string name="abc_slice_permission_allow" msgid="6374752258872407887">"Allow"</string>
+ <string name="abc_slice_permission_deny" msgid="576316744017426251">"Deny"</string>
</resources>
diff --git a/slice/slice-core/src/main/res/values-en-rXC/strings.xml b/slice/slice-core/src/main/res/values-en-rXC/strings.xml
index 22c86bc..a2e0aaa 100644
--- a/slice/slice-core/src/main/res/values-en-rXC/strings.xml
+++ b/slice/slice-core/src/main/res/values-en-rXC/strings.xml
@@ -17,10 +17,10 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slices_permission_request" msgid="3604847235923472451">"<xliff:g id="APP_0">%1$s</xliff:g> wants to show <xliff:g id="APP_2">%2$s</xliff:g> slices"</string>
- <string name="abc_slice_permission_title" msgid="4175332421259324948">"Allow <xliff:g id="APP_0">%1$s</xliff:g> to show <xliff:g id="APP_2">%2$s</xliff:g> slices?"</string>
- <string name="abc_slice_permission_text_1" msgid="4525743640399572811">"- It can read information from <xliff:g id="APP">%1$s</xliff:g>"</string>
- <string name="abc_slice_permission_text_2" msgid="7323565634860251794">"- It can take actions inside <xliff:g id="APP">%1$s</xliff:g>"</string>
- <string name="abc_slice_permission_allow" msgid="5024599872061409708">"Allow"</string>
- <string name="abc_slice_permission_deny" msgid="3819478292430407705">"Deny"</string>
+ <string name="abc_slices_permission_request" msgid="4431189529265983653">"<xliff:g id="APP_0">%1$s</xliff:g> wants to show <xliff:g id="APP_2">%2$s</xliff:g> slices"</string>
+ <string name="abc_slice_permission_title" msgid="4776010267128891014">"Allow <xliff:g id="APP_0">%1$s</xliff:g> to show <xliff:g id="APP_2">%2$s</xliff:g> slices?"</string>
+ <string name="abc_slice_permission_text_1" msgid="9108592981418900836">"- It can read information from <xliff:g id="APP">%1$s</xliff:g>"</string>
+ <string name="abc_slice_permission_text_2" msgid="7135705417979137589">"- It can take actions inside <xliff:g id="APP">%1$s</xliff:g>"</string>
+ <string name="abc_slice_permission_allow" msgid="6374752258872407887">"Allow"</string>
+ <string name="abc_slice_permission_deny" msgid="576316744017426251">"Deny"</string>
</resources>
diff --git a/slice/slice-core/src/main/res/values-es-rUS/strings.xml b/slice/slice-core/src/main/res/values-es-rUS/strings.xml
index d004921..245d037 100644
--- a/slice/slice-core/src/main/res/values-es-rUS/strings.xml
+++ b/slice/slice-core/src/main/res/values-es-rUS/strings.xml
@@ -17,10 +17,10 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slices_permission_request" msgid="3604847235923472451">"<xliff:g id="APP_0">%1$s</xliff:g> quiere mostrar fragmentos de <xliff:g id="APP_2">%2$s</xliff:g>"</string>
- <string name="abc_slice_permission_title" msgid="4175332421259324948">"¿Permitir que <xliff:g id="APP_0">%1$s</xliff:g> muestre fragmentos de <xliff:g id="APP_2">%2$s</xliff:g>?"</string>
- <string name="abc_slice_permission_text_1" msgid="4525743640399572811">"- Puede leer información de <xliff:g id="APP">%1$s</xliff:g>"</string>
- <string name="abc_slice_permission_text_2" msgid="7323565634860251794">"- Puede realizar acciones en <xliff:g id="APP">%1$s</xliff:g>"</string>
- <string name="abc_slice_permission_allow" msgid="5024599872061409708">"Permitir"</string>
- <string name="abc_slice_permission_deny" msgid="3819478292430407705">"Rechazar"</string>
+ <string name="abc_slices_permission_request" msgid="4431189529265983653">"<xliff:g id="APP_0">%1$s</xliff:g> quiere mostrar slices de <xliff:g id="APP_2">%2$s</xliff:g>"</string>
+ <string name="abc_slice_permission_title" msgid="4776010267128891014">"¿Deseas permitir que <xliff:g id="APP_0">%1$s</xliff:g> muestre slices de <xliff:g id="APP_2">%2$s</xliff:g>?"</string>
+ <string name="abc_slice_permission_text_1" msgid="9108592981418900836">"- Puede leer información de <xliff:g id="APP">%1$s</xliff:g>"</string>
+ <string name="abc_slice_permission_text_2" msgid="7135705417979137589">"- Puede realizar acciones en <xliff:g id="APP">%1$s</xliff:g>"</string>
+ <string name="abc_slice_permission_allow" msgid="6374752258872407887">"Permitir"</string>
+ <string name="abc_slice_permission_deny" msgid="576316744017426251">"Rechazar"</string>
</resources>
diff --git a/slice/slice-core/src/main/res/values-es/strings.xml b/slice/slice-core/src/main/res/values-es/strings.xml
index cdd8514..6a4d83a 100644
--- a/slice/slice-core/src/main/res/values-es/strings.xml
+++ b/slice/slice-core/src/main/res/values-es/strings.xml
@@ -17,10 +17,10 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slices_permission_request" msgid="3604847235923472451">"<xliff:g id="APP_0">%1$s</xliff:g> quiere mostrar fragmentos de <xliff:g id="APP_2">%2$s</xliff:g>"</string>
- <string name="abc_slice_permission_title" msgid="4175332421259324948">"¿Permitir que <xliff:g id="APP_0">%1$s</xliff:g> muestre fragmentos de <xliff:g id="APP_2">%2$s</xliff:g>?"</string>
- <string name="abc_slice_permission_text_1" msgid="4525743640399572811">"- Puede leer información de <xliff:g id="APP">%1$s</xliff:g>"</string>
- <string name="abc_slice_permission_text_2" msgid="7323565634860251794">"- Puede realizar acciones en <xliff:g id="APP">%1$s</xliff:g>"</string>
- <string name="abc_slice_permission_allow" msgid="5024599872061409708">"Permitir"</string>
- <string name="abc_slice_permission_deny" msgid="3819478292430407705">"Denegar"</string>
+ <string name="abc_slices_permission_request" msgid="4431189529265983653">"<xliff:g id="APP_0">%1$s</xliff:g> quiere mostrar fragmentos de <xliff:g id="APP_2">%2$s</xliff:g>"</string>
+ <string name="abc_slice_permission_title" msgid="4776010267128891014">"¿Permitir que <xliff:g id="APP_0">%1$s</xliff:g> muestre fragmentos de <xliff:g id="APP_2">%2$s</xliff:g>?"</string>
+ <string name="abc_slice_permission_text_1" msgid="9108592981418900836">"- Puede leer información de <xliff:g id="APP">%1$s</xliff:g>"</string>
+ <string name="abc_slice_permission_text_2" msgid="7135705417979137589">"- Puede realizar acciones en <xliff:g id="APP">%1$s</xliff:g>"</string>
+ <string name="abc_slice_permission_allow" msgid="6374752258872407887">"Permitir"</string>
+ <string name="abc_slice_permission_deny" msgid="576316744017426251">"Denegar"</string>
</resources>
diff --git a/slice/slice-core/src/main/res/values-et/strings.xml b/slice/slice-core/src/main/res/values-et/strings.xml
index 7d92095..f2e9926 100644
--- a/slice/slice-core/src/main/res/values-et/strings.xml
+++ b/slice/slice-core/src/main/res/values-et/strings.xml
@@ -17,10 +17,10 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slices_permission_request" msgid="3604847235923472451">"Rakendus <xliff:g id="APP_0">%1$s</xliff:g> soovib näidata rakenduse <xliff:g id="APP_2">%2$s</xliff:g> lõike"</string>
- <string name="abc_slice_permission_title" msgid="4175332421259324948">"Kas lubada rakendusel <xliff:g id="APP_0">%1$s</xliff:g> näidata rakenduse <xliff:g id="APP_2">%2$s</xliff:g> lõike?"</string>
- <string name="abc_slice_permission_text_1" msgid="4525743640399572811">"- See saab lugeda teavet rakendusest <xliff:g id="APP">%1$s</xliff:g>"</string>
- <string name="abc_slice_permission_text_2" msgid="7323565634860251794">"- See saab rakenduses <xliff:g id="APP">%1$s</xliff:g> toiminguid teha"</string>
- <string name="abc_slice_permission_allow" msgid="5024599872061409708">"Lubamine"</string>
- <string name="abc_slice_permission_deny" msgid="3819478292430407705">"Keelamine"</string>
+ <string name="abc_slices_permission_request" msgid="4431189529265983653">"Rakendus <xliff:g id="APP_0">%1$s</xliff:g> soovib rakenduse <xliff:g id="APP_2">%2$s</xliff:g> lõike näidata"</string>
+ <string name="abc_slice_permission_title" msgid="4776010267128891014">"Kas lubada rakendusel <xliff:g id="APP_0">%1$s</xliff:g> rakenduse <xliff:g id="APP_2">%2$s</xliff:g> lõike näidata?"</string>
+ <string name="abc_slice_permission_text_1" msgid="9108592981418900836">"- See saab rakendusest <xliff:g id="APP">%1$s</xliff:g> teavet lugeda"</string>
+ <string name="abc_slice_permission_text_2" msgid="7135705417979137589">"- See saab rakenduses <xliff:g id="APP">%1$s</xliff:g> toiminguid teha"</string>
+ <string name="abc_slice_permission_allow" msgid="6374752258872407887">"Luba"</string>
+ <string name="abc_slice_permission_deny" msgid="576316744017426251">"Keela"</string>
</resources>
diff --git a/slice/slice-core/src/main/res/values-eu/strings.xml b/slice/slice-core/src/main/res/values-eu/strings.xml
index 785f447..537ad54 100644
--- a/slice/slice-core/src/main/res/values-eu/strings.xml
+++ b/slice/slice-core/src/main/res/values-eu/strings.xml
@@ -17,10 +17,10 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slices_permission_request" msgid="3604847235923472451">"<xliff:g id="APP_0">%1$s</xliff:g> aplikazioak <xliff:g id="APP_2">%2$s</xliff:g> aplikazioaren zatiak erakutsi nahi ditu"</string>
- <string name="abc_slice_permission_title" msgid="4175332421259324948">"<xliff:g id="APP_2">%2$s</xliff:g> aplikazioaren zatiak erakusteko baimena eman nahi diozu <xliff:g id="APP_0">%1$s</xliff:g> aplikazioari?"</string>
- <string name="abc_slice_permission_text_1" msgid="4525743640399572811">"- <xliff:g id="APP">%1$s</xliff:g> aplikazioaren informazioa irakur dezake."</string>
- <string name="abc_slice_permission_text_2" msgid="7323565634860251794">"- <xliff:g id="APP">%1$s</xliff:g> aplikazioan ekintzak gauza ditzake."</string>
- <string name="abc_slice_permission_allow" msgid="5024599872061409708">"Eman baimena"</string>
- <string name="abc_slice_permission_deny" msgid="3819478292430407705">"Ukatu"</string>
+ <string name="abc_slices_permission_request" msgid="4431189529265983653">"<xliff:g id="APP_0">%1$s</xliff:g> aplikazioak <xliff:g id="APP_2">%2$s</xliff:g> aplikazioaren zatiak erakutsi nahi ditu"</string>
+ <string name="abc_slice_permission_title" msgid="4776010267128891014">"<xliff:g id="APP_2">%2$s</xliff:g> aplikazioaren zatiak erakusteko baimena eman nahi diozu <xliff:g id="APP_0">%1$s</xliff:g> aplikazioari?"</string>
+ <string name="abc_slice_permission_text_1" msgid="9108592981418900836">"- <xliff:g id="APP">%1$s</xliff:g> aplikazioko informazioa irakur dezake."</string>
+ <string name="abc_slice_permission_text_2" msgid="7135705417979137589">"- <xliff:g id="APP">%1$s</xliff:g> aplikazioan ekintzak gauza ditzake."</string>
+ <string name="abc_slice_permission_allow" msgid="6374752258872407887">"Eman baimena"</string>
+ <string name="abc_slice_permission_deny" msgid="576316744017426251">"Ukatu baimena"</string>
</resources>
diff --git a/slice/slice-core/src/main/res/values-fa/strings.xml b/slice/slice-core/src/main/res/values-fa/strings.xml
index 2abd384..c939a9d 100644
--- a/slice/slice-core/src/main/res/values-fa/strings.xml
+++ b/slice/slice-core/src/main/res/values-fa/strings.xml
@@ -17,10 +17,10 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slices_permission_request" msgid="3604847235923472451">"<xliff:g id="APP_0">%1$s</xliff:g> میخواهد تکههای <xliff:g id="APP_2">%2$s</xliff:g> را نشان دهد"</string>
- <string name="abc_slice_permission_title" msgid="4175332421259324948">"به <xliff:g id="APP_0">%1$s</xliff:g> اجازه داده شود تکههای <xliff:g id="APP_2">%2$s</xliff:g> را نشان دهد؟"</string>
- <string name="abc_slice_permission_text_1" msgid="4525743640399572811">"- میتواند اطلاعات <xliff:g id="APP">%1$s</xliff:g> را بخواند"</string>
- <string name="abc_slice_permission_text_2" msgid="7323565634860251794">"- میتواند در <xliff:g id="APP">%1$s</xliff:g> اقدام انجام دهد"</string>
- <string name="abc_slice_permission_allow" msgid="5024599872061409708">"مجاز بودن"</string>
- <string name="abc_slice_permission_deny" msgid="3819478292430407705">"مجاز نبودن"</string>
+ <string name="abc_slices_permission_request" msgid="4431189529265983653">"<xliff:g id="APP_0">%1$s</xliff:g> میخواهد تکههای <xliff:g id="APP_2">%2$s</xliff:g> را نشان دهد"</string>
+ <string name="abc_slice_permission_title" msgid="4776010267128891014">"به <xliff:g id="APP_0">%1$s</xliff:g> اجازه داده شود تکههای <xliff:g id="APP_2">%2$s</xliff:g> را نشان دهد؟"</string>
+ <string name="abc_slice_permission_text_1" msgid="9108592981418900836">"- میتواند اطلاعات <xliff:g id="APP">%1$s</xliff:g> را بخواند"</string>
+ <string name="abc_slice_permission_text_2" msgid="7135705417979137589">"- میتواند در <xliff:g id="APP">%1$s</xliff:g> اقدام انجام دهد"</string>
+ <string name="abc_slice_permission_allow" msgid="6374752258872407887">"اجازه دادن"</string>
+ <string name="abc_slice_permission_deny" msgid="576316744017426251">"رد کردن"</string>
</resources>
diff --git a/slice/slice-core/src/main/res/values-fi/strings.xml b/slice/slice-core/src/main/res/values-fi/strings.xml
index b826e98..55f78f2 100644
--- a/slice/slice-core/src/main/res/values-fi/strings.xml
+++ b/slice/slice-core/src/main/res/values-fi/strings.xml
@@ -17,10 +17,10 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slices_permission_request" msgid="3604847235923472451">"<xliff:g id="APP_0">%1$s</xliff:g> haluaa näyttää osia sovelluksesta <xliff:g id="APP_2">%2$s</xliff:g>."</string>
- <string name="abc_slice_permission_title" msgid="4175332421259324948">"Saako <xliff:g id="APP_0">%1$s</xliff:g> näyttää osia sovelluksesta <xliff:g id="APP_2">%2$s</xliff:g>?"</string>
- <string name="abc_slice_permission_text_1" msgid="4525743640399572811">"– Se voi lukea tietoja sovelluksesta <xliff:g id="APP">%1$s</xliff:g>."</string>
- <string name="abc_slice_permission_text_2" msgid="7323565634860251794">"– Se voi suorittaa toimintoja sovelluksessa <xliff:g id="APP">%1$s</xliff:g>."</string>
- <string name="abc_slice_permission_allow" msgid="5024599872061409708">"Salli"</string>
- <string name="abc_slice_permission_deny" msgid="3819478292430407705">"Estä"</string>
+ <string name="abc_slices_permission_request" msgid="4431189529265983653">"<xliff:g id="APP_0">%1$s</xliff:g> haluaa näyttää osia sovelluksesta <xliff:g id="APP_2">%2$s</xliff:g>."</string>
+ <string name="abc_slice_permission_title" msgid="4776010267128891014">"Saako <xliff:g id="APP_0">%1$s</xliff:g> näyttää osia sovelluksesta <xliff:g id="APP_2">%2$s</xliff:g>?"</string>
+ <string name="abc_slice_permission_text_1" msgid="9108592981418900836">"– Se voi lukea tietoja: <xliff:g id="APP">%1$s</xliff:g>."</string>
+ <string name="abc_slice_permission_text_2" msgid="7135705417979137589">"– Se voi suorittaa toimintoja: <xliff:g id="APP">%1$s</xliff:g>."</string>
+ <string name="abc_slice_permission_allow" msgid="6374752258872407887">"Salli"</string>
+ <string name="abc_slice_permission_deny" msgid="576316744017426251">"Estä"</string>
</resources>
diff --git a/slice/slice-core/src/main/res/values-fr-rCA/strings.xml b/slice/slice-core/src/main/res/values-fr-rCA/strings.xml
index a5d3fd0..65e3269 100644
--- a/slice/slice-core/src/main/res/values-fr-rCA/strings.xml
+++ b/slice/slice-core/src/main/res/values-fr-rCA/strings.xml
@@ -17,10 +17,10 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slices_permission_request" msgid="3604847235923472451">"<xliff:g id="APP_0">%1$s</xliff:g> souhaite afficher <xliff:g id="APP_2">%2$s</xliff:g> tranches"</string>
- <string name="abc_slice_permission_title" msgid="4175332421259324948">"Autoriser <xliff:g id="APP_0">%1$s</xliff:g> à afficher <xliff:g id="APP_2">%2$s</xliff:g> tranches?"</string>
- <string name="abc_slice_permission_text_1" msgid="4525743640399572811">"- Il peut lire de l\'information de <xliff:g id="APP">%1$s</xliff:g>"</string>
- <string name="abc_slice_permission_text_2" msgid="7323565634860251794">"- Il peut effectuer des actions dans <xliff:g id="APP">%1$s</xliff:g>"</string>
- <string name="abc_slice_permission_allow" msgid="5024599872061409708">"Autoriser"</string>
- <string name="abc_slice_permission_deny" msgid="3819478292430407705">"Refuser"</string>
+ <string name="abc_slices_permission_request" msgid="4431189529265983653">"<xliff:g id="APP_0">%1$s</xliff:g> veut afficher les tranches de <xliff:g id="APP_2">%2$s</xliff:g>"</string>
+ <string name="abc_slice_permission_title" msgid="4776010267128891014">"Autoriser <xliff:g id="APP_0">%1$s</xliff:g> à afficher les tranches de <xliff:g id="APP_2">%2$s</xliff:g>?"</string>
+ <string name="abc_slice_permission_text_1" msgid="9108592981418900836">"- Il peut lire de l\'information de <xliff:g id="APP">%1$s</xliff:g>"</string>
+ <string name="abc_slice_permission_text_2" msgid="7135705417979137589">"- Il peut effectuer des actions dans <xliff:g id="APP">%1$s</xliff:g>"</string>
+ <string name="abc_slice_permission_allow" msgid="6374752258872407887">"Autoriser"</string>
+ <string name="abc_slice_permission_deny" msgid="576316744017426251">"Refuser"</string>
</resources>
diff --git a/slice/slice-core/src/main/res/values-fr/strings.xml b/slice/slice-core/src/main/res/values-fr/strings.xml
index 724da28..31a7294 100644
--- a/slice/slice-core/src/main/res/values-fr/strings.xml
+++ b/slice/slice-core/src/main/res/values-fr/strings.xml
@@ -17,10 +17,10 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slices_permission_request" msgid="3604847235923472451">"<xliff:g id="APP_0">%1$s</xliff:g> souhaite afficher des éléments de <xliff:g id="APP_2">%2$s</xliff:g>"</string>
- <string name="abc_slice_permission_title" msgid="4175332421259324948">"Autoriser <xliff:g id="APP_0">%1$s</xliff:g> à afficher des éléments de <xliff:g id="APP_2">%2$s</xliff:g> ?"</string>
- <string name="abc_slice_permission_text_1" msgid="4525743640399572811">"- Accès aux informations de <xliff:g id="APP">%1$s</xliff:g>"</string>
- <string name="abc_slice_permission_text_2" msgid="7323565634860251794">"- Capacité d\'action dans <xliff:g id="APP">%1$s</xliff:g>"</string>
- <string name="abc_slice_permission_allow" msgid="5024599872061409708">"Autoriser"</string>
- <string name="abc_slice_permission_deny" msgid="3819478292430407705">"Refuser"</string>
+ <string name="abc_slices_permission_request" msgid="4431189529265983653">"<xliff:g id="APP_0">%1$s</xliff:g> souhaite afficher des segments de l\'appli <xliff:g id="APP_2">%2$s</xliff:g>"</string>
+ <string name="abc_slice_permission_title" msgid="4776010267128891014">"Autoriser <xliff:g id="APP_0">%1$s</xliff:g> à afficher des segments de l\'appli <xliff:g id="APP_2">%2$s</xliff:g> ?"</string>
+ <string name="abc_slice_permission_text_1" msgid="9108592981418900836">"- Accès en lecture aux informations de <xliff:g id="APP">%1$s</xliff:g>"</string>
+ <string name="abc_slice_permission_text_2" msgid="7135705417979137589">"- Capacité d\'action dans <xliff:g id="APP">%1$s</xliff:g>"</string>
+ <string name="abc_slice_permission_allow" msgid="6374752258872407887">"Autoriser"</string>
+ <string name="abc_slice_permission_deny" msgid="576316744017426251">"Refuser"</string>
</resources>
diff --git a/slice/slice-core/src/main/res/values-gl/strings.xml b/slice/slice-core/src/main/res/values-gl/strings.xml
index 5ef1215..32e6ede 100644
--- a/slice/slice-core/src/main/res/values-gl/strings.xml
+++ b/slice/slice-core/src/main/res/values-gl/strings.xml
@@ -17,10 +17,10 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slices_permission_request" msgid="3604847235923472451">"<xliff:g id="APP_0">%1$s</xliff:g> quere mostrar fragmentos de aplicación de <xliff:g id="APP_2">%2$s</xliff:g>"</string>
- <string name="abc_slice_permission_title" msgid="4175332421259324948">"Queres permitir que <xliff:g id="APP_0">%1$s</xliff:g> mostre fragmentos de aplicación de <xliff:g id="APP_2">%2$s</xliff:g>?"</string>
- <string name="abc_slice_permission_text_1" msgid="4525743640399572811">"- Pode ler información da aplicación <xliff:g id="APP">%1$s</xliff:g>"</string>
- <string name="abc_slice_permission_text_2" msgid="7323565634860251794">"- Pode levar a cabo accións dentro da aplicación <xliff:g id="APP">%1$s</xliff:g>"</string>
- <string name="abc_slice_permission_allow" msgid="5024599872061409708">"Permitir"</string>
- <string name="abc_slice_permission_deny" msgid="3819478292430407705">"Denegar"</string>
+ <string name="abc_slices_permission_request" msgid="4431189529265983653">"<xliff:g id="APP_0">%1$s</xliff:g> quere mostrar fragmentos de aplicación de <xliff:g id="APP_2">%2$s</xliff:g>"</string>
+ <string name="abc_slice_permission_title" msgid="4776010267128891014">"Queres permitir que <xliff:g id="APP_0">%1$s</xliff:g> mostre fragmentos de aplicación de <xliff:g id="APP_2">%2$s</xliff:g>?"</string>
+ <string name="abc_slice_permission_text_1" msgid="9108592981418900836">"- Pode ler información da aplicación <xliff:g id="APP">%1$s</xliff:g>"</string>
+ <string name="abc_slice_permission_text_2" msgid="7135705417979137589">"- Pode levar a cabo accións dentro da aplicación <xliff:g id="APP">%1$s</xliff:g>"</string>
+ <string name="abc_slice_permission_allow" msgid="6374752258872407887">"Permitir"</string>
+ <string name="abc_slice_permission_deny" msgid="576316744017426251">"Denegar"</string>
</resources>
diff --git a/slice/slice-core/src/main/res/values-gu/strings.xml b/slice/slice-core/src/main/res/values-gu/strings.xml
index 9b8f733..d133fb6 100644
--- a/slice/slice-core/src/main/res/values-gu/strings.xml
+++ b/slice/slice-core/src/main/res/values-gu/strings.xml
@@ -17,10 +17,10 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slices_permission_request" msgid="3604847235923472451">"<xliff:g id="APP_0">%1$s</xliff:g> <xliff:g id="APP_2">%2$s</xliff:g> સ્લાઇસ બતાવવા માગે છે"</string>
- <string name="abc_slice_permission_title" msgid="4175332421259324948">"<xliff:g id="APP_0">%1$s</xliff:g>ને <xliff:g id="APP_2">%2$s</xliff:g> સ્લાઇસ બતાવવાની મંજૂરી આપીએ?"</string>
- <string name="abc_slice_permission_text_1" msgid="4525743640399572811">"- તે <xliff:g id="APP">%1$s</xliff:g>માંથી માહિતી વાંચી શકે છે"</string>
- <string name="abc_slice_permission_text_2" msgid="7323565634860251794">"- તે <xliff:g id="APP">%1$s</xliff:g>ની અંદર ક્રિયાઓ કરી શકે છે"</string>
- <string name="abc_slice_permission_allow" msgid="5024599872061409708">"મંજૂરી આપો"</string>
- <string name="abc_slice_permission_deny" msgid="3819478292430407705">"નકારો"</string>
+ <string name="abc_slices_permission_request" msgid="4431189529265983653">"<xliff:g id="APP_0">%1$s</xliff:g>, <xliff:g id="APP_2">%2$s</xliff:g> સ્લાઇસ બતાવવા માગે છે"</string>
+ <string name="abc_slice_permission_title" msgid="4776010267128891014">"<xliff:g id="APP_0">%1$s</xliff:g>ને <xliff:g id="APP_2">%2$s</xliff:g> સ્લાઇસ બતાવવાની મંજૂરી આપીએ?"</string>
+ <string name="abc_slice_permission_text_1" msgid="9108592981418900836">"- તે <xliff:g id="APP">%1$s</xliff:g>માંથી માહિતી વાંચી શકે છે"</string>
+ <string name="abc_slice_permission_text_2" msgid="7135705417979137589">"- તે <xliff:g id="APP">%1$s</xliff:g>ની અંદર ક્રિયાઓ કરી શકે છે"</string>
+ <string name="abc_slice_permission_allow" msgid="6374752258872407887">"મંજૂરી આપો"</string>
+ <string name="abc_slice_permission_deny" msgid="576316744017426251">"નકારો"</string>
</resources>
diff --git a/slice/slice-core/src/main/res/values-hi/strings.xml b/slice/slice-core/src/main/res/values-hi/strings.xml
index f5215cb..2817371 100644
--- a/slice/slice-core/src/main/res/values-hi/strings.xml
+++ b/slice/slice-core/src/main/res/values-hi/strings.xml
@@ -17,10 +17,10 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slices_permission_request" msgid="3604847235923472451">"<xliff:g id="APP_0">%1$s</xliff:g>, <xliff:g id="APP_2">%2$s</xliff:g> के हिस्से (स्लाइस) दिखाना चाहता है"</string>
- <string name="abc_slice_permission_title" msgid="4175332421259324948">"<xliff:g id="APP_0">%1$s</xliff:g> को <xliff:g id="APP_2">%2$s</xliff:g> के हिस्से (स्लाइस) दिखाने की मंज़ूरी दें?"</string>
- <string name="abc_slice_permission_text_1" msgid="4525743640399572811">"- यह <xliff:g id="APP">%1$s</xliff:g> से जानकारी पा सकता है"</string>
- <string name="abc_slice_permission_text_2" msgid="7323565634860251794">"- यह <xliff:g id="APP">%1$s</xliff:g> में कार्रवाई कर सकता है"</string>
- <string name="abc_slice_permission_allow" msgid="5024599872061409708">"अनुमति दें"</string>
- <string name="abc_slice_permission_deny" msgid="3819478292430407705">"अनुमति न दें"</string>
+ <string name="abc_slices_permission_request" msgid="4431189529265983653">"<xliff:g id="APP_0">%1$s</xliff:g>, <xliff:g id="APP_2">%2$s</xliff:g> के स्लाइस दिखाना चाहता है"</string>
+ <string name="abc_slice_permission_title" msgid="4776010267128891014">"क्या आप <xliff:g id="APP_0">%1$s</xliff:g> को <xliff:g id="APP_2">%2$s</xliff:g> के स्लाइस दिखाने की अनुमति देना चाहते हैं?"</string>
+ <string name="abc_slice_permission_text_1" msgid="9108592981418900836">"- यह <xliff:g id="APP">%1$s</xliff:g> से जानकारी पा सकता है"</string>
+ <string name="abc_slice_permission_text_2" msgid="7135705417979137589">"- यह <xliff:g id="APP">%1$s</xliff:g> में कार्रवाइयां कर सकता है"</string>
+ <string name="abc_slice_permission_allow" msgid="6374752258872407887">"अनुमति दें"</string>
+ <string name="abc_slice_permission_deny" msgid="576316744017426251">"अनुमति न दें"</string>
</resources>
diff --git a/slice/slice-core/src/main/res/values-hr/strings.xml b/slice/slice-core/src/main/res/values-hr/strings.xml
index b7980bd..645c97f 100644
--- a/slice/slice-core/src/main/res/values-hr/strings.xml
+++ b/slice/slice-core/src/main/res/values-hr/strings.xml
@@ -17,10 +17,10 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slices_permission_request" msgid="3604847235923472451">"<xliff:g id="APP_0">%1$s</xliff:g> želi prikazivati isječke aplikacije <xliff:g id="APP_2">%2$s</xliff:g>"</string>
- <string name="abc_slice_permission_title" msgid="4175332421259324948">"Želite li dopustiti aplikaciji <xliff:g id="APP_0">%1$s</xliff:g> da prikazuje isječke aplikacije <xliff:g id="APP_2">%2$s</xliff:g>?"</string>
- <string name="abc_slice_permission_text_1" msgid="4525743640399572811">"– može čitati informacije aplikacije <xliff:g id="APP">%1$s</xliff:g>"</string>
- <string name="abc_slice_permission_text_2" msgid="7323565634860251794">"– može vršiti radnje u aplikaciji <xliff:g id="APP">%1$s</xliff:g>"</string>
- <string name="abc_slice_permission_allow" msgid="5024599872061409708">"Dopusti"</string>
- <string name="abc_slice_permission_deny" msgid="3819478292430407705">"Odbij"</string>
+ <string name="abc_slices_permission_request" msgid="4431189529265983653">"<xliff:g id="APP_0">%1$s</xliff:g> želi prikazivati isječke aplikacije <xliff:g id="APP_2">%2$s</xliff:g>"</string>
+ <string name="abc_slice_permission_title" msgid="4776010267128891014">"Želite li dopustiti aplikaciji <xliff:g id="APP_0">%1$s</xliff:g> da prikazuje isječke aplikacije <xliff:g id="APP_2">%2$s</xliff:g>?"</string>
+ <string name="abc_slice_permission_text_1" msgid="9108592981418900836">"– može čitati podatke aplikacije <xliff:g id="APP">%1$s</xliff:g>"</string>
+ <string name="abc_slice_permission_text_2" msgid="7135705417979137589">"– može vršiti radnje u aplikaciji <xliff:g id="APP">%1$s</xliff:g>"</string>
+ <string name="abc_slice_permission_allow" msgid="6374752258872407887">"Dopusti"</string>
+ <string name="abc_slice_permission_deny" msgid="576316744017426251">"Odbij"</string>
</resources>
diff --git a/slice/slice-core/src/main/res/values-hu/strings.xml b/slice/slice-core/src/main/res/values-hu/strings.xml
index 89b800c..606e707 100644
--- a/slice/slice-core/src/main/res/values-hu/strings.xml
+++ b/slice/slice-core/src/main/res/values-hu/strings.xml
@@ -17,10 +17,10 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slices_permission_request" msgid="3604847235923472451">"A(z) <xliff:g id="APP_0">%1$s</xliff:g> alkalmazás részleteket szeretne megjeleníteni a(z) <xliff:g id="APP_2">%2$s</xliff:g> alkalmazásból"</string>
- <string name="abc_slice_permission_title" msgid="4175332421259324948">"Engedélyezi a(z) <xliff:g id="APP_0">%1$s</xliff:g> alkalmazásnak, hogy részleteket mutasson a(z) <xliff:g id="APP_2">%2$s</xliff:g> alkalmazásból?"</string>
- <string name="abc_slice_permission_text_1" msgid="4525743640399572811">"– Információkat olvashat a(z) <xliff:g id="APP">%1$s</xliff:g> alkalmazásból"</string>
- <string name="abc_slice_permission_text_2" msgid="7323565634860251794">"– Műveleteket végezhet a(z) <xliff:g id="APP">%1$s</xliff:g> alkalmazáson belül"</string>
- <string name="abc_slice_permission_allow" msgid="5024599872061409708">"Engedélyezés"</string>
- <string name="abc_slice_permission_deny" msgid="3819478292430407705">"Elutasítás"</string>
+ <string name="abc_slices_permission_request" msgid="4431189529265983653">"A(z) <xliff:g id="APP_0">%1$s</xliff:g> alkalmazás részleteket szeretne megjeleníteni a(z) <xliff:g id="APP_2">%2$s</xliff:g> alkalmazásból"</string>
+ <string name="abc_slice_permission_title" msgid="4776010267128891014">"Engedélyezi a(z) <xliff:g id="APP_0">%1$s</xliff:g> alkalmazásnak, hogy részleteket mutasson a(z) <xliff:g id="APP_2">%2$s</xliff:g> alkalmazásból?"</string>
+ <string name="abc_slice_permission_text_1" msgid="9108592981418900836">"– Információkat olvashat a(z) <xliff:g id="APP">%1$s</xliff:g> alkalmazásból"</string>
+ <string name="abc_slice_permission_text_2" msgid="7135705417979137589">"– Műveleteket végezhet a(z) <xliff:g id="APP">%1$s</xliff:g> alkalmazáson belül"</string>
+ <string name="abc_slice_permission_allow" msgid="6374752258872407887">"Engedélyezés"</string>
+ <string name="abc_slice_permission_deny" msgid="576316744017426251">"Elutasítás"</string>
</resources>
diff --git a/slice/slice-core/src/main/res/values-hy/strings.xml b/slice/slice-core/src/main/res/values-hy/strings.xml
index 2512ee9..6b21058 100644
--- a/slice/slice-core/src/main/res/values-hy/strings.xml
+++ b/slice/slice-core/src/main/res/values-hy/strings.xml
@@ -17,10 +17,10 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slices_permission_request" msgid="3604847235923472451">"<xliff:g id="APP_0">%1$s</xliff:g> հավելվածն ուզում է ցուցադրել հատվածներ <xliff:g id="APP_2">%2$s</xliff:g> հավելվածից"</string>
- <string name="abc_slice_permission_title" msgid="4175332421259324948">"Թույլատրե՞լ <xliff:g id="APP_0">%1$s</xliff:g> հավելվածին ցուցադրել հատվածներ <xliff:g id="APP_2">%2$s</xliff:g> հավելվածից"</string>
- <string name="abc_slice_permission_text_1" msgid="4525743640399572811">"– Կարող է կարդալ տեղեկություններ <xliff:g id="APP">%1$s</xliff:g> հավելվածից"</string>
- <string name="abc_slice_permission_text_2" msgid="7323565634860251794">"– Կարող է կատարել գործողություններ <xliff:g id="APP">%1$s</xliff:g> հավելվածում"</string>
- <string name="abc_slice_permission_allow" msgid="5024599872061409708">"Թույլատրել"</string>
- <string name="abc_slice_permission_deny" msgid="3819478292430407705">"Մերժել"</string>
+ <string name="abc_slices_permission_request" msgid="4431189529265983653">"<xliff:g id="APP_0">%1$s</xliff:g> հավելվածն ուզում է ցուցադրել հատվածներ <xliff:g id="APP_2">%2$s</xliff:g> հավելվածից"</string>
+ <string name="abc_slice_permission_title" msgid="4776010267128891014">"Թույլատրե՞լ <xliff:g id="APP_0">%1$s</xliff:g> հավելվածին ցուցադրել հատվածներ <xliff:g id="APP_2">%2$s</xliff:g> հավելվածից"</string>
+ <string name="abc_slice_permission_text_1" msgid="9108592981418900836">"– Կարող է կարդալ տեղեկություններ <xliff:g id="APP">%1$s</xliff:g> հավելվածից"</string>
+ <string name="abc_slice_permission_text_2" msgid="7135705417979137589">"– Կարող է կատարել գործողություններ <xliff:g id="APP">%1$s</xliff:g> հավելվածում"</string>
+ <string name="abc_slice_permission_allow" msgid="6374752258872407887">"Թույլատրել"</string>
+ <string name="abc_slice_permission_deny" msgid="576316744017426251">"Մերժել"</string>
</resources>
diff --git a/slice/slice-core/src/main/res/values-in/strings.xml b/slice/slice-core/src/main/res/values-in/strings.xml
index 87afa02..b0678da 100644
--- a/slice/slice-core/src/main/res/values-in/strings.xml
+++ b/slice/slice-core/src/main/res/values-in/strings.xml
@@ -17,10 +17,10 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slices_permission_request" msgid="3604847235923472451">"<xliff:g id="APP_0">%1$s</xliff:g> ingin menampilkan potongan <xliff:g id="APP_2">%2$s</xliff:g>"</string>
- <string name="abc_slice_permission_title" msgid="4175332421259324948">"Izinkan <xliff:g id="APP_0">%1$s</xliff:g> menampilkan potongan <xliff:g id="APP_2">%2$s</xliff:g>?"</string>
- <string name="abc_slice_permission_text_1" msgid="4525743640399572811">"- Dapat membaca informasi dari <xliff:g id="APP">%1$s</xliff:g>"</string>
- <string name="abc_slice_permission_text_2" msgid="7323565634860251794">"- Dapat mengambil tindakan di dalam <xliff:g id="APP">%1$s</xliff:g>"</string>
- <string name="abc_slice_permission_allow" msgid="5024599872061409708">"Izinkan"</string>
- <string name="abc_slice_permission_deny" msgid="3819478292430407705">"Tolak"</string>
+ <string name="abc_slices_permission_request" msgid="4431189529265983653">"<xliff:g id="APP_0">%1$s</xliff:g> ingin menampilkan slice <xliff:g id="APP_2">%2$s</xliff:g>"</string>
+ <string name="abc_slice_permission_title" msgid="4776010267128891014">"Izinkan <xliff:g id="APP_0">%1$s</xliff:g> menampilkan slice <xliff:g id="APP_2">%2$s</xliff:g>?"</string>
+ <string name="abc_slice_permission_text_1" msgid="9108592981418900836">"- Dapat membaca informasi dari <xliff:g id="APP">%1$s</xliff:g>"</string>
+ <string name="abc_slice_permission_text_2" msgid="7135705417979137589">"- Dapat mengambil tindakan di dalam <xliff:g id="APP">%1$s</xliff:g>"</string>
+ <string name="abc_slice_permission_allow" msgid="6374752258872407887">"Izinkan"</string>
+ <string name="abc_slice_permission_deny" msgid="576316744017426251">"Tolak"</string>
</resources>
diff --git a/slice/slice-core/src/main/res/values-is/strings.xml b/slice/slice-core/src/main/res/values-is/strings.xml
index 5845ff1..46a972d 100644
--- a/slice/slice-core/src/main/res/values-is/strings.xml
+++ b/slice/slice-core/src/main/res/values-is/strings.xml
@@ -17,10 +17,10 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slices_permission_request" msgid="3604847235923472451">"<xliff:g id="APP_0">%1$s</xliff:g> vill sýna sneiðar úr <xliff:g id="APP_2">%2$s</xliff:g>"</string>
- <string name="abc_slice_permission_title" msgid="4175332421259324948">"Viltu leyfa <xliff:g id="APP_0">%1$s</xliff:g> að sýna sneiðar úr <xliff:g id="APP_2">%2$s</xliff:g>?"</string>
- <string name="abc_slice_permission_text_1" msgid="4525743640399572811">"- Það getur lesið upplýsingar úr <xliff:g id="APP">%1$s</xliff:g>"</string>
- <string name="abc_slice_permission_text_2" msgid="7323565634860251794">"- Það getur gripið til aðgerða í <xliff:g id="APP">%1$s</xliff:g>"</string>
- <string name="abc_slice_permission_allow" msgid="5024599872061409708">"Leyfa"</string>
- <string name="abc_slice_permission_deny" msgid="3819478292430407705">"Hafna"</string>
+ <string name="abc_slices_permission_request" msgid="4431189529265983653">"<xliff:g id="APP_0">%1$s</xliff:g> vill sýna sneiðar úr <xliff:g id="APP_2">%2$s</xliff:g>"</string>
+ <string name="abc_slice_permission_title" msgid="4776010267128891014">"Viltu leyfa <xliff:g id="APP_0">%1$s</xliff:g> að sýna sneiðar úr <xliff:g id="APP_2">%2$s</xliff:g>?"</string>
+ <string name="abc_slice_permission_text_1" msgid="9108592981418900836">"- Það getur lesið upplýsingar úr <xliff:g id="APP">%1$s</xliff:g>"</string>
+ <string name="abc_slice_permission_text_2" msgid="7135705417979137589">"- Það getur gripið til aðgerða í <xliff:g id="APP">%1$s</xliff:g>"</string>
+ <string name="abc_slice_permission_allow" msgid="6374752258872407887">"Leyfa"</string>
+ <string name="abc_slice_permission_deny" msgid="576316744017426251">"Hafna"</string>
</resources>
diff --git a/slice/slice-core/src/main/res/values-it/strings.xml b/slice/slice-core/src/main/res/values-it/strings.xml
index 58509f9..2c88161 100644
--- a/slice/slice-core/src/main/res/values-it/strings.xml
+++ b/slice/slice-core/src/main/res/values-it/strings.xml
@@ -17,10 +17,10 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slices_permission_request" msgid="3604847235923472451">"L\'app <xliff:g id="APP_0">%1$s</xliff:g> vuole mostrare porzioni dell\'app <xliff:g id="APP_2">%2$s</xliff:g>"</string>
- <string name="abc_slice_permission_title" msgid="4175332421259324948">"Vuoi consentire all\'app <xliff:g id="APP_0">%1$s</xliff:g> di mostrare porzioni dell\'app <xliff:g id="APP_2">%2$s</xliff:g>?"</string>
- <string name="abc_slice_permission_text_1" msgid="4525743640399572811">"- Può leggere informazioni dell\'app <xliff:g id="APP">%1$s</xliff:g>"</string>
- <string name="abc_slice_permission_text_2" msgid="7323565634860251794">"- Può compiere azioni nell\'app <xliff:g id="APP">%1$s</xliff:g>"</string>
- <string name="abc_slice_permission_allow" msgid="5024599872061409708">"Consenti"</string>
- <string name="abc_slice_permission_deny" msgid="3819478292430407705">"Rifiuta"</string>
+ <string name="abc_slices_permission_request" msgid="4431189529265983653">"L\'app <xliff:g id="APP_0">%1$s</xliff:g> vuole mostrare sezioni dell\'app <xliff:g id="APP_2">%2$s</xliff:g>"</string>
+ <string name="abc_slice_permission_title" msgid="4776010267128891014">"Vuoi consentire all\'app <xliff:g id="APP_0">%1$s</xliff:g> di mostrare sezioni dell\'app <xliff:g id="APP_2">%2$s</xliff:g>?"</string>
+ <string name="abc_slice_permission_text_1" msgid="9108592981418900836">"- Può leggere informazioni dell\'app <xliff:g id="APP">%1$s</xliff:g>"</string>
+ <string name="abc_slice_permission_text_2" msgid="7135705417979137589">"- Può compiere azioni nell\'app <xliff:g id="APP">%1$s</xliff:g>"</string>
+ <string name="abc_slice_permission_allow" msgid="6374752258872407887">"Consenti"</string>
+ <string name="abc_slice_permission_deny" msgid="576316744017426251">"Nega"</string>
</resources>
diff --git a/slice/slice-core/src/main/res/values-iw/strings.xml b/slice/slice-core/src/main/res/values-iw/strings.xml
index 4a6791f..82fe811 100644
--- a/slice/slice-core/src/main/res/values-iw/strings.xml
+++ b/slice/slice-core/src/main/res/values-iw/strings.xml
@@ -17,10 +17,10 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slices_permission_request" msgid="3604847235923472451">"<xliff:g id="APP_0">%1$s</xliff:g> רוצה להציג חלקים מ-<xliff:g id="APP_2">%2$s</xliff:g>"</string>
- <string name="abc_slice_permission_title" msgid="4175332421259324948">"האם לאפשר ל-<xliff:g id="APP_0">%1$s</xliff:g> להציג חלקים מ-<xliff:g id="APP_2">%2$s</xliff:g>?"</string>
- <string name="abc_slice_permission_text_1" msgid="4525743640399572811">"- תהיה לה אפשרות לקרוא מידע מהאפליקציה <xliff:g id="APP">%1$s</xliff:g>"</string>
- <string name="abc_slice_permission_text_2" msgid="7323565634860251794">"- תהיה לה יכולת לנקוט פעולה בתוך <xliff:g id="APP">%1$s</xliff:g>"</string>
- <string name="abc_slice_permission_allow" msgid="5024599872061409708">"אישור"</string>
- <string name="abc_slice_permission_deny" msgid="3819478292430407705">"אני לא מרשה"</string>
+ <string name="abc_slices_permission_request" msgid="4431189529265983653">"<xliff:g id="APP_0">%1$s</xliff:g> רוצה להציג חלקים מ-<xliff:g id="APP_2">%2$s</xliff:g>"</string>
+ <string name="abc_slice_permission_title" msgid="4776010267128891014">"האם לאפשר ל-<xliff:g id="APP_0">%1$s</xliff:g> להציג חלקים מ-<xliff:g id="APP_2">%2$s</xliff:g>?"</string>
+ <string name="abc_slice_permission_text_1" msgid="9108592981418900836">"- תהיה לה אפשרות לקרוא מידע מ-<xliff:g id="APP">%1$s</xliff:g>"</string>
+ <string name="abc_slice_permission_text_2" msgid="7135705417979137589">"- תהיה לה יכולת לנקוט פעולה בתוך <xliff:g id="APP">%1$s</xliff:g>"</string>
+ <string name="abc_slice_permission_allow" msgid="6374752258872407887">"אישור"</string>
+ <string name="abc_slice_permission_deny" msgid="576316744017426251">"אני לא מרשה"</string>
</resources>
diff --git a/slice/slice-core/src/main/res/values-ja/strings.xml b/slice/slice-core/src/main/res/values-ja/strings.xml
index e619da5..52b73c7 100644
--- a/slice/slice-core/src/main/res/values-ja/strings.xml
+++ b/slice/slice-core/src/main/res/values-ja/strings.xml
@@ -17,10 +17,10 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slices_permission_request" msgid="3604847235923472451">"<xliff:g id="APP_0">%1$s</xliff:g> が <xliff:g id="APP_2">%2$s</xliff:g> のスライスの表示をリクエストしています"</string>
- <string name="abc_slice_permission_title" msgid="4175332421259324948">"<xliff:g id="APP_2">%2$s</xliff:g> のスライスの表示を <xliff:g id="APP_0">%1$s</xliff:g> に許可しますか?"</string>
- <string name="abc_slice_permission_text_1" msgid="4525743640399572811">"- <xliff:g id="APP">%1$s</xliff:g> からの情報を読み取ることができます"</string>
- <string name="abc_slice_permission_text_2" msgid="7323565634860251794">"- <xliff:g id="APP">%1$s</xliff:g> 内部で操作することがあります"</string>
- <string name="abc_slice_permission_allow" msgid="5024599872061409708">"許可"</string>
- <string name="abc_slice_permission_deny" msgid="3819478292430407705">"拒否"</string>
+ <string name="abc_slices_permission_request" msgid="4431189529265983653">"<xliff:g id="APP_0">%1$s</xliff:g> が <xliff:g id="APP_2">%2$s</xliff:g> のスライスの表示をリクエストしています"</string>
+ <string name="abc_slice_permission_title" msgid="4776010267128891014">"<xliff:g id="APP_2">%2$s</xliff:g> のスライスの表示を <xliff:g id="APP_0">%1$s</xliff:g> に許可しますか?"</string>
+ <string name="abc_slice_permission_text_1" msgid="9108592981418900836">"- <xliff:g id="APP">%1$s</xliff:g> からの情報を読み取ることができます"</string>
+ <string name="abc_slice_permission_text_2" msgid="7135705417979137589">"- <xliff:g id="APP">%1$s</xliff:g> 内部で操作することがあります"</string>
+ <string name="abc_slice_permission_allow" msgid="6374752258872407887">"許可"</string>
+ <string name="abc_slice_permission_deny" msgid="576316744017426251">"許可しない"</string>
</resources>
diff --git a/slice/slice-core/src/main/res/values-ka/strings.xml b/slice/slice-core/src/main/res/values-ka/strings.xml
index 2558632..6b790c3 100644
--- a/slice/slice-core/src/main/res/values-ka/strings.xml
+++ b/slice/slice-core/src/main/res/values-ka/strings.xml
@@ -17,10 +17,10 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slices_permission_request" msgid="3604847235923472451">"<xliff:g id="APP_0">%1$s</xliff:g>-ს სურს, გაჩვენოთ <xliff:g id="APP_2">%2$s</xliff:g>-ის ფრაგმენტები"</string>
- <string name="abc_slice_permission_title" msgid="4175332421259324948">"ანიჭებთ ნებართვას <xliff:g id="APP_0">%1$s</xliff:g>-ს, აჩვენოს <xliff:g id="APP_2">%2$s</xliff:g>-ის ფრაგმენტები?"</string>
- <string name="abc_slice_permission_text_1" msgid="4525743640399572811">"- მას შეუძლია ინფორმაციის <xliff:g id="APP">%1$s</xliff:g>-დან წაკითხვა"</string>
- <string name="abc_slice_permission_text_2" msgid="7323565634860251794">"- მას შეუძლია ქმედებების <xliff:g id="APP">%1$s</xliff:g>-ში განხორციელება"</string>
- <string name="abc_slice_permission_allow" msgid="5024599872061409708">"დაშვება"</string>
- <string name="abc_slice_permission_deny" msgid="3819478292430407705">"უარყოფა"</string>
+ <string name="abc_slices_permission_request" msgid="4431189529265983653">"<xliff:g id="APP_0">%1$s</xliff:g>-ს სურს, გაჩვენოთ <xliff:g id="APP_2">%2$s</xliff:g>-ის ფრაგმენტები"</string>
+ <string name="abc_slice_permission_title" msgid="4776010267128891014">"მიანიჭებთ ნებართვას <xliff:g id="APP_0">%1$s</xliff:g>-ს, აჩვენოს <xliff:g id="APP_2">%2$s</xliff:g>-ის ფრაგმენტები?"</string>
+ <string name="abc_slice_permission_text_1" msgid="9108592981418900836">"- მას შეუძლია ინფორმაციის <xliff:g id="APP">%1$s</xliff:g>-დან წაკითხვა"</string>
+ <string name="abc_slice_permission_text_2" msgid="7135705417979137589">"- მას შეუძლია ქმედებების <xliff:g id="APP">%1$s</xliff:g>-ში განხორციელება"</string>
+ <string name="abc_slice_permission_allow" msgid="6374752258872407887">"დაშვება"</string>
+ <string name="abc_slice_permission_deny" msgid="576316744017426251">"უარყოფა"</string>
</resources>
diff --git a/slice/slice-core/src/main/res/values-kk/strings.xml b/slice/slice-core/src/main/res/values-kk/strings.xml
index 21f8465..418d78c 100644
--- a/slice/slice-core/src/main/res/values-kk/strings.xml
+++ b/slice/slice-core/src/main/res/values-kk/strings.xml
@@ -17,10 +17,10 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slices_permission_request" msgid="3604847235923472451">"<xliff:g id="APP_0">%1$s</xliff:g> қолданбасы <xliff:g id="APP_2">%2$s</xliff:g> қолданбасының үзінділерін көрсеткісі келеді"</string>
- <string name="abc_slice_permission_title" msgid="4175332421259324948">"<xliff:g id="APP_0">%1$s</xliff:g> қолданбасына <xliff:g id="APP_2">%2$s</xliff:g> қолданбасының үзінділерін көрсетуге рұқсат берілсін бе?"</string>
- <string name="abc_slice_permission_text_1" msgid="4525743640399572811">"- <xliff:g id="APP">%1$s</xliff:g> қолданбасындағы ақпаратты оқи алады"</string>
- <string name="abc_slice_permission_text_2" msgid="7323565634860251794">"- <xliff:g id="APP">%1$s</xliff:g> қолданбасында әрекет ете алады"</string>
- <string name="abc_slice_permission_allow" msgid="5024599872061409708">"Рұқсат беру"</string>
- <string name="abc_slice_permission_deny" msgid="3819478292430407705">"Тыйым салу"</string>
+ <string name="abc_slices_permission_request" msgid="4431189529265983653">"<xliff:g id="APP_0">%1$s</xliff:g> қолданбасы <xliff:g id="APP_2">%2$s</xliff:g> қолданбасының үзінділерін көрсеткісі келеді"</string>
+ <string name="abc_slice_permission_title" msgid="4776010267128891014">"<xliff:g id="APP_0">%1$s</xliff:g> қолданбасына <xliff:g id="APP_2">%2$s</xliff:g> қолданбасының үзінділерін көрсетуге рұқсат берілсін бе?"</string>
+ <string name="abc_slice_permission_text_1" msgid="9108592981418900836">"- <xliff:g id="APP">%1$s</xliff:g> қолданбасындағы ақпаратты оқи алады"</string>
+ <string name="abc_slice_permission_text_2" msgid="7135705417979137589">"- <xliff:g id="APP">%1$s</xliff:g> қолданбасында әрекет ете алады"</string>
+ <string name="abc_slice_permission_allow" msgid="6374752258872407887">"Рұқсат беру"</string>
+ <string name="abc_slice_permission_deny" msgid="576316744017426251">"Тыйым салу"</string>
</resources>
diff --git a/slice/slice-core/src/main/res/values-km/strings.xml b/slice/slice-core/src/main/res/values-km/strings.xml
index 1a5755b..d66f8de 100644
--- a/slice/slice-core/src/main/res/values-km/strings.xml
+++ b/slice/slice-core/src/main/res/values-km/strings.xml
@@ -17,10 +17,10 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slices_permission_request" msgid="3604847235923472451">"<xliff:g id="APP_0">%1$s</xliff:g> ចង់បង្ហាញស្ថិតិប្រើប្រាស់របស់ <xliff:g id="APP_2">%2$s</xliff:g>"</string>
- <string name="abc_slice_permission_title" msgid="4175332421259324948">"អនុញ្ញាតឱ្យ <xliff:g id="APP_0">%1$s</xliff:g> បង្ហាញស្ថិតិប្រើប្រាស់របស់ <xliff:g id="APP_2">%2$s</xliff:g> ?"</string>
- <string name="abc_slice_permission_text_1" msgid="4525743640399572811">"- វាអាចអានព័ត៌មានពី <xliff:g id="APP">%1$s</xliff:g>"</string>
- <string name="abc_slice_permission_text_2" msgid="7323565634860251794">"- វាអាចធ្វើសកម្មភាពនៅក្នុង <xliff:g id="APP">%1$s</xliff:g>"</string>
- <string name="abc_slice_permission_allow" msgid="5024599872061409708">"អនុញ្ញាត"</string>
- <string name="abc_slice_permission_deny" msgid="3819478292430407705">"បដិសេធ"</string>
+ <string name="abc_slices_permission_request" msgid="4431189529265983653">"<xliff:g id="APP_0">%1$s</xliff:g> ចង់បង្ហាញស្ថិតិប្រើប្រាស់របស់ <xliff:g id="APP_2">%2$s</xliff:g>"</string>
+ <string name="abc_slice_permission_title" msgid="4776010267128891014">"អនុញ្ញាតឱ្យ <xliff:g id="APP_0">%1$s</xliff:g> បង្ហាញស្ថិតិប្រើប្រាស់របស់ <xliff:g id="APP_2">%2$s</xliff:g>?"</string>
+ <string name="abc_slice_permission_text_1" msgid="9108592981418900836">"- វាអាចអានព័ត៌មានពី <xliff:g id="APP">%1$s</xliff:g>"</string>
+ <string name="abc_slice_permission_text_2" msgid="7135705417979137589">"- វាអាចធ្វើសកម្មភាពនៅក្នុង <xliff:g id="APP">%1$s</xliff:g>"</string>
+ <string name="abc_slice_permission_allow" msgid="6374752258872407887">"អនុញ្ញាត"</string>
+ <string name="abc_slice_permission_deny" msgid="576316744017426251">"បដិសេធ"</string>
</resources>
diff --git a/slice/slice-core/src/main/res/values-kn/strings.xml b/slice/slice-core/src/main/res/values-kn/strings.xml
index 0f14a36..e064774 100644
--- a/slice/slice-core/src/main/res/values-kn/strings.xml
+++ b/slice/slice-core/src/main/res/values-kn/strings.xml
@@ -17,10 +17,10 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slices_permission_request" msgid="3604847235923472451">"<xliff:g id="APP_2">%2$s</xliff:g> ಸ್ಲೈಸ್ಗಳನ್ನು <xliff:g id="APP_0">%1$s</xliff:g> ತೋರಿಸಲು ಬಯಸಿದೆ"</string>
- <string name="abc_slice_permission_title" msgid="4175332421259324948">"<xliff:g id="APP_2">%2$s</xliff:g> ಸ್ಲೈಸ್ಗಳನ್ನು ತೋರಿಸಲು <xliff:g id="APP_0">%1$s</xliff:g> ಅನ್ನು ಅನುಮತಿಸುವುದೇ?"</string>
- <string name="abc_slice_permission_text_1" msgid="4525743640399572811">"- ಇದು <xliff:g id="APP">%1$s</xliff:g> ನಿಂದ ಮಾಹಿತಿಯನ್ನು ಓದಬಹುದು"</string>
- <string name="abc_slice_permission_text_2" msgid="7323565634860251794">"- ಇದು <xliff:g id="APP">%1$s</xliff:g> ಒಳಗಡೆ ಕ್ರಿಯೆಗಳನ್ನು ತೆಗೆದುಕೊಳ್ಳಬಹುದು"</string>
- <string name="abc_slice_permission_allow" msgid="5024599872061409708">"ಅನುಮತಿಸಿ"</string>
- <string name="abc_slice_permission_deny" msgid="3819478292430407705">"ನಿರಾಕರಿಸಿ"</string>
+ <string name="abc_slices_permission_request" msgid="4431189529265983653">"<xliff:g id="APP_2">%2$s</xliff:g> ಸ್ಲೈಸ್ಗಳನ್ನು ತೋರಿಸಲು <xliff:g id="APP_0">%1$s</xliff:g> ಬಯಸುತ್ತಾರೆ"</string>
+ <string name="abc_slice_permission_title" msgid="4776010267128891014">"<xliff:g id="APP_2">%2$s</xliff:g> ಸ್ಲೈಸ್ಗಳನ್ನು ತೋರಿಸಲು <xliff:g id="APP_0">%1$s</xliff:g> ಅನ್ನು ಅನುಮತಿಸಬೇಕೇ?"</string>
+ <string name="abc_slice_permission_text_1" msgid="9108592981418900836">"- ಇದು <xliff:g id="APP">%1$s</xliff:g> ನಿಂದ ಮಾಹಿತಿಯನ್ನು ಓದಬಹುದು"</string>
+ <string name="abc_slice_permission_text_2" msgid="7135705417979137589">"- ಇದು <xliff:g id="APP">%1$s</xliff:g> ಒಳಗಡೆ ಕ್ರಿಯೆಗಳನ್ನು ತೆಗೆದುಕೊಳ್ಳಬಹುದು"</string>
+ <string name="abc_slice_permission_allow" msgid="6374752258872407887">"ಅನುಮತಿಸಿ"</string>
+ <string name="abc_slice_permission_deny" msgid="576316744017426251">"ನಿರಾಕರಿಸಿ"</string>
</resources>
diff --git a/slice/slice-core/src/main/res/values-ko/strings.xml b/slice/slice-core/src/main/res/values-ko/strings.xml
index 81a6707..6c454cf 100644
--- a/slice/slice-core/src/main/res/values-ko/strings.xml
+++ b/slice/slice-core/src/main/res/values-ko/strings.xml
@@ -17,10 +17,10 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slices_permission_request" msgid="3604847235923472451">"<xliff:g id="APP_0">%1$s</xliff:g>에서 <xliff:g id="APP_2">%2$s</xliff:g>의 슬라이스를 표시하려고 합니다."</string>
- <string name="abc_slice_permission_title" msgid="4175332421259324948">"<xliff:g id="APP_0">%1$s</xliff:g>에서 <xliff:g id="APP_2">%2$s</xliff:g>의 슬라이스를 표시하도록 허용하시겠습니까?"</string>
- <string name="abc_slice_permission_text_1" msgid="4525743640399572811">"- <xliff:g id="APP">%1$s</xliff:g>의 정보를 읽을 수 있음"</string>
- <string name="abc_slice_permission_text_2" msgid="7323565634860251794">"- <xliff:g id="APP">%1$s</xliff:g>에서 작업할 수 있음"</string>
- <string name="abc_slice_permission_allow" msgid="5024599872061409708">"허용"</string>
- <string name="abc_slice_permission_deny" msgid="3819478292430407705">"거부"</string>
+ <string name="abc_slices_permission_request" msgid="4431189529265983653">"<xliff:g id="APP_0">%1$s</xliff:g>에서 <xliff:g id="APP_2">%2$s</xliff:g>의 Slice를 표시하려고 합니다."</string>
+ <string name="abc_slice_permission_title" msgid="4776010267128891014">"<xliff:g id="APP_0">%1$s</xliff:g>에서 <xliff:g id="APP_2">%2$s</xliff:g>의 Slice를 표시하도록 허용하시겠습니까?"</string>
+ <string name="abc_slice_permission_text_1" msgid="9108592981418900836">"- <xliff:g id="APP">%1$s</xliff:g>의 정보를 읽을 수 있음"</string>
+ <string name="abc_slice_permission_text_2" msgid="7135705417979137589">"- <xliff:g id="APP">%1$s</xliff:g>에서 작업할 수 있음"</string>
+ <string name="abc_slice_permission_allow" msgid="6374752258872407887">"허용"</string>
+ <string name="abc_slice_permission_deny" msgid="576316744017426251">"거부"</string>
</resources>
diff --git a/slice/slice-core/src/main/res/values-ky/strings.xml b/slice/slice-core/src/main/res/values-ky/strings.xml
index 9a26322..1e5a977 100644
--- a/slice/slice-core/src/main/res/values-ky/strings.xml
+++ b/slice/slice-core/src/main/res/values-ky/strings.xml
@@ -17,10 +17,10 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slices_permission_request" msgid="3604847235923472451">"<xliff:g id="APP_0">%1$s</xliff:g> колдонмосу <xliff:g id="APP_2">%2$s</xliff:g> үлгүлөрүн көрсөткөнү жатат"</string>
- <string name="abc_slice_permission_title" msgid="4175332421259324948">"<xliff:g id="APP_0">%1$s</xliff:g> колдонмосуна <xliff:g id="APP_2">%2$s</xliff:g> үлгүлөрүн көрсөтүүгө уруксат берилсинби?"</string>
- <string name="abc_slice_permission_text_1" msgid="4525743640399572811">"- <xliff:g id="APP">%1$s</xliff:g> колдонмосунун маалыматын окуйт"</string>
- <string name="abc_slice_permission_text_2" msgid="7323565634860251794">"- <xliff:g id="APP">%1$s</xliff:g> колдонмосунда аракеттерди аткарат"</string>
- <string name="abc_slice_permission_allow" msgid="5024599872061409708">"Уруксат берүү"</string>
- <string name="abc_slice_permission_deny" msgid="3819478292430407705">"Тыюу салынат"</string>
+ <string name="abc_slices_permission_request" msgid="4431189529265983653">"<xliff:g id="APP_0">%1$s</xliff:g> колдонмосу <xliff:g id="APP_2">%2$s</xliff:g> фрагменттерин көрсөткүсү келет"</string>
+ <string name="abc_slice_permission_title" msgid="4776010267128891014">"<xliff:g id="APP_0">%1$s</xliff:g> колдонмосуна <xliff:g id="APP_2">%2$s</xliff:g> фрагменттерин көрсөтүүгө уруксат бересизби?"</string>
+ <string name="abc_slice_permission_text_1" msgid="9108592981418900836">"– <xliff:g id="APP">%1$s</xliff:g> колдонмосунун маалыматын окуйт"</string>
+ <string name="abc_slice_permission_text_2" msgid="7135705417979137589">"– <xliff:g id="APP">%1$s</xliff:g> колдонмосунда аракеттерди аткарат"</string>
+ <string name="abc_slice_permission_allow" msgid="6374752258872407887">"Уруксат берүү"</string>
+ <string name="abc_slice_permission_deny" msgid="576316744017426251">"Четке кагуу"</string>
</resources>
diff --git a/slice/slice-core/src/main/res/values-lo/strings.xml b/slice/slice-core/src/main/res/values-lo/strings.xml
index aeeedc9..240a641 100644
--- a/slice/slice-core/src/main/res/values-lo/strings.xml
+++ b/slice/slice-core/src/main/res/values-lo/strings.xml
@@ -17,10 +17,10 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slices_permission_request" msgid="3604847235923472451">"<xliff:g id="APP_0">%1$s</xliff:g> ຕ້ອງການສະແດງ <xliff:g id="APP_2">%2$s</xliff:g> ສະໄລ້"</string>
- <string name="abc_slice_permission_title" msgid="4175332421259324948">"ອະນຸຍາດ <xliff:g id="APP_0">%1$s</xliff:g> ໃຫ້ສະແດງ <xliff:g id="APP_2">%2$s</xliff:g> ສະໄລ້ບໍ?"</string>
- <string name="abc_slice_permission_text_1" msgid="4525743640399572811">"- ມັນສາມາດອ່ານຂໍ້ມູນຈາກ <xliff:g id="APP">%1$s</xliff:g>"</string>
- <string name="abc_slice_permission_text_2" msgid="7323565634860251794">"- ມັນສາມາດໃຊ້ຄຳສັ່ງພາຍໃນ <xliff:g id="APP">%1$s</xliff:g>"</string>
- <string name="abc_slice_permission_allow" msgid="5024599872061409708">"ອະນຸຍາດ"</string>
- <string name="abc_slice_permission_deny" msgid="3819478292430407705">"ປະຕິເສດ"</string>
+ <string name="abc_slices_permission_request" msgid="4431189529265983653">"<xliff:g id="APP_0">%1$s</xliff:g> ຕ້ອງການສະແດງສະໄລ້ <xliff:g id="APP_2">%2$s</xliff:g>"</string>
+ <string name="abc_slice_permission_title" msgid="4776010267128891014">"ອະນຸຍາດ <xliff:g id="APP_0">%1$s</xliff:g> ໃຫ້ສະແດງສະໄລ້ <xliff:g id="APP_2">%2$s</xliff:g> ບໍ?"</string>
+ <string name="abc_slice_permission_text_1" msgid="9108592981418900836">"- ມັນສາມາດອ່ານຂໍ້ມູນຈາກ <xliff:g id="APP">%1$s</xliff:g>"</string>
+ <string name="abc_slice_permission_text_2" msgid="7135705417979137589">"- ມັນສາມາດໃຊ້ຄຳສັ່ງພາຍໃນ <xliff:g id="APP">%1$s</xliff:g>"</string>
+ <string name="abc_slice_permission_allow" msgid="6374752258872407887">"ອະນຸຍາດ"</string>
+ <string name="abc_slice_permission_deny" msgid="576316744017426251">"ປະຕິເສດ"</string>
</resources>
diff --git a/slice/slice-core/src/main/res/values-lt/strings.xml b/slice/slice-core/src/main/res/values-lt/strings.xml
index 604ee1d..a9b56dd 100644
--- a/slice/slice-core/src/main/res/values-lt/strings.xml
+++ b/slice/slice-core/src/main/res/values-lt/strings.xml
@@ -17,10 +17,10 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slices_permission_request" msgid="3604847235923472451">"„<xliff:g id="APP_0">%1$s</xliff:g>“ nori rodyti „<xliff:g id="APP_2">%2$s</xliff:g>“ fragmentus"</string>
- <string name="abc_slice_permission_title" msgid="4175332421259324948">"Leisti „<xliff:g id="APP_0">%1$s</xliff:g>“ rodyti „<xliff:g id="APP_2">%2$s</xliff:g>“ fragmentus?"</string>
- <string name="abc_slice_permission_text_1" msgid="4525743640399572811">"– Gali nuskaityti informaciją iš „<xliff:g id="APP">%1$s</xliff:g>“"</string>
- <string name="abc_slice_permission_text_2" msgid="7323565634860251794">"– Gali imtis veiksmų programoje „<xliff:g id="APP">%1$s</xliff:g>“"</string>
- <string name="abc_slice_permission_allow" msgid="5024599872061409708">"Leisti"</string>
- <string name="abc_slice_permission_deny" msgid="3819478292430407705">"Atmesti"</string>
+ <string name="abc_slices_permission_request" msgid="4431189529265983653">"„<xliff:g id="APP_0">%1$s</xliff:g>“ nori rodyti „<xliff:g id="APP_2">%2$s</xliff:g>“ skiltis"</string>
+ <string name="abc_slice_permission_title" msgid="4776010267128891014">"Leisti „<xliff:g id="APP_0">%1$s</xliff:g>“ rodyti „<xliff:g id="APP_2">%2$s</xliff:g>“ skiltis?"</string>
+ <string name="abc_slice_permission_text_1" msgid="9108592981418900836">"– Gali nuskaityti informaciją iš „<xliff:g id="APP">%1$s</xliff:g>“"</string>
+ <string name="abc_slice_permission_text_2" msgid="7135705417979137589">"– Gali imtis veiksmų programoje „<xliff:g id="APP">%1$s</xliff:g>“"</string>
+ <string name="abc_slice_permission_allow" msgid="6374752258872407887">"Leisti"</string>
+ <string name="abc_slice_permission_deny" msgid="576316744017426251">"Atmesti"</string>
</resources>
diff --git a/slice/slice-core/src/main/res/values-lv/strings.xml b/slice/slice-core/src/main/res/values-lv/strings.xml
index 60dbac8..68238e1 100644
--- a/slice/slice-core/src/main/res/values-lv/strings.xml
+++ b/slice/slice-core/src/main/res/values-lv/strings.xml
@@ -17,10 +17,10 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slices_permission_request" msgid="3604847235923472451">"Lietotne <xliff:g id="APP_0">%1$s</xliff:g> vēlas rādīt lietotnes <xliff:g id="APP_2">%2$s</xliff:g> sadaļas"</string>
- <string name="abc_slice_permission_title" msgid="4175332421259324948">"Vai atļaut lietotnei <xliff:g id="APP_0">%1$s</xliff:g> rādīt lietotnes <xliff:g id="APP_2">%2$s</xliff:g> sadaļas?"</string>
- <string name="abc_slice_permission_text_1" msgid="4525743640399572811">"- Var lasīt informāciju no lietotnes <xliff:g id="APP">%1$s</xliff:g>"</string>
- <string name="abc_slice_permission_text_2" msgid="7323565634860251794">"- Var veikt darbības lietotnē <xliff:g id="APP">%1$s</xliff:g>"</string>
- <string name="abc_slice_permission_allow" msgid="5024599872061409708">"Atļaut"</string>
- <string name="abc_slice_permission_deny" msgid="3819478292430407705">"Neatļaut"</string>
+ <string name="abc_slices_permission_request" msgid="4431189529265983653">"Lietotne <xliff:g id="APP_0">%1$s</xliff:g> vēlas rādīt lietotnes <xliff:g id="APP_2">%2$s</xliff:g> segmentus."</string>
+ <string name="abc_slice_permission_title" msgid="4776010267128891014">"Vai atļaut lietotnei <xliff:g id="APP_0">%1$s</xliff:g> rādīt lietotnes <xliff:g id="APP_2">%2$s</xliff:g> segmentus?"</string>
+ <string name="abc_slice_permission_text_1" msgid="9108592981418900836">"- Var lasīt informāciju no lietotnes <xliff:g id="APP">%1$s</xliff:g>"</string>
+ <string name="abc_slice_permission_text_2" msgid="7135705417979137589">"- Var veikt darbības lietotnē <xliff:g id="APP">%1$s</xliff:g>"</string>
+ <string name="abc_slice_permission_allow" msgid="6374752258872407887">"Atļaut"</string>
+ <string name="abc_slice_permission_deny" msgid="576316744017426251">"Neatļaut"</string>
</resources>
diff --git a/slice/slice-core/src/main/res/values-mk/strings.xml b/slice/slice-core/src/main/res/values-mk/strings.xml
index fd0a8d2..79bf3d6 100644
--- a/slice/slice-core/src/main/res/values-mk/strings.xml
+++ b/slice/slice-core/src/main/res/values-mk/strings.xml
@@ -17,10 +17,10 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slices_permission_request" msgid="3604847235923472451">"<xliff:g id="APP_0">%1$s</xliff:g> сака да прикажува делови од <xliff:g id="APP_2">%2$s</xliff:g>"</string>
- <string name="abc_slice_permission_title" msgid="4175332421259324948">"Да се дозволи <xliff:g id="APP_0">%1$s</xliff:g> да прикажува делови од <xliff:g id="APP_2">%2$s</xliff:g>?"</string>
- <string name="abc_slice_permission_text_1" msgid="4525743640399572811">"- Може да чита информации од <xliff:g id="APP">%1$s</xliff:g>"</string>
- <string name="abc_slice_permission_text_2" msgid="7323565634860251794">"- Може да презема дејства во <xliff:g id="APP">%1$s</xliff:g>"</string>
- <string name="abc_slice_permission_allow" msgid="5024599872061409708">"Дозволете"</string>
- <string name="abc_slice_permission_deny" msgid="3819478292430407705">"Одбијте"</string>
+ <string name="abc_slices_permission_request" msgid="4431189529265983653">"<xliff:g id="APP_0">%1$s</xliff:g> сака да прикажува елементи од <xliff:g id="APP_2">%2$s</xliff:g>"</string>
+ <string name="abc_slice_permission_title" msgid="4776010267128891014">"Да се дозволи <xliff:g id="APP_0">%1$s</xliff:g> да прикажува елементи од <xliff:g id="APP_2">%2$s</xliff:g>?"</string>
+ <string name="abc_slice_permission_text_1" msgid="9108592981418900836">"- Може да чита информации од <xliff:g id="APP">%1$s</xliff:g>"</string>
+ <string name="abc_slice_permission_text_2" msgid="7135705417979137589">"- Може да презема дејства во <xliff:g id="APP">%1$s</xliff:g>"</string>
+ <string name="abc_slice_permission_allow" msgid="6374752258872407887">"Дозволи"</string>
+ <string name="abc_slice_permission_deny" msgid="576316744017426251">"Одбиј"</string>
</resources>
diff --git a/slice/slice-core/src/main/res/values-ml/strings.xml b/slice/slice-core/src/main/res/values-ml/strings.xml
index bb565fa..48fb716 100644
--- a/slice/slice-core/src/main/res/values-ml/strings.xml
+++ b/slice/slice-core/src/main/res/values-ml/strings.xml
@@ -17,10 +17,10 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slices_permission_request" msgid="3604847235923472451">"<xliff:g id="APP_2">%2$s</xliff:g> സ്ലൈസുകൾ കാണിക്കാൻ <xliff:g id="APP_0">%1$s</xliff:g> താൽപ്പര്യപ്പെടുന്നു"</string>
- <string name="abc_slice_permission_title" msgid="4175332421259324948">"<xliff:g id="APP_2">%2$s</xliff:g> സ്ലൈസുകൾ കാണിക്കാൻ <xliff:g id="APP_0">%1$s</xliff:g>-നെ അനുവദിക്കണോ?"</string>
- <string name="abc_slice_permission_text_1" msgid="4525743640399572811">"- ഇതിന് <xliff:g id="APP">%1$s</xliff:g>-ൽ നിന്ന് വിവരങ്ങൾ വായിക്കാനാകും"</string>
- <string name="abc_slice_permission_text_2" msgid="7323565634860251794">"- ഇതിന് <xliff:g id="APP">%1$s</xliff:g>-നുള്ളിൽ പ്രവർത്തനങ്ങൾ ചെയ്യാനാകും"</string>
- <string name="abc_slice_permission_allow" msgid="5024599872061409708">"അനുവദിക്കുക"</string>
- <string name="abc_slice_permission_deny" msgid="3819478292430407705">"നിരസിക്കുക"</string>
+ <string name="abc_slices_permission_request" msgid="4431189529265983653">"<xliff:g id="APP_2">%2$s</xliff:g> സ്ലൈസുകൾ കാണിക്കാൻ <xliff:g id="APP_0">%1$s</xliff:g> താൽപ്പര്യപ്പെടുന്നു"</string>
+ <string name="abc_slice_permission_title" msgid="4776010267128891014">"<xliff:g id="APP_2">%2$s</xliff:g> സ്ലൈസുകൾ കാണിക്കാൻ <xliff:g id="APP_0">%1$s</xliff:g> എന്നതിനെ അനുവദിക്കണോ?"</string>
+ <string name="abc_slice_permission_text_1" msgid="9108592981418900836">"- ഇതിന് <xliff:g id="APP">%1$s</xliff:g> എന്നതിൽ നിന്ന് വിവരങ്ങൾ വായിക്കാനാകും"</string>
+ <string name="abc_slice_permission_text_2" msgid="7135705417979137589">"- ഇതിന് <xliff:g id="APP">%1$s</xliff:g> എന്നതിനുള്ളിൽ പ്രവർത്തനങ്ങൾ ചെയ്യാനാകും"</string>
+ <string name="abc_slice_permission_allow" msgid="6374752258872407887">"അനുവദിക്കുക"</string>
+ <string name="abc_slice_permission_deny" msgid="576316744017426251">"നിരസിക്കുക"</string>
</resources>
diff --git a/slice/slice-core/src/main/res/values-mn/strings.xml b/slice/slice-core/src/main/res/values-mn/strings.xml
index ce2b5b9..d0ae6bc 100644
--- a/slice/slice-core/src/main/res/values-mn/strings.xml
+++ b/slice/slice-core/src/main/res/values-mn/strings.xml
@@ -17,10 +17,10 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slices_permission_request" msgid="3604847235923472451">"<xliff:g id="APP_0">%1$s</xliff:g> <xliff:g id="APP_2">%2$s</xliff:g>-н хэсгүүдийг харуулах хүсэлтэй байна"</string>
- <string name="abc_slice_permission_title" msgid="4175332421259324948">"<xliff:g id="APP_0">%1$s</xliff:g>-д <xliff:g id="APP_2">%2$s</xliff:g>-н хэсгүүдийг харуулахыг зөвшөөрөх үү?"</string>
- <string name="abc_slice_permission_text_1" msgid="4525743640399572811">"- Энэ <xliff:g id="APP">%1$s</xliff:g>-с мэдээлэл унших боломжтой"</string>
- <string name="abc_slice_permission_text_2" msgid="7323565634860251794">"- Энэ <xliff:g id="APP">%1$s</xliff:g> дотор үйлдэл хийх боломжтой"</string>
- <string name="abc_slice_permission_allow" msgid="5024599872061409708">"Зөвшөөрөх"</string>
- <string name="abc_slice_permission_deny" msgid="3819478292430407705">"Татгалзах"</string>
+ <string name="abc_slices_permission_request" msgid="4431189529265983653">"<xliff:g id="APP_0">%1$s</xliff:g> нь <xliff:g id="APP_2">%2$s</xliff:g>-н хэсгүүдийг харуулахыг хүсэж байна"</string>
+ <string name="abc_slice_permission_title" msgid="4776010267128891014">"<xliff:g id="APP_0">%1$s</xliff:g>-д <xliff:g id="APP_2">%2$s</xliff:g>-н хэсгүүдийг харуулахыг зөвшөөрөх үү?"</string>
+ <string name="abc_slice_permission_text_1" msgid="9108592981418900836">"- Энэ нь <xliff:g id="APP">%1$s</xliff:g>-с мэдээллийг унших боломжтой"</string>
+ <string name="abc_slice_permission_text_2" msgid="7135705417979137589">"- Энэ нь <xliff:g id="APP">%1$s</xliff:g>-д үйлдэл хийх боломжтой"</string>
+ <string name="abc_slice_permission_allow" msgid="6374752258872407887">"Зөвшөөрөх"</string>
+ <string name="abc_slice_permission_deny" msgid="576316744017426251">"Татгалзах"</string>
</resources>
diff --git a/slice/slice-core/src/main/res/values-mr/strings.xml b/slice/slice-core/src/main/res/values-mr/strings.xml
index 7ed173d..ab9b9bc 100644
--- a/slice/slice-core/src/main/res/values-mr/strings.xml
+++ b/slice/slice-core/src/main/res/values-mr/strings.xml
@@ -17,10 +17,10 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slices_permission_request" msgid="3604847235923472451">"<xliff:g id="APP_0">%1$s</xliff:g> ला <xliff:g id="APP_2">%2$s</xliff:g> चे तुकडे दाखवायचे आहेत"</string>
- <string name="abc_slice_permission_title" msgid="4175332421259324948">"<xliff:g id="APP_0">%1$s</xliff:g> ला <xliff:g id="APP_2">%2$s</xliff:g> चे तुकडे दाखवण्याची अनुमती द्यायची का?"</string>
- <string name="abc_slice_permission_text_1" msgid="4525743640399572811">"- ते <xliff:g id="APP">%1$s</xliff:g> ची माहिती वाचू शकते"</string>
- <string name="abc_slice_permission_text_2" msgid="7323565634860251794">"- ते <xliff:g id="APP">%1$s</xliff:g> मध्ये कृती करू शकते"</string>
- <string name="abc_slice_permission_allow" msgid="5024599872061409708">"अनुमती द्या"</string>
- <string name="abc_slice_permission_deny" msgid="3819478292430407705">"नकार द्या"</string>
+ <string name="abc_slices_permission_request" msgid="4431189529265983653">"<xliff:g id="APP_0">%1$s</xliff:g> ला <xliff:g id="APP_2">%2$s</xliff:g> स्लाइस दाखवायचे आहेत"</string>
+ <string name="abc_slice_permission_title" msgid="4776010267128891014">"<xliff:g id="APP_0">%1$s</xliff:g> ला <xliff:g id="APP_2">%2$s</xliff:g> स्लाइस दाखवण्याची अनुमती द्यायची आहे का?"</string>
+ <string name="abc_slice_permission_text_1" msgid="9108592981418900836">"- ते <xliff:g id="APP">%1$s</xliff:g> मधील माहिती वाचू शकते"</string>
+ <string name="abc_slice_permission_text_2" msgid="7135705417979137589">"- ते <xliff:g id="APP">%1$s</xliff:g> मध्ये कृती करू शकते"</string>
+ <string name="abc_slice_permission_allow" msgid="6374752258872407887">"अनुमती द्या"</string>
+ <string name="abc_slice_permission_deny" msgid="576316744017426251">"नकार द्या"</string>
</resources>
diff --git a/slice/slice-core/src/main/res/values-ms/strings.xml b/slice/slice-core/src/main/res/values-ms/strings.xml
index e4dc766..1c5a1ec 100644
--- a/slice/slice-core/src/main/res/values-ms/strings.xml
+++ b/slice/slice-core/src/main/res/values-ms/strings.xml
@@ -17,10 +17,10 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slices_permission_request" msgid="3604847235923472451">"<xliff:g id="APP_0">%1$s</xliff:g> mahu menunjukkan hirisan <xliff:g id="APP_2">%2$s</xliff:g>"</string>
- <string name="abc_slice_permission_title" msgid="4175332421259324948">"Benarkan <xliff:g id="APP_0">%1$s</xliff:g> menunjukkan hirisan <xliff:g id="APP_2">%2$s</xliff:g>?"</string>
- <string name="abc_slice_permission_text_1" msgid="4525743640399572811">"- Hos hirisan boleh membaca maklumat daripada <xliff:g id="APP">%1$s</xliff:g>"</string>
- <string name="abc_slice_permission_text_2" msgid="7323565634860251794">"- Hos hirisan boleh mengambil tindakan dalam <xliff:g id="APP">%1$s</xliff:g>"</string>
- <string name="abc_slice_permission_allow" msgid="5024599872061409708">"Benarkan"</string>
- <string name="abc_slice_permission_deny" msgid="3819478292430407705">"Tolak"</string>
+ <string name="abc_slices_permission_request" msgid="4431189529265983653">"<xliff:g id="APP_0">%1$s</xliff:g> mahu menunjukkan hirisan <xliff:g id="APP_2">%2$s</xliff:g>"</string>
+ <string name="abc_slice_permission_title" msgid="4776010267128891014">"Benarkan <xliff:g id="APP_0">%1$s</xliff:g> menunjukkan hirisan <xliff:g id="APP_2">%2$s</xliff:g>?"</string>
+ <string name="abc_slice_permission_text_1" msgid="9108592981418900836">"- Hos hirisan boleh membaca maklumat daripada <xliff:g id="APP">%1$s</xliff:g>"</string>
+ <string name="abc_slice_permission_text_2" msgid="7135705417979137589">"- Hos hirisan boleh mengambil tindakan dalam <xliff:g id="APP">%1$s</xliff:g>"</string>
+ <string name="abc_slice_permission_allow" msgid="6374752258872407887">"Benarkan"</string>
+ <string name="abc_slice_permission_deny" msgid="576316744017426251">"Tolak"</string>
</resources>
diff --git a/slice/slice-core/src/main/res/values-my/strings.xml b/slice/slice-core/src/main/res/values-my/strings.xml
index 109f680..4d73938 100644
--- a/slice/slice-core/src/main/res/values-my/strings.xml
+++ b/slice/slice-core/src/main/res/values-my/strings.xml
@@ -17,10 +17,10 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slices_permission_request" msgid="3604847235923472451">"<xliff:g id="APP_0">%1$s</xliff:g> သည် <xliff:g id="APP_2">%2$s</xliff:g> ၏အချပ်များကို ပြသလိုသည်"</string>
- <string name="abc_slice_permission_title" msgid="4175332421259324948">"<xliff:g id="APP_0">%1$s</xliff:g> အား <xliff:g id="APP_2">%2$s</xliff:g> ၏အချပ်များ ပြသခွင့်ပြုပါသလား။"</string>
- <string name="abc_slice_permission_text_1" msgid="4525743640399572811">"- ၎င်းသည် <xliff:g id="APP">%1$s</xliff:g> မှ အချက်အလက်ကို ဖတ်နိုင်သည်"</string>
- <string name="abc_slice_permission_text_2" msgid="7323565634860251794">"- ၎င်းသည် <xliff:g id="APP">%1$s</xliff:g> အတွင်း လုပ်ဆောင်ချက်များ ပြုလုပ်နိုင်သည်"</string>
- <string name="abc_slice_permission_allow" msgid="5024599872061409708">"ခွင့်ပြုရန်"</string>
- <string name="abc_slice_permission_deny" msgid="3819478292430407705">"ငြင်းပယ်ရန်"</string>
+ <string name="abc_slices_permission_request" msgid="4431189529265983653">"<xliff:g id="APP_0">%1$s</xliff:g> သည် <xliff:g id="APP_2">%2$s</xliff:g> ၏ စလိုက်စ်များကို ပြလိုသည်"</string>
+ <string name="abc_slice_permission_title" msgid="4776010267128891014">"<xliff:g id="APP_0">%1$s</xliff:g> ကို <xliff:g id="APP_2">%2$s</xliff:g> ၏ စလိုက်စ်များ ပြခွင့်ပြုပါသလား။"</string>
+ <string name="abc_slice_permission_text_1" msgid="9108592981418900836">"- ၎င်းသည် <xliff:g id="APP">%1$s</xliff:g> မှ အချက်အလက်ကို ဖတ်နိုင်သည်"</string>
+ <string name="abc_slice_permission_text_2" msgid="7135705417979137589">"- ၎င်းသည် <xliff:g id="APP">%1$s</xliff:g> အတွင်း လုပ်ဆောင်ချက်များ ပြုလုပ်နိုင်သည်"</string>
+ <string name="abc_slice_permission_allow" msgid="6374752258872407887">"ခွင့်ပြုရန်"</string>
+ <string name="abc_slice_permission_deny" msgid="576316744017426251">"ငြင်းပယ်ရန်"</string>
</resources>
diff --git a/slice/slice-core/src/main/res/values-nb/strings.xml b/slice/slice-core/src/main/res/values-nb/strings.xml
index d3246d5..a67f9c6 100644
--- a/slice/slice-core/src/main/res/values-nb/strings.xml
+++ b/slice/slice-core/src/main/res/values-nb/strings.xml
@@ -17,10 +17,10 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slices_permission_request" msgid="3604847235923472451">"<xliff:g id="APP_0">%1$s</xliff:g> vil vise <xliff:g id="APP_2">%2$s</xliff:g>-utsnitt"</string>
- <string name="abc_slice_permission_title" msgid="4175332421259324948">"Vil du tillate at <xliff:g id="APP_0">%1$s</xliff:g> viser <xliff:g id="APP_2">%2$s</xliff:g>-utsnitt?"</string>
- <string name="abc_slice_permission_text_1" msgid="4525743640399572811">"– Den kan lese informasjon fra <xliff:g id="APP">%1$s</xliff:g>"</string>
- <string name="abc_slice_permission_text_2" msgid="7323565634860251794">"– Den kan utføre handlinger i <xliff:g id="APP">%1$s</xliff:g>"</string>
- <string name="abc_slice_permission_allow" msgid="5024599872061409708">"Tillat"</string>
- <string name="abc_slice_permission_deny" msgid="3819478292430407705">"Ikke tillat"</string>
+ <string name="abc_slices_permission_request" msgid="4431189529265983653">"<xliff:g id="APP_0">%1$s</xliff:g> vil vise <xliff:g id="APP_2">%2$s</xliff:g>-UI-maler"</string>
+ <string name="abc_slice_permission_title" msgid="4776010267128891014">"Vil du tillate at <xliff:g id="APP_0">%1$s</xliff:g> viser <xliff:g id="APP_2">%2$s</xliff:g>-UI-maler?"</string>
+ <string name="abc_slice_permission_text_1" msgid="9108592981418900836">"– Den kan lese informasjon fra <xliff:g id="APP">%1$s</xliff:g>"</string>
+ <string name="abc_slice_permission_text_2" msgid="7135705417979137589">"– Den kan utføre handlinger i <xliff:g id="APP">%1$s</xliff:g>"</string>
+ <string name="abc_slice_permission_allow" msgid="6374752258872407887">"Tillat"</string>
+ <string name="abc_slice_permission_deny" msgid="576316744017426251">"Avvis"</string>
</resources>
diff --git a/slice/slice-core/src/main/res/values-ne/strings.xml b/slice/slice-core/src/main/res/values-ne/strings.xml
index baba49e..5cb30e2 100644
--- a/slice/slice-core/src/main/res/values-ne/strings.xml
+++ b/slice/slice-core/src/main/res/values-ne/strings.xml
@@ -17,10 +17,10 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slices_permission_request" msgid="3604847235923472451">"<xliff:g id="APP_0">%1$s</xliff:g> <xliff:g id="APP_2">%2$s</xliff:g> का स्लाइसहरू देखाउन चाहन्छ"</string>
- <string name="abc_slice_permission_title" msgid="4175332421259324948">"<xliff:g id="APP_0">%1$s</xliff:g> लाई <xliff:g id="APP_2">%2$s</xliff:g> का स्लाइसहरू देखाउन अनुमति दिने हो?"</string>
- <string name="abc_slice_permission_text_1" msgid="4525743640399572811">"- यसले <xliff:g id="APP">%1$s</xliff:g> को जानकारी पढ्न सक्छ"</string>
- <string name="abc_slice_permission_text_2" msgid="7323565634860251794">"- यसले <xliff:g id="APP">%1$s</xliff:g> भित्र कारबाही गर्न सक्छ"</string>
- <string name="abc_slice_permission_allow" msgid="5024599872061409708">"अनुमति दिनुहोस्"</string>
- <string name="abc_slice_permission_deny" msgid="3819478292430407705">"नदिने"</string>
+ <string name="abc_slices_permission_request" msgid="4431189529265983653">"<xliff:g id="APP_0">%1$s</xliff:g> ले <xliff:g id="APP_2">%2$s</xliff:g> का स्लाइसहरू देखाउने अनुमति माग्दै छ"</string>
+ <string name="abc_slice_permission_title" msgid="4776010267128891014">"<xliff:g id="APP_0">%1$s</xliff:g> लाई <xliff:g id="APP_2">%2$s</xliff:g> का स्लाइसहरू देखाउने अनुमति दिने हो?"</string>
+ <string name="abc_slice_permission_text_1" msgid="9108592981418900836">"- यसले <xliff:g id="APP">%1$s</xliff:g> को जानकारी पढ्न सक्छ"</string>
+ <string name="abc_slice_permission_text_2" msgid="7135705417979137589">"- यसले <xliff:g id="APP">%1$s</xliff:g> भित्र कारबाही गर्न सक्छ"</string>
+ <string name="abc_slice_permission_allow" msgid="6374752258872407887">"अनुमति दिनुहोस्"</string>
+ <string name="abc_slice_permission_deny" msgid="576316744017426251">"अनुमति नदिनु…"</string>
</resources>
diff --git a/slice/slice-core/src/main/res/values-nl/strings.xml b/slice/slice-core/src/main/res/values-nl/strings.xml
index ffbb174..069e38b 100644
--- a/slice/slice-core/src/main/res/values-nl/strings.xml
+++ b/slice/slice-core/src/main/res/values-nl/strings.xml
@@ -17,10 +17,10 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slices_permission_request" msgid="3604847235923472451">"<xliff:g id="APP_0">%1$s</xliff:g> wil segmenten van <xliff:g id="APP_2">%2$s</xliff:g> tonen"</string>
- <string name="abc_slice_permission_title" msgid="4175332421259324948">"<xliff:g id="APP_0">%1$s</xliff:g> toestaan om segmenten van <xliff:g id="APP_2">%2$s</xliff:g> te tonen?"</string>
- <string name="abc_slice_permission_text_1" msgid="4525743640399572811">"- Deze kan informatie lezen van <xliff:g id="APP">%1$s</xliff:g>"</string>
- <string name="abc_slice_permission_text_2" msgid="7323565634860251794">"- Deze kan acties uitvoeren in <xliff:g id="APP">%1$s</xliff:g>"</string>
- <string name="abc_slice_permission_allow" msgid="5024599872061409708">"Toestaan"</string>
- <string name="abc_slice_permission_deny" msgid="3819478292430407705">"Weigeren"</string>
+ <string name="abc_slices_permission_request" msgid="4431189529265983653">"<xliff:g id="APP_0">%1$s</xliff:g> wil segmenten van <xliff:g id="APP_2">%2$s</xliff:g> tonen"</string>
+ <string name="abc_slice_permission_title" msgid="4776010267128891014">"<xliff:g id="APP_0">%1$s</xliff:g> toestaan om segmenten van <xliff:g id="APP_2">%2$s</xliff:g> te tonen?"</string>
+ <string name="abc_slice_permission_text_1" msgid="9108592981418900836">"- Deze kan informatie lezen van <xliff:g id="APP">%1$s</xliff:g>"</string>
+ <string name="abc_slice_permission_text_2" msgid="7135705417979137589">"- Deze kan acties uitvoeren in <xliff:g id="APP">%1$s</xliff:g>"</string>
+ <string name="abc_slice_permission_allow" msgid="6374752258872407887">"Toestaan"</string>
+ <string name="abc_slice_permission_deny" msgid="576316744017426251">"Weigeren"</string>
</resources>
diff --git a/slice/slice-core/src/main/res/values-or/strings.xml b/slice/slice-core/src/main/res/values-or/strings.xml
index 672f51c..4b9bd75 100644
--- a/slice/slice-core/src/main/res/values-or/strings.xml
+++ b/slice/slice-core/src/main/res/values-or/strings.xml
@@ -17,10 +17,10 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slices_permission_request" msgid="3604847235923472451">"<xliff:g id="APP_0">%1$s</xliff:g>, <xliff:g id="APP_2">%2$s</xliff:g> ସ୍ଲାଇସ୍କୁ ଦେଖାଇବା ପାଇଁ ଚାହେଁ"</string>
- <string name="abc_slice_permission_title" msgid="4175332421259324948">"<xliff:g id="APP_2">%2$s</xliff:g> ସ୍ଲାଇସ୍କୁ ଦେଖାଇବା ପାଇଁ <xliff:g id="APP_0">%1$s</xliff:g>କୁ ଅନୁମତି ଦେବେ?"</string>
- <string name="abc_slice_permission_text_1" msgid="4525743640399572811">"- ଏହା <xliff:g id="APP">%1$s</xliff:g>ରୁ ସୂଚନାକୁ ପଢ଼ିପାରିବ"</string>
- <string name="abc_slice_permission_text_2" msgid="7323565634860251794">"- ଏହା <xliff:g id="APP">%1$s</xliff:g> ଭିତରେ କାମ କରିପାରିବ"</string>
- <string name="abc_slice_permission_allow" msgid="5024599872061409708">"ଅନୁମତି ଦିଅନ୍ତୁ"</string>
- <string name="abc_slice_permission_deny" msgid="3819478292430407705">"ଅଗ୍ରାହ୍ୟ କରନ୍ତୁ"</string>
+ <string name="abc_slices_permission_request" msgid="4431189529265983653">"<xliff:g id="APP_0">%1$s</xliff:g>, <xliff:g id="APP_2">%2$s</xliff:g> ସ୍ଲାଇସଗୁଡ଼ିକ ଦେଖାଇବାକୁ ଚାହେଁ"</string>
+ <string name="abc_slice_permission_title" msgid="4776010267128891014">"<xliff:g id="APP_2">%2$s</xliff:g> ସ୍ଲାଇସଗୁଡ଼ିକ ଦେଖାଇବା ପାଇଁ <xliff:g id="APP_0">%1$s</xliff:g>କୁ ଅନୁମତି ଦେବେ କି?"</string>
+ <string name="abc_slice_permission_text_1" msgid="9108592981418900836">"- ଏହା <xliff:g id="APP">%1$s</xliff:g>ରୁ ସୂଚନା ପଢ଼ିପାରିବ"</string>
+ <string name="abc_slice_permission_text_2" msgid="7135705417979137589">"- ଏହା <xliff:g id="APP">%1$s</xliff:g> ଭିତରେ କାମ କରିପାରିବ"</string>
+ <string name="abc_slice_permission_allow" msgid="6374752258872407887">"ଅନୁମତି ଦିଅନ୍ତୁ"</string>
+ <string name="abc_slice_permission_deny" msgid="576316744017426251">"ଅଗ୍ରାହ୍ୟ କରନ୍ତୁ"</string>
</resources>
diff --git a/slice/slice-core/src/main/res/values-pa/strings.xml b/slice/slice-core/src/main/res/values-pa/strings.xml
index 03c926e..12426fd 100644
--- a/slice/slice-core/src/main/res/values-pa/strings.xml
+++ b/slice/slice-core/src/main/res/values-pa/strings.xml
@@ -17,10 +17,10 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slices_permission_request" msgid="3604847235923472451">"<xliff:g id="APP_0">%1$s</xliff:g> ਦੀ <xliff:g id="APP_2">%2$s</xliff:g> ਦੇ ਹਿੱਸੇ ਦਿਖਾਉਣ ਦੀ ਇੱਛਾ ਹੈ"</string>
- <string name="abc_slice_permission_title" msgid="4175332421259324948">"ਕੀ <xliff:g id="APP_0">%1$s</xliff:g> ਨੂੰ <xliff:g id="APP_2">%2$s</xliff:g> ਦੇ ਹਿੱਸੇ ਦਿਖਾਉਣ ਦੇਣੇ ਹਨ?"</string>
- <string name="abc_slice_permission_text_1" msgid="4525743640399572811">"- ਇਹ <xliff:g id="APP">%1$s</xliff:g> ਵਿੱਚੋਂ ਜਾਣਕਾਰੀ ਪੜ੍ਹ ਸਕਦਾ ਹੈ"</string>
- <string name="abc_slice_permission_text_2" msgid="7323565634860251794">"- ਇਸ <xliff:g id="APP">%1$s</xliff:g> ਦੇ ਅੰਦਰ ਕਾਰਵਾਈਆਂ ਕਰ ਸਕਦਾ ਹੈ"</string>
- <string name="abc_slice_permission_allow" msgid="5024599872061409708">"ਕਰਨ ਦਿਓ"</string>
- <string name="abc_slice_permission_deny" msgid="3819478292430407705">"ਅਸਵੀਕਾਰ ਕਰੋ"</string>
+ <string name="abc_slices_permission_request" msgid="4431189529265983653">"<xliff:g id="APP_0">%1$s</xliff:g> ਦੀ <xliff:g id="APP_2">%2$s</xliff:g> ਦੇ ਹਿੱਸੇ ਦਿਖਾਉਣ ਦੀ ਇੱਛਾ ਹੈ"</string>
+ <string name="abc_slice_permission_title" msgid="4776010267128891014">"ਕੀ <xliff:g id="APP_0">%1$s</xliff:g> ਨੂੰ <xliff:g id="APP_2">%2$s</xliff:g> ਦੇ ਹਿੱਸੇ ਦਿਖਾਉਣ ਦੀ ਆਗਿਆ ਦੇਣੀ ਹੈ?"</string>
+ <string name="abc_slice_permission_text_1" msgid="9108592981418900836">"- ਇਹ <xliff:g id="APP">%1$s</xliff:g> ਵਿੱਚੋਂ ਜਾਣਕਾਰੀ ਪੜ੍ਹ ਸਕਦਾ ਹੈ"</string>
+ <string name="abc_slice_permission_text_2" msgid="7135705417979137589">"- ਇਸ <xliff:g id="APP">%1$s</xliff:g> ਦੇ ਅੰਦਰ ਕਾਰਵਾਈਆਂ ਕਰ ਸਕਦਾ ਹੈ"</string>
+ <string name="abc_slice_permission_allow" msgid="6374752258872407887">"ਆਗਿਆ ਦਿਓ"</string>
+ <string name="abc_slice_permission_deny" msgid="576316744017426251">"ਮਨ੍ਹਾ ਕਰੋ"</string>
</resources>
diff --git a/slice/slice-core/src/main/res/values-pl/strings.xml b/slice/slice-core/src/main/res/values-pl/strings.xml
index 7ef7e74..0fc0336 100644
--- a/slice/slice-core/src/main/res/values-pl/strings.xml
+++ b/slice/slice-core/src/main/res/values-pl/strings.xml
@@ -17,10 +17,10 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slices_permission_request" msgid="3604847235923472451">"Aplikacja <xliff:g id="APP_0">%1$s</xliff:g> chce pokazywać wycinki z aplikacji <xliff:g id="APP_2">%2$s</xliff:g>"</string>
- <string name="abc_slice_permission_title" msgid="4175332421259324948">"Zezwolić aplikacji <xliff:g id="APP_0">%1$s</xliff:g> na pokazywanie wycinków z aplikacji <xliff:g id="APP_2">%2$s</xliff:g>?"</string>
- <string name="abc_slice_permission_text_1" msgid="4525743640399572811">"- Może odczytywać informacje z aplikacji <xliff:g id="APP">%1$s</xliff:g>"</string>
- <string name="abc_slice_permission_text_2" msgid="7323565634860251794">"- Może wykonywać działania w aplikacji <xliff:g id="APP">%1$s</xliff:g>"</string>
- <string name="abc_slice_permission_allow" msgid="5024599872061409708">"Zezwól"</string>
- <string name="abc_slice_permission_deny" msgid="3819478292430407705">"Odmów"</string>
+ <string name="abc_slices_permission_request" msgid="4431189529265983653">"Aplikacja <xliff:g id="APP_0">%1$s</xliff:g> chce pokazywać wycinki z aplikacji <xliff:g id="APP_2">%2$s</xliff:g>"</string>
+ <string name="abc_slice_permission_title" msgid="4776010267128891014">"Zezwolić aplikacji <xliff:g id="APP_0">%1$s</xliff:g> na pokazywanie wycinków z aplikacji <xliff:g id="APP_2">%2$s</xliff:g>?"</string>
+ <string name="abc_slice_permission_text_1" msgid="9108592981418900836">"- Może odczytywać informacje z aplikacji <xliff:g id="APP">%1$s</xliff:g>"</string>
+ <string name="abc_slice_permission_text_2" msgid="7135705417979137589">"- Może wykonywać działania w aplikacji <xliff:g id="APP">%1$s</xliff:g>"</string>
+ <string name="abc_slice_permission_allow" msgid="6374752258872407887">"Zezwól"</string>
+ <string name="abc_slice_permission_deny" msgid="576316744017426251">"Odrzuć"</string>
</resources>
diff --git a/slice/slice-core/src/main/res/values-pt-rBR/strings.xml b/slice/slice-core/src/main/res/values-pt-rBR/strings.xml
index 4920aed..559841d 100644
--- a/slice/slice-core/src/main/res/values-pt-rBR/strings.xml
+++ b/slice/slice-core/src/main/res/values-pt-rBR/strings.xml
@@ -17,10 +17,10 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slices_permission_request" msgid="3604847235923472451">"<xliff:g id="APP_0">%1$s</xliff:g> quer mostrar partes do app <xliff:g id="APP_2">%2$s</xliff:g>"</string>
- <string name="abc_slice_permission_title" msgid="4175332421259324948">"Permitir que <xliff:g id="APP_0">%1$s</xliff:g> mostre partes do app <xliff:g id="APP_2">%2$s</xliff:g>?"</string>
- <string name="abc_slice_permission_text_1" msgid="4525743640399572811">"- Pode ler informações do app <xliff:g id="APP">%1$s</xliff:g>"</string>
- <string name="abc_slice_permission_text_2" msgid="7323565634860251794">"- Pode realizar ações no app <xliff:g id="APP">%1$s</xliff:g>"</string>
- <string name="abc_slice_permission_allow" msgid="5024599872061409708">"Permitir"</string>
- <string name="abc_slice_permission_deny" msgid="3819478292430407705">"Negar"</string>
+ <string name="abc_slices_permission_request" msgid="4431189529265983653">"<xliff:g id="APP_0">%1$s</xliff:g> quer mostrar partes do app <xliff:g id="APP_2">%2$s</xliff:g>"</string>
+ <string name="abc_slice_permission_title" msgid="4776010267128891014">"Permitir que <xliff:g id="APP_0">%1$s</xliff:g> mostre partes do app <xliff:g id="APP_2">%2$s</xliff:g>?"</string>
+ <string name="abc_slice_permission_text_1" msgid="9108592981418900836">"- Pode ler informações do app <xliff:g id="APP">%1$s</xliff:g>"</string>
+ <string name="abc_slice_permission_text_2" msgid="7135705417979137589">"- Pode realizar ações no app <xliff:g id="APP">%1$s</xliff:g>"</string>
+ <string name="abc_slice_permission_allow" msgid="6374752258872407887">"Permitir"</string>
+ <string name="abc_slice_permission_deny" msgid="576316744017426251">"Negar"</string>
</resources>
diff --git a/slice/slice-core/src/main/res/values-pt-rPT/strings.xml b/slice/slice-core/src/main/res/values-pt-rPT/strings.xml
index cdf0555..b394bfd 100644
--- a/slice/slice-core/src/main/res/values-pt-rPT/strings.xml
+++ b/slice/slice-core/src/main/res/values-pt-rPT/strings.xml
@@ -17,10 +17,10 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slices_permission_request" msgid="3604847235923472451">"A app <xliff:g id="APP_0">%1$s</xliff:g> pretende mostrar partes da app <xliff:g id="APP_2">%2$s</xliff:g>."</string>
- <string name="abc_slice_permission_title" msgid="4175332421259324948">"Permitir que a app <xliff:g id="APP_0">%1$s</xliff:g> mostre partes da app <xliff:g id="APP_2">%2$s</xliff:g>?"</string>
- <string name="abc_slice_permission_text_1" msgid="4525743640399572811">"- Pode ler informações da app <xliff:g id="APP">%1$s</xliff:g>"</string>
- <string name="abc_slice_permission_text_2" msgid="7323565634860251794">"- Pode realizar ações na app <xliff:g id="APP">%1$s</xliff:g>"</string>
- <string name="abc_slice_permission_allow" msgid="5024599872061409708">"Permitir"</string>
- <string name="abc_slice_permission_deny" msgid="3819478292430407705">"Recusar"</string>
+ <string name="abc_slices_permission_request" msgid="4431189529265983653">"A app <xliff:g id="APP_0">%1$s</xliff:g> pretende mostrar partes da app <xliff:g id="APP_2">%2$s</xliff:g>"</string>
+ <string name="abc_slice_permission_title" msgid="4776010267128891014">"Pretende permitir que a app <xliff:g id="APP_0">%1$s</xliff:g> mostre partes da app <xliff:g id="APP_2">%2$s</xliff:g>?"</string>
+ <string name="abc_slice_permission_text_1" msgid="9108592981418900836">"- Pode ler informações da app <xliff:g id="APP">%1$s</xliff:g>"</string>
+ <string name="abc_slice_permission_text_2" msgid="7135705417979137589">"- Pode realizar ações na app <xliff:g id="APP">%1$s</xliff:g>"</string>
+ <string name="abc_slice_permission_allow" msgid="6374752258872407887">"Permitir"</string>
+ <string name="abc_slice_permission_deny" msgid="576316744017426251">"Recusar"</string>
</resources>
diff --git a/slice/slice-core/src/main/res/values-pt/strings.xml b/slice/slice-core/src/main/res/values-pt/strings.xml
index 4920aed..559841d 100644
--- a/slice/slice-core/src/main/res/values-pt/strings.xml
+++ b/slice/slice-core/src/main/res/values-pt/strings.xml
@@ -17,10 +17,10 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slices_permission_request" msgid="3604847235923472451">"<xliff:g id="APP_0">%1$s</xliff:g> quer mostrar partes do app <xliff:g id="APP_2">%2$s</xliff:g>"</string>
- <string name="abc_slice_permission_title" msgid="4175332421259324948">"Permitir que <xliff:g id="APP_0">%1$s</xliff:g> mostre partes do app <xliff:g id="APP_2">%2$s</xliff:g>?"</string>
- <string name="abc_slice_permission_text_1" msgid="4525743640399572811">"- Pode ler informações do app <xliff:g id="APP">%1$s</xliff:g>"</string>
- <string name="abc_slice_permission_text_2" msgid="7323565634860251794">"- Pode realizar ações no app <xliff:g id="APP">%1$s</xliff:g>"</string>
- <string name="abc_slice_permission_allow" msgid="5024599872061409708">"Permitir"</string>
- <string name="abc_slice_permission_deny" msgid="3819478292430407705">"Negar"</string>
+ <string name="abc_slices_permission_request" msgid="4431189529265983653">"<xliff:g id="APP_0">%1$s</xliff:g> quer mostrar partes do app <xliff:g id="APP_2">%2$s</xliff:g>"</string>
+ <string name="abc_slice_permission_title" msgid="4776010267128891014">"Permitir que <xliff:g id="APP_0">%1$s</xliff:g> mostre partes do app <xliff:g id="APP_2">%2$s</xliff:g>?"</string>
+ <string name="abc_slice_permission_text_1" msgid="9108592981418900836">"- Pode ler informações do app <xliff:g id="APP">%1$s</xliff:g>"</string>
+ <string name="abc_slice_permission_text_2" msgid="7135705417979137589">"- Pode realizar ações no app <xliff:g id="APP">%1$s</xliff:g>"</string>
+ <string name="abc_slice_permission_allow" msgid="6374752258872407887">"Permitir"</string>
+ <string name="abc_slice_permission_deny" msgid="576316744017426251">"Negar"</string>
</resources>
diff --git a/slice/slice-core/src/main/res/values-ro/strings.xml b/slice/slice-core/src/main/res/values-ro/strings.xml
index 68da8f3..6339576 100644
--- a/slice/slice-core/src/main/res/values-ro/strings.xml
+++ b/slice/slice-core/src/main/res/values-ro/strings.xml
@@ -17,10 +17,10 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slices_permission_request" msgid="3604847235923472451">"<xliff:g id="APP_0">%1$s</xliff:g> vrea să afișeze porțiuni din <xliff:g id="APP_2">%2$s</xliff:g>"</string>
- <string name="abc_slice_permission_title" msgid="4175332421259324948">"Permiteți <xliff:g id="APP_0">%1$s</xliff:g> să afișeze porțiuni din <xliff:g id="APP_2">%2$s</xliff:g>?"</string>
- <string name="abc_slice_permission_text_1" msgid="4525743640399572811">"- Poate citi informații din <xliff:g id="APP">%1$s</xliff:g>"</string>
- <string name="abc_slice_permission_text_2" msgid="7323565634860251794">"- Poate efectua acțiuni în <xliff:g id="APP">%1$s</xliff:g>"</string>
- <string name="abc_slice_permission_allow" msgid="5024599872061409708">"Permiteți"</string>
- <string name="abc_slice_permission_deny" msgid="3819478292430407705">"Refuzați"</string>
+ <string name="abc_slices_permission_request" msgid="4431189529265983653">"<xliff:g id="APP_0">%1$s</xliff:g> vrea să afișeze secțiuni din <xliff:g id="APP_2">%2$s</xliff:g>"</string>
+ <string name="abc_slice_permission_title" msgid="4776010267128891014">"Permiteți ca <xliff:g id="APP_0">%1$s</xliff:g> să afișeze secțiuni din <xliff:g id="APP_2">%2$s</xliff:g>?"</string>
+ <string name="abc_slice_permission_text_1" msgid="9108592981418900836">"– Poate citi informații din <xliff:g id="APP">%1$s</xliff:g>"</string>
+ <string name="abc_slice_permission_text_2" msgid="7135705417979137589">"– Poate realiza acțiuni în <xliff:g id="APP">%1$s</xliff:g>"</string>
+ <string name="abc_slice_permission_allow" msgid="6374752258872407887">"Permiteți"</string>
+ <string name="abc_slice_permission_deny" msgid="576316744017426251">"Refuzați"</string>
</resources>
diff --git a/slice/slice-core/src/main/res/values-ru/strings.xml b/slice/slice-core/src/main/res/values-ru/strings.xml
index 5a933ca..267af58 100644
--- a/slice/slice-core/src/main/res/values-ru/strings.xml
+++ b/slice/slice-core/src/main/res/values-ru/strings.xml
@@ -17,10 +17,10 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slices_permission_request" msgid="3604847235923472451">"Приложение \"<xliff:g id="APP_0">%1$s</xliff:g>\" запрашивает разрешение на показ фрагментов приложения \"<xliff:g id="APP_2">%2$s</xliff:g>\"."</string>
- <string name="abc_slice_permission_title" msgid="4175332421259324948">"Разрешить приложению \"<xliff:g id="APP_0">%1$s</xliff:g>\" показывать фрагменты приложения \"<xliff:g id="APP_2">%2$s</xliff:g>\"?"</string>
- <string name="abc_slice_permission_text_1" msgid="4525743640399572811">"– Ему станут доступны данные из приложения \"<xliff:g id="APP">%1$s</xliff:g>\"."</string>
- <string name="abc_slice_permission_text_2" msgid="7323565634860251794">"– Оно сможет совершать действия в приложении \"<xliff:g id="APP">%1$s</xliff:g>\"."</string>
- <string name="abc_slice_permission_allow" msgid="5024599872061409708">"Да"</string>
- <string name="abc_slice_permission_deny" msgid="3819478292430407705">"Нет"</string>
+ <string name="abc_slices_permission_request" msgid="4431189529265983653">"Приложение \"<xliff:g id="APP_0">%1$s</xliff:g>\" запрашивает разрешение на показ фрагментов приложения \"<xliff:g id="APP_2">%2$s</xliff:g>\"."</string>
+ <string name="abc_slice_permission_title" msgid="4776010267128891014">"Разрешить приложению \"<xliff:g id="APP_0">%1$s</xliff:g>\" показывать фрагменты приложения \"<xliff:g id="APP_2">%2$s</xliff:g>\"?"</string>
+ <string name="abc_slice_permission_text_1" msgid="9108592981418900836">"– Ему станут доступны данные из приложения \"<xliff:g id="APP">%1$s</xliff:g>\"."</string>
+ <string name="abc_slice_permission_text_2" msgid="7135705417979137589">"– Оно сможет совершать действия в приложении \"<xliff:g id="APP">%1$s</xliff:g>\"."</string>
+ <string name="abc_slice_permission_allow" msgid="6374752258872407887">"Разрешить"</string>
+ <string name="abc_slice_permission_deny" msgid="576316744017426251">"Запретить"</string>
</resources>
diff --git a/slice/slice-core/src/main/res/values-si/strings.xml b/slice/slice-core/src/main/res/values-si/strings.xml
index 74ff957..5f62c0a 100644
--- a/slice/slice-core/src/main/res/values-si/strings.xml
+++ b/slice/slice-core/src/main/res/values-si/strings.xml
@@ -17,10 +17,10 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slices_permission_request" msgid="3604847235923472451">"<xliff:g id="APP_0">%1$s</xliff:g> හට කොටස් <xliff:g id="APP_2">%2$s</xliff:g>ක් පෙන්වීමට අවශ්යයි"</string>
- <string name="abc_slice_permission_title" msgid="4175332421259324948">"<xliff:g id="APP_0">%1$s</xliff:g> හට කොටස් <xliff:g id="APP_2">%2$s</xliff:g>ක් පෙන්වීමට ඉඩ දෙන්නද?"</string>
- <string name="abc_slice_permission_text_1" msgid="4525743640399572811">"- එයට <xliff:g id="APP">%1$s</xliff:g> වෙතින් තොරතුරු කියවිය හැකිය"</string>
- <string name="abc_slice_permission_text_2" msgid="7323565634860251794">"- එයට <xliff:g id="APP">%1$s</xliff:g> ඇතුළත ක්රියාමාර්ග ගත හැකිය"</string>
- <string name="abc_slice_permission_allow" msgid="5024599872061409708">"ඉඩ දෙන්න"</string>
- <string name="abc_slice_permission_deny" msgid="3819478292430407705">"ප්රතික්ෂේප කර."</string>
+ <string name="abc_slices_permission_request" msgid="4431189529265983653">"<xliff:g id="APP_0">%1$s</xliff:g> හට කොටස් <xliff:g id="APP_2">%2$s</xliff:g>ක් පෙන්වීමට අවශ්යයි"</string>
+ <string name="abc_slice_permission_title" msgid="4776010267128891014">"<xliff:g id="APP_0">%1$s</xliff:g> හට කොටස් <xliff:g id="APP_2">%2$s</xliff:g>ක් පෙන්වීමට ඉඩ දෙන්නද?"</string>
+ <string name="abc_slice_permission_text_1" msgid="9108592981418900836">"- එයට <xliff:g id="APP">%1$s</xliff:g> වෙතින් තොරතුරු කියවිය හැකිය"</string>
+ <string name="abc_slice_permission_text_2" msgid="7135705417979137589">"- එයට <xliff:g id="APP">%1$s</xliff:g> ඇතුළත ක්රියාමාර්ග ගත හැකිය"</string>
+ <string name="abc_slice_permission_allow" msgid="6374752258872407887">"ඉඩ දෙන්න"</string>
+ <string name="abc_slice_permission_deny" msgid="576316744017426251">"ප්රතික්ෂේප කර."</string>
</resources>
diff --git a/slice/slice-core/src/main/res/values-sk/strings.xml b/slice/slice-core/src/main/res/values-sk/strings.xml
index 04053ff..be40915 100644
--- a/slice/slice-core/src/main/res/values-sk/strings.xml
+++ b/slice/slice-core/src/main/res/values-sk/strings.xml
@@ -17,10 +17,10 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slices_permission_request" msgid="3604847235923472451">"<xliff:g id="APP_0">%1$s</xliff:g> chce zobrazovať rezy z aplikácie <xliff:g id="APP_2">%2$s</xliff:g>"</string>
- <string name="abc_slice_permission_title" msgid="4175332421259324948">"Povoliť aplikácii <xliff:g id="APP_0">%1$s</xliff:g> zobrazovať rezy z aplikácie <xliff:g id="APP_2">%2$s</xliff:g>?"</string>
- <string name="abc_slice_permission_text_1" msgid="4525743640399572811">"– Môže čítať informácie z aplikácie <xliff:g id="APP">%1$s</xliff:g>"</string>
- <string name="abc_slice_permission_text_2" msgid="7323565634860251794">"– Môže vykonávať akcie v aplikácii <xliff:g id="APP">%1$s</xliff:g>"</string>
- <string name="abc_slice_permission_allow" msgid="5024599872061409708">"Povoliť"</string>
- <string name="abc_slice_permission_deny" msgid="3819478292430407705">"Zamietnuť"</string>
+ <string name="abc_slices_permission_request" msgid="4431189529265983653">"<xliff:g id="APP_0">%1$s</xliff:g> chce zobrazovať výňatky z aplikácie <xliff:g id="APP_2">%2$s</xliff:g>"</string>
+ <string name="abc_slice_permission_title" msgid="4776010267128891014">"Chcete povoliť aplikácii <xliff:g id="APP_0">%1$s</xliff:g> zobrazovať výňatok z aplikácie <xliff:g id="APP_2">%2$s</xliff:g>?"</string>
+ <string name="abc_slice_permission_text_1" msgid="9108592981418900836">"– Môže čítať informácie z aplikácie <xliff:g id="APP">%1$s</xliff:g>"</string>
+ <string name="abc_slice_permission_text_2" msgid="7135705417979137589">"– Môže vykonávať akcie v aplikácii <xliff:g id="APP">%1$s</xliff:g>"</string>
+ <string name="abc_slice_permission_allow" msgid="6374752258872407887">"Povoliť"</string>
+ <string name="abc_slice_permission_deny" msgid="576316744017426251">"Zamietnuť"</string>
</resources>
diff --git a/slice/slice-core/src/main/res/values-sl/strings.xml b/slice/slice-core/src/main/res/values-sl/strings.xml
index 88df9ec..ae10c63d 100644
--- a/slice/slice-core/src/main/res/values-sl/strings.xml
+++ b/slice/slice-core/src/main/res/values-sl/strings.xml
@@ -17,10 +17,10 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slices_permission_request" msgid="3604847235923472451">"Aplikacija <xliff:g id="APP_0">%1$s</xliff:g> želi prikazati izreze iz aplikacije <xliff:g id="APP_2">%2$s</xliff:g>"</string>
- <string name="abc_slice_permission_title" msgid="4175332421259324948">"Ali aplikaciji <xliff:g id="APP_0">%1$s</xliff:g> dovolite prikazovanje izrezov iz aplikacije <xliff:g id="APP_2">%2$s</xliff:g>?"</string>
- <string name="abc_slice_permission_text_1" msgid="4525743640399572811">"– lahko bere podatke v aplikaciji <xliff:g id="APP">%1$s</xliff:g>"</string>
- <string name="abc_slice_permission_text_2" msgid="7323565634860251794">"– lahko izvaja dejanja v aplikaciji <xliff:g id="APP">%1$s</xliff:g>"</string>
- <string name="abc_slice_permission_allow" msgid="5024599872061409708">"Dovoli"</string>
- <string name="abc_slice_permission_deny" msgid="3819478292430407705">"Zavrni"</string>
+ <string name="abc_slices_permission_request" msgid="4431189529265983653">"Aplikacija <xliff:g id="APP_0">%1$s</xliff:g> želi prikazati izreze aplikacije <xliff:g id="APP_2">%2$s</xliff:g>."</string>
+ <string name="abc_slice_permission_title" msgid="4776010267128891014">"Želite dovoliti, da aplikacija <xliff:g id="APP_0">%1$s</xliff:g> prikaže izreze aplikacije <xliff:g id="APP_2">%2$s</xliff:g>?"</string>
+ <string name="abc_slice_permission_text_1" msgid="9108592981418900836">"– lahko bere podatke v aplikaciji <xliff:g id="APP">%1$s</xliff:g>."</string>
+ <string name="abc_slice_permission_text_2" msgid="7135705417979137589">"– lahko izvaja dejanja v aplikaciji <xliff:g id="APP">%1$s</xliff:g>."</string>
+ <string name="abc_slice_permission_allow" msgid="6374752258872407887">"Dovoli"</string>
+ <string name="abc_slice_permission_deny" msgid="576316744017426251">"Zavrni"</string>
</resources>
diff --git a/slice/slice-core/src/main/res/values-sq/strings.xml b/slice/slice-core/src/main/res/values-sq/strings.xml
index 5e56aea..55c2f0f 100644
--- a/slice/slice-core/src/main/res/values-sq/strings.xml
+++ b/slice/slice-core/src/main/res/values-sq/strings.xml
@@ -17,10 +17,10 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slices_permission_request" msgid="3604847235923472451">"<xliff:g id="APP_0">%1$s</xliff:g> dëshiron të shfaqë pjesë të <xliff:g id="APP_2">%2$s</xliff:g>"</string>
- <string name="abc_slice_permission_title" msgid="4175332421259324948">"Të lejohet <xliff:g id="APP_0">%1$s</xliff:g> që të shfaqë pjesë të <xliff:g id="APP_2">%2$s</xliff:g>?"</string>
- <string name="abc_slice_permission_text_1" msgid="4525743640399572811">"- Mund të lexojë informacion nga <xliff:g id="APP">%1$s</xliff:g>"</string>
- <string name="abc_slice_permission_text_2" msgid="7323565634860251794">"- Mund të ndërmarrë veprime brenda <xliff:g id="APP">%1$s</xliff:g>"</string>
- <string name="abc_slice_permission_allow" msgid="5024599872061409708">"Lejo"</string>
- <string name="abc_slice_permission_deny" msgid="3819478292430407705">"Refuzo"</string>
+ <string name="abc_slices_permission_request" msgid="4431189529265983653">"<xliff:g id="APP_0">%1$s</xliff:g> dëshiron të shfaqë pjesë të <xliff:g id="APP_2">%2$s</xliff:g>"</string>
+ <string name="abc_slice_permission_title" msgid="4776010267128891014">"Të lejohet <xliff:g id="APP_0">%1$s</xliff:g> që të shfaqë pjesë të <xliff:g id="APP_2">%2$s</xliff:g>?"</string>
+ <string name="abc_slice_permission_text_1" msgid="9108592981418900836">"- Mund të lexojë informacion nga <xliff:g id="APP">%1$s</xliff:g>"</string>
+ <string name="abc_slice_permission_text_2" msgid="7135705417979137589">"- Mund të ndërmarrë veprime brenda <xliff:g id="APP">%1$s</xliff:g>"</string>
+ <string name="abc_slice_permission_allow" msgid="6374752258872407887">"Lejo"</string>
+ <string name="abc_slice_permission_deny" msgid="576316744017426251">"Refuzo"</string>
</resources>
diff --git a/slice/slice-core/src/main/res/values-sr/strings.xml b/slice/slice-core/src/main/res/values-sr/strings.xml
index 1064600..6c88d06 100644
--- a/slice/slice-core/src/main/res/values-sr/strings.xml
+++ b/slice/slice-core/src/main/res/values-sr/strings.xml
@@ -17,10 +17,10 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slices_permission_request" msgid="3604847235923472451">"Апликација <xliff:g id="APP_0">%1$s</xliff:g> жели да приказује исечке из апликације <xliff:g id="APP_2">%2$s</xliff:g>"</string>
- <string name="abc_slice_permission_title" msgid="4175332421259324948">"Желите ли да дозволите апликацији <xliff:g id="APP_0">%1$s</xliff:g> да приказује исечке из апликације <xliff:g id="APP_2">%2$s</xliff:g>?"</string>
- <string name="abc_slice_permission_text_1" msgid="4525743640399572811">"– Може да чита податке из апликације <xliff:g id="APP">%1$s</xliff:g>"</string>
- <string name="abc_slice_permission_text_2" msgid="7323565634860251794">"– Може да обавља радње у апликацији <xliff:g id="APP">%1$s</xliff:g>"</string>
- <string name="abc_slice_permission_allow" msgid="5024599872061409708">"Дозволи"</string>
- <string name="abc_slice_permission_deny" msgid="3819478292430407705">"Одбиј"</string>
+ <string name="abc_slices_permission_request" msgid="4431189529265983653">"Апликација <xliff:g id="APP_0">%1$s</xliff:g> жели да приказује фрагменте из апликације <xliff:g id="APP_2">%2$s</xliff:g>"</string>
+ <string name="abc_slice_permission_title" msgid="4776010267128891014">"Желите ли да дозволите апликацији <xliff:g id="APP_0">%1$s</xliff:g> да приказује фрагменте из апликације <xliff:g id="APP_2">%2$s</xliff:g>?"</string>
+ <string name="abc_slice_permission_text_1" msgid="9108592981418900836">"– Може да чита податке из апликације <xliff:g id="APP">%1$s</xliff:g>"</string>
+ <string name="abc_slice_permission_text_2" msgid="7135705417979137589">"– Може да обавља радње у апликацији <xliff:g id="APP">%1$s</xliff:g>"</string>
+ <string name="abc_slice_permission_allow" msgid="6374752258872407887">"Дозволи"</string>
+ <string name="abc_slice_permission_deny" msgid="576316744017426251">"Одбиј"</string>
</resources>
diff --git a/slice/slice-core/src/main/res/values-sv/strings.xml b/slice/slice-core/src/main/res/values-sv/strings.xml
index 3a78a19..10f1ef1 100644
--- a/slice/slice-core/src/main/res/values-sv/strings.xml
+++ b/slice/slice-core/src/main/res/values-sv/strings.xml
@@ -17,10 +17,10 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slices_permission_request" msgid="3604847235923472451">"<xliff:g id="APP_0">%1$s</xliff:g> vill kunna visa bitar av <xliff:g id="APP_2">%2$s</xliff:g>"</string>
- <string name="abc_slice_permission_title" msgid="4175332421259324948">"Tillåter du att bitar av <xliff:g id="APP_2">%2$s</xliff:g> visas i <xliff:g id="APP_0">%1$s</xliff:g>?"</string>
- <string name="abc_slice_permission_text_1" msgid="4525743640399572811">"– Kan läsa information från <xliff:g id="APP">%1$s</xliff:g>"</string>
- <string name="abc_slice_permission_text_2" msgid="7323565634860251794">"– Kan vidta åtgärder i <xliff:g id="APP">%1$s</xliff:g>"</string>
- <string name="abc_slice_permission_allow" msgid="5024599872061409708">"Tillåt"</string>
- <string name="abc_slice_permission_deny" msgid="3819478292430407705">"Neka"</string>
+ <string name="abc_slices_permission_request" msgid="4431189529265983653">"<xliff:g id="APP_0">%1$s</xliff:g> vill kunna visa bitar av <xliff:g id="APP_2">%2$s</xliff:g>"</string>
+ <string name="abc_slice_permission_title" msgid="4776010267128891014">"Tillåter du att bitar av <xliff:g id="APP_2">%2$s</xliff:g> visas i <xliff:g id="APP_0">%1$s</xliff:g>?"</string>
+ <string name="abc_slice_permission_text_1" msgid="9108592981418900836">"– Kan läsa information från <xliff:g id="APP">%1$s</xliff:g>"</string>
+ <string name="abc_slice_permission_text_2" msgid="7135705417979137589">"– Kan vidta åtgärder i <xliff:g id="APP">%1$s</xliff:g>"</string>
+ <string name="abc_slice_permission_allow" msgid="6374752258872407887">"Tillåt"</string>
+ <string name="abc_slice_permission_deny" msgid="576316744017426251">"Neka"</string>
</resources>
diff --git a/slice/slice-core/src/main/res/values-sw/strings.xml b/slice/slice-core/src/main/res/values-sw/strings.xml
index e6a72a0..3c93854 100644
--- a/slice/slice-core/src/main/res/values-sw/strings.xml
+++ b/slice/slice-core/src/main/res/values-sw/strings.xml
@@ -17,10 +17,10 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slices_permission_request" msgid="3604847235923472451">"<xliff:g id="APP_0">%1$s</xliff:g> inataka kuonyesha vipengee <xliff:g id="APP_2">%2$s</xliff:g>"</string>
- <string name="abc_slice_permission_title" msgid="4175332421259324948">"Ungependa kuruhusu <xliff:g id="APP_0">%1$s</xliff:g> ionyeshe vipengee <xliff:g id="APP_2">%2$s</xliff:g>?"</string>
- <string name="abc_slice_permission_text_1" msgid="4525743640399572811">"- Inaweza kusoma maelezo kutoka <xliff:g id="APP">%1$s</xliff:g>"</string>
- <string name="abc_slice_permission_text_2" msgid="7323565634860251794">"- Inaweza kuchukua hatua ndani ya <xliff:g id="APP">%1$s</xliff:g>"</string>
- <string name="abc_slice_permission_allow" msgid="5024599872061409708">"Ruhusu"</string>
- <string name="abc_slice_permission_deny" msgid="3819478292430407705">"Kataa"</string>
+ <string name="abc_slices_permission_request" msgid="4431189529265983653">"<xliff:g id="APP_0">%1$s</xliff:g> inataka kuonyesha vipengee <xliff:g id="APP_2">%2$s</xliff:g>"</string>
+ <string name="abc_slice_permission_title" msgid="4776010267128891014">"Ungependa kuruhusu <xliff:g id="APP_0">%1$s</xliff:g> ionyeshe vipengee <xliff:g id="APP_2">%2$s</xliff:g>?"</string>
+ <string name="abc_slice_permission_text_1" msgid="9108592981418900836">"- Inaweza kusoma maelezo kutoka <xliff:g id="APP">%1$s</xliff:g>"</string>
+ <string name="abc_slice_permission_text_2" msgid="7135705417979137589">"- Inaweza kuchukua hatua ndani ya <xliff:g id="APP">%1$s</xliff:g>"</string>
+ <string name="abc_slice_permission_allow" msgid="6374752258872407887">"Ruhusu"</string>
+ <string name="abc_slice_permission_deny" msgid="576316744017426251">"Kataa"</string>
</resources>
diff --git a/slice/slice-core/src/main/res/values-ta/strings.xml b/slice/slice-core/src/main/res/values-ta/strings.xml
index 7f13957..abceab3 100644
--- a/slice/slice-core/src/main/res/values-ta/strings.xml
+++ b/slice/slice-core/src/main/res/values-ta/strings.xml
@@ -17,10 +17,10 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slices_permission_request" msgid="3604847235923472451">"<xliff:g id="APP_2">%2$s</xliff:g> ஆப்ஸின் விழிப்பூட்டல்களைக் காண்பிக்க, <xliff:g id="APP_0">%1$s</xliff:g> அனுமதி கேட்கிறது"</string>
- <string name="abc_slice_permission_title" msgid="4175332421259324948">"<xliff:g id="APP_2">%2$s</xliff:g> ஆப்ஸின் விழிப்பூட்டல்களைக் காண்பிக்க, <xliff:g id="APP_0">%1$s</xliff:g> ஆப்ஸை அனுமதிக்கவா?"</string>
- <string name="abc_slice_permission_text_1" msgid="4525743640399572811">"- இது, <xliff:g id="APP">%1$s</xliff:g> பயன்பாட்டிலிருக்கும் தகவலைப் படிக்கும்"</string>
- <string name="abc_slice_permission_text_2" msgid="7323565634860251794">"- இது, <xliff:g id="APP">%1$s</xliff:g> பயன்பாட்டிற்குள் செயல்பாடுகளில் ஈடுபடும்"</string>
- <string name="abc_slice_permission_allow" msgid="5024599872061409708">"அனுமதி"</string>
- <string name="abc_slice_permission_deny" msgid="3819478292430407705">"நிராகரி"</string>
+ <string name="abc_slices_permission_request" msgid="4431189529265983653">"<xliff:g id="APP_2">%2$s</xliff:g> ஆப்ஸின் ஸ்லைஸ்களை <xliff:g id="APP_0">%1$s</xliff:g> ஆப்ஸ் காட்ட விரும்புகிறது"</string>
+ <string name="abc_slice_permission_title" msgid="4776010267128891014">"<xliff:g id="APP_2">%2$s</xliff:g> ஆப்ஸின் ஸ்லைஸ்களைக் காட்ட <xliff:g id="APP_0">%1$s</xliff:g> ஆப்ஸை அனுமதிக்கவா?"</string>
+ <string name="abc_slice_permission_text_1" msgid="9108592981418900836">"- இது <xliff:g id="APP">%1$s</xliff:g> ஆப்ஸிலிருந்து தகவல்களைப் படிக்கும்"</string>
+ <string name="abc_slice_permission_text_2" msgid="7135705417979137589">"- இது <xliff:g id="APP">%1$s</xliff:g> ஆப்ஸுக்குள் சென்று செயல்களைச் செய்யும்"</string>
+ <string name="abc_slice_permission_allow" msgid="6374752258872407887">"அனுமதி"</string>
+ <string name="abc_slice_permission_deny" msgid="576316744017426251">"நிராகரி"</string>
</resources>
diff --git a/slice/slice-core/src/main/res/values-te/strings.xml b/slice/slice-core/src/main/res/values-te/strings.xml
index acbfe1f..c5b1592 100644
--- a/slice/slice-core/src/main/res/values-te/strings.xml
+++ b/slice/slice-core/src/main/res/values-te/strings.xml
@@ -17,10 +17,10 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slices_permission_request" msgid="3604847235923472451">"<xliff:g id="APP_0">%1$s</xliff:g> <xliff:g id="APP_2">%2$s</xliff:g> స్లైస్లను చూపించాలనుకుంటోంది"</string>
- <string name="abc_slice_permission_title" msgid="4175332421259324948">"<xliff:g id="APP_2">%2$s</xliff:g> స్లైస్లను చూపించడానికి <xliff:g id="APP_0">%1$s</xliff:g>ని అనుమతించాలా?"</string>
- <string name="abc_slice_permission_text_1" msgid="4525743640399572811">"- ఇది <xliff:g id="APP">%1$s</xliff:g> నుండి సమాచారాన్ని చదవగలుగుతుంది"</string>
- <string name="abc_slice_permission_text_2" msgid="7323565634860251794">"- ఇది <xliff:g id="APP">%1$s</xliff:g> లోపల చర్యలు తీసుకోగలుగుతుంది"</string>
- <string name="abc_slice_permission_allow" msgid="5024599872061409708">"అనుమతించు"</string>
- <string name="abc_slice_permission_deny" msgid="3819478292430407705">"తిరస్కరించు"</string>
+ <string name="abc_slices_permission_request" msgid="4431189529265983653">"<xliff:g id="APP_0">%1$s</xliff:g>, <xliff:g id="APP_2">%2$s</xliff:g> స్లైస్లను చూపించాలనుకుంటోంది"</string>
+ <string name="abc_slice_permission_title" msgid="4776010267128891014">"<xliff:g id="APP_2">%2$s</xliff:g> స్లైస్లను చూపించడానికి <xliff:g id="APP_0">%1$s</xliff:g>ను అనుమతించాలా?"</string>
+ <string name="abc_slice_permission_text_1" msgid="9108592981418900836">"- ఇది <xliff:g id="APP">%1$s</xliff:g> నుండి సమాచారాన్ని చదవగలదు"</string>
+ <string name="abc_slice_permission_text_2" msgid="7135705417979137589">"- ఇది <xliff:g id="APP">%1$s</xliff:g> లోపల చర్యలు తీసుకోగలదు"</string>
+ <string name="abc_slice_permission_allow" msgid="6374752258872407887">"అనుమతించండి"</string>
+ <string name="abc_slice_permission_deny" msgid="576316744017426251">"నిరాకరించండి"</string>
</resources>
diff --git a/slice/slice-core/src/main/res/values-th/strings.xml b/slice/slice-core/src/main/res/values-th/strings.xml
index b561742..a48a41d1 100644
--- a/slice/slice-core/src/main/res/values-th/strings.xml
+++ b/slice/slice-core/src/main/res/values-th/strings.xml
@@ -17,10 +17,10 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slices_permission_request" msgid="3604847235923472451">"<xliff:g id="APP_0">%1$s</xliff:g> ต้องการแสดงส่วนต่างๆ ของ <xliff:g id="APP_2">%2$s</xliff:g>"</string>
- <string name="abc_slice_permission_title" msgid="4175332421259324948">"อนุญาตให้ <xliff:g id="APP_0">%1$s</xliff:g> แสดงส่วนต่างๆ ของ <xliff:g id="APP_2">%2$s</xliff:g>"</string>
- <string name="abc_slice_permission_text_1" msgid="4525743640399572811">"- อ่านข้อมูลจาก <xliff:g id="APP">%1$s</xliff:g> ได้"</string>
- <string name="abc_slice_permission_text_2" msgid="7323565634860251794">"- ดำเนินการใน <xliff:g id="APP">%1$s</xliff:g> ได้"</string>
- <string name="abc_slice_permission_allow" msgid="5024599872061409708">"อนุญาต"</string>
- <string name="abc_slice_permission_deny" msgid="3819478292430407705">"ปฏิเสธ"</string>
+ <string name="abc_slices_permission_request" msgid="4431189529265983653">"<xliff:g id="APP_0">%1$s</xliff:g> ต้องการแสดงส่วนต่างๆ ของ <xliff:g id="APP_2">%2$s</xliff:g>"</string>
+ <string name="abc_slice_permission_title" msgid="4776010267128891014">"อนุญาตให้ <xliff:g id="APP_0">%1$s</xliff:g> แสดงส่วนต่างๆ ของ <xliff:g id="APP_2">%2$s</xliff:g> ไหม"</string>
+ <string name="abc_slice_permission_text_1" msgid="9108592981418900836">"- อ่านข้อมูลจาก <xliff:g id="APP">%1$s</xliff:g> ได้"</string>
+ <string name="abc_slice_permission_text_2" msgid="7135705417979137589">"- ดำเนินการใน <xliff:g id="APP">%1$s</xliff:g> ได้"</string>
+ <string name="abc_slice_permission_allow" msgid="6374752258872407887">"อนุญาต"</string>
+ <string name="abc_slice_permission_deny" msgid="576316744017426251">"ปฏิเสธ"</string>
</resources>
diff --git a/slice/slice-core/src/main/res/values-tl/strings.xml b/slice/slice-core/src/main/res/values-tl/strings.xml
index 3e0daf7..b4cf1fb 100644
--- a/slice/slice-core/src/main/res/values-tl/strings.xml
+++ b/slice/slice-core/src/main/res/values-tl/strings.xml
@@ -17,10 +17,10 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slices_permission_request" msgid="3604847235923472451">"Gustong ipakita ng <xliff:g id="APP_0">%1$s</xliff:g> ang mga slice ng <xliff:g id="APP_2">%2$s</xliff:g>"</string>
- <string name="abc_slice_permission_title" msgid="4175332421259324948">"Payagan ang <xliff:g id="APP_0">%1$s</xliff:g> na ipakita ang mga slice ng <xliff:g id="APP_2">%2$s</xliff:g>?"</string>
- <string name="abc_slice_permission_text_1" msgid="4525743640399572811">"- Nakakabasa ito ng impormasyon mula sa <xliff:g id="APP">%1$s</xliff:g>"</string>
- <string name="abc_slice_permission_text_2" msgid="7323565634860251794">"- Nakakagawa ito ng mga pagkilos sa loob ng <xliff:g id="APP">%1$s</xliff:g>"</string>
- <string name="abc_slice_permission_allow" msgid="5024599872061409708">"Payagan"</string>
- <string name="abc_slice_permission_deny" msgid="3819478292430407705">"Tanggihan"</string>
+ <string name="abc_slices_permission_request" msgid="4431189529265983653">"Gustong ipakita ng <xliff:g id="APP_0">%1$s</xliff:g> ang mga slice ng <xliff:g id="APP_2">%2$s</xliff:g>"</string>
+ <string name="abc_slice_permission_title" msgid="4776010267128891014">"Payagan ang <xliff:g id="APP_0">%1$s</xliff:g> na ipakita ang mga slice ng <xliff:g id="APP_2">%2$s</xliff:g>?"</string>
+ <string name="abc_slice_permission_text_1" msgid="9108592981418900836">"- Nakakabasa ito ng impormasyon mula sa <xliff:g id="APP">%1$s</xliff:g>"</string>
+ <string name="abc_slice_permission_text_2" msgid="7135705417979137589">"- Nakakagawa ito ng mga pagkilos sa <xliff:g id="APP">%1$s</xliff:g>"</string>
+ <string name="abc_slice_permission_allow" msgid="6374752258872407887">"Payagan"</string>
+ <string name="abc_slice_permission_deny" msgid="576316744017426251">"Tanggihan"</string>
</resources>
diff --git a/slice/slice-core/src/main/res/values-tr/strings.xml b/slice/slice-core/src/main/res/values-tr/strings.xml
index d8d3c87..cdc371f 100644
--- a/slice/slice-core/src/main/res/values-tr/strings.xml
+++ b/slice/slice-core/src/main/res/values-tr/strings.xml
@@ -17,10 +17,10 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slices_permission_request" msgid="3604847235923472451">"<xliff:g id="APP_0">%1$s</xliff:g> uygulaması, <xliff:g id="APP_2">%2$s</xliff:g> dilimlerini göstermek istiyor"</string>
- <string name="abc_slice_permission_title" msgid="4175332421259324948">"<xliff:g id="APP_0">%1$s</xliff:g> uygulamasının, <xliff:g id="APP_2">%2$s</xliff:g> dilimlerini göstermesine izin verilsin mi?"</string>
- <string name="abc_slice_permission_text_1" msgid="4525743640399572811">"- <xliff:g id="APP">%1$s</xliff:g> uygulamasından bilgileri okuyabilir"</string>
- <string name="abc_slice_permission_text_2" msgid="7323565634860251794">"- <xliff:g id="APP">%1$s</xliff:g> uygulamasında işlem yapabilir"</string>
- <string name="abc_slice_permission_allow" msgid="5024599872061409708">"İzin ver"</string>
- <string name="abc_slice_permission_deny" msgid="3819478292430407705">"Reddet"</string>
+ <string name="abc_slices_permission_request" msgid="4431189529265983653">"<xliff:g id="APP_0">%1$s</xliff:g> uygulaması, <xliff:g id="APP_2">%2$s</xliff:g> dilimlerini göstermek istiyor"</string>
+ <string name="abc_slice_permission_title" msgid="4776010267128891014">"<xliff:g id="APP_0">%1$s</xliff:g> uygulamasının, <xliff:g id="APP_2">%2$s</xliff:g> dilimlerini göstermesine izin verilsin mi?"</string>
+ <string name="abc_slice_permission_text_1" msgid="9108592981418900836">"- <xliff:g id="APP">%1$s</xliff:g> uygulamasından bilgileri okuyabilir"</string>
+ <string name="abc_slice_permission_text_2" msgid="7135705417979137589">"- <xliff:g id="APP">%1$s</xliff:g> uygulamasında işlem yapabilir"</string>
+ <string name="abc_slice_permission_allow" msgid="6374752258872407887">"İzin ver"</string>
+ <string name="abc_slice_permission_deny" msgid="576316744017426251">"Reddet"</string>
</resources>
diff --git a/slice/slice-core/src/main/res/values-uk/strings.xml b/slice/slice-core/src/main/res/values-uk/strings.xml
index 86dd1bd..4763f08 100644
--- a/slice/slice-core/src/main/res/values-uk/strings.xml
+++ b/slice/slice-core/src/main/res/values-uk/strings.xml
@@ -17,10 +17,10 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slices_permission_request" msgid="3604847235923472451">"<xliff:g id="APP_0">%1$s</xliff:g> хоче показати фрагменти додатка <xliff:g id="APP_2">%2$s</xliff:g>"</string>
- <string name="abc_slice_permission_title" msgid="4175332421259324948">"Дозволити додатку <xliff:g id="APP_0">%1$s</xliff:g> показувати фрагменти додатка <xliff:g id="APP_2">%2$s</xliff:g>?"</string>
- <string name="abc_slice_permission_text_1" msgid="4525743640399572811">"- Може переглядати інформацію з додатка <xliff:g id="APP">%1$s</xliff:g>"</string>
- <string name="abc_slice_permission_text_2" msgid="7323565634860251794">"- Може виконувати дії в додатку <xliff:g id="APP">%1$s</xliff:g>"</string>
- <string name="abc_slice_permission_allow" msgid="5024599872061409708">"Дозволити"</string>
- <string name="abc_slice_permission_deny" msgid="3819478292430407705">"Заборонити"</string>
+ <string name="abc_slices_permission_request" msgid="4431189529265983653">"Додаток <xliff:g id="APP_0">%1$s</xliff:g> хоче показати фрагменти додатка <xliff:g id="APP_2">%2$s</xliff:g>"</string>
+ <string name="abc_slice_permission_title" msgid="4776010267128891014">"Дозволити додатку <xliff:g id="APP_0">%1$s</xliff:g> показувати фрагменти додатка <xliff:g id="APP_2">%2$s</xliff:g>?"</string>
+ <string name="abc_slice_permission_text_1" msgid="9108592981418900836">"- Має доступ до інформації з додатка <xliff:g id="APP">%1$s</xliff:g>"</string>
+ <string name="abc_slice_permission_text_2" msgid="7135705417979137589">"- Може виконувати дії в додатку <xliff:g id="APP">%1$s</xliff:g>"</string>
+ <string name="abc_slice_permission_allow" msgid="6374752258872407887">"Дозволити"</string>
+ <string name="abc_slice_permission_deny" msgid="576316744017426251">"Заборонити"</string>
</resources>
diff --git a/slice/slice-core/src/main/res/values-ur/strings.xml b/slice/slice-core/src/main/res/values-ur/strings.xml
index 39a9820..f92f985 100644
--- a/slice/slice-core/src/main/res/values-ur/strings.xml
+++ b/slice/slice-core/src/main/res/values-ur/strings.xml
@@ -17,10 +17,10 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slices_permission_request" msgid="3604847235923472451">"<xliff:g id="APP_0">%1$s</xliff:g> <xliff:g id="APP_2">%2$s</xliff:g> کے سلائسز دکھانا چاہتی ہے"</string>
- <string name="abc_slice_permission_title" msgid="4175332421259324948">"<xliff:g id="APP_0">%1$s</xliff:g> کو <xliff:g id="APP_2">%2$s</xliff:g> کے سلائسز دکھانے کی اجازت دیں؟"</string>
- <string name="abc_slice_permission_text_1" msgid="4525743640399572811">"- یہ <xliff:g id="APP">%1$s</xliff:g> کی معلومات پڑھ سکتا ہے"</string>
- <string name="abc_slice_permission_text_2" msgid="7323565634860251794">"- یہ <xliff:g id="APP">%1$s</xliff:g> کے اندر کارروائیاں کر سکتا ہے"</string>
- <string name="abc_slice_permission_allow" msgid="5024599872061409708">"اجازت دیں"</string>
- <string name="abc_slice_permission_deny" msgid="3819478292430407705">"مسترد کریں"</string>
+ <string name="abc_slices_permission_request" msgid="4431189529265983653">"<xliff:g id="APP_0">%1$s</xliff:g> <xliff:g id="APP_2">%2$s</xliff:g> کے سلائسز دکھانا چاہتی ہے"</string>
+ <string name="abc_slice_permission_title" msgid="4776010267128891014">"<xliff:g id="APP_0">%1$s</xliff:g> کو <xliff:g id="APP_2">%2$s</xliff:g> کے سلائسز دکھانے کی اجازت دیں؟"</string>
+ <string name="abc_slice_permission_text_1" msgid="9108592981418900836">"- یہ <xliff:g id="APP">%1$s</xliff:g> کی معلومات پڑھ سکتا ہے"</string>
+ <string name="abc_slice_permission_text_2" msgid="7135705417979137589">"- یہ <xliff:g id="APP">%1$s</xliff:g> کے اندر کارروائیاں کر سکتا ہے"</string>
+ <string name="abc_slice_permission_allow" msgid="6374752258872407887">"اجازت دیں"</string>
+ <string name="abc_slice_permission_deny" msgid="576316744017426251">"مسترد کریں"</string>
</resources>
diff --git a/slice/slice-core/src/main/res/values-uz/strings.xml b/slice/slice-core/src/main/res/values-uz/strings.xml
index 1d6febd..2ecdbc9 100644
--- a/slice/slice-core/src/main/res/values-uz/strings.xml
+++ b/slice/slice-core/src/main/res/values-uz/strings.xml
@@ -17,10 +17,10 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slices_permission_request" msgid="3604847235923472451">"<xliff:g id="APP_0">%1$s</xliff:g> ilovasi <xliff:g id="APP_2">%2$s</xliff:g> ilovasidan fragmentlar ko‘rsatish uchun ruxsat so‘ramoqda"</string>
- <string name="abc_slice_permission_title" msgid="4175332421259324948">"<xliff:g id="APP_0">%1$s</xliff:g> ilovasiga <xliff:g id="APP_2">%2$s</xliff:g> ilovasidan fragmentlar ko‘rsatishga ruxsat berilsinmi?"</string>
- <string name="abc_slice_permission_text_1" msgid="4525743640399572811">"– <xliff:g id="APP">%1$s</xliff:g> ma’lumotlarini o‘qiy oladi"</string>
- <string name="abc_slice_permission_text_2" msgid="7323565634860251794">"– <xliff:g id="APP">%1$s</xliff:g> ichida amallar bajara oladi"</string>
- <string name="abc_slice_permission_allow" msgid="5024599872061409708">"Ruxsat"</string>
- <string name="abc_slice_permission_deny" msgid="3819478292430407705">"Rad etish"</string>
+ <string name="abc_slices_permission_request" msgid="4431189529265983653">"<xliff:g id="APP_0">%1$s</xliff:g> ilovasi <xliff:g id="APP_2">%2$s</xliff:g> ilovasidan fragmentlar koʻrsatish uchun ruxsat soʻramoqda"</string>
+ <string name="abc_slice_permission_title" msgid="4776010267128891014">"<xliff:g id="APP_0">%1$s</xliff:g> ilovasiga <xliff:g id="APP_2">%2$s</xliff:g> ilovasidan fragmentlar koʻrsatishga ruxsat berilsinmi?"</string>
+ <string name="abc_slice_permission_text_1" msgid="9108592981418900836">"– <xliff:g id="APP">%1$s</xliff:g> maʼlumotlarini oʻqiy oladi"</string>
+ <string name="abc_slice_permission_text_2" msgid="7135705417979137589">"– <xliff:g id="APP">%1$s</xliff:g> ichida amallar bajara oladi"</string>
+ <string name="abc_slice_permission_allow" msgid="6374752258872407887">"Ruxsat"</string>
+ <string name="abc_slice_permission_deny" msgid="576316744017426251">"Rad etish"</string>
</resources>
diff --git a/slice/slice-core/src/main/res/values-vi/strings.xml b/slice/slice-core/src/main/res/values-vi/strings.xml
index d8e71a5..9988da7 100644
--- a/slice/slice-core/src/main/res/values-vi/strings.xml
+++ b/slice/slice-core/src/main/res/values-vi/strings.xml
@@ -17,10 +17,10 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slices_permission_request" msgid="3604847235923472451">"<xliff:g id="APP_0">%1$s</xliff:g> muốn hiển thị các lát của <xliff:g id="APP_2">%2$s</xliff:g>"</string>
- <string name="abc_slice_permission_title" msgid="4175332421259324948">"Cho phép <xliff:g id="APP_0">%1$s</xliff:g> hiển thị các lát của <xliff:g id="APP_2">%2$s</xliff:g>?"</string>
- <string name="abc_slice_permission_text_1" msgid="4525743640399572811">"- Có thể đọc thông tin từ <xliff:g id="APP">%1$s</xliff:g>"</string>
- <string name="abc_slice_permission_text_2" msgid="7323565634860251794">"- Có thể thực hiện hành động bên trong <xliff:g id="APP">%1$s</xliff:g>"</string>
- <string name="abc_slice_permission_allow" msgid="5024599872061409708">"Cho phép"</string>
- <string name="abc_slice_permission_deny" msgid="3819478292430407705">"Từ chối"</string>
+ <string name="abc_slices_permission_request" msgid="4431189529265983653">"<xliff:g id="APP_0">%1$s</xliff:g> muốn hiển thị các lát cắt của <xliff:g id="APP_2">%2$s</xliff:g>"</string>
+ <string name="abc_slice_permission_title" msgid="4776010267128891014">"Cho phép <xliff:g id="APP_0">%1$s</xliff:g> hiển thị các lát cắt của <xliff:g id="APP_2">%2$s</xliff:g>?"</string>
+ <string name="abc_slice_permission_text_1" msgid="9108592981418900836">"– Có thể đọc thông tin của <xliff:g id="APP">%1$s</xliff:g>"</string>
+ <string name="abc_slice_permission_text_2" msgid="7135705417979137589">"– Có thể thực hiện hành động bên trong <xliff:g id="APP">%1$s</xliff:g>"</string>
+ <string name="abc_slice_permission_allow" msgid="6374752258872407887">"Cho phép"</string>
+ <string name="abc_slice_permission_deny" msgid="576316744017426251">"Từ chối"</string>
</resources>
diff --git a/slice/slice-core/src/main/res/values-zh-rCN/strings.xml b/slice/slice-core/src/main/res/values-zh-rCN/strings.xml
index 2ec34bc..166520d 100644
--- a/slice/slice-core/src/main/res/values-zh-rCN/strings.xml
+++ b/slice/slice-core/src/main/res/values-zh-rCN/strings.xml
@@ -17,10 +17,10 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slices_permission_request" msgid="3604847235923472451">"“<xliff:g id="APP_0">%1$s</xliff:g>”想要显示“<xliff:g id="APP_2">%2$s</xliff:g>”图块"</string>
- <string name="abc_slice_permission_title" msgid="4175332421259324948">"要允许“<xliff:g id="APP_0">%1$s</xliff:g>”显示“<xliff:g id="APP_2">%2$s</xliff:g>”图块吗?"</string>
- <string name="abc_slice_permission_text_1" msgid="4525743640399572811">"- 可以读取“<xliff:g id="APP">%1$s</xliff:g>”中的信息"</string>
- <string name="abc_slice_permission_text_2" msgid="7323565634860251794">"- 可以在“<xliff:g id="APP">%1$s</xliff:g>”内执行操作"</string>
- <string name="abc_slice_permission_allow" msgid="5024599872061409708">"允许"</string>
- <string name="abc_slice_permission_deny" msgid="3819478292430407705">"拒绝"</string>
+ <string name="abc_slices_permission_request" msgid="4431189529265983653">"“<xliff:g id="APP_0">%1$s</xliff:g>”想要显示“<xliff:g id="APP_2">%2$s</xliff:g>”Slice"</string>
+ <string name="abc_slice_permission_title" msgid="4776010267128891014">"要允许“<xliff:g id="APP_0">%1$s</xliff:g>”显示“<xliff:g id="APP_2">%2$s</xliff:g>”Slice 吗?"</string>
+ <string name="abc_slice_permission_text_1" msgid="9108592981418900836">"- 可以读取“<xliff:g id="APP">%1$s</xliff:g>”中的信息"</string>
+ <string name="abc_slice_permission_text_2" msgid="7135705417979137589">"- 可以在“<xliff:g id="APP">%1$s</xliff:g>”内执行操作"</string>
+ <string name="abc_slice_permission_allow" msgid="6374752258872407887">"允许"</string>
+ <string name="abc_slice_permission_deny" msgid="576316744017426251">"拒绝"</string>
</resources>
diff --git a/slice/slice-core/src/main/res/values-zh-rHK/strings.xml b/slice/slice-core/src/main/res/values-zh-rHK/strings.xml
index 118c2ac..1b6c73d 100644
--- a/slice/slice-core/src/main/res/values-zh-rHK/strings.xml
+++ b/slice/slice-core/src/main/res/values-zh-rHK/strings.xml
@@ -17,10 +17,10 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slices_permission_request" msgid="3604847235923472451">"「<xliff:g id="APP_0">%1$s</xliff:g>」想顯示「<xliff:g id="APP_2">%2$s</xliff:g>」的快訊"</string>
- <string name="abc_slice_permission_title" msgid="4175332421259324948">"要允許「<xliff:g id="APP_0">%1$s</xliff:g>」顯示「<xliff:g id="APP_2">%2$s</xliff:g>」的快訊嗎?"</string>
- <string name="abc_slice_permission_text_1" msgid="4525743640399572811">"- 可以讀取「<xliff:g id="APP">%1$s</xliff:g>」中的資料"</string>
- <string name="abc_slice_permission_text_2" msgid="7323565634860251794">"- 可以在「<xliff:g id="APP">%1$s</xliff:g>」內執行操作"</string>
- <string name="abc_slice_permission_allow" msgid="5024599872061409708">"允許"</string>
- <string name="abc_slice_permission_deny" msgid="3819478292430407705">"拒絕"</string>
+ <string name="abc_slices_permission_request" msgid="4431189529265983653">"「<xliff:g id="APP_0">%1$s</xliff:g>」想顯示「<xliff:g id="APP_2">%2$s</xliff:g>」的 Slice"</string>
+ <string name="abc_slice_permission_title" msgid="4776010267128891014">"要允許「<xliff:g id="APP_0">%1$s</xliff:g>」顯示「<xliff:g id="APP_2">%2$s</xliff:g>」的 Slice 嗎?"</string>
+ <string name="abc_slice_permission_text_1" msgid="9108592981418900836">"- 可以讀取「<xliff:g id="APP">%1$s</xliff:g>」中的資料"</string>
+ <string name="abc_slice_permission_text_2" msgid="7135705417979137589">"- 可以在「<xliff:g id="APP">%1$s</xliff:g>」內執行操作"</string>
+ <string name="abc_slice_permission_allow" msgid="6374752258872407887">"允許"</string>
+ <string name="abc_slice_permission_deny" msgid="576316744017426251">"拒絕"</string>
</resources>
diff --git a/slice/slice-core/src/main/res/values-zh-rTW/strings.xml b/slice/slice-core/src/main/res/values-zh-rTW/strings.xml
index 53c802d..3949ac9 100644
--- a/slice/slice-core/src/main/res/values-zh-rTW/strings.xml
+++ b/slice/slice-core/src/main/res/values-zh-rTW/strings.xml
@@ -17,10 +17,10 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slices_permission_request" msgid="3604847235923472451">"「<xliff:g id="APP_0">%1$s</xliff:g>」想要顯示「<xliff:g id="APP_2">%2$s</xliff:g>」的區塊"</string>
- <string name="abc_slice_permission_title" msgid="4175332421259324948">"要允許「<xliff:g id="APP_0">%1$s</xliff:g>」顯示「<xliff:g id="APP_2">%2$s</xliff:g>」的區塊嗎?"</string>
- <string name="abc_slice_permission_text_1" msgid="4525743640399572811">"- 它可以讀取「<xliff:g id="APP">%1$s</xliff:g>」的資訊"</string>
- <string name="abc_slice_permission_text_2" msgid="7323565634860251794">"- 它可以在「<xliff:g id="APP">%1$s</xliff:g>」內執行操作"</string>
- <string name="abc_slice_permission_allow" msgid="5024599872061409708">"允許"</string>
- <string name="abc_slice_permission_deny" msgid="3819478292430407705">"拒絕"</string>
+ <string name="abc_slices_permission_request" msgid="4431189529265983653">"「<xliff:g id="APP_0">%1$s</xliff:g>」想要顯示「<xliff:g id="APP_2">%2$s</xliff:g>」的 Slice"</string>
+ <string name="abc_slice_permission_title" msgid="4776010267128891014">"要允許「<xliff:g id="APP_0">%1$s</xliff:g>」顯示「<xliff:g id="APP_2">%2$s</xliff:g>」的 Slice 嗎?"</string>
+ <string name="abc_slice_permission_text_1" msgid="9108592981418900836">"- 可以讀取「<xliff:g id="APP">%1$s</xliff:g>」的資訊"</string>
+ <string name="abc_slice_permission_text_2" msgid="7135705417979137589">"- 可以在「<xliff:g id="APP">%1$s</xliff:g>」內執行操作"</string>
+ <string name="abc_slice_permission_allow" msgid="6374752258872407887">"允許"</string>
+ <string name="abc_slice_permission_deny" msgid="576316744017426251">"拒絕"</string>
</resources>
diff --git a/slice/slice-core/src/main/res/values-zu/strings.xml b/slice/slice-core/src/main/res/values-zu/strings.xml
index b1fac39..3ce1834 100644
--- a/slice/slice-core/src/main/res/values-zu/strings.xml
+++ b/slice/slice-core/src/main/res/values-zu/strings.xml
@@ -17,10 +17,10 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slices_permission_request" msgid="3604847235923472451">"I-<xliff:g id="APP_0">%1$s</xliff:g> ifuna ukubonisa izingcezu ze-<xliff:g id="APP_2">%2$s</xliff:g>"</string>
- <string name="abc_slice_permission_title" msgid="4175332421259324948">"Vumela i-<xliff:g id="APP_0">%1$s</xliff:g> ukuthi ibonise izingcezu ze-<xliff:g id="APP_2">%2$s</xliff:g>?"</string>
- <string name="abc_slice_permission_text_1" msgid="4525743640399572811">"- Ingafunda ulwazi kusukela ku-<xliff:g id="APP">%1$s</xliff:g>"</string>
- <string name="abc_slice_permission_text_2" msgid="7323565634860251794">"- Ingenza izenzo ngaphakathi kwe-<xliff:g id="APP">%1$s</xliff:g>"</string>
- <string name="abc_slice_permission_allow" msgid="5024599872061409708">"Vumela"</string>
- <string name="abc_slice_permission_deny" msgid="3819478292430407705">"Phika"</string>
+ <string name="abc_slices_permission_request" msgid="4431189529265983653">"I-<xliff:g id="APP_0">%1$s</xliff:g> ifuna ukubonisa izingcezu ze-<xliff:g id="APP_2">%2$s</xliff:g>"</string>
+ <string name="abc_slice_permission_title" msgid="4776010267128891014">"Vumela i-<xliff:g id="APP_0">%1$s</xliff:g> ukuthi ibonise izingcezu ze-<xliff:g id="APP_2">%2$s</xliff:g>?"</string>
+ <string name="abc_slice_permission_text_1" msgid="9108592981418900836">"- Ingafunda ulwazi kusukela ku-<xliff:g id="APP">%1$s</xliff:g>"</string>
+ <string name="abc_slice_permission_text_2" msgid="7135705417979137589">"- Ingenza izenzo ngaphakathi kwe-<xliff:g id="APP">%1$s</xliff:g>"</string>
+ <string name="abc_slice_permission_allow" msgid="6374752258872407887">"Vumela"</string>
+ <string name="abc_slice_permission_deny" msgid="576316744017426251">"Yenqaba"</string>
</resources>
diff --git a/slice/slice-view/src/main/res/values-af/strings.xml b/slice/slice-view/src/main/res/values-af/strings.xml
index fb3b6db..2a7e30f 100644
--- a/slice/slice-view/src/main/res/values-af/strings.xml
+++ b/slice/slice-view/src/main/res/values-af/strings.xml
@@ -17,21 +17,21 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slice_more_content" msgid="6405516388971241142">"+ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
- <string name="abc_slice_more" msgid="1983560225998630901">"Meer"</string>
- <string name="abc_slice_show_more" msgid="1567717014004692768">"Wys meer"</string>
- <string name="abc_slice_updated" msgid="8155085405396453848">"Opgedateer om <xliff:g id="TIME">%1$s</xliff:g>"</string>
- <plurals name="abc_slice_duration_min" formatted="false" msgid="6996334305156847955">
- <item quantity="other"><xliff:g id="ID_2">%d</xliff:g> m. gelede</item>
- <item quantity="one"><xliff:g id="ID_1">%d</xliff:g> m. gelede</item>
+ <string name="abc_slice_more_content" msgid="7841223363798860154">"+ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
+ <string name="abc_slice_more" msgid="4299234410808450900">"Meer"</string>
+ <string name="abc_slice_show_more" msgid="1112789899890391107">"Wys meer"</string>
+ <string name="abc_slice_updated" msgid="7932359091871934205">"<xliff:g id="TIME">%1$s</xliff:g> opgedateer"</string>
+ <plurals name="abc_slice_duration_min" formatted="false" msgid="7664017844210142826">
+ <item quantity="other"><xliff:g id="ID_2">%d</xliff:g> min. gelede</item>
+ <item quantity="one"><xliff:g id="ID_1">%d</xliff:g> min. gelede</item>
</plurals>
- <plurals name="abc_slice_duration_years" formatted="false" msgid="6212691832333991589">
+ <plurals name="abc_slice_duration_years" formatted="false" msgid="2628491538787454021">
<item quantity="other"><xliff:g id="ID_2">%d</xliff:g> jaar gelede</item>
<item quantity="one"><xliff:g id="ID_1">%d</xliff:g> jaar gelede</item>
</plurals>
- <plurals name="abc_slice_duration_days" formatted="false" msgid="6241698511167107334">
+ <plurals name="abc_slice_duration_days" formatted="false" msgid="8356547162075064530">
<item quantity="other"><xliff:g id="ID_2">%d</xliff:g> dae gelede</item>
<item quantity="one"><xliff:g id="ID_1">%d</xliff:g> dag gelede</item>
</plurals>
- <string name="abc_slice_error" msgid="4188371422904147368">"Kon nie koppel nie"</string>
+ <string name="abc_slice_error" msgid="1794214973158263497">"Kon nie koppel nie"</string>
</resources>
diff --git a/slice/slice-view/src/main/res/values-am/strings.xml b/slice/slice-view/src/main/res/values-am/strings.xml
index da542e1..21c0165 100644
--- a/slice/slice-view/src/main/res/values-am/strings.xml
+++ b/slice/slice-view/src/main/res/values-am/strings.xml
@@ -17,21 +17,21 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slice_more_content" msgid="6405516388971241142">"+ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
- <string name="abc_slice_more" msgid="1983560225998630901">"ተጨማሪ"</string>
- <string name="abc_slice_show_more" msgid="1567717014004692768">"ተጨማሪ አሳይ"</string>
- <string name="abc_slice_updated" msgid="8155085405396453848">"የተዘመነው <xliff:g id="TIME">%1$s</xliff:g> ላይ"</string>
- <plurals name="abc_slice_duration_min" formatted="false" msgid="6996334305156847955">
- <item quantity="one"><xliff:g id="ID_2">%d</xliff:g> ደቂቃ በፊት</item>
- <item quantity="other"><xliff:g id="ID_2">%d</xliff:g> ደቂቃ በፊት</item>
+ <string name="abc_slice_more_content" msgid="7841223363798860154">"+ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
+ <string name="abc_slice_more" msgid="4299234410808450900">"ተጨማሪ"</string>
+ <string name="abc_slice_show_more" msgid="1112789899890391107">"ተጨማሪ አሳይ"</string>
+ <string name="abc_slice_updated" msgid="7932359091871934205">"<xliff:g id="TIME">%1$s</xliff:g> ላይ ተዘምኗል"</string>
+ <plurals name="abc_slice_duration_min" formatted="false" msgid="7664017844210142826">
+ <item quantity="one">ከ<xliff:g id="ID_2">%d</xliff:g> ደቂቃ በፊት</item>
+ <item quantity="other">ከ<xliff:g id="ID_2">%d</xliff:g> ደቂቃ በፊት</item>
</plurals>
- <plurals name="abc_slice_duration_years" formatted="false" msgid="6212691832333991589">
- <item quantity="one"><xliff:g id="ID_2">%d</xliff:g> ዓመት በፊት</item>
- <item quantity="other"><xliff:g id="ID_2">%d</xliff:g> ዓመት በፊት</item>
+ <plurals name="abc_slice_duration_years" formatted="false" msgid="2628491538787454021">
+ <item quantity="one">ከ<xliff:g id="ID_2">%d</xliff:g> ዓመት በፊት</item>
+ <item quantity="other">ከ<xliff:g id="ID_2">%d</xliff:g> ዓመት በፊት</item>
</plurals>
- <plurals name="abc_slice_duration_days" formatted="false" msgid="6241698511167107334">
- <item quantity="one"><xliff:g id="ID_2">%d</xliff:g> ቀናት በፊት</item>
- <item quantity="other"><xliff:g id="ID_2">%d</xliff:g> ቀናት በፊት</item>
+ <plurals name="abc_slice_duration_days" formatted="false" msgid="8356547162075064530">
+ <item quantity="one">ከ<xliff:g id="ID_2">%d</xliff:g> ቀናት በፊት</item>
+ <item quantity="other">ከ<xliff:g id="ID_2">%d</xliff:g> ቀናት በፊት</item>
</plurals>
- <string name="abc_slice_error" msgid="4188371422904147368">"መገናኘት አልተቻለም"</string>
+ <string name="abc_slice_error" msgid="1794214973158263497">"መገናኘት አልተቻለም"</string>
</resources>
diff --git a/slice/slice-view/src/main/res/values-ar/strings.xml b/slice/slice-view/src/main/res/values-ar/strings.xml
index 1e9ca94..6db6130 100644
--- a/slice/slice-view/src/main/res/values-ar/strings.xml
+++ b/slice/slice-view/src/main/res/values-ar/strings.xml
@@ -17,19 +17,19 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slice_more_content" msgid="6405516388971241142">"بالإضافة إلى <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
- <string name="abc_slice_more" msgid="1983560225998630901">"المزيد"</string>
- <string name="abc_slice_show_more" msgid="1567717014004692768">"عرض المزيد"</string>
- <string name="abc_slice_updated" msgid="8155085405396453848">"وقت التحديث الأخير: <xliff:g id="TIME">%1$s</xliff:g>"</string>
- <plurals name="abc_slice_duration_min" formatted="false" msgid="6996334305156847955">
+ <string name="abc_slice_more_content" msgid="7841223363798860154">"+ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
+ <string name="abc_slice_more" msgid="4299234410808450900">"المزيد"</string>
+ <string name="abc_slice_show_more" msgid="1112789899890391107">"عرض المزيد من المحتوى"</string>
+ <string name="abc_slice_updated" msgid="7932359091871934205">"آخر تحديث: <xliff:g id="TIME">%1$s</xliff:g>"</string>
+ <plurals name="abc_slice_duration_min" formatted="false" msgid="7664017844210142826">
<item quantity="zero">قبل <xliff:g id="ID_2">%d</xliff:g> دقيقة</item>
<item quantity="two">قبل دقيقتين (<xliff:g id="ID_2">%d</xliff:g>)</item>
<item quantity="few">قبل <xliff:g id="ID_2">%d</xliff:g> دقائق</item>
<item quantity="many">قبل <xliff:g id="ID_2">%d</xliff:g> دقيقة</item>
<item quantity="other">قبل <xliff:g id="ID_2">%d</xliff:g> دقيقة</item>
- <item quantity="one">قبل <xliff:g id="ID_1">%d</xliff:g> دقيقة</item>
+ <item quantity="one">قبل دقيقة واحدة (<xliff:g id="ID_1">%d</xliff:g>)</item>
</plurals>
- <plurals name="abc_slice_duration_years" formatted="false" msgid="6212691832333991589">
+ <plurals name="abc_slice_duration_years" formatted="false" msgid="2628491538787454021">
<item quantity="zero">قبل <xliff:g id="ID_2">%d</xliff:g> سنة</item>
<item quantity="two">قبل سنتين (<xliff:g id="ID_2">%d</xliff:g>)</item>
<item quantity="few">قبل <xliff:g id="ID_2">%d</xliff:g> سنوات</item>
@@ -37,13 +37,13 @@
<item quantity="other">قبل <xliff:g id="ID_2">%d</xliff:g> سنة</item>
<item quantity="one">قبل <xliff:g id="ID_1">%d</xliff:g> سنة</item>
</plurals>
- <plurals name="abc_slice_duration_days" formatted="false" msgid="6241698511167107334">
+ <plurals name="abc_slice_duration_days" formatted="false" msgid="8356547162075064530">
<item quantity="zero">قبل <xliff:g id="ID_2">%d</xliff:g> يوم</item>
<item quantity="two">قبل يومين (<xliff:g id="ID_2">%d</xliff:g>)</item>
<item quantity="few">قبل <xliff:g id="ID_2">%d</xliff:g> أيام</item>
<item quantity="many">قبل <xliff:g id="ID_2">%d</xliff:g> يومًا</item>
<item quantity="other">قبل <xliff:g id="ID_2">%d</xliff:g> يوم</item>
- <item quantity="one">قبل <xliff:g id="ID_1">%d</xliff:g> يوم</item>
+ <item quantity="one">قبل يوم واحد (<xliff:g id="ID_1">%d</xliff:g>)</item>
</plurals>
- <string name="abc_slice_error" msgid="4188371422904147368">"تعذّر الاتصال."</string>
+ <string name="abc_slice_error" msgid="1794214973158263497">"تعذّر الاتصال."</string>
</resources>
diff --git a/slice/slice-view/src/main/res/values-as/strings.xml b/slice/slice-view/src/main/res/values-as/strings.xml
index 78cc260..e44322e 100644
--- a/slice/slice-view/src/main/res/values-as/strings.xml
+++ b/slice/slice-view/src/main/res/values-as/strings.xml
@@ -17,21 +17,21 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slice_more_content" msgid="6405516388971241142">"+ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
- <string name="abc_slice_more" msgid="1983560225998630901">"অধিক"</string>
- <string name="abc_slice_show_more" msgid="1567717014004692768">"অধিক দেখুৱাওক"</string>
- <string name="abc_slice_updated" msgid="8155085405396453848">"<xliff:g id="TIME">%1$s</xliff:g> আপডে’ট কৰা হৈছিল"</string>
- <plurals name="abc_slice_duration_min" formatted="false" msgid="6996334305156847955">
- <item quantity="one"><xliff:g id="ID_2">%d</xliff:g> মিনিট আগেয়ে</item>
- <item quantity="other"><xliff:g id="ID_2">%d</xliff:g> মিনিট আগেয়ে</item>
+ <string name="abc_slice_more_content" msgid="7841223363798860154">"+ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
+ <string name="abc_slice_more" msgid="4299234410808450900">"অধিক"</string>
+ <string name="abc_slice_show_more" msgid="1112789899890391107">"অধিক দেখুৱাওক"</string>
+ <string name="abc_slice_updated" msgid="7932359091871934205">"<xliff:g id="TIME">%1$s</xliff:g> আপডে’ট কৰা হৈছে"</string>
+ <plurals name="abc_slice_duration_min" formatted="false" msgid="7664017844210142826">
+ <item quantity="one"><xliff:g id="ID_2">%d</xliff:g> মিনিট আগতে</item>
+ <item quantity="other"><xliff:g id="ID_2">%d</xliff:g> মিনিট আগতে</item>
</plurals>
- <plurals name="abc_slice_duration_years" formatted="false" msgid="6212691832333991589">
- <item quantity="one"><xliff:g id="ID_2">%d</xliff:g> বছৰ আগেয়ে</item>
- <item quantity="other"><xliff:g id="ID_2">%d</xliff:g> বছৰ আগেয়ে</item>
+ <plurals name="abc_slice_duration_years" formatted="false" msgid="2628491538787454021">
+ <item quantity="one"><xliff:g id="ID_2">%d</xliff:g> বছৰ আগতে</item>
+ <item quantity="other"><xliff:g id="ID_2">%d</xliff:g> বছৰ আগতে</item>
</plurals>
- <plurals name="abc_slice_duration_days" formatted="false" msgid="6241698511167107334">
- <item quantity="one"><xliff:g id="ID_2">%d</xliff:g> দিন আগেয়ে</item>
- <item quantity="other"><xliff:g id="ID_2">%d</xliff:g>দিন আগেয়ে</item>
+ <plurals name="abc_slice_duration_days" formatted="false" msgid="8356547162075064530">
+ <item quantity="one"><xliff:g id="ID_2">%d</xliff:g> দিন আগতে</item>
+ <item quantity="other"><xliff:g id="ID_2">%d</xliff:g> দিন আগতে</item>
</plurals>
- <string name="abc_slice_error" msgid="4188371422904147368">"সংযোগ কৰিব পৰা নগ\'ল"</string>
+ <string name="abc_slice_error" msgid="1794214973158263497">"সংযোগ কৰিব পৰা নগ’ল"</string>
</resources>
diff --git a/slice/slice-view/src/main/res/values-az/strings.xml b/slice/slice-view/src/main/res/values-az/strings.xml
index 837f08c..3267935 100644
--- a/slice/slice-view/src/main/res/values-az/strings.xml
+++ b/slice/slice-view/src/main/res/values-az/strings.xml
@@ -17,21 +17,21 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slice_more_content" msgid="6405516388971241142">"+ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
- <string name="abc_slice_more" msgid="1983560225998630901">"Digər"</string>
- <string name="abc_slice_show_more" msgid="1567717014004692768">"Digərinə baxın"</string>
- <string name="abc_slice_updated" msgid="8155085405396453848">"<xliff:g id="TIME">%1$s</xliff:g> tarixində yenilənib"</string>
- <plurals name="abc_slice_duration_min" formatted="false" msgid="6996334305156847955">
+ <string name="abc_slice_more_content" msgid="7841223363798860154">"+ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
+ <string name="abc_slice_more" msgid="4299234410808450900">"Ardı"</string>
+ <string name="abc_slice_show_more" msgid="1112789899890391107">"Digərlərinə baxın"</string>
+ <string name="abc_slice_updated" msgid="7932359091871934205">"Güncəllənib: <xliff:g id="TIME">%1$s</xliff:g>"</string>
+ <plurals name="abc_slice_duration_min" formatted="false" msgid="7664017844210142826">
<item quantity="other"><xliff:g id="ID_2">%d</xliff:g> dəq əvvəl</item>
<item quantity="one"><xliff:g id="ID_1">%d</xliff:g> dəq əvvəl</item>
</plurals>
- <plurals name="abc_slice_duration_years" formatted="false" msgid="6212691832333991589">
+ <plurals name="abc_slice_duration_years" formatted="false" msgid="2628491538787454021">
<item quantity="other"><xliff:g id="ID_2">%d</xliff:g> il əvvəl</item>
<item quantity="one"><xliff:g id="ID_1">%d</xliff:g> il əvvəl</item>
</plurals>
- <plurals name="abc_slice_duration_days" formatted="false" msgid="6241698511167107334">
+ <plurals name="abc_slice_duration_days" formatted="false" msgid="8356547162075064530">
<item quantity="other"><xliff:g id="ID_2">%d</xliff:g> gün əvvəl</item>
<item quantity="one"><xliff:g id="ID_1">%d</xliff:g> gün əvvəl</item>
</plurals>
- <string name="abc_slice_error" msgid="4188371422904147368">"Qoşulmaq mümkün olmadı"</string>
+ <string name="abc_slice_error" msgid="1794214973158263497">"Qoşulmaq mümkün olmadı"</string>
</resources>
diff --git a/slice/slice-view/src/main/res/values-b+sr+Latn/strings.xml b/slice/slice-view/src/main/res/values-b+sr+Latn/strings.xml
index 8deb17c..eba9e41 100644
--- a/slice/slice-view/src/main/res/values-b+sr+Latn/strings.xml
+++ b/slice/slice-view/src/main/res/values-b+sr+Latn/strings.xml
@@ -17,24 +17,24 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slice_more_content" msgid="6405516388971241142">"i još <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
- <string name="abc_slice_more" msgid="1983560225998630901">"Još"</string>
- <string name="abc_slice_show_more" msgid="1567717014004692768">"Prikaži više"</string>
- <string name="abc_slice_updated" msgid="8155085405396453848">"Ažurirano <xliff:g id="TIME">%1$s</xliff:g>"</string>
- <plurals name="abc_slice_duration_min" formatted="false" msgid="6996334305156847955">
- <item quantity="one">pre <xliff:g id="ID_2">%d</xliff:g> min</item>
- <item quantity="few">pre <xliff:g id="ID_2">%d</xliff:g> min</item>
- <item quantity="other">pre <xliff:g id="ID_2">%d</xliff:g> min</item>
+ <string name="abc_slice_more_content" msgid="7841223363798860154">"+ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
+ <string name="abc_slice_more" msgid="4299234410808450900">"Još"</string>
+ <string name="abc_slice_show_more" msgid="1112789899890391107">"Prikaži još"</string>
+ <string name="abc_slice_updated" msgid="7932359091871934205">"Ažurirano <xliff:g id="TIME">%1$s</xliff:g>"</string>
+ <plurals name="abc_slice_duration_min" formatted="false" msgid="7664017844210142826">
+ <item quantity="one">Pre <xliff:g id="ID_2">%d</xliff:g> min</item>
+ <item quantity="few">Pre <xliff:g id="ID_2">%d</xliff:g> min</item>
+ <item quantity="other">Pre <xliff:g id="ID_2">%d</xliff:g> min</item>
</plurals>
- <plurals name="abc_slice_duration_years" formatted="false" msgid="6212691832333991589">
- <item quantity="one">pre <xliff:g id="ID_2">%d</xliff:g> god</item>
- <item quantity="few">pre <xliff:g id="ID_2">%d</xliff:g> god</item>
- <item quantity="other">pre <xliff:g id="ID_2">%d</xliff:g> god</item>
+ <plurals name="abc_slice_duration_years" formatted="false" msgid="2628491538787454021">
+ <item quantity="one">Pre <xliff:g id="ID_2">%d</xliff:g> god</item>
+ <item quantity="few">Pre <xliff:g id="ID_2">%d</xliff:g> god</item>
+ <item quantity="other">Pre <xliff:g id="ID_2">%d</xliff:g> god</item>
</plurals>
- <plurals name="abc_slice_duration_days" formatted="false" msgid="6241698511167107334">
- <item quantity="one">pre <xliff:g id="ID_2">%d</xliff:g> dan</item>
- <item quantity="few">pre <xliff:g id="ID_2">%d</xliff:g> dana</item>
- <item quantity="other">pre <xliff:g id="ID_2">%d</xliff:g> dana</item>
+ <plurals name="abc_slice_duration_days" formatted="false" msgid="8356547162075064530">
+ <item quantity="one">Pre <xliff:g id="ID_2">%d</xliff:g> dan</item>
+ <item quantity="few">Pre <xliff:g id="ID_2">%d</xliff:g> dana</item>
+ <item quantity="other">Pre <xliff:g id="ID_2">%d</xliff:g> dana</item>
</plurals>
- <string name="abc_slice_error" msgid="4188371422904147368">"Povezivanje nije uspelo"</string>
+ <string name="abc_slice_error" msgid="1794214973158263497">"Povezivanje nije uspelo"</string>
</resources>
diff --git a/slice/slice-view/src/main/res/values-be/strings.xml b/slice/slice-view/src/main/res/values-be/strings.xml
index b03f283..df9c74c 100644
--- a/slice/slice-view/src/main/res/values-be/strings.xml
+++ b/slice/slice-view/src/main/res/values-be/strings.xml
@@ -17,27 +17,27 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slice_more_content" msgid="6405516388971241142">"Яшчэ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
- <string name="abc_slice_more" msgid="1983560225998630901">"Яшчэ"</string>
- <string name="abc_slice_show_more" msgid="1567717014004692768">"Яшчэ"</string>
- <string name="abc_slice_updated" msgid="8155085405396453848">"Абноўлена <xliff:g id="TIME">%1$s</xliff:g>"</string>
- <plurals name="abc_slice_duration_min" formatted="false" msgid="6996334305156847955">
- <item quantity="one"><xliff:g id="ID_2">%d</xliff:g> хвіліну таму</item>
- <item quantity="few"><xliff:g id="ID_2">%d</xliff:g> хвіліны таму</item>
- <item quantity="many"><xliff:g id="ID_2">%d</xliff:g> хвілін таму</item>
- <item quantity="other"><xliff:g id="ID_2">%d</xliff:g> хвіліны таму</item>
+ <string name="abc_slice_more_content" msgid="7841223363798860154">"+ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
+ <string name="abc_slice_more" msgid="4299234410808450900">"Яшчэ"</string>
+ <string name="abc_slice_show_more" msgid="1112789899890391107">"Разгарнуць"</string>
+ <string name="abc_slice_updated" msgid="7932359091871934205">"Абноўлена <xliff:g id="TIME">%1$s</xliff:g>"</string>
+ <plurals name="abc_slice_duration_min" formatted="false" msgid="7664017844210142826">
+ <item quantity="one"><xliff:g id="ID_2">%d</xliff:g> хв таму</item>
+ <item quantity="few"><xliff:g id="ID_2">%d</xliff:g> хв таму</item>
+ <item quantity="many"><xliff:g id="ID_2">%d</xliff:g> хв таму</item>
+ <item quantity="other"><xliff:g id="ID_2">%d</xliff:g> хв таму</item>
</plurals>
- <plurals name="abc_slice_duration_years" formatted="false" msgid="6212691832333991589">
- <item quantity="one"><xliff:g id="ID_2">%d</xliff:g> год таму</item>
- <item quantity="few"><xliff:g id="ID_2">%d</xliff:g> гады таму</item>
- <item quantity="many"><xliff:g id="ID_2">%d</xliff:g> гадоў таму</item>
- <item quantity="other"><xliff:g id="ID_2">%d</xliff:g> года таму</item>
+ <plurals name="abc_slice_duration_years" formatted="false" msgid="2628491538787454021">
+ <item quantity="one"><xliff:g id="ID_2">%d</xliff:g> год таму</item>
+ <item quantity="few"><xliff:g id="ID_2">%d</xliff:g> гады таму</item>
+ <item quantity="many"><xliff:g id="ID_2">%d</xliff:g> гадоў таму</item>
+ <item quantity="other"><xliff:g id="ID_2">%d</xliff:g> года таму</item>
</plurals>
- <plurals name="abc_slice_duration_days" formatted="false" msgid="6241698511167107334">
- <item quantity="one"><xliff:g id="ID_2">%d</xliff:g> дзень таму</item>
- <item quantity="few"><xliff:g id="ID_2">%d</xliff:g> дні таму</item>
- <item quantity="many"><xliff:g id="ID_2">%d</xliff:g> дзён таму</item>
- <item quantity="other"><xliff:g id="ID_2">%d</xliff:g> дня таму</item>
+ <plurals name="abc_slice_duration_days" formatted="false" msgid="8356547162075064530">
+ <item quantity="one"><xliff:g id="ID_2">%d</xliff:g> дзень таму</item>
+ <item quantity="few"><xliff:g id="ID_2">%d</xliff:g> дні таму</item>
+ <item quantity="many"><xliff:g id="ID_2">%d</xliff:g> дзён таму</item>
+ <item quantity="other"><xliff:g id="ID_2">%d</xliff:g> дня таму</item>
</plurals>
- <string name="abc_slice_error" msgid="4188371422904147368">"Не атрымалася падключыцца"</string>
+ <string name="abc_slice_error" msgid="1794214973158263497">"Не ўдалося падключыцца"</string>
</resources>
diff --git a/slice/slice-view/src/main/res/values-bg/strings.xml b/slice/slice-view/src/main/res/values-bg/strings.xml
index b019a46b..ed70117 100644
--- a/slice/slice-view/src/main/res/values-bg/strings.xml
+++ b/slice/slice-view/src/main/res/values-bg/strings.xml
@@ -17,21 +17,21 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slice_more_content" msgid="6405516388971241142">"+ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
- <string name="abc_slice_more" msgid="1983560225998630901">"Още"</string>
- <string name="abc_slice_show_more" msgid="1567717014004692768">"Показване на още"</string>
- <string name="abc_slice_updated" msgid="8155085405396453848">"Актуализирано <xliff:g id="TIME">%1$s</xliff:g>"</string>
- <plurals name="abc_slice_duration_min" formatted="false" msgid="6996334305156847955">
- <item quantity="other">Преди <xliff:g id="ID_2">%d</xliff:g> мин</item>
- <item quantity="one">Преди <xliff:g id="ID_1">%d</xliff:g> мин</item>
+ <string name="abc_slice_more_content" msgid="7841223363798860154">"+ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
+ <string name="abc_slice_more" msgid="4299234410808450900">"Още"</string>
+ <string name="abc_slice_show_more" msgid="1112789899890391107">"Показване на още"</string>
+ <string name="abc_slice_updated" msgid="7932359091871934205">"Актуализирано: <xliff:g id="TIME">%1$s</xliff:g>"</string>
+ <plurals name="abc_slice_duration_min" formatted="false" msgid="7664017844210142826">
+ <item quantity="other">Преди <xliff:g id="ID_2">%d</xliff:g> мин</item>
+ <item quantity="one">Преди <xliff:g id="ID_1">%d</xliff:g> мин</item>
</plurals>
- <plurals name="abc_slice_duration_years" formatted="false" msgid="6212691832333991589">
- <item quantity="other">Преди <xliff:g id="ID_2">%d</xliff:g> год</item>
- <item quantity="one">Преди <xliff:g id="ID_1">%d</xliff:g> год</item>
+ <plurals name="abc_slice_duration_years" formatted="false" msgid="2628491538787454021">
+ <item quantity="other">Преди <xliff:g id="ID_2">%d</xliff:g> год.</item>
+ <item quantity="one">Преди <xliff:g id="ID_1">%d</xliff:g> год.</item>
</plurals>
- <plurals name="abc_slice_duration_days" formatted="false" msgid="6241698511167107334">
+ <plurals name="abc_slice_duration_days" formatted="false" msgid="8356547162075064530">
<item quantity="other">Преди <xliff:g id="ID_2">%d</xliff:g> дни</item>
<item quantity="one">Преди <xliff:g id="ID_1">%d</xliff:g> ден</item>
</plurals>
- <string name="abc_slice_error" msgid="4188371422904147368">"Не можа да се установи връзка"</string>
+ <string name="abc_slice_error" msgid="1794214973158263497">"Установяването на връзка не бе успешно"</string>
</resources>
diff --git a/slice/slice-view/src/main/res/values-bn/strings.xml b/slice/slice-view/src/main/res/values-bn/strings.xml
index bc5c45b..c1db25b 100644
--- a/slice/slice-view/src/main/res/values-bn/strings.xml
+++ b/slice/slice-view/src/main/res/values-bn/strings.xml
@@ -17,21 +17,21 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slice_more_content" msgid="6405516388971241142">"+ <xliff:g id="NUMBER">%1$d</xliff:g>টি"</string>
- <string name="abc_slice_more" msgid="1983560225998630901">"আরও"</string>
- <string name="abc_slice_show_more" msgid="1567717014004692768">"আরও দেখুন"</string>
- <string name="abc_slice_updated" msgid="8155085405396453848">"<xliff:g id="TIME">%1$s</xliff:g> আপডেট করা হয়েছে"</string>
- <plurals name="abc_slice_duration_min" formatted="false" msgid="6996334305156847955">
+ <string name="abc_slice_more_content" msgid="7841223363798860154">"+ <xliff:g id="NUMBER">%1$d</xliff:g>টি"</string>
+ <string name="abc_slice_more" msgid="4299234410808450900">"আরও"</string>
+ <string name="abc_slice_show_more" msgid="1112789899890391107">"আরও দেখুন"</string>
+ <string name="abc_slice_updated" msgid="7932359091871934205">"<xliff:g id="TIME">%1$s</xliff:g>-এ আপডেট করা হয়েছে"</string>
+ <plurals name="abc_slice_duration_min" formatted="false" msgid="7664017844210142826">
<item quantity="one"><xliff:g id="ID_2">%d</xliff:g> মিনিট আগে</item>
<item quantity="other"><xliff:g id="ID_2">%d</xliff:g> মিনিট আগে</item>
</plurals>
- <plurals name="abc_slice_duration_years" formatted="false" msgid="6212691832333991589">
+ <plurals name="abc_slice_duration_years" formatted="false" msgid="2628491538787454021">
<item quantity="one"><xliff:g id="ID_2">%d</xliff:g> বছর আগে</item>
<item quantity="other"><xliff:g id="ID_2">%d</xliff:g> বছর আগে</item>
</plurals>
- <plurals name="abc_slice_duration_days" formatted="false" msgid="6241698511167107334">
+ <plurals name="abc_slice_duration_days" formatted="false" msgid="8356547162075064530">
<item quantity="one"><xliff:g id="ID_2">%d</xliff:g> দিন আগে</item>
<item quantity="other"><xliff:g id="ID_2">%d</xliff:g> দিন আগে</item>
</plurals>
- <string name="abc_slice_error" msgid="4188371422904147368">"কানেক্ট করা যায়নি"</string>
+ <string name="abc_slice_error" msgid="1794214973158263497">"কানেক্ট করা যায়নি"</string>
</resources>
diff --git a/slice/slice-view/src/main/res/values-bs/strings.xml b/slice/slice-view/src/main/res/values-bs/strings.xml
index 2a42cd4..d3c01dd 100644
--- a/slice/slice-view/src/main/res/values-bs/strings.xml
+++ b/slice/slice-view/src/main/res/values-bs/strings.xml
@@ -17,24 +17,24 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slice_more_content" msgid="6405516388971241142">"+ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
- <string name="abc_slice_more" msgid="1983560225998630901">"Više"</string>
- <string name="abc_slice_show_more" msgid="1567717014004692768">"Prikaži više"</string>
- <string name="abc_slice_updated" msgid="8155085405396453848">"Ažurirano <xliff:g id="TIME">%1$s</xliff:g>"</string>
- <plurals name="abc_slice_duration_min" formatted="false" msgid="6996334305156847955">
+ <string name="abc_slice_more_content" msgid="7841223363798860154">"+ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
+ <string name="abc_slice_more" msgid="4299234410808450900">"Više"</string>
+ <string name="abc_slice_show_more" msgid="1112789899890391107">"Prikaži više"</string>
+ <string name="abc_slice_updated" msgid="7932359091871934205">"Ažurirano <xliff:g id="TIME">%1$s</xliff:g>"</string>
+ <plurals name="abc_slice_duration_min" formatted="false" msgid="7664017844210142826">
<item quantity="one">Prije <xliff:g id="ID_2">%d</xliff:g> min</item>
<item quantity="few">Prije <xliff:g id="ID_2">%d</xliff:g> min</item>
<item quantity="other">Prije <xliff:g id="ID_2">%d</xliff:g> min</item>
</plurals>
- <plurals name="abc_slice_duration_years" formatted="false" msgid="6212691832333991589">
+ <plurals name="abc_slice_duration_years" formatted="false" msgid="2628491538787454021">
<item quantity="one">Prije <xliff:g id="ID_2">%d</xliff:g> god.</item>
<item quantity="few">Prije <xliff:g id="ID_2">%d</xliff:g> god.</item>
<item quantity="other">Prije <xliff:g id="ID_2">%d</xliff:g> god.</item>
</plurals>
- <plurals name="abc_slice_duration_days" formatted="false" msgid="6241698511167107334">
+ <plurals name="abc_slice_duration_days" formatted="false" msgid="8356547162075064530">
<item quantity="one">Prije <xliff:g id="ID_2">%d</xliff:g> dan</item>
<item quantity="few">Prije <xliff:g id="ID_2">%d</xliff:g> dana</item>
<item quantity="other">Prije <xliff:g id="ID_2">%d</xliff:g> dana</item>
</plurals>
- <string name="abc_slice_error" msgid="4188371422904147368">"Povezivanje nije uspjelo"</string>
+ <string name="abc_slice_error" msgid="1794214973158263497">"Povezivanje nije uspjelo"</string>
</resources>
diff --git a/slice/slice-view/src/main/res/values-ca/strings.xml b/slice/slice-view/src/main/res/values-ca/strings.xml
index cc5dde0..62110c2 100644
--- a/slice/slice-view/src/main/res/values-ca/strings.xml
+++ b/slice/slice-view/src/main/res/values-ca/strings.xml
@@ -17,21 +17,21 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slice_more_content" msgid="6405516388971241142">"<xliff:g id="NUMBER">%1$d</xliff:g> més"</string>
- <string name="abc_slice_more" msgid="1983560225998630901">"Més"</string>
- <string name="abc_slice_show_more" msgid="1567717014004692768">"Mostra\'n més"</string>
- <string name="abc_slice_updated" msgid="8155085405396453848">"S\'ha actualitzat <xliff:g id="TIME">%1$s</xliff:g>"</string>
- <plurals name="abc_slice_duration_min" formatted="false" msgid="6996334305156847955">
- <item quantity="other">Fa <xliff:g id="ID_2">%d</xliff:g> min</item>
- <item quantity="one">Fa <xliff:g id="ID_1">%d</xliff:g> min</item>
+ <string name="abc_slice_more_content" msgid="7841223363798860154">"+ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
+ <string name="abc_slice_more" msgid="4299234410808450900">"Més"</string>
+ <string name="abc_slice_show_more" msgid="1112789899890391107">"Mostra\'n més"</string>
+ <string name="abc_slice_updated" msgid="7932359091871934205">"Actualitzat <xliff:g id="TIME">%1$s</xliff:g>"</string>
+ <plurals name="abc_slice_duration_min" formatted="false" msgid="7664017844210142826">
+ <item quantity="other">Fa <xliff:g id="ID_2">%d</xliff:g> min</item>
+ <item quantity="one">Fa <xliff:g id="ID_1">%d</xliff:g> min</item>
</plurals>
- <plurals name="abc_slice_duration_years" formatted="false" msgid="6212691832333991589">
- <item quantity="other">Fa <xliff:g id="ID_2">%d</xliff:g> anys</item>
- <item quantity="one">Fa <xliff:g id="ID_1">%d</xliff:g> any</item>
+ <plurals name="abc_slice_duration_years" formatted="false" msgid="2628491538787454021">
+ <item quantity="other">Fa <xliff:g id="ID_2">%d</xliff:g> anys</item>
+ <item quantity="one">Fa <xliff:g id="ID_1">%d</xliff:g> any</item>
</plurals>
- <plurals name="abc_slice_duration_days" formatted="false" msgid="6241698511167107334">
- <item quantity="other">Fa <xliff:g id="ID_2">%d</xliff:g> dies</item>
- <item quantity="one">Fa <xliff:g id="ID_1">%d</xliff:g> dia</item>
+ <plurals name="abc_slice_duration_days" formatted="false" msgid="8356547162075064530">
+ <item quantity="other">Fa <xliff:g id="ID_2">%d</xliff:g> dies</item>
+ <item quantity="one">Fa <xliff:g id="ID_1">%d</xliff:g> dia</item>
</plurals>
- <string name="abc_slice_error" msgid="4188371422904147368">"No s\'ha pogut connectar"</string>
+ <string name="abc_slice_error" msgid="1794214973158263497">"No s\'ha pogut connectar"</string>
</resources>
diff --git a/slice/slice-view/src/main/res/values-cs/strings.xml b/slice/slice-view/src/main/res/values-cs/strings.xml
index c4c1fce..8020538 100644
--- a/slice/slice-view/src/main/res/values-cs/strings.xml
+++ b/slice/slice-view/src/main/res/values-cs/strings.xml
@@ -17,27 +17,27 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slice_more_content" msgid="6405516388971241142">"a ještě <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
- <string name="abc_slice_more" msgid="1983560225998630901">"Více"</string>
- <string name="abc_slice_show_more" msgid="1567717014004692768">"Zobrazit více"</string>
- <string name="abc_slice_updated" msgid="8155085405396453848">"Aktualizováno <xliff:g id="TIME">%1$s</xliff:g>"</string>
- <plurals name="abc_slice_duration_min" formatted="false" msgid="6996334305156847955">
- <item quantity="few">před <xliff:g id="ID_2">%d</xliff:g> min</item>
- <item quantity="many">před <xliff:g id="ID_2">%d</xliff:g> min</item>
- <item quantity="other">před <xliff:g id="ID_2">%d</xliff:g> min</item>
- <item quantity="one">před <xliff:g id="ID_1">%d</xliff:g> min</item>
+ <string name="abc_slice_more_content" msgid="7841223363798860154">"+ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
+ <string name="abc_slice_more" msgid="4299234410808450900">"Více"</string>
+ <string name="abc_slice_show_more" msgid="1112789899890391107">"Zobrazit více"</string>
+ <string name="abc_slice_updated" msgid="7932359091871934205">"Aktualizováno <xliff:g id="TIME">%1$s</xliff:g>"</string>
+ <plurals name="abc_slice_duration_min" formatted="false" msgid="7664017844210142826">
+ <item quantity="few">Před <xliff:g id="ID_2">%d</xliff:g> min</item>
+ <item quantity="many">Před <xliff:g id="ID_2">%d</xliff:g> min</item>
+ <item quantity="other">Před <xliff:g id="ID_2">%d</xliff:g> min</item>
+ <item quantity="one">Před <xliff:g id="ID_1">%d</xliff:g> min</item>
</plurals>
- <plurals name="abc_slice_duration_years" formatted="false" msgid="6212691832333991589">
- <item quantity="few">před <xliff:g id="ID_2">%d</xliff:g> lety</item>
- <item quantity="many">před <xliff:g id="ID_2">%d</xliff:g> roku</item>
- <item quantity="other">před <xliff:g id="ID_2">%d</xliff:g> lety</item>
- <item quantity="one">před <xliff:g id="ID_1">%d</xliff:g> rokem</item>
+ <plurals name="abc_slice_duration_years" formatted="false" msgid="2628491538787454021">
+ <item quantity="few">Před <xliff:g id="ID_2">%d</xliff:g> r.</item>
+ <item quantity="many">Před <xliff:g id="ID_2">%d</xliff:g> r.</item>
+ <item quantity="other">Před <xliff:g id="ID_2">%d</xliff:g> r.</item>
+ <item quantity="one">Před <xliff:g id="ID_1">%d</xliff:g> r.</item>
</plurals>
- <plurals name="abc_slice_duration_days" formatted="false" msgid="6241698511167107334">
- <item quantity="few">před <xliff:g id="ID_2">%d</xliff:g> dny</item>
- <item quantity="many">před <xliff:g id="ID_2">%d</xliff:g> dne</item>
- <item quantity="other">před <xliff:g id="ID_2">%d</xliff:g> dny</item>
- <item quantity="one">před <xliff:g id="ID_1">%d</xliff:g> dnem</item>
+ <plurals name="abc_slice_duration_days" formatted="false" msgid="8356547162075064530">
+ <item quantity="few">Před <xliff:g id="ID_2">%d</xliff:g> dny</item>
+ <item quantity="many">Před <xliff:g id="ID_2">%d</xliff:g> dny</item>
+ <item quantity="other">Před <xliff:g id="ID_2">%d</xliff:g> dny</item>
+ <item quantity="one">Před <xliff:g id="ID_1">%d</xliff:g> dnem</item>
</plurals>
- <string name="abc_slice_error" msgid="4188371422904147368">"Nelze se připojit"</string>
+ <string name="abc_slice_error" msgid="1794214973158263497">"Nelze se připojit"</string>
</resources>
diff --git a/slice/slice-view/src/main/res/values-da/strings.xml b/slice/slice-view/src/main/res/values-da/strings.xml
index 4cd3d27..1491d22 100644
--- a/slice/slice-view/src/main/res/values-da/strings.xml
+++ b/slice/slice-view/src/main/res/values-da/strings.xml
@@ -17,21 +17,21 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slice_more_content" msgid="6405516388971241142">"<xliff:g id="NUMBER">%1$d</xliff:g> mere"</string>
- <string name="abc_slice_more" msgid="1983560225998630901">"Mere"</string>
- <string name="abc_slice_show_more" msgid="1567717014004692768">"Se mere"</string>
- <string name="abc_slice_updated" msgid="8155085405396453848">"Opdateret <xliff:g id="TIME">%1$s</xliff:g>"</string>
- <plurals name="abc_slice_duration_min" formatted="false" msgid="6996334305156847955">
- <item quantity="one"><xliff:g id="ID_2">%d</xliff:g> min. siden</item>
- <item quantity="other"><xliff:g id="ID_2">%d</xliff:g> min. siden</item>
+ <string name="abc_slice_more_content" msgid="7841223363798860154">"+ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
+ <string name="abc_slice_more" msgid="4299234410808450900">"Mere"</string>
+ <string name="abc_slice_show_more" msgid="1112789899890391107">"Se mere"</string>
+ <string name="abc_slice_updated" msgid="7932359091871934205">"Opdateret <xliff:g id="TIME">%1$s</xliff:g>"</string>
+ <plurals name="abc_slice_duration_min" formatted="false" msgid="7664017844210142826">
+ <item quantity="one">For <xliff:g id="ID_2">%d</xliff:g> min. siden</item>
+ <item quantity="other">For <xliff:g id="ID_2">%d</xliff:g> min. siden</item>
</plurals>
- <plurals name="abc_slice_duration_years" formatted="false" msgid="6212691832333991589">
- <item quantity="one">for <xliff:g id="ID_2">%d</xliff:g> år siden</item>
- <item quantity="other">for <xliff:g id="ID_2">%d</xliff:g> år siden</item>
+ <plurals name="abc_slice_duration_years" formatted="false" msgid="2628491538787454021">
+ <item quantity="one">For <xliff:g id="ID_2">%d</xliff:g> år siden</item>
+ <item quantity="other">For <xliff:g id="ID_2">%d</xliff:g> år siden</item>
</plurals>
- <plurals name="abc_slice_duration_days" formatted="false" msgid="6241698511167107334">
- <item quantity="one">for <xliff:g id="ID_2">%d</xliff:g> dag siden</item>
- <item quantity="other">for <xliff:g id="ID_2">%d</xliff:g> dage siden</item>
+ <plurals name="abc_slice_duration_days" formatted="false" msgid="8356547162075064530">
+ <item quantity="one">For <xliff:g id="ID_2">%d</xliff:g> dag siden</item>
+ <item quantity="other">For <xliff:g id="ID_2">%d</xliff:g> dage siden</item>
</plurals>
- <string name="abc_slice_error" msgid="4188371422904147368">"Der kunne ikke oprettes forbindelse"</string>
+ <string name="abc_slice_error" msgid="1794214973158263497">"Der kunne ikke oprettes forbindelse"</string>
</resources>
diff --git a/slice/slice-view/src/main/res/values-de/strings.xml b/slice/slice-view/src/main/res/values-de/strings.xml
index dfa6500..904d9e1 100644
--- a/slice/slice-view/src/main/res/values-de/strings.xml
+++ b/slice/slice-view/src/main/res/values-de/strings.xml
@@ -17,21 +17,21 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slice_more_content" msgid="6405516388971241142">"+ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
- <string name="abc_slice_more" msgid="1983560225998630901">"Mehr"</string>
- <string name="abc_slice_show_more" msgid="1567717014004692768">"Mehr anzeigen"</string>
- <string name="abc_slice_updated" msgid="8155085405396453848">"Aktualisiert: <xliff:g id="TIME">%1$s</xliff:g>"</string>
- <plurals name="abc_slice_duration_min" formatted="false" msgid="6996334305156847955">
+ <string name="abc_slice_more_content" msgid="7841223363798860154">"+ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
+ <string name="abc_slice_more" msgid="4299234410808450900">"Mehr"</string>
+ <string name="abc_slice_show_more" msgid="1112789899890391107">"Mehr anzeigen"</string>
+ <string name="abc_slice_updated" msgid="7932359091871934205">"Aktualisiert: <xliff:g id="TIME">%1$s</xliff:g>"</string>
+ <plurals name="abc_slice_duration_min" formatted="false" msgid="7664017844210142826">
<item quantity="other">Vor <xliff:g id="ID_2">%d</xliff:g> Min.</item>
<item quantity="one">Vor <xliff:g id="ID_1">%d</xliff:g> Min.</item>
</plurals>
- <plurals name="abc_slice_duration_years" formatted="false" msgid="6212691832333991589">
+ <plurals name="abc_slice_duration_years" formatted="false" msgid="2628491538787454021">
<item quantity="other">Vor <xliff:g id="ID_2">%d</xliff:g> Jahren</item>
<item quantity="one">Vor <xliff:g id="ID_1">%d</xliff:g> Jahr</item>
</plurals>
- <plurals name="abc_slice_duration_days" formatted="false" msgid="6241698511167107334">
+ <plurals name="abc_slice_duration_days" formatted="false" msgid="8356547162075064530">
<item quantity="other">Vor <xliff:g id="ID_2">%d</xliff:g> Tagen</item>
<item quantity="one">Vor <xliff:g id="ID_1">%d</xliff:g> Tag</item>
</plurals>
- <string name="abc_slice_error" msgid="4188371422904147368">"Verbindung nicht möglich"</string>
+ <string name="abc_slice_error" msgid="1794214973158263497">"Verbindung nicht möglich"</string>
</resources>
diff --git a/slice/slice-view/src/main/res/values-el/strings.xml b/slice/slice-view/src/main/res/values-el/strings.xml
index 31092af..f3dd719 100644
--- a/slice/slice-view/src/main/res/values-el/strings.xml
+++ b/slice/slice-view/src/main/res/values-el/strings.xml
@@ -17,21 +17,21 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slice_more_content" msgid="6405516388971241142">"+ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
- <string name="abc_slice_more" msgid="1983560225998630901">"Περισσότ."</string>
- <string name="abc_slice_show_more" msgid="1567717014004692768">"Εμφάνιση περισσότερων"</string>
- <string name="abc_slice_updated" msgid="8155085405396453848">"Ενημερώθηκε <xliff:g id="TIME">%1$s</xliff:g>"</string>
- <plurals name="abc_slice_duration_min" formatted="false" msgid="6996334305156847955">
- <item quantity="other"><xliff:g id="ID_2">%d</xliff:g> λεπ. πριν</item>
- <item quantity="one"><xliff:g id="ID_1">%d</xliff:g> λεπ. πριν</item>
+ <string name="abc_slice_more_content" msgid="7841223363798860154">"+ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
+ <string name="abc_slice_more" msgid="4299234410808450900">"Περισσότ."</string>
+ <string name="abc_slice_show_more" msgid="1112789899890391107">"Εμφάνιση περισσότερων"</string>
+ <string name="abc_slice_updated" msgid="7932359091871934205">"Ενημερώθηκε <xliff:g id="TIME">%1$s</xliff:g>"</string>
+ <plurals name="abc_slice_duration_min" formatted="false" msgid="7664017844210142826">
+ <item quantity="other"><xliff:g id="ID_2">%d</xliff:g> λ. πριν</item>
+ <item quantity="one"><xliff:g id="ID_1">%d</xliff:g> λ. πριν</item>
</plurals>
- <plurals name="abc_slice_duration_years" formatted="false" msgid="6212691832333991589">
- <item quantity="other"><xliff:g id="ID_2">%d</xliff:g> χρ. πριν</item>
- <item quantity="one"><xliff:g id="ID_1">%d</xliff:g> χρ. πριν</item>
+ <plurals name="abc_slice_duration_years" formatted="false" msgid="2628491538787454021">
+ <item quantity="other"><xliff:g id="ID_2">%d</xliff:g> έτη πριν</item>
+ <item quantity="one"><xliff:g id="ID_1">%d</xliff:g> έτος πριν</item>
</plurals>
- <plurals name="abc_slice_duration_days" formatted="false" msgid="6241698511167107334">
+ <plurals name="abc_slice_duration_days" formatted="false" msgid="8356547162075064530">
<item quantity="other"><xliff:g id="ID_2">%d</xliff:g> ημ. πριν</item>
<item quantity="one"><xliff:g id="ID_1">%d</xliff:g> ημ. πριν</item>
</plurals>
- <string name="abc_slice_error" msgid="4188371422904147368">"Αδυναμία σύνδεσης"</string>
+ <string name="abc_slice_error" msgid="1794214973158263497">"Αδυναμία σύνδεσης"</string>
</resources>
diff --git a/slice/slice-view/src/main/res/values-en-rAU/strings.xml b/slice/slice-view/src/main/res/values-en-rAU/strings.xml
index 8fa5b45..ac4f6d7 100644
--- a/slice/slice-view/src/main/res/values-en-rAU/strings.xml
+++ b/slice/slice-view/src/main/res/values-en-rAU/strings.xml
@@ -17,21 +17,21 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slice_more_content" msgid="6405516388971241142">"+ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
- <string name="abc_slice_more" msgid="1983560225998630901">"More"</string>
- <string name="abc_slice_show_more" msgid="1567717014004692768">"Show more"</string>
- <string name="abc_slice_updated" msgid="8155085405396453848">"Updated <xliff:g id="TIME">%1$s</xliff:g>"</string>
- <plurals name="abc_slice_duration_min" formatted="false" msgid="6996334305156847955">
+ <string name="abc_slice_more_content" msgid="7841223363798860154">"+ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
+ <string name="abc_slice_more" msgid="4299234410808450900">"More"</string>
+ <string name="abc_slice_show_more" msgid="1112789899890391107">"Show more"</string>
+ <string name="abc_slice_updated" msgid="7932359091871934205">"Updated <xliff:g id="TIME">%1$s</xliff:g>"</string>
+ <plurals name="abc_slice_duration_min" formatted="false" msgid="7664017844210142826">
<item quantity="other"><xliff:g id="ID_2">%d</xliff:g> min ago</item>
<item quantity="one"><xliff:g id="ID_1">%d</xliff:g> min ago</item>
</plurals>
- <plurals name="abc_slice_duration_years" formatted="false" msgid="6212691832333991589">
+ <plurals name="abc_slice_duration_years" formatted="false" msgid="2628491538787454021">
<item quantity="other"><xliff:g id="ID_2">%d</xliff:g> yr ago</item>
<item quantity="one"><xliff:g id="ID_1">%d</xliff:g> yr ago</item>
</plurals>
- <plurals name="abc_slice_duration_days" formatted="false" msgid="6241698511167107334">
+ <plurals name="abc_slice_duration_days" formatted="false" msgid="8356547162075064530">
<item quantity="other"><xliff:g id="ID_2">%d</xliff:g> days ago</item>
<item quantity="one"><xliff:g id="ID_1">%d</xliff:g> day ago</item>
</plurals>
- <string name="abc_slice_error" msgid="4188371422904147368">"Couldn\'t connect"</string>
+ <string name="abc_slice_error" msgid="1794214973158263497">"Couldn\'t connect"</string>
</resources>
diff --git a/slice/slice-view/src/main/res/values-en-rCA/strings.xml b/slice/slice-view/src/main/res/values-en-rCA/strings.xml
index 8fa5b45..ac4f6d7 100644
--- a/slice/slice-view/src/main/res/values-en-rCA/strings.xml
+++ b/slice/slice-view/src/main/res/values-en-rCA/strings.xml
@@ -17,21 +17,21 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slice_more_content" msgid="6405516388971241142">"+ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
- <string name="abc_slice_more" msgid="1983560225998630901">"More"</string>
- <string name="abc_slice_show_more" msgid="1567717014004692768">"Show more"</string>
- <string name="abc_slice_updated" msgid="8155085405396453848">"Updated <xliff:g id="TIME">%1$s</xliff:g>"</string>
- <plurals name="abc_slice_duration_min" formatted="false" msgid="6996334305156847955">
+ <string name="abc_slice_more_content" msgid="7841223363798860154">"+ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
+ <string name="abc_slice_more" msgid="4299234410808450900">"More"</string>
+ <string name="abc_slice_show_more" msgid="1112789899890391107">"Show more"</string>
+ <string name="abc_slice_updated" msgid="7932359091871934205">"Updated <xliff:g id="TIME">%1$s</xliff:g>"</string>
+ <plurals name="abc_slice_duration_min" formatted="false" msgid="7664017844210142826">
<item quantity="other"><xliff:g id="ID_2">%d</xliff:g> min ago</item>
<item quantity="one"><xliff:g id="ID_1">%d</xliff:g> min ago</item>
</plurals>
- <plurals name="abc_slice_duration_years" formatted="false" msgid="6212691832333991589">
+ <plurals name="abc_slice_duration_years" formatted="false" msgid="2628491538787454021">
<item quantity="other"><xliff:g id="ID_2">%d</xliff:g> yr ago</item>
<item quantity="one"><xliff:g id="ID_1">%d</xliff:g> yr ago</item>
</plurals>
- <plurals name="abc_slice_duration_days" formatted="false" msgid="6241698511167107334">
+ <plurals name="abc_slice_duration_days" formatted="false" msgid="8356547162075064530">
<item quantity="other"><xliff:g id="ID_2">%d</xliff:g> days ago</item>
<item quantity="one"><xliff:g id="ID_1">%d</xliff:g> day ago</item>
</plurals>
- <string name="abc_slice_error" msgid="4188371422904147368">"Couldn\'t connect"</string>
+ <string name="abc_slice_error" msgid="1794214973158263497">"Couldn\'t connect"</string>
</resources>
diff --git a/slice/slice-view/src/main/res/values-en-rGB/strings.xml b/slice/slice-view/src/main/res/values-en-rGB/strings.xml
index 8fa5b45..ac4f6d7 100644
--- a/slice/slice-view/src/main/res/values-en-rGB/strings.xml
+++ b/slice/slice-view/src/main/res/values-en-rGB/strings.xml
@@ -17,21 +17,21 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slice_more_content" msgid="6405516388971241142">"+ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
- <string name="abc_slice_more" msgid="1983560225998630901">"More"</string>
- <string name="abc_slice_show_more" msgid="1567717014004692768">"Show more"</string>
- <string name="abc_slice_updated" msgid="8155085405396453848">"Updated <xliff:g id="TIME">%1$s</xliff:g>"</string>
- <plurals name="abc_slice_duration_min" formatted="false" msgid="6996334305156847955">
+ <string name="abc_slice_more_content" msgid="7841223363798860154">"+ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
+ <string name="abc_slice_more" msgid="4299234410808450900">"More"</string>
+ <string name="abc_slice_show_more" msgid="1112789899890391107">"Show more"</string>
+ <string name="abc_slice_updated" msgid="7932359091871934205">"Updated <xliff:g id="TIME">%1$s</xliff:g>"</string>
+ <plurals name="abc_slice_duration_min" formatted="false" msgid="7664017844210142826">
<item quantity="other"><xliff:g id="ID_2">%d</xliff:g> min ago</item>
<item quantity="one"><xliff:g id="ID_1">%d</xliff:g> min ago</item>
</plurals>
- <plurals name="abc_slice_duration_years" formatted="false" msgid="6212691832333991589">
+ <plurals name="abc_slice_duration_years" formatted="false" msgid="2628491538787454021">
<item quantity="other"><xliff:g id="ID_2">%d</xliff:g> yr ago</item>
<item quantity="one"><xliff:g id="ID_1">%d</xliff:g> yr ago</item>
</plurals>
- <plurals name="abc_slice_duration_days" formatted="false" msgid="6241698511167107334">
+ <plurals name="abc_slice_duration_days" formatted="false" msgid="8356547162075064530">
<item quantity="other"><xliff:g id="ID_2">%d</xliff:g> days ago</item>
<item quantity="one"><xliff:g id="ID_1">%d</xliff:g> day ago</item>
</plurals>
- <string name="abc_slice_error" msgid="4188371422904147368">"Couldn\'t connect"</string>
+ <string name="abc_slice_error" msgid="1794214973158263497">"Couldn\'t connect"</string>
</resources>
diff --git a/slice/slice-view/src/main/res/values-en-rIN/strings.xml b/slice/slice-view/src/main/res/values-en-rIN/strings.xml
index 8fa5b45..ac4f6d7 100644
--- a/slice/slice-view/src/main/res/values-en-rIN/strings.xml
+++ b/slice/slice-view/src/main/res/values-en-rIN/strings.xml
@@ -17,21 +17,21 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slice_more_content" msgid="6405516388971241142">"+ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
- <string name="abc_slice_more" msgid="1983560225998630901">"More"</string>
- <string name="abc_slice_show_more" msgid="1567717014004692768">"Show more"</string>
- <string name="abc_slice_updated" msgid="8155085405396453848">"Updated <xliff:g id="TIME">%1$s</xliff:g>"</string>
- <plurals name="abc_slice_duration_min" formatted="false" msgid="6996334305156847955">
+ <string name="abc_slice_more_content" msgid="7841223363798860154">"+ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
+ <string name="abc_slice_more" msgid="4299234410808450900">"More"</string>
+ <string name="abc_slice_show_more" msgid="1112789899890391107">"Show more"</string>
+ <string name="abc_slice_updated" msgid="7932359091871934205">"Updated <xliff:g id="TIME">%1$s</xliff:g>"</string>
+ <plurals name="abc_slice_duration_min" formatted="false" msgid="7664017844210142826">
<item quantity="other"><xliff:g id="ID_2">%d</xliff:g> min ago</item>
<item quantity="one"><xliff:g id="ID_1">%d</xliff:g> min ago</item>
</plurals>
- <plurals name="abc_slice_duration_years" formatted="false" msgid="6212691832333991589">
+ <plurals name="abc_slice_duration_years" formatted="false" msgid="2628491538787454021">
<item quantity="other"><xliff:g id="ID_2">%d</xliff:g> yr ago</item>
<item quantity="one"><xliff:g id="ID_1">%d</xliff:g> yr ago</item>
</plurals>
- <plurals name="abc_slice_duration_days" formatted="false" msgid="6241698511167107334">
+ <plurals name="abc_slice_duration_days" formatted="false" msgid="8356547162075064530">
<item quantity="other"><xliff:g id="ID_2">%d</xliff:g> days ago</item>
<item quantity="one"><xliff:g id="ID_1">%d</xliff:g> day ago</item>
</plurals>
- <string name="abc_slice_error" msgid="4188371422904147368">"Couldn\'t connect"</string>
+ <string name="abc_slice_error" msgid="1794214973158263497">"Couldn\'t connect"</string>
</resources>
diff --git a/slice/slice-view/src/main/res/values-en-rXC/strings.xml b/slice/slice-view/src/main/res/values-en-rXC/strings.xml
index 03ea7b7..0646ee1 100644
--- a/slice/slice-view/src/main/res/values-en-rXC/strings.xml
+++ b/slice/slice-view/src/main/res/values-en-rXC/strings.xml
@@ -17,21 +17,21 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slice_more_content" msgid="6405516388971241142">"+ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
- <string name="abc_slice_more" msgid="1983560225998630901">"More"</string>
- <string name="abc_slice_show_more" msgid="1567717014004692768">"Show more"</string>
- <string name="abc_slice_updated" msgid="8155085405396453848">"Updated <xliff:g id="TIME">%1$s</xliff:g>"</string>
- <plurals name="abc_slice_duration_min" formatted="false" msgid="6996334305156847955">
- <item quantity="other"><xliff:g id="ID_2">%d</xliff:g> min ago</item>
- <item quantity="one"><xliff:g id="ID_1">%d</xliff:g> min ago</item>
+ <string name="abc_slice_more_content" msgid="7841223363798860154">"+ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
+ <string name="abc_slice_more" msgid="4299234410808450900">"More"</string>
+ <string name="abc_slice_show_more" msgid="1112789899890391107">"Show more"</string>
+ <string name="abc_slice_updated" msgid="7932359091871934205">"Updated <xliff:g id="TIME">%1$s</xliff:g>"</string>
+ <plurals name="abc_slice_duration_min" formatted="false" msgid="7664017844210142826">
+ <item quantity="other"><xliff:g id="ID_2">%d</xliff:g> min ago</item>
+ <item quantity="one"><xliff:g id="ID_1">%d</xliff:g> min ago</item>
</plurals>
- <plurals name="abc_slice_duration_years" formatted="false" msgid="6212691832333991589">
- <item quantity="other"><xliff:g id="ID_2">%d</xliff:g> yr ago</item>
- <item quantity="one"><xliff:g id="ID_1">%d</xliff:g> yr ago</item>
+ <plurals name="abc_slice_duration_years" formatted="false" msgid="2628491538787454021">
+ <item quantity="other"><xliff:g id="ID_2">%d</xliff:g> yr ago</item>
+ <item quantity="one"><xliff:g id="ID_1">%d</xliff:g> yr ago</item>
</plurals>
- <plurals name="abc_slice_duration_days" formatted="false" msgid="6241698511167107334">
- <item quantity="other"><xliff:g id="ID_2">%d</xliff:g> days ago</item>
- <item quantity="one"><xliff:g id="ID_1">%d</xliff:g> day ago</item>
+ <plurals name="abc_slice_duration_days" formatted="false" msgid="8356547162075064530">
+ <item quantity="other"><xliff:g id="ID_2">%d</xliff:g> days ago</item>
+ <item quantity="one"><xliff:g id="ID_1">%d</xliff:g> day ago</item>
</plurals>
- <string name="abc_slice_error" msgid="4188371422904147368">"Couldn\'t connect"</string>
+ <string name="abc_slice_error" msgid="1794214973158263497">"Couldn\'t connect"</string>
</resources>
diff --git a/slice/slice-view/src/main/res/values-es-rUS/strings.xml b/slice/slice-view/src/main/res/values-es-rUS/strings.xml
index 3125104..d89415a 100644
--- a/slice/slice-view/src/main/res/values-es-rUS/strings.xml
+++ b/slice/slice-view/src/main/res/values-es-rUS/strings.xml
@@ -17,21 +17,21 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slice_more_content" msgid="6405516388971241142">"<xliff:g id="NUMBER">%1$d</xliff:g> más"</string>
- <string name="abc_slice_more" msgid="1983560225998630901">"Más"</string>
- <string name="abc_slice_show_more" msgid="1567717014004692768">"Mostrar más"</string>
- <string name="abc_slice_updated" msgid="8155085405396453848">"Última actualización: <xliff:g id="TIME">%1$s</xliff:g>"</string>
- <plurals name="abc_slice_duration_min" formatted="false" msgid="6996334305156847955">
+ <string name="abc_slice_more_content" msgid="7841223363798860154">"+ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
+ <string name="abc_slice_more" msgid="4299234410808450900">"Más"</string>
+ <string name="abc_slice_show_more" msgid="1112789899890391107">"Mostrar más"</string>
+ <string name="abc_slice_updated" msgid="7932359091871934205">"Actualización: <xliff:g id="TIME">%1$s</xliff:g>"</string>
+ <plurals name="abc_slice_duration_min" formatted="false" msgid="7664017844210142826">
<item quantity="other">Hace <xliff:g id="ID_2">%d</xliff:g> min</item>
<item quantity="one">Hace <xliff:g id="ID_1">%d</xliff:g> min</item>
</plurals>
- <plurals name="abc_slice_duration_years" formatted="false" msgid="6212691832333991589">
- <item quantity="other">Hace <xliff:g id="ID_2">%d</xliff:g> años</item>
- <item quantity="one">Hace <xliff:g id="ID_1">%d</xliff:g> año</item>
+ <plurals name="abc_slice_duration_years" formatted="false" msgid="2628491538787454021">
+ <item quantity="other">Hace <xliff:g id="ID_2">%d</xliff:g> años</item>
+ <item quantity="one">Hace <xliff:g id="ID_1">%d</xliff:g> año</item>
</plurals>
- <plurals name="abc_slice_duration_days" formatted="false" msgid="6241698511167107334">
- <item quantity="other">Hace <xliff:g id="ID_2">%d</xliff:g> días</item>
- <item quantity="one">Hace <xliff:g id="ID_1">%d</xliff:g> día</item>
+ <plurals name="abc_slice_duration_days" formatted="false" msgid="8356547162075064530">
+ <item quantity="other">Hace <xliff:g id="ID_2">%d</xliff:g> días</item>
+ <item quantity="one">Hace <xliff:g id="ID_1">%d</xliff:g> día</item>
</plurals>
- <string name="abc_slice_error" msgid="4188371422904147368">"No se pudo establecer conexión"</string>
+ <string name="abc_slice_error" msgid="1794214973158263497">"No se pudo establecer conexión"</string>
</resources>
diff --git a/slice/slice-view/src/main/res/values-es/strings.xml b/slice/slice-view/src/main/res/values-es/strings.xml
index f6e42fc..a55dfb7 100644
--- a/slice/slice-view/src/main/res/values-es/strings.xml
+++ b/slice/slice-view/src/main/res/values-es/strings.xml
@@ -17,21 +17,21 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slice_more_content" msgid="6405516388971241142">"<xliff:g id="NUMBER">%1$d</xliff:g> más"</string>
- <string name="abc_slice_more" msgid="1983560225998630901">"Más"</string>
- <string name="abc_slice_show_more" msgid="1567717014004692768">"Ver más"</string>
- <string name="abc_slice_updated" msgid="8155085405396453848">"Última actualización: <xliff:g id="TIME">%1$s</xliff:g>"</string>
- <plurals name="abc_slice_duration_min" formatted="false" msgid="6996334305156847955">
- <item quantity="other">hace <xliff:g id="ID_2">%d</xliff:g> minutos</item>
- <item quantity="one">hace <xliff:g id="ID_1">%d</xliff:g> minuto</item>
+ <string name="abc_slice_more_content" msgid="7841223363798860154">"+ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
+ <string name="abc_slice_more" msgid="4299234410808450900">"Más"</string>
+ <string name="abc_slice_show_more" msgid="1112789899890391107">"Ver más"</string>
+ <string name="abc_slice_updated" msgid="7932359091871934205">"Última actualización: <xliff:g id="TIME">%1$s</xliff:g>"</string>
+ <plurals name="abc_slice_duration_min" formatted="false" msgid="7664017844210142826">
+ <item quantity="other">Hace <xliff:g id="ID_2">%d</xliff:g> min</item>
+ <item quantity="one">Hace <xliff:g id="ID_1">%d</xliff:g> min</item>
</plurals>
- <plurals name="abc_slice_duration_years" formatted="false" msgid="6212691832333991589">
- <item quantity="other">hace <xliff:g id="ID_2">%d</xliff:g> años</item>
- <item quantity="one">hace <xliff:g id="ID_1">%d</xliff:g> año</item>
+ <plurals name="abc_slice_duration_years" formatted="false" msgid="2628491538787454021">
+ <item quantity="other">Hace <xliff:g id="ID_2">%d</xliff:g> años</item>
+ <item quantity="one">Hace <xliff:g id="ID_1">%d</xliff:g> año</item>
</plurals>
- <plurals name="abc_slice_duration_days" formatted="false" msgid="6241698511167107334">
- <item quantity="other">hace <xliff:g id="ID_2">%d</xliff:g> días</item>
- <item quantity="one">hace <xliff:g id="ID_1">%d</xliff:g> día</item>
+ <plurals name="abc_slice_duration_days" formatted="false" msgid="8356547162075064530">
+ <item quantity="other">Hace <xliff:g id="ID_2">%d</xliff:g> días</item>
+ <item quantity="one">Hace <xliff:g id="ID_1">%d</xliff:g> día</item>
</plurals>
- <string name="abc_slice_error" msgid="4188371422904147368">"No se ha podido establecer la conexión"</string>
+ <string name="abc_slice_error" msgid="1794214973158263497">"No se ha podido conectar"</string>
</resources>
diff --git a/slice/slice-view/src/main/res/values-et/strings.xml b/slice/slice-view/src/main/res/values-et/strings.xml
index 7e053e92..166fd8a 100644
--- a/slice/slice-view/src/main/res/values-et/strings.xml
+++ b/slice/slice-view/src/main/res/values-et/strings.xml
@@ -17,21 +17,21 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slice_more_content" msgid="6405516388971241142">"ja veel <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
- <string name="abc_slice_more" msgid="1983560225998630901">"Rohkem"</string>
- <string name="abc_slice_show_more" msgid="1567717014004692768">"Kuva rohkem"</string>
- <string name="abc_slice_updated" msgid="8155085405396453848">"Värskendatud kell <xliff:g id="TIME">%1$s</xliff:g>"</string>
- <plurals name="abc_slice_duration_min" formatted="false" msgid="6996334305156847955">
+ <string name="abc_slice_more_content" msgid="7841223363798860154">"+<xliff:g id="NUMBER">%1$d</xliff:g>"</string>
+ <string name="abc_slice_more" msgid="4299234410808450900">"Rohkem"</string>
+ <string name="abc_slice_show_more" msgid="1112789899890391107">"Kuva rohkem"</string>
+ <string name="abc_slice_updated" msgid="7932359091871934205">"Värskendati <xliff:g id="TIME">%1$s</xliff:g>"</string>
+ <plurals name="abc_slice_duration_min" formatted="false" msgid="7664017844210142826">
<item quantity="other"><xliff:g id="ID_2">%d</xliff:g> min tagasi</item>
<item quantity="one"><xliff:g id="ID_1">%d</xliff:g> min tagasi</item>
</plurals>
- <plurals name="abc_slice_duration_years" formatted="false" msgid="6212691832333991589">
+ <plurals name="abc_slice_duration_years" formatted="false" msgid="2628491538787454021">
<item quantity="other"><xliff:g id="ID_2">%d</xliff:g> a tagasi</item>
<item quantity="one"><xliff:g id="ID_1">%d</xliff:g> a tagasi</item>
</plurals>
- <plurals name="abc_slice_duration_days" formatted="false" msgid="6241698511167107334">
+ <plurals name="abc_slice_duration_days" formatted="false" msgid="8356547162075064530">
<item quantity="other"><xliff:g id="ID_2">%d</xliff:g> päeva tagasi</item>
<item quantity="one"><xliff:g id="ID_1">%d</xliff:g> päev tagasi</item>
</plurals>
- <string name="abc_slice_error" msgid="4188371422904147368">"Ühendamine ebaõnnestus"</string>
+ <string name="abc_slice_error" msgid="1794214973158263497">"Ühendamine ebaõnnestus"</string>
</resources>
diff --git a/slice/slice-view/src/main/res/values-eu/strings.xml b/slice/slice-view/src/main/res/values-eu/strings.xml
index 4a7f780..6d7dfa3 100644
--- a/slice/slice-view/src/main/res/values-eu/strings.xml
+++ b/slice/slice-view/src/main/res/values-eu/strings.xml
@@ -17,21 +17,21 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slice_more_content" msgid="6405516388971241142">"Beste <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
- <string name="abc_slice_more" msgid="1983560225998630901">"Gehiago"</string>
- <string name="abc_slice_show_more" msgid="1567717014004692768">"Erakutsi gehiago"</string>
- <string name="abc_slice_updated" msgid="8155085405396453848">"Azken eguneratzea: <xliff:g id="TIME">%1$s</xliff:g>"</string>
- <plurals name="abc_slice_duration_min" formatted="false" msgid="6996334305156847955">
- <item quantity="other">Duela <xliff:g id="ID_2">%d</xliff:g> min</item>
- <item quantity="one">Duela <xliff:g id="ID_1">%d</xliff:g> min</item>
+ <string name="abc_slice_more_content" msgid="7841223363798860154">"Beste <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
+ <string name="abc_slice_more" msgid="4299234410808450900">"Gehiago"</string>
+ <string name="abc_slice_show_more" msgid="1112789899890391107">"Erakutsi gehiago"</string>
+ <string name="abc_slice_updated" msgid="7932359091871934205">"Azken eguneratzea: <xliff:g id="TIME">%1$s</xliff:g>"</string>
+ <plurals name="abc_slice_duration_min" formatted="false" msgid="7664017844210142826">
+ <item quantity="other">Duela <xliff:g id="ID_2">%d</xliff:g> min</item>
+ <item quantity="one">Duela <xliff:g id="ID_1">%d</xliff:g> min</item>
</plurals>
- <plurals name="abc_slice_duration_years" formatted="false" msgid="6212691832333991589">
+ <plurals name="abc_slice_duration_years" formatted="false" msgid="2628491538787454021">
<item quantity="other">Duela <xliff:g id="ID_2">%d</xliff:g> urte</item>
<item quantity="one">Duela <xliff:g id="ID_1">%d</xliff:g> urte</item>
</plurals>
- <plurals name="abc_slice_duration_days" formatted="false" msgid="6241698511167107334">
- <item quantity="other">Duela <xliff:g id="ID_2">%d</xliff:g> egun</item>
- <item quantity="one">Duela <xliff:g id="ID_1">%d</xliff:g> egun</item>
+ <plurals name="abc_slice_duration_days" formatted="false" msgid="8356547162075064530">
+ <item quantity="other">Duela <xliff:g id="ID_2">%d</xliff:g> egun</item>
+ <item quantity="one">Duela <xliff:g id="ID_1">%d</xliff:g> egun</item>
</plurals>
- <string name="abc_slice_error" msgid="4188371422904147368">"Ezin izan da konektatu"</string>
+ <string name="abc_slice_error" msgid="1794214973158263497">"Ezin izan da konektatu"</string>
</resources>
diff --git a/slice/slice-view/src/main/res/values-fa/strings.xml b/slice/slice-view/src/main/res/values-fa/strings.xml
index 7832e8a..1ba9209 100644
--- a/slice/slice-view/src/main/res/values-fa/strings.xml
+++ b/slice/slice-view/src/main/res/values-fa/strings.xml
@@ -17,21 +17,21 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slice_more_content" msgid="6405516388971241142">"+ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
- <string name="abc_slice_more" msgid="1983560225998630901">"بیشتر"</string>
- <string name="abc_slice_show_more" msgid="1567717014004692768">"بیشتر ببینید"</string>
- <string name="abc_slice_updated" msgid="8155085405396453848">"زمان بهروزرسانی <xliff:g id="TIME">%1$s</xliff:g>"</string>
- <plurals name="abc_slice_duration_min" formatted="false" msgid="6996334305156847955">
+ <string name="abc_slice_more_content" msgid="7841223363798860154">"+ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
+ <string name="abc_slice_more" msgid="4299234410808450900">"بیشتر"</string>
+ <string name="abc_slice_show_more" msgid="1112789899890391107">"بیشتر ببینید"</string>
+ <string name="abc_slice_updated" msgid="7932359091871934205">"<xliff:g id="TIME">%1$s</xliff:g> بهروزرسانی شد"</string>
+ <plurals name="abc_slice_duration_min" formatted="false" msgid="7664017844210142826">
<item quantity="one"><xliff:g id="ID_2">%d</xliff:g> دقیقه قبل</item>
<item quantity="other"><xliff:g id="ID_2">%d</xliff:g> دقیقه قبل</item>
</plurals>
- <plurals name="abc_slice_duration_years" formatted="false" msgid="6212691832333991589">
+ <plurals name="abc_slice_duration_years" formatted="false" msgid="2628491538787454021">
<item quantity="one"><xliff:g id="ID_2">%d</xliff:g> سال قبل</item>
<item quantity="other"><xliff:g id="ID_2">%d</xliff:g> سال قبل</item>
</plurals>
- <plurals name="abc_slice_duration_days" formatted="false" msgid="6241698511167107334">
+ <plurals name="abc_slice_duration_days" formatted="false" msgid="8356547162075064530">
<item quantity="one"><xliff:g id="ID_2">%d</xliff:g> روز قبل</item>
<item quantity="other"><xliff:g id="ID_2">%d</xliff:g> روز قبل</item>
</plurals>
- <string name="abc_slice_error" msgid="4188371422904147368">"متصل نشد"</string>
+ <string name="abc_slice_error" msgid="1794214973158263497">"متصل نشد"</string>
</resources>
diff --git a/slice/slice-view/src/main/res/values-fi/strings.xml b/slice/slice-view/src/main/res/values-fi/strings.xml
index dbbe0cd..85e25c2 100644
--- a/slice/slice-view/src/main/res/values-fi/strings.xml
+++ b/slice/slice-view/src/main/res/values-fi/strings.xml
@@ -17,21 +17,21 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slice_more_content" msgid="6405516388971241142">"+ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
- <string name="abc_slice_more" msgid="1983560225998630901">"Lisää"</string>
- <string name="abc_slice_show_more" msgid="1567717014004692768">"Näytä lisää"</string>
- <string name="abc_slice_updated" msgid="8155085405396453848">"Päivitetty <xliff:g id="TIME">%1$s</xliff:g>"</string>
- <plurals name="abc_slice_duration_min" formatted="false" msgid="6996334305156847955">
- <item quantity="other"><xliff:g id="ID_2">%d</xliff:g> min sitten</item>
- <item quantity="one"><xliff:g id="ID_1">%d</xliff:g> min sitten</item>
+ <string name="abc_slice_more_content" msgid="7841223363798860154">"+ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
+ <string name="abc_slice_more" msgid="4299234410808450900">"Lisää"</string>
+ <string name="abc_slice_show_more" msgid="1112789899890391107">"Näytä lisää"</string>
+ <string name="abc_slice_updated" msgid="7932359091871934205">"Päivitetty <xliff:g id="TIME">%1$s</xliff:g>"</string>
+ <plurals name="abc_slice_duration_min" formatted="false" msgid="7664017844210142826">
+ <item quantity="other"><xliff:g id="ID_2">%d</xliff:g> min sitten</item>
+ <item quantity="one"><xliff:g id="ID_1">%d</xliff:g> min sitten</item>
</plurals>
- <plurals name="abc_slice_duration_years" formatted="false" msgid="6212691832333991589">
+ <plurals name="abc_slice_duration_years" formatted="false" msgid="2628491538787454021">
<item quantity="other"><xliff:g id="ID_2">%d</xliff:g> vuotta sitten</item>
<item quantity="one"><xliff:g id="ID_1">%d</xliff:g> vuosi sitten</item>
</plurals>
- <plurals name="abc_slice_duration_days" formatted="false" msgid="6241698511167107334">
+ <plurals name="abc_slice_duration_days" formatted="false" msgid="8356547162075064530">
<item quantity="other"><xliff:g id="ID_2">%d</xliff:g> päivää sitten</item>
<item quantity="one"><xliff:g id="ID_1">%d</xliff:g> päivä sitten</item>
</plurals>
- <string name="abc_slice_error" msgid="4188371422904147368">"Ei yhteyttä"</string>
+ <string name="abc_slice_error" msgid="1794214973158263497">"Ei yhteyttä"</string>
</resources>
diff --git a/slice/slice-view/src/main/res/values-fr-rCA/strings.xml b/slice/slice-view/src/main/res/values-fr-rCA/strings.xml
index 63c7fcd..497deaec 100644
--- a/slice/slice-view/src/main/res/values-fr-rCA/strings.xml
+++ b/slice/slice-view/src/main/res/values-fr-rCA/strings.xml
@@ -17,21 +17,21 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slice_more_content" msgid="6405516388971241142">"+ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
- <string name="abc_slice_more" msgid="1983560225998630901">"Plus"</string>
- <string name="abc_slice_show_more" msgid="1567717014004692768">"Plus"</string>
- <string name="abc_slice_updated" msgid="8155085405396453848">"Mise à jour : <xliff:g id="TIME">%1$s</xliff:g>"</string>
- <plurals name="abc_slice_duration_min" formatted="false" msgid="6996334305156847955">
- <item quantity="one">Il y a <xliff:g id="ID_2">%d</xliff:g> minute</item>
- <item quantity="other">Il y a <xliff:g id="ID_2">%d</xliff:g> minutes</item>
+ <string name="abc_slice_more_content" msgid="7841223363798860154">"+ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
+ <string name="abc_slice_more" msgid="4299234410808450900">"Plus"</string>
+ <string name="abc_slice_show_more" msgid="1112789899890391107">"Afficher plus d\'options"</string>
+ <string name="abc_slice_updated" msgid="7932359091871934205">"Mis à jour : <xliff:g id="TIME">%1$s</xliff:g>"</string>
+ <plurals name="abc_slice_duration_min" formatted="false" msgid="7664017844210142826">
+ <item quantity="one">Il y a <xliff:g id="ID_2">%d</xliff:g> min</item>
+ <item quantity="other">Il y a <xliff:g id="ID_2">%d</xliff:g> min</item>
</plurals>
- <plurals name="abc_slice_duration_years" formatted="false" msgid="6212691832333991589">
+ <plurals name="abc_slice_duration_years" formatted="false" msgid="2628491538787454021">
<item quantity="one">Il y a <xliff:g id="ID_2">%d</xliff:g> an</item>
<item quantity="other">Il y a <xliff:g id="ID_2">%d</xliff:g> ans</item>
</plurals>
- <plurals name="abc_slice_duration_days" formatted="false" msgid="6241698511167107334">
- <item quantity="one">Il y a <xliff:g id="ID_2">%d</xliff:g> jour</item>
- <item quantity="other">Il y a <xliff:g id="ID_2">%d</xliff:g> jours</item>
+ <plurals name="abc_slice_duration_days" formatted="false" msgid="8356547162075064530">
+ <item quantity="one">Il y a <xliff:g id="ID_2">%d</xliff:g> j</item>
+ <item quantity="other">Il y a <xliff:g id="ID_2">%d</xliff:g> j</item>
</plurals>
- <string name="abc_slice_error" msgid="4188371422904147368">"Impossible de se connecter"</string>
+ <string name="abc_slice_error" msgid="1794214973158263497">"Impossible de se connecter"</string>
</resources>
diff --git a/slice/slice-view/src/main/res/values-fr/strings.xml b/slice/slice-view/src/main/res/values-fr/strings.xml
index 47ff242..c708167 100644
--- a/slice/slice-view/src/main/res/values-fr/strings.xml
+++ b/slice/slice-view/src/main/res/values-fr/strings.xml
@@ -17,21 +17,21 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slice_more_content" msgid="6405516388971241142">"<xliff:g id="NUMBER">%1$d</xliff:g> autres"</string>
- <string name="abc_slice_more" msgid="1983560225998630901">"Plus"</string>
- <string name="abc_slice_show_more" msgid="1567717014004692768">"Afficher plus"</string>
- <string name="abc_slice_updated" msgid="8155085405396453848">"Dernière mise à jour : <xliff:g id="TIME">%1$s</xliff:g>"</string>
- <plurals name="abc_slice_duration_min" formatted="false" msgid="6996334305156847955">
- <item quantity="one">Il y a <xliff:g id="ID_2">%d</xliff:g> minute</item>
- <item quantity="other">Il y a <xliff:g id="ID_2">%d</xliff:g> minutes</item>
+ <string name="abc_slice_more_content" msgid="7841223363798860154">"+ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
+ <string name="abc_slice_more" msgid="4299234410808450900">"Plus"</string>
+ <string name="abc_slice_show_more" msgid="1112789899890391107">"Plus"</string>
+ <string name="abc_slice_updated" msgid="7932359091871934205">"Mis à jour il y a <xliff:g id="TIME">%1$s</xliff:g>"</string>
+ <plurals name="abc_slice_duration_min" formatted="false" msgid="7664017844210142826">
+ <item quantity="one">Il y a <xliff:g id="ID_2">%d</xliff:g> min</item>
+ <item quantity="other">Il y a <xliff:g id="ID_2">%d</xliff:g> min</item>
</plurals>
- <plurals name="abc_slice_duration_years" formatted="false" msgid="6212691832333991589">
+ <plurals name="abc_slice_duration_years" formatted="false" msgid="2628491538787454021">
<item quantity="one">Il y a <xliff:g id="ID_2">%d</xliff:g> an</item>
<item quantity="other">Il y a <xliff:g id="ID_2">%d</xliff:g> ans</item>
</plurals>
- <plurals name="abc_slice_duration_days" formatted="false" msgid="6241698511167107334">
+ <plurals name="abc_slice_duration_days" formatted="false" msgid="8356547162075064530">
<item quantity="one">Il y a <xliff:g id="ID_2">%d</xliff:g> jour</item>
<item quantity="other">Il y a <xliff:g id="ID_2">%d</xliff:g> jours</item>
</plurals>
- <string name="abc_slice_error" msgid="4188371422904147368">"Impossible de se connecter"</string>
+ <string name="abc_slice_error" msgid="1794214973158263497">"Impossible de se connecter"</string>
</resources>
diff --git a/slice/slice-view/src/main/res/values-gl/strings.xml b/slice/slice-view/src/main/res/values-gl/strings.xml
index fb3d1c2..21f2ab5 100644
--- a/slice/slice-view/src/main/res/values-gl/strings.xml
+++ b/slice/slice-view/src/main/res/values-gl/strings.xml
@@ -17,21 +17,21 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slice_more_content" msgid="6405516388971241142">"<xliff:g id="NUMBER">%1$d</xliff:g> máis"</string>
- <string name="abc_slice_more" msgid="1983560225998630901">"Máis"</string>
- <string name="abc_slice_show_more" msgid="1567717014004692768">"Amosar máis"</string>
- <string name="abc_slice_updated" msgid="8155085405396453848">"Contido actualizado (<xliff:g id="TIME">%1$s</xliff:g>)"</string>
- <plurals name="abc_slice_duration_min" formatted="false" msgid="6996334305156847955">
- <item quantity="other">hai <xliff:g id="ID_2">%d</xliff:g> min</item>
- <item quantity="one">hai <xliff:g id="ID_1">%d</xliff:g> min</item>
+ <string name="abc_slice_more_content" msgid="7841223363798860154">"+ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
+ <string name="abc_slice_more" msgid="4299234410808450900">"Máis"</string>
+ <string name="abc_slice_show_more" msgid="1112789899890391107">"Mostrar máis"</string>
+ <string name="abc_slice_updated" msgid="7932359091871934205">"Última actualización: <xliff:g id="TIME">%1$s</xliff:g>"</string>
+ <plurals name="abc_slice_duration_min" formatted="false" msgid="7664017844210142826">
+ <item quantity="other">Hai <xliff:g id="ID_2">%d</xliff:g> min</item>
+ <item quantity="one">Hai <xliff:g id="ID_1">%d</xliff:g> min</item>
</plurals>
- <plurals name="abc_slice_duration_years" formatted="false" msgid="6212691832333991589">
- <item quantity="other">hai <xliff:g id="ID_2">%d</xliff:g> anos</item>
- <item quantity="one">hai <xliff:g id="ID_1">%d</xliff:g> ano</item>
+ <plurals name="abc_slice_duration_years" formatted="false" msgid="2628491538787454021">
+ <item quantity="other">Hai <xliff:g id="ID_2">%d</xliff:g> anos</item>
+ <item quantity="one">Hai <xliff:g id="ID_1">%d</xliff:g> ano</item>
</plurals>
- <plurals name="abc_slice_duration_days" formatted="false" msgid="6241698511167107334">
- <item quantity="other">hai <xliff:g id="ID_2">%d</xliff:g> días</item>
- <item quantity="one">hai <xliff:g id="ID_1">%d</xliff:g> día</item>
+ <plurals name="abc_slice_duration_days" formatted="false" msgid="8356547162075064530">
+ <item quantity="other">Hai <xliff:g id="ID_2">%d</xliff:g> días</item>
+ <item quantity="one">Hai <xliff:g id="ID_1">%d</xliff:g> día</item>
</plurals>
- <string name="abc_slice_error" msgid="4188371422904147368">"Non se puido establecer conexión"</string>
+ <string name="abc_slice_error" msgid="1794214973158263497">"Non se puido establecer conexión"</string>
</resources>
diff --git a/slice/slice-view/src/main/res/values-gu/strings.xml b/slice/slice-view/src/main/res/values-gu/strings.xml
index 4951f8c..fe90df6 100644
--- a/slice/slice-view/src/main/res/values-gu/strings.xml
+++ b/slice/slice-view/src/main/res/values-gu/strings.xml
@@ -17,21 +17,21 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slice_more_content" msgid="6405516388971241142">"+ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
- <string name="abc_slice_more" msgid="1983560225998630901">"વધુ"</string>
- <string name="abc_slice_show_more" msgid="1567717014004692768">"વધુ બતાવો"</string>
- <string name="abc_slice_updated" msgid="8155085405396453848">"<xliff:g id="TIME">%1$s</xliff:g> અપડેટ થયું"</string>
- <plurals name="abc_slice_duration_min" formatted="false" msgid="6996334305156847955">
+ <string name="abc_slice_more_content" msgid="7841223363798860154">"+ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
+ <string name="abc_slice_more" msgid="4299234410808450900">"વધુ"</string>
+ <string name="abc_slice_show_more" msgid="1112789899890391107">"વધુ બતાવો"</string>
+ <string name="abc_slice_updated" msgid="7932359091871934205">"અપડેટ કરાયાનો સમય <xliff:g id="TIME">%1$s</xliff:g>"</string>
+ <plurals name="abc_slice_duration_min" formatted="false" msgid="7664017844210142826">
<item quantity="one"><xliff:g id="ID_2">%d</xliff:g> મિનિટ પહેલાં</item>
<item quantity="other"><xliff:g id="ID_2">%d</xliff:g> મિનિટ પહેલાં</item>
</plurals>
- <plurals name="abc_slice_duration_years" formatted="false" msgid="6212691832333991589">
+ <plurals name="abc_slice_duration_years" formatted="false" msgid="2628491538787454021">
<item quantity="one"><xliff:g id="ID_2">%d</xliff:g> વર્ષ પહેલાં</item>
<item quantity="other"><xliff:g id="ID_2">%d</xliff:g> વર્ષ પહેલાં</item>
</plurals>
- <plurals name="abc_slice_duration_days" formatted="false" msgid="6241698511167107334">
+ <plurals name="abc_slice_duration_days" formatted="false" msgid="8356547162075064530">
<item quantity="one"><xliff:g id="ID_2">%d</xliff:g> દિવસ પહેલાં</item>
<item quantity="other"><xliff:g id="ID_2">%d</xliff:g> દિવસ પહેલાં</item>
</plurals>
- <string name="abc_slice_error" msgid="4188371422904147368">"કનેક્ટ કરી શકાયું નથી"</string>
+ <string name="abc_slice_error" msgid="1794214973158263497">"કનેક્ટ કરી શકાયું નથી"</string>
</resources>
diff --git a/slice/slice-view/src/main/res/values-hi/strings.xml b/slice/slice-view/src/main/res/values-hi/strings.xml
index 79a64bb..16afba2 100644
--- a/slice/slice-view/src/main/res/values-hi/strings.xml
+++ b/slice/slice-view/src/main/res/values-hi/strings.xml
@@ -17,21 +17,21 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slice_more_content" msgid="6405516388971241142">"+ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
- <string name="abc_slice_more" msgid="1983560225998630901">"ज़्यादा देखें"</string>
- <string name="abc_slice_show_more" msgid="1567717014004692768">"ज़्यादा देखें"</string>
- <string name="abc_slice_updated" msgid="8155085405396453848">"<xliff:g id="TIME">%1$s</xliff:g> बजे अपडेट किया गया"</string>
- <plurals name="abc_slice_duration_min" formatted="false" msgid="6996334305156847955">
+ <string name="abc_slice_more_content" msgid="7841223363798860154">"+ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
+ <string name="abc_slice_more" msgid="4299234410808450900">"ज़्यादा"</string>
+ <string name="abc_slice_show_more" msgid="1112789899890391107">"और दिखाएं"</string>
+ <string name="abc_slice_updated" msgid="7932359091871934205">"<xliff:g id="TIME">%1$s</xliff:g> पहले अपडेट किया गया"</string>
+ <plurals name="abc_slice_duration_min" formatted="false" msgid="7664017844210142826">
<item quantity="one"><xliff:g id="ID_2">%d</xliff:g> मिनट पहले</item>
<item quantity="other"><xliff:g id="ID_2">%d</xliff:g> मिनट पहले</item>
</plurals>
- <plurals name="abc_slice_duration_years" formatted="false" msgid="6212691832333991589">
+ <plurals name="abc_slice_duration_years" formatted="false" msgid="2628491538787454021">
<item quantity="one"><xliff:g id="ID_2">%d</xliff:g> साल पहले</item>
<item quantity="other"><xliff:g id="ID_2">%d</xliff:g> साल पहले</item>
</plurals>
- <plurals name="abc_slice_duration_days" formatted="false" msgid="6241698511167107334">
+ <plurals name="abc_slice_duration_days" formatted="false" msgid="8356547162075064530">
<item quantity="one"><xliff:g id="ID_2">%d</xliff:g> दिन पहले</item>
<item quantity="other"><xliff:g id="ID_2">%d</xliff:g> दिन पहले</item>
</plurals>
- <string name="abc_slice_error" msgid="4188371422904147368">"कनेक्ट नहीं हो पाया"</string>
+ <string name="abc_slice_error" msgid="1794214973158263497">"कनेक्ट नहीं किया जा सका"</string>
</resources>
diff --git a/slice/slice-view/src/main/res/values-hr/strings.xml b/slice/slice-view/src/main/res/values-hr/strings.xml
index f44b06c..d3c01dd 100644
--- a/slice/slice-view/src/main/res/values-hr/strings.xml
+++ b/slice/slice-view/src/main/res/values-hr/strings.xml
@@ -17,24 +17,24 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slice_more_content" msgid="6405516388971241142">"još <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
- <string name="abc_slice_more" msgid="1983560225998630901">"Više"</string>
- <string name="abc_slice_show_more" msgid="1567717014004692768">"Prikaži više"</string>
- <string name="abc_slice_updated" msgid="8155085405396453848">"Ažurirano <xliff:g id="TIME">%1$s</xliff:g>"</string>
- <plurals name="abc_slice_duration_min" formatted="false" msgid="6996334305156847955">
+ <string name="abc_slice_more_content" msgid="7841223363798860154">"+ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
+ <string name="abc_slice_more" msgid="4299234410808450900">"Više"</string>
+ <string name="abc_slice_show_more" msgid="1112789899890391107">"Prikaži više"</string>
+ <string name="abc_slice_updated" msgid="7932359091871934205">"Ažurirano <xliff:g id="TIME">%1$s</xliff:g>"</string>
+ <plurals name="abc_slice_duration_min" formatted="false" msgid="7664017844210142826">
<item quantity="one">Prije <xliff:g id="ID_2">%d</xliff:g> min</item>
<item quantity="few">Prije <xliff:g id="ID_2">%d</xliff:g> min</item>
<item quantity="other">Prije <xliff:g id="ID_2">%d</xliff:g> min</item>
</plurals>
- <plurals name="abc_slice_duration_years" formatted="false" msgid="6212691832333991589">
- <item quantity="one">Prije <xliff:g id="ID_2">%d</xliff:g> godinu</item>
- <item quantity="few">Prije <xliff:g id="ID_2">%d</xliff:g> godine</item>
- <item quantity="other">Prije <xliff:g id="ID_2">%d</xliff:g> godina</item>
+ <plurals name="abc_slice_duration_years" formatted="false" msgid="2628491538787454021">
+ <item quantity="one">Prije <xliff:g id="ID_2">%d</xliff:g> god.</item>
+ <item quantity="few">Prije <xliff:g id="ID_2">%d</xliff:g> god.</item>
+ <item quantity="other">Prije <xliff:g id="ID_2">%d</xliff:g> god.</item>
</plurals>
- <plurals name="abc_slice_duration_days" formatted="false" msgid="6241698511167107334">
+ <plurals name="abc_slice_duration_days" formatted="false" msgid="8356547162075064530">
<item quantity="one">Prije <xliff:g id="ID_2">%d</xliff:g> dan</item>
<item quantity="few">Prije <xliff:g id="ID_2">%d</xliff:g> dana</item>
<item quantity="other">Prije <xliff:g id="ID_2">%d</xliff:g> dana</item>
</plurals>
- <string name="abc_slice_error" msgid="4188371422904147368">"Povezivanje nije moguće"</string>
+ <string name="abc_slice_error" msgid="1794214973158263497">"Povezivanje nije uspjelo"</string>
</resources>
diff --git a/slice/slice-view/src/main/res/values-hu/strings.xml b/slice/slice-view/src/main/res/values-hu/strings.xml
index cf5ebdc..5d498d4 100644
--- a/slice/slice-view/src/main/res/values-hu/strings.xml
+++ b/slice/slice-view/src/main/res/values-hu/strings.xml
@@ -17,21 +17,21 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slice_more_content" msgid="6405516388971241142">"+ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
- <string name="abc_slice_more" msgid="1983560225998630901">"Több"</string>
- <string name="abc_slice_show_more" msgid="1567717014004692768">"Több megjelenítése"</string>
- <string name="abc_slice_updated" msgid="8155085405396453848">"Frissítve: <xliff:g id="TIME">%1$s</xliff:g>"</string>
- <plurals name="abc_slice_duration_min" formatted="false" msgid="6996334305156847955">
- <item quantity="other"><xliff:g id="ID_2">%d</xliff:g> perce</item>
- <item quantity="one"><xliff:g id="ID_1">%d</xliff:g> perce</item>
+ <string name="abc_slice_more_content" msgid="7841223363798860154">"+ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
+ <string name="abc_slice_more" msgid="4299234410808450900">"Több"</string>
+ <string name="abc_slice_show_more" msgid="1112789899890391107">"Több megjelenítése"</string>
+ <string name="abc_slice_updated" msgid="7932359091871934205">"<xliff:g id="TIME">%1$s</xliff:g> frissítve"</string>
+ <plurals name="abc_slice_duration_min" formatted="false" msgid="7664017844210142826">
+ <item quantity="other"><xliff:g id="ID_2">%d</xliff:g> perccel ezelőtt</item>
+ <item quantity="one"><xliff:g id="ID_1">%d</xliff:g> perccel ezelőtt</item>
</plurals>
- <plurals name="abc_slice_duration_years" formatted="false" msgid="6212691832333991589">
+ <plurals name="abc_slice_duration_years" formatted="false" msgid="2628491538787454021">
<item quantity="other"><xliff:g id="ID_2">%d</xliff:g> éve</item>
<item quantity="one"><xliff:g id="ID_1">%d</xliff:g> éve</item>
</plurals>
- <plurals name="abc_slice_duration_days" formatted="false" msgid="6241698511167107334">
+ <plurals name="abc_slice_duration_days" formatted="false" msgid="8356547162075064530">
<item quantity="other"><xliff:g id="ID_2">%d</xliff:g> napja</item>
<item quantity="one"><xliff:g id="ID_1">%d</xliff:g> napja</item>
</plurals>
- <string name="abc_slice_error" msgid="4188371422904147368">"Nem sikerült kapcsolódni"</string>
+ <string name="abc_slice_error" msgid="1794214973158263497">"Nem sikerült csatlakozni"</string>
</resources>
diff --git a/slice/slice-view/src/main/res/values-hy/strings.xml b/slice/slice-view/src/main/res/values-hy/strings.xml
index d0a7c06..08f191a 100644
--- a/slice/slice-view/src/main/res/values-hy/strings.xml
+++ b/slice/slice-view/src/main/res/values-hy/strings.xml
@@ -17,21 +17,21 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slice_more_content" msgid="6405516388971241142">"+ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
- <string name="abc_slice_more" msgid="1983560225998630901">"Ավելին"</string>
- <string name="abc_slice_show_more" msgid="1567717014004692768">"Ցույց տալ ավելին"</string>
- <string name="abc_slice_updated" msgid="8155085405396453848">"Թարմացվել է <xliff:g id="TIME">%1$s</xliff:g>"</string>
- <plurals name="abc_slice_duration_min" formatted="false" msgid="6996334305156847955">
+ <string name="abc_slice_more_content" msgid="7841223363798860154">"+ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
+ <string name="abc_slice_more" msgid="4299234410808450900">"Ավելին"</string>
+ <string name="abc_slice_show_more" msgid="1112789899890391107">"Ծավալել"</string>
+ <string name="abc_slice_updated" msgid="7932359091871934205">"Թարմացվել է <xliff:g id="TIME">%1$s</xliff:g>"</string>
+ <plurals name="abc_slice_duration_min" formatted="false" msgid="7664017844210142826">
<item quantity="one"><xliff:g id="ID_2">%d</xliff:g> րոպե առաջ</item>
<item quantity="other"><xliff:g id="ID_2">%d</xliff:g> րոպե առաջ</item>
</plurals>
- <plurals name="abc_slice_duration_years" formatted="false" msgid="6212691832333991589">
+ <plurals name="abc_slice_duration_years" formatted="false" msgid="2628491538787454021">
<item quantity="one"><xliff:g id="ID_2">%d</xliff:g> տարի առաջ</item>
<item quantity="other"><xliff:g id="ID_2">%d</xliff:g> տարի առաջ</item>
</plurals>
- <plurals name="abc_slice_duration_days" formatted="false" msgid="6241698511167107334">
+ <plurals name="abc_slice_duration_days" formatted="false" msgid="8356547162075064530">
<item quantity="one"><xliff:g id="ID_2">%d</xliff:g> օր առաջ</item>
<item quantity="other"><xliff:g id="ID_2">%d</xliff:g> օր առաջ</item>
</plurals>
- <string name="abc_slice_error" msgid="4188371422904147368">"Չհաջողվեց միանալ"</string>
+ <string name="abc_slice_error" msgid="1794214973158263497">"Չհաջողվեց միանալ"</string>
</resources>
diff --git a/slice/slice-view/src/main/res/values-in/strings.xml b/slice/slice-view/src/main/res/values-in/strings.xml
index 5641ebb..43723bb 100644
--- a/slice/slice-view/src/main/res/values-in/strings.xml
+++ b/slice/slice-view/src/main/res/values-in/strings.xml
@@ -17,21 +17,21 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slice_more_content" msgid="6405516388971241142">"+ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
- <string name="abc_slice_more" msgid="1983560225998630901">"Lainnya"</string>
- <string name="abc_slice_show_more" msgid="1567717014004692768">"Tampilkan lainnya"</string>
- <string name="abc_slice_updated" msgid="8155085405396453848">"Diupdate <xliff:g id="TIME">%1$s</xliff:g>"</string>
- <plurals name="abc_slice_duration_min" formatted="false" msgid="6996334305156847955">
- <item quantity="other"><xliff:g id="ID_2">%d</xliff:g> menit lalu</item>
- <item quantity="one"><xliff:g id="ID_1">%d</xliff:g> menit lalu</item>
+ <string name="abc_slice_more_content" msgid="7841223363798860154">"+ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
+ <string name="abc_slice_more" msgid="4299234410808450900">"Lainnya"</string>
+ <string name="abc_slice_show_more" msgid="1112789899890391107">"Tampilkan lainnya"</string>
+ <string name="abc_slice_updated" msgid="7932359091871934205">"Diperbarui <xliff:g id="TIME">%1$s</xliff:g>"</string>
+ <plurals name="abc_slice_duration_min" formatted="false" msgid="7664017844210142826">
+ <item quantity="other"><xliff:g id="ID_2">%d</xliff:g> mnt lalu</item>
+ <item quantity="one"><xliff:g id="ID_1">%d</xliff:g> mnt lalu</item>
</plurals>
- <plurals name="abc_slice_duration_years" formatted="false" msgid="6212691832333991589">
- <item quantity="other"><xliff:g id="ID_2">%d</xliff:g> tahun lalu</item>
- <item quantity="one"><xliff:g id="ID_1">%d</xliff:g> tahun lalu</item>
+ <plurals name="abc_slice_duration_years" formatted="false" msgid="2628491538787454021">
+ <item quantity="other"><xliff:g id="ID_2">%d</xliff:g> thn lalu</item>
+ <item quantity="one"><xliff:g id="ID_1">%d</xliff:g> thn lalu</item>
</plurals>
- <plurals name="abc_slice_duration_days" formatted="false" msgid="6241698511167107334">
- <item quantity="other"><xliff:g id="ID_2">%d</xliff:g> hari lalu</item>
- <item quantity="one"><xliff:g id="ID_1">%d</xliff:g> hari lalu</item>
+ <plurals name="abc_slice_duration_days" formatted="false" msgid="8356547162075064530">
+ <item quantity="other"><xliff:g id="ID_2">%d</xliff:g> hr lalu</item>
+ <item quantity="one"><xliff:g id="ID_1">%d</xliff:g> hr lalu</item>
</plurals>
- <string name="abc_slice_error" msgid="4188371422904147368">"Tidak dapat terhubung"</string>
+ <string name="abc_slice_error" msgid="1794214973158263497">"Tidak dapat terhubung"</string>
</resources>
diff --git a/slice/slice-view/src/main/res/values-is/strings.xml b/slice/slice-view/src/main/res/values-is/strings.xml
index 855a858..9b20e83a 100644
--- a/slice/slice-view/src/main/res/values-is/strings.xml
+++ b/slice/slice-view/src/main/res/values-is/strings.xml
@@ -17,21 +17,21 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slice_more_content" msgid="6405516388971241142">"+ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
- <string name="abc_slice_more" msgid="1983560225998630901">"Meira"</string>
- <string name="abc_slice_show_more" msgid="1567717014004692768">"Sýna meira"</string>
- <string name="abc_slice_updated" msgid="8155085405396453848">"Uppfært <xliff:g id="TIME">%1$s</xliff:g>"</string>
- <plurals name="abc_slice_duration_min" formatted="false" msgid="6996334305156847955">
+ <string name="abc_slice_more_content" msgid="7841223363798860154">"+ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
+ <string name="abc_slice_more" msgid="4299234410808450900">"Meira"</string>
+ <string name="abc_slice_show_more" msgid="1112789899890391107">"Sýna meira"</string>
+ <string name="abc_slice_updated" msgid="7932359091871934205">"Uppfært <xliff:g id="TIME">%1$s</xliff:g>"</string>
+ <plurals name="abc_slice_duration_min" formatted="false" msgid="7664017844210142826">
<item quantity="one">Fyrir <xliff:g id="ID_2">%d</xliff:g> mín.</item>
<item quantity="other">Fyrir <xliff:g id="ID_2">%d</xliff:g> mín.</item>
</plurals>
- <plurals name="abc_slice_duration_years" formatted="false" msgid="6212691832333991589">
+ <plurals name="abc_slice_duration_years" formatted="false" msgid="2628491538787454021">
<item quantity="one">Fyrir <xliff:g id="ID_2">%d</xliff:g> ári</item>
<item quantity="other">Fyrir <xliff:g id="ID_2">%d</xliff:g> árum</item>
</plurals>
- <plurals name="abc_slice_duration_days" formatted="false" msgid="6241698511167107334">
+ <plurals name="abc_slice_duration_days" formatted="false" msgid="8356547162075064530">
<item quantity="one">Fyrir <xliff:g id="ID_2">%d</xliff:g> degi</item>
<item quantity="other">Fyrir <xliff:g id="ID_2">%d</xliff:g> dögum</item>
</plurals>
- <string name="abc_slice_error" msgid="4188371422904147368">"Tenging mistókst"</string>
+ <string name="abc_slice_error" msgid="1794214973158263497">"Tenging mistókst"</string>
</resources>
diff --git a/slice/slice-view/src/main/res/values-it/strings.xml b/slice/slice-view/src/main/res/values-it/strings.xml
index d2f7a39..9087d7a 100644
--- a/slice/slice-view/src/main/res/values-it/strings.xml
+++ b/slice/slice-view/src/main/res/values-it/strings.xml
@@ -17,21 +17,21 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slice_more_content" msgid="6405516388971241142">"+ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
- <string name="abc_slice_more" msgid="1983560225998630901">"Altro"</string>
- <string name="abc_slice_show_more" msgid="1567717014004692768">"Mostra altro"</string>
- <string name="abc_slice_updated" msgid="8155085405396453848">"Aggiornamento: <xliff:g id="TIME">%1$s</xliff:g>"</string>
- <plurals name="abc_slice_duration_min" formatted="false" msgid="6996334305156847955">
+ <string name="abc_slice_more_content" msgid="7841223363798860154">"+ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
+ <string name="abc_slice_more" msgid="4299234410808450900">"Altro"</string>
+ <string name="abc_slice_show_more" msgid="1112789899890391107">"Mostra altro"</string>
+ <string name="abc_slice_updated" msgid="7932359091871934205">"Ultimo aggiornamento: <xliff:g id="TIME">%1$s</xliff:g>"</string>
+ <plurals name="abc_slice_duration_min" formatted="false" msgid="7664017844210142826">
<item quantity="other"><xliff:g id="ID_2">%d</xliff:g> min fa</item>
<item quantity="one"><xliff:g id="ID_1">%d</xliff:g> min fa</item>
</plurals>
- <plurals name="abc_slice_duration_years" formatted="false" msgid="6212691832333991589">
+ <plurals name="abc_slice_duration_years" formatted="false" msgid="2628491538787454021">
<item quantity="other"><xliff:g id="ID_2">%d</xliff:g> anni fa</item>
<item quantity="one"><xliff:g id="ID_1">%d</xliff:g> anno fa</item>
</plurals>
- <plurals name="abc_slice_duration_days" formatted="false" msgid="6241698511167107334">
- <item quantity="other"><xliff:g id="ID_2">%d</xliff:g> gg fa</item>
- <item quantity="one"><xliff:g id="ID_1">%d</xliff:g> g fa</item>
+ <plurals name="abc_slice_duration_days" formatted="false" msgid="8356547162075064530">
+ <item quantity="other"><xliff:g id="ID_2">%d</xliff:g> giorni fa</item>
+ <item quantity="one"><xliff:g id="ID_1">%d</xliff:g> giorno fa</item>
</plurals>
- <string name="abc_slice_error" msgid="4188371422904147368">"Impossibile collegarsi"</string>
+ <string name="abc_slice_error" msgid="1794214973158263497">"Impossibile collegarsi"</string>
</resources>
diff --git a/slice/slice-view/src/main/res/values-iw/strings.xml b/slice/slice-view/src/main/res/values-iw/strings.xml
index a511a5a..ca930b8 100644
--- a/slice/slice-view/src/main/res/values-iw/strings.xml
+++ b/slice/slice-view/src/main/res/values-iw/strings.xml
@@ -17,27 +17,27 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slice_more_content" msgid="6405516388971241142">"+ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
- <string name="abc_slice_more" msgid="1983560225998630901">"עוד"</string>
- <string name="abc_slice_show_more" msgid="1567717014004692768">"עוד"</string>
- <string name="abc_slice_updated" msgid="8155085405396453848">"עדכון אחרון: <xliff:g id="TIME">%1$s</xliff:g>"</string>
- <plurals name="abc_slice_duration_min" formatted="false" msgid="6996334305156847955">
- <item quantity="two">לפני <xliff:g id="ID_2">%d</xliff:g> דק’</item>
- <item quantity="many">לפני <xliff:g id="ID_2">%d</xliff:g> דק’</item>
- <item quantity="other">לפני <xliff:g id="ID_2">%d</xliff:g> דק’</item>
+ <string name="abc_slice_more_content" msgid="7841223363798860154">"+ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
+ <string name="abc_slice_more" msgid="4299234410808450900">"עוד"</string>
+ <string name="abc_slice_show_more" msgid="1112789899890391107">"הצגת פרטים נוספים"</string>
+ <string name="abc_slice_updated" msgid="7932359091871934205">"עדכון אחרון: <xliff:g id="TIME">%1$s</xliff:g>"</string>
+ <plurals name="abc_slice_duration_min" formatted="false" msgid="7664017844210142826">
+ <item quantity="two">לפני <xliff:g id="ID_2">%d</xliff:g> דקות</item>
+ <item quantity="many">לפני <xliff:g id="ID_2">%d</xliff:g> דקות</item>
+ <item quantity="other">לפני <xliff:g id="ID_2">%d</xliff:g> דקות</item>
<item quantity="one">לפני דקה (<xliff:g id="ID_1">%d</xliff:g>)</item>
</plurals>
- <plurals name="abc_slice_duration_years" formatted="false" msgid="6212691832333991589">
+ <plurals name="abc_slice_duration_years" formatted="false" msgid="2628491538787454021">
<item quantity="two">לפני <xliff:g id="ID_2">%d</xliff:g> שנים</item>
<item quantity="many">לפני <xliff:g id="ID_2">%d</xliff:g> שנים</item>
<item quantity="other">לפני <xliff:g id="ID_2">%d</xliff:g> שנים</item>
<item quantity="one">לפני שנה (<xliff:g id="ID_1">%d</xliff:g>)</item>
</plurals>
- <plurals name="abc_slice_duration_days" formatted="false" msgid="6241698511167107334">
- <item quantity="two">לפני <xliff:g id="ID_2">%d</xliff:g> ימים</item>
+ <plurals name="abc_slice_duration_days" formatted="false" msgid="8356547162075064530">
+ <item quantity="two">לפני יומיים (<xliff:g id="ID_2">%d</xliff:g>)</item>
<item quantity="many">לפני <xliff:g id="ID_2">%d</xliff:g> ימים</item>
<item quantity="other">לפני <xliff:g id="ID_2">%d</xliff:g> ימים</item>
<item quantity="one">לפני יום אחד (<xliff:g id="ID_1">%d</xliff:g>)</item>
</plurals>
- <string name="abc_slice_error" msgid="4188371422904147368">"לא ניתן היה להתחבר"</string>
+ <string name="abc_slice_error" msgid="1794214973158263497">"לא ניתן היה להתחבר"</string>
</resources>
diff --git a/slice/slice-view/src/main/res/values-ja/strings.xml b/slice/slice-view/src/main/res/values-ja/strings.xml
index 4d21cdf..69bd8d9 100644
--- a/slice/slice-view/src/main/res/values-ja/strings.xml
+++ b/slice/slice-view/src/main/res/values-ja/strings.xml
@@ -17,21 +17,21 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slice_more_content" msgid="6405516388971241142">"他 <xliff:g id="NUMBER">%1$d</xliff:g> 件"</string>
- <string name="abc_slice_more" msgid="1983560225998630901">"もっと見る"</string>
- <string name="abc_slice_show_more" msgid="1567717014004692768">"もっと見る"</string>
- <string name="abc_slice_updated" msgid="8155085405396453848">"更新時刻: <xliff:g id="TIME">%1$s</xliff:g>"</string>
- <plurals name="abc_slice_duration_min" formatted="false" msgid="6996334305156847955">
+ <string name="abc_slice_more_content" msgid="7841223363798860154">"他 <xliff:g id="NUMBER">%1$d</xliff:g> 件"</string>
+ <string name="abc_slice_more" msgid="4299234410808450900">"その他"</string>
+ <string name="abc_slice_show_more" msgid="1112789899890391107">"もっと見る"</string>
+ <string name="abc_slice_updated" msgid="7932359091871934205">"<xliff:g id="TIME">%1$s</xliff:g>に更新"</string>
+ <plurals name="abc_slice_duration_min" formatted="false" msgid="7664017844210142826">
<item quantity="other"><xliff:g id="ID_2">%d</xliff:g> 分前</item>
<item quantity="one"><xliff:g id="ID_1">%d</xliff:g> 分前</item>
</plurals>
- <plurals name="abc_slice_duration_years" formatted="false" msgid="6212691832333991589">
+ <plurals name="abc_slice_duration_years" formatted="false" msgid="2628491538787454021">
<item quantity="other"><xliff:g id="ID_2">%d</xliff:g> 年前</item>
<item quantity="one"><xliff:g id="ID_1">%d</xliff:g> 年前</item>
</plurals>
- <plurals name="abc_slice_duration_days" formatted="false" msgid="6241698511167107334">
+ <plurals name="abc_slice_duration_days" formatted="false" msgid="8356547162075064530">
<item quantity="other"><xliff:g id="ID_2">%d</xliff:g> 日前</item>
<item quantity="one"><xliff:g id="ID_1">%d</xliff:g> 日前</item>
</plurals>
- <string name="abc_slice_error" msgid="4188371422904147368">"接続できませんでした"</string>
+ <string name="abc_slice_error" msgid="1794214973158263497">"接続できませんでした"</string>
</resources>
diff --git a/slice/slice-view/src/main/res/values-ka/strings.xml b/slice/slice-view/src/main/res/values-ka/strings.xml
index 9b8558c..5a0e018 100644
--- a/slice/slice-view/src/main/res/values-ka/strings.xml
+++ b/slice/slice-view/src/main/res/values-ka/strings.xml
@@ -17,21 +17,21 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slice_more_content" msgid="6405516388971241142">"+ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
- <string name="abc_slice_more" msgid="1983560225998630901">"მეტი"</string>
- <string name="abc_slice_show_more" msgid="1567717014004692768">"მეტის ჩვენება"</string>
- <string name="abc_slice_updated" msgid="8155085405396453848">"განახლების დრო: <xliff:g id="TIME">%1$s</xliff:g>"</string>
- <plurals name="abc_slice_duration_min" formatted="false" msgid="6996334305156847955">
+ <string name="abc_slice_more_content" msgid="7841223363798860154">"+ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
+ <string name="abc_slice_more" msgid="4299234410808450900">"მეტი"</string>
+ <string name="abc_slice_show_more" msgid="1112789899890391107">"მეტის ჩვენება"</string>
+ <string name="abc_slice_updated" msgid="7932359091871934205">"განახლდა <xliff:g id="TIME">%1$s</xliff:g>"</string>
+ <plurals name="abc_slice_duration_min" formatted="false" msgid="7664017844210142826">
<item quantity="other"><xliff:g id="ID_2">%d</xliff:g> წუთის წინ</item>
<item quantity="one"><xliff:g id="ID_1">%d</xliff:g> წუთის წინ</item>
</plurals>
- <plurals name="abc_slice_duration_years" formatted="false" msgid="6212691832333991589">
+ <plurals name="abc_slice_duration_years" formatted="false" msgid="2628491538787454021">
<item quantity="other"><xliff:g id="ID_2">%d</xliff:g> წლის წინ</item>
<item quantity="one"><xliff:g id="ID_1">%d</xliff:g> წლის წინ</item>
</plurals>
- <plurals name="abc_slice_duration_days" formatted="false" msgid="6241698511167107334">
+ <plurals name="abc_slice_duration_days" formatted="false" msgid="8356547162075064530">
<item quantity="other"><xliff:g id="ID_2">%d</xliff:g> დღის წინ</item>
<item quantity="one"><xliff:g id="ID_1">%d</xliff:g> დღის წინ</item>
</plurals>
- <string name="abc_slice_error" msgid="4188371422904147368">"დაკავშირება ვერ მოხერხდა"</string>
+ <string name="abc_slice_error" msgid="1794214973158263497">"დაკავშირება ვერ მოხერხდა"</string>
</resources>
diff --git a/slice/slice-view/src/main/res/values-kk/strings.xml b/slice/slice-view/src/main/res/values-kk/strings.xml
index 72b0303..6988eaf 100644
--- a/slice/slice-view/src/main/res/values-kk/strings.xml
+++ b/slice/slice-view/src/main/res/values-kk/strings.xml
@@ -17,21 +17,21 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slice_more_content" msgid="6405516388971241142">"+ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
- <string name="abc_slice_more" msgid="1983560225998630901">"Тағы"</string>
- <string name="abc_slice_show_more" msgid="1567717014004692768">"Толығырақ көрсету"</string>
- <string name="abc_slice_updated" msgid="8155085405396453848">"Жаңартылған уақыты: <xliff:g id="TIME">%1$s</xliff:g>"</string>
- <plurals name="abc_slice_duration_min" formatted="false" msgid="6996334305156847955">
- <item quantity="other"><xliff:g id="ID_2">%d</xliff:g> минут бұрын</item>
- <item quantity="one"><xliff:g id="ID_1">%d</xliff:g> минут бұрын</item>
+ <string name="abc_slice_more_content" msgid="7841223363798860154">"+ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
+ <string name="abc_slice_more" msgid="4299234410808450900">"Жаю"</string>
+ <string name="abc_slice_show_more" msgid="1112789899890391107">"Басқаларын көру"</string>
+ <string name="abc_slice_updated" msgid="7932359091871934205">"Жаңартылған: <xliff:g id="TIME">%1$s</xliff:g>"</string>
+ <plurals name="abc_slice_duration_min" formatted="false" msgid="7664017844210142826">
+ <item quantity="other"><xliff:g id="ID_2">%d</xliff:g> мин бұрын</item>
+ <item quantity="one"><xliff:g id="ID_1">%d</xliff:g> мин бұрын</item>
</plurals>
- <plurals name="abc_slice_duration_years" formatted="false" msgid="6212691832333991589">
+ <plurals name="abc_slice_duration_years" formatted="false" msgid="2628491538787454021">
<item quantity="other"><xliff:g id="ID_2">%d</xliff:g> жыл бұрын</item>
<item quantity="one"><xliff:g id="ID_1">%d</xliff:g> жыл бұрын</item>
</plurals>
- <plurals name="abc_slice_duration_days" formatted="false" msgid="6241698511167107334">
- <item quantity="other"><xliff:g id="ID_2">%d</xliff:g> күн бұрын</item>
- <item quantity="one"><xliff:g id="ID_1">%d</xliff:g> күн бұрын</item>
+ <plurals name="abc_slice_duration_days" formatted="false" msgid="8356547162075064530">
+ <item quantity="other"><xliff:g id="ID_2">%d</xliff:g> күн бұрын</item>
+ <item quantity="one"><xliff:g id="ID_1">%d</xliff:g> күн бұрын</item>
</plurals>
- <string name="abc_slice_error" msgid="4188371422904147368">"Байланыс орнатылмады"</string>
+ <string name="abc_slice_error" msgid="1794214973158263497">"Қосылмады"</string>
</resources>
diff --git a/slice/slice-view/src/main/res/values-km/strings.xml b/slice/slice-view/src/main/res/values-km/strings.xml
index 1e78acb..6cbcb6f 100644
--- a/slice/slice-view/src/main/res/values-km/strings.xml
+++ b/slice/slice-view/src/main/res/values-km/strings.xml
@@ -17,21 +17,21 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slice_more_content" msgid="6405516388971241142">"+ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
- <string name="abc_slice_more" msgid="1983560225998630901">"ច្រើនទៀត"</string>
- <string name="abc_slice_show_more" msgid="1567717014004692768">"បង្ហាញច្រើនទៀត"</string>
- <string name="abc_slice_updated" msgid="8155085405396453848">"បានធ្វើបច្ចុប្បន្នភាពកាលពី <xliff:g id="TIME">%1$s</xliff:g>"</string>
- <plurals name="abc_slice_duration_min" formatted="false" msgid="6996334305156847955">
+ <string name="abc_slice_more_content" msgid="7841223363798860154">"+ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
+ <string name="abc_slice_more" msgid="4299234410808450900">"ច្រើនទៀត"</string>
+ <string name="abc_slice_show_more" msgid="1112789899890391107">"បង្ហាញច្រើនទៀត"</string>
+ <string name="abc_slice_updated" msgid="7932359091871934205">"បានធ្វើបច្ចុប្បន្នភាព <xliff:g id="TIME">%1$s</xliff:g>"</string>
+ <plurals name="abc_slice_duration_min" formatted="false" msgid="7664017844210142826">
<item quantity="other"><xliff:g id="ID_2">%d</xliff:g> នាទីមុន</item>
<item quantity="one"><xliff:g id="ID_1">%d</xliff:g> នាទីមុន</item>
</plurals>
- <plurals name="abc_slice_duration_years" formatted="false" msgid="6212691832333991589">
+ <plurals name="abc_slice_duration_years" formatted="false" msgid="2628491538787454021">
<item quantity="other"><xliff:g id="ID_2">%d</xliff:g> ឆ្នាំមុន</item>
<item quantity="one"><xliff:g id="ID_1">%d</xliff:g> ឆ្នាំមុន</item>
</plurals>
- <plurals name="abc_slice_duration_days" formatted="false" msgid="6241698511167107334">
- <item quantity="other"><xliff:g id="ID_2">%d</xliff:g> ថ្ងៃមុន</item>
- <item quantity="one"><xliff:g id="ID_1">%d</xliff:g> ថ្ងៃមុន</item>
+ <plurals name="abc_slice_duration_days" formatted="false" msgid="8356547162075064530">
+ <item quantity="other"><xliff:g id="ID_2">%d</xliff:g> ថ្ងៃមុន</item>
+ <item quantity="one"><xliff:g id="ID_1">%d</xliff:g> ថ្ងៃមុន</item>
</plurals>
- <string name="abc_slice_error" msgid="4188371422904147368">"មិនអាចភ្ជាប់បានទេ"</string>
+ <string name="abc_slice_error" msgid="1794214973158263497">"មិនអាចភ្ជាប់បានទេ"</string>
</resources>
diff --git a/slice/slice-view/src/main/res/values-kn/strings.xml b/slice/slice-view/src/main/res/values-kn/strings.xml
index ed7dcd6..252b999 100644
--- a/slice/slice-view/src/main/res/values-kn/strings.xml
+++ b/slice/slice-view/src/main/res/values-kn/strings.xml
@@ -17,21 +17,21 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slice_more_content" msgid="6405516388971241142">"+ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
- <string name="abc_slice_more" msgid="1983560225998630901">"ಇನ್ನಷ್ಟು"</string>
- <string name="abc_slice_show_more" msgid="1567717014004692768">"ಹೆಚ್ಚು ತೋರಿಸಿ"</string>
- <string name="abc_slice_updated" msgid="8155085405396453848">"<xliff:g id="TIME">%1$s</xliff:g> ಅನ್ನು ಅಪ್ಡೇಟ್ ಮಾಡಲಾಗಿದೆ"</string>
- <plurals name="abc_slice_duration_min" formatted="false" msgid="6996334305156847955">
+ <string name="abc_slice_more_content" msgid="7841223363798860154">"+ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
+ <string name="abc_slice_more" msgid="4299234410808450900">"ಇನ್ನಷ್ಟು"</string>
+ <string name="abc_slice_show_more" msgid="1112789899890391107">"ಇನ್ನಷ್ಟು ತೋರಿಸಿ"</string>
+ <string name="abc_slice_updated" msgid="7932359091871934205">"<xliff:g id="TIME">%1$s</xliff:g> ಅಪ್ಡೇಟ್ ಮಾಡಲಾಗಿದೆ"</string>
+ <plurals name="abc_slice_duration_min" formatted="false" msgid="7664017844210142826">
<item quantity="one"><xliff:g id="ID_2">%d</xliff:g> ನಿಮಿಷದ ಹಿಂದೆ</item>
<item quantity="other"><xliff:g id="ID_2">%d</xliff:g> ನಿಮಿಷದ ಹಿಂದೆ</item>
</plurals>
- <plurals name="abc_slice_duration_years" formatted="false" msgid="6212691832333991589">
+ <plurals name="abc_slice_duration_years" formatted="false" msgid="2628491538787454021">
<item quantity="one"><xliff:g id="ID_2">%d</xliff:g> ವರ್ಷದ ಹಿಂದೆ</item>
<item quantity="other"><xliff:g id="ID_2">%d</xliff:g> ವರ್ಷದ ಹಿಂದೆ</item>
</plurals>
- <plurals name="abc_slice_duration_days" formatted="false" msgid="6241698511167107334">
+ <plurals name="abc_slice_duration_days" formatted="false" msgid="8356547162075064530">
<item quantity="one"><xliff:g id="ID_2">%d</xliff:g> ದಿನಗಳ ಹಿಂದೆ</item>
<item quantity="other"><xliff:g id="ID_2">%d</xliff:g> ದಿನಗಳ ಹಿಂದೆ</item>
</plurals>
- <string name="abc_slice_error" msgid="4188371422904147368">"ಸಂಪರ್ಕಿಸಲು ಸಾಧ್ಯವಾಗುತ್ತಿಲ್ಲ"</string>
+ <string name="abc_slice_error" msgid="1794214973158263497">"ಕನೆಕ್ಟ್ ಮಾಡಲು ಸಾಧ್ಯವಾಗಲಿಲ್ಲ"</string>
</resources>
diff --git a/slice/slice-view/src/main/res/values-ko/strings.xml b/slice/slice-view/src/main/res/values-ko/strings.xml
index 4dab983..448375b 100644
--- a/slice/slice-view/src/main/res/values-ko/strings.xml
+++ b/slice/slice-view/src/main/res/values-ko/strings.xml
@@ -17,21 +17,21 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slice_more_content" msgid="6405516388971241142">"<xliff:g id="NUMBER">%1$d</xliff:g>개 더보기"</string>
- <string name="abc_slice_more" msgid="1983560225998630901">"더보기"</string>
- <string name="abc_slice_show_more" msgid="1567717014004692768">"더보기"</string>
- <string name="abc_slice_updated" msgid="8155085405396453848">"<xliff:g id="TIME">%1$s</xliff:g>에 업데이트됨"</string>
- <plurals name="abc_slice_duration_min" formatted="false" msgid="6996334305156847955">
+ <string name="abc_slice_more_content" msgid="7841223363798860154">"<xliff:g id="NUMBER">%1$d</xliff:g>개 더보기"</string>
+ <string name="abc_slice_more" msgid="4299234410808450900">"더보기"</string>
+ <string name="abc_slice_show_more" msgid="1112789899890391107">"더보기"</string>
+ <string name="abc_slice_updated" msgid="7932359091871934205">"<xliff:g id="TIME">%1$s</xliff:g>에 업데이트함"</string>
+ <plurals name="abc_slice_duration_min" formatted="false" msgid="7664017844210142826">
<item quantity="other"><xliff:g id="ID_2">%d</xliff:g>분 전</item>
<item quantity="one"><xliff:g id="ID_1">%d</xliff:g>분 전</item>
</plurals>
- <plurals name="abc_slice_duration_years" formatted="false" msgid="6212691832333991589">
+ <plurals name="abc_slice_duration_years" formatted="false" msgid="2628491538787454021">
<item quantity="other"><xliff:g id="ID_2">%d</xliff:g>년 전</item>
<item quantity="one"><xliff:g id="ID_1">%d</xliff:g>년 전</item>
</plurals>
- <plurals name="abc_slice_duration_days" formatted="false" msgid="6241698511167107334">
+ <plurals name="abc_slice_duration_days" formatted="false" msgid="8356547162075064530">
<item quantity="other"><xliff:g id="ID_2">%d</xliff:g>일 전</item>
<item quantity="one"><xliff:g id="ID_1">%d</xliff:g>일 전</item>
</plurals>
- <string name="abc_slice_error" msgid="4188371422904147368">"연결할 수 없음"</string>
+ <string name="abc_slice_error" msgid="1794214973158263497">"연결할 수 없음"</string>
</resources>
diff --git a/slice/slice-view/src/main/res/values-ky/strings.xml b/slice/slice-view/src/main/res/values-ky/strings.xml
index 4730de0..f3b7450 100644
--- a/slice/slice-view/src/main/res/values-ky/strings.xml
+++ b/slice/slice-view/src/main/res/values-ky/strings.xml
@@ -17,21 +17,21 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slice_more_content" msgid="6405516388971241142">"+ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
- <string name="abc_slice_more" msgid="1983560225998630901">"Дагы"</string>
- <string name="abc_slice_show_more" msgid="1567717014004692768">"Дагы көрсөтүү"</string>
- <string name="abc_slice_updated" msgid="8155085405396453848">"<xliff:g id="TIME">%1$s</xliff:g> жаңырды"</string>
- <plurals name="abc_slice_duration_min" formatted="false" msgid="6996334305156847955">
+ <string name="abc_slice_more_content" msgid="7841223363798860154">"+ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
+ <string name="abc_slice_more" msgid="4299234410808450900">"Дагы"</string>
+ <string name="abc_slice_show_more" msgid="1112789899890391107">"Дагы көрсөтүү"</string>
+ <string name="abc_slice_updated" msgid="7932359091871934205">"<xliff:g id="TIME">%1$s</xliff:g> жаңыртылды"</string>
+ <plurals name="abc_slice_duration_min" formatted="false" msgid="7664017844210142826">
<item quantity="other"><xliff:g id="ID_2">%d</xliff:g> мүн. мурун</item>
<item quantity="one"><xliff:g id="ID_1">%d</xliff:g> мүн. мурун</item>
</plurals>
- <plurals name="abc_slice_duration_years" formatted="false" msgid="6212691832333991589">
+ <plurals name="abc_slice_duration_years" formatted="false" msgid="2628491538787454021">
<item quantity="other"><xliff:g id="ID_2">%d</xliff:g> жыл мурун</item>
<item quantity="one"><xliff:g id="ID_1">%d</xliff:g> жыл мурун</item>
</plurals>
- <plurals name="abc_slice_duration_days" formatted="false" msgid="6241698511167107334">
+ <plurals name="abc_slice_duration_days" formatted="false" msgid="8356547162075064530">
<item quantity="other"><xliff:g id="ID_2">%d</xliff:g> күн мурун</item>
<item quantity="one"><xliff:g id="ID_1">%d</xliff:g> күн мурун</item>
</plurals>
- <string name="abc_slice_error" msgid="4188371422904147368">"Туташпай койду"</string>
+ <string name="abc_slice_error" msgid="1794214973158263497">"Туташпай койду"</string>
</resources>
diff --git a/slice/slice-view/src/main/res/values-lo/strings.xml b/slice/slice-view/src/main/res/values-lo/strings.xml
index 89c4291..400474b 100644
--- a/slice/slice-view/src/main/res/values-lo/strings.xml
+++ b/slice/slice-view/src/main/res/values-lo/strings.xml
@@ -17,21 +17,21 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slice_more_content" msgid="6405516388971241142">"+ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
- <string name="abc_slice_more" msgid="1983560225998630901">"ເພີ່ມເຕີມ"</string>
- <string name="abc_slice_show_more" msgid="1567717014004692768">"ສະແດງເພີ່ມເຕີມ"</string>
- <string name="abc_slice_updated" msgid="8155085405396453848">"ອັບເດດເມື່ອ <xliff:g id="TIME">%1$s</xliff:g>"</string>
- <plurals name="abc_slice_duration_min" formatted="false" msgid="6996334305156847955">
+ <string name="abc_slice_more_content" msgid="7841223363798860154">"+ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
+ <string name="abc_slice_more" msgid="4299234410808450900">"ເພີ່ມເຕີມ"</string>
+ <string name="abc_slice_show_more" msgid="1112789899890391107">"ສະແດງເພີ່ມເຕີມ"</string>
+ <string name="abc_slice_updated" msgid="7932359091871934205">"ອັບເດດເມື່ອ <xliff:g id="TIME">%1$s</xliff:g>"</string>
+ <plurals name="abc_slice_duration_min" formatted="false" msgid="7664017844210142826">
<item quantity="other"><xliff:g id="ID_2">%d</xliff:g> ນທ ກ່ອນ</item>
<item quantity="one"><xliff:g id="ID_1">%d</xliff:g> ນທ ກ່ອນ</item>
</plurals>
- <plurals name="abc_slice_duration_years" formatted="false" msgid="6212691832333991589">
+ <plurals name="abc_slice_duration_years" formatted="false" msgid="2628491538787454021">
<item quantity="other"><xliff:g id="ID_2">%d</xliff:g> ປີກ່ອນ</item>
- <item quantity="one"><xliff:g id="ID_1">%d</xliff:g> ປີກ່ອນ</item>
+ <item quantity="one"><xliff:g id="ID_1">%d</xliff:g> ປິກ່ອນ</item>
</plurals>
- <plurals name="abc_slice_duration_days" formatted="false" msgid="6241698511167107334">
+ <plurals name="abc_slice_duration_days" formatted="false" msgid="8356547162075064530">
<item quantity="other"><xliff:g id="ID_2">%d</xliff:g> ມື້ກ່ອນ</item>
<item quantity="one"><xliff:g id="ID_1">%d</xliff:g> ມື້ກ່ອນ</item>
</plurals>
- <string name="abc_slice_error" msgid="4188371422904147368">"ບໍ່ສາມາດເຊື່ອມຕໍ່ໄດ້"</string>
+ <string name="abc_slice_error" msgid="1794214973158263497">"ບໍ່ສາມາດເຊື່ອມຕໍ່ໄດ້"</string>
</resources>
diff --git a/slice/slice-view/src/main/res/values-lt/strings.xml b/slice/slice-view/src/main/res/values-lt/strings.xml
index e4094b4..1117ecc 100644
--- a/slice/slice-view/src/main/res/values-lt/strings.xml
+++ b/slice/slice-view/src/main/res/values-lt/strings.xml
@@ -17,27 +17,27 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slice_more_content" msgid="6405516388971241142">"Dar <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
- <string name="abc_slice_more" msgid="1983560225998630901">"Daugiau"</string>
- <string name="abc_slice_show_more" msgid="1567717014004692768">"Rodyti daugiau"</string>
- <string name="abc_slice_updated" msgid="8155085405396453848">"Atnaujinta <xliff:g id="TIME">%1$s</xliff:g>"</string>
- <plurals name="abc_slice_duration_min" formatted="false" msgid="6996334305156847955">
+ <string name="abc_slice_more_content" msgid="7841223363798860154">"+ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
+ <string name="abc_slice_more" msgid="4299234410808450900">"Daugiau"</string>
+ <string name="abc_slice_show_more" msgid="1112789899890391107">"Rodyti daugiau"</string>
+ <string name="abc_slice_updated" msgid="7932359091871934205">"Atnaujinta <xliff:g id="TIME">%1$s</xliff:g>"</string>
+ <plurals name="abc_slice_duration_min" formatted="false" msgid="7664017844210142826">
<item quantity="one">Prieš <xliff:g id="ID_2">%d</xliff:g> min.</item>
<item quantity="few">Prieš <xliff:g id="ID_2">%d</xliff:g> min.</item>
<item quantity="many">Prieš <xliff:g id="ID_2">%d</xliff:g> min.</item>
<item quantity="other">Prieš <xliff:g id="ID_2">%d</xliff:g> min.</item>
</plurals>
- <plurals name="abc_slice_duration_years" formatted="false" msgid="6212691832333991589">
+ <plurals name="abc_slice_duration_years" formatted="false" msgid="2628491538787454021">
<item quantity="one">Prieš <xliff:g id="ID_2">%d</xliff:g> m.</item>
<item quantity="few">Prieš <xliff:g id="ID_2">%d</xliff:g> m.</item>
<item quantity="many">Prieš <xliff:g id="ID_2">%d</xliff:g> m.</item>
<item quantity="other">Prieš <xliff:g id="ID_2">%d</xliff:g> m.</item>
</plurals>
- <plurals name="abc_slice_duration_days" formatted="false" msgid="6241698511167107334">
+ <plurals name="abc_slice_duration_days" formatted="false" msgid="8356547162075064530">
<item quantity="one">Prieš <xliff:g id="ID_2">%d</xliff:g> d.</item>
<item quantity="few">Prieš <xliff:g id="ID_2">%d</xliff:g> d.</item>
<item quantity="many">Prieš <xliff:g id="ID_2">%d</xliff:g> d.</item>
<item quantity="other">Prieš <xliff:g id="ID_2">%d</xliff:g> d.</item>
</plurals>
- <string name="abc_slice_error" msgid="4188371422904147368">"Prisijungti nepavyko"</string>
+ <string name="abc_slice_error" msgid="1794214973158263497">"Prisijungti nepavyko"</string>
</resources>
diff --git a/slice/slice-view/src/main/res/values-lv/strings.xml b/slice/slice-view/src/main/res/values-lv/strings.xml
index 45be57c..c682863 100644
--- a/slice/slice-view/src/main/res/values-lv/strings.xml
+++ b/slice/slice-view/src/main/res/values-lv/strings.xml
@@ -17,24 +17,24 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slice_more_content" msgid="6405516388971241142">"Vēl <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
- <string name="abc_slice_more" msgid="1983560225998630901">"Vēl"</string>
- <string name="abc_slice_show_more" msgid="1567717014004692768">"Rādīt vairāk"</string>
- <string name="abc_slice_updated" msgid="8155085405396453848">"Atjaunināts <xliff:g id="TIME">%1$s</xliff:g>"</string>
- <plurals name="abc_slice_duration_min" formatted="false" msgid="6996334305156847955">
+ <string name="abc_slice_more_content" msgid="7841223363798860154">"Vēl <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
+ <string name="abc_slice_more" msgid="4299234410808450900">"Vairāk"</string>
+ <string name="abc_slice_show_more" msgid="1112789899890391107">"Rādīt vairāk"</string>
+ <string name="abc_slice_updated" msgid="7932359091871934205">"Saturs atjaunināts: <xliff:g id="TIME">%1$s</xliff:g>"</string>
+ <plurals name="abc_slice_duration_min" formatted="false" msgid="7664017844210142826">
<item quantity="zero">Pirms <xliff:g id="ID_2">%d</xliff:g> minūtēm</item>
<item quantity="one">Pirms <xliff:g id="ID_2">%d</xliff:g> minūtes</item>
<item quantity="other">Pirms <xliff:g id="ID_2">%d</xliff:g> minūtēm</item>
</plurals>
- <plurals name="abc_slice_duration_years" formatted="false" msgid="6212691832333991589">
+ <plurals name="abc_slice_duration_years" formatted="false" msgid="2628491538787454021">
<item quantity="zero">Pirms <xliff:g id="ID_2">%d</xliff:g> gadiem</item>
<item quantity="one">Pirms <xliff:g id="ID_2">%d</xliff:g> gada</item>
<item quantity="other">Pirms <xliff:g id="ID_2">%d</xliff:g> gadiem</item>
</plurals>
- <plurals name="abc_slice_duration_days" formatted="false" msgid="6241698511167107334">
+ <plurals name="abc_slice_duration_days" formatted="false" msgid="8356547162075064530">
<item quantity="zero">Pirms <xliff:g id="ID_2">%d</xliff:g> dienām</item>
<item quantity="one">Pirms <xliff:g id="ID_2">%d</xliff:g> dienas</item>
<item quantity="other">Pirms <xliff:g id="ID_2">%d</xliff:g> dienām</item>
</plurals>
- <string name="abc_slice_error" msgid="4188371422904147368">"Nevarēja izveidot savienojumu"</string>
+ <string name="abc_slice_error" msgid="1794214973158263497">"Nevarēja izveidot savienojumu"</string>
</resources>
diff --git a/slice/slice-view/src/main/res/values-mk/strings.xml b/slice/slice-view/src/main/res/values-mk/strings.xml
index ff88cd7..6672e5f 100644
--- a/slice/slice-view/src/main/res/values-mk/strings.xml
+++ b/slice/slice-view/src/main/res/values-mk/strings.xml
@@ -17,21 +17,21 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slice_more_content" msgid="6405516388971241142">"+ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
- <string name="abc_slice_more" msgid="1983560225998630901">"Повеќе"</string>
- <string name="abc_slice_show_more" msgid="1567717014004692768">"Прикажи повеќе"</string>
- <string name="abc_slice_updated" msgid="8155085405396453848">"Ажурирано <xliff:g id="TIME">%1$s</xliff:g>"</string>
- <plurals name="abc_slice_duration_min" formatted="false" msgid="6996334305156847955">
+ <string name="abc_slice_more_content" msgid="7841223363798860154">"+ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
+ <string name="abc_slice_more" msgid="4299234410808450900">"Повеќе"</string>
+ <string name="abc_slice_show_more" msgid="1112789899890391107">"Прикажи повеќе"</string>
+ <string name="abc_slice_updated" msgid="7932359091871934205">"Ажурирано <xliff:g id="TIME">%1$s</xliff:g>"</string>
+ <plurals name="abc_slice_duration_min" formatted="false" msgid="7664017844210142826">
<item quantity="one">Пред <xliff:g id="ID_2">%d</xliff:g> мин.</item>
<item quantity="other">Пред <xliff:g id="ID_2">%d</xliff:g> мин.</item>
</plurals>
- <plurals name="abc_slice_duration_years" formatted="false" msgid="6212691832333991589">
- <item quantity="one">Пред <xliff:g id="ID_2">%d</xliff:g> год.</item>
- <item quantity="other">Пред <xliff:g id="ID_2">%d</xliff:g> год.</item>
+ <plurals name="abc_slice_duration_years" formatted="false" msgid="2628491538787454021">
+ <item quantity="one">Пред <xliff:g id="ID_2">%d</xliff:g> г.</item>
+ <item quantity="other">Пред <xliff:g id="ID_2">%d</xliff:g> г.</item>
</plurals>
- <plurals name="abc_slice_duration_days" formatted="false" msgid="6241698511167107334">
+ <plurals name="abc_slice_duration_days" formatted="false" msgid="8356547162075064530">
<item quantity="one">Пред <xliff:g id="ID_2">%d</xliff:g> ден</item>
<item quantity="other">Пред <xliff:g id="ID_2">%d</xliff:g> дена</item>
</plurals>
- <string name="abc_slice_error" msgid="4188371422904147368">"Не може да се поврзе"</string>
+ <string name="abc_slice_error" msgid="1794214973158263497">"Не може да се поврзе"</string>
</resources>
diff --git a/slice/slice-view/src/main/res/values-ml/strings.xml b/slice/slice-view/src/main/res/values-ml/strings.xml
index b67ae80..59f1686 100644
--- a/slice/slice-view/src/main/res/values-ml/strings.xml
+++ b/slice/slice-view/src/main/res/values-ml/strings.xml
@@ -17,21 +17,21 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slice_more_content" msgid="6405516388971241142">"+ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
- <string name="abc_slice_more" msgid="1983560225998630901">"കൂടുതൽ"</string>
- <string name="abc_slice_show_more" msgid="1567717014004692768">"കൂടുതൽ കാണിക്കുക"</string>
- <string name="abc_slice_updated" msgid="8155085405396453848">"<xliff:g id="TIME">%1$s</xliff:g> അപ്ഡേറ്റ് ചെയ്തു"</string>
- <plurals name="abc_slice_duration_min" formatted="false" msgid="6996334305156847955">
- <item quantity="other"><xliff:g id="ID_2">%d</xliff:g> മിനിറ്റ് മുൻപ്</item>
- <item quantity="one"><xliff:g id="ID_1">%d</xliff:g> മിനിറ്റ് മുൻപ്</item>
+ <string name="abc_slice_more_content" msgid="7841223363798860154">"+ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
+ <string name="abc_slice_more" msgid="4299234410808450900">"കൂടുതൽ"</string>
+ <string name="abc_slice_show_more" msgid="1112789899890391107">"കൂടുതൽ കാണിക്കുക"</string>
+ <string name="abc_slice_updated" msgid="7932359091871934205">"<xliff:g id="TIME">%1$s</xliff:g> അപ്ഡേറ്റ് ചെയ്തു"</string>
+ <plurals name="abc_slice_duration_min" formatted="false" msgid="7664017844210142826">
+ <item quantity="other"><xliff:g id="ID_2">%d</xliff:g> മിനിറ്റ് മുമ്പ്</item>
+ <item quantity="one"><xliff:g id="ID_1">%d</xliff:g> മിനിറ്റ് മുമ്പ്</item>
</plurals>
- <plurals name="abc_slice_duration_years" formatted="false" msgid="6212691832333991589">
- <item quantity="other"><xliff:g id="ID_2">%d</xliff:g> വർഷം മുൻപ്</item>
- <item quantity="one"><xliff:g id="ID_1">%d</xliff:g> വർഷം മുൻപ്</item>
+ <plurals name="abc_slice_duration_years" formatted="false" msgid="2628491538787454021">
+ <item quantity="other"><xliff:g id="ID_2">%d</xliff:g> വർഷം മുമ്പ്</item>
+ <item quantity="one"><xliff:g id="ID_1">%d</xliff:g> വർഷം മുമ്പ്</item>
</plurals>
- <plurals name="abc_slice_duration_days" formatted="false" msgid="6241698511167107334">
- <item quantity="other"><xliff:g id="ID_2">%d</xliff:g> ദിവസം മുൻപ്</item>
- <item quantity="one"><xliff:g id="ID_1">%d</xliff:g> ദിവസം മുൻപ്</item>
+ <plurals name="abc_slice_duration_days" formatted="false" msgid="8356547162075064530">
+ <item quantity="other"><xliff:g id="ID_2">%d</xliff:g> ദിവസം മുമ്പ്</item>
+ <item quantity="one"><xliff:g id="ID_1">%d</xliff:g> ദിവസം മുമ്പ്</item>
</plurals>
- <string name="abc_slice_error" msgid="4188371422904147368">"കണക്റ്റ് ചെയ്യാനായില്ല"</string>
+ <string name="abc_slice_error" msgid="1794214973158263497">"കണക്റ്റ് ചെയ്യാനായില്ല"</string>
</resources>
diff --git a/slice/slice-view/src/main/res/values-mn/strings.xml b/slice/slice-view/src/main/res/values-mn/strings.xml
index 52a5d1a..4c1e3db 100644
--- a/slice/slice-view/src/main/res/values-mn/strings.xml
+++ b/slice/slice-view/src/main/res/values-mn/strings.xml
@@ -17,21 +17,21 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slice_more_content" msgid="6405516388971241142">"+ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
- <string name="abc_slice_more" msgid="1983560225998630901">"Бусад"</string>
- <string name="abc_slice_show_more" msgid="1567717014004692768">"Дэлгэрэнгүй үзэх"</string>
- <string name="abc_slice_updated" msgid="8155085405396453848">"<xliff:g id="TIME">%1$s</xliff:g> шинэчилсэн"</string>
- <plurals name="abc_slice_duration_min" formatted="false" msgid="6996334305156847955">
+ <string name="abc_slice_more_content" msgid="7841223363798860154">"+ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
+ <string name="abc_slice_more" msgid="4299234410808450900">"Бусад"</string>
+ <string name="abc_slice_show_more" msgid="1112789899890391107">"Дэлгэрэнгүй харуулах"</string>
+ <string name="abc_slice_updated" msgid="7932359091871934205">"<xliff:g id="TIME">%1$s</xliff:g>-д шинэчилсэн"</string>
+ <plurals name="abc_slice_duration_min" formatted="false" msgid="7664017844210142826">
<item quantity="other"><xliff:g id="ID_2">%d</xliff:g> минутын өмнө</item>
<item quantity="one"><xliff:g id="ID_1">%d</xliff:g> минутын өмнө</item>
</plurals>
- <plurals name="abc_slice_duration_years" formatted="false" msgid="6212691832333991589">
+ <plurals name="abc_slice_duration_years" formatted="false" msgid="2628491538787454021">
<item quantity="other"><xliff:g id="ID_2">%d</xliff:g> жилийн өмнө</item>
<item quantity="one"><xliff:g id="ID_1">%d</xliff:g> жилийн өмнө</item>
</plurals>
- <plurals name="abc_slice_duration_days" formatted="false" msgid="6241698511167107334">
+ <plurals name="abc_slice_duration_days" formatted="false" msgid="8356547162075064530">
<item quantity="other"><xliff:g id="ID_2">%d</xliff:g> өдрийн өмнө</item>
<item quantity="one"><xliff:g id="ID_1">%d</xliff:g> өдрийн өмнө</item>
</plurals>
- <string name="abc_slice_error" msgid="4188371422904147368">"Холбогдож чадсангүй"</string>
+ <string name="abc_slice_error" msgid="1794214973158263497">"Холбогдож чадсангүй"</string>
</resources>
diff --git a/slice/slice-view/src/main/res/values-mr/strings.xml b/slice/slice-view/src/main/res/values-mr/strings.xml
index 54d042c..fed87e4 100644
--- a/slice/slice-view/src/main/res/values-mr/strings.xml
+++ b/slice/slice-view/src/main/res/values-mr/strings.xml
@@ -17,21 +17,21 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slice_more_content" msgid="6405516388971241142">"+ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
- <string name="abc_slice_more" msgid="1983560225998630901">"आणखी"</string>
- <string name="abc_slice_show_more" msgid="1567717014004692768">"आणखी दाखवा"</string>
- <string name="abc_slice_updated" msgid="8155085405396453848">"<xliff:g id="TIME">%1$s</xliff:g> ला अपडेट केले"</string>
- <plurals name="abc_slice_duration_min" formatted="false" msgid="6996334305156847955">
+ <string name="abc_slice_more_content" msgid="7841223363798860154">"+ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
+ <string name="abc_slice_more" msgid="4299234410808450900">"आणखी"</string>
+ <string name="abc_slice_show_more" msgid="1112789899890391107">"आणखी दाखवा"</string>
+ <string name="abc_slice_updated" msgid="7932359091871934205">"<xliff:g id="TIME">%1$s</xliff:g> अपडेट केले"</string>
+ <plurals name="abc_slice_duration_min" formatted="false" msgid="7664017844210142826">
<item quantity="other"><xliff:g id="ID_2">%d</xliff:g> मिनिटांपूर्वी</item>
<item quantity="one"><xliff:g id="ID_1">%d</xliff:g> मिनिटापूर्वी</item>
</plurals>
- <plurals name="abc_slice_duration_years" formatted="false" msgid="6212691832333991589">
+ <plurals name="abc_slice_duration_years" formatted="false" msgid="2628491538787454021">
<item quantity="other"><xliff:g id="ID_2">%d</xliff:g> वर्षांपूर्वी</item>
<item quantity="one"><xliff:g id="ID_1">%d</xliff:g> वर्षापूर्वी</item>
</plurals>
- <plurals name="abc_slice_duration_days" formatted="false" msgid="6241698511167107334">
+ <plurals name="abc_slice_duration_days" formatted="false" msgid="8356547162075064530">
<item quantity="other"><xliff:g id="ID_2">%d</xliff:g> दिवसांपूर्वी</item>
<item quantity="one"><xliff:g id="ID_1">%d</xliff:g> दिवसापूर्वी</item>
</plurals>
- <string name="abc_slice_error" msgid="4188371422904147368">"कनेक्ट करता आले नाही"</string>
+ <string name="abc_slice_error" msgid="1794214973158263497">"कनेक्ट करता आले नाही"</string>
</resources>
diff --git a/slice/slice-view/src/main/res/values-ms/strings.xml b/slice/slice-view/src/main/res/values-ms/strings.xml
index 576b8df..541f51c 100644
--- a/slice/slice-view/src/main/res/values-ms/strings.xml
+++ b/slice/slice-view/src/main/res/values-ms/strings.xml
@@ -17,21 +17,21 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slice_more_content" msgid="6405516388971241142">"+ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
- <string name="abc_slice_more" msgid="1983560225998630901">"Lagi"</string>
- <string name="abc_slice_show_more" msgid="1567717014004692768">"Tunjukkan lagi"</string>
- <string name="abc_slice_updated" msgid="8155085405396453848">"Dikemas kini pada <xliff:g id="TIME">%1$s</xliff:g>"</string>
- <plurals name="abc_slice_duration_min" formatted="false" msgid="6996334305156847955">
+ <string name="abc_slice_more_content" msgid="7841223363798860154">"+ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
+ <string name="abc_slice_more" msgid="4299234410808450900">"Lagi"</string>
+ <string name="abc_slice_show_more" msgid="1112789899890391107">"Tunjukkan lagi"</string>
+ <string name="abc_slice_updated" msgid="7932359091871934205">"Dikemas kini <xliff:g id="TIME">%1$s</xliff:g>"</string>
+ <plurals name="abc_slice_duration_min" formatted="false" msgid="7664017844210142826">
<item quantity="other"><xliff:g id="ID_2">%d</xliff:g> min yang lalu</item>
<item quantity="one"><xliff:g id="ID_1">%d</xliff:g> min yang lalu</item>
</plurals>
- <plurals name="abc_slice_duration_years" formatted="false" msgid="6212691832333991589">
+ <plurals name="abc_slice_duration_years" formatted="false" msgid="2628491538787454021">
<item quantity="other"><xliff:g id="ID_2">%d</xliff:g> thn yang lalu</item>
<item quantity="one"><xliff:g id="ID_1">%d</xliff:g> thn yang lalu</item>
</plurals>
- <plurals name="abc_slice_duration_days" formatted="false" msgid="6241698511167107334">
+ <plurals name="abc_slice_duration_days" formatted="false" msgid="8356547162075064530">
<item quantity="other"><xliff:g id="ID_2">%d</xliff:g> hari yang lalu</item>
<item quantity="one"><xliff:g id="ID_1">%d</xliff:g> hari yang lalu</item>
</plurals>
- <string name="abc_slice_error" msgid="4188371422904147368">"Tidak dapat menyambung"</string>
+ <string name="abc_slice_error" msgid="1794214973158263497">"Tidak dapat menyambung"</string>
</resources>
diff --git a/slice/slice-view/src/main/res/values-my/strings.xml b/slice/slice-view/src/main/res/values-my/strings.xml
index 5b9d57c..5425741 100644
--- a/slice/slice-view/src/main/res/values-my/strings.xml
+++ b/slice/slice-view/src/main/res/values-my/strings.xml
@@ -17,21 +17,21 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slice_more_content" msgid="6405516388971241142">"+ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
- <string name="abc_slice_more" msgid="1983560225998630901">"နောက်ထပ်"</string>
- <string name="abc_slice_show_more" msgid="1567717014004692768">"ပိုပြပါ"</string>
- <string name="abc_slice_updated" msgid="8155085405396453848">"<xliff:g id="TIME">%1$s</xliff:g> က အပ်ဒိတ်လုပ်ထားသည်"</string>
- <plurals name="abc_slice_duration_min" formatted="false" msgid="6996334305156847955">
- <item quantity="other">ပြီးခဲ့သော<xliff:g id="ID_2">%d</xliff:g>မိနစ်</item>
- <item quantity="one">ပြီးခဲ့သော<xliff:g id="ID_1">%d</xliff:g>မိနစ်</item>
+ <string name="abc_slice_more_content" msgid="7841223363798860154">"+ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
+ <string name="abc_slice_more" msgid="4299234410808450900">"နောက်ထပ်"</string>
+ <string name="abc_slice_show_more" msgid="1112789899890391107">"ပိုပြပါ"</string>
+ <string name="abc_slice_updated" msgid="7932359091871934205">"<xliff:g id="TIME">%1$s</xliff:g> က အပ်ဒိတ်လုပ်ထားသည်"</string>
+ <plurals name="abc_slice_duration_min" formatted="false" msgid="7664017844210142826">
+ <item quantity="other">ပြီးခဲ့သော <xliff:g id="ID_2">%d</xliff:g> မိနစ်</item>
+ <item quantity="one">ပြီးခဲ့သော <xliff:g id="ID_1">%d</xliff:g> မိနစ်</item>
</plurals>
- <plurals name="abc_slice_duration_years" formatted="false" msgid="6212691832333991589">
- <item quantity="other">ပြီးခဲ့သော <xliff:g id="ID_2">%d</xliff:g>နှစ်</item>
- <item quantity="one">ပြီးခဲ့သော <xliff:g id="ID_1">%d</xliff:g>နှစ်</item>
+ <plurals name="abc_slice_duration_years" formatted="false" msgid="2628491538787454021">
+ <item quantity="other">ပြီးခဲ့သော <xliff:g id="ID_2">%d</xliff:g> နှစ်</item>
+ <item quantity="one">ပြီးခဲ့သော <xliff:g id="ID_1">%d</xliff:g> နှစ်</item>
</plurals>
- <plurals name="abc_slice_duration_days" formatted="false" msgid="6241698511167107334">
+ <plurals name="abc_slice_duration_days" formatted="false" msgid="8356547162075064530">
<item quantity="other">ပြီးခဲ့သော <xliff:g id="ID_2">%d</xliff:g> ရက်</item>
<item quantity="one">ပြီးခဲ့သော <xliff:g id="ID_1">%d</xliff:g> ရက်</item>
</plurals>
- <string name="abc_slice_error" msgid="4188371422904147368">"ချိတ်ဆက်၍ မရပါ"</string>
+ <string name="abc_slice_error" msgid="1794214973158263497">"ချိတ်ဆက်၍ မရပါ"</string>
</resources>
diff --git a/slice/slice-view/src/main/res/values-nb/strings.xml b/slice/slice-view/src/main/res/values-nb/strings.xml
index 3fad9c4..d4bbb8f 100644
--- a/slice/slice-view/src/main/res/values-nb/strings.xml
+++ b/slice/slice-view/src/main/res/values-nb/strings.xml
@@ -17,21 +17,21 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slice_more_content" msgid="6405516388971241142">"+ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
- <string name="abc_slice_more" msgid="1983560225998630901">"Mer"</string>
- <string name="abc_slice_show_more" msgid="1567717014004692768">"Vis mer"</string>
- <string name="abc_slice_updated" msgid="8155085405396453848">"Oppdatert <xliff:g id="TIME">%1$s</xliff:g>"</string>
- <plurals name="abc_slice_duration_min" formatted="false" msgid="6996334305156847955">
- <item quantity="other">For <xliff:g id="ID_2">%d</xliff:g> min. siden</item>
- <item quantity="one">For <xliff:g id="ID_1">%d</xliff:g> min. siden</item>
+ <string name="abc_slice_more_content" msgid="7841223363798860154">"+ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
+ <string name="abc_slice_more" msgid="4299234410808450900">"Mer"</string>
+ <string name="abc_slice_show_more" msgid="1112789899890391107">"Vis flere"</string>
+ <string name="abc_slice_updated" msgid="7932359091871934205">"Oppdatert <xliff:g id="TIME">%1$s</xliff:g>"</string>
+ <plurals name="abc_slice_duration_min" formatted="false" msgid="7664017844210142826">
+ <item quantity="other">For <xliff:g id="ID_2">%d</xliff:g> min siden</item>
+ <item quantity="one">For <xliff:g id="ID_1">%d</xliff:g> min siden</item>
</plurals>
- <plurals name="abc_slice_duration_years" formatted="false" msgid="6212691832333991589">
+ <plurals name="abc_slice_duration_years" formatted="false" msgid="2628491538787454021">
<item quantity="other">For <xliff:g id="ID_2">%d</xliff:g> år siden</item>
<item quantity="one">For <xliff:g id="ID_1">%d</xliff:g> år siden</item>
</plurals>
- <plurals name="abc_slice_duration_days" formatted="false" msgid="6241698511167107334">
+ <plurals name="abc_slice_duration_days" formatted="false" msgid="8356547162075064530">
<item quantity="other">For <xliff:g id="ID_2">%d</xliff:g> dager siden</item>
<item quantity="one">For <xliff:g id="ID_1">%d</xliff:g> dag siden</item>
</plurals>
- <string name="abc_slice_error" msgid="4188371422904147368">"Kunne ikke koble til"</string>
+ <string name="abc_slice_error" msgid="1794214973158263497">"Kunne ikke koble til"</string>
</resources>
diff --git a/slice/slice-view/src/main/res/values-ne/strings.xml b/slice/slice-view/src/main/res/values-ne/strings.xml
index beb8b311..d585da9 100644
--- a/slice/slice-view/src/main/res/values-ne/strings.xml
+++ b/slice/slice-view/src/main/res/values-ne/strings.xml
@@ -17,21 +17,21 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slice_more_content" msgid="6405516388971241142">"+ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
- <string name="abc_slice_more" msgid="1983560225998630901">"थप"</string>
- <string name="abc_slice_show_more" msgid="1567717014004692768">"थप देखाउनुहोस्"</string>
- <string name="abc_slice_updated" msgid="8155085405396453848">"अद्यावधिक गरिएको समय: <xliff:g id="TIME">%1$s</xliff:g>"</string>
- <plurals name="abc_slice_duration_min" formatted="false" msgid="6996334305156847955">
+ <string name="abc_slice_more_content" msgid="7841223363798860154">"+ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
+ <string name="abc_slice_more" msgid="4299234410808450900">"थप"</string>
+ <string name="abc_slice_show_more" msgid="1112789899890391107">"थप देखाइयोस्"</string>
+ <string name="abc_slice_updated" msgid="7932359091871934205">"<xliff:g id="TIME">%1$s</xliff:g> अपडेट गरिएको"</string>
+ <plurals name="abc_slice_duration_min" formatted="false" msgid="7664017844210142826">
<item quantity="other"><xliff:g id="ID_2">%d</xliff:g> मिनेटअघि</item>
<item quantity="one"><xliff:g id="ID_1">%d</xliff:g> मिनेटअघि</item>
</plurals>
- <plurals name="abc_slice_duration_years" formatted="false" msgid="6212691832333991589">
+ <plurals name="abc_slice_duration_years" formatted="false" msgid="2628491538787454021">
<item quantity="other"><xliff:g id="ID_2">%d</xliff:g> वर्षअघि</item>
<item quantity="one"><xliff:g id="ID_1">%d</xliff:g> वर्षअघि</item>
</plurals>
- <plurals name="abc_slice_duration_days" formatted="false" msgid="6241698511167107334">
+ <plurals name="abc_slice_duration_days" formatted="false" msgid="8356547162075064530">
<item quantity="other"><xliff:g id="ID_2">%d</xliff:g> दिनअघि</item>
<item quantity="one"><xliff:g id="ID_1">%d</xliff:g> दिनअघि</item>
</plurals>
- <string name="abc_slice_error" msgid="4188371422904147368">"जडान गर्न सकिएन"</string>
+ <string name="abc_slice_error" msgid="1794214973158263497">"कनेक्ट गर्न सकिएन"</string>
</resources>
diff --git a/slice/slice-view/src/main/res/values-nl/strings.xml b/slice/slice-view/src/main/res/values-nl/strings.xml
index a5a10b3..b692f61 100644
--- a/slice/slice-view/src/main/res/values-nl/strings.xml
+++ b/slice/slice-view/src/main/res/values-nl/strings.xml
@@ -17,21 +17,21 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slice_more_content" msgid="6405516388971241142">"+ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
- <string name="abc_slice_more" msgid="1983560225998630901">"Meer"</string>
- <string name="abc_slice_show_more" msgid="1567717014004692768">"Meer tonen"</string>
- <string name="abc_slice_updated" msgid="8155085405396453848">"Geüpdatet: <xliff:g id="TIME">%1$s</xliff:g>"</string>
- <plurals name="abc_slice_duration_min" formatted="false" msgid="6996334305156847955">
- <item quantity="other"><xliff:g id="ID_2">%d</xliff:g> min geleden</item>
- <item quantity="one"><xliff:g id="ID_1">%d</xliff:g> min geleden</item>
+ <string name="abc_slice_more_content" msgid="7841223363798860154">"+ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
+ <string name="abc_slice_more" msgid="4299234410808450900">"Meer"</string>
+ <string name="abc_slice_show_more" msgid="1112789899890391107">"Meer tonen"</string>
+ <string name="abc_slice_updated" msgid="7932359091871934205">"<xliff:g id="TIME">%1$s</xliff:g> geüpdatet"</string>
+ <plurals name="abc_slice_duration_min" formatted="false" msgid="7664017844210142826">
+ <item quantity="other"><xliff:g id="ID_2">%d</xliff:g> min geleden</item>
+ <item quantity="one"><xliff:g id="ID_1">%d</xliff:g> min geleden</item>
</plurals>
- <plurals name="abc_slice_duration_years" formatted="false" msgid="6212691832333991589">
- <item quantity="other"><xliff:g id="ID_2">%d</xliff:g> jaar geleden</item>
- <item quantity="one"><xliff:g id="ID_1">%d</xliff:g> jaar geleden</item>
+ <plurals name="abc_slice_duration_years" formatted="false" msgid="2628491538787454021">
+ <item quantity="other"><xliff:g id="ID_2">%d</xliff:g> jr geleden</item>
+ <item quantity="one"><xliff:g id="ID_1">%d</xliff:g> jr geleden</item>
</plurals>
- <plurals name="abc_slice_duration_days" formatted="false" msgid="6241698511167107334">
+ <plurals name="abc_slice_duration_days" formatted="false" msgid="8356547162075064530">
<item quantity="other"><xliff:g id="ID_2">%d</xliff:g> dagen geleden</item>
<item quantity="one"><xliff:g id="ID_1">%d</xliff:g> dag geleden</item>
</plurals>
- <string name="abc_slice_error" msgid="4188371422904147368">"Kan geen verbinding maken"</string>
+ <string name="abc_slice_error" msgid="1794214973158263497">"Kan geen verbinding maken"</string>
</resources>
diff --git a/slice/slice-view/src/main/res/values-or/strings.xml b/slice/slice-view/src/main/res/values-or/strings.xml
index 6bf6019..2463f74 100644
--- a/slice/slice-view/src/main/res/values-or/strings.xml
+++ b/slice/slice-view/src/main/res/values-or/strings.xml
@@ -17,21 +17,21 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slice_more_content" msgid="6405516388971241142">"+ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
- <string name="abc_slice_more" msgid="1983560225998630901">"ଅଧିକ"</string>
- <string name="abc_slice_show_more" msgid="1567717014004692768">"ଅଧିକ ଦେଖାନ୍ତୁ"</string>
- <string name="abc_slice_updated" msgid="8155085405396453848">"<xliff:g id="TIME">%1$s</xliff:g>ରେ ଅପଡେଟ୍ ହୋଇଥିଲା"</string>
- <plurals name="abc_slice_duration_min" formatted="false" msgid="6996334305156847955">
+ <string name="abc_slice_more_content" msgid="7841223363798860154">"+ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
+ <string name="abc_slice_more" msgid="4299234410808450900">"ଅଧିକ"</string>
+ <string name="abc_slice_show_more" msgid="1112789899890391107">"ଅଧିକ ଦେଖାନ୍ତୁ"</string>
+ <string name="abc_slice_updated" msgid="7932359091871934205">"<xliff:g id="TIME">%1$s</xliff:g>ରେ ଅପଡେଟ୍ ହୋଇଛି"</string>
+ <plurals name="abc_slice_duration_min" formatted="false" msgid="7664017844210142826">
<item quantity="other"><xliff:g id="ID_2">%d</xliff:g> ମିନିଟ୍ ପୂର୍ବେ</item>
<item quantity="one"><xliff:g id="ID_1">%d</xliff:g> ମିନିଟ୍ ପୂର୍ବେ</item>
</plurals>
- <plurals name="abc_slice_duration_years" formatted="false" msgid="6212691832333991589">
+ <plurals name="abc_slice_duration_years" formatted="false" msgid="2628491538787454021">
<item quantity="other"><xliff:g id="ID_2">%d</xliff:g> ବର୍ଷ ପୂର୍ବେ</item>
<item quantity="one"><xliff:g id="ID_1">%d</xliff:g> ବର୍ଷ ପୂର୍ବେ</item>
</plurals>
- <plurals name="abc_slice_duration_days" formatted="false" msgid="6241698511167107334">
+ <plurals name="abc_slice_duration_days" formatted="false" msgid="8356547162075064530">
<item quantity="other"><xliff:g id="ID_2">%d</xliff:g> ଦିନ ପୂର୍ବେ</item>
<item quantity="one"><xliff:g id="ID_1">%d</xliff:g> ଦିନ ପୂର୍ବେ</item>
</plurals>
- <string name="abc_slice_error" msgid="4188371422904147368">"କନେକ୍ଟ ହେଲାନାହିଁ"</string>
+ <string name="abc_slice_error" msgid="1794214973158263497">"ସଂଯୋଗ କରାଯାଇପାରିଲା ନାହିଁ"</string>
</resources>
diff --git a/slice/slice-view/src/main/res/values-pa/strings.xml b/slice/slice-view/src/main/res/values-pa/strings.xml
index e588aac..1997af1 100644
--- a/slice/slice-view/src/main/res/values-pa/strings.xml
+++ b/slice/slice-view/src/main/res/values-pa/strings.xml
@@ -17,21 +17,21 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slice_more_content" msgid="6405516388971241142">"+ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
- <string name="abc_slice_more" msgid="1983560225998630901">"ਹੋਰ"</string>
- <string name="abc_slice_show_more" msgid="1567717014004692768">"ਹੋਰ ਦਿਖਾਓ"</string>
- <string name="abc_slice_updated" msgid="8155085405396453848">"<xliff:g id="TIME">%1$s</xliff:g> ਅੱਪਡੇਟ ਕੀਤੀ ਗਈ"</string>
- <plurals name="abc_slice_duration_min" formatted="false" msgid="6996334305156847955">
+ <string name="abc_slice_more_content" msgid="7841223363798860154">"+ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
+ <string name="abc_slice_more" msgid="4299234410808450900">"ਹੋਰ"</string>
+ <string name="abc_slice_show_more" msgid="1112789899890391107">"ਹੋਰ ਦਿਖਾਓ"</string>
+ <string name="abc_slice_updated" msgid="7932359091871934205">"<xliff:g id="TIME">%1$s</xliff:g> ਅੱਪਡੇਟ ਕੀਤੀ ਗਈ"</string>
+ <plurals name="abc_slice_duration_min" formatted="false" msgid="7664017844210142826">
<item quantity="one"><xliff:g id="ID_2">%d</xliff:g> ਮਿੰਟ ਪਹਿਲਾਂ</item>
<item quantity="other"><xliff:g id="ID_2">%d</xliff:g> ਮਿੰਟ ਪਹਿਲਾਂ</item>
</plurals>
- <plurals name="abc_slice_duration_years" formatted="false" msgid="6212691832333991589">
+ <plurals name="abc_slice_duration_years" formatted="false" msgid="2628491538787454021">
<item quantity="one"><xliff:g id="ID_2">%d</xliff:g> ਸਾਲ ਪਹਿਲਾਂ</item>
<item quantity="other"><xliff:g id="ID_2">%d</xliff:g> ਸਾਲ ਪਹਿਲਾਂ</item>
</plurals>
- <plurals name="abc_slice_duration_days" formatted="false" msgid="6241698511167107334">
+ <plurals name="abc_slice_duration_days" formatted="false" msgid="8356547162075064530">
<item quantity="one"><xliff:g id="ID_2">%d</xliff:g> ਦਿਨ ਪਹਿਲਾਂ</item>
<item quantity="other"><xliff:g id="ID_2">%d</xliff:g> ਦਿਨ ਪਹਿਲਾਂ</item>
</plurals>
- <string name="abc_slice_error" msgid="4188371422904147368">"ਕਨੈਕਟ ਨਹੀਂ ਕੀਤਾ ਜਾ ਸਕਿਆ"</string>
+ <string name="abc_slice_error" msgid="1794214973158263497">"ਕਨੈਕਟ ਨਹੀਂ ਕੀਤਾ ਜਾ ਸਕਿਆ"</string>
</resources>
diff --git a/slice/slice-view/src/main/res/values-pl/strings.xml b/slice/slice-view/src/main/res/values-pl/strings.xml
index c5300ca..2aea6ac 100644
--- a/slice/slice-view/src/main/res/values-pl/strings.xml
+++ b/slice/slice-view/src/main/res/values-pl/strings.xml
@@ -17,27 +17,27 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slice_more_content" msgid="6405516388971241142">"+ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
- <string name="abc_slice_more" msgid="1983560225998630901">"Więcej"</string>
- <string name="abc_slice_show_more" msgid="1567717014004692768">"Pokaż więcej"</string>
- <string name="abc_slice_updated" msgid="8155085405396453848">"Aktualizacja: <xliff:g id="TIME">%1$s</xliff:g>"</string>
- <plurals name="abc_slice_duration_min" formatted="false" msgid="6996334305156847955">
+ <string name="abc_slice_more_content" msgid="7841223363798860154">"+ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
+ <string name="abc_slice_more" msgid="4299234410808450900">"Więcej"</string>
+ <string name="abc_slice_show_more" msgid="1112789899890391107">"Pokaż więcej"</string>
+ <string name="abc_slice_updated" msgid="7932359091871934205">"Aktualizacja: <xliff:g id="TIME">%1$s</xliff:g>"</string>
+ <plurals name="abc_slice_duration_min" formatted="false" msgid="7664017844210142826">
<item quantity="few"><xliff:g id="ID_2">%d</xliff:g> min temu</item>
<item quantity="many"><xliff:g id="ID_2">%d</xliff:g> min temu</item>
<item quantity="other"><xliff:g id="ID_2">%d</xliff:g> min temu</item>
<item quantity="one"><xliff:g id="ID_1">%d</xliff:g> min temu</item>
</plurals>
- <plurals name="abc_slice_duration_years" formatted="false" msgid="6212691832333991589">
+ <plurals name="abc_slice_duration_years" formatted="false" msgid="2628491538787454021">
<item quantity="few"><xliff:g id="ID_2">%d</xliff:g> lata temu</item>
<item quantity="many"><xliff:g id="ID_2">%d</xliff:g> lat temu</item>
<item quantity="other"><xliff:g id="ID_2">%d</xliff:g> roku temu</item>
<item quantity="one"><xliff:g id="ID_1">%d</xliff:g> rok temu</item>
</plurals>
- <plurals name="abc_slice_duration_days" formatted="false" msgid="6241698511167107334">
+ <plurals name="abc_slice_duration_days" formatted="false" msgid="8356547162075064530">
<item quantity="few"><xliff:g id="ID_2">%d</xliff:g> dni temu</item>
<item quantity="many"><xliff:g id="ID_2">%d</xliff:g> dni temu</item>
<item quantity="other"><xliff:g id="ID_2">%d</xliff:g> dnia temu</item>
<item quantity="one"><xliff:g id="ID_1">%d</xliff:g> dzień temu</item>
</plurals>
- <string name="abc_slice_error" msgid="4188371422904147368">"Nie udało się połączyć"</string>
+ <string name="abc_slice_error" msgid="1794214973158263497">"Nie udało się połączyć"</string>
</resources>
diff --git a/slice/slice-view/src/main/res/values-pt-rBR/strings.xml b/slice/slice-view/src/main/res/values-pt-rBR/strings.xml
index 79cc7b7..4fd3a99 100644
--- a/slice/slice-view/src/main/res/values-pt-rBR/strings.xml
+++ b/slice/slice-view/src/main/res/values-pt-rBR/strings.xml
@@ -17,21 +17,21 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slice_more_content" msgid="6405516388971241142">"Mais <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
- <string name="abc_slice_more" msgid="1983560225998630901">"Mais"</string>
- <string name="abc_slice_show_more" msgid="1567717014004692768">"Mostrar mais"</string>
- <string name="abc_slice_updated" msgid="8155085405396453848">"Atualizado às <xliff:g id="TIME">%1$s</xliff:g>"</string>
- <plurals name="abc_slice_duration_min" formatted="false" msgid="6996334305156847955">
- <item quantity="one"><xliff:g id="ID_2">%d</xliff:g> min atrás</item>
- <item quantity="other"><xliff:g id="ID_2">%d</xliff:g> min atrás</item>
+ <string name="abc_slice_more_content" msgid="7841223363798860154">"+ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
+ <string name="abc_slice_more" msgid="4299234410808450900">"Mais"</string>
+ <string name="abc_slice_show_more" msgid="1112789899890391107">"Mostrar mais"</string>
+ <string name="abc_slice_updated" msgid="7932359091871934205">"Atualizado <xliff:g id="TIME">%1$s</xliff:g>"</string>
+ <plurals name="abc_slice_duration_min" formatted="false" msgid="7664017844210142826">
+ <item quantity="one">Há <xliff:g id="ID_2">%d</xliff:g>min</item>
+ <item quantity="other">Há <xliff:g id="ID_2">%d</xliff:g>min</item>
</plurals>
- <plurals name="abc_slice_duration_years" formatted="false" msgid="6212691832333991589">
- <item quantity="one"><xliff:g id="ID_2">%d</xliff:g> ano atrás</item>
- <item quantity="other"><xliff:g id="ID_2">%d</xliff:g> anos atrás</item>
+ <plurals name="abc_slice_duration_years" formatted="false" msgid="2628491538787454021">
+ <item quantity="one">Há <xliff:g id="ID_2">%d</xliff:g> ano</item>
+ <item quantity="other">Há <xliff:g id="ID_2">%d</xliff:g> anos</item>
</plurals>
- <plurals name="abc_slice_duration_days" formatted="false" msgid="6241698511167107334">
+ <plurals name="abc_slice_duration_days" formatted="false" msgid="8356547162075064530">
<item quantity="one"><xliff:g id="ID_2">%d</xliff:g> dia atrás</item>
<item quantity="other"><xliff:g id="ID_2">%d</xliff:g> dias atrás</item>
</plurals>
- <string name="abc_slice_error" msgid="4188371422904147368">"Não foi possível conectar"</string>
+ <string name="abc_slice_error" msgid="1794214973158263497">"Não foi possível conectar"</string>
</resources>
diff --git a/slice/slice-view/src/main/res/values-pt-rPT/strings.xml b/slice/slice-view/src/main/res/values-pt-rPT/strings.xml
index b81ec60..34a67ff 100644
--- a/slice/slice-view/src/main/res/values-pt-rPT/strings.xml
+++ b/slice/slice-view/src/main/res/values-pt-rPT/strings.xml
@@ -17,21 +17,21 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slice_more_content" msgid="6405516388971241142">"+ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
- <string name="abc_slice_more" msgid="1983560225998630901">"Mais"</string>
- <string name="abc_slice_show_more" msgid="1567717014004692768">"Mostrar mais"</string>
- <string name="abc_slice_updated" msgid="8155085405396453848">"Atualizado: <xliff:g id="TIME">%1$s</xliff:g>"</string>
- <plurals name="abc_slice_duration_min" formatted="false" msgid="6996334305156847955">
- <item quantity="other">Há <xliff:g id="ID_2">%d</xliff:g> minutos.</item>
- <item quantity="one">Há <xliff:g id="ID_1">%d</xliff:g> minuto.</item>
+ <string name="abc_slice_more_content" msgid="7841223363798860154">"+ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
+ <string name="abc_slice_more" msgid="4299234410808450900">"Mais"</string>
+ <string name="abc_slice_show_more" msgid="1112789899890391107">"Mostrar mais"</string>
+ <string name="abc_slice_updated" msgid="7932359091871934205">"Atualização: <xliff:g id="TIME">%1$s</xliff:g>"</string>
+ <plurals name="abc_slice_duration_min" formatted="false" msgid="7664017844210142826">
+ <item quantity="other">Há <xliff:g id="ID_2">%d</xliff:g> min</item>
+ <item quantity="one">Há <xliff:g id="ID_1">%d</xliff:g> min</item>
</plurals>
- <plurals name="abc_slice_duration_years" formatted="false" msgid="6212691832333991589">
- <item quantity="other">Há <xliff:g id="ID_2">%d</xliff:g> anos.</item>
- <item quantity="one">Há <xliff:g id="ID_1">%d</xliff:g> ano.</item>
+ <plurals name="abc_slice_duration_years" formatted="false" msgid="2628491538787454021">
+ <item quantity="other">Há <xliff:g id="ID_2">%d</xliff:g> anos</item>
+ <item quantity="one">Há <xliff:g id="ID_1">%d</xliff:g> ano</item>
</plurals>
- <plurals name="abc_slice_duration_days" formatted="false" msgid="6241698511167107334">
- <item quantity="other">Há <xliff:g id="ID_2">%d</xliff:g> dias.</item>
- <item quantity="one">Há <xliff:g id="ID_1">%d</xliff:g> dia.</item>
+ <plurals name="abc_slice_duration_days" formatted="false" msgid="8356547162075064530">
+ <item quantity="other">Há <xliff:g id="ID_2">%d</xliff:g> dias</item>
+ <item quantity="one">Há <xliff:g id="ID_1">%d</xliff:g> dia</item>
</plurals>
- <string name="abc_slice_error" msgid="4188371422904147368">"Não foi possível ligar."</string>
+ <string name="abc_slice_error" msgid="1794214973158263497">"Não foi possível ligar"</string>
</resources>
diff --git a/slice/slice-view/src/main/res/values-pt/strings.xml b/slice/slice-view/src/main/res/values-pt/strings.xml
index 79cc7b7..4fd3a99 100644
--- a/slice/slice-view/src/main/res/values-pt/strings.xml
+++ b/slice/slice-view/src/main/res/values-pt/strings.xml
@@ -17,21 +17,21 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slice_more_content" msgid="6405516388971241142">"Mais <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
- <string name="abc_slice_more" msgid="1983560225998630901">"Mais"</string>
- <string name="abc_slice_show_more" msgid="1567717014004692768">"Mostrar mais"</string>
- <string name="abc_slice_updated" msgid="8155085405396453848">"Atualizado às <xliff:g id="TIME">%1$s</xliff:g>"</string>
- <plurals name="abc_slice_duration_min" formatted="false" msgid="6996334305156847955">
- <item quantity="one"><xliff:g id="ID_2">%d</xliff:g> min atrás</item>
- <item quantity="other"><xliff:g id="ID_2">%d</xliff:g> min atrás</item>
+ <string name="abc_slice_more_content" msgid="7841223363798860154">"+ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
+ <string name="abc_slice_more" msgid="4299234410808450900">"Mais"</string>
+ <string name="abc_slice_show_more" msgid="1112789899890391107">"Mostrar mais"</string>
+ <string name="abc_slice_updated" msgid="7932359091871934205">"Atualizado <xliff:g id="TIME">%1$s</xliff:g>"</string>
+ <plurals name="abc_slice_duration_min" formatted="false" msgid="7664017844210142826">
+ <item quantity="one">Há <xliff:g id="ID_2">%d</xliff:g>min</item>
+ <item quantity="other">Há <xliff:g id="ID_2">%d</xliff:g>min</item>
</plurals>
- <plurals name="abc_slice_duration_years" formatted="false" msgid="6212691832333991589">
- <item quantity="one"><xliff:g id="ID_2">%d</xliff:g> ano atrás</item>
- <item quantity="other"><xliff:g id="ID_2">%d</xliff:g> anos atrás</item>
+ <plurals name="abc_slice_duration_years" formatted="false" msgid="2628491538787454021">
+ <item quantity="one">Há <xliff:g id="ID_2">%d</xliff:g> ano</item>
+ <item quantity="other">Há <xliff:g id="ID_2">%d</xliff:g> anos</item>
</plurals>
- <plurals name="abc_slice_duration_days" formatted="false" msgid="6241698511167107334">
+ <plurals name="abc_slice_duration_days" formatted="false" msgid="8356547162075064530">
<item quantity="one"><xliff:g id="ID_2">%d</xliff:g> dia atrás</item>
<item quantity="other"><xliff:g id="ID_2">%d</xliff:g> dias atrás</item>
</plurals>
- <string name="abc_slice_error" msgid="4188371422904147368">"Não foi possível conectar"</string>
+ <string name="abc_slice_error" msgid="1794214973158263497">"Não foi possível conectar"</string>
</resources>
diff --git a/slice/slice-view/src/main/res/values-ro/strings.xml b/slice/slice-view/src/main/res/values-ro/strings.xml
index 9ff89d0..80e77e5 100644
--- a/slice/slice-view/src/main/res/values-ro/strings.xml
+++ b/slice/slice-view/src/main/res/values-ro/strings.xml
@@ -17,24 +17,24 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slice_more_content" msgid="6405516388971241142">"+ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
- <string name="abc_slice_more" msgid="1983560225998630901">"Mai mult"</string>
- <string name="abc_slice_show_more" msgid="1567717014004692768">"Vedeți mai multe"</string>
- <string name="abc_slice_updated" msgid="8155085405396453848">"Actualizat la <xliff:g id="TIME">%1$s</xliff:g>"</string>
- <plurals name="abc_slice_duration_min" formatted="false" msgid="6996334305156847955">
- <item quantity="few">acum <xliff:g id="ID_2">%d</xliff:g> min.</item>
- <item quantity="other">acum <xliff:g id="ID_2">%d</xliff:g> de min.</item>
- <item quantity="one">acum <xliff:g id="ID_1">%d</xliff:g> min.</item>
+ <string name="abc_slice_more_content" msgid="7841223363798860154">"+ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
+ <string name="abc_slice_more" msgid="4299234410808450900">"Mai multe"</string>
+ <string name="abc_slice_show_more" msgid="1112789899890391107">"Afișați mai mult"</string>
+ <string name="abc_slice_updated" msgid="7932359091871934205">"Ultima actualizare: <xliff:g id="TIME">%1$s</xliff:g>"</string>
+ <plurals name="abc_slice_duration_min" formatted="false" msgid="7664017844210142826">
+ <item quantity="few">Acum <xliff:g id="ID_2">%d</xliff:g> minute</item>
+ <item quantity="other">Acum <xliff:g id="ID_2">%d</xliff:g> de minute</item>
+ <item quantity="one">Acum <xliff:g id="ID_1">%d</xliff:g> minut</item>
</plurals>
- <plurals name="abc_slice_duration_years" formatted="false" msgid="6212691832333991589">
- <item quantity="few">acum <xliff:g id="ID_2">%d</xliff:g> ani</item>
- <item quantity="other">acum <xliff:g id="ID_2">%d</xliff:g> de ani</item>
- <item quantity="one">acum <xliff:g id="ID_1">%d</xliff:g> an</item>
+ <plurals name="abc_slice_duration_years" formatted="false" msgid="2628491538787454021">
+ <item quantity="few">Acum <xliff:g id="ID_2">%d</xliff:g> ani</item>
+ <item quantity="other">Acum <xliff:g id="ID_2">%d</xliff:g> de ani</item>
+ <item quantity="one">Acum <xliff:g id="ID_1">%d</xliff:g> an</item>
</plurals>
- <plurals name="abc_slice_duration_days" formatted="false" msgid="6241698511167107334">
- <item quantity="few">acum <xliff:g id="ID_2">%d</xliff:g> zile</item>
- <item quantity="other">acum <xliff:g id="ID_2">%d</xliff:g> de zile</item>
- <item quantity="one">acum <xliff:g id="ID_1">%d</xliff:g> zi</item>
+ <plurals name="abc_slice_duration_days" formatted="false" msgid="8356547162075064530">
+ <item quantity="few">Acum <xliff:g id="ID_2">%d</xliff:g> zile</item>
+ <item quantity="other">Acum <xliff:g id="ID_2">%d</xliff:g> de zile</item>
+ <item quantity="one">Acum <xliff:g id="ID_1">%d</xliff:g> zi</item>
</plurals>
- <string name="abc_slice_error" msgid="4188371422904147368">"Nu s-a putut conecta"</string>
+ <string name="abc_slice_error" msgid="1794214973158263497">"Nu s-a putut conecta"</string>
</resources>
diff --git a/slice/slice-view/src/main/res/values-ru/strings.xml b/slice/slice-view/src/main/res/values-ru/strings.xml
index 85953aa..2ca514d 100644
--- a/slice/slice-view/src/main/res/values-ru/strings.xml
+++ b/slice/slice-view/src/main/res/values-ru/strings.xml
@@ -17,27 +17,27 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slice_more_content" msgid="6405516388971241142">"+ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
- <string name="abc_slice_more" msgid="1983560225998630901">"Ещё"</string>
- <string name="abc_slice_show_more" msgid="1567717014004692768">"Ещё"</string>
- <string name="abc_slice_updated" msgid="8155085405396453848">"Обновлено <xliff:g id="TIME">%1$s</xliff:g>"</string>
- <plurals name="abc_slice_duration_min" formatted="false" msgid="6996334305156847955">
- <item quantity="one"><xliff:g id="ID_2">%d</xliff:g> мин. назад</item>
- <item quantity="few"><xliff:g id="ID_2">%d</xliff:g> мин. назад</item>
- <item quantity="many"><xliff:g id="ID_2">%d</xliff:g> мин. назад</item>
- <item quantity="other"><xliff:g id="ID_2">%d</xliff:g> мин. назад</item>
+ <string name="abc_slice_more_content" msgid="7841223363798860154">"+ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
+ <string name="abc_slice_more" msgid="4299234410808450900">"Ещё"</string>
+ <string name="abc_slice_show_more" msgid="1112789899890391107">"Показать больше"</string>
+ <string name="abc_slice_updated" msgid="7932359091871934205">"Обновлено <xliff:g id="TIME">%1$s</xliff:g>"</string>
+ <plurals name="abc_slice_duration_min" formatted="false" msgid="7664017844210142826">
+ <item quantity="one"><xliff:g id="ID_2">%d</xliff:g> минуту назад</item>
+ <item quantity="few"><xliff:g id="ID_2">%d</xliff:g> минуты назад</item>
+ <item quantity="many"><xliff:g id="ID_2">%d</xliff:g> минут назад</item>
+ <item quantity="other"><xliff:g id="ID_2">%d</xliff:g> минуты назад</item>
</plurals>
- <plurals name="abc_slice_duration_years" formatted="false" msgid="6212691832333991589">
- <item quantity="one"><xliff:g id="ID_2">%d</xliff:g> г. назад</item>
- <item quantity="few"><xliff:g id="ID_2">%d</xliff:g> г. назад</item>
- <item quantity="many"><xliff:g id="ID_2">%d</xliff:g> лет назад</item>
- <item quantity="other"><xliff:g id="ID_2">%d</xliff:g> г. назад</item>
+ <plurals name="abc_slice_duration_years" formatted="false" msgid="2628491538787454021">
+ <item quantity="one"><xliff:g id="ID_2">%d</xliff:g> год назад</item>
+ <item quantity="few"><xliff:g id="ID_2">%d</xliff:g> года назад</item>
+ <item quantity="many"><xliff:g id="ID_2">%d</xliff:g> лет назад</item>
+ <item quantity="other"><xliff:g id="ID_2">%d</xliff:g> года назад</item>
</plurals>
- <plurals name="abc_slice_duration_days" formatted="false" msgid="6241698511167107334">
- <item quantity="one"><xliff:g id="ID_2">%d</xliff:g> дн. назад</item>
- <item quantity="few"><xliff:g id="ID_2">%d</xliff:g> дн. назад</item>
- <item quantity="many"><xliff:g id="ID_2">%d</xliff:g> дн. назад</item>
- <item quantity="other"><xliff:g id="ID_2">%d</xliff:g> дн. назад</item>
+ <plurals name="abc_slice_duration_days" formatted="false" msgid="8356547162075064530">
+ <item quantity="one"><xliff:g id="ID_2">%d</xliff:g> день назад</item>
+ <item quantity="few"><xliff:g id="ID_2">%d</xliff:g> дня назад</item>
+ <item quantity="many"><xliff:g id="ID_2">%d</xliff:g> дней назад</item>
+ <item quantity="other"><xliff:g id="ID_2">%d</xliff:g> дня назад</item>
</plurals>
- <string name="abc_slice_error" msgid="4188371422904147368">"Ошибка подключения"</string>
+ <string name="abc_slice_error" msgid="1794214973158263497">"Ошибка подключения."</string>
</resources>
diff --git a/slice/slice-view/src/main/res/values-si/strings.xml b/slice/slice-view/src/main/res/values-si/strings.xml
index cfd7685..a85701c 100644
--- a/slice/slice-view/src/main/res/values-si/strings.xml
+++ b/slice/slice-view/src/main/res/values-si/strings.xml
@@ -17,21 +17,21 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slice_more_content" msgid="6405516388971241142">"+ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
- <string name="abc_slice_more" msgid="1983560225998630901">"තව"</string>
- <string name="abc_slice_show_more" msgid="1567717014004692768">"තව පෙන්වන්න"</string>
- <string name="abc_slice_updated" msgid="8155085405396453848">"<xliff:g id="TIME">%1$s</xliff:g> යාවත්කාලීන කරන ලදී"</string>
- <plurals name="abc_slice_duration_min" formatted="false" msgid="6996334305156847955">
+ <string name="abc_slice_more_content" msgid="7841223363798860154">"+ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
+ <string name="abc_slice_more" msgid="4299234410808450900">"තව"</string>
+ <string name="abc_slice_show_more" msgid="1112789899890391107">"තව පෙන්වන්න"</string>
+ <string name="abc_slice_updated" msgid="7932359091871934205">"යාවත්කාලීන කළේ <xliff:g id="TIME">%1$s</xliff:g>"</string>
+ <plurals name="abc_slice_duration_min" formatted="false" msgid="7664017844210142826">
<item quantity="one">මිනි <xliff:g id="ID_2">%d</xliff:g>කට පෙර</item>
<item quantity="other">මිනි <xliff:g id="ID_2">%d</xliff:g>කට පෙර</item>
</plurals>
- <plurals name="abc_slice_duration_years" formatted="false" msgid="6212691832333991589">
+ <plurals name="abc_slice_duration_years" formatted="false" msgid="2628491538787454021">
<item quantity="one">වසර <xliff:g id="ID_2">%d</xliff:g>කට පෙර</item>
<item quantity="other">වසර <xliff:g id="ID_2">%d</xliff:g>කට පෙර</item>
</plurals>
- <plurals name="abc_slice_duration_days" formatted="false" msgid="6241698511167107334">
+ <plurals name="abc_slice_duration_days" formatted="false" msgid="8356547162075064530">
<item quantity="one">දින <xliff:g id="ID_2">%d</xliff:g>කට පෙර</item>
<item quantity="other">දින <xliff:g id="ID_2">%d</xliff:g>කට පෙර</item>
</plurals>
- <string name="abc_slice_error" msgid="4188371422904147368">"සම්බන්ධ වීමට නොහැකි විය"</string>
+ <string name="abc_slice_error" msgid="1794214973158263497">"සම්බන්ධ කළ නොහැකි විය"</string>
</resources>
diff --git a/slice/slice-view/src/main/res/values-sk/strings.xml b/slice/slice-view/src/main/res/values-sk/strings.xml
index 76bed58..c2c1bc2 100644
--- a/slice/slice-view/src/main/res/values-sk/strings.xml
+++ b/slice/slice-view/src/main/res/values-sk/strings.xml
@@ -17,27 +17,27 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slice_more_content" msgid="6405516388971241142">"+ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
- <string name="abc_slice_more" msgid="1983560225998630901">"Viac"</string>
- <string name="abc_slice_show_more" msgid="1567717014004692768">"Zobraziť viac"</string>
- <string name="abc_slice_updated" msgid="8155085405396453848">"Aktualizované <xliff:g id="TIME">%1$s</xliff:g>"</string>
- <plurals name="abc_slice_duration_min" formatted="false" msgid="6996334305156847955">
- <item quantity="few">pred <xliff:g id="ID_2">%d</xliff:g> min</item>
- <item quantity="many">pred <xliff:g id="ID_2">%d</xliff:g> min</item>
- <item quantity="other">pred <xliff:g id="ID_2">%d</xliff:g> min</item>
- <item quantity="one">pred <xliff:g id="ID_1">%d</xliff:g> min</item>
+ <string name="abc_slice_more_content" msgid="7841223363798860154">"+ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
+ <string name="abc_slice_more" msgid="4299234410808450900">"Viac"</string>
+ <string name="abc_slice_show_more" msgid="1112789899890391107">"Zobraziť viac"</string>
+ <string name="abc_slice_updated" msgid="7932359091871934205">"Aktualizované <xliff:g id="TIME">%1$s</xliff:g>"</string>
+ <plurals name="abc_slice_duration_min" formatted="false" msgid="7664017844210142826">
+ <item quantity="few">pred <xliff:g id="ID_2">%d</xliff:g> min</item>
+ <item quantity="many">pred <xliff:g id="ID_2">%d</xliff:g> min</item>
+ <item quantity="other">pred <xliff:g id="ID_2">%d</xliff:g> min</item>
+ <item quantity="one">pred <xliff:g id="ID_1">%d</xliff:g> min</item>
</plurals>
- <plurals name="abc_slice_duration_years" formatted="false" msgid="6212691832333991589">
- <item quantity="few">pred <xliff:g id="ID_2">%d</xliff:g> rokmi</item>
- <item quantity="many">pred <xliff:g id="ID_2">%d</xliff:g> roka</item>
- <item quantity="other">pred <xliff:g id="ID_2">%d</xliff:g> rokmi</item>
- <item quantity="one">pred <xliff:g id="ID_1">%d</xliff:g> rokom</item>
+ <plurals name="abc_slice_duration_years" formatted="false" msgid="2628491538787454021">
+ <item quantity="few">pred <xliff:g id="ID_2">%d</xliff:g> r.</item>
+ <item quantity="many">pred <xliff:g id="ID_2">%d</xliff:g> r.</item>
+ <item quantity="other">pred <xliff:g id="ID_2">%d</xliff:g> r.</item>
+ <item quantity="one">pred <xliff:g id="ID_1">%d</xliff:g> r.</item>
</plurals>
- <plurals name="abc_slice_duration_days" formatted="false" msgid="6241698511167107334">
- <item quantity="few">pred <xliff:g id="ID_2">%d</xliff:g> dňami</item>
- <item quantity="many">pred <xliff:g id="ID_2">%d</xliff:g> dňa</item>
- <item quantity="other">pred <xliff:g id="ID_2">%d</xliff:g> dňami</item>
- <item quantity="one">pred <xliff:g id="ID_1">%d</xliff:g> dňom</item>
+ <plurals name="abc_slice_duration_days" formatted="false" msgid="8356547162075064530">
+ <item quantity="few">pred <xliff:g id="ID_2">%d</xliff:g> dňami</item>
+ <item quantity="many">pred <xliff:g id="ID_2">%d</xliff:g> dňa</item>
+ <item quantity="other">pred <xliff:g id="ID_2">%d</xliff:g> dňami</item>
+ <item quantity="one">pred <xliff:g id="ID_1">%d</xliff:g> dňom</item>
</plurals>
- <string name="abc_slice_error" msgid="4188371422904147368">"Nepodarilo sa pripojiť"</string>
+ <string name="abc_slice_error" msgid="1794214973158263497">"Nepodarilo sa pripojiť"</string>
</resources>
diff --git a/slice/slice-view/src/main/res/values-sl/strings.xml b/slice/slice-view/src/main/res/values-sl/strings.xml
index 0389500..80b1a1d 100644
--- a/slice/slice-view/src/main/res/values-sl/strings.xml
+++ b/slice/slice-view/src/main/res/values-sl/strings.xml
@@ -17,27 +17,27 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slice_more_content" msgid="6405516388971241142">"in še <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
- <string name="abc_slice_more" msgid="1983560225998630901">"Več"</string>
- <string name="abc_slice_show_more" msgid="1567717014004692768">"Pokaži več"</string>
- <string name="abc_slice_updated" msgid="8155085405396453848">"Posodobljeno: <xliff:g id="TIME">%1$s</xliff:g>"</string>
- <plurals name="abc_slice_duration_min" formatted="false" msgid="6996334305156847955">
- <item quantity="one">pred <xliff:g id="ID_2">%d</xliff:g> minuto</item>
- <item quantity="two">pred <xliff:g id="ID_2">%d</xliff:g> minutama</item>
- <item quantity="few">pred <xliff:g id="ID_2">%d</xliff:g> minutami</item>
- <item quantity="other">pred <xliff:g id="ID_2">%d</xliff:g> minutami</item>
+ <string name="abc_slice_more_content" msgid="7841223363798860154">"in še <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
+ <string name="abc_slice_more" msgid="4299234410808450900">"Več"</string>
+ <string name="abc_slice_show_more" msgid="1112789899890391107">"Pokaži več"</string>
+ <string name="abc_slice_updated" msgid="7932359091871934205">"Posodobljeno: <xliff:g id="TIME">%1$s</xliff:g>"</string>
+ <plurals name="abc_slice_duration_min" formatted="false" msgid="7664017844210142826">
+ <item quantity="one">Pred <xliff:g id="ID_2">%d</xliff:g> min</item>
+ <item quantity="two">Pred <xliff:g id="ID_2">%d</xliff:g> min</item>
+ <item quantity="few">Pred <xliff:g id="ID_2">%d</xliff:g> min</item>
+ <item quantity="other">Pred <xliff:g id="ID_2">%d</xliff:g> min</item>
</plurals>
- <plurals name="abc_slice_duration_years" formatted="false" msgid="6212691832333991589">
- <item quantity="one">pred <xliff:g id="ID_2">%d</xliff:g> letom</item>
- <item quantity="two">pred <xliff:g id="ID_2">%d</xliff:g> letoma</item>
- <item quantity="few">pred <xliff:g id="ID_2">%d</xliff:g> leti</item>
- <item quantity="other">pred <xliff:g id="ID_2">%d</xliff:g> leti</item>
+ <plurals name="abc_slice_duration_years" formatted="false" msgid="2628491538787454021">
+ <item quantity="one">Pred <xliff:g id="ID_2">%d</xliff:g> letom</item>
+ <item quantity="two">Pred <xliff:g id="ID_2">%d</xliff:g> letoma</item>
+ <item quantity="few">Pred <xliff:g id="ID_2">%d</xliff:g> leti</item>
+ <item quantity="other">Pred <xliff:g id="ID_2">%d</xliff:g> leti</item>
</plurals>
- <plurals name="abc_slice_duration_days" formatted="false" msgid="6241698511167107334">
- <item quantity="one">pred <xliff:g id="ID_2">%d</xliff:g> dnem</item>
- <item quantity="two">pred <xliff:g id="ID_2">%d</xliff:g> dnevoma</item>
- <item quantity="few">pred <xliff:g id="ID_2">%d</xliff:g> dnevi</item>
- <item quantity="other">pred <xliff:g id="ID_2">%d</xliff:g> dnevi</item>
+ <plurals name="abc_slice_duration_days" formatted="false" msgid="8356547162075064530">
+ <item quantity="one">Pred <xliff:g id="ID_2">%d</xliff:g> dnevom</item>
+ <item quantity="two">Pred <xliff:g id="ID_2">%d</xliff:g> dnevoma</item>
+ <item quantity="few">Pred <xliff:g id="ID_2">%d</xliff:g> dnevi</item>
+ <item quantity="other">Pred <xliff:g id="ID_2">%d</xliff:g> dnevi</item>
</plurals>
- <string name="abc_slice_error" msgid="4188371422904147368">"Povezava ni mogoča"</string>
+ <string name="abc_slice_error" msgid="1794214973158263497">"Povezava ni mogoča"</string>
</resources>
diff --git a/slice/slice-view/src/main/res/values-sq/strings.xml b/slice/slice-view/src/main/res/values-sq/strings.xml
index aeb84d0..0839d0c 100644
--- a/slice/slice-view/src/main/res/values-sq/strings.xml
+++ b/slice/slice-view/src/main/res/values-sq/strings.xml
@@ -17,21 +17,21 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slice_more_content" msgid="6405516388971241142">"+ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
- <string name="abc_slice_more" msgid="1983560225998630901">"Më shumë"</string>
- <string name="abc_slice_show_more" msgid="1567717014004692768">"Shfaq më shumë"</string>
- <string name="abc_slice_updated" msgid="8155085405396453848">"Përditësuar <xliff:g id="TIME">%1$s</xliff:g>"</string>
- <plurals name="abc_slice_duration_min" formatted="false" msgid="6996334305156847955">
- <item quantity="other"><xliff:g id="ID_2">%d</xliff:g> min më parë</item>
- <item quantity="one"><xliff:g id="ID_1">%d</xliff:g> min më parë</item>
+ <string name="abc_slice_more_content" msgid="7841223363798860154">"+ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
+ <string name="abc_slice_more" msgid="4299234410808450900">"Më shumë"</string>
+ <string name="abc_slice_show_more" msgid="1112789899890391107">"Shfaq më shumë"</string>
+ <string name="abc_slice_updated" msgid="7932359091871934205">"Përditësuar <xliff:g id="TIME">%1$s</xliff:g>"</string>
+ <plurals name="abc_slice_duration_min" formatted="false" msgid="7664017844210142826">
+ <item quantity="other"><xliff:g id="ID_2">%d</xliff:g> min. më parë</item>
+ <item quantity="one"><xliff:g id="ID_1">%d</xliff:g> min. më parë</item>
</plurals>
- <plurals name="abc_slice_duration_years" formatted="false" msgid="6212691832333991589">
+ <plurals name="abc_slice_duration_years" formatted="false" msgid="2628491538787454021">
<item quantity="other"><xliff:g id="ID_2">%d</xliff:g> vite më parë</item>
<item quantity="one"><xliff:g id="ID_1">%d</xliff:g> vit më parë</item>
</plurals>
- <plurals name="abc_slice_duration_days" formatted="false" msgid="6241698511167107334">
+ <plurals name="abc_slice_duration_days" formatted="false" msgid="8356547162075064530">
<item quantity="other"><xliff:g id="ID_2">%d</xliff:g> ditë më parë</item>
<item quantity="one"><xliff:g id="ID_1">%d</xliff:g> ditë më parë</item>
</plurals>
- <string name="abc_slice_error" msgid="4188371422904147368">"Nuk mund të lidhej"</string>
+ <string name="abc_slice_error" msgid="1794214973158263497">"Nuk mund të lidhej"</string>
</resources>
diff --git a/slice/slice-view/src/main/res/values-sr/strings.xml b/slice/slice-view/src/main/res/values-sr/strings.xml
index 718f3d7..2b01296 100644
--- a/slice/slice-view/src/main/res/values-sr/strings.xml
+++ b/slice/slice-view/src/main/res/values-sr/strings.xml
@@ -17,24 +17,24 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slice_more_content" msgid="6405516388971241142">"и још <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
- <string name="abc_slice_more" msgid="1983560225998630901">"Још"</string>
- <string name="abc_slice_show_more" msgid="1567717014004692768">"Прикажи више"</string>
- <string name="abc_slice_updated" msgid="8155085405396453848">"Ажурирано <xliff:g id="TIME">%1$s</xliff:g>"</string>
- <plurals name="abc_slice_duration_min" formatted="false" msgid="6996334305156847955">
- <item quantity="one">пре <xliff:g id="ID_2">%d</xliff:g> мин</item>
- <item quantity="few">пре <xliff:g id="ID_2">%d</xliff:g> мин</item>
- <item quantity="other">пре <xliff:g id="ID_2">%d</xliff:g> мин</item>
+ <string name="abc_slice_more_content" msgid="7841223363798860154">"+ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
+ <string name="abc_slice_more" msgid="4299234410808450900">"Још"</string>
+ <string name="abc_slice_show_more" msgid="1112789899890391107">"Прикажи још"</string>
+ <string name="abc_slice_updated" msgid="7932359091871934205">"Ажурирано <xliff:g id="TIME">%1$s</xliff:g>"</string>
+ <plurals name="abc_slice_duration_min" formatted="false" msgid="7664017844210142826">
+ <item quantity="one">Пре <xliff:g id="ID_2">%d</xliff:g> мин</item>
+ <item quantity="few">Пре <xliff:g id="ID_2">%d</xliff:g> мин</item>
+ <item quantity="other">Пре <xliff:g id="ID_2">%d</xliff:g> мин</item>
</plurals>
- <plurals name="abc_slice_duration_years" formatted="false" msgid="6212691832333991589">
- <item quantity="one">пре <xliff:g id="ID_2">%d</xliff:g> год</item>
- <item quantity="few">пре <xliff:g id="ID_2">%d</xliff:g> год</item>
- <item quantity="other">пре <xliff:g id="ID_2">%d</xliff:g> год</item>
+ <plurals name="abc_slice_duration_years" formatted="false" msgid="2628491538787454021">
+ <item quantity="one">Пре <xliff:g id="ID_2">%d</xliff:g> год</item>
+ <item quantity="few">Пре <xliff:g id="ID_2">%d</xliff:g> год</item>
+ <item quantity="other">Пре <xliff:g id="ID_2">%d</xliff:g> год</item>
</plurals>
- <plurals name="abc_slice_duration_days" formatted="false" msgid="6241698511167107334">
- <item quantity="one">пре <xliff:g id="ID_2">%d</xliff:g> дан</item>
- <item quantity="few">пре <xliff:g id="ID_2">%d</xliff:g> дана</item>
- <item quantity="other">пре <xliff:g id="ID_2">%d</xliff:g> дана</item>
+ <plurals name="abc_slice_duration_days" formatted="false" msgid="8356547162075064530">
+ <item quantity="one">Пре <xliff:g id="ID_2">%d</xliff:g> дан</item>
+ <item quantity="few">Пре <xliff:g id="ID_2">%d</xliff:g> дана</item>
+ <item quantity="other">Пре <xliff:g id="ID_2">%d</xliff:g> дана</item>
</plurals>
- <string name="abc_slice_error" msgid="4188371422904147368">"Повезивање није успело"</string>
+ <string name="abc_slice_error" msgid="1794214973158263497">"Повезивање није успело"</string>
</resources>
diff --git a/slice/slice-view/src/main/res/values-sv/strings.xml b/slice/slice-view/src/main/res/values-sv/strings.xml
index 90caa1a..5c85aa8 100644
--- a/slice/slice-view/src/main/res/values-sv/strings.xml
+++ b/slice/slice-view/src/main/res/values-sv/strings.xml
@@ -17,21 +17,21 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slice_more_content" msgid="6405516388971241142">"<xliff:g id="NUMBER">%1$d</xliff:g> till"</string>
- <string name="abc_slice_more" msgid="1983560225998630901">"Mer"</string>
- <string name="abc_slice_show_more" msgid="1567717014004692768">"Visa mer"</string>
- <string name="abc_slice_updated" msgid="8155085405396453848">"Uppdaterades <xliff:g id="TIME">%1$s</xliff:g>"</string>
- <plurals name="abc_slice_duration_min" formatted="false" msgid="6996334305156847955">
- <item quantity="other"><xliff:g id="ID_2">%d</xliff:g> minuter sedan</item>
- <item quantity="one"><xliff:g id="ID_1">%d</xliff:g> minut sedan</item>
+ <string name="abc_slice_more_content" msgid="7841223363798860154">"+ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
+ <string name="abc_slice_more" msgid="4299234410808450900">"Mer"</string>
+ <string name="abc_slice_show_more" msgid="1112789899890391107">"Visa mer"</string>
+ <string name="abc_slice_updated" msgid="7932359091871934205">"Uppdaterades för <xliff:g id="TIME">%1$s</xliff:g>"</string>
+ <plurals name="abc_slice_duration_min" formatted="false" msgid="7664017844210142826">
+ <item quantity="other"><xliff:g id="ID_2">%d</xliff:g> min sedan</item>
+ <item quantity="one"><xliff:g id="ID_1">%d</xliff:g> min sedan</item>
</plurals>
- <plurals name="abc_slice_duration_years" formatted="false" msgid="6212691832333991589">
+ <plurals name="abc_slice_duration_years" formatted="false" msgid="2628491538787454021">
<item quantity="other"><xliff:g id="ID_2">%d</xliff:g> år sedan</item>
<item quantity="one"><xliff:g id="ID_1">%d</xliff:g> år sedan</item>
</plurals>
- <plurals name="abc_slice_duration_days" formatted="false" msgid="6241698511167107334">
+ <plurals name="abc_slice_duration_days" formatted="false" msgid="8356547162075064530">
<item quantity="other"><xliff:g id="ID_2">%d</xliff:g> dagar sedan</item>
<item quantity="one"><xliff:g id="ID_1">%d</xliff:g> dag sedan</item>
</plurals>
- <string name="abc_slice_error" msgid="4188371422904147368">"Det gick inte att ansluta"</string>
+ <string name="abc_slice_error" msgid="1794214973158263497">"Det gick inte att ansluta"</string>
</resources>
diff --git a/slice/slice-view/src/main/res/values-sw/strings.xml b/slice/slice-view/src/main/res/values-sw/strings.xml
index 609c51f..9a5bcb6 100644
--- a/slice/slice-view/src/main/res/values-sw/strings.xml
+++ b/slice/slice-view/src/main/res/values-sw/strings.xml
@@ -17,21 +17,21 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slice_more_content" msgid="6405516388971241142">"+ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
- <string name="abc_slice_more" msgid="1983560225998630901">"Mengine"</string>
- <string name="abc_slice_show_more" msgid="1567717014004692768">"Onyesha mengine"</string>
- <string name="abc_slice_updated" msgid="8155085405396453848">"Ilisasishwa <xliff:g id="TIME">%1$s</xliff:g>"</string>
- <plurals name="abc_slice_duration_min" formatted="false" msgid="6996334305156847955">
- <item quantity="other">Dakika <xliff:g id="ID_2">%d</xliff:g> zilizopita</item>
- <item quantity="one">Dakika <xliff:g id="ID_1">%d</xliff:g> iliyopita</item>
+ <string name="abc_slice_more_content" msgid="7841223363798860154">"+ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
+ <string name="abc_slice_more" msgid="4299234410808450900">"Zaidi"</string>
+ <string name="abc_slice_show_more" msgid="1112789899890391107">"Onyesha zaidi"</string>
+ <string name="abc_slice_updated" msgid="7932359091871934205">"Ilisasishwa <xliff:g id="TIME">%1$s</xliff:g>"</string>
+ <plurals name="abc_slice_duration_min" formatted="false" msgid="7664017844210142826">
+ <item quantity="other">Dak <xliff:g id="ID_2">%d</xliff:g> zilizopita</item>
+ <item quantity="one">Dak <xliff:g id="ID_1">%d</xliff:g> iliyopita</item>
</plurals>
- <plurals name="abc_slice_duration_years" formatted="false" msgid="6212691832333991589">
+ <plurals name="abc_slice_duration_years" formatted="false" msgid="2628491538787454021">
<item quantity="other">Miaka <xliff:g id="ID_2">%d</xliff:g> iliyopita</item>
<item quantity="one">Mwaka <xliff:g id="ID_1">%d</xliff:g> uliopita</item>
</plurals>
- <plurals name="abc_slice_duration_days" formatted="false" msgid="6241698511167107334">
+ <plurals name="abc_slice_duration_days" formatted="false" msgid="8356547162075064530">
<item quantity="other">Siku <xliff:g id="ID_2">%d</xliff:g> zilizopita</item>
<item quantity="one">Siku <xliff:g id="ID_1">%d</xliff:g> iliyopita</item>
</plurals>
- <string name="abc_slice_error" msgid="4188371422904147368">"Imeshindwa kuunganisha"</string>
+ <string name="abc_slice_error" msgid="1794214973158263497">"Imeshindwa kuunganisha"</string>
</resources>
diff --git a/slice/slice-view/src/main/res/values-ta/strings.xml b/slice/slice-view/src/main/res/values-ta/strings.xml
index 778218e..c47e265 100644
--- a/slice/slice-view/src/main/res/values-ta/strings.xml
+++ b/slice/slice-view/src/main/res/values-ta/strings.xml
@@ -17,21 +17,21 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slice_more_content" msgid="6405516388971241142">"+ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
- <string name="abc_slice_more" msgid="1983560225998630901">"மேலும்"</string>
- <string name="abc_slice_show_more" msgid="1567717014004692768">"மேலும் காட்டு"</string>
- <string name="abc_slice_updated" msgid="8155085405396453848">"புதுப்பித்தது: <xliff:g id="TIME">%1$s</xliff:g>"</string>
- <plurals name="abc_slice_duration_min" formatted="false" msgid="6996334305156847955">
- <item quantity="other"><xliff:g id="ID_2">%d</xliff:g> நிமி. முன்</item>
- <item quantity="one"><xliff:g id="ID_1">%d</xliff:g> நிமி. முன்</item>
+ <string name="abc_slice_more_content" msgid="7841223363798860154">"+ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
+ <string name="abc_slice_more" msgid="4299234410808450900">"மேலும்"</string>
+ <string name="abc_slice_show_more" msgid="1112789899890391107">"மேலும் காட்டு"</string>
+ <string name="abc_slice_updated" msgid="7932359091871934205">"புதுப்பித்தது: <xliff:g id="TIME">%1$s</xliff:g>"</string>
+ <plurals name="abc_slice_duration_min" formatted="false" msgid="7664017844210142826">
+ <item quantity="other"><xliff:g id="ID_2">%d</xliff:g> நிமி முன்பு</item>
+ <item quantity="one"><xliff:g id="ID_1">%d</xliff:g> நிமி முன்பு</item>
</plurals>
- <plurals name="abc_slice_duration_years" formatted="false" msgid="6212691832333991589">
- <item quantity="other"><xliff:g id="ID_2">%d</xliff:g> ஆண்டிற்கு முன்</item>
- <item quantity="one"><xliff:g id="ID_1">%d</xliff:g> ஆண்டிற்கு முன்</item>
+ <plurals name="abc_slice_duration_years" formatted="false" msgid="2628491538787454021">
+ <item quantity="other"><xliff:g id="ID_2">%d</xliff:g> ஆண்டுக்கு முன்</item>
+ <item quantity="one"><xliff:g id="ID_1">%d</xliff:g> ஆண்டுக்கு முன்</item>
</plurals>
- <plurals name="abc_slice_duration_days" formatted="false" msgid="6241698511167107334">
- <item quantity="other"><xliff:g id="ID_2">%d</xliff:g> நாளுக்கு முன்</item>
- <item quantity="one"><xliff:g id="ID_1">%d</xliff:g> நாளுக்கு முன்</item>
+ <plurals name="abc_slice_duration_days" formatted="false" msgid="8356547162075064530">
+ <item quantity="other"><xliff:g id="ID_2">%d</xliff:g> நா முன்பு</item>
+ <item quantity="one"><xliff:g id="ID_1">%d</xliff:g> நா முன்பு</item>
</plurals>
- <string name="abc_slice_error" msgid="4188371422904147368">"இணைக்க முடியவில்லை"</string>
+ <string name="abc_slice_error" msgid="1794214973158263497">"இணைக்க முடியவில்லை"</string>
</resources>
diff --git a/slice/slice-view/src/main/res/values-te/strings.xml b/slice/slice-view/src/main/res/values-te/strings.xml
index 82137b8..dcb3945 100644
--- a/slice/slice-view/src/main/res/values-te/strings.xml
+++ b/slice/slice-view/src/main/res/values-te/strings.xml
@@ -17,21 +17,21 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slice_more_content" msgid="6405516388971241142">"+ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
- <string name="abc_slice_more" msgid="1983560225998630901">"మరింత"</string>
- <string name="abc_slice_show_more" msgid="1567717014004692768">"మరింత చూపు"</string>
- <string name="abc_slice_updated" msgid="8155085405396453848">"అప్డేట్ చేసిన సమయం <xliff:g id="TIME">%1$s</xliff:g>"</string>
- <plurals name="abc_slice_duration_min" formatted="false" msgid="6996334305156847955">
+ <string name="abc_slice_more_content" msgid="7841223363798860154">"+ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
+ <string name="abc_slice_more" msgid="4299234410808450900">"మరింత"</string>
+ <string name="abc_slice_show_more" msgid="1112789899890391107">"మరింత కంటెంట్ను చూడండి"</string>
+ <string name="abc_slice_updated" msgid="7932359091871934205">"<xliff:g id="TIME">%1$s</xliff:g> అప్డేట్ చేయబడింది"</string>
+ <plurals name="abc_slice_duration_min" formatted="false" msgid="7664017844210142826">
<item quantity="other"><xliff:g id="ID_2">%d</xliff:g> నిమి క్రితం</item>
<item quantity="one"><xliff:g id="ID_1">%d</xliff:g> నిమి క్రితం</item>
</plurals>
- <plurals name="abc_slice_duration_years" formatted="false" msgid="6212691832333991589">
+ <plurals name="abc_slice_duration_years" formatted="false" msgid="2628491538787454021">
<item quantity="other"><xliff:g id="ID_2">%d</xliff:g> సం క్రితం</item>
<item quantity="one"><xliff:g id="ID_1">%d</xliff:g> సం క్రితం</item>
</plurals>
- <plurals name="abc_slice_duration_days" formatted="false" msgid="6241698511167107334">
+ <plurals name="abc_slice_duration_days" formatted="false" msgid="8356547162075064530">
<item quantity="other"><xliff:g id="ID_2">%d</xliff:g> రోజుల క్రితం</item>
<item quantity="one"><xliff:g id="ID_1">%d</xliff:g> రోజు క్రితం</item>
</plurals>
- <string name="abc_slice_error" msgid="4188371422904147368">"కనెక్ట్ చేయడం సాధ్యపడలేదు"</string>
+ <string name="abc_slice_error" msgid="1794214973158263497">"కనెక్ట్ చేయడం సాధ్యపడలేదు"</string>
</resources>
diff --git a/slice/slice-view/src/main/res/values-th/strings.xml b/slice/slice-view/src/main/res/values-th/strings.xml
index 3ae19da..96123c3 100644
--- a/slice/slice-view/src/main/res/values-th/strings.xml
+++ b/slice/slice-view/src/main/res/values-th/strings.xml
@@ -17,21 +17,21 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slice_more_content" msgid="6405516388971241142">"+ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
- <string name="abc_slice_more" msgid="1983560225998630901">"เพิ่มเติม"</string>
- <string name="abc_slice_show_more" msgid="1567717014004692768">"แสดงเพิ่ม"</string>
- <string name="abc_slice_updated" msgid="8155085405396453848">"อัปเดตเมื่อ <xliff:g id="TIME">%1$s</xliff:g>"</string>
- <plurals name="abc_slice_duration_min" formatted="false" msgid="6996334305156847955">
- <item quantity="other"><xliff:g id="ID_2">%d</xliff:g> นาทีที่แล้ว</item>
- <item quantity="one"><xliff:g id="ID_1">%d</xliff:g> นาทีที่แล้ว</item>
+ <string name="abc_slice_more_content" msgid="7841223363798860154">"+ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
+ <string name="abc_slice_more" msgid="4299234410808450900">"เพิ่มเติม"</string>
+ <string name="abc_slice_show_more" msgid="1112789899890391107">"แสดงเพิ่มเติม"</string>
+ <string name="abc_slice_updated" msgid="7932359091871934205">"อัปเดตเมื่อ <xliff:g id="TIME">%1$s</xliff:g>"</string>
+ <plurals name="abc_slice_duration_min" formatted="false" msgid="7664017844210142826">
+ <item quantity="other"><xliff:g id="ID_2">%d</xliff:g> นาทีที่ผ่านมา</item>
+ <item quantity="one"><xliff:g id="ID_1">%d</xliff:g> นาทีที่ผ่านมา</item>
</plurals>
- <plurals name="abc_slice_duration_years" formatted="false" msgid="6212691832333991589">
- <item quantity="other"><xliff:g id="ID_2">%d</xliff:g> ปีที่แล้ว</item>
- <item quantity="one"><xliff:g id="ID_1">%d</xliff:g> ปีที่แล้ว</item>
+ <plurals name="abc_slice_duration_years" formatted="false" msgid="2628491538787454021">
+ <item quantity="other"><xliff:g id="ID_2">%d</xliff:g> ปีที่ผ่านมา</item>
+ <item quantity="one"><xliff:g id="ID_1">%d</xliff:g> ปีที่ผ่านมา</item>
</plurals>
- <plurals name="abc_slice_duration_days" formatted="false" msgid="6241698511167107334">
- <item quantity="other"><xliff:g id="ID_2">%d</xliff:g> วันที่แล้ว</item>
- <item quantity="one"><xliff:g id="ID_1">%d</xliff:g> วันที่แล้ว</item>
+ <plurals name="abc_slice_duration_days" formatted="false" msgid="8356547162075064530">
+ <item quantity="other"><xliff:g id="ID_2">%d</xliff:g> วันที่ผ่านมา</item>
+ <item quantity="one"><xliff:g id="ID_1">%d</xliff:g> วันที่ผ่านมา</item>
</plurals>
- <string name="abc_slice_error" msgid="4188371422904147368">"เชื่อมต่อไม่ได้"</string>
+ <string name="abc_slice_error" msgid="1794214973158263497">"เชื่อมต่อไม่ได้"</string>
</resources>
diff --git a/slice/slice-view/src/main/res/values-tl/strings.xml b/slice/slice-view/src/main/res/values-tl/strings.xml
index 2e76a1a..d07e8cb 100644
--- a/slice/slice-view/src/main/res/values-tl/strings.xml
+++ b/slice/slice-view/src/main/res/values-tl/strings.xml
@@ -17,21 +17,21 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slice_more_content" msgid="6405516388971241142">"+ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
- <string name="abc_slice_more" msgid="1983560225998630901">"Higit pa"</string>
- <string name="abc_slice_show_more" msgid="1567717014004692768">"Magpakita pa"</string>
- <string name="abc_slice_updated" msgid="8155085405396453848">"Na-update noong <xliff:g id="TIME">%1$s</xliff:g>"</string>
- <plurals name="abc_slice_duration_min" formatted="false" msgid="6996334305156847955">
+ <string name="abc_slice_more_content" msgid="7841223363798860154">"+ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
+ <string name="abc_slice_more" msgid="4299234410808450900">"Higit pa"</string>
+ <string name="abc_slice_show_more" msgid="1112789899890391107">"Magpakita pa"</string>
+ <string name="abc_slice_updated" msgid="7932359091871934205">"Na-update <xliff:g id="TIME">%1$s</xliff:g>"</string>
+ <plurals name="abc_slice_duration_min" formatted="false" msgid="7664017844210142826">
<item quantity="one"><xliff:g id="ID_2">%d</xliff:g> min ang nakalipas</item>
<item quantity="other"><xliff:g id="ID_2">%d</xliff:g> na min ang nakalipas</item>
</plurals>
- <plurals name="abc_slice_duration_years" formatted="false" msgid="6212691832333991589">
+ <plurals name="abc_slice_duration_years" formatted="false" msgid="2628491538787454021">
<item quantity="one"><xliff:g id="ID_2">%d</xliff:g> taon ang nakalipas</item>
<item quantity="other"><xliff:g id="ID_2">%d</xliff:g> na taon ang nakalipas</item>
</plurals>
- <plurals name="abc_slice_duration_days" formatted="false" msgid="6241698511167107334">
+ <plurals name="abc_slice_duration_days" formatted="false" msgid="8356547162075064530">
<item quantity="one"><xliff:g id="ID_2">%d</xliff:g> araw ang nakalipas</item>
<item quantity="other"><xliff:g id="ID_2">%d</xliff:g> na araw ang nakalipas</item>
</plurals>
- <string name="abc_slice_error" msgid="4188371422904147368">"Hindi makakonekta"</string>
+ <string name="abc_slice_error" msgid="1794214973158263497">"Hindi makakonekta"</string>
</resources>
diff --git a/slice/slice-view/src/main/res/values-tr/strings.xml b/slice/slice-view/src/main/res/values-tr/strings.xml
index 74de868..47c3c007 100644
--- a/slice/slice-view/src/main/res/values-tr/strings.xml
+++ b/slice/slice-view/src/main/res/values-tr/strings.xml
@@ -17,21 +17,21 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slice_more_content" msgid="6405516388971241142">"+ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
- <string name="abc_slice_more" msgid="1983560225998630901">"Daha fazla"</string>
- <string name="abc_slice_show_more" msgid="1567717014004692768">"Daha fazla göster"</string>
- <string name="abc_slice_updated" msgid="8155085405396453848">"Güncellenme zamanı: <xliff:g id="TIME">%1$s</xliff:g>"</string>
- <plurals name="abc_slice_duration_min" formatted="false" msgid="6996334305156847955">
+ <string name="abc_slice_more_content" msgid="7841223363798860154">"+ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
+ <string name="abc_slice_more" msgid="4299234410808450900">"Diğer"</string>
+ <string name="abc_slice_show_more" msgid="1112789899890391107">"Daha fazla göster"</string>
+ <string name="abc_slice_updated" msgid="7932359091871934205">"<xliff:g id="TIME">%1$s</xliff:g> güncellendi"</string>
+ <plurals name="abc_slice_duration_min" formatted="false" msgid="7664017844210142826">
<item quantity="other"><xliff:g id="ID_2">%d</xliff:g> dk. önce</item>
<item quantity="one"><xliff:g id="ID_1">%d</xliff:g> dk. önce</item>
</plurals>
- <plurals name="abc_slice_duration_years" formatted="false" msgid="6212691832333991589">
+ <plurals name="abc_slice_duration_years" formatted="false" msgid="2628491538787454021">
<item quantity="other"><xliff:g id="ID_2">%d</xliff:g> yıl önce</item>
<item quantity="one"><xliff:g id="ID_1">%d</xliff:g> yıl önce</item>
</plurals>
- <plurals name="abc_slice_duration_days" formatted="false" msgid="6241698511167107334">
+ <plurals name="abc_slice_duration_days" formatted="false" msgid="8356547162075064530">
<item quantity="other"><xliff:g id="ID_2">%d</xliff:g> gün önce</item>
<item quantity="one"><xliff:g id="ID_1">%d</xliff:g> gün önce</item>
</plurals>
- <string name="abc_slice_error" msgid="4188371422904147368">"Bağlanılamadı"</string>
+ <string name="abc_slice_error" msgid="1794214973158263497">"Bağlanamadı"</string>
</resources>
diff --git a/slice/slice-view/src/main/res/values-uk/strings.xml b/slice/slice-view/src/main/res/values-uk/strings.xml
index 0706d80..f29a022 100644
--- a/slice/slice-view/src/main/res/values-uk/strings.xml
+++ b/slice/slice-view/src/main/res/values-uk/strings.xml
@@ -17,27 +17,27 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slice_more_content" msgid="6405516388971241142">"+ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
- <string name="abc_slice_more" msgid="1983560225998630901">"Більше"</string>
- <string name="abc_slice_show_more" msgid="1567717014004692768">"Показати більше"</string>
- <string name="abc_slice_updated" msgid="8155085405396453848">"Оновлено: <xliff:g id="TIME">%1$s</xliff:g>"</string>
- <plurals name="abc_slice_duration_min" formatted="false" msgid="6996334305156847955">
- <item quantity="one"><xliff:g id="ID_2">%d</xliff:g> хвилину тому</item>
- <item quantity="few"><xliff:g id="ID_2">%d</xliff:g> хвилини тому</item>
- <item quantity="many"><xliff:g id="ID_2">%d</xliff:g> хвилин тому</item>
- <item quantity="other"><xliff:g id="ID_2">%d</xliff:g> хвилини тому</item>
+ <string name="abc_slice_more_content" msgid="7841223363798860154">"+ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
+ <string name="abc_slice_more" msgid="4299234410808450900">"Більше"</string>
+ <string name="abc_slice_show_more" msgid="1112789899890391107">"Показати більше"</string>
+ <string name="abc_slice_updated" msgid="7932359091871934205">"Оновлено <xliff:g id="TIME">%1$s</xliff:g>"</string>
+ <plurals name="abc_slice_duration_min" formatted="false" msgid="7664017844210142826">
+ <item quantity="one"><xliff:g id="ID_2">%d</xliff:g> хв тому</item>
+ <item quantity="few"><xliff:g id="ID_2">%d</xliff:g> хв тому</item>
+ <item quantity="many"><xliff:g id="ID_2">%d</xliff:g> хв тому</item>
+ <item quantity="other"><xliff:g id="ID_2">%d</xliff:g> хв тому</item>
</plurals>
- <plurals name="abc_slice_duration_years" formatted="false" msgid="6212691832333991589">
- <item quantity="one"><xliff:g id="ID_2">%d</xliff:g> рік тому</item>
- <item quantity="few"><xliff:g id="ID_2">%d</xliff:g> роки тому</item>
- <item quantity="many"><xliff:g id="ID_2">%d</xliff:g> років тому</item>
- <item quantity="other"><xliff:g id="ID_2">%d</xliff:g> року тому</item>
+ <plurals name="abc_slice_duration_years" formatted="false" msgid="2628491538787454021">
+ <item quantity="one"><xliff:g id="ID_2">%d</xliff:g> р. тому</item>
+ <item quantity="few"><xliff:g id="ID_2">%d</xliff:g> р. тому</item>
+ <item quantity="many"><xliff:g id="ID_2">%d</xliff:g> р. тому</item>
+ <item quantity="other"><xliff:g id="ID_2">%d</xliff:g> р. тому</item>
</plurals>
- <plurals name="abc_slice_duration_days" formatted="false" msgid="6241698511167107334">
+ <plurals name="abc_slice_duration_days" formatted="false" msgid="8356547162075064530">
<item quantity="one"><xliff:g id="ID_2">%d</xliff:g> день тому</item>
<item quantity="few"><xliff:g id="ID_2">%d</xliff:g> дні тому</item>
<item quantity="many"><xliff:g id="ID_2">%d</xliff:g> днів тому</item>
<item quantity="other"><xliff:g id="ID_2">%d</xliff:g> дня тому</item>
</plurals>
- <string name="abc_slice_error" msgid="4188371422904147368">"Не вдалося під’єднатися"</string>
+ <string name="abc_slice_error" msgid="1794214973158263497">"Не вдалося підключитися"</string>
</resources>
diff --git a/slice/slice-view/src/main/res/values-ur/strings.xml b/slice/slice-view/src/main/res/values-ur/strings.xml
index 1fff81c4..92dbe21 100644
--- a/slice/slice-view/src/main/res/values-ur/strings.xml
+++ b/slice/slice-view/src/main/res/values-ur/strings.xml
@@ -17,21 +17,21 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slice_more_content" msgid="6405516388971241142">"+ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
- <string name="abc_slice_more" msgid="1983560225998630901">"مزید"</string>
- <string name="abc_slice_show_more" msgid="1567717014004692768">"مزید دکھائیں"</string>
- <string name="abc_slice_updated" msgid="8155085405396453848">"<xliff:g id="TIME">%1$s</xliff:g> اپ ڈیٹ کیا گیا"</string>
- <plurals name="abc_slice_duration_min" formatted="false" msgid="6996334305156847955">
+ <string name="abc_slice_more_content" msgid="7841223363798860154">"<xliff:g id="NUMBER">%1$d</xliff:g> +"</string>
+ <string name="abc_slice_more" msgid="4299234410808450900">"مزید"</string>
+ <string name="abc_slice_show_more" msgid="1112789899890391107">"مزید دکھائیں"</string>
+ <string name="abc_slice_updated" msgid="7932359091871934205">"اپ ڈیٹ کا وقت <xliff:g id="TIME">%1$s</xliff:g>"</string>
+ <plurals name="abc_slice_duration_min" formatted="false" msgid="7664017844210142826">
<item quantity="other"><xliff:g id="ID_2">%d</xliff:g> منٹ پہلے</item>
<item quantity="one"><xliff:g id="ID_1">%d</xliff:g> منٹ پہلے</item>
</plurals>
- <plurals name="abc_slice_duration_years" formatted="false" msgid="6212691832333991589">
+ <plurals name="abc_slice_duration_years" formatted="false" msgid="2628491538787454021">
<item quantity="other"><xliff:g id="ID_2">%d</xliff:g> سال پہلے</item>
<item quantity="one"><xliff:g id="ID_1">%d</xliff:g> سال پہلے</item>
</plurals>
- <plurals name="abc_slice_duration_days" formatted="false" msgid="6241698511167107334">
+ <plurals name="abc_slice_duration_days" formatted="false" msgid="8356547162075064530">
<item quantity="other"><xliff:g id="ID_2">%d</xliff:g> دن پہلے</item>
<item quantity="one"><xliff:g id="ID_1">%d</xliff:g> دن پہلے</item>
</plurals>
- <string name="abc_slice_error" msgid="4188371422904147368">"منسلک نہیں ہو سکا"</string>
+ <string name="abc_slice_error" msgid="1794214973158263497">"منسلک نہیں ہو سکا"</string>
</resources>
diff --git a/slice/slice-view/src/main/res/values-uz/strings.xml b/slice/slice-view/src/main/res/values-uz/strings.xml
index 0a973cd..262dafd 100644
--- a/slice/slice-view/src/main/res/values-uz/strings.xml
+++ b/slice/slice-view/src/main/res/values-uz/strings.xml
@@ -17,21 +17,21 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slice_more_content" msgid="6405516388971241142">"+ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
- <string name="abc_slice_more" msgid="1983560225998630901">"Yana"</string>
- <string name="abc_slice_show_more" msgid="1567717014004692768">"Yana"</string>
- <string name="abc_slice_updated" msgid="8155085405396453848">"Yangilandi: <xliff:g id="TIME">%1$s</xliff:g>"</string>
- <plurals name="abc_slice_duration_min" formatted="false" msgid="6996334305156847955">
+ <string name="abc_slice_more_content" msgid="7841223363798860154">"+ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
+ <string name="abc_slice_more" msgid="4299234410808450900">"Yana"</string>
+ <string name="abc_slice_show_more" msgid="1112789899890391107">"Yana"</string>
+ <string name="abc_slice_updated" msgid="7932359091871934205">"Yangilandi: <xliff:g id="TIME">%1$s</xliff:g>"</string>
+ <plurals name="abc_slice_duration_min" formatted="false" msgid="7664017844210142826">
<item quantity="other"><xliff:g id="ID_2">%d</xliff:g> daqiqa oldin</item>
<item quantity="one"><xliff:g id="ID_1">%d</xliff:g> daqiqa oldin</item>
</plurals>
- <plurals name="abc_slice_duration_years" formatted="false" msgid="6212691832333991589">
+ <plurals name="abc_slice_duration_years" formatted="false" msgid="2628491538787454021">
<item quantity="other"><xliff:g id="ID_2">%d</xliff:g> yil oldin</item>
<item quantity="one"><xliff:g id="ID_1">%d</xliff:g> yil oldin</item>
</plurals>
- <plurals name="abc_slice_duration_days" formatted="false" msgid="6241698511167107334">
+ <plurals name="abc_slice_duration_days" formatted="false" msgid="8356547162075064530">
<item quantity="other"><xliff:g id="ID_2">%d</xliff:g> kun oldin</item>
<item quantity="one"><xliff:g id="ID_1">%d</xliff:g> kun oldin</item>
</plurals>
- <string name="abc_slice_error" msgid="4188371422904147368">"Ulanib bo‘lmadi"</string>
+ <string name="abc_slice_error" msgid="1794214973158263497">"Ulanmadi"</string>
</resources>
diff --git a/slice/slice-view/src/main/res/values-vi/strings.xml b/slice/slice-view/src/main/res/values-vi/strings.xml
index 1e71db6..39e7f30 100644
--- a/slice/slice-view/src/main/res/values-vi/strings.xml
+++ b/slice/slice-view/src/main/res/values-vi/strings.xml
@@ -17,21 +17,21 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slice_more_content" msgid="6405516388971241142">"+ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
- <string name="abc_slice_more" msgid="1983560225998630901">"Thêm"</string>
- <string name="abc_slice_show_more" msgid="1567717014004692768">"Hiển thị thêm"</string>
- <string name="abc_slice_updated" msgid="8155085405396453848">"Đã cập nhật lúc <xliff:g id="TIME">%1$s</xliff:g>"</string>
- <plurals name="abc_slice_duration_min" formatted="false" msgid="6996334305156847955">
+ <string name="abc_slice_more_content" msgid="7841223363798860154">"+ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
+ <string name="abc_slice_more" msgid="4299234410808450900">"Xem thêm"</string>
+ <string name="abc_slice_show_more" msgid="1112789899890391107">"Hiện thêm"</string>
+ <string name="abc_slice_updated" msgid="7932359091871934205">"Thời gian cập nhật: <xliff:g id="TIME">%1$s</xliff:g>"</string>
+ <plurals name="abc_slice_duration_min" formatted="false" msgid="7664017844210142826">
<item quantity="other"><xliff:g id="ID_2">%d</xliff:g> phút trước</item>
<item quantity="one"><xliff:g id="ID_1">%d</xliff:g> phút trước</item>
</plurals>
- <plurals name="abc_slice_duration_years" formatted="false" msgid="6212691832333991589">
+ <plurals name="abc_slice_duration_years" formatted="false" msgid="2628491538787454021">
<item quantity="other"><xliff:g id="ID_2">%d</xliff:g> năm trước</item>
<item quantity="one"><xliff:g id="ID_1">%d</xliff:g> năm trước</item>
</plurals>
- <plurals name="abc_slice_duration_days" formatted="false" msgid="6241698511167107334">
+ <plurals name="abc_slice_duration_days" formatted="false" msgid="8356547162075064530">
<item quantity="other"><xliff:g id="ID_2">%d</xliff:g> ngày trước</item>
<item quantity="one"><xliff:g id="ID_1">%d</xliff:g> ngày trước</item>
</plurals>
- <string name="abc_slice_error" msgid="4188371422904147368">"Không thể kết nối"</string>
+ <string name="abc_slice_error" msgid="1794214973158263497">"Không thể kết nối"</string>
</resources>
diff --git a/slice/slice-view/src/main/res/values-zh-rCN/strings.xml b/slice/slice-view/src/main/res/values-zh-rCN/strings.xml
index c018343..ded56d9 100644
--- a/slice/slice-view/src/main/res/values-zh-rCN/strings.xml
+++ b/slice/slice-view/src/main/res/values-zh-rCN/strings.xml
@@ -17,21 +17,21 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slice_more_content" msgid="6405516388971241142">"+ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
- <string name="abc_slice_more" msgid="1983560225998630901">"更多"</string>
- <string name="abc_slice_show_more" msgid="1567717014004692768">"显示更多"</string>
- <string name="abc_slice_updated" msgid="8155085405396453848">"更新时间:<xliff:g id="TIME">%1$s</xliff:g>"</string>
- <plurals name="abc_slice_duration_min" formatted="false" msgid="6996334305156847955">
+ <string name="abc_slice_more_content" msgid="7841223363798860154">"+ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
+ <string name="abc_slice_more" msgid="4299234410808450900">"更多"</string>
+ <string name="abc_slice_show_more" msgid="1112789899890391107">"展开"</string>
+ <string name="abc_slice_updated" msgid="7932359091871934205">"更新时间:<xliff:g id="TIME">%1$s</xliff:g>"</string>
+ <plurals name="abc_slice_duration_min" formatted="false" msgid="7664017844210142826">
<item quantity="other"><xliff:g id="ID_2">%d</xliff:g> 分钟前</item>
<item quantity="one"><xliff:g id="ID_1">%d</xliff:g> 分钟前</item>
</plurals>
- <plurals name="abc_slice_duration_years" formatted="false" msgid="6212691832333991589">
+ <plurals name="abc_slice_duration_years" formatted="false" msgid="2628491538787454021">
<item quantity="other"><xliff:g id="ID_2">%d</xliff:g> 年前</item>
<item quantity="one"><xliff:g id="ID_1">%d</xliff:g> 年前</item>
</plurals>
- <plurals name="abc_slice_duration_days" formatted="false" msgid="6241698511167107334">
+ <plurals name="abc_slice_duration_days" formatted="false" msgid="8356547162075064530">
<item quantity="other"><xliff:g id="ID_2">%d</xliff:g> 天前</item>
<item quantity="one"><xliff:g id="ID_1">%d</xliff:g> 天前</item>
</plurals>
- <string name="abc_slice_error" msgid="4188371422904147368">"无法连接"</string>
+ <string name="abc_slice_error" msgid="1794214973158263497">"无法连接"</string>
</resources>
diff --git a/slice/slice-view/src/main/res/values-zh-rHK/strings.xml b/slice/slice-view/src/main/res/values-zh-rHK/strings.xml
index d1ac276..8ba7634 100644
--- a/slice/slice-view/src/main/res/values-zh-rHK/strings.xml
+++ b/slice/slice-view/src/main/res/values-zh-rHK/strings.xml
@@ -17,21 +17,21 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slice_more_content" msgid="6405516388971241142">"+ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
- <string name="abc_slice_more" msgid="1983560225998630901">"更多"</string>
- <string name="abc_slice_show_more" msgid="1567717014004692768">"顯示更多"</string>
- <string name="abc_slice_updated" msgid="8155085405396453848">"更新時間:<xliff:g id="TIME">%1$s</xliff:g>"</string>
- <plurals name="abc_slice_duration_min" formatted="false" msgid="6996334305156847955">
+ <string name="abc_slice_more_content" msgid="7841223363798860154">"+ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
+ <string name="abc_slice_more" msgid="4299234410808450900">"更多"</string>
+ <string name="abc_slice_show_more" msgid="1112789899890391107">"顯示更多"</string>
+ <string name="abc_slice_updated" msgid="7932359091871934205">"上次更新時間:<xliff:g id="TIME">%1$s</xliff:g>"</string>
+ <plurals name="abc_slice_duration_min" formatted="false" msgid="7664017844210142826">
<item quantity="other"><xliff:g id="ID_2">%d</xliff:g> 分鐘前</item>
<item quantity="one"><xliff:g id="ID_1">%d</xliff:g> 分鐘前</item>
</plurals>
- <plurals name="abc_slice_duration_years" formatted="false" msgid="6212691832333991589">
+ <plurals name="abc_slice_duration_years" formatted="false" msgid="2628491538787454021">
<item quantity="other"><xliff:g id="ID_2">%d</xliff:g> 年前</item>
<item quantity="one"><xliff:g id="ID_1">%d</xliff:g> 年前</item>
</plurals>
- <plurals name="abc_slice_duration_days" formatted="false" msgid="6241698511167107334">
+ <plurals name="abc_slice_duration_days" formatted="false" msgid="8356547162075064530">
<item quantity="other"><xliff:g id="ID_2">%d</xliff:g> 天前</item>
<item quantity="one"><xliff:g id="ID_1">%d</xliff:g> 天前</item>
</plurals>
- <string name="abc_slice_error" msgid="4188371422904147368">"無法連線"</string>
+ <string name="abc_slice_error" msgid="1794214973158263497">"無法連接"</string>
</resources>
diff --git a/slice/slice-view/src/main/res/values-zh-rTW/strings.xml b/slice/slice-view/src/main/res/values-zh-rTW/strings.xml
index d1ac276..43420ad 100644
--- a/slice/slice-view/src/main/res/values-zh-rTW/strings.xml
+++ b/slice/slice-view/src/main/res/values-zh-rTW/strings.xml
@@ -17,21 +17,21 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slice_more_content" msgid="6405516388971241142">"+ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
- <string name="abc_slice_more" msgid="1983560225998630901">"更多"</string>
- <string name="abc_slice_show_more" msgid="1567717014004692768">"顯示更多"</string>
- <string name="abc_slice_updated" msgid="8155085405396453848">"更新時間:<xliff:g id="TIME">%1$s</xliff:g>"</string>
- <plurals name="abc_slice_duration_min" formatted="false" msgid="6996334305156847955">
+ <string name="abc_slice_more_content" msgid="7841223363798860154">"+ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
+ <string name="abc_slice_more" msgid="4299234410808450900">"更多"</string>
+ <string name="abc_slice_show_more" msgid="1112789899890391107">"顯示更多"</string>
+ <string name="abc_slice_updated" msgid="7932359091871934205">"更新時間:<xliff:g id="TIME">%1$s</xliff:g>"</string>
+ <plurals name="abc_slice_duration_min" formatted="false" msgid="7664017844210142826">
<item quantity="other"><xliff:g id="ID_2">%d</xliff:g> 分鐘前</item>
<item quantity="one"><xliff:g id="ID_1">%d</xliff:g> 分鐘前</item>
</plurals>
- <plurals name="abc_slice_duration_years" formatted="false" msgid="6212691832333991589">
+ <plurals name="abc_slice_duration_years" formatted="false" msgid="2628491538787454021">
<item quantity="other"><xliff:g id="ID_2">%d</xliff:g> 年前</item>
<item quantity="one"><xliff:g id="ID_1">%d</xliff:g> 年前</item>
</plurals>
- <plurals name="abc_slice_duration_days" formatted="false" msgid="6241698511167107334">
+ <plurals name="abc_slice_duration_days" formatted="false" msgid="8356547162075064530">
<item quantity="other"><xliff:g id="ID_2">%d</xliff:g> 天前</item>
<item quantity="one"><xliff:g id="ID_1">%d</xliff:g> 天前</item>
</plurals>
- <string name="abc_slice_error" msgid="4188371422904147368">"無法連線"</string>
+ <string name="abc_slice_error" msgid="1794214973158263497">"無法連線"</string>
</resources>
diff --git a/slice/slice-view/src/main/res/values-zu/strings.xml b/slice/slice-view/src/main/res/values-zu/strings.xml
index 966bb1b..8d685ec 100644
--- a/slice/slice-view/src/main/res/values-zu/strings.xml
+++ b/slice/slice-view/src/main/res/values-zu/strings.xml
@@ -17,21 +17,21 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_slice_more_content" msgid="6405516388971241142">"+ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
- <string name="abc_slice_more" msgid="1983560225998630901">"Okuningi"</string>
- <string name="abc_slice_show_more" msgid="1567717014004692768">"Bonisa okuningi"</string>
- <string name="abc_slice_updated" msgid="8155085405396453848">"Kubuyekezwe ngo-<xliff:g id="TIME">%1$s</xliff:g>"</string>
- <plurals name="abc_slice_duration_min" formatted="false" msgid="6996334305156847955">
+ <string name="abc_slice_more_content" msgid="7841223363798860154">"+ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
+ <string name="abc_slice_more" msgid="4299234410808450900">"Okuningi"</string>
+ <string name="abc_slice_show_more" msgid="1112789899890391107">"Bonisa okuningi"</string>
+ <string name="abc_slice_updated" msgid="7932359091871934205">"Ibuyekezwe <xliff:g id="TIME">%1$s</xliff:g>"</string>
+ <plurals name="abc_slice_duration_min" formatted="false" msgid="7664017844210142826">
<item quantity="one"><xliff:g id="ID_2">%d</xliff:g> iminithi eledlule</item>
<item quantity="other"><xliff:g id="ID_2">%d</xliff:g> iminithi eledlule</item>
</plurals>
- <plurals name="abc_slice_duration_years" formatted="false" msgid="6212691832333991589">
+ <plurals name="abc_slice_duration_years" formatted="false" msgid="2628491538787454021">
<item quantity="one"><xliff:g id="ID_2">%d</xliff:g> unyaka owedlule</item>
<item quantity="other"><xliff:g id="ID_2">%d</xliff:g> unyaka owedlule</item>
</plurals>
- <plurals name="abc_slice_duration_days" formatted="false" msgid="6241698511167107334">
- <item quantity="one"><xliff:g id="ID_2">%d</xliff:g> izinsuku ezedlule</item>
- <item quantity="other"><xliff:g id="ID_2">%d</xliff:g> izinsuku ezedlule</item>
+ <plurals name="abc_slice_duration_days" formatted="false" msgid="8356547162075064530">
+ <item quantity="one"><xliff:g id="ID_2">%d</xliff:g> izinsuku ezidlule</item>
+ <item quantity="other"><xliff:g id="ID_2">%d</xliff:g> izinsuku ezidlule</item>
</plurals>
- <string name="abc_slice_error" msgid="4188371422904147368">"Ayikwazanga ukuxhuma"</string>
+ <string name="abc_slice_error" msgid="1794214973158263497">"Ayikwazanga ukuxhuma"</string>
</resources>
diff --git a/slidingpanelayout/slidingpanelayout/build.gradle b/slidingpanelayout/slidingpanelayout/build.gradle
index 9071872..716eaf0 100644
--- a/slidingpanelayout/slidingpanelayout/build.gradle
+++ b/slidingpanelayout/slidingpanelayout/build.gradle
@@ -11,7 +11,7 @@
api("androidx.annotation:annotation:1.1.0")
implementation("androidx.core:core:1.1.0")
api("androidx.customview:customview:1.1.0")
- implementation("androidx.window:window:1.0.0-alpha10")
+ implementation(project(":window:window"))
implementation ("androidx.transition:transition:1.4.1")
androidTestImplementation(libs.testExtJunit)
@@ -20,7 +20,7 @@
androidTestImplementation(libs.kotlinStdlib)
androidTestImplementation(libs.truth)
androidTestImplementation(project(':internal-testutils-runtime'))
- androidTestImplementation("androidx.window:window-testing:1.0.0-alpha10")
+ androidTestImplementation(project(":window:window-testing"))
}
androidx {
diff --git a/startup/startup-runtime-lint/src/main/java/androidx/startup/lint/StartupRuntimeIssueRegistry.kt b/startup/startup-runtime-lint/src/main/java/androidx/startup/lint/StartupRuntimeIssueRegistry.kt
index 9cbccb3..59cb3cc 100644
--- a/startup/startup-runtime-lint/src/main/java/androidx/startup/lint/StartupRuntimeIssueRegistry.kt
+++ b/startup/startup-runtime-lint/src/main/java/androidx/startup/lint/StartupRuntimeIssueRegistry.kt
@@ -27,7 +27,7 @@
*/
class StartupRuntimeIssueRegistry : IssueRegistry() {
override val minApi = CURRENT_API
- override val api = 10
+ override val api = 11
override val issues: List<Issue>
get() = listOf(
InitializerConstructorDetector.ISSUE,
diff --git a/startup/startup-runtime/src/main/java/androidx/startup/AppInitializer.java b/startup/startup-runtime/src/main/java/androidx/startup/AppInitializer.java
index 1d23647..eda1040 100644
--- a/startup/startup-runtime/src/main/java/androidx/startup/AppInitializer.java
+++ b/startup/startup-runtime/src/main/java/androidx/startup/AppInitializer.java
@@ -69,7 +69,10 @@
* @param context The application context
*/
AppInitializer(@NonNull Context context) {
- mContext = context.getApplicationContext();
+ // We cannot always rely on getApplicationContext()
+ // More context: b/196959015
+ Context applicationContext = context.getApplicationContext();
+ mContext = applicationContext == null ? context : applicationContext;
mDiscovered = new HashSet<>();
mInitialized = new HashMap<>();
}
diff --git a/test/screenshot/build.gradle b/test/screenshot/screenshot/build.gradle
similarity index 100%
rename from test/screenshot/build.gradle
rename to test/screenshot/screenshot/build.gradle
diff --git a/test/screenshot/proto/build.gradle b/test/screenshot/screenshot/proto/build.gradle
similarity index 100%
rename from test/screenshot/proto/build.gradle
rename to test/screenshot/screenshot/proto/build.gradle
diff --git a/test/screenshot/proto/src/main/proto/screenshot_result.proto b/test/screenshot/screenshot/proto/src/main/proto/screenshot_result.proto
similarity index 100%
rename from test/screenshot/proto/src/main/proto/screenshot_result.proto
rename to test/screenshot/screenshot/proto/src/main/proto/screenshot_result.proto
diff --git a/test/screenshot/src/androidTest/assets/checkbox_checked.png b/test/screenshot/screenshot/src/androidTest/assets/checkbox_checked.png
similarity index 100%
rename from test/screenshot/src/androidTest/assets/checkbox_checked.png
rename to test/screenshot/screenshot/src/androidTest/assets/checkbox_checked.png
Binary files differ
diff --git a/test/screenshot/src/androidTest/assets/fullscreen_checked_checkbox.png b/test/screenshot/screenshot/src/androidTest/assets/fullscreen_checked_checkbox.png
similarity index 100%
rename from test/screenshot/src/androidTest/assets/fullscreen_checked_checkbox.png
rename to test/screenshot/screenshot/src/androidTest/assets/fullscreen_checked_checkbox.png
Binary files differ
diff --git a/test/screenshot/src/androidTest/assets/fullscreen_checked_checkbox_round.png b/test/screenshot/screenshot/src/androidTest/assets/fullscreen_checked_checkbox_round.png
similarity index 100%
rename from test/screenshot/src/androidTest/assets/fullscreen_checked_checkbox_round.png
rename to test/screenshot/screenshot/src/androidTest/assets/fullscreen_checked_checkbox_round.png
Binary files differ
diff --git a/test/screenshot/src/androidTest/assets/fullscreen_rect_gray.png b/test/screenshot/screenshot/src/androidTest/assets/fullscreen_rect_gray.png
similarity index 100%
rename from test/screenshot/src/androidTest/assets/fullscreen_rect_gray.png
rename to test/screenshot/screenshot/src/androidTest/assets/fullscreen_rect_gray.png
Binary files differ
diff --git a/test/screenshot/src/androidTest/assets/fullscreen_rect_gray_dark.png b/test/screenshot/screenshot/src/androidTest/assets/fullscreen_rect_gray_dark.png
similarity index 100%
rename from test/screenshot/src/androidTest/assets/fullscreen_rect_gray_dark.png
rename to test/screenshot/screenshot/src/androidTest/assets/fullscreen_rect_gray_dark.png
Binary files differ
diff --git a/test/screenshot/src/androidTest/assets/fullscreen_rect_gray_moved_1px.png b/test/screenshot/screenshot/src/androidTest/assets/fullscreen_rect_gray_moved_1px.png
similarity index 100%
rename from test/screenshot/src/androidTest/assets/fullscreen_rect_gray_moved_1px.png
rename to test/screenshot/screenshot/src/androidTest/assets/fullscreen_rect_gray_moved_1px.png
Binary files differ
diff --git a/test/screenshot/src/androidTest/assets/round_rect_gray.png b/test/screenshot/screenshot/src/androidTest/assets/round_rect_gray.png
similarity index 100%
rename from test/screenshot/src/androidTest/assets/round_rect_gray.png
rename to test/screenshot/screenshot/src/androidTest/assets/round_rect_gray.png
Binary files differ
diff --git a/test/screenshot/src/androidTest/assets/round_rect_gray_dark.png b/test/screenshot/screenshot/src/androidTest/assets/round_rect_gray_dark.png
similarity index 100%
rename from test/screenshot/src/androidTest/assets/round_rect_gray_dark.png
rename to test/screenshot/screenshot/src/androidTest/assets/round_rect_gray_dark.png
Binary files differ
diff --git a/test/screenshot/src/androidTest/assets/round_rect_green.png b/test/screenshot/screenshot/src/androidTest/assets/round_rect_green.png
similarity index 100%
rename from test/screenshot/src/androidTest/assets/round_rect_green.png
rename to test/screenshot/screenshot/src/androidTest/assets/round_rect_green.png
Binary files differ
diff --git a/test/screenshot/src/androidTest/java/androidx/test/screenshot/MSSIMMatcherTest.kt b/test/screenshot/screenshot/src/androidTest/java/androidx/test/screenshot/MSSIMMatcherTest.kt
similarity index 100%
rename from test/screenshot/src/androidTest/java/androidx/test/screenshot/MSSIMMatcherTest.kt
rename to test/screenshot/screenshot/src/androidTest/java/androidx/test/screenshot/MSSIMMatcherTest.kt
diff --git a/test/screenshot/src/androidTest/java/androidx/test/screenshot/PixelPerfectMatcherTest.kt b/test/screenshot/screenshot/src/androidTest/java/androidx/test/screenshot/PixelPerfectMatcherTest.kt
similarity index 100%
rename from test/screenshot/src/androidTest/java/androidx/test/screenshot/PixelPerfectMatcherTest.kt
rename to test/screenshot/screenshot/src/androidTest/java/androidx/test/screenshot/PixelPerfectMatcherTest.kt
diff --git a/test/screenshot/src/androidTest/java/androidx/test/screenshot/ScreenshotTestRuleTest.kt b/test/screenshot/screenshot/src/androidTest/java/androidx/test/screenshot/ScreenshotTestRuleTest.kt
similarity index 100%
rename from test/screenshot/src/androidTest/java/androidx/test/screenshot/ScreenshotTestRuleTest.kt
rename to test/screenshot/screenshot/src/androidTest/java/androidx/test/screenshot/ScreenshotTestRuleTest.kt
diff --git a/test/screenshot/src/androidTest/java/androidx/test/screenshot/utils/BitmapUtils.kt b/test/screenshot/screenshot/src/androidTest/java/androidx/test/screenshot/utils/BitmapUtils.kt
similarity index 100%
rename from test/screenshot/src/androidTest/java/androidx/test/screenshot/utils/BitmapUtils.kt
rename to test/screenshot/screenshot/src/androidTest/java/androidx/test/screenshot/utils/BitmapUtils.kt
diff --git a/test/screenshot/src/main/AndroidManifest.xml b/test/screenshot/screenshot/src/main/AndroidManifest.xml
similarity index 100%
rename from test/screenshot/src/main/AndroidManifest.xml
rename to test/screenshot/screenshot/src/main/AndroidManifest.xml
diff --git a/test/screenshot/src/main/java/androidx/test/screenshot/AndroidXScreenshotTestRule.kt b/test/screenshot/screenshot/src/main/java/androidx/test/screenshot/AndroidXScreenshotTestRule.kt
similarity index 100%
rename from test/screenshot/src/main/java/androidx/test/screenshot/AndroidXScreenshotTestRule.kt
rename to test/screenshot/screenshot/src/main/java/androidx/test/screenshot/AndroidXScreenshotTestRule.kt
diff --git a/test/screenshot/src/main/java/androidx/test/screenshot/ScreenshotTestRule.kt b/test/screenshot/screenshot/src/main/java/androidx/test/screenshot/ScreenshotTestRule.kt
similarity index 100%
rename from test/screenshot/src/main/java/androidx/test/screenshot/ScreenshotTestRule.kt
rename to test/screenshot/screenshot/src/main/java/androidx/test/screenshot/ScreenshotTestRule.kt
diff --git a/test/screenshot/src/main/java/androidx/test/screenshot/matchers/BitmapMatcher.kt b/test/screenshot/screenshot/src/main/java/androidx/test/screenshot/matchers/BitmapMatcher.kt
similarity index 100%
rename from test/screenshot/src/main/java/androidx/test/screenshot/matchers/BitmapMatcher.kt
rename to test/screenshot/screenshot/src/main/java/androidx/test/screenshot/matchers/BitmapMatcher.kt
diff --git a/test/screenshot/src/main/java/androidx/test/screenshot/matchers/MSSIMMatcher.kt b/test/screenshot/screenshot/src/main/java/androidx/test/screenshot/matchers/MSSIMMatcher.kt
similarity index 100%
rename from test/screenshot/src/main/java/androidx/test/screenshot/matchers/MSSIMMatcher.kt
rename to test/screenshot/screenshot/src/main/java/androidx/test/screenshot/matchers/MSSIMMatcher.kt
diff --git a/test/screenshot/src/main/java/androidx/test/screenshot/matchers/PixelPerfectMatcher.kt b/test/screenshot/screenshot/src/main/java/androidx/test/screenshot/matchers/PixelPerfectMatcher.kt
similarity index 100%
rename from test/screenshot/src/main/java/androidx/test/screenshot/matchers/PixelPerfectMatcher.kt
rename to test/screenshot/screenshot/src/main/java/androidx/test/screenshot/matchers/PixelPerfectMatcher.kt
diff --git a/testutils/testutils-common/build.gradle b/testutils/testutils-common/build.gradle
index bea9428..dccc2a9 100644
--- a/testutils/testutils-common/build.gradle
+++ b/testutils/testutils-common/build.gradle
@@ -1,3 +1,5 @@
+import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
+
/*
* Copyright 2018 The Android Open Source Project
*
@@ -21,4 +23,12 @@
dependencies {
implementation(libs.kotlinStdlib)
+ implementation(libs.kotlinCoroutinesAndroid)
+}
+
+// Allow usage of Kotlin's @OptIn.
+tasks.withType(KotlinCompile).configureEach {
+ kotlinOptions {
+ freeCompilerArgs += ["-Xopt-in=kotlin.RequiresOptIn"]
+ }
}
diff --git a/testutils/testutils-common/src/main/java/androidx/testutils/FilteringExecutor.kt b/testutils/testutils-common/src/main/java/androidx/testutils/FilteringExecutor.kt
new file mode 100644
index 0000000..5f37afc
--- /dev/null
+++ b/testutils/testutils-common/src/main/java/androidx/testutils/FilteringExecutor.kt
@@ -0,0 +1,98 @@
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * 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.
+ */
+package androidx.testutils
+
+import kotlinx.coroutines.ExperimentalCoroutinesApi
+import kotlinx.coroutines.flow.MutableStateFlow
+import kotlinx.coroutines.flow.first
+import kotlinx.coroutines.flow.mapLatest
+import java.util.concurrent.Executor
+import java.util.concurrent.Executors
+import java.util.concurrent.TimeUnit
+import java.util.concurrent.locks.ReentrantLock
+import kotlin.concurrent.withLock
+import kotlinx.coroutines.withTimeout
+
+/**
+ * An executor that can block some known runnables. We use it to slow down database
+ * invalidation events.
+ */
+@OptIn(ExperimentalCoroutinesApi::class)
+class FilteringExecutor : Executor {
+ private val delegate = Executors.newSingleThreadExecutor()
+ private val deferred = mutableListOf<Runnable>()
+ private val deferredSize = MutableStateFlow(0)
+ private val lock = ReentrantLock()
+
+ var filterFunction: (Runnable) -> Boolean = { true }
+ set(value) {
+ field = value
+ reEnqueueDeferred()
+ }
+
+ suspend fun awaitDeferredSizeAtLeast(min: Int) = withTestTimeout {
+ deferredSize.mapLatest {
+ it >= min
+ }.first()
+ }
+
+ private fun reEnqueueDeferred() {
+ val copy = lock.withLock {
+ val copy = deferred.toMutableList()
+ deferred.clear()
+ deferredSize.value = 0
+ copy
+ }
+ copy.forEach(this::execute)
+ }
+
+ fun deferredSize(): Int {
+ return deferred.size
+ }
+
+ fun executeAll() {
+ while (deferred.isNotEmpty()) {
+ deferred.removeFirst().run()
+ }
+ }
+
+ fun executeLatestDeferred() {
+ deferred.removeLast().run()
+ }
+
+ override fun execute(command: Runnable) {
+ lock.withLock {
+ if (filterFunction(command)) {
+ delegate.execute(command)
+ } else {
+ deferred.add(command)
+ deferredSize.value += 1
+ }
+ }
+ }
+}
+
+suspend fun <T> withTestTimeout(block: suspend () -> T): T {
+ try {
+ return withTimeout(
+ timeMillis = TimeUnit.SECONDS.toMillis(3)
+ ) {
+ block()
+ }
+ } catch (err: Throwable) {
+ throw AssertionError("didn't complete in expected time", err)
+ }
+}
diff --git a/testutils/testutils-macrobenchmark/build.gradle b/testutils/testutils-macrobenchmark/build.gradle
index c4a95da..51aa39d 100644
--- a/testutils/testutils-macrobenchmark/build.gradle
+++ b/testutils/testutils-macrobenchmark/build.gradle
@@ -29,6 +29,6 @@
android {
defaultConfig {
- minSdkVersion 18
+ minSdkVersion 21
}
}
diff --git a/textclassifier/textclassifier/src/androidTest/java/androidx/textclassifier/BlockingReceiver.java b/textclassifier/textclassifier/src/androidTest/java/androidx/textclassifier/BlockingReceiver.java
index e36874f..5320e2a 100644
--- a/textclassifier/textclassifier/src/androidTest/java/androidx/textclassifier/BlockingReceiver.java
+++ b/textclassifier/textclassifier/src/androidTest/java/androidx/textclassifier/BlockingReceiver.java
@@ -48,7 +48,8 @@
private BlockingReceiver(Context context, String action) {
mContext = Preconditions.checkNotNull(context);
mExpectedAction = Preconditions.checkNotNull(action);
- mIntent = PendingIntent.getBroadcast(mContext, 0, new Intent(mExpectedAction), 0);
+ mIntent = PendingIntent.getBroadcast(mContext, 0, new Intent(mExpectedAction),
+ PendingIntent.FLAG_IMMUTABLE);
mLatch = new CountDownLatch(1);
}
diff --git a/textclassifier/textclassifier/src/androidTest/java/androidx/textclassifier/ConversationActionsTest.java b/textclassifier/textclassifier/src/androidTest/java/androidx/textclassifier/ConversationActionsTest.java
index f194df0..8ba7113 100644
--- a/textclassifier/textclassifier/src/androidTest/java/androidx/textclassifier/ConversationActionsTest.java
+++ b/textclassifier/textclassifier/src/androidTest/java/androidx/textclassifier/ConversationActionsTest.java
@@ -47,7 +47,8 @@
private static final Bundle EXTRAS = new Bundle();
private static final PendingIntent PENDING_INTENT = PendingIntent.getActivity(
- InstrumentationRegistry.getInstrumentation().getTargetContext(), 0, new Intent(), 0);
+ InstrumentationRegistry.getInstrumentation().getTargetContext(), 0, new Intent(),
+ PendingIntent.FLAG_IMMUTABLE);
private static final RemoteActionCompat REMOTE_ACTION = new RemoteActionCompat(
IconCompat.createWithData(new byte[0], 0, 0),
diff --git a/textclassifier/textclassifier/src/androidTest/java/androidx/textclassifier/LegacyTextClassifierTest.java b/textclassifier/textclassifier/src/androidTest/java/androidx/textclassifier/LegacyTextClassifierTest.java
index 3ebbd8c..93d11aa 100644
--- a/textclassifier/textclassifier/src/androidTest/java/androidx/textclassifier/LegacyTextClassifierTest.java
+++ b/textclassifier/textclassifier/src/androidTest/java/androidx/textclassifier/LegacyTextClassifierTest.java
@@ -69,7 +69,8 @@
@Before
public void setUp() {
mPendingIntent = PendingIntent.getActivity(
- ApplicationProvider.getApplicationContext(), 0, new Intent(), 0);
+ ApplicationProvider.getApplicationContext(), 0, new Intent(),
+ PendingIntent.FLAG_IMMUTABLE);
mMatchMaker = mock(MatchMaker.class);
when(mMatchMaker.getActions(anyString(), any(CharSequence.class)))
diff --git a/textclassifier/textclassifier/src/androidTest/java/androidx/textclassifier/TextClassificationTest.java b/textclassifier/textclassifier/src/androidTest/java/androidx/textclassifier/TextClassificationTest.java
index 0c302cf..c4f351e 100644
--- a/textclassifier/textclassifier/src/androidTest/java/androidx/textclassifier/TextClassificationTest.java
+++ b/textclassifier/textclassifier/src/androidTest/java/androidx/textclassifier/TextClassificationTest.java
@@ -342,6 +342,6 @@
}
private PendingIntent createPendingIntent(Intent intent) {
- return PendingIntent.getActivity(mContext, 0, intent, 0);
+ return PendingIntent.getActivity(mContext, 0, intent, PendingIntent.FLAG_IMMUTABLE);
}
}
diff --git a/textclassifier/textclassifier/src/androidTest/java/androidx/textclassifier/widget/ToolbarControllerTest.java b/textclassifier/textclassifier/src/androidTest/java/androidx/textclassifier/widget/ToolbarControllerTest.java
index ffa848e..b518258 100644
--- a/textclassifier/textclassifier/src/androidTest/java/androidx/textclassifier/widget/ToolbarControllerTest.java
+++ b/textclassifier/textclassifier/src/androidTest/java/androidx/textclassifier/widget/ToolbarControllerTest.java
@@ -102,7 +102,8 @@
mController = ToolbarController.getInstance(mTextView);
mAction = new RemoteActionCompat(
ICON, SMART_ACTION, "description",
- PendingIntent.getActivity(mTextView.getContext(), 0, new Intent(), 0));
+ PendingIntent.getActivity(mTextView.getContext(), 0, new Intent(),
+ PendingIntent.FLAG_IMMUTABLE));
mAction.setShouldShowIcon(false);
mMockActionMode = mock(ActionMode.class);
when(mMockActionMode.getType()).thenReturn(ActionMode.TYPE_FLOATING);
diff --git a/textclassifier/textclassifier/src/main/java/androidx/textclassifier/LegacyTextClassifier.java b/textclassifier/textclassifier/src/main/java/androidx/textclassifier/LegacyTextClassifier.java
index 7191aa1..adb2397 100644
--- a/textclassifier/textclassifier/src/main/java/androidx/textclassifier/LegacyTextClassifier.java
+++ b/textclassifier/textclassifier/src/main/java/androidx/textclassifier/LegacyTextClassifier.java
@@ -366,7 +366,7 @@
@Nullable
private PendingIntent createPendingIntent(Intent intent, int requestCode) {
final ResolveInfo resolveInfo = mPackageManager.resolveActivity(intent, 0);
- final int flags = PendingIntent.FLAG_UPDATE_CURRENT;
+ final int flags = PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_IMMUTABLE;
if (resolveInfo != null && resolveInfo.activityInfo != null
&& mPermissionsChecker.hasPermission(resolveInfo.activityInfo)) {
return PendingIntent.getActivity(mContext, requestCode, intent, flags);
diff --git a/textclassifier/textclassifier/src/main/res/values-te/strings.xml b/textclassifier/textclassifier/src/main/res/values-te/strings.xml
index 9e55cfd..618e468 100644
--- a/textclassifier/textclassifier/src/main/res/values-te/strings.xml
+++ b/textclassifier/textclassifier/src/main/res/values-te/strings.xml
@@ -17,13 +17,13 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="email" msgid="6099716515489216517">"ఇమెయిల్ పంపు"</string>
- <string name="email_desc" msgid="2189760120923982860">"ఎంచుకున్న చిరునామాకు ఇమెయిల్ను పంపుతుంది"</string>
+ <string name="email_desc" msgid="2189760120923982860">"ఎంచుకున్న అడ్రస్కు ఇమెయిల్ను పంపుతుంది"</string>
<string name="dial" msgid="2101464860090311277">"కాల్ చేయి"</string>
<string name="dial_desc" msgid="1195407206406821463">"ఎంచుకున్న ఫోన్ నంబర్కు కాల్ చేస్తుంది"</string>
<string name="browse" msgid="4753676368851695348">"తెరువు"</string>
<string name="browse_desc" msgid="728882176434276995">"ఎంచుకున్న URLని తెరుస్తుంది"</string>
- <string name="sms" msgid="2214738262605167054">"సందేశం పంపు"</string>
- <string name="sms_desc" msgid="7733202356868441148">"ఎంచుకున్న ఫోన్ నంబర్కి సందేశం పంపుతుంది"</string>
+ <string name="sms" msgid="2214738262605167054">"మెసేజ్ పంపు"</string>
+ <string name="sms_desc" msgid="7733202356868441148">"ఎంచుకున్న ఫోన్ నంబర్కి మెసేజ్ పంపుతుంది"</string>
<string name="add_contact" msgid="386263007484061034">"జోడించు"</string>
<string name="add_contact_desc" msgid="1739272501140197425">"పరిచయాలకు జోడిస్తుంది"</string>
<string name="floating_toolbar_open_overflow_description" msgid="6778458701858708647">"మరిన్ని ఆప్షన్లు"</string>
diff --git a/wear/benchmark/integration-tests/macrobenchmark-target/src/main/AndroidManifest.xml b/wear/benchmark/integration-tests/macrobenchmark-target/src/main/AndroidManifest.xml
index 0aaac14..e662e8c 100644
--- a/wear/benchmark/integration-tests/macrobenchmark-target/src/main/AndroidManifest.xml
+++ b/wear/benchmark/integration-tests/macrobenchmark-target/src/main/AndroidManifest.xml
@@ -28,7 +28,6 @@
tools:ignore="MissingApplicationIcon">
<!-- Profileable to enable macrobenchmark profiling -->
- <!--suppress AndroidElementNotAllowed -->
<profileable android:shell="true"/>
<!--
diff --git a/wear/compose/compose-foundation/api/current.txt b/wear/compose/compose-foundation/api/current.txt
index f5a6198..fb15cdf 100644
--- a/wear/compose/compose-foundation/api/current.txt
+++ b/wear/compose/compose-foundation/api/current.txt
@@ -14,7 +14,7 @@
property public final float Start;
}
- public final class ArcPaddingValues {
+ @androidx.compose.runtime.Stable public final class ArcPaddingValues {
ctor public ArcPaddingValues(float outer, float inner, float start, float end);
method public float getEnd();
method public float getInner();
@@ -24,6 +24,12 @@
property public final float inner;
property public final float outer;
property public final float start;
+ field public static final androidx.wear.compose.foundation.ArcPaddingValues.Companion Companion;
+ }
+
+ public static final class ArcPaddingValues.Companion {
+ method public androidx.wear.compose.foundation.ArcPaddingValues getZero();
+ property public final androidx.wear.compose.foundation.ArcPaddingValues Zero;
}
public final class BasicCurvedTextKt {
diff --git a/wear/compose/compose-foundation/api/public_plus_experimental_current.txt b/wear/compose/compose-foundation/api/public_plus_experimental_current.txt
index f5a6198..fb15cdf 100644
--- a/wear/compose/compose-foundation/api/public_plus_experimental_current.txt
+++ b/wear/compose/compose-foundation/api/public_plus_experimental_current.txt
@@ -14,7 +14,7 @@
property public final float Start;
}
- public final class ArcPaddingValues {
+ @androidx.compose.runtime.Stable public final class ArcPaddingValues {
ctor public ArcPaddingValues(float outer, float inner, float start, float end);
method public float getEnd();
method public float getInner();
@@ -24,6 +24,12 @@
property public final float inner;
property public final float outer;
property public final float start;
+ field public static final androidx.wear.compose.foundation.ArcPaddingValues.Companion Companion;
+ }
+
+ public static final class ArcPaddingValues.Companion {
+ method public androidx.wear.compose.foundation.ArcPaddingValues getZero();
+ property public final androidx.wear.compose.foundation.ArcPaddingValues Zero;
}
public final class BasicCurvedTextKt {
diff --git a/wear/compose/compose-foundation/api/restricted_current.txt b/wear/compose/compose-foundation/api/restricted_current.txt
index f5a6198..fb15cdf 100644
--- a/wear/compose/compose-foundation/api/restricted_current.txt
+++ b/wear/compose/compose-foundation/api/restricted_current.txt
@@ -14,7 +14,7 @@
property public final float Start;
}
- public final class ArcPaddingValues {
+ @androidx.compose.runtime.Stable public final class ArcPaddingValues {
ctor public ArcPaddingValues(float outer, float inner, float start, float end);
method public float getEnd();
method public float getInner();
@@ -24,6 +24,12 @@
property public final float inner;
property public final float outer;
property public final float start;
+ field public static final androidx.wear.compose.foundation.ArcPaddingValues.Companion Companion;
+ }
+
+ public static final class ArcPaddingValues.Companion {
+ method public androidx.wear.compose.foundation.ArcPaddingValues getZero();
+ property public final androidx.wear.compose.foundation.ArcPaddingValues Zero;
}
public final class BasicCurvedTextKt {
diff --git a/wear/compose/compose-foundation/src/commonMain/kotlin/androidx/wear/compose/foundation/BasicCurvedText.kt b/wear/compose/compose-foundation/src/commonMain/kotlin/androidx/wear/compose/foundation/BasicCurvedText.kt
index de23e7d..bcc5388 100644
--- a/wear/compose/compose-foundation/src/commonMain/kotlin/androidx/wear/compose/foundation/BasicCurvedText.kt
+++ b/wear/compose/compose-foundation/src/commonMain/kotlin/androidx/wear/compose/foundation/BasicCurvedText.kt
@@ -17,6 +17,7 @@
package androidx.wear.compose.foundation
import androidx.compose.runtime.Composable
+import androidx.compose.runtime.Stable
import androidx.compose.runtime.remember
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.drawBehind
@@ -51,6 +52,7 @@
* @param start Padding added at the start of the component.
* @param end Padding added at the end of the component.
*/
+@Stable
class ArcPaddingValues(val outer: Dp, val inner: Dp, val start: Dp, val end: Dp) {
override fun equals(other: Any?): Boolean {
return other is ArcPaddingValues &&
@@ -66,6 +68,14 @@
override fun toString(): String {
return "ArcPaddingValues(outer=$outer, inner=$inner, start=$start, end=$end)"
}
+
+ companion object {
+ /**
+ * An arc padding value with zero magnitude.
+ */
+ @Stable
+ val Zero = ArcPaddingValues(0.dp, 0.dp, 0.dp, 0.dp)
+ }
}
/**
diff --git a/wear/compose/compose-material/api/current.txt b/wear/compose/compose-material/api/current.txt
index 3edf5d9..afdb912 100644
--- a/wear/compose/compose-material/api/current.txt
+++ b/wear/compose/compose-material/api/current.txt
@@ -202,9 +202,13 @@
method public void items(int count, kotlin.jvm.functions.Function1<? super java.lang.Integer,kotlin.Unit> itemContent);
}
- @androidx.compose.runtime.Stable public final class ScalingLazyColumnState {
+ @androidx.compose.runtime.Stable public final class ScalingLazyColumnState implements androidx.compose.foundation.gestures.ScrollableState {
ctor public ScalingLazyColumnState();
+ method public float dispatchRawDelta(float delta);
method public androidx.wear.compose.material.ScalingLazyColumnLayoutInfo getLayoutInfo();
+ method public boolean isScrollInProgress();
+ method public suspend Object? scroll(androidx.compose.foundation.MutatePriority scrollPriority, kotlin.jvm.functions.Function2<? super androidx.compose.foundation.gestures.ScrollScope,? super kotlin.coroutines.Continuation<? super kotlin.Unit>,?> block, kotlin.coroutines.Continuation<? super kotlin.Unit> p);
+ property public boolean isScrollInProgress;
property public final androidx.wear.compose.material.ScalingLazyColumnLayoutInfo layoutInfo;
field public static final androidx.wear.compose.material.ScalingLazyColumnState.Companion Companion;
}
diff --git a/wear/compose/compose-material/api/public_plus_experimental_current.txt b/wear/compose/compose-material/api/public_plus_experimental_current.txt
index 93fd282..4ad3204 100644
--- a/wear/compose/compose-material/api/public_plus_experimental_current.txt
+++ b/wear/compose/compose-material/api/public_plus_experimental_current.txt
@@ -228,9 +228,13 @@
method public void items(int count, kotlin.jvm.functions.Function1<? super java.lang.Integer,kotlin.Unit> itemContent);
}
- @androidx.compose.runtime.Stable public final class ScalingLazyColumnState {
+ @androidx.compose.runtime.Stable public final class ScalingLazyColumnState implements androidx.compose.foundation.gestures.ScrollableState {
ctor public ScalingLazyColumnState();
+ method public float dispatchRawDelta(float delta);
method public androidx.wear.compose.material.ScalingLazyColumnLayoutInfo getLayoutInfo();
+ method public boolean isScrollInProgress();
+ method public suspend Object? scroll(androidx.compose.foundation.MutatePriority scrollPriority, kotlin.jvm.functions.Function2<? super androidx.compose.foundation.gestures.ScrollScope,? super kotlin.coroutines.Continuation<? super kotlin.Unit>,?> block, kotlin.coroutines.Continuation<? super kotlin.Unit> p);
+ property public boolean isScrollInProgress;
property public final androidx.wear.compose.material.ScalingLazyColumnLayoutInfo layoutInfo;
field public static final androidx.wear.compose.material.ScalingLazyColumnState.Companion Companion;
}
diff --git a/wear/compose/compose-material/api/restricted_current.txt b/wear/compose/compose-material/api/restricted_current.txt
index 3edf5d9..afdb912 100644
--- a/wear/compose/compose-material/api/restricted_current.txt
+++ b/wear/compose/compose-material/api/restricted_current.txt
@@ -202,9 +202,13 @@
method public void items(int count, kotlin.jvm.functions.Function1<? super java.lang.Integer,kotlin.Unit> itemContent);
}
- @androidx.compose.runtime.Stable public final class ScalingLazyColumnState {
+ @androidx.compose.runtime.Stable public final class ScalingLazyColumnState implements androidx.compose.foundation.gestures.ScrollableState {
ctor public ScalingLazyColumnState();
+ method public float dispatchRawDelta(float delta);
method public androidx.wear.compose.material.ScalingLazyColumnLayoutInfo getLayoutInfo();
+ method public boolean isScrollInProgress();
+ method public suspend Object? scroll(androidx.compose.foundation.MutatePriority scrollPriority, kotlin.jvm.functions.Function2<? super androidx.compose.foundation.gestures.ScrollScope,? super kotlin.coroutines.Continuation<? super kotlin.Unit>,?> block, kotlin.coroutines.Continuation<? super kotlin.Unit> p);
+ property public boolean isScrollInProgress;
property public final androidx.wear.compose.material.ScalingLazyColumnLayoutInfo layoutInfo;
field public static final androidx.wear.compose.material.ScalingLazyColumnState.Companion Companion;
}
diff --git a/wear/compose/compose-material/benchmark/src/androidTest/AndroidManifest.xml b/wear/compose/compose-material/benchmark/src/androidTest/AndroidManifest.xml
index aa65e87..2615d48 100644
--- a/wear/compose/compose-material/benchmark/src/androidTest/AndroidManifest.xml
+++ b/wear/compose/compose-material/benchmark/src/androidTest/AndroidManifest.xml
@@ -14,19 +14,4 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:tools="http://schemas.android.com/tools"
- package="androidx.wear.compose.material.benchmark">
-
- <!--
- Important: disable debugging for accurate performance results
-
- In a com.android.library project, this flag must be disabled from this
- manifest, as it is not possible to override this flag from Gradle.
- -->
- <application
- android:debuggable="false"
- tools:ignore="HardcodedDebugMode"
- tools:replace="android:debuggable" />
-</manifest>
\ No newline at end of file
+<manifest package="androidx.wear.compose.material.benchmark"/>
\ No newline at end of file
diff --git a/wear/compose/compose-material/build.gradle b/wear/compose/compose-material/build.gradle
index 48477c7..190e39f 100644
--- a/wear/compose/compose-material/build.gradle
+++ b/wear/compose/compose-material/build.gradle
@@ -44,7 +44,7 @@
androidTestImplementation project(path: ':compose:ui:ui-test')
androidTestImplementation project(path: ':compose:ui:ui-test-junit4')
androidTestImplementation project(path: ':compose:test-utils')
- androidTestImplementation project(":test:screenshot:test-screenshot")
+ androidTestImplementation project(":test:screenshot:screenshot")
androidTestImplementation(libs.testRunner)
androidTestImplementation(libs.truth)
}
@@ -95,7 +95,7 @@
implementation(project(path: ':compose:ui:ui-test'))
implementation(project(path: ':compose:ui:ui-test-junit4'))
implementation(project(path: ':compose:test-utils'))
- implementation(project(":test:screenshot:test-screenshot"))
+ implementation(project(":test:screenshot:screenshot"))
}
}
}
diff --git a/wear/compose/compose-material/src/androidAndroidTest/kotlin/androidx/wear/compose/material/ScalingLazyColumnLayoutInfoTest.kt b/wear/compose/compose-material/src/androidAndroidTest/kotlin/androidx/wear/compose/material/ScalingLazyColumnLayoutInfoTest.kt
index d6a00f6..2ca3094 100644
--- a/wear/compose/compose-material/src/androidAndroidTest/kotlin/androidx/wear/compose/material/ScalingLazyColumnLayoutInfoTest.kt
+++ b/wear/compose/compose-material/src/androidAndroidTest/kotlin/androidx/wear/compose/material/ScalingLazyColumnLayoutInfoTest.kt
@@ -16,13 +16,17 @@
package androidx.wear.compose.material
+import androidx.compose.foundation.gestures.animateScrollBy
+import androidx.compose.foundation.gestures.scrollBy
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.requiredSize
import androidx.compose.runtime.Composable
+import androidx.compose.runtime.Stable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
+import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier
import androidx.compose.ui.test.junit4.createComposeRule
@@ -35,6 +39,9 @@
import org.junit.Test
import org.junit.runner.RunWith
import com.google.common.truth.Truth.assertThat
+import kotlinx.coroutines.CoroutineScope
+import kotlinx.coroutines.launch
+import kotlinx.coroutines.runBlocking
import kotlin.math.roundToInt
@MediumTest
@@ -78,6 +85,30 @@
}
@Test
+ fun visibleItemsAreCorrectAfterScrolling() {
+ lateinit var state: ScalingLazyColumnState
+ rule.setContent {
+ ScalingLazyColumn(
+ state = rememberScalingLazyColumnState().also { state = it },
+ modifier = Modifier.requiredSize(
+ itemSizeDp * 3.5f + defaultItemSpacingDp * 2.5f
+ ),
+ ) {
+ items(5) {
+ Box(Modifier.requiredSize(itemSizeDp))
+ }
+ }
+ }
+
+ rule.runOnIdle {
+ runBlocking {
+ state.scrollBy(itemSizePx.toFloat() + defaultItemSpacingPx.toFloat())
+ }
+ state.layoutInfo.assertVisibleItems(count = 4, startIndex = 1)
+ }
+ }
+
+ @Test
fun visibleItemsAreCorrectNoScaling() {
lateinit var state: ScalingLazyColumnState
rule.setContent {
@@ -101,6 +132,74 @@
}
@Test
+ fun visibleItemsAreCorrectAfterScrollNoScaling() {
+ lateinit var state: ScalingLazyColumnState
+ rule.setContent {
+ ScalingLazyColumn(
+ state = rememberScalingLazyColumnState().also { state = it },
+ modifier = Modifier.requiredSize(
+ itemSizeDp * 3.5f + defaultItemSpacingDp * 2.5f
+ ),
+ scalingParams = ScalingLazyColumnDefaults.scalingParams(1.0f, 1.0f)
+ ) {
+ items(5) {
+ Box(Modifier.requiredSize(itemSizeDp))
+ }
+ }
+ }
+
+ rule.runOnIdle {
+ runBlocking {
+ state.scrollBy(itemSizePx.toFloat() + defaultItemSpacingPx.toFloat())
+ }
+ state.layoutInfo.assertVisibleItems(count = 4, startIndex = 1)
+ assertThat(state.layoutInfo.visibleItemsInfo.first().offset).isEqualTo(0)
+ }
+
+ rule.runOnIdle {
+ runBlocking {
+ state.scrollBy(-(itemSizePx.toFloat() + defaultItemSpacingPx.toFloat()))
+ }
+ state.layoutInfo.assertVisibleItems(count = 4, startIndex = 0)
+ assertThat(state.layoutInfo.visibleItemsInfo.first().offset).isEqualTo(0)
+ }
+ }
+
+ @Test
+ fun visibleItemsAreCorrectAfterDispatchRawDeltaScrollNoScaling() {
+ lateinit var state: ScalingLazyColumnState
+ rule.setContent {
+ ScalingLazyColumn(
+ state = rememberScalingLazyColumnState().also { state = it },
+ modifier = Modifier.requiredSize(
+ itemSizeDp * 3.5f + defaultItemSpacingDp * 2.5f
+ ),
+ scalingParams = ScalingLazyColumnDefaults.scalingParams(1.0f, 1.0f)
+ ) {
+ items(5) {
+ Box(Modifier.requiredSize(itemSizeDp))
+ }
+ }
+ }
+
+ rule.runOnIdle {
+ runBlocking {
+ state.dispatchRawDelta(itemSizePx.toFloat() + defaultItemSpacingPx.toFloat())
+ }
+ state.layoutInfo.assertVisibleItems(count = 4, startIndex = 1)
+ assertThat(state.layoutInfo.visibleItemsInfo.first().offset).isEqualTo(0)
+ }
+
+ rule.runOnIdle {
+ runBlocking {
+ state.dispatchRawDelta(-(itemSizePx.toFloat() + defaultItemSpacingPx.toFloat()))
+ }
+ state.layoutInfo.assertVisibleItems(count = 4, startIndex = 0)
+ assertThat(state.layoutInfo.visibleItemsInfo.first().offset).isEqualTo(0)
+ }
+ }
+
+ @Test
fun visibleItemsAreCorrectWithCustomSpacing() {
lateinit var state: ScalingLazyColumnState
val spacing: Dp = 10.dp
@@ -127,6 +226,115 @@
}
}
+ @Composable
+ fun ObservingFun(
+ state: ScalingLazyColumnState,
+ currentInfo: StableRef<ScalingLazyColumnLayoutInfo?>
+ ) {
+ currentInfo.value = state.layoutInfo
+ }
+
+ @Test
+ fun visibleItemsAreObservableWhenWeScroll() {
+ lateinit var state: ScalingLazyColumnState
+ val currentInfo = StableRef<ScalingLazyColumnLayoutInfo?>(null)
+ rule.setContent {
+ ScalingLazyColumn(
+ state = rememberScalingLazyColumnState().also { state = it },
+ modifier = Modifier.requiredSize(itemSizeDp * 3.5f + defaultItemSpacingDp * 2.5f)
+ ) {
+ items(6) {
+ Box(Modifier.requiredSize(itemSizeDp))
+ }
+ }
+ ObservingFun(state, currentInfo)
+ }
+
+ rule.runOnIdle {
+ // empty it here and scrolling should invoke observingFun again
+ currentInfo.value = null
+ runBlocking {
+ state.scrollBy(itemSizePx.toFloat() + defaultItemSpacingPx.toFloat())
+ }
+ }
+
+ rule.runOnIdle {
+ assertThat(currentInfo.value).isNotNull()
+ currentInfo.value!!.assertVisibleItems(count = 4, startIndex = 1)
+ }
+ }
+
+ @Test
+ fun visibleItemsAreObservableWhenWeDispatchRawDeltaScroll() {
+ lateinit var state: ScalingLazyColumnState
+ val currentInfo = StableRef<ScalingLazyColumnLayoutInfo?>(null)
+ rule.setContent {
+ ScalingLazyColumn(
+ state = rememberScalingLazyColumnState().also { state = it },
+ modifier = Modifier.requiredSize(itemSizeDp * 3.5f + defaultItemSpacingDp * 2.5f)
+ ) {
+ items(6) {
+ Box(Modifier.requiredSize(itemSizeDp))
+ }
+ }
+ ObservingFun(state, currentInfo)
+ }
+
+ rule.runOnIdle {
+ // empty it here and scrolling should invoke observingFun again
+ currentInfo.value = null
+ runBlocking {
+ state.dispatchRawDelta(itemSizePx.toFloat() + defaultItemSpacingPx.toFloat())
+ }
+ }
+
+ rule.runOnIdle {
+ assertThat(currentInfo.value).isNotNull()
+ currentInfo.value!!.assertVisibleItems(count = 4, startIndex = 1)
+ }
+ }
+
+ @Composable
+ fun ObservingIsScrollInProgressTrueFun(
+ state: ScalingLazyColumnState,
+ currentInfo: StableRef<Boolean?>
+ ) {
+ // If isScrollInProgress is ever true record it - otherwise leave the value as null
+ if (state.isScrollInProgress) {
+ currentInfo.value = true
+ }
+ }
+
+ @Test
+ fun isScrollInProgressIsObservableWhenWeScroll() {
+ lateinit var state: ScalingLazyColumnState
+ var scope: CoroutineScope? = null
+ val currentInfo = StableRef<Boolean?>(null)
+ rule.setContent {
+ scope = rememberCoroutineScope()
+ ScalingLazyColumn(
+ state = rememberScalingLazyColumnState().also { state = it },
+ modifier = Modifier.requiredSize(itemSizeDp * 3.5f + defaultItemSpacingDp * 2.5f)
+ ) {
+ items(6) {
+ Box(Modifier.requiredSize(itemSizeDp))
+ }
+ }
+ ObservingIsScrollInProgressTrueFun(state, currentInfo)
+ }
+
+ scope!!.launch {
+ // empty it here and scrolling should invoke observingFun again
+ currentInfo.value = null
+ state.animateScrollBy(itemSizePx.toFloat() + defaultItemSpacingPx.toFloat())
+ }
+
+ rule.runOnIdle {
+ assertThat(currentInfo.value).isNotNull()
+ assertThat(currentInfo.value).isTrue()
+ }
+ }
+
@Test
fun visibleItemsAreObservableWhenResize() {
lateinit var state: ScalingLazyColumnState
@@ -252,4 +460,7 @@
previousEndOffset = it.offset + it.size
}
}
-}
\ No newline at end of file
+}
+
+@Stable
+class StableRef<T>(var value: T)
\ No newline at end of file
diff --git a/wear/compose/compose-material/src/commonMain/kotlin/androidx/wear/compose/material/ScalingLazyColumnState.kt b/wear/compose/compose-material/src/commonMain/kotlin/androidx/wear/compose/material/ScalingLazyColumnState.kt
index c5bce6d..6414ad6 100644
--- a/wear/compose/compose-material/src/commonMain/kotlin/androidx/wear/compose/material/ScalingLazyColumnState.kt
+++ b/wear/compose/compose-material/src/commonMain/kotlin/androidx/wear/compose/material/ScalingLazyColumnState.kt
@@ -16,6 +16,9 @@
package androidx.wear.compose.material
+import androidx.compose.foundation.MutatePriority
+import androidx.compose.foundation.gestures.ScrollScope
+import androidx.compose.foundation.gestures.ScrollableState
import androidx.compose.foundation.lazy.LazyListItemInfo
import androidx.compose.foundation.lazy.LazyListState
import androidx.compose.runtime.Composable
@@ -44,7 +47,7 @@
* In most cases, this will be created via [rememberScalingLazyColumnState].
*/
@Stable
-public class ScalingLazyColumnState {
+public class ScalingLazyColumnState : ScrollableState {
internal var lazyListState: LazyListState = LazyListState(0, 0)
internal val extraPaddingInPixels = mutableStateOf<Int?>(null)
@@ -185,6 +188,22 @@
}
)
}
+
+ override val isScrollInProgress: Boolean
+ get() {
+ return lazyListState.isScrollInProgress
+ }
+
+ override fun dispatchRawDelta(delta: Float): Float {
+ return lazyListState.dispatchRawDelta(delta)
+ }
+
+ override suspend fun scroll(
+ scrollPriority: MutatePriority,
+ block: suspend ScrollScope.() -> Unit
+ ) {
+ lazyListState.scroll(scrollPriority = scrollPriority, block = block)
+ }
}
private object EmptyScalingLazyColumnLayoutInfo : ScalingLazyColumnLayoutInfo {
diff --git a/wear/compose/integration-tests/macrobenchmark-target/src/main/AndroidManifest.xml b/wear/compose/integration-tests/macrobenchmark-target/src/main/AndroidManifest.xml
index 3c45bb0..7f488b1 100644
--- a/wear/compose/integration-tests/macrobenchmark-target/src/main/AndroidManifest.xml
+++ b/wear/compose/integration-tests/macrobenchmark-target/src/main/AndroidManifest.xml
@@ -28,7 +28,6 @@
tools:ignore="MissingApplicationIcon">
<!-- Profileable to enable macrobenchmark profiling -->
- <!--suppress AndroidElementNotAllowed -->
<profileable android:shell="true"/>
<!--
diff --git a/wear/tiles/tiles-renderer/build.gradle b/wear/tiles/tiles-renderer/build.gradle
index 8295d1d..8f43527 100644
--- a/wear/tiles/tiles-renderer/build.gradle
+++ b/wear/tiles/tiles-renderer/build.gradle
@@ -41,8 +41,8 @@
implementation(libs.kotlinCoroutinesCore)
implementation(libs.kotlinCoroutinesAndroid)
- androidTestImplementation(project(path: ":wear:tiles:tiles-proto", configuration: "shadow"))
- androidTestImplementation(project(":test:screenshot:test-screenshot"))
+ androidTestImplementation(project(path: ":wear:tiles:tiles-proto"))
+ androidTestImplementation(project(":test:screenshot:screenshot"))
androidTestImplementation(libs.testExtJunit)
androidTestImplementation(libs.testCore)
androidTestImplementation(libs.testRunner)
diff --git a/wear/tiles/tiles-renderer/src/androidTest/java/androidx/wear/tiles/renderer/test/TileRendererGoldenTest.java b/wear/tiles/tiles-renderer/src/androidTest/java/androidx/wear/tiles/renderer/test/TileRendererGoldenTest.java
index 433bec7..e3c0260 100644
--- a/wear/tiles/tiles-renderer/src/androidTest/java/androidx/wear/tiles/renderer/test/TileRendererGoldenTest.java
+++ b/wear/tiles/tiles-renderer/src/androidTest/java/androidx/wear/tiles/renderer/test/TileRendererGoldenTest.java
@@ -93,6 +93,7 @@
{"line_in_arc"},
{"line_multi_height"},
{"long_text"},
+ {"mixed_language_text"},
{"multi_line_text_alignment"},
{"row_column_space_test"},
{"row_with_alignment"},
diff --git a/wear/tiles/tiles-renderer/src/androidTest/res/raw/mixed_language_text.textproto b/wear/tiles/tiles-renderer/src/androidTest/res/raw/mixed_language_text.textproto
new file mode 100644
index 0000000..27891c3
--- /dev/null
+++ b/wear/tiles/tiles-renderer/src/androidTest/res/raw/mixed_language_text.textproto
@@ -0,0 +1,73 @@
+box {
+ modifiers {
+ background {
+ color {
+ argb: 0xFF000000
+ }
+ }
+ }
+ width {
+ expanded_dimension: {}
+ }
+ height {
+ expanded_dimension: {}
+ }
+ vertical_alignment {
+ value: VERTICAL_ALIGN_CENTER
+ }
+ horizontal_alignment {
+ value: HORIZONTAL_ALIGN_CENTER
+ }
+ contents {
+ column {
+ horizontal_alignment {
+ value: HORIZONTAL_ALIGN_LEFT
+ }
+ contents {
+ text {
+ text {
+ value: "Latin Only"
+ }
+ font_style {
+ size { value: 16 }
+ underline { value: true }
+ }
+ }
+ }
+ contents {
+ text {
+ text {
+ value: "Underline 안녕하세요"
+ }
+ font_style {
+ size { value: 16 }
+ underline { value: true }
+ }
+ }
+ }
+ contents {
+ text {
+ text {
+ value: "Italic 안녕하세요"
+ }
+ font_style {
+ size { value: 16 }
+ italic { value: true }
+ }
+ }
+ }
+ contents {
+ text {
+ text {
+ value: "Italic Underline 안녕하세요"
+ }
+ font_style {
+ size { value: 16 }
+ italic { value: true }
+ underline { value: true }
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/wear/tiles/tiles-renderer/src/main/java/androidx/wear/tiles/connection/DefaultTileProviderClient.kt b/wear/tiles/tiles-renderer/src/main/java/androidx/wear/tiles/connection/DefaultTileProviderClient.kt
index f71495f..4290e82 100644
--- a/wear/tiles/tiles-renderer/src/main/java/androidx/wear/tiles/connection/DefaultTileProviderClient.kt
+++ b/wear/tiles/tiles-renderer/src/main/java/androidx/wear/tiles/connection/DefaultTileProviderClient.kt
@@ -73,19 +73,19 @@
// These don't contain a useful payload right now, so just pre-build them.
private val TILE_ADD_EVENT = TileAddEventData(
- EventBuilders.TileAddEvent.builder().build().toProto().toByteArray(),
+ EventBuilders.TileAddEvent.Builder().build().toProto().toByteArray(),
TileAddEventData.VERSION_PROTOBUF
)
private val TILE_REMOVE_EVENT = TileRemoveEventData(
- EventBuilders.TileRemoveEvent.builder().build().toProto().toByteArray(),
+ EventBuilders.TileRemoveEvent.Builder().build().toProto().toByteArray(),
TileRemoveEventData.VERSION_PROTOBUF
)
private val TILE_ENTER_EVENT = TileEnterEventData(
- EventBuilders.TileEnterEvent.builder().build().toProto().toByteArray(),
+ EventBuilders.TileEnterEvent.Builder().build().toProto().toByteArray(),
TileEnterEventData.VERSION_PROTOBUF
)
private val TILE_LEAVE_EVENT = TileLeaveEventData(
- EventBuilders.TileLeaveEvent.builder().build().toProto().toByteArray(),
+ EventBuilders.TileLeaveEvent.Builder().build().toProto().toByteArray(),
TileLeaveEventData.VERSION_PROTOBUF
)
}
diff --git a/wear/tiles/tiles-renderer/src/main/java/androidx/wear/tiles/manager/TileUiClient.kt b/wear/tiles/tiles-renderer/src/main/java/androidx/wear/tiles/manager/TileUiClient.kt
index d78f2a3..5aa71ab 100644
--- a/wear/tiles/tiles-renderer/src/main/java/androidx/wear/tiles/manager/TileUiClient.kt
+++ b/wear/tiles/tiles-renderer/src/main/java/androidx/wear/tiles/manager/TileUiClient.kt
@@ -135,11 +135,11 @@
}
private suspend fun requestTile(
- state: StateBuilders.State = StateBuilders.State.builder().build()
+ state: StateBuilders.State = StateBuilders.State.Builder().build()
) = coroutineScope {
withContext(Dispatchers.Main) {
val tileRequest = RequestBuilders.TileRequest
- .builder()
+ .Builder()
.setState(state)
.setDeviceParameters(buildDeviceParameters())
.build()
@@ -150,7 +150,7 @@
tile.resourcesVersion != tileResources?.version
) {
val resourcesRequest = RequestBuilders.ResourcesRequest
- .builder()
+ .Builder()
.setVersion(tile.resourcesVersion)
.setDeviceParameters(buildDeviceParameters())
.build()
@@ -170,7 +170,7 @@
val localTimelineManager = TilesTimelineManager(
context.getSystemService(AlarmManager::class.java),
System::currentTimeMillis,
- tile.timeline ?: TimelineBuilders.Timeline.builder().build(),
+ tile.timeline ?: TimelineBuilders.Timeline.Builder().build(),
0,
ContextCompat.getMainExecutor(context),
{ _, layout -> updateContents(layout) }
@@ -212,7 +212,7 @@
private fun buildDeviceParameters(): DeviceParametersBuilders.DeviceParameters {
val displayMetrics: DisplayMetrics = context.resources.displayMetrics
val isScreenRound: Boolean = context.resources.configuration.isScreenRound
- return DeviceParametersBuilders.DeviceParameters.builder()
+ return DeviceParametersBuilders.DeviceParameters.Builder()
.setScreenWidthDp(Math.round(displayMetrics.widthPixels / displayMetrics.density))
.setScreenHeightDp(Math.round(displayMetrics.heightPixels / displayMetrics.density))
.setScreenDensity(displayMetrics.density)
diff --git a/wear/tiles/tiles-renderer/src/main/java/androidx/wear/tiles/renderer/internal/TileRendererInternal.java b/wear/tiles/tiles-renderer/src/main/java/androidx/wear/tiles/renderer/internal/TileRendererInternal.java
index b2a8c6c..647c94a 100644
--- a/wear/tiles/tiles-renderer/src/main/java/androidx/wear/tiles/renderer/internal/TileRendererInternal.java
+++ b/wear/tiles/tiles-renderer/src/main/java/androidx/wear/tiles/renderer/internal/TileRendererInternal.java
@@ -40,6 +40,7 @@
import android.text.Spanned;
import android.text.TextPaint;
import android.text.TextUtils.TruncateAt;
+import android.text.method.LinkMovementMethod;
import android.text.style.AbsoluteSizeSpan;
import android.text.style.ClickableSpan;
import android.text.style.ForegroundColorSpan;
@@ -59,6 +60,7 @@
import android.widget.ImageView;
import android.widget.ImageView.ScaleType;
import android.widget.LinearLayout;
+import android.widget.Scroller;
import android.widget.Space;
import android.widget.TextView;
@@ -537,22 +539,14 @@
}
private void applyFontStyle(FontStyle style, TextView textView) {
+ // Note: Underline must be applied as a Span to work correctly (as opposed to using
+ // TextPaint#setTextUnderline). This is applied in the caller instead.
+
// Need to supply typefaceStyle when creating the typeface (will select specialist
// bold/italic typefaces), *and* when setting the typeface (will set synthetic bold/italic
// flags in Paint if they're not supported by the given typeface).
textView.setTypeface(createTypeface(style), fontStyleToTypefaceStyle(style));
- int currentPaintFlags = textView.getPaintFlags();
-
- // Remove the bits we're setting
- currentPaintFlags &= ~Paint.UNDERLINE_TEXT_FLAG;
-
- if (style.hasUnderline() && style.getUnderline().getValue()) {
- currentPaintFlags |= Paint.UNDERLINE_TEXT_FLAG;
- }
-
- textView.setPaintFlags(currentPaintFlags);
-
if (style.hasSize()) {
textView.setTextSize(TypedValue.COMPLEX_UNIT_SP, style.getSize().getValue());
}
@@ -1024,7 +1018,18 @@
LayoutParams layoutParams = generateDefaultLayoutParams();
- textView.setText(text.getText().getValue());
+ // Underlines are applied using a Spannable here, rather than setting paint bits (or using
+ // Paint#setTextUnderline). When multiple fonts are mixed on the same line (especially when
+ // mixing anything with NotoSans-CJK), multiple underlines can appear. Using UnderlineSpan
+ // instead though causes the correct behaviour to happen (only a single underline).
+ SpannableStringBuilder ssb = new SpannableStringBuilder();
+ ssb.append(text.getText().getValue());
+
+ if (text.getFontStyle().getUnderline().getValue()) {
+ ssb.setSpan(new UnderlineSpan(), 0, ssb.length(), Spanned.SPAN_MARK_MARK);
+ }
+
+ textView.setText(ssb);
textView.setEllipsize(textTruncationToEllipsize(text.getOverflow()));
textView.setGravity(textAlignToAndroidGravity(text.getMultilineAlignment()));
@@ -1517,15 +1522,26 @@
SpannableStringBuilder builder = new SpannableStringBuilder();
+ boolean isAnySpanClickable = false;
for (Span element : spannable.getSpansList()) {
switch (element.getInnerCase()) {
case IMAGE:
SpanImage protoImage = element.getImage();
builder = inflateImageInSpannable(builder, protoImage, tv);
+
+ if (protoImage.getModifiers().hasClickable()) {
+ isAnySpanClickable = true;
+ }
+
break;
case TEXT:
SpanText protoText = element.getText();
builder = inflateTextInSpannable(builder, protoText);
+
+ if (protoText.getModifiers().hasClickable()) {
+ isAnySpanClickable = true;
+ }
+
break;
default:
Log.w(TAG, "Unknown Span child type.");
@@ -1568,8 +1584,23 @@
tv.setText(builder);
+ if (isAnySpanClickable) {
+ // For any ClickableSpans to work, the MovementMethod must be set to LinkMovementMethod.
+ tv.setMovementMethod(LinkMovementMethod.getInstance());
+
+ // Disable the highlight color; if we don't do this, the clicked span will get
+ // highlighted, which will be cleared half a second later if using LoadAction as the
+ // next layout will be delivered, which recreates the elements and clears the highlight.
+ tv.setHighlightColor(Color.TRANSPARENT);
+
+ // Use InhibitingScroller to prevent the text from scrolling when tapped. Setting a
+ // MovementMethod on a TextView (e.g. for clickables in a Spannable) then cause the
+ // TextView to be scrollable, and to jump to the end when tapped.
+ tv.setScroller(new InhibitingScroller(mUiContext));
+ }
+
View wrappedView = applyModifiers(tv, spannable.getModifiers());
- parent.addView(applyModifiers(tv, spannable.getModifiers()), layoutParams);
+ parent.addView(wrappedView, layoutParams);
return wrappedView;
}
@@ -1958,4 +1989,17 @@
}
}
}
+
+ /** Implementation of {@link Scroller} which inhibits all scrolling. */
+ private static class InhibitingScroller extends Scroller {
+ InhibitingScroller(Context context) {
+ super(context);
+ }
+
+ @Override
+ public void startScroll(int startX, int startY, int dx, int dy) {}
+
+ @Override
+ public void startScroll(int startX, int startY, int dx, int dy, int duration) {}
+ }
}
diff --git a/wear/tiles/tiles-renderer/src/test/java/androidx/wear/tiles/checkers/CheckAccessibilityAvailableTest.kt b/wear/tiles/tiles-renderer/src/test/java/androidx/wear/tiles/checkers/CheckAccessibilityAvailableTest.kt
index 3530cd9..c9c5a01 100644
--- a/wear/tiles/tiles-renderer/src/test/java/androidx/wear/tiles/checkers/CheckAccessibilityAvailableTest.kt
+++ b/wear/tiles/tiles-renderer/src/test/java/androidx/wear/tiles/checkers/CheckAccessibilityAvailableTest.kt
@@ -31,7 +31,7 @@
class CheckAccessibilityAvailableTest {
@Test
fun check_throwsWithNoSemantics() {
- val entry = buildTimelineEntry(Box.builder().build())
+ val entry = buildTimelineEntry(Box.Builder().build())
var exception: CheckerException? = null
@@ -47,13 +47,14 @@
@Test
fun check_doesntThrowIfSemanticsPresent() {
val entry = buildTimelineEntry(
- Box.builder()
+ Box.Builder()
.setModifiers(
- Modifiers.builder()
+ Modifiers.Builder()
.setSemantics(
- Semantics.builder()
+ Semantics.Builder()
.setContentDescription("Hello World")
- )
+ .build()
+ ).build()
).build()
)
@@ -71,16 +72,17 @@
@Test
fun check_doesntThrowIfSemanticsPresentOnNestedElement() {
val entry = buildTimelineEntry(
- Box.builder()
+ Box.Builder()
.addContent(
- Box.builder()
+ Box.Builder()
.setModifiers(
- Modifiers.builder()
+ Modifiers.Builder()
.setSemantics(
- Semantics.builder()
+ Semantics.Builder()
.setContentDescription("Hello World")
- )
- )
+ .build()
+ ).build()
+ ).build()
).build()
)
@@ -96,7 +98,7 @@
}
private fun buildTimelineEntry(layout: LayoutElement) =
- TimelineEntry.builder().setLayout(
- Layout.builder().setRoot(layout)
+ TimelineEntry.Builder().setLayout(
+ Layout.Builder().setRoot(layout).build()
).build()
}
diff --git a/wear/tiles/tiles-renderer/src/test/java/androidx/wear/tiles/checkers/TimelineCheckerTest.kt b/wear/tiles/tiles-renderer/src/test/java/androidx/wear/tiles/checkers/TimelineCheckerTest.kt
index c8d79d1..7389c34 100644
--- a/wear/tiles/tiles-renderer/src/test/java/androidx/wear/tiles/checkers/TimelineCheckerTest.kt
+++ b/wear/tiles/tiles-renderer/src/test/java/androidx/wear/tiles/checkers/TimelineCheckerTest.kt
@@ -94,17 +94,17 @@
}
private fun buildTimeline() =
- TimelineBuilders.Timeline.builder().addTimelineEntry(
- TimelineBuilders.TimelineEntry.builder().setLayout(
- LayoutElementBuilders.Layout.builder().setRoot(
- LayoutElementBuilders.Text.builder().setText("Hello")
- )
- )
+ TimelineBuilders.Timeline.Builder().addTimelineEntry(
+ TimelineBuilders.TimelineEntry.Builder().setLayout(
+ LayoutElementBuilders.Layout.Builder().setRoot(
+ LayoutElementBuilders.Text.Builder().setText("Hello").build()
+ ).build()
+ ).build()
).addTimelineEntry(
- TimelineBuilders.TimelineEntry.builder().setLayout(
- LayoutElementBuilders.Layout.builder().setRoot(
- LayoutElementBuilders.Text.builder().setText("World")
- )
- )
+ TimelineBuilders.TimelineEntry.Builder().setLayout(
+ LayoutElementBuilders.Layout.Builder().setRoot(
+ LayoutElementBuilders.Text.Builder().setText("World").build()
+ ).build()
+ ).build()
).build()
}
\ No newline at end of file
diff --git a/wear/tiles/tiles-renderer/src/test/java/androidx/wear/tiles/connection/DefaultTileProviderClientTest.kt b/wear/tiles/tiles-renderer/src/test/java/androidx/wear/tiles/connection/DefaultTileProviderClientTest.kt
index 159c2d0..b03a20c 100644
--- a/wear/tiles/tiles-renderer/src/test/java/androidx/wear/tiles/connection/DefaultTileProviderClientTest.kt
+++ b/wear/tiles/tiles-renderer/src/test/java/androidx/wear/tiles/connection/DefaultTileProviderClientTest.kt
@@ -95,11 +95,11 @@
@Test
public fun getTileContents_canGetTileContents(): Unit = fakeCoroutineScope.runBlockingTest {
- val expectedTile = TileBuilders.Tile.builder().setResourcesVersion("5").build()
+ val expectedTile = TileBuilders.Tile.Builder().setResourcesVersion("5").build()
fakeTileProvider.returnTile = expectedTile.toProto().toByteArray()
val result = async {
- clientUnderTest.requestTile(RequestBuilders.TileRequest.builder().build()).await()
+ clientUnderTest.requestTile(RequestBuilders.TileRequest.Builder().build()).await()
}
Shadows.shadowOf(Looper.getMainLooper()).idle()
@@ -114,7 +114,7 @@
fakeTileProvider.returnTile = byteArrayOf(127)
val result = async {
- clientUnderTest.requestTile(RequestBuilders.TileRequest.builder().build()).await()
+ clientUnderTest.requestTile(RequestBuilders.TileRequest.Builder().build()).await()
}
Shadows.shadowOf(Looper.getMainLooper()).idle()
@@ -132,7 +132,7 @@
fakeTileProvider.returnTileVersion = -1
val result = async {
- clientUnderTest.requestTile(RequestBuilders.TileRequest.builder().build()).await()
+ clientUnderTest.requestTile(RequestBuilders.TileRequest.Builder().build()).await()
}
Shadows.shadowOf(Looper.getMainLooper()).idle()
@@ -149,7 +149,7 @@
// This has to be dispatched on the correct dispatcher, so we can fully control its timing.
val result = async(fakeCoroutineDispatcher) {
- clientUnderTest.requestTile(RequestBuilders.TileRequest.builder().build()).await()
+ clientUnderTest.requestTile(RequestBuilders.TileRequest.Builder().build()).await()
}
Shadows.shadowOf(Looper.getMainLooper()).idle() // Ensure it actually binds...
@@ -167,12 +167,12 @@
@Test
public fun getResources_canGetResources(): Unit = fakeCoroutineScope.runBlockingTest {
- val expectedResources = ResourceBuilders.Resources.builder().setVersion("5").build()
+ val expectedResources = ResourceBuilders.Resources.Builder().setVersion("5").build()
fakeTileProvider.returnResources = expectedResources.toProto().toByteArray()
val result = async {
clientUnderTest.requestResources(
- RequestBuilders.ResourcesRequest.builder().build()
+ RequestBuilders.ResourcesRequest.Builder().build()
).await()
}
Shadows.shadowOf(Looper.getMainLooper()).idle()
@@ -186,7 +186,7 @@
val result = async {
clientUnderTest.requestResources(
- RequestBuilders.ResourcesRequest.builder().build()
+ RequestBuilders.ResourcesRequest.Builder().build()
).await()
}
Shadows.shadowOf(Looper.getMainLooper()).idle()
@@ -199,13 +199,13 @@
@Test
public fun getResources_failsIfVersionMismatch(): Unit = fakeCoroutineScope.runBlockingTest {
- val expectedResources = ResourceBuilders.Resources.builder().setVersion("5").build()
+ val expectedResources = ResourceBuilders.Resources.Builder().setVersion("5").build()
fakeTileProvider.returnResources = expectedResources.toProto().toByteArray()
fakeTileProvider.returnResourcesVersion = -2
val result = async {
clientUnderTest.requestResources(
- RequestBuilders.ResourcesRequest.builder().build()
+ RequestBuilders.ResourcesRequest.Builder().build()
).await()
}
Shadows.shadowOf(Looper.getMainLooper()).idle()
@@ -217,14 +217,14 @@
@Test
public fun getResources_failsOnTimeout(): Unit = fakeCoroutineScope.runBlockingTest {
- val expectedResources = ResourceBuilders.Resources.builder().setVersion("5").build()
+ val expectedResources = ResourceBuilders.Resources.Builder().setVersion("5").build()
fakeTileProvider.returnResources = expectedResources.toProto().toByteArray()
fakeTileProvider.shouldReturnResources = false
// This has to be dispatched on the correct dispatcher, so we can fully control its timing.
val result = async(fakeCoroutineDispatcher) {
clientUnderTest.requestResources(
- RequestBuilders.ResourcesRequest.builder().build()
+ RequestBuilders.ResourcesRequest.Builder().build()
).await()
}
Shadows.shadowOf(Looper.getMainLooper()).idle() // Ensure it actually binds...
diff --git a/wear/tiles/tiles-renderer/src/test/java/androidx/wear/tiles/renderer/internal/TileRendererInternalTest.java b/wear/tiles/tiles-renderer/src/test/java/androidx/wear/tiles/renderer/internal/TileRendererInternalTest.java
index 56d3e02..720732c 100644
--- a/wear/tiles/tiles-renderer/src/test/java/androidx/wear/tiles/renderer/internal/TileRendererInternalTest.java
+++ b/wear/tiles/tiles-renderer/src/test/java/androidx/wear/tiles/renderer/internal/TileRendererInternalTest.java
@@ -29,6 +29,8 @@
import android.content.pm.ActivityInfo;
import android.graphics.Rect;
import android.os.Looper;
+import android.os.SystemClock;
+import android.view.MotionEvent;
import android.view.View;
import android.view.View.MeasureSpec;
import android.view.ViewGroup;
@@ -84,6 +86,7 @@
import androidx.wear.tiles.proto.ModifiersProto.Modifiers;
import androidx.wear.tiles.proto.ModifiersProto.Padding;
import androidx.wear.tiles.proto.ModifiersProto.Semantics;
+import androidx.wear.tiles.proto.ModifiersProto.SpanModifiers;
import androidx.wear.tiles.proto.ResourceProto.AndroidImageResourceByResId;
import androidx.wear.tiles.proto.ResourceProto.ImageResource;
import androidx.wear.tiles.proto.ResourceProto.Resources;
@@ -103,6 +106,8 @@
import org.robolectric.shadows.ShadowPackageManager;
import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
import java.util.Map;
@RunWith(TilesTestRunner.class)
@@ -1137,6 +1142,60 @@
}
@Test
+ public void inflate_spannable_onClickCanFire() {
+ LayoutElement root = LayoutElement.newBuilder()
+ .setSpannable(Spannable.newBuilder()
+ .addSpans(Span.newBuilder()
+ .setText(SpanText.newBuilder()
+ .setText(StringProp.newBuilder()
+ .setValue("Hello World"))
+ .setModifiers(SpanModifiers.newBuilder()
+ .setClickable(Clickable.newBuilder()
+ .setOnClick(Action.newBuilder()
+ .setLoadAction(LoadAction
+ .getDefaultInstance())))))))
+ .build();
+
+ List<Boolean> hasFiredList = new ArrayList<>();
+ FrameLayout rootLayout =
+ inflateProto(
+ root,
+ /* theme= */0,
+ resourceResolvers(),
+ p -> hasFiredList.add(true));
+
+ TextView tv = (TextView) rootLayout.getChildAt(0);
+
+ // Dispatch a click event to the first View; it should trigger the LoadAction...
+ long startTime = SystemClock.uptimeMillis();
+ MotionEvent evt =
+ MotionEvent.obtain(
+ /* downTime= */ startTime,
+ /* eventTime= */ startTime,
+ MotionEvent.ACTION_DOWN,
+ /* x= */ 5f,
+ /* y= */ 5f,
+ /* metaState= */ 0);
+ tv.dispatchTouchEvent(evt);
+ evt.recycle();
+
+ evt =
+ MotionEvent.obtain(
+ /* downTime= */ startTime,
+ /* eventTime= */ startTime + 100,
+ MotionEvent.ACTION_UP,
+ /* x= */ 5f,
+ /* y= */ 5f,
+ /* metaState= */ 0);
+ tv.dispatchTouchEvent(evt);
+ evt.recycle();
+
+ shadowOf(Looper.getMainLooper()).idle();
+
+ assertThat(hasFiredList).hasSize(1);
+ }
+
+ @Test
public void inflate_image_intrinsicSizeIsIgnored() {
LayoutElement root = LayoutElement.newBuilder()
.setBox(Box.newBuilder()
diff --git a/wear/tiles/tiles-renderer/src/test/java/androidx/wear/tiles/timeline/TilesTimelineCacheTest.java b/wear/tiles/tiles-renderer/src/test/java/androidx/wear/tiles/timeline/TilesTimelineCacheTest.java
index 7d73149..f566a42 100644
--- a/wear/tiles/tiles-renderer/src/test/java/androidx/wear/tiles/timeline/TilesTimelineCacheTest.java
+++ b/wear/tiles/tiles-renderer/src/test/java/androidx/wear/tiles/timeline/TilesTimelineCacheTest.java
@@ -44,8 +44,8 @@
public void timelineCache_noValidityMakesDefaultTile() {
// Purposefully not setting a validity period.
TimelineEntry entry =
- TimelineEntry.builder().setLayout(buildTextLayout("Hello World")).build();
- Timeline timeline = Timeline.builder().addTimelineEntry(entry).build();
+ new TimelineEntry.Builder().setLayout(buildTextLayout("Hello World")).build();
+ Timeline timeline = new Timeline.Builder().addTimelineEntry(entry).build();
TilesTimelineCache timelineCache = new TilesTimelineCache(timeline);
@@ -66,25 +66,27 @@
final long cutoverMillis = Duration.ofMinutes(10).toMillis();
TimelineEntry entry1 =
- TimelineEntry.builder()
+ new TimelineEntry.Builder()
.setLayout(buildTextLayout("Tile1"))
.setValidity(
- TimeInterval.builder()
+ new TimeInterval.Builder()
.setStartMillis(0)
- .setEndMillis(cutoverMillis))
+ .setEndMillis(cutoverMillis)
+ .build())
.build();
TimelineEntry entry2 =
- TimelineEntry.builder()
+ new TimelineEntry.Builder()
.setLayout(buildTextLayout("Tile2"))
.setValidity(
- TimeInterval.builder()
+ new TimeInterval.Builder()
.setStartMillis(cutoverMillis)
- .setEndMillis(Long.MAX_VALUE))
+ .setEndMillis(Long.MAX_VALUE)
+ .build())
.build();
Timeline timeline =
- Timeline.builder().addTimelineEntry(entry1).addTimelineEntry(entry2).build();
+ new Timeline.Builder().addTimelineEntry(entry1).addTimelineEntry(entry2).build();
TilesTimelineCache timelineCache = new TilesTimelineCache(timeline);
@@ -128,19 +130,23 @@
final long entry1EndMillis = entry1StartMillis + Duration.ofMinutes(10).toMillis();
TimelineEntry defaultEntry =
- TimelineEntry.builder().setLayout(buildTextLayout("DefaultTile")).build();
+ new TimelineEntry.Builder().setLayout(buildTextLayout("DefaultTile")).build();
TimelineEntry entry1 =
- TimelineEntry.builder()
+ new TimelineEntry.Builder()
.setLayout(buildTextLayout("Entry1"))
.setValidity(
- TimeInterval.builder()
+ new TimeInterval.Builder()
.setStartMillis(entry1StartMillis)
- .setEndMillis(entry1EndMillis))
+ .setEndMillis(entry1EndMillis)
+ .build())
.build();
Timeline timeline =
- Timeline.builder().addTimelineEntry(entry1).addTimelineEntry(defaultEntry).build();
+ new Timeline.Builder()
+ .addTimelineEntry(entry1)
+ .addTimelineEntry(defaultEntry)
+ .build();
TilesTimelineCache timelineCache = new TilesTimelineCache(timeline);
@@ -186,37 +192,40 @@
entry3StartMillis + Duration.ofMinutes(2).toMillis(); // Valid for 2 minutes
TimelineEntry defaultEntry =
- TimelineEntry.builder().setLayout(buildTextLayout("DefaultTile")).build();
+ new TimelineEntry.Builder().setLayout(buildTextLayout("DefaultTile")).build();
TimelineEntry entry1 =
- TimelineEntry.builder()
+ new TimelineEntry.Builder()
.setLayout(buildTextLayout("Entry1"))
.setValidity(
- TimeInterval.builder()
+ new TimeInterval.Builder()
.setStartMillis(entry1StartMillis)
- .setEndMillis(entry1EndMillis))
+ .setEndMillis(entry1EndMillis)
+ .build())
.build();
TimelineEntry entry2 =
- TimelineEntry.builder()
+ new TimelineEntry.Builder()
.setLayout(buildTextLayout("Entry2"))
.setValidity(
- TimeInterval.builder()
+ new TimeInterval.Builder()
.setStartMillis(entry2StartMillis)
- .setEndMillis(entry2EndMillis))
+ .setEndMillis(entry2EndMillis)
+ .build())
.build();
TimelineEntry entry3 =
- TimelineEntry.builder()
+ new TimelineEntry.Builder()
.setLayout(buildTextLayout("Entry3"))
.setValidity(
- TimeInterval.builder()
+ new TimeInterval.Builder()
.setStartMillis(entry3StartMillis)
- .setEndMillis(entry3EndMillis))
+ .setEndMillis(entry3EndMillis)
+ .build())
.build();
Timeline timeline =
- Timeline.builder()
+ new Timeline.Builder()
.addTimelineEntry(defaultEntry)
.addTimelineEntry(entry1)
.addTimelineEntry(entry2)
@@ -283,37 +292,40 @@
entry3StartMillis + Duration.ofMinutes(4).toMillis(); // Valid for 4 minutes
TimelineEntry defaultEntry =
- TimelineEntry.builder().setLayout(buildTextLayout("DefaultTile")).build();
+ new TimelineEntry.Builder().setLayout(buildTextLayout("DefaultTile")).build();
TimelineEntry entry1 =
- TimelineEntry.builder()
+ new TimelineEntry.Builder()
.setLayout(buildTextLayout("Entry1"))
.setValidity(
- TimeInterval.builder()
+ new TimeInterval.Builder()
.setStartMillis(entry1StartMillis)
- .setEndMillis(entry1EndMillis))
+ .setEndMillis(entry1EndMillis)
+ .build())
.build();
TimelineEntry entry2 =
- TimelineEntry.builder()
+ new TimelineEntry.Builder()
.setLayout(buildTextLayout("Entry2"))
.setValidity(
- TimeInterval.builder()
+ new TimeInterval.Builder()
.setStartMillis(entry2StartMillis)
- .setEndMillis(entry2EndMillis))
+ .setEndMillis(entry2EndMillis)
+ .build())
.build();
TimelineEntry entry3 =
- TimelineEntry.builder()
+ new TimelineEntry.Builder()
.setLayout(buildTextLayout("Entry3"))
.setValidity(
- TimeInterval.builder()
+ new TimeInterval.Builder()
.setStartMillis(entry3StartMillis)
- .setEndMillis(entry3EndMillis))
+ .setEndMillis(entry3EndMillis)
+ .build())
.build();
Timeline timeline =
- Timeline.builder()
+ new Timeline.Builder()
.addTimelineEntry(defaultEntry)
.addTimelineEntry(entry1)
.addTimelineEntry(entry2)
@@ -378,37 +390,40 @@
entry3StartMillis + Duration.ofMinutes(6).toMillis(); // Valid for 6 minutes
TimelineEntry defaultEntry =
- TimelineEntry.builder().setLayout(buildTextLayout("DefaultTile")).build();
+ new TimelineEntry.Builder().setLayout(buildTextLayout("DefaultTile")).build();
TimelineEntry entry1 =
- TimelineEntry.builder()
+ new TimelineEntry.Builder()
.setLayout(buildTextLayout("Entry1"))
.setValidity(
- TimeInterval.builder()
+ new TimeInterval.Builder()
.setStartMillis(entry1StartMillis)
- .setEndMillis(entry1EndMillis))
+ .setEndMillis(entry1EndMillis)
+ .build())
.build();
TimelineEntry entry2 =
- TimelineEntry.builder()
+ new TimelineEntry.Builder()
.setLayout(buildTextLayout("Entry2"))
.setValidity(
- TimeInterval.builder()
+ new TimeInterval.Builder()
.setStartMillis(entry2StartMillis)
- .setEndMillis(entry2EndMillis))
+ .setEndMillis(entry2EndMillis)
+ .build())
.build();
TimelineEntry entry3 =
- TimelineEntry.builder()
+ new TimelineEntry.Builder()
.setLayout(buildTextLayout("Entry3"))
.setValidity(
- TimeInterval.builder()
+ new TimeInterval.Builder()
.setStartMillis(entry3StartMillis)
- .setEndMillis(entry3EndMillis))
+ .setEndMillis(entry3EndMillis)
+ .build())
.build();
Timeline timeline =
- Timeline.builder()
+ new Timeline.Builder()
.addTimelineEntry(defaultEntry)
.addTimelineEntry(entry1)
.addTimelineEntry(entry2)
@@ -460,25 +475,27 @@
entry2StartMillis + Duration.ofMinutes(10).toMillis(); // 10 minutes
TimelineEntry entry1 =
- TimelineEntry.builder()
+ new TimelineEntry.Builder()
.setLayout(buildTextLayout("Entry1"))
.setValidity(
- TimeInterval.builder()
+ new TimeInterval.Builder()
.setStartMillis(entry1StartMillis)
- .setEndMillis(entry1EndMillis))
+ .setEndMillis(entry1EndMillis)
+ .build())
.build();
TimelineEntry entry2 =
- TimelineEntry.builder()
+ new TimelineEntry.Builder()
.setLayout(buildTextLayout("Entry2"))
.setValidity(
- TimeInterval.builder()
+ new TimeInterval.Builder()
.setStartMillis(entry2StartMillis)
- .setEndMillis(entry2EndMillis))
+ .setEndMillis(entry2EndMillis)
+ .build())
.build();
Timeline timeline =
- Timeline.builder().addTimelineEntry(entry1).addTimelineEntry(entry2).build();
+ new Timeline.Builder().addTimelineEntry(entry1).addTimelineEntry(entry2).build();
TilesTimelineCache timelineCache = new TilesTimelineCache(timeline);
@@ -516,6 +533,6 @@
}
private static Layout buildTextLayout(String text) {
- return Layout.builder().setRoot(Text.builder().setText(text)).build();
+ return new Layout.Builder().setRoot(new Text.Builder().setText(text).build()).build();
}
}
diff --git a/wear/tiles/tiles-renderer/src/test/java/androidx/wear/tiles/timeline/TilesTimelineManagerTest.java b/wear/tiles/tiles-renderer/src/test/java/androidx/wear/tiles/timeline/TilesTimelineManagerTest.java
index f6c490f..801818c 100644
--- a/wear/tiles/tiles-renderer/src/test/java/androidx/wear/tiles/timeline/TilesTimelineManagerTest.java
+++ b/wear/tiles/tiles-renderer/src/test/java/androidx/wear/tiles/timeline/TilesTimelineManagerTest.java
@@ -89,8 +89,8 @@
public void timelineManager_singleTileImmediatelySet() {
List<Layout> returnedLayouts = new ArrayList<>();
Layout layout = buildTextLayout("Hello World");
- TimelineEntry entry = TimelineEntry.builder().setLayout(layout).build();
- Timeline timeline = Timeline.builder().addTimelineEntry(entry).build();
+ TimelineEntry entry = new TimelineEntry.Builder().setLayout(layout).build();
+ Timeline timeline = new Timeline.Builder().addTimelineEntry(entry).build();
mTimelineManager =
new TilesTimelineManager(
@@ -116,36 +116,39 @@
Layout layout1 = buildTextLayout("Tile1");
TimelineEntry entry1 =
- TimelineEntry.builder()
+ new TimelineEntry.Builder()
.setLayout(layout1)
.setValidity(
- TimeInterval.builder()
+ new TimeInterval.Builder()
.setStartMillis(0)
- .setEndMillis(cutover1Millis))
+ .setEndMillis(cutover1Millis)
+ .build())
.build();
Layout layout2 = buildTextLayout("Tile2");
TimelineEntry entry2 =
- TimelineEntry.builder()
+ new TimelineEntry.Builder()
.setLayout(layout2)
.setValidity(
- TimeInterval.builder()
+ new TimeInterval.Builder()
.setStartMillis(cutover1Millis)
- .setEndMillis(cutover2Millis))
+ .setEndMillis(cutover2Millis)
+ .build())
.build();
Layout layout3 = buildTextLayout("Tile3");
TimelineEntry entry3 =
- TimelineEntry.builder()
+ new TimelineEntry.Builder()
.setLayout(layout3)
.setValidity(
- TimeInterval.builder()
+ new TimeInterval.Builder()
.setStartMillis(cutover2Millis)
- .setEndMillis(Long.MAX_VALUE))
+ .setEndMillis(Long.MAX_VALUE)
+ .build())
.build();
Timeline timeline =
- Timeline.builder()
+ new Timeline.Builder()
.addTimelineEntry(entry1)
.addTimelineEntry(entry2)
.addTimelineEntry(entry3)
@@ -186,25 +189,27 @@
final long cutover1Millis = mCurrentTime + Duration.ofMinutes(10).toMillis();
TimelineEntry entry1 =
- TimelineEntry.builder()
+ new TimelineEntry.Builder()
.setLayout(buildTextLayout("Tile1"))
.setValidity(
- TimeInterval.builder()
+ new TimeInterval.Builder()
.setStartMillis(0)
- .setEndMillis(cutover1Millis))
+ .setEndMillis(cutover1Millis)
+ .build())
.build();
TimelineEntry entry2 =
- TimelineEntry.builder()
+ new TimelineEntry.Builder()
.setLayout(buildTextLayout("Tile2"))
.setValidity(
- TimeInterval.builder()
+ new TimeInterval.Builder()
.setStartMillis(cutover1Millis)
- .setEndMillis(Long.MAX_VALUE))
+ .setEndMillis(Long.MAX_VALUE)
+ .build())
.build();
Timeline timeline =
- Timeline.builder().addTimelineEntry(entry1).addTimelineEntry(entry2).build();
+ new Timeline.Builder().addTimelineEntry(entry1).addTimelineEntry(entry2).build();
mTimelineManager =
new TilesTimelineManager(
@@ -232,26 +237,28 @@
Layout layout1 = buildTextLayout("Tile1");
TimelineEntry entry1 =
- TimelineEntry.builder()
+ new TimelineEntry.Builder()
.setLayout(layout1)
.setValidity(
- TimeInterval.builder()
+ new TimeInterval.Builder()
.setStartMillis(0)
- .setEndMillis(cutover1Millis))
+ .setEndMillis(cutover1Millis)
+ .build())
.build();
Layout layout2 = buildTextLayout("Tile2");
TimelineEntry entry2 =
- TimelineEntry.builder()
+ new TimelineEntry.Builder()
.setLayout(layout2)
.setValidity(
- TimeInterval.builder()
+ new TimeInterval.Builder()
.setStartMillis(cutover1Millis)
- .setEndMillis(Long.MAX_VALUE))
+ .setEndMillis(Long.MAX_VALUE)
+ .build())
.build();
Timeline timeline =
- Timeline.builder().addTimelineEntry(entry1).addTimelineEntry(entry2).build();
+ new Timeline.Builder().addTimelineEntry(entry1).addTimelineEntry(entry2).build();
mTimelineManager =
new TilesTimelineManager(
@@ -290,36 +297,39 @@
Layout layout1 = buildTextLayout("Tile1");
TimelineEntry entry1 =
- TimelineEntry.builder()
+ new TimelineEntry.Builder()
.setLayout(layout1)
.setValidity(
- TimeInterval.builder()
+ new TimeInterval.Builder()
.setStartMillis(0)
- .setEndMillis(cutover1Millis))
+ .setEndMillis(cutover1Millis)
+ .build())
.build();
Layout layout2 = buildTextLayout("Tile2");
TimelineEntry entry2 =
- TimelineEntry.builder()
+ new TimelineEntry.Builder()
.setLayout(layout2)
.setValidity(
- TimeInterval.builder()
+ new TimeInterval.Builder()
.setStartMillis(cutover1Millis)
- .setEndMillis(cutover2Millis))
+ .setEndMillis(cutover2Millis)
+ .build())
.build();
Layout layout3 = buildTextLayout("Tile3");
TimelineEntry entry3 =
- TimelineEntry.builder()
+ new TimelineEntry.Builder()
.setLayout(layout3)
.setValidity(
- TimeInterval.builder()
+ new TimeInterval.Builder()
.setStartMillis(cutover2Millis)
- .setEndMillis(Long.MAX_VALUE))
+ .setEndMillis(Long.MAX_VALUE)
+ .build())
.build();
Timeline timeline =
- Timeline.builder()
+ new Timeline.Builder()
.addTimelineEntry(entry1)
.addTimelineEntry(entry2)
.addTimelineEntry(entry3)
@@ -345,7 +355,7 @@
}
private static Layout buildTextLayout(String text) {
- return Layout.builder().setRoot(Text.builder().setText(text)).build();
+ return new Layout.Builder().setRoot(new Text.Builder().setText(text).build()).build();
}
private void seekToTime(long timeMillis) {
diff --git a/wear/tiles/tiles-testing/src/test/java/androidx/wear/tiles/testing/TestTileProviderClientTest.kt b/wear/tiles/tiles-testing/src/test/java/androidx/wear/tiles/testing/TestTileProviderClientTest.kt
index ad614002..5c57c59 100644
--- a/wear/tiles/tiles-testing/src/test/java/androidx/wear/tiles/testing/TestTileProviderClientTest.kt
+++ b/wear/tiles/tiles-testing/src/test/java/androidx/wear/tiles/testing/TestTileProviderClientTest.kt
@@ -59,7 +59,7 @@
@Test
public fun canCallOnTileRequest() {
- val future = clientUnderTest.requestTile(RequestBuilders.TileRequest.builder().build())
+ val future = clientUnderTest.requestTile(RequestBuilders.TileRequest.Builder().build())
shadowOf(Looper.getMainLooper()).idle()
assertThat(future.isDone).isTrue()
@@ -69,7 +69,7 @@
@Test
public fun canCallOnResourcesRequest() {
val future = clientUnderTest.requestResources(
- RequestBuilders.ResourcesRequest.builder().build()
+ RequestBuilders.ResourcesRequest.Builder().build()
)
shadowOf(Looper.getMainLooper()).idle()
@@ -140,7 +140,7 @@
): ListenableFuture<TileBuilders.Tile> {
val f = ResolvableFuture.create<TileBuilders.Tile>()
- f.set(TileBuilders.Tile.builder().setResourcesVersion(RESOURCES_VERSION).build())
+ f.set(TileBuilders.Tile.Builder().setResourcesVersion(RESOURCES_VERSION).build())
return f
}
@@ -150,7 +150,7 @@
): ListenableFuture<ResourceBuilders.Resources> {
val f = ResolvableFuture.create<ResourceBuilders.Resources>()
- f.set(ResourceBuilders.Resources.builder().setVersion(RESOURCES_VERSION).build())
+ f.set(ResourceBuilders.Resources.Builder().setVersion(RESOURCES_VERSION).build())
return f
}
diff --git a/wear/tiles/tiles/api/current.txt b/wear/tiles/tiles/api/current.txt
index e760e85..6bfd76f 100644
--- a/wear/tiles/tiles/api/current.txt
+++ b/wear/tiles/tiles/api/current.txt
@@ -17,36 +17,35 @@
}
public static final class ActionBuilders.AndroidActivity {
- method public static androidx.wear.tiles.ActionBuilders.AndroidActivity.Builder builder();
method public String getClassName();
method public java.util.Map<java.lang.String!,androidx.wear.tiles.ActionBuilders.AndroidExtra!> getKeyToExtraMapping();
method public String getPackageName();
}
public static final class ActionBuilders.AndroidActivity.Builder {
+ ctor public ActionBuilders.AndroidActivity.Builder();
method public androidx.wear.tiles.ActionBuilders.AndroidActivity.Builder addKeyToExtraMapping(String, androidx.wear.tiles.ActionBuilders.AndroidExtra);
- method public androidx.wear.tiles.ActionBuilders.AndroidActivity.Builder addKeyToExtraMapping(String, androidx.wear.tiles.ActionBuilders.AndroidExtra.Builder);
method public androidx.wear.tiles.ActionBuilders.AndroidActivity build();
method public androidx.wear.tiles.ActionBuilders.AndroidActivity.Builder setClassName(String);
method public androidx.wear.tiles.ActionBuilders.AndroidActivity.Builder setPackageName(String);
}
public static final class ActionBuilders.AndroidBooleanExtra implements androidx.wear.tiles.ActionBuilders.AndroidExtra {
- method public static androidx.wear.tiles.ActionBuilders.AndroidBooleanExtra.Builder builder();
method public boolean getValue();
}
public static final class ActionBuilders.AndroidBooleanExtra.Builder implements androidx.wear.tiles.ActionBuilders.AndroidExtra.Builder {
+ ctor public ActionBuilders.AndroidBooleanExtra.Builder();
method public androidx.wear.tiles.ActionBuilders.AndroidBooleanExtra build();
method public androidx.wear.tiles.ActionBuilders.AndroidBooleanExtra.Builder setValue(boolean);
}
public static final class ActionBuilders.AndroidDoubleExtra implements androidx.wear.tiles.ActionBuilders.AndroidExtra {
- method public static androidx.wear.tiles.ActionBuilders.AndroidDoubleExtra.Builder builder();
method public double getValue();
}
public static final class ActionBuilders.AndroidDoubleExtra.Builder implements androidx.wear.tiles.ActionBuilders.AndroidExtra.Builder {
+ ctor public ActionBuilders.AndroidDoubleExtra.Builder();
method public androidx.wear.tiles.ActionBuilders.AndroidDoubleExtra build();
method public androidx.wear.tiles.ActionBuilders.AndroidDoubleExtra.Builder setValue(double);
}
@@ -59,55 +58,53 @@
}
public static final class ActionBuilders.AndroidIntExtra implements androidx.wear.tiles.ActionBuilders.AndroidExtra {
- method public static androidx.wear.tiles.ActionBuilders.AndroidIntExtra.Builder builder();
method public int getValue();
}
public static final class ActionBuilders.AndroidIntExtra.Builder implements androidx.wear.tiles.ActionBuilders.AndroidExtra.Builder {
+ ctor public ActionBuilders.AndroidIntExtra.Builder();
method public androidx.wear.tiles.ActionBuilders.AndroidIntExtra build();
method public androidx.wear.tiles.ActionBuilders.AndroidIntExtra.Builder setValue(int);
}
public static final class ActionBuilders.AndroidLongExtra implements androidx.wear.tiles.ActionBuilders.AndroidExtra {
- method public static androidx.wear.tiles.ActionBuilders.AndroidLongExtra.Builder builder();
method public long getValue();
}
public static final class ActionBuilders.AndroidLongExtra.Builder implements androidx.wear.tiles.ActionBuilders.AndroidExtra.Builder {
+ ctor public ActionBuilders.AndroidLongExtra.Builder();
method public androidx.wear.tiles.ActionBuilders.AndroidLongExtra build();
method public androidx.wear.tiles.ActionBuilders.AndroidLongExtra.Builder setValue(long);
}
public static final class ActionBuilders.AndroidStringExtra implements androidx.wear.tiles.ActionBuilders.AndroidExtra {
- method public static androidx.wear.tiles.ActionBuilders.AndroidStringExtra.Builder builder();
method public String getValue();
}
public static final class ActionBuilders.AndroidStringExtra.Builder implements androidx.wear.tiles.ActionBuilders.AndroidExtra.Builder {
+ ctor public ActionBuilders.AndroidStringExtra.Builder();
method public androidx.wear.tiles.ActionBuilders.AndroidStringExtra build();
method public androidx.wear.tiles.ActionBuilders.AndroidStringExtra.Builder setValue(String);
}
public static final class ActionBuilders.LaunchAction implements androidx.wear.tiles.ActionBuilders.Action {
- method public static androidx.wear.tiles.ActionBuilders.LaunchAction.Builder builder();
method public androidx.wear.tiles.ActionBuilders.AndroidActivity? getAndroidActivity();
}
public static final class ActionBuilders.LaunchAction.Builder implements androidx.wear.tiles.ActionBuilders.Action.Builder {
+ ctor public ActionBuilders.LaunchAction.Builder();
method public androidx.wear.tiles.ActionBuilders.LaunchAction build();
method public androidx.wear.tiles.ActionBuilders.LaunchAction.Builder setAndroidActivity(androidx.wear.tiles.ActionBuilders.AndroidActivity);
- method public androidx.wear.tiles.ActionBuilders.LaunchAction.Builder setAndroidActivity(androidx.wear.tiles.ActionBuilders.AndroidActivity.Builder);
}
public static final class ActionBuilders.LoadAction implements androidx.wear.tiles.ActionBuilders.Action {
- method public static androidx.wear.tiles.ActionBuilders.LoadAction.Builder builder();
method public androidx.wear.tiles.StateBuilders.State? getRequestState();
}
public static final class ActionBuilders.LoadAction.Builder implements androidx.wear.tiles.ActionBuilders.Action.Builder {
+ ctor public ActionBuilders.LoadAction.Builder();
method public androidx.wear.tiles.ActionBuilders.LoadAction build();
method public androidx.wear.tiles.ActionBuilders.LoadAction.Builder setRequestState(androidx.wear.tiles.StateBuilders.State);
- method public androidx.wear.tiles.ActionBuilders.LoadAction.Builder setRequestState(androidx.wear.tiles.StateBuilders.State.Builder);
}
public final class ColorBuilders {
@@ -115,11 +112,11 @@
}
public static final class ColorBuilders.ColorProp {
- method public static androidx.wear.tiles.ColorBuilders.ColorProp.Builder builder();
method @ColorInt public int getArgb();
}
public static final class ColorBuilders.ColorProp.Builder {
+ ctor public ColorBuilders.ColorProp.Builder();
method public androidx.wear.tiles.ColorBuilders.ColorProp build();
method public androidx.wear.tiles.ColorBuilders.ColorProp.Builder setArgb(@ColorInt int);
}
@@ -133,7 +130,6 @@
}
public static final class DeviceParametersBuilders.DeviceParameters {
- method public static androidx.wear.tiles.DeviceParametersBuilders.DeviceParameters.Builder builder();
method public int getDevicePlatform();
method @FloatRange(from=0.0, fromInclusive=false, toInclusive=false) public float getScreenDensity();
method @Dimension(unit=androidx.annotation.Dimension.DP) public int getScreenHeightDp();
@@ -142,6 +138,7 @@
}
public static final class DeviceParametersBuilders.DeviceParameters.Builder {
+ ctor public DeviceParametersBuilders.DeviceParameters.Builder();
method public androidx.wear.tiles.DeviceParametersBuilders.DeviceParameters build();
method public androidx.wear.tiles.DeviceParametersBuilders.DeviceParameters.Builder setDevicePlatform(int);
method public androidx.wear.tiles.DeviceParametersBuilders.DeviceParameters.Builder setScreenDensity(@FloatRange(from=0.0, fromInclusive=false, toInclusive=false) float);
@@ -167,40 +164,40 @@
}
public static final class DimensionBuilders.DegreesProp {
- method public static androidx.wear.tiles.DimensionBuilders.DegreesProp.Builder builder();
method public float getValue();
}
public static final class DimensionBuilders.DegreesProp.Builder {
+ ctor public DimensionBuilders.DegreesProp.Builder();
method public androidx.wear.tiles.DimensionBuilders.DegreesProp build();
method public androidx.wear.tiles.DimensionBuilders.DegreesProp.Builder setValue(float);
}
public static final class DimensionBuilders.DpProp implements androidx.wear.tiles.DimensionBuilders.ContainerDimension androidx.wear.tiles.DimensionBuilders.ImageDimension androidx.wear.tiles.DimensionBuilders.SpacerDimension {
- method public static androidx.wear.tiles.DimensionBuilders.DpProp.Builder builder();
method @Dimension(unit=androidx.annotation.Dimension.DP) public float getValue();
}
public static final class DimensionBuilders.DpProp.Builder implements androidx.wear.tiles.DimensionBuilders.ContainerDimension.Builder androidx.wear.tiles.DimensionBuilders.ImageDimension.Builder androidx.wear.tiles.DimensionBuilders.SpacerDimension.Builder {
+ ctor public DimensionBuilders.DpProp.Builder();
method public androidx.wear.tiles.DimensionBuilders.DpProp build();
method public androidx.wear.tiles.DimensionBuilders.DpProp.Builder setValue(@Dimension(unit=androidx.annotation.Dimension.DP) float);
}
public static final class DimensionBuilders.EmProp {
- method public static androidx.wear.tiles.DimensionBuilders.EmProp.Builder builder();
method public float getValue();
}
public static final class DimensionBuilders.EmProp.Builder {
+ ctor public DimensionBuilders.EmProp.Builder();
method public androidx.wear.tiles.DimensionBuilders.EmProp build();
method public androidx.wear.tiles.DimensionBuilders.EmProp.Builder setValue(float);
}
public static final class DimensionBuilders.ExpandedDimensionProp implements androidx.wear.tiles.DimensionBuilders.ContainerDimension androidx.wear.tiles.DimensionBuilders.ImageDimension {
- method public static androidx.wear.tiles.DimensionBuilders.ExpandedDimensionProp.Builder builder();
}
public static final class DimensionBuilders.ExpandedDimensionProp.Builder implements androidx.wear.tiles.DimensionBuilders.ContainerDimension.Builder androidx.wear.tiles.DimensionBuilders.ImageDimension.Builder {
+ ctor public DimensionBuilders.ExpandedDimensionProp.Builder();
method public androidx.wear.tiles.DimensionBuilders.ExpandedDimensionProp build();
}
@@ -212,23 +209,23 @@
}
public static final class DimensionBuilders.ProportionalDimensionProp implements androidx.wear.tiles.DimensionBuilders.ImageDimension {
- method public static androidx.wear.tiles.DimensionBuilders.ProportionalDimensionProp.Builder builder();
method @IntRange(from=0) public int getAspectRatioHeight();
method @IntRange(from=0) public int getAspectRatioWidth();
}
public static final class DimensionBuilders.ProportionalDimensionProp.Builder implements androidx.wear.tiles.DimensionBuilders.ImageDimension.Builder {
+ ctor public DimensionBuilders.ProportionalDimensionProp.Builder();
method public androidx.wear.tiles.DimensionBuilders.ProportionalDimensionProp build();
method public androidx.wear.tiles.DimensionBuilders.ProportionalDimensionProp.Builder setAspectRatioHeight(@IntRange(from=0) int);
method public androidx.wear.tiles.DimensionBuilders.ProportionalDimensionProp.Builder setAspectRatioWidth(@IntRange(from=0) int);
}
public static final class DimensionBuilders.SpProp {
- method public static androidx.wear.tiles.DimensionBuilders.SpProp.Builder builder();
method @Dimension(unit=androidx.annotation.Dimension.SP) public float getValue();
}
public static final class DimensionBuilders.SpProp.Builder {
+ ctor public DimensionBuilders.SpProp.Builder();
method public androidx.wear.tiles.DimensionBuilders.SpProp build();
method public androidx.wear.tiles.DimensionBuilders.SpProp.Builder setValue(@Dimension(unit=androidx.annotation.Dimension.SP) float);
}
@@ -241,10 +238,10 @@
}
public static final class DimensionBuilders.WrappedDimensionProp implements androidx.wear.tiles.DimensionBuilders.ContainerDimension {
- method public static androidx.wear.tiles.DimensionBuilders.WrappedDimensionProp.Builder builder();
}
public static final class DimensionBuilders.WrappedDimensionProp.Builder implements androidx.wear.tiles.DimensionBuilders.ContainerDimension.Builder {
+ ctor public DimensionBuilders.WrappedDimensionProp.Builder();
method public androidx.wear.tiles.DimensionBuilders.WrappedDimensionProp build();
}
@@ -252,34 +249,34 @@
}
public static final class EventBuilders.TileAddEvent {
- method public static androidx.wear.tiles.EventBuilders.TileAddEvent.Builder builder();
}
public static final class EventBuilders.TileAddEvent.Builder {
+ ctor public EventBuilders.TileAddEvent.Builder();
method public androidx.wear.tiles.EventBuilders.TileAddEvent build();
}
public static final class EventBuilders.TileEnterEvent {
- method public static androidx.wear.tiles.EventBuilders.TileEnterEvent.Builder builder();
}
public static final class EventBuilders.TileEnterEvent.Builder {
+ ctor public EventBuilders.TileEnterEvent.Builder();
method public androidx.wear.tiles.EventBuilders.TileEnterEvent build();
}
public static final class EventBuilders.TileLeaveEvent {
- method public static androidx.wear.tiles.EventBuilders.TileLeaveEvent.Builder builder();
}
public static final class EventBuilders.TileLeaveEvent.Builder {
+ ctor public EventBuilders.TileLeaveEvent.Builder();
method public androidx.wear.tiles.EventBuilders.TileLeaveEvent build();
}
public static final class EventBuilders.TileRemoveEvent {
- method public static androidx.wear.tiles.EventBuilders.TileRemoveEvent.Builder builder();
}
public static final class EventBuilders.TileRemoveEvent.Builder {
+ ctor public EventBuilders.TileRemoveEvent.Builder();
method public androidx.wear.tiles.EventBuilders.TileRemoveEvent build();
}
@@ -321,7 +318,6 @@
}
public static final class LayoutElementBuilders.Arc implements androidx.wear.tiles.LayoutElementBuilders.LayoutElement {
- method public static androidx.wear.tiles.LayoutElementBuilders.Arc.Builder builder();
method public androidx.wear.tiles.DimensionBuilders.DegreesProp? getAnchorAngle();
method public androidx.wear.tiles.LayoutElementBuilders.ArcAnchorTypeProp? getAnchorType();
method public java.util.List<androidx.wear.tiles.LayoutElementBuilders.ArcLayoutElement!> getContents();
@@ -330,39 +326,36 @@
}
public static final class LayoutElementBuilders.Arc.Builder implements androidx.wear.tiles.LayoutElementBuilders.LayoutElement.Builder {
+ ctor public LayoutElementBuilders.Arc.Builder();
method public androidx.wear.tiles.LayoutElementBuilders.Arc.Builder addContent(androidx.wear.tiles.LayoutElementBuilders.ArcLayoutElement);
- method public androidx.wear.tiles.LayoutElementBuilders.Arc.Builder addContent(androidx.wear.tiles.LayoutElementBuilders.ArcLayoutElement.Builder);
method public androidx.wear.tiles.LayoutElementBuilders.Arc build();
method public androidx.wear.tiles.LayoutElementBuilders.Arc.Builder setAnchorAngle(androidx.wear.tiles.DimensionBuilders.DegreesProp);
- method public androidx.wear.tiles.LayoutElementBuilders.Arc.Builder setAnchorAngle(androidx.wear.tiles.DimensionBuilders.DegreesProp.Builder);
method public androidx.wear.tiles.LayoutElementBuilders.Arc.Builder setAnchorType(androidx.wear.tiles.LayoutElementBuilders.ArcAnchorTypeProp);
method public androidx.wear.tiles.LayoutElementBuilders.Arc.Builder setAnchorType(int);
method public androidx.wear.tiles.LayoutElementBuilders.Arc.Builder setModifiers(androidx.wear.tiles.ModifiersBuilders.Modifiers);
- method public androidx.wear.tiles.LayoutElementBuilders.Arc.Builder setModifiers(androidx.wear.tiles.ModifiersBuilders.Modifiers.Builder);
method public androidx.wear.tiles.LayoutElementBuilders.Arc.Builder setVerticalAlign(androidx.wear.tiles.LayoutElementBuilders.VerticalAlignmentProp);
method public androidx.wear.tiles.LayoutElementBuilders.Arc.Builder setVerticalAlign(int);
}
public static final class LayoutElementBuilders.ArcAdapter implements androidx.wear.tiles.LayoutElementBuilders.ArcLayoutElement {
- method public static androidx.wear.tiles.LayoutElementBuilders.ArcAdapter.Builder builder();
method public androidx.wear.tiles.LayoutElementBuilders.LayoutElement? getContent();
method public androidx.wear.tiles.TypeBuilders.BoolProp? getRotateContents();
}
public static final class LayoutElementBuilders.ArcAdapter.Builder implements androidx.wear.tiles.LayoutElementBuilders.ArcLayoutElement.Builder {
+ ctor public LayoutElementBuilders.ArcAdapter.Builder();
method public androidx.wear.tiles.LayoutElementBuilders.ArcAdapter build();
method public androidx.wear.tiles.LayoutElementBuilders.ArcAdapter.Builder setContent(androidx.wear.tiles.LayoutElementBuilders.LayoutElement);
- method public androidx.wear.tiles.LayoutElementBuilders.ArcAdapter.Builder setContent(androidx.wear.tiles.LayoutElementBuilders.LayoutElement.Builder);
method public androidx.wear.tiles.LayoutElementBuilders.ArcAdapter.Builder setRotateContents(androidx.wear.tiles.TypeBuilders.BoolProp);
method public androidx.wear.tiles.LayoutElementBuilders.ArcAdapter.Builder setRotateContents(boolean);
}
public static final class LayoutElementBuilders.ArcAnchorTypeProp {
- method public static androidx.wear.tiles.LayoutElementBuilders.ArcAnchorTypeProp.Builder builder();
method public int getValue();
}
public static final class LayoutElementBuilders.ArcAnchorTypeProp.Builder {
+ ctor public LayoutElementBuilders.ArcAnchorTypeProp.Builder();
method public androidx.wear.tiles.LayoutElementBuilders.ArcAnchorTypeProp build();
method public androidx.wear.tiles.LayoutElementBuilders.ArcAnchorTypeProp.Builder setValue(int);
}
@@ -375,7 +368,6 @@
}
public static final class LayoutElementBuilders.ArcLine implements androidx.wear.tiles.LayoutElementBuilders.ArcLayoutElement {
- method public static androidx.wear.tiles.LayoutElementBuilders.ArcLine.Builder builder();
method public androidx.wear.tiles.ColorBuilders.ColorProp? getColor();
method public androidx.wear.tiles.DimensionBuilders.DegreesProp? getLength();
method public androidx.wear.tiles.ModifiersBuilders.ArcModifiers? getModifiers();
@@ -383,53 +375,44 @@
}
public static final class LayoutElementBuilders.ArcLine.Builder implements androidx.wear.tiles.LayoutElementBuilders.ArcLayoutElement.Builder {
+ ctor public LayoutElementBuilders.ArcLine.Builder();
method public androidx.wear.tiles.LayoutElementBuilders.ArcLine build();
method public androidx.wear.tiles.LayoutElementBuilders.ArcLine.Builder setColor(androidx.wear.tiles.ColorBuilders.ColorProp);
- method public androidx.wear.tiles.LayoutElementBuilders.ArcLine.Builder setColor(androidx.wear.tiles.ColorBuilders.ColorProp.Builder);
method public androidx.wear.tiles.LayoutElementBuilders.ArcLine.Builder setLength(androidx.wear.tiles.DimensionBuilders.DegreesProp);
- method public androidx.wear.tiles.LayoutElementBuilders.ArcLine.Builder setLength(androidx.wear.tiles.DimensionBuilders.DegreesProp.Builder);
method public androidx.wear.tiles.LayoutElementBuilders.ArcLine.Builder setModifiers(androidx.wear.tiles.ModifiersBuilders.ArcModifiers);
- method public androidx.wear.tiles.LayoutElementBuilders.ArcLine.Builder setModifiers(androidx.wear.tiles.ModifiersBuilders.ArcModifiers.Builder);
method public androidx.wear.tiles.LayoutElementBuilders.ArcLine.Builder setThickness(androidx.wear.tiles.DimensionBuilders.DpProp);
- method public androidx.wear.tiles.LayoutElementBuilders.ArcLine.Builder setThickness(androidx.wear.tiles.DimensionBuilders.DpProp.Builder);
}
public static final class LayoutElementBuilders.ArcSpacer implements androidx.wear.tiles.LayoutElementBuilders.ArcLayoutElement {
- method public static androidx.wear.tiles.LayoutElementBuilders.ArcSpacer.Builder builder();
method public androidx.wear.tiles.DimensionBuilders.DegreesProp? getLength();
method public androidx.wear.tiles.ModifiersBuilders.ArcModifiers? getModifiers();
method public androidx.wear.tiles.DimensionBuilders.DpProp? getThickness();
}
public static final class LayoutElementBuilders.ArcSpacer.Builder implements androidx.wear.tiles.LayoutElementBuilders.ArcLayoutElement.Builder {
+ ctor public LayoutElementBuilders.ArcSpacer.Builder();
method public androidx.wear.tiles.LayoutElementBuilders.ArcSpacer build();
method public androidx.wear.tiles.LayoutElementBuilders.ArcSpacer.Builder setLength(androidx.wear.tiles.DimensionBuilders.DegreesProp);
- method public androidx.wear.tiles.LayoutElementBuilders.ArcSpacer.Builder setLength(androidx.wear.tiles.DimensionBuilders.DegreesProp.Builder);
method public androidx.wear.tiles.LayoutElementBuilders.ArcSpacer.Builder setModifiers(androidx.wear.tiles.ModifiersBuilders.ArcModifiers);
- method public androidx.wear.tiles.LayoutElementBuilders.ArcSpacer.Builder setModifiers(androidx.wear.tiles.ModifiersBuilders.ArcModifiers.Builder);
method public androidx.wear.tiles.LayoutElementBuilders.ArcSpacer.Builder setThickness(androidx.wear.tiles.DimensionBuilders.DpProp);
- method public androidx.wear.tiles.LayoutElementBuilders.ArcSpacer.Builder setThickness(androidx.wear.tiles.DimensionBuilders.DpProp.Builder);
}
public static final class LayoutElementBuilders.ArcText implements androidx.wear.tiles.LayoutElementBuilders.ArcLayoutElement {
- method public static androidx.wear.tiles.LayoutElementBuilders.ArcText.Builder builder();
method public androidx.wear.tiles.LayoutElementBuilders.FontStyle? getFontStyle();
method public androidx.wear.tiles.ModifiersBuilders.ArcModifiers? getModifiers();
method public androidx.wear.tiles.TypeBuilders.StringProp? getText();
}
public static final class LayoutElementBuilders.ArcText.Builder implements androidx.wear.tiles.LayoutElementBuilders.ArcLayoutElement.Builder {
+ ctor public LayoutElementBuilders.ArcText.Builder();
method public androidx.wear.tiles.LayoutElementBuilders.ArcText build();
method public androidx.wear.tiles.LayoutElementBuilders.ArcText.Builder setFontStyle(androidx.wear.tiles.LayoutElementBuilders.FontStyle);
- method public androidx.wear.tiles.LayoutElementBuilders.ArcText.Builder setFontStyle(androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder);
method public androidx.wear.tiles.LayoutElementBuilders.ArcText.Builder setModifiers(androidx.wear.tiles.ModifiersBuilders.ArcModifiers);
- method public androidx.wear.tiles.LayoutElementBuilders.ArcText.Builder setModifiers(androidx.wear.tiles.ModifiersBuilders.ArcModifiers.Builder);
method public androidx.wear.tiles.LayoutElementBuilders.ArcText.Builder setText(androidx.wear.tiles.TypeBuilders.StringProp);
method public androidx.wear.tiles.LayoutElementBuilders.ArcText.Builder setText(String);
}
public static final class LayoutElementBuilders.Box implements androidx.wear.tiles.LayoutElementBuilders.LayoutElement {
- method public static androidx.wear.tiles.LayoutElementBuilders.Box.Builder builder();
method public java.util.List<androidx.wear.tiles.LayoutElementBuilders.LayoutElement!> getContents();
method public androidx.wear.tiles.DimensionBuilders.ContainerDimension? getHeight();
method public androidx.wear.tiles.LayoutElementBuilders.HorizontalAlignmentProp? getHorizontalAlignment();
@@ -439,34 +422,29 @@
}
public static final class LayoutElementBuilders.Box.Builder implements androidx.wear.tiles.LayoutElementBuilders.LayoutElement.Builder {
+ ctor public LayoutElementBuilders.Box.Builder();
method public androidx.wear.tiles.LayoutElementBuilders.Box.Builder addContent(androidx.wear.tiles.LayoutElementBuilders.LayoutElement);
- method public androidx.wear.tiles.LayoutElementBuilders.Box.Builder addContent(androidx.wear.tiles.LayoutElementBuilders.LayoutElement.Builder);
method public androidx.wear.tiles.LayoutElementBuilders.Box build();
method public androidx.wear.tiles.LayoutElementBuilders.Box.Builder setHeight(androidx.wear.tiles.DimensionBuilders.ContainerDimension);
- method public androidx.wear.tiles.LayoutElementBuilders.Box.Builder setHeight(androidx.wear.tiles.DimensionBuilders.ContainerDimension.Builder);
method public androidx.wear.tiles.LayoutElementBuilders.Box.Builder setHorizontalAlignment(androidx.wear.tiles.LayoutElementBuilders.HorizontalAlignmentProp);
method public androidx.wear.tiles.LayoutElementBuilders.Box.Builder setHorizontalAlignment(int);
method public androidx.wear.tiles.LayoutElementBuilders.Box.Builder setModifiers(androidx.wear.tiles.ModifiersBuilders.Modifiers);
- method public androidx.wear.tiles.LayoutElementBuilders.Box.Builder setModifiers(androidx.wear.tiles.ModifiersBuilders.Modifiers.Builder);
method public androidx.wear.tiles.LayoutElementBuilders.Box.Builder setVerticalAlignment(androidx.wear.tiles.LayoutElementBuilders.VerticalAlignmentProp);
method public androidx.wear.tiles.LayoutElementBuilders.Box.Builder setVerticalAlignment(int);
method public androidx.wear.tiles.LayoutElementBuilders.Box.Builder setWidth(androidx.wear.tiles.DimensionBuilders.ContainerDimension);
- method public androidx.wear.tiles.LayoutElementBuilders.Box.Builder setWidth(androidx.wear.tiles.DimensionBuilders.ContainerDimension.Builder);
}
public static final class LayoutElementBuilders.ColorFilter {
- method public static androidx.wear.tiles.LayoutElementBuilders.ColorFilter.Builder builder();
method public androidx.wear.tiles.ColorBuilders.ColorProp? getTint();
}
public static final class LayoutElementBuilders.ColorFilter.Builder {
+ ctor public LayoutElementBuilders.ColorFilter.Builder();
method public androidx.wear.tiles.LayoutElementBuilders.ColorFilter build();
method public androidx.wear.tiles.LayoutElementBuilders.ColorFilter.Builder setTint(androidx.wear.tiles.ColorBuilders.ColorProp);
- method public androidx.wear.tiles.LayoutElementBuilders.ColorFilter.Builder setTint(androidx.wear.tiles.ColorBuilders.ColorProp.Builder);
}
public static final class LayoutElementBuilders.Column implements androidx.wear.tiles.LayoutElementBuilders.LayoutElement {
- method public static androidx.wear.tiles.LayoutElementBuilders.Column.Builder builder();
method public java.util.List<androidx.wear.tiles.LayoutElementBuilders.LayoutElement!> getContents();
method public androidx.wear.tiles.DimensionBuilders.ContainerDimension? getHeight();
method public androidx.wear.tiles.LayoutElementBuilders.HorizontalAlignmentProp? getHorizontalAlignment();
@@ -475,31 +453,27 @@
}
public static final class LayoutElementBuilders.Column.Builder implements androidx.wear.tiles.LayoutElementBuilders.LayoutElement.Builder {
+ ctor public LayoutElementBuilders.Column.Builder();
method public androidx.wear.tiles.LayoutElementBuilders.Column.Builder addContent(androidx.wear.tiles.LayoutElementBuilders.LayoutElement);
- method public androidx.wear.tiles.LayoutElementBuilders.Column.Builder addContent(androidx.wear.tiles.LayoutElementBuilders.LayoutElement.Builder);
method public androidx.wear.tiles.LayoutElementBuilders.Column build();
method public androidx.wear.tiles.LayoutElementBuilders.Column.Builder setHeight(androidx.wear.tiles.DimensionBuilders.ContainerDimension);
- method public androidx.wear.tiles.LayoutElementBuilders.Column.Builder setHeight(androidx.wear.tiles.DimensionBuilders.ContainerDimension.Builder);
method public androidx.wear.tiles.LayoutElementBuilders.Column.Builder setHorizontalAlignment(androidx.wear.tiles.LayoutElementBuilders.HorizontalAlignmentProp);
method public androidx.wear.tiles.LayoutElementBuilders.Column.Builder setHorizontalAlignment(int);
method public androidx.wear.tiles.LayoutElementBuilders.Column.Builder setModifiers(androidx.wear.tiles.ModifiersBuilders.Modifiers);
- method public androidx.wear.tiles.LayoutElementBuilders.Column.Builder setModifiers(androidx.wear.tiles.ModifiersBuilders.Modifiers.Builder);
method public androidx.wear.tiles.LayoutElementBuilders.Column.Builder setWidth(androidx.wear.tiles.DimensionBuilders.ContainerDimension);
- method public androidx.wear.tiles.LayoutElementBuilders.Column.Builder setWidth(androidx.wear.tiles.DimensionBuilders.ContainerDimension.Builder);
}
public static final class LayoutElementBuilders.ContentScaleModeProp {
- method public static androidx.wear.tiles.LayoutElementBuilders.ContentScaleModeProp.Builder builder();
method public int getValue();
}
public static final class LayoutElementBuilders.ContentScaleModeProp.Builder {
+ ctor public LayoutElementBuilders.ContentScaleModeProp.Builder();
method public androidx.wear.tiles.LayoutElementBuilders.ContentScaleModeProp build();
method public androidx.wear.tiles.LayoutElementBuilders.ContentScaleModeProp.Builder setValue(int);
}
public static final class LayoutElementBuilders.FontStyle {
- method public static androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder builder();
method public androidx.wear.tiles.ColorBuilders.ColorProp? getColor();
method public androidx.wear.tiles.TypeBuilders.BoolProp? getItalic();
method public androidx.wear.tiles.DimensionBuilders.EmProp? getLetterSpacing();
@@ -509,15 +483,13 @@
}
public static final class LayoutElementBuilders.FontStyle.Builder {
+ ctor public LayoutElementBuilders.FontStyle.Builder();
method public androidx.wear.tiles.LayoutElementBuilders.FontStyle build();
method public androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder setColor(androidx.wear.tiles.ColorBuilders.ColorProp);
- method public androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder setColor(androidx.wear.tiles.ColorBuilders.ColorProp.Builder);
method public androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder setItalic(androidx.wear.tiles.TypeBuilders.BoolProp);
method public androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder setItalic(boolean);
method public androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder setLetterSpacing(androidx.wear.tiles.DimensionBuilders.EmProp);
- method public androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder setLetterSpacing(androidx.wear.tiles.DimensionBuilders.EmProp.Builder);
method public androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder setSize(androidx.wear.tiles.DimensionBuilders.SpProp);
- method public androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder setSize(androidx.wear.tiles.DimensionBuilders.SpProp.Builder);
method public androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder setUnderline(androidx.wear.tiles.TypeBuilders.BoolProp);
method public androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder setUnderline(boolean);
method public androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder setWeight(androidx.wear.tiles.LayoutElementBuilders.FontWeightProp);
@@ -525,53 +497,40 @@
}
public static class LayoutElementBuilders.FontStyles {
- method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder body1();
method public static androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder body1(androidx.wear.tiles.DeviceParametersBuilders.DeviceParameters);
- method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder body2();
method public static androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder body2(androidx.wear.tiles.DeviceParametersBuilders.DeviceParameters);
- method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder button();
method public static androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder button(androidx.wear.tiles.DeviceParametersBuilders.DeviceParameters);
- method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder caption1();
method public static androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder caption1(androidx.wear.tiles.DeviceParametersBuilders.DeviceParameters);
- method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder caption2();
method public static androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder caption2(androidx.wear.tiles.DeviceParametersBuilders.DeviceParameters);
- method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder display1();
method public static androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder display1(androidx.wear.tiles.DeviceParametersBuilders.DeviceParameters);
- method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder display2();
method public static androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder display2(androidx.wear.tiles.DeviceParametersBuilders.DeviceParameters);
- method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder display3();
method public static androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder display3(androidx.wear.tiles.DeviceParametersBuilders.DeviceParameters);
- method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder title1();
method public static androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder title1(androidx.wear.tiles.DeviceParametersBuilders.DeviceParameters);
- method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder title2();
method public static androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder title2(androidx.wear.tiles.DeviceParametersBuilders.DeviceParameters);
- method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder title3();
method public static androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder title3(androidx.wear.tiles.DeviceParametersBuilders.DeviceParameters);
- method @Deprecated public static androidx.wear.tiles.LayoutElementBuilders.FontStyles withDeviceParameters(androidx.wear.tiles.DeviceParametersBuilders.DeviceParameters);
}
public static final class LayoutElementBuilders.FontWeightProp {
- method public static androidx.wear.tiles.LayoutElementBuilders.FontWeightProp.Builder builder();
method public int getValue();
}
public static final class LayoutElementBuilders.FontWeightProp.Builder {
+ ctor public LayoutElementBuilders.FontWeightProp.Builder();
method public androidx.wear.tiles.LayoutElementBuilders.FontWeightProp build();
method public androidx.wear.tiles.LayoutElementBuilders.FontWeightProp.Builder setValue(int);
}
public static final class LayoutElementBuilders.HorizontalAlignmentProp {
- method public static androidx.wear.tiles.LayoutElementBuilders.HorizontalAlignmentProp.Builder builder();
method public int getValue();
}
public static final class LayoutElementBuilders.HorizontalAlignmentProp.Builder {
+ ctor public LayoutElementBuilders.HorizontalAlignmentProp.Builder();
method public androidx.wear.tiles.LayoutElementBuilders.HorizontalAlignmentProp build();
method public androidx.wear.tiles.LayoutElementBuilders.HorizontalAlignmentProp.Builder setValue(int);
}
public static final class LayoutElementBuilders.Image implements androidx.wear.tiles.LayoutElementBuilders.LayoutElement {
- method public static androidx.wear.tiles.LayoutElementBuilders.Image.Builder builder();
method public androidx.wear.tiles.LayoutElementBuilders.ContentScaleModeProp? getContentScaleMode();
method public androidx.wear.tiles.DimensionBuilders.ImageDimension? getHeight();
method public androidx.wear.tiles.ModifiersBuilders.Modifiers? getModifiers();
@@ -580,28 +539,25 @@
}
public static final class LayoutElementBuilders.Image.Builder implements androidx.wear.tiles.LayoutElementBuilders.LayoutElement.Builder {
+ ctor public LayoutElementBuilders.Image.Builder();
method public androidx.wear.tiles.LayoutElementBuilders.Image build();
method public androidx.wear.tiles.LayoutElementBuilders.Image.Builder setContentScaleMode(androidx.wear.tiles.LayoutElementBuilders.ContentScaleModeProp);
method public androidx.wear.tiles.LayoutElementBuilders.Image.Builder setContentScaleMode(int);
method public androidx.wear.tiles.LayoutElementBuilders.Image.Builder setHeight(androidx.wear.tiles.DimensionBuilders.ImageDimension);
- method public androidx.wear.tiles.LayoutElementBuilders.Image.Builder setHeight(androidx.wear.tiles.DimensionBuilders.ImageDimension.Builder);
method public androidx.wear.tiles.LayoutElementBuilders.Image.Builder setModifiers(androidx.wear.tiles.ModifiersBuilders.Modifiers);
- method public androidx.wear.tiles.LayoutElementBuilders.Image.Builder setModifiers(androidx.wear.tiles.ModifiersBuilders.Modifiers.Builder);
method public androidx.wear.tiles.LayoutElementBuilders.Image.Builder setResourceId(androidx.wear.tiles.TypeBuilders.StringProp);
method public androidx.wear.tiles.LayoutElementBuilders.Image.Builder setResourceId(String);
method public androidx.wear.tiles.LayoutElementBuilders.Image.Builder setWidth(androidx.wear.tiles.DimensionBuilders.ImageDimension);
- method public androidx.wear.tiles.LayoutElementBuilders.Image.Builder setWidth(androidx.wear.tiles.DimensionBuilders.ImageDimension.Builder);
}
public static final class LayoutElementBuilders.Layout {
- method public static androidx.wear.tiles.LayoutElementBuilders.Layout.Builder builder();
method public androidx.wear.tiles.LayoutElementBuilders.LayoutElement? getRoot();
}
public static final class LayoutElementBuilders.Layout.Builder {
+ ctor public LayoutElementBuilders.Layout.Builder();
method public androidx.wear.tiles.LayoutElementBuilders.Layout build();
method public androidx.wear.tiles.LayoutElementBuilders.Layout.Builder setRoot(androidx.wear.tiles.LayoutElementBuilders.LayoutElement);
- method public androidx.wear.tiles.LayoutElementBuilders.Layout.Builder setRoot(androidx.wear.tiles.LayoutElementBuilders.LayoutElement.Builder);
}
public static interface LayoutElementBuilders.LayoutElement {
@@ -612,7 +568,6 @@
}
public static final class LayoutElementBuilders.Row implements androidx.wear.tiles.LayoutElementBuilders.LayoutElement {
- method public static androidx.wear.tiles.LayoutElementBuilders.Row.Builder builder();
method public java.util.List<androidx.wear.tiles.LayoutElementBuilders.LayoutElement!> getContents();
method public androidx.wear.tiles.DimensionBuilders.ContainerDimension? getHeight();
method public androidx.wear.tiles.ModifiersBuilders.Modifiers? getModifiers();
@@ -621,34 +576,28 @@
}
public static final class LayoutElementBuilders.Row.Builder implements androidx.wear.tiles.LayoutElementBuilders.LayoutElement.Builder {
+ ctor public LayoutElementBuilders.Row.Builder();
method public androidx.wear.tiles.LayoutElementBuilders.Row.Builder addContent(androidx.wear.tiles.LayoutElementBuilders.LayoutElement);
- method public androidx.wear.tiles.LayoutElementBuilders.Row.Builder addContent(androidx.wear.tiles.LayoutElementBuilders.LayoutElement.Builder);
method public androidx.wear.tiles.LayoutElementBuilders.Row build();
method public androidx.wear.tiles.LayoutElementBuilders.Row.Builder setHeight(androidx.wear.tiles.DimensionBuilders.ContainerDimension);
- method public androidx.wear.tiles.LayoutElementBuilders.Row.Builder setHeight(androidx.wear.tiles.DimensionBuilders.ContainerDimension.Builder);
method public androidx.wear.tiles.LayoutElementBuilders.Row.Builder setModifiers(androidx.wear.tiles.ModifiersBuilders.Modifiers);
- method public androidx.wear.tiles.LayoutElementBuilders.Row.Builder setModifiers(androidx.wear.tiles.ModifiersBuilders.Modifiers.Builder);
method public androidx.wear.tiles.LayoutElementBuilders.Row.Builder setVerticalAlignment(androidx.wear.tiles.LayoutElementBuilders.VerticalAlignmentProp);
method public androidx.wear.tiles.LayoutElementBuilders.Row.Builder setVerticalAlignment(int);
method public androidx.wear.tiles.LayoutElementBuilders.Row.Builder setWidth(androidx.wear.tiles.DimensionBuilders.ContainerDimension);
- method public androidx.wear.tiles.LayoutElementBuilders.Row.Builder setWidth(androidx.wear.tiles.DimensionBuilders.ContainerDimension.Builder);
}
public static final class LayoutElementBuilders.Spacer implements androidx.wear.tiles.LayoutElementBuilders.LayoutElement {
- method public static androidx.wear.tiles.LayoutElementBuilders.Spacer.Builder builder();
method public androidx.wear.tiles.DimensionBuilders.SpacerDimension? getHeight();
method public androidx.wear.tiles.ModifiersBuilders.Modifiers? getModifiers();
method public androidx.wear.tiles.DimensionBuilders.SpacerDimension? getWidth();
}
public static final class LayoutElementBuilders.Spacer.Builder implements androidx.wear.tiles.LayoutElementBuilders.LayoutElement.Builder {
+ ctor public LayoutElementBuilders.Spacer.Builder();
method public androidx.wear.tiles.LayoutElementBuilders.Spacer build();
method public androidx.wear.tiles.LayoutElementBuilders.Spacer.Builder setHeight(androidx.wear.tiles.DimensionBuilders.SpacerDimension);
- method public androidx.wear.tiles.LayoutElementBuilders.Spacer.Builder setHeight(androidx.wear.tiles.DimensionBuilders.SpacerDimension.Builder);
method public androidx.wear.tiles.LayoutElementBuilders.Spacer.Builder setModifiers(androidx.wear.tiles.ModifiersBuilders.Modifiers);
- method public androidx.wear.tiles.LayoutElementBuilders.Spacer.Builder setModifiers(androidx.wear.tiles.ModifiersBuilders.Modifiers.Builder);
method public androidx.wear.tiles.LayoutElementBuilders.Spacer.Builder setWidth(androidx.wear.tiles.DimensionBuilders.SpacerDimension);
- method public androidx.wear.tiles.LayoutElementBuilders.Spacer.Builder setWidth(androidx.wear.tiles.DimensionBuilders.SpacerDimension.Builder);
}
public static interface LayoutElementBuilders.Span {
@@ -659,7 +608,6 @@
}
public static final class LayoutElementBuilders.SpanImage implements androidx.wear.tiles.LayoutElementBuilders.Span {
- method public static androidx.wear.tiles.LayoutElementBuilders.SpanImage.Builder builder();
method public androidx.wear.tiles.LayoutElementBuilders.SpanVerticalAlignmentProp? getAlignment();
method public androidx.wear.tiles.DimensionBuilders.DpProp? getHeight();
method public androidx.wear.tiles.ModifiersBuilders.SpanModifiers? getModifiers();
@@ -668,48 +616,43 @@
}
public static final class LayoutElementBuilders.SpanImage.Builder implements androidx.wear.tiles.LayoutElementBuilders.Span.Builder {
+ ctor public LayoutElementBuilders.SpanImage.Builder();
method public androidx.wear.tiles.LayoutElementBuilders.SpanImage build();
method public androidx.wear.tiles.LayoutElementBuilders.SpanImage.Builder setAlignment(androidx.wear.tiles.LayoutElementBuilders.SpanVerticalAlignmentProp);
method public androidx.wear.tiles.LayoutElementBuilders.SpanImage.Builder setAlignment(int);
method public androidx.wear.tiles.LayoutElementBuilders.SpanImage.Builder setHeight(androidx.wear.tiles.DimensionBuilders.DpProp);
- method public androidx.wear.tiles.LayoutElementBuilders.SpanImage.Builder setHeight(androidx.wear.tiles.DimensionBuilders.DpProp.Builder);
method public androidx.wear.tiles.LayoutElementBuilders.SpanImage.Builder setModifiers(androidx.wear.tiles.ModifiersBuilders.SpanModifiers);
- method public androidx.wear.tiles.LayoutElementBuilders.SpanImage.Builder setModifiers(androidx.wear.tiles.ModifiersBuilders.SpanModifiers.Builder);
method public androidx.wear.tiles.LayoutElementBuilders.SpanImage.Builder setResourceId(androidx.wear.tiles.TypeBuilders.StringProp);
method public androidx.wear.tiles.LayoutElementBuilders.SpanImage.Builder setResourceId(String);
method public androidx.wear.tiles.LayoutElementBuilders.SpanImage.Builder setWidth(androidx.wear.tiles.DimensionBuilders.DpProp);
- method public androidx.wear.tiles.LayoutElementBuilders.SpanImage.Builder setWidth(androidx.wear.tiles.DimensionBuilders.DpProp.Builder);
}
public static final class LayoutElementBuilders.SpanText implements androidx.wear.tiles.LayoutElementBuilders.Span {
- method public static androidx.wear.tiles.LayoutElementBuilders.SpanText.Builder builder();
method public androidx.wear.tiles.LayoutElementBuilders.FontStyle? getFontStyle();
method public androidx.wear.tiles.ModifiersBuilders.SpanModifiers? getModifiers();
method public androidx.wear.tiles.TypeBuilders.StringProp? getText();
}
public static final class LayoutElementBuilders.SpanText.Builder implements androidx.wear.tiles.LayoutElementBuilders.Span.Builder {
+ ctor public LayoutElementBuilders.SpanText.Builder();
method public androidx.wear.tiles.LayoutElementBuilders.SpanText build();
method public androidx.wear.tiles.LayoutElementBuilders.SpanText.Builder setFontStyle(androidx.wear.tiles.LayoutElementBuilders.FontStyle);
- method public androidx.wear.tiles.LayoutElementBuilders.SpanText.Builder setFontStyle(androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder);
method public androidx.wear.tiles.LayoutElementBuilders.SpanText.Builder setModifiers(androidx.wear.tiles.ModifiersBuilders.SpanModifiers);
- method public androidx.wear.tiles.LayoutElementBuilders.SpanText.Builder setModifiers(androidx.wear.tiles.ModifiersBuilders.SpanModifiers.Builder);
method public androidx.wear.tiles.LayoutElementBuilders.SpanText.Builder setText(androidx.wear.tiles.TypeBuilders.StringProp);
method public androidx.wear.tiles.LayoutElementBuilders.SpanText.Builder setText(String);
}
public static final class LayoutElementBuilders.SpanVerticalAlignmentProp {
- method public static androidx.wear.tiles.LayoutElementBuilders.SpanVerticalAlignmentProp.Builder builder();
method public int getValue();
}
public static final class LayoutElementBuilders.SpanVerticalAlignmentProp.Builder {
+ ctor public LayoutElementBuilders.SpanVerticalAlignmentProp.Builder();
method public androidx.wear.tiles.LayoutElementBuilders.SpanVerticalAlignmentProp build();
method public androidx.wear.tiles.LayoutElementBuilders.SpanVerticalAlignmentProp.Builder setValue(int);
}
public static final class LayoutElementBuilders.Spannable implements androidx.wear.tiles.LayoutElementBuilders.LayoutElement {
- method public static androidx.wear.tiles.LayoutElementBuilders.Spannable.Builder builder();
method public androidx.wear.tiles.DimensionBuilders.SpProp? getLineHeight();
method public androidx.wear.tiles.TypeBuilders.Int32Prop? getMaxLines();
method public androidx.wear.tiles.ModifiersBuilders.Modifiers? getModifiers();
@@ -719,15 +662,13 @@
}
public static final class LayoutElementBuilders.Spannable.Builder implements androidx.wear.tiles.LayoutElementBuilders.LayoutElement.Builder {
+ ctor public LayoutElementBuilders.Spannable.Builder();
method public androidx.wear.tiles.LayoutElementBuilders.Spannable.Builder addSpan(androidx.wear.tiles.LayoutElementBuilders.Span);
- method public androidx.wear.tiles.LayoutElementBuilders.Spannable.Builder addSpan(androidx.wear.tiles.LayoutElementBuilders.Span.Builder);
method public androidx.wear.tiles.LayoutElementBuilders.Spannable build();
method public androidx.wear.tiles.LayoutElementBuilders.Spannable.Builder setLineHeight(androidx.wear.tiles.DimensionBuilders.SpProp);
- method public androidx.wear.tiles.LayoutElementBuilders.Spannable.Builder setLineHeight(androidx.wear.tiles.DimensionBuilders.SpProp.Builder);
method public androidx.wear.tiles.LayoutElementBuilders.Spannable.Builder setMaxLines(androidx.wear.tiles.TypeBuilders.Int32Prop);
method public androidx.wear.tiles.LayoutElementBuilders.Spannable.Builder setMaxLines(@IntRange(from=1) int);
method public androidx.wear.tiles.LayoutElementBuilders.Spannable.Builder setModifiers(androidx.wear.tiles.ModifiersBuilders.Modifiers);
- method public androidx.wear.tiles.LayoutElementBuilders.Spannable.Builder setModifiers(androidx.wear.tiles.ModifiersBuilders.Modifiers.Builder);
method public androidx.wear.tiles.LayoutElementBuilders.Spannable.Builder setMultilineAlignment(androidx.wear.tiles.LayoutElementBuilders.HorizontalAlignmentProp);
method public androidx.wear.tiles.LayoutElementBuilders.Spannable.Builder setMultilineAlignment(int);
method public androidx.wear.tiles.LayoutElementBuilders.Spannable.Builder setOverflow(androidx.wear.tiles.LayoutElementBuilders.TextOverflowProp);
@@ -735,7 +676,6 @@
}
public static final class LayoutElementBuilders.Text implements androidx.wear.tiles.LayoutElementBuilders.LayoutElement {
- method public static androidx.wear.tiles.LayoutElementBuilders.Text.Builder builder();
method public androidx.wear.tiles.LayoutElementBuilders.FontStyle? getFontStyle();
method public androidx.wear.tiles.DimensionBuilders.SpProp? getLineHeight();
method public androidx.wear.tiles.TypeBuilders.Int32Prop? getMaxLines();
@@ -746,15 +686,13 @@
}
public static final class LayoutElementBuilders.Text.Builder implements androidx.wear.tiles.LayoutElementBuilders.LayoutElement.Builder {
+ ctor public LayoutElementBuilders.Text.Builder();
method public androidx.wear.tiles.LayoutElementBuilders.Text build();
method public androidx.wear.tiles.LayoutElementBuilders.Text.Builder setFontStyle(androidx.wear.tiles.LayoutElementBuilders.FontStyle);
- method public androidx.wear.tiles.LayoutElementBuilders.Text.Builder setFontStyle(androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder);
method public androidx.wear.tiles.LayoutElementBuilders.Text.Builder setLineHeight(androidx.wear.tiles.DimensionBuilders.SpProp);
- method public androidx.wear.tiles.LayoutElementBuilders.Text.Builder setLineHeight(androidx.wear.tiles.DimensionBuilders.SpProp.Builder);
method public androidx.wear.tiles.LayoutElementBuilders.Text.Builder setMaxLines(androidx.wear.tiles.TypeBuilders.Int32Prop);
method public androidx.wear.tiles.LayoutElementBuilders.Text.Builder setMaxLines(@IntRange(from=1) int);
method public androidx.wear.tiles.LayoutElementBuilders.Text.Builder setModifiers(androidx.wear.tiles.ModifiersBuilders.Modifiers);
- method public androidx.wear.tiles.LayoutElementBuilders.Text.Builder setModifiers(androidx.wear.tiles.ModifiersBuilders.Modifiers.Builder);
method public androidx.wear.tiles.LayoutElementBuilders.Text.Builder setMultilineAlignment(androidx.wear.tiles.LayoutElementBuilders.TextAlignmentProp);
method public androidx.wear.tiles.LayoutElementBuilders.Text.Builder setMultilineAlignment(int);
method public androidx.wear.tiles.LayoutElementBuilders.Text.Builder setOverflow(androidx.wear.tiles.LayoutElementBuilders.TextOverflowProp);
@@ -764,31 +702,31 @@
}
public static final class LayoutElementBuilders.TextAlignmentProp {
- method public static androidx.wear.tiles.LayoutElementBuilders.TextAlignmentProp.Builder builder();
method public int getValue();
}
public static final class LayoutElementBuilders.TextAlignmentProp.Builder {
+ ctor public LayoutElementBuilders.TextAlignmentProp.Builder();
method public androidx.wear.tiles.LayoutElementBuilders.TextAlignmentProp build();
method public androidx.wear.tiles.LayoutElementBuilders.TextAlignmentProp.Builder setValue(int);
}
public static final class LayoutElementBuilders.TextOverflowProp {
- method public static androidx.wear.tiles.LayoutElementBuilders.TextOverflowProp.Builder builder();
method public int getValue();
}
public static final class LayoutElementBuilders.TextOverflowProp.Builder {
+ ctor public LayoutElementBuilders.TextOverflowProp.Builder();
method public androidx.wear.tiles.LayoutElementBuilders.TextOverflowProp build();
method public androidx.wear.tiles.LayoutElementBuilders.TextOverflowProp.Builder setValue(int);
}
public static final class LayoutElementBuilders.VerticalAlignmentProp {
- method public static androidx.wear.tiles.LayoutElementBuilders.VerticalAlignmentProp.Builder builder();
method public int getValue();
}
public static final class LayoutElementBuilders.VerticalAlignmentProp.Builder {
+ ctor public LayoutElementBuilders.VerticalAlignmentProp.Builder();
method public androidx.wear.tiles.LayoutElementBuilders.VerticalAlignmentProp build();
method public androidx.wear.tiles.LayoutElementBuilders.VerticalAlignmentProp.Builder setValue(int);
}
@@ -797,73 +735,64 @@
}
public static final class ModifiersBuilders.ArcModifiers {
- method public static androidx.wear.tiles.ModifiersBuilders.ArcModifiers.Builder builder();
method public androidx.wear.tiles.ModifiersBuilders.Clickable? getClickable();
method public androidx.wear.tiles.ModifiersBuilders.Semantics? getSemantics();
}
public static final class ModifiersBuilders.ArcModifiers.Builder {
+ ctor public ModifiersBuilders.ArcModifiers.Builder();
method public androidx.wear.tiles.ModifiersBuilders.ArcModifiers build();
method public androidx.wear.tiles.ModifiersBuilders.ArcModifiers.Builder setClickable(androidx.wear.tiles.ModifiersBuilders.Clickable);
- method public androidx.wear.tiles.ModifiersBuilders.ArcModifiers.Builder setClickable(androidx.wear.tiles.ModifiersBuilders.Clickable.Builder);
method public androidx.wear.tiles.ModifiersBuilders.ArcModifiers.Builder setSemantics(androidx.wear.tiles.ModifiersBuilders.Semantics);
- method public androidx.wear.tiles.ModifiersBuilders.ArcModifiers.Builder setSemantics(androidx.wear.tiles.ModifiersBuilders.Semantics.Builder);
}
public static final class ModifiersBuilders.Background {
- method public static androidx.wear.tiles.ModifiersBuilders.Background.Builder builder();
method public androidx.wear.tiles.ColorBuilders.ColorProp? getColor();
method public androidx.wear.tiles.ModifiersBuilders.Corner? getCorner();
}
public static final class ModifiersBuilders.Background.Builder {
+ ctor public ModifiersBuilders.Background.Builder();
method public androidx.wear.tiles.ModifiersBuilders.Background build();
method public androidx.wear.tiles.ModifiersBuilders.Background.Builder setColor(androidx.wear.tiles.ColorBuilders.ColorProp);
- method public androidx.wear.tiles.ModifiersBuilders.Background.Builder setColor(androidx.wear.tiles.ColorBuilders.ColorProp.Builder);
method public androidx.wear.tiles.ModifiersBuilders.Background.Builder setCorner(androidx.wear.tiles.ModifiersBuilders.Corner);
- method public androidx.wear.tiles.ModifiersBuilders.Background.Builder setCorner(androidx.wear.tiles.ModifiersBuilders.Corner.Builder);
}
public static final class ModifiersBuilders.Border {
- method public static androidx.wear.tiles.ModifiersBuilders.Border.Builder builder();
method public androidx.wear.tiles.ColorBuilders.ColorProp? getColor();
method public androidx.wear.tiles.DimensionBuilders.DpProp? getWidth();
}
public static final class ModifiersBuilders.Border.Builder {
+ ctor public ModifiersBuilders.Border.Builder();
method public androidx.wear.tiles.ModifiersBuilders.Border build();
method public androidx.wear.tiles.ModifiersBuilders.Border.Builder setColor(androidx.wear.tiles.ColorBuilders.ColorProp);
- method public androidx.wear.tiles.ModifiersBuilders.Border.Builder setColor(androidx.wear.tiles.ColorBuilders.ColorProp.Builder);
method public androidx.wear.tiles.ModifiersBuilders.Border.Builder setWidth(androidx.wear.tiles.DimensionBuilders.DpProp);
- method public androidx.wear.tiles.ModifiersBuilders.Border.Builder setWidth(androidx.wear.tiles.DimensionBuilders.DpProp.Builder);
}
public static final class ModifiersBuilders.Clickable {
- method public static androidx.wear.tiles.ModifiersBuilders.Clickable.Builder builder();
method public String getId();
method public androidx.wear.tiles.ActionBuilders.Action? getOnClick();
}
public static final class ModifiersBuilders.Clickable.Builder {
+ ctor public ModifiersBuilders.Clickable.Builder();
method public androidx.wear.tiles.ModifiersBuilders.Clickable build();
method public androidx.wear.tiles.ModifiersBuilders.Clickable.Builder setId(String);
method public androidx.wear.tiles.ModifiersBuilders.Clickable.Builder setOnClick(androidx.wear.tiles.ActionBuilders.Action);
- method public androidx.wear.tiles.ModifiersBuilders.Clickable.Builder setOnClick(androidx.wear.tiles.ActionBuilders.Action.Builder);
}
public static final class ModifiersBuilders.Corner {
- method public static androidx.wear.tiles.ModifiersBuilders.Corner.Builder builder();
method public androidx.wear.tiles.DimensionBuilders.DpProp? getRadius();
}
public static final class ModifiersBuilders.Corner.Builder {
+ ctor public ModifiersBuilders.Corner.Builder();
method public androidx.wear.tiles.ModifiersBuilders.Corner build();
method public androidx.wear.tiles.ModifiersBuilders.Corner.Builder setRadius(androidx.wear.tiles.DimensionBuilders.DpProp);
- method public androidx.wear.tiles.ModifiersBuilders.Corner.Builder setRadius(androidx.wear.tiles.DimensionBuilders.DpProp.Builder);
}
public static final class ModifiersBuilders.Modifiers {
- method public static androidx.wear.tiles.ModifiersBuilders.Modifiers.Builder builder();
method public androidx.wear.tiles.ModifiersBuilders.Background? getBackground();
method public androidx.wear.tiles.ModifiersBuilders.Border? getBorder();
method public androidx.wear.tiles.ModifiersBuilders.Clickable? getClickable();
@@ -872,21 +801,16 @@
}
public static final class ModifiersBuilders.Modifiers.Builder {
+ ctor public ModifiersBuilders.Modifiers.Builder();
method public androidx.wear.tiles.ModifiersBuilders.Modifiers build();
method public androidx.wear.tiles.ModifiersBuilders.Modifiers.Builder setBackground(androidx.wear.tiles.ModifiersBuilders.Background);
- method public androidx.wear.tiles.ModifiersBuilders.Modifiers.Builder setBackground(androidx.wear.tiles.ModifiersBuilders.Background.Builder);
method public androidx.wear.tiles.ModifiersBuilders.Modifiers.Builder setBorder(androidx.wear.tiles.ModifiersBuilders.Border);
- method public androidx.wear.tiles.ModifiersBuilders.Modifiers.Builder setBorder(androidx.wear.tiles.ModifiersBuilders.Border.Builder);
method public androidx.wear.tiles.ModifiersBuilders.Modifiers.Builder setClickable(androidx.wear.tiles.ModifiersBuilders.Clickable);
- method public androidx.wear.tiles.ModifiersBuilders.Modifiers.Builder setClickable(androidx.wear.tiles.ModifiersBuilders.Clickable.Builder);
method public androidx.wear.tiles.ModifiersBuilders.Modifiers.Builder setPadding(androidx.wear.tiles.ModifiersBuilders.Padding);
- method public androidx.wear.tiles.ModifiersBuilders.Modifiers.Builder setPadding(androidx.wear.tiles.ModifiersBuilders.Padding.Builder);
method public androidx.wear.tiles.ModifiersBuilders.Modifiers.Builder setSemantics(androidx.wear.tiles.ModifiersBuilders.Semantics);
- method public androidx.wear.tiles.ModifiersBuilders.Modifiers.Builder setSemantics(androidx.wear.tiles.ModifiersBuilders.Semantics.Builder);
}
public static final class ModifiersBuilders.Padding {
- method public static androidx.wear.tiles.ModifiersBuilders.Padding.Builder builder();
method public androidx.wear.tiles.DimensionBuilders.DpProp? getBottom();
method public androidx.wear.tiles.DimensionBuilders.DpProp? getEnd();
method public androidx.wear.tiles.TypeBuilders.BoolProp? getRtlAware();
@@ -895,72 +819,64 @@
}
public static final class ModifiersBuilders.Padding.Builder {
+ ctor public ModifiersBuilders.Padding.Builder();
method public androidx.wear.tiles.ModifiersBuilders.Padding build();
method public androidx.wear.tiles.ModifiersBuilders.Padding.Builder setAll(androidx.wear.tiles.DimensionBuilders.DpProp);
- method public androidx.wear.tiles.ModifiersBuilders.Padding.Builder setAll(androidx.wear.tiles.DimensionBuilders.DpProp.Builder);
method public androidx.wear.tiles.ModifiersBuilders.Padding.Builder setBottom(androidx.wear.tiles.DimensionBuilders.DpProp);
- method public androidx.wear.tiles.ModifiersBuilders.Padding.Builder setBottom(androidx.wear.tiles.DimensionBuilders.DpProp.Builder);
method public androidx.wear.tiles.ModifiersBuilders.Padding.Builder setEnd(androidx.wear.tiles.DimensionBuilders.DpProp);
- method public androidx.wear.tiles.ModifiersBuilders.Padding.Builder setEnd(androidx.wear.tiles.DimensionBuilders.DpProp.Builder);
method public androidx.wear.tiles.ModifiersBuilders.Padding.Builder setRtlAware(androidx.wear.tiles.TypeBuilders.BoolProp);
method public androidx.wear.tiles.ModifiersBuilders.Padding.Builder setRtlAware(boolean);
method public androidx.wear.tiles.ModifiersBuilders.Padding.Builder setStart(androidx.wear.tiles.DimensionBuilders.DpProp);
- method public androidx.wear.tiles.ModifiersBuilders.Padding.Builder setStart(androidx.wear.tiles.DimensionBuilders.DpProp.Builder);
method public androidx.wear.tiles.ModifiersBuilders.Padding.Builder setTop(androidx.wear.tiles.DimensionBuilders.DpProp);
- method public androidx.wear.tiles.ModifiersBuilders.Padding.Builder setTop(androidx.wear.tiles.DimensionBuilders.DpProp.Builder);
}
public static final class ModifiersBuilders.Semantics {
- method public static androidx.wear.tiles.ModifiersBuilders.Semantics.Builder builder();
method public String getContentDescription();
}
public static final class ModifiersBuilders.Semantics.Builder {
+ ctor public ModifiersBuilders.Semantics.Builder();
method public androidx.wear.tiles.ModifiersBuilders.Semantics build();
method public androidx.wear.tiles.ModifiersBuilders.Semantics.Builder setContentDescription(String);
}
public static final class ModifiersBuilders.SpanModifiers {
- method public static androidx.wear.tiles.ModifiersBuilders.SpanModifiers.Builder builder();
method public androidx.wear.tiles.ModifiersBuilders.Clickable? getClickable();
}
public static final class ModifiersBuilders.SpanModifiers.Builder {
+ ctor public ModifiersBuilders.SpanModifiers.Builder();
method public androidx.wear.tiles.ModifiersBuilders.SpanModifiers build();
method public androidx.wear.tiles.ModifiersBuilders.SpanModifiers.Builder setClickable(androidx.wear.tiles.ModifiersBuilders.Clickable);
- method public androidx.wear.tiles.ModifiersBuilders.SpanModifiers.Builder setClickable(androidx.wear.tiles.ModifiersBuilders.Clickable.Builder);
}
public final class RequestBuilders {
}
public static final class RequestBuilders.ResourcesRequest {
- method public static androidx.wear.tiles.RequestBuilders.ResourcesRequest.Builder builder();
method public androidx.wear.tiles.DeviceParametersBuilders.DeviceParameters? getDeviceParameters();
method public java.util.List<java.lang.String!> getResourceIds();
method public String getVersion();
}
public static final class RequestBuilders.ResourcesRequest.Builder {
+ ctor public RequestBuilders.ResourcesRequest.Builder();
method public androidx.wear.tiles.RequestBuilders.ResourcesRequest.Builder addResourceId(String);
method public androidx.wear.tiles.RequestBuilders.ResourcesRequest build();
method public androidx.wear.tiles.RequestBuilders.ResourcesRequest.Builder setDeviceParameters(androidx.wear.tiles.DeviceParametersBuilders.DeviceParameters);
- method public androidx.wear.tiles.RequestBuilders.ResourcesRequest.Builder setDeviceParameters(androidx.wear.tiles.DeviceParametersBuilders.DeviceParameters.Builder);
method public androidx.wear.tiles.RequestBuilders.ResourcesRequest.Builder setVersion(String);
}
public static final class RequestBuilders.TileRequest {
- method public static androidx.wear.tiles.RequestBuilders.TileRequest.Builder builder();
method public androidx.wear.tiles.DeviceParametersBuilders.DeviceParameters? getDeviceParameters();
method public androidx.wear.tiles.StateBuilders.State? getState();
}
public static final class RequestBuilders.TileRequest.Builder {
+ ctor public RequestBuilders.TileRequest.Builder();
method public androidx.wear.tiles.RequestBuilders.TileRequest build();
method public androidx.wear.tiles.RequestBuilders.TileRequest.Builder setDeviceParameters(androidx.wear.tiles.DeviceParametersBuilders.DeviceParameters);
- method public androidx.wear.tiles.RequestBuilders.TileRequest.Builder setDeviceParameters(androidx.wear.tiles.DeviceParametersBuilders.DeviceParameters.Builder);
method public androidx.wear.tiles.RequestBuilders.TileRequest.Builder setState(androidx.wear.tiles.StateBuilders.State);
- method public androidx.wear.tiles.RequestBuilders.TileRequest.Builder setState(androidx.wear.tiles.StateBuilders.State.Builder);
}
public final class ResourceBuilders {
@@ -969,31 +885,28 @@
}
public static final class ResourceBuilders.AndroidImageResourceByResId {
- method public static androidx.wear.tiles.ResourceBuilders.AndroidImageResourceByResId.Builder builder();
method @DrawableRes public int getResourceId();
}
public static final class ResourceBuilders.AndroidImageResourceByResId.Builder {
+ ctor public ResourceBuilders.AndroidImageResourceByResId.Builder();
method public androidx.wear.tiles.ResourceBuilders.AndroidImageResourceByResId build();
method public androidx.wear.tiles.ResourceBuilders.AndroidImageResourceByResId.Builder setResourceId(@DrawableRes int);
}
public static final class ResourceBuilders.ImageResource {
- method public static androidx.wear.tiles.ResourceBuilders.ImageResource.Builder builder();
method public androidx.wear.tiles.ResourceBuilders.AndroidImageResourceByResId? getAndroidResourceByResId();
method public androidx.wear.tiles.ResourceBuilders.InlineImageResource? getInlineResource();
}
public static final class ResourceBuilders.ImageResource.Builder {
+ ctor public ResourceBuilders.ImageResource.Builder();
method public androidx.wear.tiles.ResourceBuilders.ImageResource build();
method public androidx.wear.tiles.ResourceBuilders.ImageResource.Builder setAndroidResourceByResId(androidx.wear.tiles.ResourceBuilders.AndroidImageResourceByResId);
- method public androidx.wear.tiles.ResourceBuilders.ImageResource.Builder setAndroidResourceByResId(androidx.wear.tiles.ResourceBuilders.AndroidImageResourceByResId.Builder);
method public androidx.wear.tiles.ResourceBuilders.ImageResource.Builder setInlineResource(androidx.wear.tiles.ResourceBuilders.InlineImageResource);
- method public androidx.wear.tiles.ResourceBuilders.ImageResource.Builder setInlineResource(androidx.wear.tiles.ResourceBuilders.InlineImageResource.Builder);
}
public static final class ResourceBuilders.InlineImageResource {
- method public static androidx.wear.tiles.ResourceBuilders.InlineImageResource.Builder builder();
method public byte[] getData();
method public int getFormat();
method @Dimension(unit=androidx.annotation.Dimension.PX) public int getHeightPx();
@@ -1001,6 +914,7 @@
}
public static final class ResourceBuilders.InlineImageResource.Builder {
+ ctor public ResourceBuilders.InlineImageResource.Builder();
method public androidx.wear.tiles.ResourceBuilders.InlineImageResource build();
method public androidx.wear.tiles.ResourceBuilders.InlineImageResource.Builder setData(byte[]);
method public androidx.wear.tiles.ResourceBuilders.InlineImageResource.Builder setFormat(int);
@@ -1009,14 +923,13 @@
}
public static final class ResourceBuilders.Resources {
- method public static androidx.wear.tiles.ResourceBuilders.Resources.Builder builder();
method public java.util.Map<java.lang.String!,androidx.wear.tiles.ResourceBuilders.ImageResource!> getIdToImageMapping();
method public String getVersion();
}
public static final class ResourceBuilders.Resources.Builder {
+ ctor public ResourceBuilders.Resources.Builder();
method public androidx.wear.tiles.ResourceBuilders.Resources.Builder addIdToImageMapping(String, androidx.wear.tiles.ResourceBuilders.ImageResource);
- method public androidx.wear.tiles.ResourceBuilders.Resources.Builder addIdToImageMapping(String, androidx.wear.tiles.ResourceBuilders.ImageResource.Builder);
method public androidx.wear.tiles.ResourceBuilders.Resources build();
method public androidx.wear.tiles.ResourceBuilders.Resources.Builder setVersion(String);
}
@@ -1025,11 +938,11 @@
}
public static final class StateBuilders.State {
- method public static androidx.wear.tiles.StateBuilders.State.Builder builder();
method public String getLastClickableId();
}
public static final class StateBuilders.State.Builder {
+ ctor public StateBuilders.State.Builder();
method public androidx.wear.tiles.StateBuilders.State build();
}
@@ -1037,18 +950,17 @@
}
public static final class TileBuilders.Tile {
- method public static androidx.wear.tiles.TileBuilders.Tile.Builder builder();
method public long getFreshnessIntervalMillis();
method public String getResourcesVersion();
method public androidx.wear.tiles.TimelineBuilders.Timeline? getTimeline();
}
public static final class TileBuilders.Tile.Builder {
+ ctor public TileBuilders.Tile.Builder();
method public androidx.wear.tiles.TileBuilders.Tile build();
method public androidx.wear.tiles.TileBuilders.Tile.Builder setFreshnessIntervalMillis(long);
method public androidx.wear.tiles.TileBuilders.Tile.Builder setResourcesVersion(String);
method public androidx.wear.tiles.TileBuilders.Tile.Builder setTimeline(androidx.wear.tiles.TimelineBuilders.Timeline);
- method public androidx.wear.tiles.TileBuilders.Tile.Builder setTimeline(androidx.wear.tiles.TimelineBuilders.Timeline.Builder);
}
public abstract class TileProviderService extends android.app.Service {
@@ -1074,81 +986,78 @@
}
public static final class TimelineBuilders.TimeInterval {
- method public static androidx.wear.tiles.TimelineBuilders.TimeInterval.Builder builder();
method public long getEndMillis();
method public long getStartMillis();
}
public static final class TimelineBuilders.TimeInterval.Builder {
+ ctor public TimelineBuilders.TimeInterval.Builder();
method public androidx.wear.tiles.TimelineBuilders.TimeInterval build();
method public androidx.wear.tiles.TimelineBuilders.TimeInterval.Builder setEndMillis(long);
method public androidx.wear.tiles.TimelineBuilders.TimeInterval.Builder setStartMillis(long);
}
public static final class TimelineBuilders.Timeline {
- method public static androidx.wear.tiles.TimelineBuilders.Timeline.Builder builder();
method public java.util.List<androidx.wear.tiles.TimelineBuilders.TimelineEntry!> getTimelineEntries();
}
public static final class TimelineBuilders.Timeline.Builder {
+ ctor public TimelineBuilders.Timeline.Builder();
method public androidx.wear.tiles.TimelineBuilders.Timeline.Builder addTimelineEntry(androidx.wear.tiles.TimelineBuilders.TimelineEntry);
- method public androidx.wear.tiles.TimelineBuilders.Timeline.Builder addTimelineEntry(androidx.wear.tiles.TimelineBuilders.TimelineEntry.Builder);
method public androidx.wear.tiles.TimelineBuilders.Timeline build();
}
public static final class TimelineBuilders.TimelineEntry {
- method public static androidx.wear.tiles.TimelineBuilders.TimelineEntry.Builder builder();
method public androidx.wear.tiles.LayoutElementBuilders.Layout? getLayout();
method public androidx.wear.tiles.TimelineBuilders.TimeInterval? getValidity();
}
public static final class TimelineBuilders.TimelineEntry.Builder {
+ ctor public TimelineBuilders.TimelineEntry.Builder();
method public androidx.wear.tiles.TimelineBuilders.TimelineEntry build();
method public androidx.wear.tiles.TimelineBuilders.TimelineEntry.Builder setLayout(androidx.wear.tiles.LayoutElementBuilders.Layout);
- method public androidx.wear.tiles.TimelineBuilders.TimelineEntry.Builder setLayout(androidx.wear.tiles.LayoutElementBuilders.Layout.Builder);
method public androidx.wear.tiles.TimelineBuilders.TimelineEntry.Builder setValidity(androidx.wear.tiles.TimelineBuilders.TimeInterval);
- method public androidx.wear.tiles.TimelineBuilders.TimelineEntry.Builder setValidity(androidx.wear.tiles.TimelineBuilders.TimeInterval.Builder);
}
public final class TypeBuilders {
}
public static final class TypeBuilders.BoolProp {
- method public static androidx.wear.tiles.TypeBuilders.BoolProp.Builder builder();
method public boolean getValue();
}
public static final class TypeBuilders.BoolProp.Builder {
+ ctor public TypeBuilders.BoolProp.Builder();
method public androidx.wear.tiles.TypeBuilders.BoolProp build();
method public androidx.wear.tiles.TypeBuilders.BoolProp.Builder setValue(boolean);
}
public static final class TypeBuilders.FloatProp {
- method public static androidx.wear.tiles.TypeBuilders.FloatProp.Builder builder();
method public float getValue();
}
public static final class TypeBuilders.FloatProp.Builder {
+ ctor public TypeBuilders.FloatProp.Builder();
method public androidx.wear.tiles.TypeBuilders.FloatProp build();
method public androidx.wear.tiles.TypeBuilders.FloatProp.Builder setValue(float);
}
public static final class TypeBuilders.Int32Prop {
- method public static androidx.wear.tiles.TypeBuilders.Int32Prop.Builder builder();
method public int getValue();
}
public static final class TypeBuilders.Int32Prop.Builder {
+ ctor public TypeBuilders.Int32Prop.Builder();
method public androidx.wear.tiles.TypeBuilders.Int32Prop build();
method public androidx.wear.tiles.TypeBuilders.Int32Prop.Builder setValue(int);
}
public static final class TypeBuilders.StringProp {
- method public static androidx.wear.tiles.TypeBuilders.StringProp.Builder builder();
method public String getValue();
}
public static final class TypeBuilders.StringProp.Builder {
+ ctor public TypeBuilders.StringProp.Builder();
method public androidx.wear.tiles.TypeBuilders.StringProp build();
method public androidx.wear.tiles.TypeBuilders.StringProp.Builder setValue(String);
}
diff --git a/wear/tiles/tiles/api/public_plus_experimental_current.txt b/wear/tiles/tiles/api/public_plus_experimental_current.txt
index 7e68be6..5c4ad7e 100644
--- a/wear/tiles/tiles/api/public_plus_experimental_current.txt
+++ b/wear/tiles/tiles/api/public_plus_experimental_current.txt
@@ -17,36 +17,35 @@
}
public static final class ActionBuilders.AndroidActivity {
- method public static androidx.wear.tiles.ActionBuilders.AndroidActivity.Builder builder();
method public String getClassName();
method public java.util.Map<java.lang.String!,androidx.wear.tiles.ActionBuilders.AndroidExtra!> getKeyToExtraMapping();
method public String getPackageName();
}
public static final class ActionBuilders.AndroidActivity.Builder {
+ ctor public ActionBuilders.AndroidActivity.Builder();
method public androidx.wear.tiles.ActionBuilders.AndroidActivity.Builder addKeyToExtraMapping(String, androidx.wear.tiles.ActionBuilders.AndroidExtra);
- method public androidx.wear.tiles.ActionBuilders.AndroidActivity.Builder addKeyToExtraMapping(String, androidx.wear.tiles.ActionBuilders.AndroidExtra.Builder);
method public androidx.wear.tiles.ActionBuilders.AndroidActivity build();
method public androidx.wear.tiles.ActionBuilders.AndroidActivity.Builder setClassName(String);
method public androidx.wear.tiles.ActionBuilders.AndroidActivity.Builder setPackageName(String);
}
public static final class ActionBuilders.AndroidBooleanExtra implements androidx.wear.tiles.ActionBuilders.AndroidExtra {
- method public static androidx.wear.tiles.ActionBuilders.AndroidBooleanExtra.Builder builder();
method public boolean getValue();
}
public static final class ActionBuilders.AndroidBooleanExtra.Builder implements androidx.wear.tiles.ActionBuilders.AndroidExtra.Builder {
+ ctor public ActionBuilders.AndroidBooleanExtra.Builder();
method public androidx.wear.tiles.ActionBuilders.AndroidBooleanExtra build();
method public androidx.wear.tiles.ActionBuilders.AndroidBooleanExtra.Builder setValue(boolean);
}
public static final class ActionBuilders.AndroidDoubleExtra implements androidx.wear.tiles.ActionBuilders.AndroidExtra {
- method public static androidx.wear.tiles.ActionBuilders.AndroidDoubleExtra.Builder builder();
method public double getValue();
}
public static final class ActionBuilders.AndroidDoubleExtra.Builder implements androidx.wear.tiles.ActionBuilders.AndroidExtra.Builder {
+ ctor public ActionBuilders.AndroidDoubleExtra.Builder();
method public androidx.wear.tiles.ActionBuilders.AndroidDoubleExtra build();
method public androidx.wear.tiles.ActionBuilders.AndroidDoubleExtra.Builder setValue(double);
}
@@ -59,55 +58,53 @@
}
public static final class ActionBuilders.AndroidIntExtra implements androidx.wear.tiles.ActionBuilders.AndroidExtra {
- method public static androidx.wear.tiles.ActionBuilders.AndroidIntExtra.Builder builder();
method public int getValue();
}
public static final class ActionBuilders.AndroidIntExtra.Builder implements androidx.wear.tiles.ActionBuilders.AndroidExtra.Builder {
+ ctor public ActionBuilders.AndroidIntExtra.Builder();
method public androidx.wear.tiles.ActionBuilders.AndroidIntExtra build();
method public androidx.wear.tiles.ActionBuilders.AndroidIntExtra.Builder setValue(int);
}
public static final class ActionBuilders.AndroidLongExtra implements androidx.wear.tiles.ActionBuilders.AndroidExtra {
- method public static androidx.wear.tiles.ActionBuilders.AndroidLongExtra.Builder builder();
method public long getValue();
}
public static final class ActionBuilders.AndroidLongExtra.Builder implements androidx.wear.tiles.ActionBuilders.AndroidExtra.Builder {
+ ctor public ActionBuilders.AndroidLongExtra.Builder();
method public androidx.wear.tiles.ActionBuilders.AndroidLongExtra build();
method public androidx.wear.tiles.ActionBuilders.AndroidLongExtra.Builder setValue(long);
}
public static final class ActionBuilders.AndroidStringExtra implements androidx.wear.tiles.ActionBuilders.AndroidExtra {
- method public static androidx.wear.tiles.ActionBuilders.AndroidStringExtra.Builder builder();
method public String getValue();
}
public static final class ActionBuilders.AndroidStringExtra.Builder implements androidx.wear.tiles.ActionBuilders.AndroidExtra.Builder {
+ ctor public ActionBuilders.AndroidStringExtra.Builder();
method public androidx.wear.tiles.ActionBuilders.AndroidStringExtra build();
method public androidx.wear.tiles.ActionBuilders.AndroidStringExtra.Builder setValue(String);
}
public static final class ActionBuilders.LaunchAction implements androidx.wear.tiles.ActionBuilders.Action {
- method public static androidx.wear.tiles.ActionBuilders.LaunchAction.Builder builder();
method public androidx.wear.tiles.ActionBuilders.AndroidActivity? getAndroidActivity();
}
public static final class ActionBuilders.LaunchAction.Builder implements androidx.wear.tiles.ActionBuilders.Action.Builder {
+ ctor public ActionBuilders.LaunchAction.Builder();
method public androidx.wear.tiles.ActionBuilders.LaunchAction build();
method public androidx.wear.tiles.ActionBuilders.LaunchAction.Builder setAndroidActivity(androidx.wear.tiles.ActionBuilders.AndroidActivity);
- method public androidx.wear.tiles.ActionBuilders.LaunchAction.Builder setAndroidActivity(androidx.wear.tiles.ActionBuilders.AndroidActivity.Builder);
}
public static final class ActionBuilders.LoadAction implements androidx.wear.tiles.ActionBuilders.Action {
- method public static androidx.wear.tiles.ActionBuilders.LoadAction.Builder builder();
method public androidx.wear.tiles.StateBuilders.State? getRequestState();
}
public static final class ActionBuilders.LoadAction.Builder implements androidx.wear.tiles.ActionBuilders.Action.Builder {
+ ctor public ActionBuilders.LoadAction.Builder();
method public androidx.wear.tiles.ActionBuilders.LoadAction build();
method public androidx.wear.tiles.ActionBuilders.LoadAction.Builder setRequestState(androidx.wear.tiles.StateBuilders.State);
- method public androidx.wear.tiles.ActionBuilders.LoadAction.Builder setRequestState(androidx.wear.tiles.StateBuilders.State.Builder);
}
public final class ColorBuilders {
@@ -115,11 +112,11 @@
}
public static final class ColorBuilders.ColorProp {
- method public static androidx.wear.tiles.ColorBuilders.ColorProp.Builder builder();
method @ColorInt public int getArgb();
}
public static final class ColorBuilders.ColorProp.Builder {
+ ctor public ColorBuilders.ColorProp.Builder();
method public androidx.wear.tiles.ColorBuilders.ColorProp build();
method public androidx.wear.tiles.ColorBuilders.ColorProp.Builder setArgb(@ColorInt int);
}
@@ -133,7 +130,6 @@
}
public static final class DeviceParametersBuilders.DeviceParameters {
- method public static androidx.wear.tiles.DeviceParametersBuilders.DeviceParameters.Builder builder();
method public int getDevicePlatform();
method @FloatRange(from=0.0, fromInclusive=false, toInclusive=false) public float getScreenDensity();
method @Dimension(unit=androidx.annotation.Dimension.DP) public int getScreenHeightDp();
@@ -142,6 +138,7 @@
}
public static final class DeviceParametersBuilders.DeviceParameters.Builder {
+ ctor public DeviceParametersBuilders.DeviceParameters.Builder();
method public androidx.wear.tiles.DeviceParametersBuilders.DeviceParameters build();
method public androidx.wear.tiles.DeviceParametersBuilders.DeviceParameters.Builder setDevicePlatform(int);
method public androidx.wear.tiles.DeviceParametersBuilders.DeviceParameters.Builder setScreenDensity(@FloatRange(from=0.0, fromInclusive=false, toInclusive=false) float);
@@ -167,40 +164,40 @@
}
public static final class DimensionBuilders.DegreesProp {
- method public static androidx.wear.tiles.DimensionBuilders.DegreesProp.Builder builder();
method public float getValue();
}
public static final class DimensionBuilders.DegreesProp.Builder {
+ ctor public DimensionBuilders.DegreesProp.Builder();
method public androidx.wear.tiles.DimensionBuilders.DegreesProp build();
method public androidx.wear.tiles.DimensionBuilders.DegreesProp.Builder setValue(float);
}
public static final class DimensionBuilders.DpProp implements androidx.wear.tiles.DimensionBuilders.ContainerDimension androidx.wear.tiles.DimensionBuilders.ImageDimension androidx.wear.tiles.DimensionBuilders.SpacerDimension {
- method public static androidx.wear.tiles.DimensionBuilders.DpProp.Builder builder();
method @Dimension(unit=androidx.annotation.Dimension.DP) public float getValue();
}
public static final class DimensionBuilders.DpProp.Builder implements androidx.wear.tiles.DimensionBuilders.ContainerDimension.Builder androidx.wear.tiles.DimensionBuilders.ImageDimension.Builder androidx.wear.tiles.DimensionBuilders.SpacerDimension.Builder {
+ ctor public DimensionBuilders.DpProp.Builder();
method public androidx.wear.tiles.DimensionBuilders.DpProp build();
method public androidx.wear.tiles.DimensionBuilders.DpProp.Builder setValue(@Dimension(unit=androidx.annotation.Dimension.DP) float);
}
public static final class DimensionBuilders.EmProp {
- method public static androidx.wear.tiles.DimensionBuilders.EmProp.Builder builder();
method public float getValue();
}
public static final class DimensionBuilders.EmProp.Builder {
+ ctor public DimensionBuilders.EmProp.Builder();
method public androidx.wear.tiles.DimensionBuilders.EmProp build();
method public androidx.wear.tiles.DimensionBuilders.EmProp.Builder setValue(float);
}
public static final class DimensionBuilders.ExpandedDimensionProp implements androidx.wear.tiles.DimensionBuilders.ContainerDimension androidx.wear.tiles.DimensionBuilders.ImageDimension {
- method public static androidx.wear.tiles.DimensionBuilders.ExpandedDimensionProp.Builder builder();
}
public static final class DimensionBuilders.ExpandedDimensionProp.Builder implements androidx.wear.tiles.DimensionBuilders.ContainerDimension.Builder androidx.wear.tiles.DimensionBuilders.ImageDimension.Builder {
+ ctor public DimensionBuilders.ExpandedDimensionProp.Builder();
method public androidx.wear.tiles.DimensionBuilders.ExpandedDimensionProp build();
}
@@ -212,23 +209,23 @@
}
public static final class DimensionBuilders.ProportionalDimensionProp implements androidx.wear.tiles.DimensionBuilders.ImageDimension {
- method public static androidx.wear.tiles.DimensionBuilders.ProportionalDimensionProp.Builder builder();
method @IntRange(from=0) public int getAspectRatioHeight();
method @IntRange(from=0) public int getAspectRatioWidth();
}
public static final class DimensionBuilders.ProportionalDimensionProp.Builder implements androidx.wear.tiles.DimensionBuilders.ImageDimension.Builder {
+ ctor public DimensionBuilders.ProportionalDimensionProp.Builder();
method public androidx.wear.tiles.DimensionBuilders.ProportionalDimensionProp build();
method public androidx.wear.tiles.DimensionBuilders.ProportionalDimensionProp.Builder setAspectRatioHeight(@IntRange(from=0) int);
method public androidx.wear.tiles.DimensionBuilders.ProportionalDimensionProp.Builder setAspectRatioWidth(@IntRange(from=0) int);
}
public static final class DimensionBuilders.SpProp {
- method public static androidx.wear.tiles.DimensionBuilders.SpProp.Builder builder();
method @Dimension(unit=androidx.annotation.Dimension.SP) public float getValue();
}
public static final class DimensionBuilders.SpProp.Builder {
+ ctor public DimensionBuilders.SpProp.Builder();
method public androidx.wear.tiles.DimensionBuilders.SpProp build();
method public androidx.wear.tiles.DimensionBuilders.SpProp.Builder setValue(@Dimension(unit=androidx.annotation.Dimension.SP) float);
}
@@ -241,10 +238,10 @@
}
public static final class DimensionBuilders.WrappedDimensionProp implements androidx.wear.tiles.DimensionBuilders.ContainerDimension {
- method public static androidx.wear.tiles.DimensionBuilders.WrappedDimensionProp.Builder builder();
}
public static final class DimensionBuilders.WrappedDimensionProp.Builder implements androidx.wear.tiles.DimensionBuilders.ContainerDimension.Builder {
+ ctor public DimensionBuilders.WrappedDimensionProp.Builder();
method public androidx.wear.tiles.DimensionBuilders.WrappedDimensionProp build();
}
@@ -252,34 +249,34 @@
}
public static final class EventBuilders.TileAddEvent {
- method public static androidx.wear.tiles.EventBuilders.TileAddEvent.Builder builder();
}
public static final class EventBuilders.TileAddEvent.Builder {
+ ctor public EventBuilders.TileAddEvent.Builder();
method public androidx.wear.tiles.EventBuilders.TileAddEvent build();
}
public static final class EventBuilders.TileEnterEvent {
- method public static androidx.wear.tiles.EventBuilders.TileEnterEvent.Builder builder();
}
public static final class EventBuilders.TileEnterEvent.Builder {
+ ctor public EventBuilders.TileEnterEvent.Builder();
method public androidx.wear.tiles.EventBuilders.TileEnterEvent build();
}
public static final class EventBuilders.TileLeaveEvent {
- method public static androidx.wear.tiles.EventBuilders.TileLeaveEvent.Builder builder();
}
public static final class EventBuilders.TileLeaveEvent.Builder {
+ ctor public EventBuilders.TileLeaveEvent.Builder();
method public androidx.wear.tiles.EventBuilders.TileLeaveEvent build();
}
public static final class EventBuilders.TileRemoveEvent {
- method public static androidx.wear.tiles.EventBuilders.TileRemoveEvent.Builder builder();
}
public static final class EventBuilders.TileRemoveEvent.Builder {
+ ctor public EventBuilders.TileRemoveEvent.Builder();
method public androidx.wear.tiles.EventBuilders.TileRemoveEvent build();
}
@@ -322,7 +319,6 @@
}
public static final class LayoutElementBuilders.Arc implements androidx.wear.tiles.LayoutElementBuilders.LayoutElement {
- method public static androidx.wear.tiles.LayoutElementBuilders.Arc.Builder builder();
method public androidx.wear.tiles.DimensionBuilders.DegreesProp? getAnchorAngle();
method public androidx.wear.tiles.LayoutElementBuilders.ArcAnchorTypeProp? getAnchorType();
method public java.util.List<androidx.wear.tiles.LayoutElementBuilders.ArcLayoutElement!> getContents();
@@ -331,39 +327,36 @@
}
public static final class LayoutElementBuilders.Arc.Builder implements androidx.wear.tiles.LayoutElementBuilders.LayoutElement.Builder {
+ ctor public LayoutElementBuilders.Arc.Builder();
method public androidx.wear.tiles.LayoutElementBuilders.Arc.Builder addContent(androidx.wear.tiles.LayoutElementBuilders.ArcLayoutElement);
- method public androidx.wear.tiles.LayoutElementBuilders.Arc.Builder addContent(androidx.wear.tiles.LayoutElementBuilders.ArcLayoutElement.Builder);
method public androidx.wear.tiles.LayoutElementBuilders.Arc build();
method public androidx.wear.tiles.LayoutElementBuilders.Arc.Builder setAnchorAngle(androidx.wear.tiles.DimensionBuilders.DegreesProp);
- method public androidx.wear.tiles.LayoutElementBuilders.Arc.Builder setAnchorAngle(androidx.wear.tiles.DimensionBuilders.DegreesProp.Builder);
method public androidx.wear.tiles.LayoutElementBuilders.Arc.Builder setAnchorType(androidx.wear.tiles.LayoutElementBuilders.ArcAnchorTypeProp);
method public androidx.wear.tiles.LayoutElementBuilders.Arc.Builder setAnchorType(int);
method public androidx.wear.tiles.LayoutElementBuilders.Arc.Builder setModifiers(androidx.wear.tiles.ModifiersBuilders.Modifiers);
- method public androidx.wear.tiles.LayoutElementBuilders.Arc.Builder setModifiers(androidx.wear.tiles.ModifiersBuilders.Modifiers.Builder);
method public androidx.wear.tiles.LayoutElementBuilders.Arc.Builder setVerticalAlign(androidx.wear.tiles.LayoutElementBuilders.VerticalAlignmentProp);
method public androidx.wear.tiles.LayoutElementBuilders.Arc.Builder setVerticalAlign(int);
}
public static final class LayoutElementBuilders.ArcAdapter implements androidx.wear.tiles.LayoutElementBuilders.ArcLayoutElement {
- method public static androidx.wear.tiles.LayoutElementBuilders.ArcAdapter.Builder builder();
method public androidx.wear.tiles.LayoutElementBuilders.LayoutElement? getContent();
method public androidx.wear.tiles.TypeBuilders.BoolProp? getRotateContents();
}
public static final class LayoutElementBuilders.ArcAdapter.Builder implements androidx.wear.tiles.LayoutElementBuilders.ArcLayoutElement.Builder {
+ ctor public LayoutElementBuilders.ArcAdapter.Builder();
method public androidx.wear.tiles.LayoutElementBuilders.ArcAdapter build();
method public androidx.wear.tiles.LayoutElementBuilders.ArcAdapter.Builder setContent(androidx.wear.tiles.LayoutElementBuilders.LayoutElement);
- method public androidx.wear.tiles.LayoutElementBuilders.ArcAdapter.Builder setContent(androidx.wear.tiles.LayoutElementBuilders.LayoutElement.Builder);
method public androidx.wear.tiles.LayoutElementBuilders.ArcAdapter.Builder setRotateContents(androidx.wear.tiles.TypeBuilders.BoolProp);
method public androidx.wear.tiles.LayoutElementBuilders.ArcAdapter.Builder setRotateContents(boolean);
}
public static final class LayoutElementBuilders.ArcAnchorTypeProp {
- method public static androidx.wear.tiles.LayoutElementBuilders.ArcAnchorTypeProp.Builder builder();
method public int getValue();
}
public static final class LayoutElementBuilders.ArcAnchorTypeProp.Builder {
+ ctor public LayoutElementBuilders.ArcAnchorTypeProp.Builder();
method public androidx.wear.tiles.LayoutElementBuilders.ArcAnchorTypeProp build();
method public androidx.wear.tiles.LayoutElementBuilders.ArcAnchorTypeProp.Builder setValue(int);
}
@@ -376,7 +369,6 @@
}
public static final class LayoutElementBuilders.ArcLine implements androidx.wear.tiles.LayoutElementBuilders.ArcLayoutElement {
- method public static androidx.wear.tiles.LayoutElementBuilders.ArcLine.Builder builder();
method public androidx.wear.tiles.ColorBuilders.ColorProp? getColor();
method public androidx.wear.tiles.DimensionBuilders.DegreesProp? getLength();
method public androidx.wear.tiles.ModifiersBuilders.ArcModifiers? getModifiers();
@@ -384,53 +376,44 @@
}
public static final class LayoutElementBuilders.ArcLine.Builder implements androidx.wear.tiles.LayoutElementBuilders.ArcLayoutElement.Builder {
+ ctor public LayoutElementBuilders.ArcLine.Builder();
method public androidx.wear.tiles.LayoutElementBuilders.ArcLine build();
method public androidx.wear.tiles.LayoutElementBuilders.ArcLine.Builder setColor(androidx.wear.tiles.ColorBuilders.ColorProp);
- method public androidx.wear.tiles.LayoutElementBuilders.ArcLine.Builder setColor(androidx.wear.tiles.ColorBuilders.ColorProp.Builder);
method public androidx.wear.tiles.LayoutElementBuilders.ArcLine.Builder setLength(androidx.wear.tiles.DimensionBuilders.DegreesProp);
- method public androidx.wear.tiles.LayoutElementBuilders.ArcLine.Builder setLength(androidx.wear.tiles.DimensionBuilders.DegreesProp.Builder);
method public androidx.wear.tiles.LayoutElementBuilders.ArcLine.Builder setModifiers(androidx.wear.tiles.ModifiersBuilders.ArcModifiers);
- method public androidx.wear.tiles.LayoutElementBuilders.ArcLine.Builder setModifiers(androidx.wear.tiles.ModifiersBuilders.ArcModifiers.Builder);
method public androidx.wear.tiles.LayoutElementBuilders.ArcLine.Builder setThickness(androidx.wear.tiles.DimensionBuilders.DpProp);
- method public androidx.wear.tiles.LayoutElementBuilders.ArcLine.Builder setThickness(androidx.wear.tiles.DimensionBuilders.DpProp.Builder);
}
public static final class LayoutElementBuilders.ArcSpacer implements androidx.wear.tiles.LayoutElementBuilders.ArcLayoutElement {
- method public static androidx.wear.tiles.LayoutElementBuilders.ArcSpacer.Builder builder();
method public androidx.wear.tiles.DimensionBuilders.DegreesProp? getLength();
method public androidx.wear.tiles.ModifiersBuilders.ArcModifiers? getModifiers();
method public androidx.wear.tiles.DimensionBuilders.DpProp? getThickness();
}
public static final class LayoutElementBuilders.ArcSpacer.Builder implements androidx.wear.tiles.LayoutElementBuilders.ArcLayoutElement.Builder {
+ ctor public LayoutElementBuilders.ArcSpacer.Builder();
method public androidx.wear.tiles.LayoutElementBuilders.ArcSpacer build();
method public androidx.wear.tiles.LayoutElementBuilders.ArcSpacer.Builder setLength(androidx.wear.tiles.DimensionBuilders.DegreesProp);
- method public androidx.wear.tiles.LayoutElementBuilders.ArcSpacer.Builder setLength(androidx.wear.tiles.DimensionBuilders.DegreesProp.Builder);
method public androidx.wear.tiles.LayoutElementBuilders.ArcSpacer.Builder setModifiers(androidx.wear.tiles.ModifiersBuilders.ArcModifiers);
- method public androidx.wear.tiles.LayoutElementBuilders.ArcSpacer.Builder setModifiers(androidx.wear.tiles.ModifiersBuilders.ArcModifiers.Builder);
method public androidx.wear.tiles.LayoutElementBuilders.ArcSpacer.Builder setThickness(androidx.wear.tiles.DimensionBuilders.DpProp);
- method public androidx.wear.tiles.LayoutElementBuilders.ArcSpacer.Builder setThickness(androidx.wear.tiles.DimensionBuilders.DpProp.Builder);
}
public static final class LayoutElementBuilders.ArcText implements androidx.wear.tiles.LayoutElementBuilders.ArcLayoutElement {
- method public static androidx.wear.tiles.LayoutElementBuilders.ArcText.Builder builder();
method public androidx.wear.tiles.LayoutElementBuilders.FontStyle? getFontStyle();
method public androidx.wear.tiles.ModifiersBuilders.ArcModifiers? getModifiers();
method public androidx.wear.tiles.TypeBuilders.StringProp? getText();
}
public static final class LayoutElementBuilders.ArcText.Builder implements androidx.wear.tiles.LayoutElementBuilders.ArcLayoutElement.Builder {
+ ctor public LayoutElementBuilders.ArcText.Builder();
method public androidx.wear.tiles.LayoutElementBuilders.ArcText build();
method public androidx.wear.tiles.LayoutElementBuilders.ArcText.Builder setFontStyle(androidx.wear.tiles.LayoutElementBuilders.FontStyle);
- method public androidx.wear.tiles.LayoutElementBuilders.ArcText.Builder setFontStyle(androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder);
method public androidx.wear.tiles.LayoutElementBuilders.ArcText.Builder setModifiers(androidx.wear.tiles.ModifiersBuilders.ArcModifiers);
- method public androidx.wear.tiles.LayoutElementBuilders.ArcText.Builder setModifiers(androidx.wear.tiles.ModifiersBuilders.ArcModifiers.Builder);
method public androidx.wear.tiles.LayoutElementBuilders.ArcText.Builder setText(androidx.wear.tiles.TypeBuilders.StringProp);
method public androidx.wear.tiles.LayoutElementBuilders.ArcText.Builder setText(String);
}
public static final class LayoutElementBuilders.Box implements androidx.wear.tiles.LayoutElementBuilders.LayoutElement {
- method public static androidx.wear.tiles.LayoutElementBuilders.Box.Builder builder();
method public java.util.List<androidx.wear.tiles.LayoutElementBuilders.LayoutElement!> getContents();
method public androidx.wear.tiles.DimensionBuilders.ContainerDimension? getHeight();
method public androidx.wear.tiles.LayoutElementBuilders.HorizontalAlignmentProp? getHorizontalAlignment();
@@ -440,34 +423,29 @@
}
public static final class LayoutElementBuilders.Box.Builder implements androidx.wear.tiles.LayoutElementBuilders.LayoutElement.Builder {
+ ctor public LayoutElementBuilders.Box.Builder();
method public androidx.wear.tiles.LayoutElementBuilders.Box.Builder addContent(androidx.wear.tiles.LayoutElementBuilders.LayoutElement);
- method public androidx.wear.tiles.LayoutElementBuilders.Box.Builder addContent(androidx.wear.tiles.LayoutElementBuilders.LayoutElement.Builder);
method public androidx.wear.tiles.LayoutElementBuilders.Box build();
method public androidx.wear.tiles.LayoutElementBuilders.Box.Builder setHeight(androidx.wear.tiles.DimensionBuilders.ContainerDimension);
- method public androidx.wear.tiles.LayoutElementBuilders.Box.Builder setHeight(androidx.wear.tiles.DimensionBuilders.ContainerDimension.Builder);
method public androidx.wear.tiles.LayoutElementBuilders.Box.Builder setHorizontalAlignment(androidx.wear.tiles.LayoutElementBuilders.HorizontalAlignmentProp);
method public androidx.wear.tiles.LayoutElementBuilders.Box.Builder setHorizontalAlignment(int);
method public androidx.wear.tiles.LayoutElementBuilders.Box.Builder setModifiers(androidx.wear.tiles.ModifiersBuilders.Modifiers);
- method public androidx.wear.tiles.LayoutElementBuilders.Box.Builder setModifiers(androidx.wear.tiles.ModifiersBuilders.Modifiers.Builder);
method public androidx.wear.tiles.LayoutElementBuilders.Box.Builder setVerticalAlignment(androidx.wear.tiles.LayoutElementBuilders.VerticalAlignmentProp);
method public androidx.wear.tiles.LayoutElementBuilders.Box.Builder setVerticalAlignment(int);
method public androidx.wear.tiles.LayoutElementBuilders.Box.Builder setWidth(androidx.wear.tiles.DimensionBuilders.ContainerDimension);
- method public androidx.wear.tiles.LayoutElementBuilders.Box.Builder setWidth(androidx.wear.tiles.DimensionBuilders.ContainerDimension.Builder);
}
public static final class LayoutElementBuilders.ColorFilter {
- method public static androidx.wear.tiles.LayoutElementBuilders.ColorFilter.Builder builder();
method public androidx.wear.tiles.ColorBuilders.ColorProp? getTint();
}
public static final class LayoutElementBuilders.ColorFilter.Builder {
+ ctor public LayoutElementBuilders.ColorFilter.Builder();
method public androidx.wear.tiles.LayoutElementBuilders.ColorFilter build();
method public androidx.wear.tiles.LayoutElementBuilders.ColorFilter.Builder setTint(androidx.wear.tiles.ColorBuilders.ColorProp);
- method public androidx.wear.tiles.LayoutElementBuilders.ColorFilter.Builder setTint(androidx.wear.tiles.ColorBuilders.ColorProp.Builder);
}
public static final class LayoutElementBuilders.Column implements androidx.wear.tiles.LayoutElementBuilders.LayoutElement {
- method public static androidx.wear.tiles.LayoutElementBuilders.Column.Builder builder();
method public java.util.List<androidx.wear.tiles.LayoutElementBuilders.LayoutElement!> getContents();
method public androidx.wear.tiles.DimensionBuilders.ContainerDimension? getHeight();
method public androidx.wear.tiles.LayoutElementBuilders.HorizontalAlignmentProp? getHorizontalAlignment();
@@ -476,31 +454,27 @@
}
public static final class LayoutElementBuilders.Column.Builder implements androidx.wear.tiles.LayoutElementBuilders.LayoutElement.Builder {
+ ctor public LayoutElementBuilders.Column.Builder();
method public androidx.wear.tiles.LayoutElementBuilders.Column.Builder addContent(androidx.wear.tiles.LayoutElementBuilders.LayoutElement);
- method public androidx.wear.tiles.LayoutElementBuilders.Column.Builder addContent(androidx.wear.tiles.LayoutElementBuilders.LayoutElement.Builder);
method public androidx.wear.tiles.LayoutElementBuilders.Column build();
method public androidx.wear.tiles.LayoutElementBuilders.Column.Builder setHeight(androidx.wear.tiles.DimensionBuilders.ContainerDimension);
- method public androidx.wear.tiles.LayoutElementBuilders.Column.Builder setHeight(androidx.wear.tiles.DimensionBuilders.ContainerDimension.Builder);
method public androidx.wear.tiles.LayoutElementBuilders.Column.Builder setHorizontalAlignment(androidx.wear.tiles.LayoutElementBuilders.HorizontalAlignmentProp);
method public androidx.wear.tiles.LayoutElementBuilders.Column.Builder setHorizontalAlignment(int);
method public androidx.wear.tiles.LayoutElementBuilders.Column.Builder setModifiers(androidx.wear.tiles.ModifiersBuilders.Modifiers);
- method public androidx.wear.tiles.LayoutElementBuilders.Column.Builder setModifiers(androidx.wear.tiles.ModifiersBuilders.Modifiers.Builder);
method public androidx.wear.tiles.LayoutElementBuilders.Column.Builder setWidth(androidx.wear.tiles.DimensionBuilders.ContainerDimension);
- method public androidx.wear.tiles.LayoutElementBuilders.Column.Builder setWidth(androidx.wear.tiles.DimensionBuilders.ContainerDimension.Builder);
}
public static final class LayoutElementBuilders.ContentScaleModeProp {
- method public static androidx.wear.tiles.LayoutElementBuilders.ContentScaleModeProp.Builder builder();
method public int getValue();
}
public static final class LayoutElementBuilders.ContentScaleModeProp.Builder {
+ ctor public LayoutElementBuilders.ContentScaleModeProp.Builder();
method public androidx.wear.tiles.LayoutElementBuilders.ContentScaleModeProp build();
method public androidx.wear.tiles.LayoutElementBuilders.ContentScaleModeProp.Builder setValue(int);
}
public static final class LayoutElementBuilders.FontStyle {
- method public static androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder builder();
method public androidx.wear.tiles.ColorBuilders.ColorProp? getColor();
method public androidx.wear.tiles.TypeBuilders.BoolProp? getItalic();
method public androidx.wear.tiles.DimensionBuilders.EmProp? getLetterSpacing();
@@ -511,15 +485,13 @@
}
public static final class LayoutElementBuilders.FontStyle.Builder {
+ ctor public LayoutElementBuilders.FontStyle.Builder();
method public androidx.wear.tiles.LayoutElementBuilders.FontStyle build();
method public androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder setColor(androidx.wear.tiles.ColorBuilders.ColorProp);
- method public androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder setColor(androidx.wear.tiles.ColorBuilders.ColorProp.Builder);
method public androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder setItalic(androidx.wear.tiles.TypeBuilders.BoolProp);
method public androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder setItalic(boolean);
method public androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder setLetterSpacing(androidx.wear.tiles.DimensionBuilders.EmProp);
- method public androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder setLetterSpacing(androidx.wear.tiles.DimensionBuilders.EmProp.Builder);
method public androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder setSize(androidx.wear.tiles.DimensionBuilders.SpProp);
- method public androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder setSize(androidx.wear.tiles.DimensionBuilders.SpProp.Builder);
method public androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder setUnderline(androidx.wear.tiles.TypeBuilders.BoolProp);
method public androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder setUnderline(boolean);
method @androidx.wear.tiles.TilesExperimental public androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder setVariant(androidx.wear.tiles.LayoutElementBuilders.FontVariantProp);
@@ -529,63 +501,50 @@
}
public static class LayoutElementBuilders.FontStyles {
- method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder body1();
method public static androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder body1(androidx.wear.tiles.DeviceParametersBuilders.DeviceParameters);
- method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder body2();
method public static androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder body2(androidx.wear.tiles.DeviceParametersBuilders.DeviceParameters);
- method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder button();
method public static androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder button(androidx.wear.tiles.DeviceParametersBuilders.DeviceParameters);
- method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder caption1();
method public static androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder caption1(androidx.wear.tiles.DeviceParametersBuilders.DeviceParameters);
- method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder caption2();
method public static androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder caption2(androidx.wear.tiles.DeviceParametersBuilders.DeviceParameters);
- method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder display1();
method public static androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder display1(androidx.wear.tiles.DeviceParametersBuilders.DeviceParameters);
- method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder display2();
method public static androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder display2(androidx.wear.tiles.DeviceParametersBuilders.DeviceParameters);
- method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder display3();
method public static androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder display3(androidx.wear.tiles.DeviceParametersBuilders.DeviceParameters);
- method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder title1();
method public static androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder title1(androidx.wear.tiles.DeviceParametersBuilders.DeviceParameters);
- method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder title2();
method public static androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder title2(androidx.wear.tiles.DeviceParametersBuilders.DeviceParameters);
- method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder title3();
method public static androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder title3(androidx.wear.tiles.DeviceParametersBuilders.DeviceParameters);
- method @Deprecated public static androidx.wear.tiles.LayoutElementBuilders.FontStyles withDeviceParameters(androidx.wear.tiles.DeviceParametersBuilders.DeviceParameters);
}
@androidx.wear.tiles.TilesExperimental public static final class LayoutElementBuilders.FontVariantProp {
- method public static androidx.wear.tiles.LayoutElementBuilders.FontVariantProp.Builder builder();
method public int getValue();
}
public static final class LayoutElementBuilders.FontVariantProp.Builder {
+ ctor public LayoutElementBuilders.FontVariantProp.Builder();
method public androidx.wear.tiles.LayoutElementBuilders.FontVariantProp build();
method public androidx.wear.tiles.LayoutElementBuilders.FontVariantProp.Builder setValue(int);
}
public static final class LayoutElementBuilders.FontWeightProp {
- method public static androidx.wear.tiles.LayoutElementBuilders.FontWeightProp.Builder builder();
method public int getValue();
}
public static final class LayoutElementBuilders.FontWeightProp.Builder {
+ ctor public LayoutElementBuilders.FontWeightProp.Builder();
method public androidx.wear.tiles.LayoutElementBuilders.FontWeightProp build();
method public androidx.wear.tiles.LayoutElementBuilders.FontWeightProp.Builder setValue(int);
}
public static final class LayoutElementBuilders.HorizontalAlignmentProp {
- method public static androidx.wear.tiles.LayoutElementBuilders.HorizontalAlignmentProp.Builder builder();
method public int getValue();
}
public static final class LayoutElementBuilders.HorizontalAlignmentProp.Builder {
+ ctor public LayoutElementBuilders.HorizontalAlignmentProp.Builder();
method public androidx.wear.tiles.LayoutElementBuilders.HorizontalAlignmentProp build();
method public androidx.wear.tiles.LayoutElementBuilders.HorizontalAlignmentProp.Builder setValue(int);
}
public static final class LayoutElementBuilders.Image implements androidx.wear.tiles.LayoutElementBuilders.LayoutElement {
- method public static androidx.wear.tiles.LayoutElementBuilders.Image.Builder builder();
method public androidx.wear.tiles.LayoutElementBuilders.ContentScaleModeProp? getContentScaleMode();
method @androidx.wear.tiles.TilesExperimental public androidx.wear.tiles.LayoutElementBuilders.ColorFilter? getFilter();
method public androidx.wear.tiles.DimensionBuilders.ImageDimension? getHeight();
@@ -595,30 +554,26 @@
}
public static final class LayoutElementBuilders.Image.Builder implements androidx.wear.tiles.LayoutElementBuilders.LayoutElement.Builder {
+ ctor public LayoutElementBuilders.Image.Builder();
method public androidx.wear.tiles.LayoutElementBuilders.Image build();
method public androidx.wear.tiles.LayoutElementBuilders.Image.Builder setContentScaleMode(androidx.wear.tiles.LayoutElementBuilders.ContentScaleModeProp);
method public androidx.wear.tiles.LayoutElementBuilders.Image.Builder setContentScaleMode(int);
method @androidx.wear.tiles.TilesExperimental public androidx.wear.tiles.LayoutElementBuilders.Image.Builder setFilter(androidx.wear.tiles.LayoutElementBuilders.ColorFilter);
- method @androidx.wear.tiles.TilesExperimental public androidx.wear.tiles.LayoutElementBuilders.Image.Builder setFilter(androidx.wear.tiles.LayoutElementBuilders.ColorFilter.Builder);
method public androidx.wear.tiles.LayoutElementBuilders.Image.Builder setHeight(androidx.wear.tiles.DimensionBuilders.ImageDimension);
- method public androidx.wear.tiles.LayoutElementBuilders.Image.Builder setHeight(androidx.wear.tiles.DimensionBuilders.ImageDimension.Builder);
method public androidx.wear.tiles.LayoutElementBuilders.Image.Builder setModifiers(androidx.wear.tiles.ModifiersBuilders.Modifiers);
- method public androidx.wear.tiles.LayoutElementBuilders.Image.Builder setModifiers(androidx.wear.tiles.ModifiersBuilders.Modifiers.Builder);
method public androidx.wear.tiles.LayoutElementBuilders.Image.Builder setResourceId(androidx.wear.tiles.TypeBuilders.StringProp);
method public androidx.wear.tiles.LayoutElementBuilders.Image.Builder setResourceId(String);
method public androidx.wear.tiles.LayoutElementBuilders.Image.Builder setWidth(androidx.wear.tiles.DimensionBuilders.ImageDimension);
- method public androidx.wear.tiles.LayoutElementBuilders.Image.Builder setWidth(androidx.wear.tiles.DimensionBuilders.ImageDimension.Builder);
}
public static final class LayoutElementBuilders.Layout {
- method public static androidx.wear.tiles.LayoutElementBuilders.Layout.Builder builder();
method public androidx.wear.tiles.LayoutElementBuilders.LayoutElement? getRoot();
}
public static final class LayoutElementBuilders.Layout.Builder {
+ ctor public LayoutElementBuilders.Layout.Builder();
method public androidx.wear.tiles.LayoutElementBuilders.Layout build();
method public androidx.wear.tiles.LayoutElementBuilders.Layout.Builder setRoot(androidx.wear.tiles.LayoutElementBuilders.LayoutElement);
- method public androidx.wear.tiles.LayoutElementBuilders.Layout.Builder setRoot(androidx.wear.tiles.LayoutElementBuilders.LayoutElement.Builder);
}
public static interface LayoutElementBuilders.LayoutElement {
@@ -629,7 +584,6 @@
}
public static final class LayoutElementBuilders.Row implements androidx.wear.tiles.LayoutElementBuilders.LayoutElement {
- method public static androidx.wear.tiles.LayoutElementBuilders.Row.Builder builder();
method public java.util.List<androidx.wear.tiles.LayoutElementBuilders.LayoutElement!> getContents();
method public androidx.wear.tiles.DimensionBuilders.ContainerDimension? getHeight();
method public androidx.wear.tiles.ModifiersBuilders.Modifiers? getModifiers();
@@ -638,34 +592,28 @@
}
public static final class LayoutElementBuilders.Row.Builder implements androidx.wear.tiles.LayoutElementBuilders.LayoutElement.Builder {
+ ctor public LayoutElementBuilders.Row.Builder();
method public androidx.wear.tiles.LayoutElementBuilders.Row.Builder addContent(androidx.wear.tiles.LayoutElementBuilders.LayoutElement);
- method public androidx.wear.tiles.LayoutElementBuilders.Row.Builder addContent(androidx.wear.tiles.LayoutElementBuilders.LayoutElement.Builder);
method public androidx.wear.tiles.LayoutElementBuilders.Row build();
method public androidx.wear.tiles.LayoutElementBuilders.Row.Builder setHeight(androidx.wear.tiles.DimensionBuilders.ContainerDimension);
- method public androidx.wear.tiles.LayoutElementBuilders.Row.Builder setHeight(androidx.wear.tiles.DimensionBuilders.ContainerDimension.Builder);
method public androidx.wear.tiles.LayoutElementBuilders.Row.Builder setModifiers(androidx.wear.tiles.ModifiersBuilders.Modifiers);
- method public androidx.wear.tiles.LayoutElementBuilders.Row.Builder setModifiers(androidx.wear.tiles.ModifiersBuilders.Modifiers.Builder);
method public androidx.wear.tiles.LayoutElementBuilders.Row.Builder setVerticalAlignment(androidx.wear.tiles.LayoutElementBuilders.VerticalAlignmentProp);
method public androidx.wear.tiles.LayoutElementBuilders.Row.Builder setVerticalAlignment(int);
method public androidx.wear.tiles.LayoutElementBuilders.Row.Builder setWidth(androidx.wear.tiles.DimensionBuilders.ContainerDimension);
- method public androidx.wear.tiles.LayoutElementBuilders.Row.Builder setWidth(androidx.wear.tiles.DimensionBuilders.ContainerDimension.Builder);
}
public static final class LayoutElementBuilders.Spacer implements androidx.wear.tiles.LayoutElementBuilders.LayoutElement {
- method public static androidx.wear.tiles.LayoutElementBuilders.Spacer.Builder builder();
method public androidx.wear.tiles.DimensionBuilders.SpacerDimension? getHeight();
method public androidx.wear.tiles.ModifiersBuilders.Modifiers? getModifiers();
method public androidx.wear.tiles.DimensionBuilders.SpacerDimension? getWidth();
}
public static final class LayoutElementBuilders.Spacer.Builder implements androidx.wear.tiles.LayoutElementBuilders.LayoutElement.Builder {
+ ctor public LayoutElementBuilders.Spacer.Builder();
method public androidx.wear.tiles.LayoutElementBuilders.Spacer build();
method public androidx.wear.tiles.LayoutElementBuilders.Spacer.Builder setHeight(androidx.wear.tiles.DimensionBuilders.SpacerDimension);
- method public androidx.wear.tiles.LayoutElementBuilders.Spacer.Builder setHeight(androidx.wear.tiles.DimensionBuilders.SpacerDimension.Builder);
method public androidx.wear.tiles.LayoutElementBuilders.Spacer.Builder setModifiers(androidx.wear.tiles.ModifiersBuilders.Modifiers);
- method public androidx.wear.tiles.LayoutElementBuilders.Spacer.Builder setModifiers(androidx.wear.tiles.ModifiersBuilders.Modifiers.Builder);
method public androidx.wear.tiles.LayoutElementBuilders.Spacer.Builder setWidth(androidx.wear.tiles.DimensionBuilders.SpacerDimension);
- method public androidx.wear.tiles.LayoutElementBuilders.Spacer.Builder setWidth(androidx.wear.tiles.DimensionBuilders.SpacerDimension.Builder);
}
public static interface LayoutElementBuilders.Span {
@@ -676,7 +624,6 @@
}
public static final class LayoutElementBuilders.SpanImage implements androidx.wear.tiles.LayoutElementBuilders.Span {
- method public static androidx.wear.tiles.LayoutElementBuilders.SpanImage.Builder builder();
method public androidx.wear.tiles.LayoutElementBuilders.SpanVerticalAlignmentProp? getAlignment();
method public androidx.wear.tiles.DimensionBuilders.DpProp? getHeight();
method public androidx.wear.tiles.ModifiersBuilders.SpanModifiers? getModifiers();
@@ -685,48 +632,43 @@
}
public static final class LayoutElementBuilders.SpanImage.Builder implements androidx.wear.tiles.LayoutElementBuilders.Span.Builder {
+ ctor public LayoutElementBuilders.SpanImage.Builder();
method public androidx.wear.tiles.LayoutElementBuilders.SpanImage build();
method public androidx.wear.tiles.LayoutElementBuilders.SpanImage.Builder setAlignment(androidx.wear.tiles.LayoutElementBuilders.SpanVerticalAlignmentProp);
method public androidx.wear.tiles.LayoutElementBuilders.SpanImage.Builder setAlignment(int);
method public androidx.wear.tiles.LayoutElementBuilders.SpanImage.Builder setHeight(androidx.wear.tiles.DimensionBuilders.DpProp);
- method public androidx.wear.tiles.LayoutElementBuilders.SpanImage.Builder setHeight(androidx.wear.tiles.DimensionBuilders.DpProp.Builder);
method public androidx.wear.tiles.LayoutElementBuilders.SpanImage.Builder setModifiers(androidx.wear.tiles.ModifiersBuilders.SpanModifiers);
- method public androidx.wear.tiles.LayoutElementBuilders.SpanImage.Builder setModifiers(androidx.wear.tiles.ModifiersBuilders.SpanModifiers.Builder);
method public androidx.wear.tiles.LayoutElementBuilders.SpanImage.Builder setResourceId(androidx.wear.tiles.TypeBuilders.StringProp);
method public androidx.wear.tiles.LayoutElementBuilders.SpanImage.Builder setResourceId(String);
method public androidx.wear.tiles.LayoutElementBuilders.SpanImage.Builder setWidth(androidx.wear.tiles.DimensionBuilders.DpProp);
- method public androidx.wear.tiles.LayoutElementBuilders.SpanImage.Builder setWidth(androidx.wear.tiles.DimensionBuilders.DpProp.Builder);
}
public static final class LayoutElementBuilders.SpanText implements androidx.wear.tiles.LayoutElementBuilders.Span {
- method public static androidx.wear.tiles.LayoutElementBuilders.SpanText.Builder builder();
method public androidx.wear.tiles.LayoutElementBuilders.FontStyle? getFontStyle();
method public androidx.wear.tiles.ModifiersBuilders.SpanModifiers? getModifiers();
method public androidx.wear.tiles.TypeBuilders.StringProp? getText();
}
public static final class LayoutElementBuilders.SpanText.Builder implements androidx.wear.tiles.LayoutElementBuilders.Span.Builder {
+ ctor public LayoutElementBuilders.SpanText.Builder();
method public androidx.wear.tiles.LayoutElementBuilders.SpanText build();
method public androidx.wear.tiles.LayoutElementBuilders.SpanText.Builder setFontStyle(androidx.wear.tiles.LayoutElementBuilders.FontStyle);
- method public androidx.wear.tiles.LayoutElementBuilders.SpanText.Builder setFontStyle(androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder);
method public androidx.wear.tiles.LayoutElementBuilders.SpanText.Builder setModifiers(androidx.wear.tiles.ModifiersBuilders.SpanModifiers);
- method public androidx.wear.tiles.LayoutElementBuilders.SpanText.Builder setModifiers(androidx.wear.tiles.ModifiersBuilders.SpanModifiers.Builder);
method public androidx.wear.tiles.LayoutElementBuilders.SpanText.Builder setText(androidx.wear.tiles.TypeBuilders.StringProp);
method public androidx.wear.tiles.LayoutElementBuilders.SpanText.Builder setText(String);
}
public static final class LayoutElementBuilders.SpanVerticalAlignmentProp {
- method public static androidx.wear.tiles.LayoutElementBuilders.SpanVerticalAlignmentProp.Builder builder();
method public int getValue();
}
public static final class LayoutElementBuilders.SpanVerticalAlignmentProp.Builder {
+ ctor public LayoutElementBuilders.SpanVerticalAlignmentProp.Builder();
method public androidx.wear.tiles.LayoutElementBuilders.SpanVerticalAlignmentProp build();
method public androidx.wear.tiles.LayoutElementBuilders.SpanVerticalAlignmentProp.Builder setValue(int);
}
public static final class LayoutElementBuilders.Spannable implements androidx.wear.tiles.LayoutElementBuilders.LayoutElement {
- method public static androidx.wear.tiles.LayoutElementBuilders.Spannable.Builder builder();
method public androidx.wear.tiles.DimensionBuilders.SpProp? getLineHeight();
method public androidx.wear.tiles.TypeBuilders.Int32Prop? getMaxLines();
method public androidx.wear.tiles.ModifiersBuilders.Modifiers? getModifiers();
@@ -736,15 +678,13 @@
}
public static final class LayoutElementBuilders.Spannable.Builder implements androidx.wear.tiles.LayoutElementBuilders.LayoutElement.Builder {
+ ctor public LayoutElementBuilders.Spannable.Builder();
method public androidx.wear.tiles.LayoutElementBuilders.Spannable.Builder addSpan(androidx.wear.tiles.LayoutElementBuilders.Span);
- method public androidx.wear.tiles.LayoutElementBuilders.Spannable.Builder addSpan(androidx.wear.tiles.LayoutElementBuilders.Span.Builder);
method public androidx.wear.tiles.LayoutElementBuilders.Spannable build();
method public androidx.wear.tiles.LayoutElementBuilders.Spannable.Builder setLineHeight(androidx.wear.tiles.DimensionBuilders.SpProp);
- method public androidx.wear.tiles.LayoutElementBuilders.Spannable.Builder setLineHeight(androidx.wear.tiles.DimensionBuilders.SpProp.Builder);
method public androidx.wear.tiles.LayoutElementBuilders.Spannable.Builder setMaxLines(androidx.wear.tiles.TypeBuilders.Int32Prop);
method public androidx.wear.tiles.LayoutElementBuilders.Spannable.Builder setMaxLines(@IntRange(from=1) int);
method public androidx.wear.tiles.LayoutElementBuilders.Spannable.Builder setModifiers(androidx.wear.tiles.ModifiersBuilders.Modifiers);
- method public androidx.wear.tiles.LayoutElementBuilders.Spannable.Builder setModifiers(androidx.wear.tiles.ModifiersBuilders.Modifiers.Builder);
method public androidx.wear.tiles.LayoutElementBuilders.Spannable.Builder setMultilineAlignment(androidx.wear.tiles.LayoutElementBuilders.HorizontalAlignmentProp);
method public androidx.wear.tiles.LayoutElementBuilders.Spannable.Builder setMultilineAlignment(int);
method public androidx.wear.tiles.LayoutElementBuilders.Spannable.Builder setOverflow(androidx.wear.tiles.LayoutElementBuilders.TextOverflowProp);
@@ -752,7 +692,6 @@
}
public static final class LayoutElementBuilders.Text implements androidx.wear.tiles.LayoutElementBuilders.LayoutElement {
- method public static androidx.wear.tiles.LayoutElementBuilders.Text.Builder builder();
method public androidx.wear.tiles.LayoutElementBuilders.FontStyle? getFontStyle();
method public androidx.wear.tiles.DimensionBuilders.SpProp? getLineHeight();
method public androidx.wear.tiles.TypeBuilders.Int32Prop? getMaxLines();
@@ -763,15 +702,13 @@
}
public static final class LayoutElementBuilders.Text.Builder implements androidx.wear.tiles.LayoutElementBuilders.LayoutElement.Builder {
+ ctor public LayoutElementBuilders.Text.Builder();
method public androidx.wear.tiles.LayoutElementBuilders.Text build();
method public androidx.wear.tiles.LayoutElementBuilders.Text.Builder setFontStyle(androidx.wear.tiles.LayoutElementBuilders.FontStyle);
- method public androidx.wear.tiles.LayoutElementBuilders.Text.Builder setFontStyle(androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder);
method public androidx.wear.tiles.LayoutElementBuilders.Text.Builder setLineHeight(androidx.wear.tiles.DimensionBuilders.SpProp);
- method public androidx.wear.tiles.LayoutElementBuilders.Text.Builder setLineHeight(androidx.wear.tiles.DimensionBuilders.SpProp.Builder);
method public androidx.wear.tiles.LayoutElementBuilders.Text.Builder setMaxLines(androidx.wear.tiles.TypeBuilders.Int32Prop);
method public androidx.wear.tiles.LayoutElementBuilders.Text.Builder setMaxLines(@IntRange(from=1) int);
method public androidx.wear.tiles.LayoutElementBuilders.Text.Builder setModifiers(androidx.wear.tiles.ModifiersBuilders.Modifiers);
- method public androidx.wear.tiles.LayoutElementBuilders.Text.Builder setModifiers(androidx.wear.tiles.ModifiersBuilders.Modifiers.Builder);
method public androidx.wear.tiles.LayoutElementBuilders.Text.Builder setMultilineAlignment(androidx.wear.tiles.LayoutElementBuilders.TextAlignmentProp);
method public androidx.wear.tiles.LayoutElementBuilders.Text.Builder setMultilineAlignment(int);
method public androidx.wear.tiles.LayoutElementBuilders.Text.Builder setOverflow(androidx.wear.tiles.LayoutElementBuilders.TextOverflowProp);
@@ -781,31 +718,31 @@
}
public static final class LayoutElementBuilders.TextAlignmentProp {
- method public static androidx.wear.tiles.LayoutElementBuilders.TextAlignmentProp.Builder builder();
method public int getValue();
}
public static final class LayoutElementBuilders.TextAlignmentProp.Builder {
+ ctor public LayoutElementBuilders.TextAlignmentProp.Builder();
method public androidx.wear.tiles.LayoutElementBuilders.TextAlignmentProp build();
method public androidx.wear.tiles.LayoutElementBuilders.TextAlignmentProp.Builder setValue(int);
}
public static final class LayoutElementBuilders.TextOverflowProp {
- method public static androidx.wear.tiles.LayoutElementBuilders.TextOverflowProp.Builder builder();
method public int getValue();
}
public static final class LayoutElementBuilders.TextOverflowProp.Builder {
+ ctor public LayoutElementBuilders.TextOverflowProp.Builder();
method public androidx.wear.tiles.LayoutElementBuilders.TextOverflowProp build();
method public androidx.wear.tiles.LayoutElementBuilders.TextOverflowProp.Builder setValue(int);
}
public static final class LayoutElementBuilders.VerticalAlignmentProp {
- method public static androidx.wear.tiles.LayoutElementBuilders.VerticalAlignmentProp.Builder builder();
method public int getValue();
}
public static final class LayoutElementBuilders.VerticalAlignmentProp.Builder {
+ ctor public LayoutElementBuilders.VerticalAlignmentProp.Builder();
method public androidx.wear.tiles.LayoutElementBuilders.VerticalAlignmentProp build();
method public androidx.wear.tiles.LayoutElementBuilders.VerticalAlignmentProp.Builder setValue(int);
}
@@ -814,73 +751,64 @@
}
public static final class ModifiersBuilders.ArcModifiers {
- method public static androidx.wear.tiles.ModifiersBuilders.ArcModifiers.Builder builder();
method public androidx.wear.tiles.ModifiersBuilders.Clickable? getClickable();
method public androidx.wear.tiles.ModifiersBuilders.Semantics? getSemantics();
}
public static final class ModifiersBuilders.ArcModifiers.Builder {
+ ctor public ModifiersBuilders.ArcModifiers.Builder();
method public androidx.wear.tiles.ModifiersBuilders.ArcModifiers build();
method public androidx.wear.tiles.ModifiersBuilders.ArcModifiers.Builder setClickable(androidx.wear.tiles.ModifiersBuilders.Clickable);
- method public androidx.wear.tiles.ModifiersBuilders.ArcModifiers.Builder setClickable(androidx.wear.tiles.ModifiersBuilders.Clickable.Builder);
method public androidx.wear.tiles.ModifiersBuilders.ArcModifiers.Builder setSemantics(androidx.wear.tiles.ModifiersBuilders.Semantics);
- method public androidx.wear.tiles.ModifiersBuilders.ArcModifiers.Builder setSemantics(androidx.wear.tiles.ModifiersBuilders.Semantics.Builder);
}
public static final class ModifiersBuilders.Background {
- method public static androidx.wear.tiles.ModifiersBuilders.Background.Builder builder();
method public androidx.wear.tiles.ColorBuilders.ColorProp? getColor();
method public androidx.wear.tiles.ModifiersBuilders.Corner? getCorner();
}
public static final class ModifiersBuilders.Background.Builder {
+ ctor public ModifiersBuilders.Background.Builder();
method public androidx.wear.tiles.ModifiersBuilders.Background build();
method public androidx.wear.tiles.ModifiersBuilders.Background.Builder setColor(androidx.wear.tiles.ColorBuilders.ColorProp);
- method public androidx.wear.tiles.ModifiersBuilders.Background.Builder setColor(androidx.wear.tiles.ColorBuilders.ColorProp.Builder);
method public androidx.wear.tiles.ModifiersBuilders.Background.Builder setCorner(androidx.wear.tiles.ModifiersBuilders.Corner);
- method public androidx.wear.tiles.ModifiersBuilders.Background.Builder setCorner(androidx.wear.tiles.ModifiersBuilders.Corner.Builder);
}
public static final class ModifiersBuilders.Border {
- method public static androidx.wear.tiles.ModifiersBuilders.Border.Builder builder();
method public androidx.wear.tiles.ColorBuilders.ColorProp? getColor();
method public androidx.wear.tiles.DimensionBuilders.DpProp? getWidth();
}
public static final class ModifiersBuilders.Border.Builder {
+ ctor public ModifiersBuilders.Border.Builder();
method public androidx.wear.tiles.ModifiersBuilders.Border build();
method public androidx.wear.tiles.ModifiersBuilders.Border.Builder setColor(androidx.wear.tiles.ColorBuilders.ColorProp);
- method public androidx.wear.tiles.ModifiersBuilders.Border.Builder setColor(androidx.wear.tiles.ColorBuilders.ColorProp.Builder);
method public androidx.wear.tiles.ModifiersBuilders.Border.Builder setWidth(androidx.wear.tiles.DimensionBuilders.DpProp);
- method public androidx.wear.tiles.ModifiersBuilders.Border.Builder setWidth(androidx.wear.tiles.DimensionBuilders.DpProp.Builder);
}
public static final class ModifiersBuilders.Clickable {
- method public static androidx.wear.tiles.ModifiersBuilders.Clickable.Builder builder();
method public String getId();
method public androidx.wear.tiles.ActionBuilders.Action? getOnClick();
}
public static final class ModifiersBuilders.Clickable.Builder {
+ ctor public ModifiersBuilders.Clickable.Builder();
method public androidx.wear.tiles.ModifiersBuilders.Clickable build();
method public androidx.wear.tiles.ModifiersBuilders.Clickable.Builder setId(String);
method public androidx.wear.tiles.ModifiersBuilders.Clickable.Builder setOnClick(androidx.wear.tiles.ActionBuilders.Action);
- method public androidx.wear.tiles.ModifiersBuilders.Clickable.Builder setOnClick(androidx.wear.tiles.ActionBuilders.Action.Builder);
}
public static final class ModifiersBuilders.Corner {
- method public static androidx.wear.tiles.ModifiersBuilders.Corner.Builder builder();
method public androidx.wear.tiles.DimensionBuilders.DpProp? getRadius();
}
public static final class ModifiersBuilders.Corner.Builder {
+ ctor public ModifiersBuilders.Corner.Builder();
method public androidx.wear.tiles.ModifiersBuilders.Corner build();
method public androidx.wear.tiles.ModifiersBuilders.Corner.Builder setRadius(androidx.wear.tiles.DimensionBuilders.DpProp);
- method public androidx.wear.tiles.ModifiersBuilders.Corner.Builder setRadius(androidx.wear.tiles.DimensionBuilders.DpProp.Builder);
}
public static final class ModifiersBuilders.Modifiers {
- method public static androidx.wear.tiles.ModifiersBuilders.Modifiers.Builder builder();
method public androidx.wear.tiles.ModifiersBuilders.Background? getBackground();
method public androidx.wear.tiles.ModifiersBuilders.Border? getBorder();
method public androidx.wear.tiles.ModifiersBuilders.Clickable? getClickable();
@@ -889,21 +817,16 @@
}
public static final class ModifiersBuilders.Modifiers.Builder {
+ ctor public ModifiersBuilders.Modifiers.Builder();
method public androidx.wear.tiles.ModifiersBuilders.Modifiers build();
method public androidx.wear.tiles.ModifiersBuilders.Modifiers.Builder setBackground(androidx.wear.tiles.ModifiersBuilders.Background);
- method public androidx.wear.tiles.ModifiersBuilders.Modifiers.Builder setBackground(androidx.wear.tiles.ModifiersBuilders.Background.Builder);
method public androidx.wear.tiles.ModifiersBuilders.Modifiers.Builder setBorder(androidx.wear.tiles.ModifiersBuilders.Border);
- method public androidx.wear.tiles.ModifiersBuilders.Modifiers.Builder setBorder(androidx.wear.tiles.ModifiersBuilders.Border.Builder);
method public androidx.wear.tiles.ModifiersBuilders.Modifiers.Builder setClickable(androidx.wear.tiles.ModifiersBuilders.Clickable);
- method public androidx.wear.tiles.ModifiersBuilders.Modifiers.Builder setClickable(androidx.wear.tiles.ModifiersBuilders.Clickable.Builder);
method public androidx.wear.tiles.ModifiersBuilders.Modifiers.Builder setPadding(androidx.wear.tiles.ModifiersBuilders.Padding);
- method public androidx.wear.tiles.ModifiersBuilders.Modifiers.Builder setPadding(androidx.wear.tiles.ModifiersBuilders.Padding.Builder);
method public androidx.wear.tiles.ModifiersBuilders.Modifiers.Builder setSemantics(androidx.wear.tiles.ModifiersBuilders.Semantics);
- method public androidx.wear.tiles.ModifiersBuilders.Modifiers.Builder setSemantics(androidx.wear.tiles.ModifiersBuilders.Semantics.Builder);
}
public static final class ModifiersBuilders.Padding {
- method public static androidx.wear.tiles.ModifiersBuilders.Padding.Builder builder();
method public androidx.wear.tiles.DimensionBuilders.DpProp? getBottom();
method public androidx.wear.tiles.DimensionBuilders.DpProp? getEnd();
method public androidx.wear.tiles.TypeBuilders.BoolProp? getRtlAware();
@@ -912,72 +835,64 @@
}
public static final class ModifiersBuilders.Padding.Builder {
+ ctor public ModifiersBuilders.Padding.Builder();
method public androidx.wear.tiles.ModifiersBuilders.Padding build();
method public androidx.wear.tiles.ModifiersBuilders.Padding.Builder setAll(androidx.wear.tiles.DimensionBuilders.DpProp);
- method public androidx.wear.tiles.ModifiersBuilders.Padding.Builder setAll(androidx.wear.tiles.DimensionBuilders.DpProp.Builder);
method public androidx.wear.tiles.ModifiersBuilders.Padding.Builder setBottom(androidx.wear.tiles.DimensionBuilders.DpProp);
- method public androidx.wear.tiles.ModifiersBuilders.Padding.Builder setBottom(androidx.wear.tiles.DimensionBuilders.DpProp.Builder);
method public androidx.wear.tiles.ModifiersBuilders.Padding.Builder setEnd(androidx.wear.tiles.DimensionBuilders.DpProp);
- method public androidx.wear.tiles.ModifiersBuilders.Padding.Builder setEnd(androidx.wear.tiles.DimensionBuilders.DpProp.Builder);
method public androidx.wear.tiles.ModifiersBuilders.Padding.Builder setRtlAware(androidx.wear.tiles.TypeBuilders.BoolProp);
method public androidx.wear.tiles.ModifiersBuilders.Padding.Builder setRtlAware(boolean);
method public androidx.wear.tiles.ModifiersBuilders.Padding.Builder setStart(androidx.wear.tiles.DimensionBuilders.DpProp);
- method public androidx.wear.tiles.ModifiersBuilders.Padding.Builder setStart(androidx.wear.tiles.DimensionBuilders.DpProp.Builder);
method public androidx.wear.tiles.ModifiersBuilders.Padding.Builder setTop(androidx.wear.tiles.DimensionBuilders.DpProp);
- method public androidx.wear.tiles.ModifiersBuilders.Padding.Builder setTop(androidx.wear.tiles.DimensionBuilders.DpProp.Builder);
}
public static final class ModifiersBuilders.Semantics {
- method public static androidx.wear.tiles.ModifiersBuilders.Semantics.Builder builder();
method public String getContentDescription();
}
public static final class ModifiersBuilders.Semantics.Builder {
+ ctor public ModifiersBuilders.Semantics.Builder();
method public androidx.wear.tiles.ModifiersBuilders.Semantics build();
method public androidx.wear.tiles.ModifiersBuilders.Semantics.Builder setContentDescription(String);
}
public static final class ModifiersBuilders.SpanModifiers {
- method public static androidx.wear.tiles.ModifiersBuilders.SpanModifiers.Builder builder();
method public androidx.wear.tiles.ModifiersBuilders.Clickable? getClickable();
}
public static final class ModifiersBuilders.SpanModifiers.Builder {
+ ctor public ModifiersBuilders.SpanModifiers.Builder();
method public androidx.wear.tiles.ModifiersBuilders.SpanModifiers build();
method public androidx.wear.tiles.ModifiersBuilders.SpanModifiers.Builder setClickable(androidx.wear.tiles.ModifiersBuilders.Clickable);
- method public androidx.wear.tiles.ModifiersBuilders.SpanModifiers.Builder setClickable(androidx.wear.tiles.ModifiersBuilders.Clickable.Builder);
}
public final class RequestBuilders {
}
public static final class RequestBuilders.ResourcesRequest {
- method public static androidx.wear.tiles.RequestBuilders.ResourcesRequest.Builder builder();
method public androidx.wear.tiles.DeviceParametersBuilders.DeviceParameters? getDeviceParameters();
method public java.util.List<java.lang.String!> getResourceIds();
method public String getVersion();
}
public static final class RequestBuilders.ResourcesRequest.Builder {
+ ctor public RequestBuilders.ResourcesRequest.Builder();
method public androidx.wear.tiles.RequestBuilders.ResourcesRequest.Builder addResourceId(String);
method public androidx.wear.tiles.RequestBuilders.ResourcesRequest build();
method public androidx.wear.tiles.RequestBuilders.ResourcesRequest.Builder setDeviceParameters(androidx.wear.tiles.DeviceParametersBuilders.DeviceParameters);
- method public androidx.wear.tiles.RequestBuilders.ResourcesRequest.Builder setDeviceParameters(androidx.wear.tiles.DeviceParametersBuilders.DeviceParameters.Builder);
method public androidx.wear.tiles.RequestBuilders.ResourcesRequest.Builder setVersion(String);
}
public static final class RequestBuilders.TileRequest {
- method public static androidx.wear.tiles.RequestBuilders.TileRequest.Builder builder();
method public androidx.wear.tiles.DeviceParametersBuilders.DeviceParameters? getDeviceParameters();
method public androidx.wear.tiles.StateBuilders.State? getState();
}
public static final class RequestBuilders.TileRequest.Builder {
+ ctor public RequestBuilders.TileRequest.Builder();
method public androidx.wear.tiles.RequestBuilders.TileRequest build();
method public androidx.wear.tiles.RequestBuilders.TileRequest.Builder setDeviceParameters(androidx.wear.tiles.DeviceParametersBuilders.DeviceParameters);
- method public androidx.wear.tiles.RequestBuilders.TileRequest.Builder setDeviceParameters(androidx.wear.tiles.DeviceParametersBuilders.DeviceParameters.Builder);
method public androidx.wear.tiles.RequestBuilders.TileRequest.Builder setState(androidx.wear.tiles.StateBuilders.State);
- method public androidx.wear.tiles.RequestBuilders.TileRequest.Builder setState(androidx.wear.tiles.StateBuilders.State.Builder);
}
public final class ResourceBuilders {
@@ -986,31 +901,28 @@
}
public static final class ResourceBuilders.AndroidImageResourceByResId {
- method public static androidx.wear.tiles.ResourceBuilders.AndroidImageResourceByResId.Builder builder();
method @DrawableRes public int getResourceId();
}
public static final class ResourceBuilders.AndroidImageResourceByResId.Builder {
+ ctor public ResourceBuilders.AndroidImageResourceByResId.Builder();
method public androidx.wear.tiles.ResourceBuilders.AndroidImageResourceByResId build();
method public androidx.wear.tiles.ResourceBuilders.AndroidImageResourceByResId.Builder setResourceId(@DrawableRes int);
}
public static final class ResourceBuilders.ImageResource {
- method public static androidx.wear.tiles.ResourceBuilders.ImageResource.Builder builder();
method public androidx.wear.tiles.ResourceBuilders.AndroidImageResourceByResId? getAndroidResourceByResId();
method public androidx.wear.tiles.ResourceBuilders.InlineImageResource? getInlineResource();
}
public static final class ResourceBuilders.ImageResource.Builder {
+ ctor public ResourceBuilders.ImageResource.Builder();
method public androidx.wear.tiles.ResourceBuilders.ImageResource build();
method public androidx.wear.tiles.ResourceBuilders.ImageResource.Builder setAndroidResourceByResId(androidx.wear.tiles.ResourceBuilders.AndroidImageResourceByResId);
- method public androidx.wear.tiles.ResourceBuilders.ImageResource.Builder setAndroidResourceByResId(androidx.wear.tiles.ResourceBuilders.AndroidImageResourceByResId.Builder);
method public androidx.wear.tiles.ResourceBuilders.ImageResource.Builder setInlineResource(androidx.wear.tiles.ResourceBuilders.InlineImageResource);
- method public androidx.wear.tiles.ResourceBuilders.ImageResource.Builder setInlineResource(androidx.wear.tiles.ResourceBuilders.InlineImageResource.Builder);
}
public static final class ResourceBuilders.InlineImageResource {
- method public static androidx.wear.tiles.ResourceBuilders.InlineImageResource.Builder builder();
method public byte[] getData();
method public int getFormat();
method @Dimension(unit=androidx.annotation.Dimension.PX) public int getHeightPx();
@@ -1018,6 +930,7 @@
}
public static final class ResourceBuilders.InlineImageResource.Builder {
+ ctor public ResourceBuilders.InlineImageResource.Builder();
method public androidx.wear.tiles.ResourceBuilders.InlineImageResource build();
method public androidx.wear.tiles.ResourceBuilders.InlineImageResource.Builder setData(byte[]);
method public androidx.wear.tiles.ResourceBuilders.InlineImageResource.Builder setFormat(int);
@@ -1026,14 +939,13 @@
}
public static final class ResourceBuilders.Resources {
- method public static androidx.wear.tiles.ResourceBuilders.Resources.Builder builder();
method public java.util.Map<java.lang.String!,androidx.wear.tiles.ResourceBuilders.ImageResource!> getIdToImageMapping();
method public String getVersion();
}
public static final class ResourceBuilders.Resources.Builder {
+ ctor public ResourceBuilders.Resources.Builder();
method public androidx.wear.tiles.ResourceBuilders.Resources.Builder addIdToImageMapping(String, androidx.wear.tiles.ResourceBuilders.ImageResource);
- method public androidx.wear.tiles.ResourceBuilders.Resources.Builder addIdToImageMapping(String, androidx.wear.tiles.ResourceBuilders.ImageResource.Builder);
method public androidx.wear.tiles.ResourceBuilders.Resources build();
method public androidx.wear.tiles.ResourceBuilders.Resources.Builder setVersion(String);
}
@@ -1042,11 +954,11 @@
}
public static final class StateBuilders.State {
- method public static androidx.wear.tiles.StateBuilders.State.Builder builder();
method public String getLastClickableId();
}
public static final class StateBuilders.State.Builder {
+ ctor public StateBuilders.State.Builder();
method public androidx.wear.tiles.StateBuilders.State build();
}
@@ -1054,18 +966,17 @@
}
public static final class TileBuilders.Tile {
- method public static androidx.wear.tiles.TileBuilders.Tile.Builder builder();
method public long getFreshnessIntervalMillis();
method public String getResourcesVersion();
method public androidx.wear.tiles.TimelineBuilders.Timeline? getTimeline();
}
public static final class TileBuilders.Tile.Builder {
+ ctor public TileBuilders.Tile.Builder();
method public androidx.wear.tiles.TileBuilders.Tile build();
method public androidx.wear.tiles.TileBuilders.Tile.Builder setFreshnessIntervalMillis(long);
method public androidx.wear.tiles.TileBuilders.Tile.Builder setResourcesVersion(String);
method public androidx.wear.tiles.TileBuilders.Tile.Builder setTimeline(androidx.wear.tiles.TimelineBuilders.Timeline);
- method public androidx.wear.tiles.TileBuilders.Tile.Builder setTimeline(androidx.wear.tiles.TimelineBuilders.Timeline.Builder);
}
public abstract class TileProviderService extends android.app.Service {
@@ -1094,81 +1005,78 @@
}
public static final class TimelineBuilders.TimeInterval {
- method public static androidx.wear.tiles.TimelineBuilders.TimeInterval.Builder builder();
method public long getEndMillis();
method public long getStartMillis();
}
public static final class TimelineBuilders.TimeInterval.Builder {
+ ctor public TimelineBuilders.TimeInterval.Builder();
method public androidx.wear.tiles.TimelineBuilders.TimeInterval build();
method public androidx.wear.tiles.TimelineBuilders.TimeInterval.Builder setEndMillis(long);
method public androidx.wear.tiles.TimelineBuilders.TimeInterval.Builder setStartMillis(long);
}
public static final class TimelineBuilders.Timeline {
- method public static androidx.wear.tiles.TimelineBuilders.Timeline.Builder builder();
method public java.util.List<androidx.wear.tiles.TimelineBuilders.TimelineEntry!> getTimelineEntries();
}
public static final class TimelineBuilders.Timeline.Builder {
+ ctor public TimelineBuilders.Timeline.Builder();
method public androidx.wear.tiles.TimelineBuilders.Timeline.Builder addTimelineEntry(androidx.wear.tiles.TimelineBuilders.TimelineEntry);
- method public androidx.wear.tiles.TimelineBuilders.Timeline.Builder addTimelineEntry(androidx.wear.tiles.TimelineBuilders.TimelineEntry.Builder);
method public androidx.wear.tiles.TimelineBuilders.Timeline build();
}
public static final class TimelineBuilders.TimelineEntry {
- method public static androidx.wear.tiles.TimelineBuilders.TimelineEntry.Builder builder();
method public androidx.wear.tiles.LayoutElementBuilders.Layout? getLayout();
method public androidx.wear.tiles.TimelineBuilders.TimeInterval? getValidity();
}
public static final class TimelineBuilders.TimelineEntry.Builder {
+ ctor public TimelineBuilders.TimelineEntry.Builder();
method public androidx.wear.tiles.TimelineBuilders.TimelineEntry build();
method public androidx.wear.tiles.TimelineBuilders.TimelineEntry.Builder setLayout(androidx.wear.tiles.LayoutElementBuilders.Layout);
- method public androidx.wear.tiles.TimelineBuilders.TimelineEntry.Builder setLayout(androidx.wear.tiles.LayoutElementBuilders.Layout.Builder);
method public androidx.wear.tiles.TimelineBuilders.TimelineEntry.Builder setValidity(androidx.wear.tiles.TimelineBuilders.TimeInterval);
- method public androidx.wear.tiles.TimelineBuilders.TimelineEntry.Builder setValidity(androidx.wear.tiles.TimelineBuilders.TimeInterval.Builder);
}
public final class TypeBuilders {
}
public static final class TypeBuilders.BoolProp {
- method public static androidx.wear.tiles.TypeBuilders.BoolProp.Builder builder();
method public boolean getValue();
}
public static final class TypeBuilders.BoolProp.Builder {
+ ctor public TypeBuilders.BoolProp.Builder();
method public androidx.wear.tiles.TypeBuilders.BoolProp build();
method public androidx.wear.tiles.TypeBuilders.BoolProp.Builder setValue(boolean);
}
public static final class TypeBuilders.FloatProp {
- method public static androidx.wear.tiles.TypeBuilders.FloatProp.Builder builder();
method public float getValue();
}
public static final class TypeBuilders.FloatProp.Builder {
+ ctor public TypeBuilders.FloatProp.Builder();
method public androidx.wear.tiles.TypeBuilders.FloatProp build();
method public androidx.wear.tiles.TypeBuilders.FloatProp.Builder setValue(float);
}
public static final class TypeBuilders.Int32Prop {
- method public static androidx.wear.tiles.TypeBuilders.Int32Prop.Builder builder();
method public int getValue();
}
public static final class TypeBuilders.Int32Prop.Builder {
+ ctor public TypeBuilders.Int32Prop.Builder();
method public androidx.wear.tiles.TypeBuilders.Int32Prop build();
method public androidx.wear.tiles.TypeBuilders.Int32Prop.Builder setValue(int);
}
public static final class TypeBuilders.StringProp {
- method public static androidx.wear.tiles.TypeBuilders.StringProp.Builder builder();
method public String getValue();
}
public static final class TypeBuilders.StringProp.Builder {
+ ctor public TypeBuilders.StringProp.Builder();
method public androidx.wear.tiles.TypeBuilders.StringProp build();
method public androidx.wear.tiles.TypeBuilders.StringProp.Builder setValue(String);
}
diff --git a/wear/tiles/tiles/api/restricted_current.txt b/wear/tiles/tiles/api/restricted_current.txt
index e760e85..6bfd76f 100644
--- a/wear/tiles/tiles/api/restricted_current.txt
+++ b/wear/tiles/tiles/api/restricted_current.txt
@@ -17,36 +17,35 @@
}
public static final class ActionBuilders.AndroidActivity {
- method public static androidx.wear.tiles.ActionBuilders.AndroidActivity.Builder builder();
method public String getClassName();
method public java.util.Map<java.lang.String!,androidx.wear.tiles.ActionBuilders.AndroidExtra!> getKeyToExtraMapping();
method public String getPackageName();
}
public static final class ActionBuilders.AndroidActivity.Builder {
+ ctor public ActionBuilders.AndroidActivity.Builder();
method public androidx.wear.tiles.ActionBuilders.AndroidActivity.Builder addKeyToExtraMapping(String, androidx.wear.tiles.ActionBuilders.AndroidExtra);
- method public androidx.wear.tiles.ActionBuilders.AndroidActivity.Builder addKeyToExtraMapping(String, androidx.wear.tiles.ActionBuilders.AndroidExtra.Builder);
method public androidx.wear.tiles.ActionBuilders.AndroidActivity build();
method public androidx.wear.tiles.ActionBuilders.AndroidActivity.Builder setClassName(String);
method public androidx.wear.tiles.ActionBuilders.AndroidActivity.Builder setPackageName(String);
}
public static final class ActionBuilders.AndroidBooleanExtra implements androidx.wear.tiles.ActionBuilders.AndroidExtra {
- method public static androidx.wear.tiles.ActionBuilders.AndroidBooleanExtra.Builder builder();
method public boolean getValue();
}
public static final class ActionBuilders.AndroidBooleanExtra.Builder implements androidx.wear.tiles.ActionBuilders.AndroidExtra.Builder {
+ ctor public ActionBuilders.AndroidBooleanExtra.Builder();
method public androidx.wear.tiles.ActionBuilders.AndroidBooleanExtra build();
method public androidx.wear.tiles.ActionBuilders.AndroidBooleanExtra.Builder setValue(boolean);
}
public static final class ActionBuilders.AndroidDoubleExtra implements androidx.wear.tiles.ActionBuilders.AndroidExtra {
- method public static androidx.wear.tiles.ActionBuilders.AndroidDoubleExtra.Builder builder();
method public double getValue();
}
public static final class ActionBuilders.AndroidDoubleExtra.Builder implements androidx.wear.tiles.ActionBuilders.AndroidExtra.Builder {
+ ctor public ActionBuilders.AndroidDoubleExtra.Builder();
method public androidx.wear.tiles.ActionBuilders.AndroidDoubleExtra build();
method public androidx.wear.tiles.ActionBuilders.AndroidDoubleExtra.Builder setValue(double);
}
@@ -59,55 +58,53 @@
}
public static final class ActionBuilders.AndroidIntExtra implements androidx.wear.tiles.ActionBuilders.AndroidExtra {
- method public static androidx.wear.tiles.ActionBuilders.AndroidIntExtra.Builder builder();
method public int getValue();
}
public static final class ActionBuilders.AndroidIntExtra.Builder implements androidx.wear.tiles.ActionBuilders.AndroidExtra.Builder {
+ ctor public ActionBuilders.AndroidIntExtra.Builder();
method public androidx.wear.tiles.ActionBuilders.AndroidIntExtra build();
method public androidx.wear.tiles.ActionBuilders.AndroidIntExtra.Builder setValue(int);
}
public static final class ActionBuilders.AndroidLongExtra implements androidx.wear.tiles.ActionBuilders.AndroidExtra {
- method public static androidx.wear.tiles.ActionBuilders.AndroidLongExtra.Builder builder();
method public long getValue();
}
public static final class ActionBuilders.AndroidLongExtra.Builder implements androidx.wear.tiles.ActionBuilders.AndroidExtra.Builder {
+ ctor public ActionBuilders.AndroidLongExtra.Builder();
method public androidx.wear.tiles.ActionBuilders.AndroidLongExtra build();
method public androidx.wear.tiles.ActionBuilders.AndroidLongExtra.Builder setValue(long);
}
public static final class ActionBuilders.AndroidStringExtra implements androidx.wear.tiles.ActionBuilders.AndroidExtra {
- method public static androidx.wear.tiles.ActionBuilders.AndroidStringExtra.Builder builder();
method public String getValue();
}
public static final class ActionBuilders.AndroidStringExtra.Builder implements androidx.wear.tiles.ActionBuilders.AndroidExtra.Builder {
+ ctor public ActionBuilders.AndroidStringExtra.Builder();
method public androidx.wear.tiles.ActionBuilders.AndroidStringExtra build();
method public androidx.wear.tiles.ActionBuilders.AndroidStringExtra.Builder setValue(String);
}
public static final class ActionBuilders.LaunchAction implements androidx.wear.tiles.ActionBuilders.Action {
- method public static androidx.wear.tiles.ActionBuilders.LaunchAction.Builder builder();
method public androidx.wear.tiles.ActionBuilders.AndroidActivity? getAndroidActivity();
}
public static final class ActionBuilders.LaunchAction.Builder implements androidx.wear.tiles.ActionBuilders.Action.Builder {
+ ctor public ActionBuilders.LaunchAction.Builder();
method public androidx.wear.tiles.ActionBuilders.LaunchAction build();
method public androidx.wear.tiles.ActionBuilders.LaunchAction.Builder setAndroidActivity(androidx.wear.tiles.ActionBuilders.AndroidActivity);
- method public androidx.wear.tiles.ActionBuilders.LaunchAction.Builder setAndroidActivity(androidx.wear.tiles.ActionBuilders.AndroidActivity.Builder);
}
public static final class ActionBuilders.LoadAction implements androidx.wear.tiles.ActionBuilders.Action {
- method public static androidx.wear.tiles.ActionBuilders.LoadAction.Builder builder();
method public androidx.wear.tiles.StateBuilders.State? getRequestState();
}
public static final class ActionBuilders.LoadAction.Builder implements androidx.wear.tiles.ActionBuilders.Action.Builder {
+ ctor public ActionBuilders.LoadAction.Builder();
method public androidx.wear.tiles.ActionBuilders.LoadAction build();
method public androidx.wear.tiles.ActionBuilders.LoadAction.Builder setRequestState(androidx.wear.tiles.StateBuilders.State);
- method public androidx.wear.tiles.ActionBuilders.LoadAction.Builder setRequestState(androidx.wear.tiles.StateBuilders.State.Builder);
}
public final class ColorBuilders {
@@ -115,11 +112,11 @@
}
public static final class ColorBuilders.ColorProp {
- method public static androidx.wear.tiles.ColorBuilders.ColorProp.Builder builder();
method @ColorInt public int getArgb();
}
public static final class ColorBuilders.ColorProp.Builder {
+ ctor public ColorBuilders.ColorProp.Builder();
method public androidx.wear.tiles.ColorBuilders.ColorProp build();
method public androidx.wear.tiles.ColorBuilders.ColorProp.Builder setArgb(@ColorInt int);
}
@@ -133,7 +130,6 @@
}
public static final class DeviceParametersBuilders.DeviceParameters {
- method public static androidx.wear.tiles.DeviceParametersBuilders.DeviceParameters.Builder builder();
method public int getDevicePlatform();
method @FloatRange(from=0.0, fromInclusive=false, toInclusive=false) public float getScreenDensity();
method @Dimension(unit=androidx.annotation.Dimension.DP) public int getScreenHeightDp();
@@ -142,6 +138,7 @@
}
public static final class DeviceParametersBuilders.DeviceParameters.Builder {
+ ctor public DeviceParametersBuilders.DeviceParameters.Builder();
method public androidx.wear.tiles.DeviceParametersBuilders.DeviceParameters build();
method public androidx.wear.tiles.DeviceParametersBuilders.DeviceParameters.Builder setDevicePlatform(int);
method public androidx.wear.tiles.DeviceParametersBuilders.DeviceParameters.Builder setScreenDensity(@FloatRange(from=0.0, fromInclusive=false, toInclusive=false) float);
@@ -167,40 +164,40 @@
}
public static final class DimensionBuilders.DegreesProp {
- method public static androidx.wear.tiles.DimensionBuilders.DegreesProp.Builder builder();
method public float getValue();
}
public static final class DimensionBuilders.DegreesProp.Builder {
+ ctor public DimensionBuilders.DegreesProp.Builder();
method public androidx.wear.tiles.DimensionBuilders.DegreesProp build();
method public androidx.wear.tiles.DimensionBuilders.DegreesProp.Builder setValue(float);
}
public static final class DimensionBuilders.DpProp implements androidx.wear.tiles.DimensionBuilders.ContainerDimension androidx.wear.tiles.DimensionBuilders.ImageDimension androidx.wear.tiles.DimensionBuilders.SpacerDimension {
- method public static androidx.wear.tiles.DimensionBuilders.DpProp.Builder builder();
method @Dimension(unit=androidx.annotation.Dimension.DP) public float getValue();
}
public static final class DimensionBuilders.DpProp.Builder implements androidx.wear.tiles.DimensionBuilders.ContainerDimension.Builder androidx.wear.tiles.DimensionBuilders.ImageDimension.Builder androidx.wear.tiles.DimensionBuilders.SpacerDimension.Builder {
+ ctor public DimensionBuilders.DpProp.Builder();
method public androidx.wear.tiles.DimensionBuilders.DpProp build();
method public androidx.wear.tiles.DimensionBuilders.DpProp.Builder setValue(@Dimension(unit=androidx.annotation.Dimension.DP) float);
}
public static final class DimensionBuilders.EmProp {
- method public static androidx.wear.tiles.DimensionBuilders.EmProp.Builder builder();
method public float getValue();
}
public static final class DimensionBuilders.EmProp.Builder {
+ ctor public DimensionBuilders.EmProp.Builder();
method public androidx.wear.tiles.DimensionBuilders.EmProp build();
method public androidx.wear.tiles.DimensionBuilders.EmProp.Builder setValue(float);
}
public static final class DimensionBuilders.ExpandedDimensionProp implements androidx.wear.tiles.DimensionBuilders.ContainerDimension androidx.wear.tiles.DimensionBuilders.ImageDimension {
- method public static androidx.wear.tiles.DimensionBuilders.ExpandedDimensionProp.Builder builder();
}
public static final class DimensionBuilders.ExpandedDimensionProp.Builder implements androidx.wear.tiles.DimensionBuilders.ContainerDimension.Builder androidx.wear.tiles.DimensionBuilders.ImageDimension.Builder {
+ ctor public DimensionBuilders.ExpandedDimensionProp.Builder();
method public androidx.wear.tiles.DimensionBuilders.ExpandedDimensionProp build();
}
@@ -212,23 +209,23 @@
}
public static final class DimensionBuilders.ProportionalDimensionProp implements androidx.wear.tiles.DimensionBuilders.ImageDimension {
- method public static androidx.wear.tiles.DimensionBuilders.ProportionalDimensionProp.Builder builder();
method @IntRange(from=0) public int getAspectRatioHeight();
method @IntRange(from=0) public int getAspectRatioWidth();
}
public static final class DimensionBuilders.ProportionalDimensionProp.Builder implements androidx.wear.tiles.DimensionBuilders.ImageDimension.Builder {
+ ctor public DimensionBuilders.ProportionalDimensionProp.Builder();
method public androidx.wear.tiles.DimensionBuilders.ProportionalDimensionProp build();
method public androidx.wear.tiles.DimensionBuilders.ProportionalDimensionProp.Builder setAspectRatioHeight(@IntRange(from=0) int);
method public androidx.wear.tiles.DimensionBuilders.ProportionalDimensionProp.Builder setAspectRatioWidth(@IntRange(from=0) int);
}
public static final class DimensionBuilders.SpProp {
- method public static androidx.wear.tiles.DimensionBuilders.SpProp.Builder builder();
method @Dimension(unit=androidx.annotation.Dimension.SP) public float getValue();
}
public static final class DimensionBuilders.SpProp.Builder {
+ ctor public DimensionBuilders.SpProp.Builder();
method public androidx.wear.tiles.DimensionBuilders.SpProp build();
method public androidx.wear.tiles.DimensionBuilders.SpProp.Builder setValue(@Dimension(unit=androidx.annotation.Dimension.SP) float);
}
@@ -241,10 +238,10 @@
}
public static final class DimensionBuilders.WrappedDimensionProp implements androidx.wear.tiles.DimensionBuilders.ContainerDimension {
- method public static androidx.wear.tiles.DimensionBuilders.WrappedDimensionProp.Builder builder();
}
public static final class DimensionBuilders.WrappedDimensionProp.Builder implements androidx.wear.tiles.DimensionBuilders.ContainerDimension.Builder {
+ ctor public DimensionBuilders.WrappedDimensionProp.Builder();
method public androidx.wear.tiles.DimensionBuilders.WrappedDimensionProp build();
}
@@ -252,34 +249,34 @@
}
public static final class EventBuilders.TileAddEvent {
- method public static androidx.wear.tiles.EventBuilders.TileAddEvent.Builder builder();
}
public static final class EventBuilders.TileAddEvent.Builder {
+ ctor public EventBuilders.TileAddEvent.Builder();
method public androidx.wear.tiles.EventBuilders.TileAddEvent build();
}
public static final class EventBuilders.TileEnterEvent {
- method public static androidx.wear.tiles.EventBuilders.TileEnterEvent.Builder builder();
}
public static final class EventBuilders.TileEnterEvent.Builder {
+ ctor public EventBuilders.TileEnterEvent.Builder();
method public androidx.wear.tiles.EventBuilders.TileEnterEvent build();
}
public static final class EventBuilders.TileLeaveEvent {
- method public static androidx.wear.tiles.EventBuilders.TileLeaveEvent.Builder builder();
}
public static final class EventBuilders.TileLeaveEvent.Builder {
+ ctor public EventBuilders.TileLeaveEvent.Builder();
method public androidx.wear.tiles.EventBuilders.TileLeaveEvent build();
}
public static final class EventBuilders.TileRemoveEvent {
- method public static androidx.wear.tiles.EventBuilders.TileRemoveEvent.Builder builder();
}
public static final class EventBuilders.TileRemoveEvent.Builder {
+ ctor public EventBuilders.TileRemoveEvent.Builder();
method public androidx.wear.tiles.EventBuilders.TileRemoveEvent build();
}
@@ -321,7 +318,6 @@
}
public static final class LayoutElementBuilders.Arc implements androidx.wear.tiles.LayoutElementBuilders.LayoutElement {
- method public static androidx.wear.tiles.LayoutElementBuilders.Arc.Builder builder();
method public androidx.wear.tiles.DimensionBuilders.DegreesProp? getAnchorAngle();
method public androidx.wear.tiles.LayoutElementBuilders.ArcAnchorTypeProp? getAnchorType();
method public java.util.List<androidx.wear.tiles.LayoutElementBuilders.ArcLayoutElement!> getContents();
@@ -330,39 +326,36 @@
}
public static final class LayoutElementBuilders.Arc.Builder implements androidx.wear.tiles.LayoutElementBuilders.LayoutElement.Builder {
+ ctor public LayoutElementBuilders.Arc.Builder();
method public androidx.wear.tiles.LayoutElementBuilders.Arc.Builder addContent(androidx.wear.tiles.LayoutElementBuilders.ArcLayoutElement);
- method public androidx.wear.tiles.LayoutElementBuilders.Arc.Builder addContent(androidx.wear.tiles.LayoutElementBuilders.ArcLayoutElement.Builder);
method public androidx.wear.tiles.LayoutElementBuilders.Arc build();
method public androidx.wear.tiles.LayoutElementBuilders.Arc.Builder setAnchorAngle(androidx.wear.tiles.DimensionBuilders.DegreesProp);
- method public androidx.wear.tiles.LayoutElementBuilders.Arc.Builder setAnchorAngle(androidx.wear.tiles.DimensionBuilders.DegreesProp.Builder);
method public androidx.wear.tiles.LayoutElementBuilders.Arc.Builder setAnchorType(androidx.wear.tiles.LayoutElementBuilders.ArcAnchorTypeProp);
method public androidx.wear.tiles.LayoutElementBuilders.Arc.Builder setAnchorType(int);
method public androidx.wear.tiles.LayoutElementBuilders.Arc.Builder setModifiers(androidx.wear.tiles.ModifiersBuilders.Modifiers);
- method public androidx.wear.tiles.LayoutElementBuilders.Arc.Builder setModifiers(androidx.wear.tiles.ModifiersBuilders.Modifiers.Builder);
method public androidx.wear.tiles.LayoutElementBuilders.Arc.Builder setVerticalAlign(androidx.wear.tiles.LayoutElementBuilders.VerticalAlignmentProp);
method public androidx.wear.tiles.LayoutElementBuilders.Arc.Builder setVerticalAlign(int);
}
public static final class LayoutElementBuilders.ArcAdapter implements androidx.wear.tiles.LayoutElementBuilders.ArcLayoutElement {
- method public static androidx.wear.tiles.LayoutElementBuilders.ArcAdapter.Builder builder();
method public androidx.wear.tiles.LayoutElementBuilders.LayoutElement? getContent();
method public androidx.wear.tiles.TypeBuilders.BoolProp? getRotateContents();
}
public static final class LayoutElementBuilders.ArcAdapter.Builder implements androidx.wear.tiles.LayoutElementBuilders.ArcLayoutElement.Builder {
+ ctor public LayoutElementBuilders.ArcAdapter.Builder();
method public androidx.wear.tiles.LayoutElementBuilders.ArcAdapter build();
method public androidx.wear.tiles.LayoutElementBuilders.ArcAdapter.Builder setContent(androidx.wear.tiles.LayoutElementBuilders.LayoutElement);
- method public androidx.wear.tiles.LayoutElementBuilders.ArcAdapter.Builder setContent(androidx.wear.tiles.LayoutElementBuilders.LayoutElement.Builder);
method public androidx.wear.tiles.LayoutElementBuilders.ArcAdapter.Builder setRotateContents(androidx.wear.tiles.TypeBuilders.BoolProp);
method public androidx.wear.tiles.LayoutElementBuilders.ArcAdapter.Builder setRotateContents(boolean);
}
public static final class LayoutElementBuilders.ArcAnchorTypeProp {
- method public static androidx.wear.tiles.LayoutElementBuilders.ArcAnchorTypeProp.Builder builder();
method public int getValue();
}
public static final class LayoutElementBuilders.ArcAnchorTypeProp.Builder {
+ ctor public LayoutElementBuilders.ArcAnchorTypeProp.Builder();
method public androidx.wear.tiles.LayoutElementBuilders.ArcAnchorTypeProp build();
method public androidx.wear.tiles.LayoutElementBuilders.ArcAnchorTypeProp.Builder setValue(int);
}
@@ -375,7 +368,6 @@
}
public static final class LayoutElementBuilders.ArcLine implements androidx.wear.tiles.LayoutElementBuilders.ArcLayoutElement {
- method public static androidx.wear.tiles.LayoutElementBuilders.ArcLine.Builder builder();
method public androidx.wear.tiles.ColorBuilders.ColorProp? getColor();
method public androidx.wear.tiles.DimensionBuilders.DegreesProp? getLength();
method public androidx.wear.tiles.ModifiersBuilders.ArcModifiers? getModifiers();
@@ -383,53 +375,44 @@
}
public static final class LayoutElementBuilders.ArcLine.Builder implements androidx.wear.tiles.LayoutElementBuilders.ArcLayoutElement.Builder {
+ ctor public LayoutElementBuilders.ArcLine.Builder();
method public androidx.wear.tiles.LayoutElementBuilders.ArcLine build();
method public androidx.wear.tiles.LayoutElementBuilders.ArcLine.Builder setColor(androidx.wear.tiles.ColorBuilders.ColorProp);
- method public androidx.wear.tiles.LayoutElementBuilders.ArcLine.Builder setColor(androidx.wear.tiles.ColorBuilders.ColorProp.Builder);
method public androidx.wear.tiles.LayoutElementBuilders.ArcLine.Builder setLength(androidx.wear.tiles.DimensionBuilders.DegreesProp);
- method public androidx.wear.tiles.LayoutElementBuilders.ArcLine.Builder setLength(androidx.wear.tiles.DimensionBuilders.DegreesProp.Builder);
method public androidx.wear.tiles.LayoutElementBuilders.ArcLine.Builder setModifiers(androidx.wear.tiles.ModifiersBuilders.ArcModifiers);
- method public androidx.wear.tiles.LayoutElementBuilders.ArcLine.Builder setModifiers(androidx.wear.tiles.ModifiersBuilders.ArcModifiers.Builder);
method public androidx.wear.tiles.LayoutElementBuilders.ArcLine.Builder setThickness(androidx.wear.tiles.DimensionBuilders.DpProp);
- method public androidx.wear.tiles.LayoutElementBuilders.ArcLine.Builder setThickness(androidx.wear.tiles.DimensionBuilders.DpProp.Builder);
}
public static final class LayoutElementBuilders.ArcSpacer implements androidx.wear.tiles.LayoutElementBuilders.ArcLayoutElement {
- method public static androidx.wear.tiles.LayoutElementBuilders.ArcSpacer.Builder builder();
method public androidx.wear.tiles.DimensionBuilders.DegreesProp? getLength();
method public androidx.wear.tiles.ModifiersBuilders.ArcModifiers? getModifiers();
method public androidx.wear.tiles.DimensionBuilders.DpProp? getThickness();
}
public static final class LayoutElementBuilders.ArcSpacer.Builder implements androidx.wear.tiles.LayoutElementBuilders.ArcLayoutElement.Builder {
+ ctor public LayoutElementBuilders.ArcSpacer.Builder();
method public androidx.wear.tiles.LayoutElementBuilders.ArcSpacer build();
method public androidx.wear.tiles.LayoutElementBuilders.ArcSpacer.Builder setLength(androidx.wear.tiles.DimensionBuilders.DegreesProp);
- method public androidx.wear.tiles.LayoutElementBuilders.ArcSpacer.Builder setLength(androidx.wear.tiles.DimensionBuilders.DegreesProp.Builder);
method public androidx.wear.tiles.LayoutElementBuilders.ArcSpacer.Builder setModifiers(androidx.wear.tiles.ModifiersBuilders.ArcModifiers);
- method public androidx.wear.tiles.LayoutElementBuilders.ArcSpacer.Builder setModifiers(androidx.wear.tiles.ModifiersBuilders.ArcModifiers.Builder);
method public androidx.wear.tiles.LayoutElementBuilders.ArcSpacer.Builder setThickness(androidx.wear.tiles.DimensionBuilders.DpProp);
- method public androidx.wear.tiles.LayoutElementBuilders.ArcSpacer.Builder setThickness(androidx.wear.tiles.DimensionBuilders.DpProp.Builder);
}
public static final class LayoutElementBuilders.ArcText implements androidx.wear.tiles.LayoutElementBuilders.ArcLayoutElement {
- method public static androidx.wear.tiles.LayoutElementBuilders.ArcText.Builder builder();
method public androidx.wear.tiles.LayoutElementBuilders.FontStyle? getFontStyle();
method public androidx.wear.tiles.ModifiersBuilders.ArcModifiers? getModifiers();
method public androidx.wear.tiles.TypeBuilders.StringProp? getText();
}
public static final class LayoutElementBuilders.ArcText.Builder implements androidx.wear.tiles.LayoutElementBuilders.ArcLayoutElement.Builder {
+ ctor public LayoutElementBuilders.ArcText.Builder();
method public androidx.wear.tiles.LayoutElementBuilders.ArcText build();
method public androidx.wear.tiles.LayoutElementBuilders.ArcText.Builder setFontStyle(androidx.wear.tiles.LayoutElementBuilders.FontStyle);
- method public androidx.wear.tiles.LayoutElementBuilders.ArcText.Builder setFontStyle(androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder);
method public androidx.wear.tiles.LayoutElementBuilders.ArcText.Builder setModifiers(androidx.wear.tiles.ModifiersBuilders.ArcModifiers);
- method public androidx.wear.tiles.LayoutElementBuilders.ArcText.Builder setModifiers(androidx.wear.tiles.ModifiersBuilders.ArcModifiers.Builder);
method public androidx.wear.tiles.LayoutElementBuilders.ArcText.Builder setText(androidx.wear.tiles.TypeBuilders.StringProp);
method public androidx.wear.tiles.LayoutElementBuilders.ArcText.Builder setText(String);
}
public static final class LayoutElementBuilders.Box implements androidx.wear.tiles.LayoutElementBuilders.LayoutElement {
- method public static androidx.wear.tiles.LayoutElementBuilders.Box.Builder builder();
method public java.util.List<androidx.wear.tiles.LayoutElementBuilders.LayoutElement!> getContents();
method public androidx.wear.tiles.DimensionBuilders.ContainerDimension? getHeight();
method public androidx.wear.tiles.LayoutElementBuilders.HorizontalAlignmentProp? getHorizontalAlignment();
@@ -439,34 +422,29 @@
}
public static final class LayoutElementBuilders.Box.Builder implements androidx.wear.tiles.LayoutElementBuilders.LayoutElement.Builder {
+ ctor public LayoutElementBuilders.Box.Builder();
method public androidx.wear.tiles.LayoutElementBuilders.Box.Builder addContent(androidx.wear.tiles.LayoutElementBuilders.LayoutElement);
- method public androidx.wear.tiles.LayoutElementBuilders.Box.Builder addContent(androidx.wear.tiles.LayoutElementBuilders.LayoutElement.Builder);
method public androidx.wear.tiles.LayoutElementBuilders.Box build();
method public androidx.wear.tiles.LayoutElementBuilders.Box.Builder setHeight(androidx.wear.tiles.DimensionBuilders.ContainerDimension);
- method public androidx.wear.tiles.LayoutElementBuilders.Box.Builder setHeight(androidx.wear.tiles.DimensionBuilders.ContainerDimension.Builder);
method public androidx.wear.tiles.LayoutElementBuilders.Box.Builder setHorizontalAlignment(androidx.wear.tiles.LayoutElementBuilders.HorizontalAlignmentProp);
method public androidx.wear.tiles.LayoutElementBuilders.Box.Builder setHorizontalAlignment(int);
method public androidx.wear.tiles.LayoutElementBuilders.Box.Builder setModifiers(androidx.wear.tiles.ModifiersBuilders.Modifiers);
- method public androidx.wear.tiles.LayoutElementBuilders.Box.Builder setModifiers(androidx.wear.tiles.ModifiersBuilders.Modifiers.Builder);
method public androidx.wear.tiles.LayoutElementBuilders.Box.Builder setVerticalAlignment(androidx.wear.tiles.LayoutElementBuilders.VerticalAlignmentProp);
method public androidx.wear.tiles.LayoutElementBuilders.Box.Builder setVerticalAlignment(int);
method public androidx.wear.tiles.LayoutElementBuilders.Box.Builder setWidth(androidx.wear.tiles.DimensionBuilders.ContainerDimension);
- method public androidx.wear.tiles.LayoutElementBuilders.Box.Builder setWidth(androidx.wear.tiles.DimensionBuilders.ContainerDimension.Builder);
}
public static final class LayoutElementBuilders.ColorFilter {
- method public static androidx.wear.tiles.LayoutElementBuilders.ColorFilter.Builder builder();
method public androidx.wear.tiles.ColorBuilders.ColorProp? getTint();
}
public static final class LayoutElementBuilders.ColorFilter.Builder {
+ ctor public LayoutElementBuilders.ColorFilter.Builder();
method public androidx.wear.tiles.LayoutElementBuilders.ColorFilter build();
method public androidx.wear.tiles.LayoutElementBuilders.ColorFilter.Builder setTint(androidx.wear.tiles.ColorBuilders.ColorProp);
- method public androidx.wear.tiles.LayoutElementBuilders.ColorFilter.Builder setTint(androidx.wear.tiles.ColorBuilders.ColorProp.Builder);
}
public static final class LayoutElementBuilders.Column implements androidx.wear.tiles.LayoutElementBuilders.LayoutElement {
- method public static androidx.wear.tiles.LayoutElementBuilders.Column.Builder builder();
method public java.util.List<androidx.wear.tiles.LayoutElementBuilders.LayoutElement!> getContents();
method public androidx.wear.tiles.DimensionBuilders.ContainerDimension? getHeight();
method public androidx.wear.tiles.LayoutElementBuilders.HorizontalAlignmentProp? getHorizontalAlignment();
@@ -475,31 +453,27 @@
}
public static final class LayoutElementBuilders.Column.Builder implements androidx.wear.tiles.LayoutElementBuilders.LayoutElement.Builder {
+ ctor public LayoutElementBuilders.Column.Builder();
method public androidx.wear.tiles.LayoutElementBuilders.Column.Builder addContent(androidx.wear.tiles.LayoutElementBuilders.LayoutElement);
- method public androidx.wear.tiles.LayoutElementBuilders.Column.Builder addContent(androidx.wear.tiles.LayoutElementBuilders.LayoutElement.Builder);
method public androidx.wear.tiles.LayoutElementBuilders.Column build();
method public androidx.wear.tiles.LayoutElementBuilders.Column.Builder setHeight(androidx.wear.tiles.DimensionBuilders.ContainerDimension);
- method public androidx.wear.tiles.LayoutElementBuilders.Column.Builder setHeight(androidx.wear.tiles.DimensionBuilders.ContainerDimension.Builder);
method public androidx.wear.tiles.LayoutElementBuilders.Column.Builder setHorizontalAlignment(androidx.wear.tiles.LayoutElementBuilders.HorizontalAlignmentProp);
method public androidx.wear.tiles.LayoutElementBuilders.Column.Builder setHorizontalAlignment(int);
method public androidx.wear.tiles.LayoutElementBuilders.Column.Builder setModifiers(androidx.wear.tiles.ModifiersBuilders.Modifiers);
- method public androidx.wear.tiles.LayoutElementBuilders.Column.Builder setModifiers(androidx.wear.tiles.ModifiersBuilders.Modifiers.Builder);
method public androidx.wear.tiles.LayoutElementBuilders.Column.Builder setWidth(androidx.wear.tiles.DimensionBuilders.ContainerDimension);
- method public androidx.wear.tiles.LayoutElementBuilders.Column.Builder setWidth(androidx.wear.tiles.DimensionBuilders.ContainerDimension.Builder);
}
public static final class LayoutElementBuilders.ContentScaleModeProp {
- method public static androidx.wear.tiles.LayoutElementBuilders.ContentScaleModeProp.Builder builder();
method public int getValue();
}
public static final class LayoutElementBuilders.ContentScaleModeProp.Builder {
+ ctor public LayoutElementBuilders.ContentScaleModeProp.Builder();
method public androidx.wear.tiles.LayoutElementBuilders.ContentScaleModeProp build();
method public androidx.wear.tiles.LayoutElementBuilders.ContentScaleModeProp.Builder setValue(int);
}
public static final class LayoutElementBuilders.FontStyle {
- method public static androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder builder();
method public androidx.wear.tiles.ColorBuilders.ColorProp? getColor();
method public androidx.wear.tiles.TypeBuilders.BoolProp? getItalic();
method public androidx.wear.tiles.DimensionBuilders.EmProp? getLetterSpacing();
@@ -509,15 +483,13 @@
}
public static final class LayoutElementBuilders.FontStyle.Builder {
+ ctor public LayoutElementBuilders.FontStyle.Builder();
method public androidx.wear.tiles.LayoutElementBuilders.FontStyle build();
method public androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder setColor(androidx.wear.tiles.ColorBuilders.ColorProp);
- method public androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder setColor(androidx.wear.tiles.ColorBuilders.ColorProp.Builder);
method public androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder setItalic(androidx.wear.tiles.TypeBuilders.BoolProp);
method public androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder setItalic(boolean);
method public androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder setLetterSpacing(androidx.wear.tiles.DimensionBuilders.EmProp);
- method public androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder setLetterSpacing(androidx.wear.tiles.DimensionBuilders.EmProp.Builder);
method public androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder setSize(androidx.wear.tiles.DimensionBuilders.SpProp);
- method public androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder setSize(androidx.wear.tiles.DimensionBuilders.SpProp.Builder);
method public androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder setUnderline(androidx.wear.tiles.TypeBuilders.BoolProp);
method public androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder setUnderline(boolean);
method public androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder setWeight(androidx.wear.tiles.LayoutElementBuilders.FontWeightProp);
@@ -525,53 +497,40 @@
}
public static class LayoutElementBuilders.FontStyles {
- method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder body1();
method public static androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder body1(androidx.wear.tiles.DeviceParametersBuilders.DeviceParameters);
- method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder body2();
method public static androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder body2(androidx.wear.tiles.DeviceParametersBuilders.DeviceParameters);
- method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder button();
method public static androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder button(androidx.wear.tiles.DeviceParametersBuilders.DeviceParameters);
- method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder caption1();
method public static androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder caption1(androidx.wear.tiles.DeviceParametersBuilders.DeviceParameters);
- method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder caption2();
method public static androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder caption2(androidx.wear.tiles.DeviceParametersBuilders.DeviceParameters);
- method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder display1();
method public static androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder display1(androidx.wear.tiles.DeviceParametersBuilders.DeviceParameters);
- method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder display2();
method public static androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder display2(androidx.wear.tiles.DeviceParametersBuilders.DeviceParameters);
- method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder display3();
method public static androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder display3(androidx.wear.tiles.DeviceParametersBuilders.DeviceParameters);
- method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder title1();
method public static androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder title1(androidx.wear.tiles.DeviceParametersBuilders.DeviceParameters);
- method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder title2();
method public static androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder title2(androidx.wear.tiles.DeviceParametersBuilders.DeviceParameters);
- method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder title3();
method public static androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder title3(androidx.wear.tiles.DeviceParametersBuilders.DeviceParameters);
- method @Deprecated public static androidx.wear.tiles.LayoutElementBuilders.FontStyles withDeviceParameters(androidx.wear.tiles.DeviceParametersBuilders.DeviceParameters);
}
public static final class LayoutElementBuilders.FontWeightProp {
- method public static androidx.wear.tiles.LayoutElementBuilders.FontWeightProp.Builder builder();
method public int getValue();
}
public static final class LayoutElementBuilders.FontWeightProp.Builder {
+ ctor public LayoutElementBuilders.FontWeightProp.Builder();
method public androidx.wear.tiles.LayoutElementBuilders.FontWeightProp build();
method public androidx.wear.tiles.LayoutElementBuilders.FontWeightProp.Builder setValue(int);
}
public static final class LayoutElementBuilders.HorizontalAlignmentProp {
- method public static androidx.wear.tiles.LayoutElementBuilders.HorizontalAlignmentProp.Builder builder();
method public int getValue();
}
public static final class LayoutElementBuilders.HorizontalAlignmentProp.Builder {
+ ctor public LayoutElementBuilders.HorizontalAlignmentProp.Builder();
method public androidx.wear.tiles.LayoutElementBuilders.HorizontalAlignmentProp build();
method public androidx.wear.tiles.LayoutElementBuilders.HorizontalAlignmentProp.Builder setValue(int);
}
public static final class LayoutElementBuilders.Image implements androidx.wear.tiles.LayoutElementBuilders.LayoutElement {
- method public static androidx.wear.tiles.LayoutElementBuilders.Image.Builder builder();
method public androidx.wear.tiles.LayoutElementBuilders.ContentScaleModeProp? getContentScaleMode();
method public androidx.wear.tiles.DimensionBuilders.ImageDimension? getHeight();
method public androidx.wear.tiles.ModifiersBuilders.Modifiers? getModifiers();
@@ -580,28 +539,25 @@
}
public static final class LayoutElementBuilders.Image.Builder implements androidx.wear.tiles.LayoutElementBuilders.LayoutElement.Builder {
+ ctor public LayoutElementBuilders.Image.Builder();
method public androidx.wear.tiles.LayoutElementBuilders.Image build();
method public androidx.wear.tiles.LayoutElementBuilders.Image.Builder setContentScaleMode(androidx.wear.tiles.LayoutElementBuilders.ContentScaleModeProp);
method public androidx.wear.tiles.LayoutElementBuilders.Image.Builder setContentScaleMode(int);
method public androidx.wear.tiles.LayoutElementBuilders.Image.Builder setHeight(androidx.wear.tiles.DimensionBuilders.ImageDimension);
- method public androidx.wear.tiles.LayoutElementBuilders.Image.Builder setHeight(androidx.wear.tiles.DimensionBuilders.ImageDimension.Builder);
method public androidx.wear.tiles.LayoutElementBuilders.Image.Builder setModifiers(androidx.wear.tiles.ModifiersBuilders.Modifiers);
- method public androidx.wear.tiles.LayoutElementBuilders.Image.Builder setModifiers(androidx.wear.tiles.ModifiersBuilders.Modifiers.Builder);
method public androidx.wear.tiles.LayoutElementBuilders.Image.Builder setResourceId(androidx.wear.tiles.TypeBuilders.StringProp);
method public androidx.wear.tiles.LayoutElementBuilders.Image.Builder setResourceId(String);
method public androidx.wear.tiles.LayoutElementBuilders.Image.Builder setWidth(androidx.wear.tiles.DimensionBuilders.ImageDimension);
- method public androidx.wear.tiles.LayoutElementBuilders.Image.Builder setWidth(androidx.wear.tiles.DimensionBuilders.ImageDimension.Builder);
}
public static final class LayoutElementBuilders.Layout {
- method public static androidx.wear.tiles.LayoutElementBuilders.Layout.Builder builder();
method public androidx.wear.tiles.LayoutElementBuilders.LayoutElement? getRoot();
}
public static final class LayoutElementBuilders.Layout.Builder {
+ ctor public LayoutElementBuilders.Layout.Builder();
method public androidx.wear.tiles.LayoutElementBuilders.Layout build();
method public androidx.wear.tiles.LayoutElementBuilders.Layout.Builder setRoot(androidx.wear.tiles.LayoutElementBuilders.LayoutElement);
- method public androidx.wear.tiles.LayoutElementBuilders.Layout.Builder setRoot(androidx.wear.tiles.LayoutElementBuilders.LayoutElement.Builder);
}
public static interface LayoutElementBuilders.LayoutElement {
@@ -612,7 +568,6 @@
}
public static final class LayoutElementBuilders.Row implements androidx.wear.tiles.LayoutElementBuilders.LayoutElement {
- method public static androidx.wear.tiles.LayoutElementBuilders.Row.Builder builder();
method public java.util.List<androidx.wear.tiles.LayoutElementBuilders.LayoutElement!> getContents();
method public androidx.wear.tiles.DimensionBuilders.ContainerDimension? getHeight();
method public androidx.wear.tiles.ModifiersBuilders.Modifiers? getModifiers();
@@ -621,34 +576,28 @@
}
public static final class LayoutElementBuilders.Row.Builder implements androidx.wear.tiles.LayoutElementBuilders.LayoutElement.Builder {
+ ctor public LayoutElementBuilders.Row.Builder();
method public androidx.wear.tiles.LayoutElementBuilders.Row.Builder addContent(androidx.wear.tiles.LayoutElementBuilders.LayoutElement);
- method public androidx.wear.tiles.LayoutElementBuilders.Row.Builder addContent(androidx.wear.tiles.LayoutElementBuilders.LayoutElement.Builder);
method public androidx.wear.tiles.LayoutElementBuilders.Row build();
method public androidx.wear.tiles.LayoutElementBuilders.Row.Builder setHeight(androidx.wear.tiles.DimensionBuilders.ContainerDimension);
- method public androidx.wear.tiles.LayoutElementBuilders.Row.Builder setHeight(androidx.wear.tiles.DimensionBuilders.ContainerDimension.Builder);
method public androidx.wear.tiles.LayoutElementBuilders.Row.Builder setModifiers(androidx.wear.tiles.ModifiersBuilders.Modifiers);
- method public androidx.wear.tiles.LayoutElementBuilders.Row.Builder setModifiers(androidx.wear.tiles.ModifiersBuilders.Modifiers.Builder);
method public androidx.wear.tiles.LayoutElementBuilders.Row.Builder setVerticalAlignment(androidx.wear.tiles.LayoutElementBuilders.VerticalAlignmentProp);
method public androidx.wear.tiles.LayoutElementBuilders.Row.Builder setVerticalAlignment(int);
method public androidx.wear.tiles.LayoutElementBuilders.Row.Builder setWidth(androidx.wear.tiles.DimensionBuilders.ContainerDimension);
- method public androidx.wear.tiles.LayoutElementBuilders.Row.Builder setWidth(androidx.wear.tiles.DimensionBuilders.ContainerDimension.Builder);
}
public static final class LayoutElementBuilders.Spacer implements androidx.wear.tiles.LayoutElementBuilders.LayoutElement {
- method public static androidx.wear.tiles.LayoutElementBuilders.Spacer.Builder builder();
method public androidx.wear.tiles.DimensionBuilders.SpacerDimension? getHeight();
method public androidx.wear.tiles.ModifiersBuilders.Modifiers? getModifiers();
method public androidx.wear.tiles.DimensionBuilders.SpacerDimension? getWidth();
}
public static final class LayoutElementBuilders.Spacer.Builder implements androidx.wear.tiles.LayoutElementBuilders.LayoutElement.Builder {
+ ctor public LayoutElementBuilders.Spacer.Builder();
method public androidx.wear.tiles.LayoutElementBuilders.Spacer build();
method public androidx.wear.tiles.LayoutElementBuilders.Spacer.Builder setHeight(androidx.wear.tiles.DimensionBuilders.SpacerDimension);
- method public androidx.wear.tiles.LayoutElementBuilders.Spacer.Builder setHeight(androidx.wear.tiles.DimensionBuilders.SpacerDimension.Builder);
method public androidx.wear.tiles.LayoutElementBuilders.Spacer.Builder setModifiers(androidx.wear.tiles.ModifiersBuilders.Modifiers);
- method public androidx.wear.tiles.LayoutElementBuilders.Spacer.Builder setModifiers(androidx.wear.tiles.ModifiersBuilders.Modifiers.Builder);
method public androidx.wear.tiles.LayoutElementBuilders.Spacer.Builder setWidth(androidx.wear.tiles.DimensionBuilders.SpacerDimension);
- method public androidx.wear.tiles.LayoutElementBuilders.Spacer.Builder setWidth(androidx.wear.tiles.DimensionBuilders.SpacerDimension.Builder);
}
public static interface LayoutElementBuilders.Span {
@@ -659,7 +608,6 @@
}
public static final class LayoutElementBuilders.SpanImage implements androidx.wear.tiles.LayoutElementBuilders.Span {
- method public static androidx.wear.tiles.LayoutElementBuilders.SpanImage.Builder builder();
method public androidx.wear.tiles.LayoutElementBuilders.SpanVerticalAlignmentProp? getAlignment();
method public androidx.wear.tiles.DimensionBuilders.DpProp? getHeight();
method public androidx.wear.tiles.ModifiersBuilders.SpanModifiers? getModifiers();
@@ -668,48 +616,43 @@
}
public static final class LayoutElementBuilders.SpanImage.Builder implements androidx.wear.tiles.LayoutElementBuilders.Span.Builder {
+ ctor public LayoutElementBuilders.SpanImage.Builder();
method public androidx.wear.tiles.LayoutElementBuilders.SpanImage build();
method public androidx.wear.tiles.LayoutElementBuilders.SpanImage.Builder setAlignment(androidx.wear.tiles.LayoutElementBuilders.SpanVerticalAlignmentProp);
method public androidx.wear.tiles.LayoutElementBuilders.SpanImage.Builder setAlignment(int);
method public androidx.wear.tiles.LayoutElementBuilders.SpanImage.Builder setHeight(androidx.wear.tiles.DimensionBuilders.DpProp);
- method public androidx.wear.tiles.LayoutElementBuilders.SpanImage.Builder setHeight(androidx.wear.tiles.DimensionBuilders.DpProp.Builder);
method public androidx.wear.tiles.LayoutElementBuilders.SpanImage.Builder setModifiers(androidx.wear.tiles.ModifiersBuilders.SpanModifiers);
- method public androidx.wear.tiles.LayoutElementBuilders.SpanImage.Builder setModifiers(androidx.wear.tiles.ModifiersBuilders.SpanModifiers.Builder);
method public androidx.wear.tiles.LayoutElementBuilders.SpanImage.Builder setResourceId(androidx.wear.tiles.TypeBuilders.StringProp);
method public androidx.wear.tiles.LayoutElementBuilders.SpanImage.Builder setResourceId(String);
method public androidx.wear.tiles.LayoutElementBuilders.SpanImage.Builder setWidth(androidx.wear.tiles.DimensionBuilders.DpProp);
- method public androidx.wear.tiles.LayoutElementBuilders.SpanImage.Builder setWidth(androidx.wear.tiles.DimensionBuilders.DpProp.Builder);
}
public static final class LayoutElementBuilders.SpanText implements androidx.wear.tiles.LayoutElementBuilders.Span {
- method public static androidx.wear.tiles.LayoutElementBuilders.SpanText.Builder builder();
method public androidx.wear.tiles.LayoutElementBuilders.FontStyle? getFontStyle();
method public androidx.wear.tiles.ModifiersBuilders.SpanModifiers? getModifiers();
method public androidx.wear.tiles.TypeBuilders.StringProp? getText();
}
public static final class LayoutElementBuilders.SpanText.Builder implements androidx.wear.tiles.LayoutElementBuilders.Span.Builder {
+ ctor public LayoutElementBuilders.SpanText.Builder();
method public androidx.wear.tiles.LayoutElementBuilders.SpanText build();
method public androidx.wear.tiles.LayoutElementBuilders.SpanText.Builder setFontStyle(androidx.wear.tiles.LayoutElementBuilders.FontStyle);
- method public androidx.wear.tiles.LayoutElementBuilders.SpanText.Builder setFontStyle(androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder);
method public androidx.wear.tiles.LayoutElementBuilders.SpanText.Builder setModifiers(androidx.wear.tiles.ModifiersBuilders.SpanModifiers);
- method public androidx.wear.tiles.LayoutElementBuilders.SpanText.Builder setModifiers(androidx.wear.tiles.ModifiersBuilders.SpanModifiers.Builder);
method public androidx.wear.tiles.LayoutElementBuilders.SpanText.Builder setText(androidx.wear.tiles.TypeBuilders.StringProp);
method public androidx.wear.tiles.LayoutElementBuilders.SpanText.Builder setText(String);
}
public static final class LayoutElementBuilders.SpanVerticalAlignmentProp {
- method public static androidx.wear.tiles.LayoutElementBuilders.SpanVerticalAlignmentProp.Builder builder();
method public int getValue();
}
public static final class LayoutElementBuilders.SpanVerticalAlignmentProp.Builder {
+ ctor public LayoutElementBuilders.SpanVerticalAlignmentProp.Builder();
method public androidx.wear.tiles.LayoutElementBuilders.SpanVerticalAlignmentProp build();
method public androidx.wear.tiles.LayoutElementBuilders.SpanVerticalAlignmentProp.Builder setValue(int);
}
public static final class LayoutElementBuilders.Spannable implements androidx.wear.tiles.LayoutElementBuilders.LayoutElement {
- method public static androidx.wear.tiles.LayoutElementBuilders.Spannable.Builder builder();
method public androidx.wear.tiles.DimensionBuilders.SpProp? getLineHeight();
method public androidx.wear.tiles.TypeBuilders.Int32Prop? getMaxLines();
method public androidx.wear.tiles.ModifiersBuilders.Modifiers? getModifiers();
@@ -719,15 +662,13 @@
}
public static final class LayoutElementBuilders.Spannable.Builder implements androidx.wear.tiles.LayoutElementBuilders.LayoutElement.Builder {
+ ctor public LayoutElementBuilders.Spannable.Builder();
method public androidx.wear.tiles.LayoutElementBuilders.Spannable.Builder addSpan(androidx.wear.tiles.LayoutElementBuilders.Span);
- method public androidx.wear.tiles.LayoutElementBuilders.Spannable.Builder addSpan(androidx.wear.tiles.LayoutElementBuilders.Span.Builder);
method public androidx.wear.tiles.LayoutElementBuilders.Spannable build();
method public androidx.wear.tiles.LayoutElementBuilders.Spannable.Builder setLineHeight(androidx.wear.tiles.DimensionBuilders.SpProp);
- method public androidx.wear.tiles.LayoutElementBuilders.Spannable.Builder setLineHeight(androidx.wear.tiles.DimensionBuilders.SpProp.Builder);
method public androidx.wear.tiles.LayoutElementBuilders.Spannable.Builder setMaxLines(androidx.wear.tiles.TypeBuilders.Int32Prop);
method public androidx.wear.tiles.LayoutElementBuilders.Spannable.Builder setMaxLines(@IntRange(from=1) int);
method public androidx.wear.tiles.LayoutElementBuilders.Spannable.Builder setModifiers(androidx.wear.tiles.ModifiersBuilders.Modifiers);
- method public androidx.wear.tiles.LayoutElementBuilders.Spannable.Builder setModifiers(androidx.wear.tiles.ModifiersBuilders.Modifiers.Builder);
method public androidx.wear.tiles.LayoutElementBuilders.Spannable.Builder setMultilineAlignment(androidx.wear.tiles.LayoutElementBuilders.HorizontalAlignmentProp);
method public androidx.wear.tiles.LayoutElementBuilders.Spannable.Builder setMultilineAlignment(int);
method public androidx.wear.tiles.LayoutElementBuilders.Spannable.Builder setOverflow(androidx.wear.tiles.LayoutElementBuilders.TextOverflowProp);
@@ -735,7 +676,6 @@
}
public static final class LayoutElementBuilders.Text implements androidx.wear.tiles.LayoutElementBuilders.LayoutElement {
- method public static androidx.wear.tiles.LayoutElementBuilders.Text.Builder builder();
method public androidx.wear.tiles.LayoutElementBuilders.FontStyle? getFontStyle();
method public androidx.wear.tiles.DimensionBuilders.SpProp? getLineHeight();
method public androidx.wear.tiles.TypeBuilders.Int32Prop? getMaxLines();
@@ -746,15 +686,13 @@
}
public static final class LayoutElementBuilders.Text.Builder implements androidx.wear.tiles.LayoutElementBuilders.LayoutElement.Builder {
+ ctor public LayoutElementBuilders.Text.Builder();
method public androidx.wear.tiles.LayoutElementBuilders.Text build();
method public androidx.wear.tiles.LayoutElementBuilders.Text.Builder setFontStyle(androidx.wear.tiles.LayoutElementBuilders.FontStyle);
- method public androidx.wear.tiles.LayoutElementBuilders.Text.Builder setFontStyle(androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder);
method public androidx.wear.tiles.LayoutElementBuilders.Text.Builder setLineHeight(androidx.wear.tiles.DimensionBuilders.SpProp);
- method public androidx.wear.tiles.LayoutElementBuilders.Text.Builder setLineHeight(androidx.wear.tiles.DimensionBuilders.SpProp.Builder);
method public androidx.wear.tiles.LayoutElementBuilders.Text.Builder setMaxLines(androidx.wear.tiles.TypeBuilders.Int32Prop);
method public androidx.wear.tiles.LayoutElementBuilders.Text.Builder setMaxLines(@IntRange(from=1) int);
method public androidx.wear.tiles.LayoutElementBuilders.Text.Builder setModifiers(androidx.wear.tiles.ModifiersBuilders.Modifiers);
- method public androidx.wear.tiles.LayoutElementBuilders.Text.Builder setModifiers(androidx.wear.tiles.ModifiersBuilders.Modifiers.Builder);
method public androidx.wear.tiles.LayoutElementBuilders.Text.Builder setMultilineAlignment(androidx.wear.tiles.LayoutElementBuilders.TextAlignmentProp);
method public androidx.wear.tiles.LayoutElementBuilders.Text.Builder setMultilineAlignment(int);
method public androidx.wear.tiles.LayoutElementBuilders.Text.Builder setOverflow(androidx.wear.tiles.LayoutElementBuilders.TextOverflowProp);
@@ -764,31 +702,31 @@
}
public static final class LayoutElementBuilders.TextAlignmentProp {
- method public static androidx.wear.tiles.LayoutElementBuilders.TextAlignmentProp.Builder builder();
method public int getValue();
}
public static final class LayoutElementBuilders.TextAlignmentProp.Builder {
+ ctor public LayoutElementBuilders.TextAlignmentProp.Builder();
method public androidx.wear.tiles.LayoutElementBuilders.TextAlignmentProp build();
method public androidx.wear.tiles.LayoutElementBuilders.TextAlignmentProp.Builder setValue(int);
}
public static final class LayoutElementBuilders.TextOverflowProp {
- method public static androidx.wear.tiles.LayoutElementBuilders.TextOverflowProp.Builder builder();
method public int getValue();
}
public static final class LayoutElementBuilders.TextOverflowProp.Builder {
+ ctor public LayoutElementBuilders.TextOverflowProp.Builder();
method public androidx.wear.tiles.LayoutElementBuilders.TextOverflowProp build();
method public androidx.wear.tiles.LayoutElementBuilders.TextOverflowProp.Builder setValue(int);
}
public static final class LayoutElementBuilders.VerticalAlignmentProp {
- method public static androidx.wear.tiles.LayoutElementBuilders.VerticalAlignmentProp.Builder builder();
method public int getValue();
}
public static final class LayoutElementBuilders.VerticalAlignmentProp.Builder {
+ ctor public LayoutElementBuilders.VerticalAlignmentProp.Builder();
method public androidx.wear.tiles.LayoutElementBuilders.VerticalAlignmentProp build();
method public androidx.wear.tiles.LayoutElementBuilders.VerticalAlignmentProp.Builder setValue(int);
}
@@ -797,73 +735,64 @@
}
public static final class ModifiersBuilders.ArcModifiers {
- method public static androidx.wear.tiles.ModifiersBuilders.ArcModifiers.Builder builder();
method public androidx.wear.tiles.ModifiersBuilders.Clickable? getClickable();
method public androidx.wear.tiles.ModifiersBuilders.Semantics? getSemantics();
}
public static final class ModifiersBuilders.ArcModifiers.Builder {
+ ctor public ModifiersBuilders.ArcModifiers.Builder();
method public androidx.wear.tiles.ModifiersBuilders.ArcModifiers build();
method public androidx.wear.tiles.ModifiersBuilders.ArcModifiers.Builder setClickable(androidx.wear.tiles.ModifiersBuilders.Clickable);
- method public androidx.wear.tiles.ModifiersBuilders.ArcModifiers.Builder setClickable(androidx.wear.tiles.ModifiersBuilders.Clickable.Builder);
method public androidx.wear.tiles.ModifiersBuilders.ArcModifiers.Builder setSemantics(androidx.wear.tiles.ModifiersBuilders.Semantics);
- method public androidx.wear.tiles.ModifiersBuilders.ArcModifiers.Builder setSemantics(androidx.wear.tiles.ModifiersBuilders.Semantics.Builder);
}
public static final class ModifiersBuilders.Background {
- method public static androidx.wear.tiles.ModifiersBuilders.Background.Builder builder();
method public androidx.wear.tiles.ColorBuilders.ColorProp? getColor();
method public androidx.wear.tiles.ModifiersBuilders.Corner? getCorner();
}
public static final class ModifiersBuilders.Background.Builder {
+ ctor public ModifiersBuilders.Background.Builder();
method public androidx.wear.tiles.ModifiersBuilders.Background build();
method public androidx.wear.tiles.ModifiersBuilders.Background.Builder setColor(androidx.wear.tiles.ColorBuilders.ColorProp);
- method public androidx.wear.tiles.ModifiersBuilders.Background.Builder setColor(androidx.wear.tiles.ColorBuilders.ColorProp.Builder);
method public androidx.wear.tiles.ModifiersBuilders.Background.Builder setCorner(androidx.wear.tiles.ModifiersBuilders.Corner);
- method public androidx.wear.tiles.ModifiersBuilders.Background.Builder setCorner(androidx.wear.tiles.ModifiersBuilders.Corner.Builder);
}
public static final class ModifiersBuilders.Border {
- method public static androidx.wear.tiles.ModifiersBuilders.Border.Builder builder();
method public androidx.wear.tiles.ColorBuilders.ColorProp? getColor();
method public androidx.wear.tiles.DimensionBuilders.DpProp? getWidth();
}
public static final class ModifiersBuilders.Border.Builder {
+ ctor public ModifiersBuilders.Border.Builder();
method public androidx.wear.tiles.ModifiersBuilders.Border build();
method public androidx.wear.tiles.ModifiersBuilders.Border.Builder setColor(androidx.wear.tiles.ColorBuilders.ColorProp);
- method public androidx.wear.tiles.ModifiersBuilders.Border.Builder setColor(androidx.wear.tiles.ColorBuilders.ColorProp.Builder);
method public androidx.wear.tiles.ModifiersBuilders.Border.Builder setWidth(androidx.wear.tiles.DimensionBuilders.DpProp);
- method public androidx.wear.tiles.ModifiersBuilders.Border.Builder setWidth(androidx.wear.tiles.DimensionBuilders.DpProp.Builder);
}
public static final class ModifiersBuilders.Clickable {
- method public static androidx.wear.tiles.ModifiersBuilders.Clickable.Builder builder();
method public String getId();
method public androidx.wear.tiles.ActionBuilders.Action? getOnClick();
}
public static final class ModifiersBuilders.Clickable.Builder {
+ ctor public ModifiersBuilders.Clickable.Builder();
method public androidx.wear.tiles.ModifiersBuilders.Clickable build();
method public androidx.wear.tiles.ModifiersBuilders.Clickable.Builder setId(String);
method public androidx.wear.tiles.ModifiersBuilders.Clickable.Builder setOnClick(androidx.wear.tiles.ActionBuilders.Action);
- method public androidx.wear.tiles.ModifiersBuilders.Clickable.Builder setOnClick(androidx.wear.tiles.ActionBuilders.Action.Builder);
}
public static final class ModifiersBuilders.Corner {
- method public static androidx.wear.tiles.ModifiersBuilders.Corner.Builder builder();
method public androidx.wear.tiles.DimensionBuilders.DpProp? getRadius();
}
public static final class ModifiersBuilders.Corner.Builder {
+ ctor public ModifiersBuilders.Corner.Builder();
method public androidx.wear.tiles.ModifiersBuilders.Corner build();
method public androidx.wear.tiles.ModifiersBuilders.Corner.Builder setRadius(androidx.wear.tiles.DimensionBuilders.DpProp);
- method public androidx.wear.tiles.ModifiersBuilders.Corner.Builder setRadius(androidx.wear.tiles.DimensionBuilders.DpProp.Builder);
}
public static final class ModifiersBuilders.Modifiers {
- method public static androidx.wear.tiles.ModifiersBuilders.Modifiers.Builder builder();
method public androidx.wear.tiles.ModifiersBuilders.Background? getBackground();
method public androidx.wear.tiles.ModifiersBuilders.Border? getBorder();
method public androidx.wear.tiles.ModifiersBuilders.Clickable? getClickable();
@@ -872,21 +801,16 @@
}
public static final class ModifiersBuilders.Modifiers.Builder {
+ ctor public ModifiersBuilders.Modifiers.Builder();
method public androidx.wear.tiles.ModifiersBuilders.Modifiers build();
method public androidx.wear.tiles.ModifiersBuilders.Modifiers.Builder setBackground(androidx.wear.tiles.ModifiersBuilders.Background);
- method public androidx.wear.tiles.ModifiersBuilders.Modifiers.Builder setBackground(androidx.wear.tiles.ModifiersBuilders.Background.Builder);
method public androidx.wear.tiles.ModifiersBuilders.Modifiers.Builder setBorder(androidx.wear.tiles.ModifiersBuilders.Border);
- method public androidx.wear.tiles.ModifiersBuilders.Modifiers.Builder setBorder(androidx.wear.tiles.ModifiersBuilders.Border.Builder);
method public androidx.wear.tiles.ModifiersBuilders.Modifiers.Builder setClickable(androidx.wear.tiles.ModifiersBuilders.Clickable);
- method public androidx.wear.tiles.ModifiersBuilders.Modifiers.Builder setClickable(androidx.wear.tiles.ModifiersBuilders.Clickable.Builder);
method public androidx.wear.tiles.ModifiersBuilders.Modifiers.Builder setPadding(androidx.wear.tiles.ModifiersBuilders.Padding);
- method public androidx.wear.tiles.ModifiersBuilders.Modifiers.Builder setPadding(androidx.wear.tiles.ModifiersBuilders.Padding.Builder);
method public androidx.wear.tiles.ModifiersBuilders.Modifiers.Builder setSemantics(androidx.wear.tiles.ModifiersBuilders.Semantics);
- method public androidx.wear.tiles.ModifiersBuilders.Modifiers.Builder setSemantics(androidx.wear.tiles.ModifiersBuilders.Semantics.Builder);
}
public static final class ModifiersBuilders.Padding {
- method public static androidx.wear.tiles.ModifiersBuilders.Padding.Builder builder();
method public androidx.wear.tiles.DimensionBuilders.DpProp? getBottom();
method public androidx.wear.tiles.DimensionBuilders.DpProp? getEnd();
method public androidx.wear.tiles.TypeBuilders.BoolProp? getRtlAware();
@@ -895,72 +819,64 @@
}
public static final class ModifiersBuilders.Padding.Builder {
+ ctor public ModifiersBuilders.Padding.Builder();
method public androidx.wear.tiles.ModifiersBuilders.Padding build();
method public androidx.wear.tiles.ModifiersBuilders.Padding.Builder setAll(androidx.wear.tiles.DimensionBuilders.DpProp);
- method public androidx.wear.tiles.ModifiersBuilders.Padding.Builder setAll(androidx.wear.tiles.DimensionBuilders.DpProp.Builder);
method public androidx.wear.tiles.ModifiersBuilders.Padding.Builder setBottom(androidx.wear.tiles.DimensionBuilders.DpProp);
- method public androidx.wear.tiles.ModifiersBuilders.Padding.Builder setBottom(androidx.wear.tiles.DimensionBuilders.DpProp.Builder);
method public androidx.wear.tiles.ModifiersBuilders.Padding.Builder setEnd(androidx.wear.tiles.DimensionBuilders.DpProp);
- method public androidx.wear.tiles.ModifiersBuilders.Padding.Builder setEnd(androidx.wear.tiles.DimensionBuilders.DpProp.Builder);
method public androidx.wear.tiles.ModifiersBuilders.Padding.Builder setRtlAware(androidx.wear.tiles.TypeBuilders.BoolProp);
method public androidx.wear.tiles.ModifiersBuilders.Padding.Builder setRtlAware(boolean);
method public androidx.wear.tiles.ModifiersBuilders.Padding.Builder setStart(androidx.wear.tiles.DimensionBuilders.DpProp);
- method public androidx.wear.tiles.ModifiersBuilders.Padding.Builder setStart(androidx.wear.tiles.DimensionBuilders.DpProp.Builder);
method public androidx.wear.tiles.ModifiersBuilders.Padding.Builder setTop(androidx.wear.tiles.DimensionBuilders.DpProp);
- method public androidx.wear.tiles.ModifiersBuilders.Padding.Builder setTop(androidx.wear.tiles.DimensionBuilders.DpProp.Builder);
}
public static final class ModifiersBuilders.Semantics {
- method public static androidx.wear.tiles.ModifiersBuilders.Semantics.Builder builder();
method public String getContentDescription();
}
public static final class ModifiersBuilders.Semantics.Builder {
+ ctor public ModifiersBuilders.Semantics.Builder();
method public androidx.wear.tiles.ModifiersBuilders.Semantics build();
method public androidx.wear.tiles.ModifiersBuilders.Semantics.Builder setContentDescription(String);
}
public static final class ModifiersBuilders.SpanModifiers {
- method public static androidx.wear.tiles.ModifiersBuilders.SpanModifiers.Builder builder();
method public androidx.wear.tiles.ModifiersBuilders.Clickable? getClickable();
}
public static final class ModifiersBuilders.SpanModifiers.Builder {
+ ctor public ModifiersBuilders.SpanModifiers.Builder();
method public androidx.wear.tiles.ModifiersBuilders.SpanModifiers build();
method public androidx.wear.tiles.ModifiersBuilders.SpanModifiers.Builder setClickable(androidx.wear.tiles.ModifiersBuilders.Clickable);
- method public androidx.wear.tiles.ModifiersBuilders.SpanModifiers.Builder setClickable(androidx.wear.tiles.ModifiersBuilders.Clickable.Builder);
}
public final class RequestBuilders {
}
public static final class RequestBuilders.ResourcesRequest {
- method public static androidx.wear.tiles.RequestBuilders.ResourcesRequest.Builder builder();
method public androidx.wear.tiles.DeviceParametersBuilders.DeviceParameters? getDeviceParameters();
method public java.util.List<java.lang.String!> getResourceIds();
method public String getVersion();
}
public static final class RequestBuilders.ResourcesRequest.Builder {
+ ctor public RequestBuilders.ResourcesRequest.Builder();
method public androidx.wear.tiles.RequestBuilders.ResourcesRequest.Builder addResourceId(String);
method public androidx.wear.tiles.RequestBuilders.ResourcesRequest build();
method public androidx.wear.tiles.RequestBuilders.ResourcesRequest.Builder setDeviceParameters(androidx.wear.tiles.DeviceParametersBuilders.DeviceParameters);
- method public androidx.wear.tiles.RequestBuilders.ResourcesRequest.Builder setDeviceParameters(androidx.wear.tiles.DeviceParametersBuilders.DeviceParameters.Builder);
method public androidx.wear.tiles.RequestBuilders.ResourcesRequest.Builder setVersion(String);
}
public static final class RequestBuilders.TileRequest {
- method public static androidx.wear.tiles.RequestBuilders.TileRequest.Builder builder();
method public androidx.wear.tiles.DeviceParametersBuilders.DeviceParameters? getDeviceParameters();
method public androidx.wear.tiles.StateBuilders.State? getState();
}
public static final class RequestBuilders.TileRequest.Builder {
+ ctor public RequestBuilders.TileRequest.Builder();
method public androidx.wear.tiles.RequestBuilders.TileRequest build();
method public androidx.wear.tiles.RequestBuilders.TileRequest.Builder setDeviceParameters(androidx.wear.tiles.DeviceParametersBuilders.DeviceParameters);
- method public androidx.wear.tiles.RequestBuilders.TileRequest.Builder setDeviceParameters(androidx.wear.tiles.DeviceParametersBuilders.DeviceParameters.Builder);
method public androidx.wear.tiles.RequestBuilders.TileRequest.Builder setState(androidx.wear.tiles.StateBuilders.State);
- method public androidx.wear.tiles.RequestBuilders.TileRequest.Builder setState(androidx.wear.tiles.StateBuilders.State.Builder);
}
public final class ResourceBuilders {
@@ -969,31 +885,28 @@
}
public static final class ResourceBuilders.AndroidImageResourceByResId {
- method public static androidx.wear.tiles.ResourceBuilders.AndroidImageResourceByResId.Builder builder();
method @DrawableRes public int getResourceId();
}
public static final class ResourceBuilders.AndroidImageResourceByResId.Builder {
+ ctor public ResourceBuilders.AndroidImageResourceByResId.Builder();
method public androidx.wear.tiles.ResourceBuilders.AndroidImageResourceByResId build();
method public androidx.wear.tiles.ResourceBuilders.AndroidImageResourceByResId.Builder setResourceId(@DrawableRes int);
}
public static final class ResourceBuilders.ImageResource {
- method public static androidx.wear.tiles.ResourceBuilders.ImageResource.Builder builder();
method public androidx.wear.tiles.ResourceBuilders.AndroidImageResourceByResId? getAndroidResourceByResId();
method public androidx.wear.tiles.ResourceBuilders.InlineImageResource? getInlineResource();
}
public static final class ResourceBuilders.ImageResource.Builder {
+ ctor public ResourceBuilders.ImageResource.Builder();
method public androidx.wear.tiles.ResourceBuilders.ImageResource build();
method public androidx.wear.tiles.ResourceBuilders.ImageResource.Builder setAndroidResourceByResId(androidx.wear.tiles.ResourceBuilders.AndroidImageResourceByResId);
- method public androidx.wear.tiles.ResourceBuilders.ImageResource.Builder setAndroidResourceByResId(androidx.wear.tiles.ResourceBuilders.AndroidImageResourceByResId.Builder);
method public androidx.wear.tiles.ResourceBuilders.ImageResource.Builder setInlineResource(androidx.wear.tiles.ResourceBuilders.InlineImageResource);
- method public androidx.wear.tiles.ResourceBuilders.ImageResource.Builder setInlineResource(androidx.wear.tiles.ResourceBuilders.InlineImageResource.Builder);
}
public static final class ResourceBuilders.InlineImageResource {
- method public static androidx.wear.tiles.ResourceBuilders.InlineImageResource.Builder builder();
method public byte[] getData();
method public int getFormat();
method @Dimension(unit=androidx.annotation.Dimension.PX) public int getHeightPx();
@@ -1001,6 +914,7 @@
}
public static final class ResourceBuilders.InlineImageResource.Builder {
+ ctor public ResourceBuilders.InlineImageResource.Builder();
method public androidx.wear.tiles.ResourceBuilders.InlineImageResource build();
method public androidx.wear.tiles.ResourceBuilders.InlineImageResource.Builder setData(byte[]);
method public androidx.wear.tiles.ResourceBuilders.InlineImageResource.Builder setFormat(int);
@@ -1009,14 +923,13 @@
}
public static final class ResourceBuilders.Resources {
- method public static androidx.wear.tiles.ResourceBuilders.Resources.Builder builder();
method public java.util.Map<java.lang.String!,androidx.wear.tiles.ResourceBuilders.ImageResource!> getIdToImageMapping();
method public String getVersion();
}
public static final class ResourceBuilders.Resources.Builder {
+ ctor public ResourceBuilders.Resources.Builder();
method public androidx.wear.tiles.ResourceBuilders.Resources.Builder addIdToImageMapping(String, androidx.wear.tiles.ResourceBuilders.ImageResource);
- method public androidx.wear.tiles.ResourceBuilders.Resources.Builder addIdToImageMapping(String, androidx.wear.tiles.ResourceBuilders.ImageResource.Builder);
method public androidx.wear.tiles.ResourceBuilders.Resources build();
method public androidx.wear.tiles.ResourceBuilders.Resources.Builder setVersion(String);
}
@@ -1025,11 +938,11 @@
}
public static final class StateBuilders.State {
- method public static androidx.wear.tiles.StateBuilders.State.Builder builder();
method public String getLastClickableId();
}
public static final class StateBuilders.State.Builder {
+ ctor public StateBuilders.State.Builder();
method public androidx.wear.tiles.StateBuilders.State build();
}
@@ -1037,18 +950,17 @@
}
public static final class TileBuilders.Tile {
- method public static androidx.wear.tiles.TileBuilders.Tile.Builder builder();
method public long getFreshnessIntervalMillis();
method public String getResourcesVersion();
method public androidx.wear.tiles.TimelineBuilders.Timeline? getTimeline();
}
public static final class TileBuilders.Tile.Builder {
+ ctor public TileBuilders.Tile.Builder();
method public androidx.wear.tiles.TileBuilders.Tile build();
method public androidx.wear.tiles.TileBuilders.Tile.Builder setFreshnessIntervalMillis(long);
method public androidx.wear.tiles.TileBuilders.Tile.Builder setResourcesVersion(String);
method public androidx.wear.tiles.TileBuilders.Tile.Builder setTimeline(androidx.wear.tiles.TimelineBuilders.Timeline);
- method public androidx.wear.tiles.TileBuilders.Tile.Builder setTimeline(androidx.wear.tiles.TimelineBuilders.Timeline.Builder);
}
public abstract class TileProviderService extends android.app.Service {
@@ -1074,81 +986,78 @@
}
public static final class TimelineBuilders.TimeInterval {
- method public static androidx.wear.tiles.TimelineBuilders.TimeInterval.Builder builder();
method public long getEndMillis();
method public long getStartMillis();
}
public static final class TimelineBuilders.TimeInterval.Builder {
+ ctor public TimelineBuilders.TimeInterval.Builder();
method public androidx.wear.tiles.TimelineBuilders.TimeInterval build();
method public androidx.wear.tiles.TimelineBuilders.TimeInterval.Builder setEndMillis(long);
method public androidx.wear.tiles.TimelineBuilders.TimeInterval.Builder setStartMillis(long);
}
public static final class TimelineBuilders.Timeline {
- method public static androidx.wear.tiles.TimelineBuilders.Timeline.Builder builder();
method public java.util.List<androidx.wear.tiles.TimelineBuilders.TimelineEntry!> getTimelineEntries();
}
public static final class TimelineBuilders.Timeline.Builder {
+ ctor public TimelineBuilders.Timeline.Builder();
method public androidx.wear.tiles.TimelineBuilders.Timeline.Builder addTimelineEntry(androidx.wear.tiles.TimelineBuilders.TimelineEntry);
- method public androidx.wear.tiles.TimelineBuilders.Timeline.Builder addTimelineEntry(androidx.wear.tiles.TimelineBuilders.TimelineEntry.Builder);
method public androidx.wear.tiles.TimelineBuilders.Timeline build();
}
public static final class TimelineBuilders.TimelineEntry {
- method public static androidx.wear.tiles.TimelineBuilders.TimelineEntry.Builder builder();
method public androidx.wear.tiles.LayoutElementBuilders.Layout? getLayout();
method public androidx.wear.tiles.TimelineBuilders.TimeInterval? getValidity();
}
public static final class TimelineBuilders.TimelineEntry.Builder {
+ ctor public TimelineBuilders.TimelineEntry.Builder();
method public androidx.wear.tiles.TimelineBuilders.TimelineEntry build();
method public androidx.wear.tiles.TimelineBuilders.TimelineEntry.Builder setLayout(androidx.wear.tiles.LayoutElementBuilders.Layout);
- method public androidx.wear.tiles.TimelineBuilders.TimelineEntry.Builder setLayout(androidx.wear.tiles.LayoutElementBuilders.Layout.Builder);
method public androidx.wear.tiles.TimelineBuilders.TimelineEntry.Builder setValidity(androidx.wear.tiles.TimelineBuilders.TimeInterval);
- method public androidx.wear.tiles.TimelineBuilders.TimelineEntry.Builder setValidity(androidx.wear.tiles.TimelineBuilders.TimeInterval.Builder);
}
public final class TypeBuilders {
}
public static final class TypeBuilders.BoolProp {
- method public static androidx.wear.tiles.TypeBuilders.BoolProp.Builder builder();
method public boolean getValue();
}
public static final class TypeBuilders.BoolProp.Builder {
+ ctor public TypeBuilders.BoolProp.Builder();
method public androidx.wear.tiles.TypeBuilders.BoolProp build();
method public androidx.wear.tiles.TypeBuilders.BoolProp.Builder setValue(boolean);
}
public static final class TypeBuilders.FloatProp {
- method public static androidx.wear.tiles.TypeBuilders.FloatProp.Builder builder();
method public float getValue();
}
public static final class TypeBuilders.FloatProp.Builder {
+ ctor public TypeBuilders.FloatProp.Builder();
method public androidx.wear.tiles.TypeBuilders.FloatProp build();
method public androidx.wear.tiles.TypeBuilders.FloatProp.Builder setValue(float);
}
public static final class TypeBuilders.Int32Prop {
- method public static androidx.wear.tiles.TypeBuilders.Int32Prop.Builder builder();
method public int getValue();
}
public static final class TypeBuilders.Int32Prop.Builder {
+ ctor public TypeBuilders.Int32Prop.Builder();
method public androidx.wear.tiles.TypeBuilders.Int32Prop build();
method public androidx.wear.tiles.TypeBuilders.Int32Prop.Builder setValue(int);
}
public static final class TypeBuilders.StringProp {
- method public static androidx.wear.tiles.TypeBuilders.StringProp.Builder builder();
method public String getValue();
}
public static final class TypeBuilders.StringProp.Builder {
+ ctor public TypeBuilders.StringProp.Builder();
method public androidx.wear.tiles.TypeBuilders.StringProp build();
method public androidx.wear.tiles.TypeBuilders.StringProp.Builder setValue(String);
}
diff --git a/wear/tiles/tiles/build.gradle b/wear/tiles/tiles/build.gradle
index cedca9fc..6709574 100644
--- a/wear/tiles/tiles/build.gradle
+++ b/wear/tiles/tiles/build.gradle
@@ -28,7 +28,7 @@
api(libs.guavaListenableFuture)
implementation("androidx.annotation:annotation-experimental:1.1.0")
- implementation(project(path: ":wear:tiles:tiles-proto", configuration: "shadow"))
+ implementation(project(path: ":wear:tiles:tiles-proto"))
compileOnly(libs.kotlinStdlib) // For annotation-experimental
diff --git a/wear/tiles/tiles/src/main/java/androidx/wear/tiles/ActionBuilders.java b/wear/tiles/tiles/src/main/java/androidx/wear/tiles/ActionBuilders.java
index 1aa8fbb..243aae3 100644
--- a/wear/tiles/tiles/src/main/java/androidx/wear/tiles/ActionBuilders.java
+++ b/wear/tiles/tiles/src/main/java/androidx/wear/tiles/ActionBuilders.java
@@ -37,31 +37,31 @@
/** Shortcut for building an {@link AndroidStringExtra}. */
@NonNull
public static AndroidStringExtra stringExtra(@NonNull String value) {
- return AndroidStringExtra.builder().setValue(value).build();
+ return new AndroidStringExtra.Builder().setValue(value).build();
}
/** Shortcut for building an {@link AndroidIntExtra}. */
@NonNull
public static AndroidIntExtra intExtra(int value) {
- return AndroidIntExtra.builder().setValue(value).build();
+ return new AndroidIntExtra.Builder().setValue(value).build();
}
/** Shortcut for building an {@link AndroidLongExtra}. */
@NonNull
public static AndroidLongExtra longExtra(long value) {
- return AndroidLongExtra.builder().setValue(value).build();
+ return new AndroidLongExtra.Builder().setValue(value).build();
}
/** Shortcut for building an {@link AndroidDoubleExtra}. */
@NonNull
public static AndroidDoubleExtra doubleExtra(double value) {
- return AndroidDoubleExtra.builder().setValue(value).build();
+ return new AndroidDoubleExtra.Builder().setValue(value).build();
}
/** Shortcut for building an {@link AndroidBooleanExtra}. */
@NonNull
public static AndroidBooleanExtra booleanExtra(boolean value) {
- return AndroidBooleanExtra.builder().setValue(value).build();
+ return new AndroidBooleanExtra.Builder().setValue(value).build();
}
/** A string value that can be added to an Android intent's extras. */
@@ -78,12 +78,6 @@
return mImpl.getValue();
}
- /** Returns a new {@link Builder}. */
- @NonNull
- public static Builder builder() {
- return new Builder();
- }
-
/** @hide */
@RestrictTo(Scope.LIBRARY_GROUP)
@NonNull
@@ -111,7 +105,7 @@
private final ActionProto.AndroidStringExtra.Builder mImpl =
ActionProto.AndroidStringExtra.newBuilder();
- Builder() {}
+ public Builder() {}
/** Sets the value. */
@NonNull
@@ -141,12 +135,6 @@
return mImpl.getValue();
}
- /** Returns a new {@link Builder}. */
- @NonNull
- public static Builder builder() {
- return new Builder();
- }
-
/** @hide */
@RestrictTo(Scope.LIBRARY_GROUP)
@NonNull
@@ -174,7 +162,7 @@
private final ActionProto.AndroidIntExtra.Builder mImpl =
ActionProto.AndroidIntExtra.newBuilder();
- Builder() {}
+ public Builder() {}
/** Sets the value. */
@NonNull
@@ -204,12 +192,6 @@
return mImpl.getValue();
}
- /** Returns a new {@link Builder}. */
- @NonNull
- public static Builder builder() {
- return new Builder();
- }
-
/** @hide */
@RestrictTo(Scope.LIBRARY_GROUP)
@NonNull
@@ -237,7 +219,7 @@
private final ActionProto.AndroidLongExtra.Builder mImpl =
ActionProto.AndroidLongExtra.newBuilder();
- Builder() {}
+ public Builder() {}
/** Sets the value. */
@NonNull
@@ -267,12 +249,6 @@
return mImpl.getValue();
}
- /** Returns a new {@link Builder}. */
- @NonNull
- public static Builder builder() {
- return new Builder();
- }
-
/** @hide */
@RestrictTo(Scope.LIBRARY_GROUP)
@NonNull
@@ -300,7 +276,7 @@
private final ActionProto.AndroidDoubleExtra.Builder mImpl =
ActionProto.AndroidDoubleExtra.newBuilder();
- Builder() {}
+ public Builder() {}
/** Sets the value. */
@NonNull
@@ -330,12 +306,6 @@
return mImpl.getValue();
}
- /** Returns a new {@link Builder}. */
- @NonNull
- public static Builder builder() {
- return new Builder();
- }
-
/** @hide */
@RestrictTo(Scope.LIBRARY_GROUP)
@NonNull
@@ -364,7 +334,7 @@
private final ActionProto.AndroidBooleanExtra.Builder mImpl =
ActionProto.AndroidBooleanExtra.newBuilder();
- Builder() {}
+ public Builder() {}
/** Sets the value. */
@SuppressLint("MissingGetterMatchingBuilder")
@@ -473,12 +443,6 @@
f.getValue()))));
}
- /** Returns a new {@link Builder}. */
- @NonNull
- public static Builder builder() {
- return new Builder();
- }
-
/** @hide */
@RestrictTo(Scope.LIBRARY_GROUP)
@NonNull
@@ -498,7 +462,7 @@
private final ActionProto.AndroidActivity.Builder mImpl =
ActionProto.AndroidActivity.newBuilder();
- Builder() {}
+ public Builder() {}
/** Sets the package name to send the intent to, for example, "com.google.weather". */
@NonNull
@@ -525,15 +489,6 @@
return this;
}
- /** Adds an entry into the extras to be included in the intent. */
- @SuppressLint("MissingGetterMatchingBuilder")
- @NonNull
- public Builder addKeyToExtraMapping(
- @NonNull String key, @NonNull AndroidExtra.Builder extraBuilder) {
- mImpl.putKeyToExtra(key, extraBuilder.build().toAndroidExtraProto());
- return this;
- }
-
/** Builds an instance from accumulated values. */
@NonNull
public AndroidActivity build() {
@@ -564,12 +519,6 @@
}
}
- /** Returns a new {@link Builder}. */
- @NonNull
- public static Builder builder() {
- return new Builder();
- }
-
/** @hide */
@RestrictTo(Scope.LIBRARY_GROUP)
@NonNull
@@ -597,7 +546,7 @@
private final ActionProto.LaunchAction.Builder mImpl =
ActionProto.LaunchAction.newBuilder();
- Builder() {}
+ public Builder() {}
/** Sets an action to launch an Android activity. */
@NonNull
@@ -606,14 +555,6 @@
return this;
}
- /** Sets an action to launch an Android activity. */
- @NonNull
- public Builder setAndroidActivity(
- @NonNull AndroidActivity.Builder androidActivityBuilder) {
- mImpl.setAndroidActivity(androidActivityBuilder.build().toProto());
- return this;
- }
-
@Override
@NonNull
public LaunchAction build() {
@@ -645,12 +586,6 @@
}
}
- /** Returns a new {@link Builder}. */
- @NonNull
- public static Builder builder() {
- return new Builder();
- }
-
/** @hide */
@RestrictTo(Scope.LIBRARY_GROUP)
@NonNull
@@ -678,7 +613,7 @@
private final ActionProto.LoadAction.Builder mImpl =
ActionProto.LoadAction.newBuilder();
- Builder() {}
+ public Builder() {}
/**
* Sets the state to load the next tile with. This will be included in the {@link
@@ -691,17 +626,6 @@
return this;
}
- /**
- * Sets the state to load the next tile with. This will be included in the {@link
- * androidx.wear.tiles.RequestBuilders.TileRequest} sent after this action is invoked by
- * a {@link androidx.wear.tiles.ModifiersBuilders.Clickable}.
- */
- @NonNull
- public Builder setRequestState(@NonNull State.Builder requestStateBuilder) {
- mImpl.setRequestState(requestStateBuilder.build().toProto());
- return this;
- }
-
@Override
@NonNull
public LoadAction build() {
diff --git a/wear/tiles/tiles/src/main/java/androidx/wear/tiles/ColorBuilders.java b/wear/tiles/tiles/src/main/java/androidx/wear/tiles/ColorBuilders.java
index 7d74b0a..fa35b82 100644
--- a/wear/tiles/tiles/src/main/java/androidx/wear/tiles/ColorBuilders.java
+++ b/wear/tiles/tiles/src/main/java/androidx/wear/tiles/ColorBuilders.java
@@ -29,7 +29,7 @@
/** Shortcut for building a {@link ColorProp} using an ARGB value. */
@NonNull
public static ColorProp argb(@ColorInt int colorArgb) {
- return ColorProp.builder().setArgb(colorArgb).build();
+ return new ColorProp.Builder().setArgb(colorArgb).build();
}
/** A property defining a color. */
@@ -46,12 +46,6 @@
return mImpl.getArgb();
}
- /** Returns a new {@link Builder}. */
- @NonNull
- public static Builder builder() {
- return new Builder();
- }
-
/** @hide */
@RestrictTo(Scope.LIBRARY_GROUP)
@NonNull
@@ -70,7 +64,7 @@
public static final class Builder {
private final ColorProto.ColorProp.Builder mImpl = ColorProto.ColorProp.newBuilder();
- Builder() {}
+ public Builder() {}
/** Sets the color value, in ARGB format. */
@NonNull
diff --git a/wear/tiles/tiles/src/main/java/androidx/wear/tiles/DeviceParametersBuilders.java b/wear/tiles/tiles/src/main/java/androidx/wear/tiles/DeviceParametersBuilders.java
index 61dc624..74e900a 100644
--- a/wear/tiles/tiles/src/main/java/androidx/wear/tiles/DeviceParametersBuilders.java
+++ b/wear/tiles/tiles/src/main/java/androidx/wear/tiles/DeviceParametersBuilders.java
@@ -112,12 +112,6 @@
return mImpl.getScreenShape().getNumber();
}
- /** Returns a new {@link Builder}. */
- @NonNull
- public static Builder builder() {
- return new Builder();
- }
-
/** @hide */
@RestrictTo(Scope.LIBRARY_GROUP)
@NonNull
@@ -138,7 +132,7 @@
private final DeviceParametersProto.DeviceParameters.Builder mImpl =
DeviceParametersProto.DeviceParameters.newBuilder();
- Builder() {}
+ public Builder() {}
/** Sets width of the device's screen in DP. */
@NonNull
diff --git a/wear/tiles/tiles/src/main/java/androidx/wear/tiles/DimensionBuilders.java b/wear/tiles/tiles/src/main/java/androidx/wear/tiles/DimensionBuilders.java
index aeee6f5..fadeb59 100644
--- a/wear/tiles/tiles/src/main/java/androidx/wear/tiles/DimensionBuilders.java
+++ b/wear/tiles/tiles/src/main/java/androidx/wear/tiles/DimensionBuilders.java
@@ -32,31 +32,31 @@
public final class DimensionBuilders {
private DimensionBuilders() {}
- private static final ExpandedDimensionProp EXPAND = ExpandedDimensionProp.builder().build();
- private static final WrappedDimensionProp WRAP = WrappedDimensionProp.builder().build();
+ private static final ExpandedDimensionProp EXPAND = new ExpandedDimensionProp.Builder().build();
+ private static final WrappedDimensionProp WRAP = new WrappedDimensionProp.Builder().build();
/** Shortcut for building a {@link DpProp} using a measurement in DP. */
@NonNull
public static DpProp dp(@Dimension(unit = DP) float valueDp) {
- return DpProp.builder().setValue(valueDp).build();
+ return new DpProp.Builder().setValue(valueDp).build();
}
/** Shortcut for building a {@link SpProp} using a measurement in SP. */
@NonNull
public static SpProp sp(@Dimension(unit = SP) float valueSp) {
- return SpProp.builder().setValue(valueSp).build();
+ return new SpProp.Builder().setValue(valueSp).build();
}
/** Shortcut for building a {@link EmProp} using a measurement in EM. */
@NonNull
public static EmProp em(int valueEm) {
- return EmProp.builder().setValue(valueEm).build();
+ return new EmProp.Builder().setValue(valueEm).build();
}
/** Shortcut for building an {@link DegreesProp} using a measurement in degrees. */
@NonNull
public static DegreesProp degrees(float valueDegrees) {
- return DegreesProp.builder().setValue(valueDegrees).build();
+ return new DegreesProp.Builder().setValue(valueDegrees).build();
}
/**
@@ -92,12 +92,6 @@
return mImpl.getValue();
}
- /** Returns a new {@link Builder}. */
- @NonNull
- public static Builder builder() {
- return new Builder();
- }
-
/** @hide */
@RestrictTo(Scope.LIBRARY_GROUP)
@NonNull
@@ -143,7 +137,7 @@
SpacerDimension.Builder {
private final DimensionProto.DpProp.Builder mImpl = DimensionProto.DpProp.newBuilder();
- Builder() {}
+ public Builder() {}
/** Sets the value, in dp. */
@NonNull
@@ -174,12 +168,6 @@
return mImpl.getValue();
}
- /** Returns a new {@link Builder}. */
- @NonNull
- public static Builder builder() {
- return new Builder();
- }
-
/** @hide */
@RestrictTo(Scope.LIBRARY_GROUP)
@NonNull
@@ -198,7 +186,7 @@
public static final class Builder {
private final DimensionProto.SpProp.Builder mImpl = DimensionProto.SpProp.newBuilder();
- Builder() {}
+ public Builder() {}
/** Sets the value, in sp. */
@NonNull
@@ -228,12 +216,6 @@
return mImpl.getValue();
}
- /** Returns a new {@link Builder}. */
- @NonNull
- public static Builder builder() {
- return new Builder();
- }
-
/** @hide */
@RestrictTo(Scope.LIBRARY_GROUP)
@NonNull
@@ -252,7 +234,7 @@
public static final class Builder {
private final DimensionProto.EmProp.Builder mImpl = DimensionProto.EmProp.newBuilder();
- Builder() {}
+ public Builder() {}
/** Sets the value, in em. */
@NonNull
@@ -282,12 +264,6 @@
return mImpl.getValue();
}
- /** Returns a new {@link Builder}. */
- @NonNull
- public static Builder builder() {
- return new Builder();
- }
-
/** @hide */
@RestrictTo(Scope.LIBRARY_GROUP)
@NonNull
@@ -307,7 +283,7 @@
private final DimensionProto.DegreesProp.Builder mImpl =
DimensionProto.DegreesProp.newBuilder();
- Builder() {}
+ public Builder() {}
/** Sets the value, in degrees. */
@NonNull
@@ -335,12 +311,6 @@
this.mImpl = impl;
}
- /** Returns a new {@link Builder}. */
- @NonNull
- public static Builder builder() {
- return new Builder();
- }
-
/** @hide */
@RestrictTo(Scope.LIBRARY_GROUP)
@NonNull
@@ -380,7 +350,7 @@
private final DimensionProto.ExpandedDimensionProp.Builder mImpl =
DimensionProto.ExpandedDimensionProp.newBuilder();
- Builder() {}
+ public Builder() {}
@Override
@NonNull
@@ -401,12 +371,6 @@
this.mImpl = impl;
}
- /** Returns a new {@link Builder}. */
- @NonNull
- public static Builder builder() {
- return new Builder();
- }
-
/** @hide */
@RestrictTo(Scope.LIBRARY_GROUP)
@NonNull
@@ -437,7 +401,7 @@
private final DimensionProto.WrappedDimensionProp.Builder mImpl =
DimensionProto.WrappedDimensionProp.newBuilder();
- Builder() {}
+ public Builder() {}
@Override
@NonNull
@@ -481,12 +445,6 @@
return mImpl.getAspectRatioHeight();
}
- /** Returns a new {@link Builder}. */
- @NonNull
- public static Builder builder() {
- return new Builder();
- }
-
/** @hide */
@RestrictTo(Scope.LIBRARY_GROUP)
@NonNull
@@ -517,7 +475,7 @@
private final DimensionProto.ProportionalDimensionProp.Builder mImpl =
DimensionProto.ProportionalDimensionProp.newBuilder();
- Builder() {}
+ public Builder() {}
/** Sets the width to be used when calculating the aspect ratio to preserve. */
@NonNull
diff --git a/wear/tiles/tiles/src/main/java/androidx/wear/tiles/EventBuilders.java b/wear/tiles/tiles/src/main/java/androidx/wear/tiles/EventBuilders.java
index cfc85fd..17e5741 100644
--- a/wear/tiles/tiles/src/main/java/androidx/wear/tiles/EventBuilders.java
+++ b/wear/tiles/tiles/src/main/java/androidx/wear/tiles/EventBuilders.java
@@ -33,12 +33,6 @@
this.mImpl = impl;
}
- /** Returns a new {@link Builder}. */
- @NonNull
- public static Builder builder() {
- return new Builder();
- }
-
/** @hide */
@RestrictTo(Scope.LIBRARY_GROUP)
@NonNull
@@ -58,7 +52,7 @@
private final EventProto.TileAddEvent.Builder mImpl =
EventProto.TileAddEvent.newBuilder();
- Builder() {}
+ public Builder() {}
/** Builds an instance from accumulated values. */
@NonNull
@@ -76,12 +70,6 @@
this.mImpl = impl;
}
- /** Returns a new {@link Builder}. */
- @NonNull
- public static Builder builder() {
- return new Builder();
- }
-
/** @hide */
@RestrictTo(Scope.LIBRARY_GROUP)
@NonNull
@@ -101,7 +89,7 @@
private final EventProto.TileRemoveEvent.Builder mImpl =
EventProto.TileRemoveEvent.newBuilder();
- Builder() {}
+ public Builder() {}
/** Builds an instance from accumulated values. */
@NonNull
@@ -119,12 +107,6 @@
this.mImpl = impl;
}
- /** Returns a new {@link Builder}. */
- @NonNull
- public static Builder builder() {
- return new Builder();
- }
-
/** @hide */
@RestrictTo(Scope.LIBRARY_GROUP)
@NonNull
@@ -144,7 +126,7 @@
private final EventProto.TileEnterEvent.Builder mImpl =
EventProto.TileEnterEvent.newBuilder();
- Builder() {}
+ public Builder() {}
/** Builds an instance from accumulated values. */
@NonNull
@@ -165,12 +147,6 @@
this.mImpl = impl;
}
- /** Returns a new {@link Builder}. */
- @NonNull
- public static Builder builder() {
- return new Builder();
- }
-
/** @hide */
@RestrictTo(Scope.LIBRARY_GROUP)
@NonNull
@@ -190,7 +166,7 @@
private final EventProto.TileLeaveEvent.Builder mImpl =
EventProto.TileLeaveEvent.newBuilder();
- Builder() {}
+ public Builder() {}
/** Builds an instance from accumulated values. */
@NonNull
diff --git a/wear/tiles/tiles/src/main/java/androidx/wear/tiles/LayoutElementBuilders.java b/wear/tiles/tiles/src/main/java/androidx/wear/tiles/LayoutElementBuilders.java
index 93bb313..cf02974 100644
--- a/wear/tiles/tiles/src/main/java/androidx/wear/tiles/LayoutElementBuilders.java
+++ b/wear/tiles/tiles/src/main/java/androidx/wear/tiles/LayoutElementBuilders.java
@@ -352,12 +352,6 @@
return mImpl.getValue().getNumber();
}
- /** Returns a new {@link Builder}. */
- @NonNull
- public static Builder builder() {
- return new Builder();
- }
-
/** @hide */
@RestrictTo(Scope.LIBRARY_GROUP)
@NonNull
@@ -378,7 +372,7 @@
private final LayoutElementProto.HorizontalAlignmentProp.Builder mImpl =
LayoutElementProto.HorizontalAlignmentProp.newBuilder();
- Builder() {}
+ public Builder() {}
/** Sets the value. */
@NonNull
@@ -409,12 +403,6 @@
return mImpl.getValue().getNumber();
}
- /** Returns a new {@link Builder}. */
- @NonNull
- public static Builder builder() {
- return new Builder();
- }
-
/** @hide */
@RestrictTo(Scope.LIBRARY_GROUP)
@NonNull
@@ -435,7 +423,7 @@
private final LayoutElementProto.VerticalAlignmentProp.Builder mImpl =
LayoutElementProto.VerticalAlignmentProp.newBuilder();
- Builder() {}
+ public Builder() {}
/** Sets the value. */
@NonNull
@@ -466,12 +454,6 @@
return mImpl.getValue().getNumber();
}
- /** Returns a new {@link Builder}. */
- @NonNull
- public static Builder builder() {
- return new Builder();
- }
-
/** @hide */
@RestrictTo(Scope.LIBRARY_GROUP)
@NonNull
@@ -491,7 +473,7 @@
private final LayoutElementProto.FontWeightProp.Builder mImpl =
LayoutElementProto.FontWeightProp.newBuilder();
- Builder() {}
+ public Builder() {}
/** Sets the value. */
@NonNull
@@ -523,12 +505,6 @@
return mImpl.getValue().getNumber();
}
- /** Returns a new {@link Builder}. */
- @NonNull
- public static Builder builder() {
- return new Builder();
- }
-
/** @hide */
@RestrictTo(Scope.LIBRARY_GROUP)
@NonNull
@@ -548,7 +524,7 @@
private final LayoutElementProto.FontVariantProp.Builder mImpl =
LayoutElementProto.FontVariantProp.newBuilder();
- Builder() {}
+ public Builder() {}
/** Sets the value. */
@NonNull
@@ -579,12 +555,6 @@
return mImpl.getValue().getNumber();
}
- /** Returns a new {@link Builder}. */
- @NonNull
- public static Builder builder() {
- return new Builder();
- }
-
/** @hide */
@RestrictTo(Scope.LIBRARY_GROUP)
@NonNull
@@ -605,7 +575,7 @@
private final LayoutElementProto.SpanVerticalAlignmentProp.Builder mImpl =
LayoutElementProto.SpanVerticalAlignmentProp.newBuilder();
- Builder() {}
+ public Builder() {}
/** Sets the value. */
@NonNull
@@ -725,12 +695,6 @@
}
}
- /** Returns a new {@link Builder}. */
- @NonNull
- public static Builder builder() {
- return new Builder();
- }
-
/** @hide */
@RestrictTo(Scope.LIBRARY_GROUP)
@NonNull
@@ -750,7 +714,7 @@
private final LayoutElementProto.FontStyle.Builder mImpl =
LayoutElementProto.FontStyle.newBuilder();
- Builder() {}
+ public Builder() {}
/**
* Sets the size of the font, in scaled pixels (sp). If not specified, defaults to the
@@ -763,16 +727,6 @@
}
/**
- * Sets the size of the font, in scaled pixels (sp). If not specified, defaults to the
- * size of the system's "body" font.
- */
- @NonNull
- public Builder setSize(@NonNull SpProp.Builder sizeBuilder) {
- mImpl.setSize(sizeBuilder.build().toProto());
- return this;
- }
-
- /**
* Sets whether the text should be rendered in a italic typeface. If not specified,
* defaults to "false".
*/
@@ -819,13 +773,6 @@
return this;
}
- /** Sets the text color. If not defined, defaults to white. */
- @NonNull
- public Builder setColor(@NonNull ColorProp.Builder colorBuilder) {
- mImpl.setColor(colorBuilder.build().toProto());
- return this;
- }
-
/**
* Sets the weight of the font. If the provided value is not supported on a platform,
* the nearest supported value will be used. If not defined, or when set to an invalid
@@ -860,16 +807,6 @@
}
/**
- * Sets the text letter-spacing. Positive numbers increase the space between letters
- * while negative numbers tighten the space. If not specified, defaults to 0.
- */
- @NonNull
- public Builder setLetterSpacing(@NonNull EmProp.Builder letterSpacingBuilder) {
- mImpl.setLetterSpacing(letterSpacingBuilder.build().toProto());
- return this;
- }
-
- /**
* Sets the variant of a font. Some renderers may use different fonts for title and body
* text, which can be selected using this field. If not specified, defaults to "body".
*/
@@ -914,12 +851,6 @@
return mImpl.getValue().getNumber();
}
- /** Returns a new {@link Builder}. */
- @NonNull
- public static Builder builder() {
- return new Builder();
- }
-
/** @hide */
@RestrictTo(Scope.LIBRARY_GROUP)
@NonNull
@@ -940,7 +871,7 @@
private final LayoutElementProto.TextAlignmentProp.Builder mImpl =
LayoutElementProto.TextAlignmentProp.newBuilder();
- Builder() {}
+ public Builder() {}
/** Sets the value. */
@NonNull
@@ -971,12 +902,6 @@
return mImpl.getValue().getNumber();
}
- /** Returns a new {@link Builder}. */
- @NonNull
- public static Builder builder() {
- return new Builder();
- }
-
/** @hide */
@RestrictTo(Scope.LIBRARY_GROUP)
@NonNull
@@ -997,7 +922,7 @@
private final LayoutElementProto.TextOverflowProp.Builder mImpl =
LayoutElementProto.TextOverflowProp.newBuilder();
- Builder() {}
+ public Builder() {}
/** Sets the value. */
@NonNull
@@ -1028,12 +953,6 @@
return mImpl.getValue().getNumber();
}
- /** Returns a new {@link Builder}. */
- @NonNull
- public static Builder builder() {
- return new Builder();
- }
-
/** @hide */
@RestrictTo(Scope.LIBRARY_GROUP)
@NonNull
@@ -1054,7 +973,7 @@
private final LayoutElementProto.ArcAnchorTypeProp.Builder mImpl =
LayoutElementProto.ArcAnchorTypeProp.newBuilder();
- Builder() {}
+ public Builder() {}
/** Sets the value. */
@NonNull
@@ -1175,12 +1094,6 @@
}
}
- /** Returns a new {@link Builder}. */
- @NonNull
- public static Builder builder() {
- return new Builder();
- }
-
/** @hide */
@RestrictTo(Scope.LIBRARY_GROUP)
@NonNull
@@ -1208,7 +1121,7 @@
private final LayoutElementProto.Text.Builder mImpl =
LayoutElementProto.Text.newBuilder();
- Builder() {}
+ public Builder() {}
/** Sets the text to render. */
@NonNull
@@ -1233,16 +1146,6 @@
return this;
}
- /**
- * Sets the style of font to use (size, bold etc). If not specified, defaults to the
- * platform's default body font.
- */
- @NonNull
- public Builder setFontStyle(@NonNull FontStyle.Builder fontStyleBuilder) {
- mImpl.setFontStyle(fontStyleBuilder.build().toProto());
- return this;
- }
-
/** Sets {@link androidx.wear.tiles.ModifiersBuilders.Modifiers} for this element. */
@NonNull
public Builder setModifiers(@NonNull Modifiers modifiers) {
@@ -1250,13 +1153,6 @@
return this;
}
- /** Sets {@link androidx.wear.tiles.ModifiersBuilders.Modifiers} for this element. */
- @NonNull
- public Builder setModifiers(@NonNull Modifiers.Builder modifiersBuilder) {
- mImpl.setModifiers(modifiersBuilder.build().toProto());
- return this;
- }
-
/**
* Sets the maximum number of lines that can be represented by the {@link Text} element.
* If not defined, the {@link Text} element will be treated as a single-line element.
@@ -1343,17 +1239,6 @@
return this;
}
- /**
- * Sets the explicit height between lines of text. This is equivalent to the vertical
- * distance between subsequent baselines. If not specified, defaults the font's
- * recommended interline spacing.
- */
- @NonNull
- public Builder setLineHeight(@NonNull SpProp.Builder lineHeightBuilder) {
- mImpl.setLineHeight(lineHeightBuilder.build().toProto());
- return this;
- }
-
@Override
@NonNull
public Text build() {
@@ -1376,12 +1261,6 @@
return mImpl.getValue().getNumber();
}
- /** Returns a new {@link Builder}. */
- @NonNull
- public static Builder builder() {
- return new Builder();
- }
-
/** @hide */
@RestrictTo(Scope.LIBRARY_GROUP)
@NonNull
@@ -1402,7 +1281,7 @@
private final LayoutElementProto.ContentScaleModeProp.Builder mImpl =
LayoutElementProto.ContentScaleModeProp.newBuilder();
- Builder() {}
+ public Builder() {}
/** Sets the value. */
@NonNull
@@ -1444,12 +1323,6 @@
}
}
- /** Returns a new {@link Builder}. */
- @NonNull
- public static Builder builder() {
- return new Builder();
- }
-
/** @hide */
@RestrictTo(Scope.LIBRARY_GROUP)
@NonNull
@@ -1469,7 +1342,7 @@
private final LayoutElementProto.ColorFilter.Builder mImpl =
LayoutElementProto.ColorFilter.newBuilder();
- Builder() {}
+ public Builder() {}
/**
* Sets the tint color to use. If specified, the image will be tinted, using SRC_IN
@@ -1485,20 +1358,6 @@
return this;
}
- /**
- * Sets the tint color to use. If specified, the image will be tinted, using SRC_IN
- * blending (that is, all color information will be stripped from the target image, and
- * only the alpha channel will be blended with the requested color).
- *
- * <p>Note that only Android image resources can be tinted; Inline images will not be
- * tinted, and this property will have no effect.
- */
- @NonNull
- public Builder setTint(@NonNull ColorProp.Builder tintBuilder) {
- mImpl.setTint(tintBuilder.build().toProto());
- return this;
- }
-
/** Builds an instance from accumulated values. */
@NonNull
public ColorFilter build() {
@@ -1601,12 +1460,6 @@
}
}
- /** Returns a new {@link Builder}. */
- @NonNull
- public static Builder builder() {
- return new Builder();
- }
-
/** @hide */
@RestrictTo(Scope.LIBRARY_GROUP)
@NonNull
@@ -1634,7 +1487,7 @@
private final LayoutElementProto.Image.Builder mImpl =
LayoutElementProto.Image.newBuilder();
- Builder() {}
+ public Builder() {}
/**
* Sets the resource_id of the image to render. This must exist in the supplied resource
@@ -1662,13 +1515,6 @@
return this;
}
- /** Sets the width of this image. If not defined, the image will not be rendered. */
- @NonNull
- public Builder setWidth(@NonNull ImageDimension.Builder widthBuilder) {
- mImpl.setWidth(widthBuilder.build().toImageDimensionProto());
- return this;
- }
-
/** Sets the height of this image. If not defined, the image will not be rendered. */
@NonNull
public Builder setHeight(@NonNull ImageDimension height) {
@@ -1676,13 +1522,6 @@
return this;
}
- /** Sets the height of this image. If not defined, the image will not be rendered. */
- @NonNull
- public Builder setHeight(@NonNull ImageDimension.Builder heightBuilder) {
- mImpl.setHeight(heightBuilder.build().toImageDimensionProto());
- return this;
- }
-
/**
* Sets how to scale the image resource inside the bounds specified by width/height if
* its size does not match those bounds. Defaults to CONTENT_SCALE_MODE_FIT.
@@ -1713,13 +1552,6 @@
return this;
}
- /** Sets {@link androidx.wear.tiles.ModifiersBuilders.Modifiers} for this element. */
- @NonNull
- public Builder setModifiers(@NonNull Modifiers.Builder modifiersBuilder) {
- mImpl.setModifiers(modifiersBuilder.build().toProto());
- return this;
- }
-
/**
* Sets filtering parameters for this image. If not specified, defaults to no filtering.
*/
@@ -1730,16 +1562,6 @@
return this;
}
- /**
- * Sets filtering parameters for this image. If not specified, defaults to no filtering.
- */
- @TilesExperimental
- @NonNull
- public Builder setFilter(@NonNull ColorFilter.Builder filterBuilder) {
- mImpl.setFilter(filterBuilder.build().toProto());
- return this;
- }
-
@Override
@NonNull
public Image build() {
@@ -1796,12 +1618,6 @@
}
}
- /** Returns a new {@link Builder}. */
- @NonNull
- public static Builder builder() {
- return new Builder();
- }
-
/** @hide */
@RestrictTo(Scope.LIBRARY_GROUP)
@NonNull
@@ -1829,7 +1645,7 @@
private final LayoutElementProto.Spacer.Builder mImpl =
LayoutElementProto.Spacer.newBuilder();
- Builder() {}
+ public Builder() {}
/**
* Sets the width of this {@link Spacer}. When this is added as the direct child of an
@@ -1842,17 +1658,6 @@
return this;
}
- /**
- * Sets the width of this {@link Spacer}. When this is added as the direct child of an
- * {@link Arc}, this must be specified as an angular dimension, otherwise a linear
- * dimension must be used. If not defined, defaults to 0.
- */
- @NonNull
- public Builder setWidth(@NonNull SpacerDimension.Builder widthBuilder) {
- mImpl.setWidth(widthBuilder.build().toSpacerDimensionProto());
- return this;
- }
-
/** Sets the height of this spacer. If not defined, defaults to 0. */
@NonNull
public Builder setHeight(@NonNull SpacerDimension height) {
@@ -1860,13 +1665,6 @@
return this;
}
- /** Sets the height of this spacer. If not defined, defaults to 0. */
- @NonNull
- public Builder setHeight(@NonNull SpacerDimension.Builder heightBuilder) {
- mImpl.setHeight(heightBuilder.build().toSpacerDimensionProto());
- return this;
- }
-
/** Sets {@link androidx.wear.tiles.ModifiersBuilders.Modifiers} for this element. */
@NonNull
public Builder setModifiers(@NonNull Modifiers modifiers) {
@@ -1874,13 +1672,6 @@
return this;
}
- /** Sets {@link androidx.wear.tiles.ModifiersBuilders.Modifiers} for this element. */
- @NonNull
- public Builder setModifiers(@NonNull Modifiers.Builder modifiersBuilder) {
- mImpl.setModifiers(modifiersBuilder.build().toProto());
- return this;
- }
-
@Override
@NonNull
public Spacer build() {
@@ -1974,12 +1765,6 @@
}
}
- /** Returns a new {@link Builder}. */
- @NonNull
- public static Builder builder() {
- return new Builder();
- }
-
/** @hide */
@RestrictTo(Scope.LIBRARY_GROUP)
@NonNull
@@ -2007,7 +1792,7 @@
private final LayoutElementProto.Box.Builder mImpl =
LayoutElementProto.Box.newBuilder();
- Builder() {}
+ public Builder() {}
/** Adds one item to the child element(s) to wrap. */
@NonNull
@@ -2016,13 +1801,6 @@
return this;
}
- /** Adds one item to the child element(s) to wrap. */
- @NonNull
- public Builder addContent(@NonNull LayoutElement.Builder contentBuilder) {
- mImpl.addContents(contentBuilder.build().toLayoutElementProto());
- return this;
- }
-
/**
* Sets the height of this {@link Box}. If not defined, this will size itself to fit all
* of its children (i.e. a WrappedDimension).
@@ -2034,16 +1812,6 @@
}
/**
- * Sets the height of this {@link Box}. If not defined, this will size itself to fit all
- * of its children (i.e. a WrappedDimension).
- */
- @NonNull
- public Builder setHeight(@NonNull ContainerDimension.Builder heightBuilder) {
- mImpl.setHeight(heightBuilder.build().toContainerDimensionProto());
- return this;
- }
-
- /**
* Sets the width of this {@link Box}. If not defined, this will size itself to fit all
* of its children (i.e. a WrappedDimension).
*/
@@ -2054,16 +1822,6 @@
}
/**
- * Sets the width of this {@link Box}. If not defined, this will size itself to fit all
- * of its children (i.e. a WrappedDimension).
- */
- @NonNull
- public Builder setWidth(@NonNull ContainerDimension.Builder widthBuilder) {
- mImpl.setWidth(widthBuilder.build().toContainerDimensionProto());
- return this;
- }
-
- /**
* Sets the horizontal alignment of the element inside this {@link Box}. If not defined,
* defaults to HORIZONTAL_ALIGN_CENTER.
*/
@@ -2117,13 +1875,6 @@
return this;
}
- /** Sets {@link androidx.wear.tiles.ModifiersBuilders.Modifiers} for this element. */
- @NonNull
- public Builder setModifiers(@NonNull Modifiers.Builder modifiersBuilder) {
- mImpl.setModifiers(modifiersBuilder.build().toProto());
- return this;
- }
-
@Override
@NonNull
public Box build() {
@@ -2180,12 +1931,6 @@
}
}
- /** Returns a new {@link Builder}. */
- @NonNull
- public static Builder builder() {
- return new Builder();
- }
-
/** @hide */
@RestrictTo(Scope.LIBRARY_GROUP)
@NonNull
@@ -2213,7 +1958,7 @@
private final LayoutElementProto.SpanText.Builder mImpl =
LayoutElementProto.SpanText.newBuilder();
- Builder() {}
+ public Builder() {}
/** Sets the text to render. */
@NonNull
@@ -2238,16 +1983,6 @@
return this;
}
- /**
- * Sets the style of font to use (size, bold etc). If not specified, defaults to the
- * platform's default body font.
- */
- @NonNull
- public Builder setFontStyle(@NonNull FontStyle.Builder fontStyleBuilder) {
- mImpl.setFontStyle(fontStyleBuilder.build().toProto());
- return this;
- }
-
/** Sets {@link androidx.wear.tiles.ModifiersBuilders.Modifiers} for this element. */
@NonNull
public Builder setModifiers(@NonNull SpanModifiers modifiers) {
@@ -2255,13 +1990,6 @@
return this;
}
- /** Sets {@link androidx.wear.tiles.ModifiersBuilders.Modifiers} for this element. */
- @NonNull
- public Builder setModifiers(@NonNull SpanModifiers.Builder modifiersBuilder) {
- mImpl.setModifiers(modifiersBuilder.build().toProto());
- return this;
- }
-
@Override
@NonNull
public SpanText build() {
@@ -2343,12 +2071,6 @@
}
}
- /** Returns a new {@link Builder}. */
- @NonNull
- public static Builder builder() {
- return new Builder();
- }
-
/** @hide */
@RestrictTo(Scope.LIBRARY_GROUP)
@NonNull
@@ -2376,7 +2098,7 @@
private final LayoutElementProto.SpanImage.Builder mImpl =
LayoutElementProto.SpanImage.newBuilder();
- Builder() {}
+ public Builder() {}
/**
* Sets the resource_id of the image to render. This must exist in the supplied resource
@@ -2404,13 +2126,6 @@
return this;
}
- /** Sets the width of this image. If not defined, the image will not be rendered. */
- @NonNull
- public Builder setWidth(@NonNull DpProp.Builder widthBuilder) {
- mImpl.setWidth(widthBuilder.build().toProto());
- return this;
- }
-
/** Sets the height of this image. If not defined, the image will not be rendered. */
@NonNull
public Builder setHeight(@NonNull DpProp height) {
@@ -2418,13 +2133,6 @@
return this;
}
- /** Sets the height of this image. If not defined, the image will not be rendered. */
- @NonNull
- public Builder setHeight(@NonNull DpProp.Builder heightBuilder) {
- mImpl.setHeight(heightBuilder.build().toProto());
- return this;
- }
-
/** Sets {@link androidx.wear.tiles.ModifiersBuilders.Modifiers} for this element. */
@NonNull
public Builder setModifiers(@NonNull SpanModifiers modifiers) {
@@ -2432,13 +2140,6 @@
return this;
}
- /** Sets {@link androidx.wear.tiles.ModifiersBuilders.Modifiers} for this element. */
- @NonNull
- public Builder setModifiers(@NonNull SpanModifiers.Builder modifiersBuilder) {
- mImpl.setModifiers(modifiersBuilder.build().toProto());
- return this;
- }
-
/**
* Sets alignment of this image within the line height of the surrounding {@link
* Spannable}. If undefined, defaults to SPAN_VERTICAL_ALIGN_BOTTOM.
@@ -2610,12 +2311,6 @@
}
}
- /** Returns a new {@link Builder}. */
- @NonNull
- public static Builder builder() {
- return new Builder();
- }
-
/** @hide */
@RestrictTo(Scope.LIBRARY_GROUP)
@NonNull
@@ -2643,7 +2338,7 @@
private final LayoutElementProto.Spannable.Builder mImpl =
LayoutElementProto.Spannable.newBuilder();
- Builder() {}
+ public Builder() {}
/** Adds one item to the {@link Span} elements that form this {@link Spannable}. */
@NonNull
@@ -2652,13 +2347,6 @@
return this;
}
- /** Adds one item to the {@link Span} elements that form this {@link Spannable}. */
- @NonNull
- public Builder addSpan(@NonNull Span.Builder spanBuilder) {
- mImpl.addSpans(spanBuilder.build().toSpanProto());
- return this;
- }
-
/** Sets {@link androidx.wear.tiles.ModifiersBuilders.Modifiers} for this element. */
@NonNull
public Builder setModifiers(@NonNull Modifiers modifiers) {
@@ -2666,13 +2354,6 @@
return this;
}
- /** Sets {@link androidx.wear.tiles.ModifiersBuilders.Modifiers} for this element. */
- @NonNull
- public Builder setModifiers(@NonNull Modifiers.Builder modifiersBuilder) {
- mImpl.setModifiers(modifiersBuilder.build().toProto());
- return this;
- }
-
/**
* Sets the maximum number of lines that can be represented by the {@link Spannable}
* element. If not defined, the {@link Spannable} element will be treated as a
@@ -2762,17 +2443,6 @@
return this;
}
- /**
- * Sets the explicit height between lines of text. This is equivalent to the vertical
- * distance between subsequent baselines. If not specified, defaults the font's
- * recommended interline spacing.
- */
- @NonNull
- public Builder setLineHeight(@NonNull SpProp.Builder lineHeightBuilder) {
- mImpl.setLineHeight(lineHeightBuilder.build().toProto());
- return this;
- }
-
@Override
@NonNull
public Spannable build() {
@@ -2863,12 +2533,6 @@
}
}
- /** Returns a new {@link Builder}. */
- @NonNull
- public static Builder builder() {
- return new Builder();
- }
-
/** @hide */
@RestrictTo(Scope.LIBRARY_GROUP)
@NonNull
@@ -2896,7 +2560,7 @@
private final LayoutElementProto.Column.Builder mImpl =
LayoutElementProto.Column.newBuilder();
- Builder() {}
+ public Builder() {}
/** Adds one item to the list of child elements to place inside this {@link Column}. */
@NonNull
@@ -2905,13 +2569,6 @@
return this;
}
- /** Adds one item to the list of child elements to place inside this {@link Column}. */
- @NonNull
- public Builder addContent(@NonNull LayoutElement.Builder contentBuilder) {
- mImpl.addContents(contentBuilder.build().toLayoutElementProto());
- return this;
- }
-
/**
* Sets the horizontal alignment of elements inside this column, if they are narrower
* than the resulting width of the column. If not defined, defaults to
@@ -2949,16 +2606,6 @@
}
/**
- * Sets the width of this column. If not defined, this will size itself to fit all of
- * its children (i.e. a WrappedDimension).
- */
- @NonNull
- public Builder setWidth(@NonNull ContainerDimension.Builder widthBuilder) {
- mImpl.setWidth(widthBuilder.build().toContainerDimensionProto());
- return this;
- }
-
- /**
* Sets the height of this column. If not defined, this will size itself to fit all of
* its children (i.e. a WrappedDimension).
*/
@@ -2968,16 +2615,6 @@
return this;
}
- /**
- * Sets the height of this column. If not defined, this will size itself to fit all of
- * its children (i.e. a WrappedDimension).
- */
- @NonNull
- public Builder setHeight(@NonNull ContainerDimension.Builder heightBuilder) {
- mImpl.setHeight(heightBuilder.build().toContainerDimensionProto());
- return this;
- }
-
/** Sets {@link androidx.wear.tiles.ModifiersBuilders.Modifiers} for this element. */
@NonNull
public Builder setModifiers(@NonNull Modifiers modifiers) {
@@ -2985,13 +2622,6 @@
return this;
}
- /** Sets {@link androidx.wear.tiles.ModifiersBuilders.Modifiers} for this element. */
- @NonNull
- public Builder setModifiers(@NonNull Modifiers.Builder modifiersBuilder) {
- mImpl.setModifiers(modifiersBuilder.build().toProto());
- return this;
- }
-
@Override
@NonNull
public Column build() {
@@ -3082,12 +2712,6 @@
}
}
- /** Returns a new {@link Builder}. */
- @NonNull
- public static Builder builder() {
- return new Builder();
- }
-
/** @hide */
@RestrictTo(Scope.LIBRARY_GROUP)
@NonNull
@@ -3115,7 +2739,7 @@
private final LayoutElementProto.Row.Builder mImpl =
LayoutElementProto.Row.newBuilder();
- Builder() {}
+ public Builder() {}
/** Adds one item to the list of child elements to place inside this {@link Row}. */
@NonNull
@@ -3124,13 +2748,6 @@
return this;
}
- /** Adds one item to the list of child elements to place inside this {@link Row}. */
- @NonNull
- public Builder addContent(@NonNull LayoutElement.Builder contentBuilder) {
- mImpl.addContents(contentBuilder.build().toLayoutElementProto());
- return this;
- }
-
/**
* Sets the vertical alignment of elements inside this row, if they are narrower than
* the resulting height of the row. If not defined, defaults to VERTICAL_ALIGN_CENTER.
@@ -3165,16 +2782,6 @@
}
/**
- * Sets the width of this row. If not defined, this will size itself to fit all of its
- * children (i.e. a WrappedDimension).
- */
- @NonNull
- public Builder setWidth(@NonNull ContainerDimension.Builder widthBuilder) {
- mImpl.setWidth(widthBuilder.build().toContainerDimensionProto());
- return this;
- }
-
- /**
* Sets the height of this row. If not defined, this will size itself to fit all of its
* children (i.e. a WrappedDimension).
*/
@@ -3184,16 +2791,6 @@
return this;
}
- /**
- * Sets the height of this row. If not defined, this will size itself to fit all of its
- * children (i.e. a WrappedDimension).
- */
- @NonNull
- public Builder setHeight(@NonNull ContainerDimension.Builder heightBuilder) {
- mImpl.setHeight(heightBuilder.build().toContainerDimensionProto());
- return this;
- }
-
/** Sets {@link androidx.wear.tiles.ModifiersBuilders.Modifiers} for this element. */
@NonNull
public Builder setModifiers(@NonNull Modifiers modifiers) {
@@ -3201,13 +2798,6 @@
return this;
}
- /** Sets {@link androidx.wear.tiles.ModifiersBuilders.Modifiers} for this element. */
- @NonNull
- public Builder setModifiers(@NonNull Modifiers.Builder modifiersBuilder) {
- mImpl.setModifiers(modifiersBuilder.build().toProto());
- return this;
- }
-
@Override
@NonNull
public Row build() {
@@ -3296,12 +2886,6 @@
}
}
- /** Returns a new {@link Builder}. */
- @NonNull
- public static Builder builder() {
- return new Builder();
- }
-
/** @hide */
@RestrictTo(Scope.LIBRARY_GROUP)
@NonNull
@@ -3329,7 +2913,7 @@
private final LayoutElementProto.Arc.Builder mImpl =
LayoutElementProto.Arc.newBuilder();
- Builder() {}
+ public Builder() {}
/** Adds one item to contents of this container. */
@NonNull
@@ -3338,13 +2922,6 @@
return this;
}
- /** Adds one item to contents of this container. */
- @NonNull
- public Builder addContent(@NonNull ArcLayoutElement.Builder contentBuilder) {
- mImpl.addContents(contentBuilder.build().toArcLayoutElementProto());
- return this;
- }
-
/**
* Sets the angle for the anchor, used with anchor_type to determine where to draw
* children. Note that 0 degrees is the 12 o clock position on a device, and the angle
@@ -3361,21 +2938,6 @@
}
/**
- * Sets the angle for the anchor, used with anchor_type to determine where to draw
- * children. Note that 0 degrees is the 12 o clock position on a device, and the angle
- * sweeps clockwise. If not defined, defaults to 0 degrees.
- *
- * <p>Values do not have to be clamped to the range 0-360; values less than 0 degrees
- * will sweep anti-clockwise (i.e. -90 degrees is equivalent to 270 degrees), and values
- * >360 will be be placed at X mod 360 degrees.
- */
- @NonNull
- public Builder setAnchorAngle(@NonNull DegreesProp.Builder anchorAngleBuilder) {
- mImpl.setAnchorAngle(anchorAngleBuilder.build().toProto());
- return this;
- }
-
- /**
* Sets how to align the contents of this container relative to anchor_angle. If not
* defined, defaults to ARC_ANCHOR_CENTER.
*/
@@ -3430,13 +2992,6 @@
return this;
}
- /** Sets {@link androidx.wear.tiles.ModifiersBuilders.Modifiers} for this element. */
- @NonNull
- public Builder setModifiers(@NonNull Modifiers.Builder modifiersBuilder) {
- mImpl.setModifiers(modifiersBuilder.build().toProto());
- return this;
- }
-
@Override
@NonNull
public Arc build() {
@@ -3489,12 +3044,6 @@
}
}
- /** Returns a new {@link Builder}. */
- @NonNull
- public static Builder builder() {
- return new Builder();
- }
-
/** @hide */
@RestrictTo(Scope.LIBRARY_GROUP)
@NonNull
@@ -3522,7 +3071,7 @@
private final LayoutElementProto.ArcText.Builder mImpl =
LayoutElementProto.ArcText.newBuilder();
- Builder() {}
+ public Builder() {}
/** Sets the text to render. */
@NonNull
@@ -3547,16 +3096,6 @@
return this;
}
- /**
- * Sets the style of font to use (size, bold etc). If not specified, defaults to the
- * platform's default body font.
- */
- @NonNull
- public Builder setFontStyle(@NonNull FontStyle.Builder fontStyleBuilder) {
- mImpl.setFontStyle(fontStyleBuilder.build().toProto());
- return this;
- }
-
/** Sets {@link androidx.wear.tiles.ModifiersBuilders.Modifiers} for this element. */
@NonNull
public Builder setModifiers(@NonNull ArcModifiers modifiers) {
@@ -3564,13 +3103,6 @@
return this;
}
- /** Sets {@link androidx.wear.tiles.ModifiersBuilders.Modifiers} for this element. */
- @NonNull
- public Builder setModifiers(@NonNull ArcModifiers.Builder modifiersBuilder) {
- mImpl.setModifiers(modifiersBuilder.build().toProto());
- return this;
- }
-
@Override
@NonNull
public ArcText build() {
@@ -3636,12 +3168,6 @@
}
}
- /** Returns a new {@link Builder}. */
- @NonNull
- public static Builder builder() {
- return new Builder();
- }
-
/** @hide */
@RestrictTo(Scope.LIBRARY_GROUP)
@NonNull
@@ -3669,7 +3195,7 @@
private final LayoutElementProto.ArcLine.Builder mImpl =
LayoutElementProto.ArcLine.newBuilder();
- Builder() {}
+ public Builder() {}
/** Sets the length of this line, in degrees. If not defined, defaults to 0. */
@NonNull
@@ -3678,13 +3204,6 @@
return this;
}
- /** Sets the length of this line, in degrees. If not defined, defaults to 0. */
- @NonNull
- public Builder setLength(@NonNull DegreesProp.Builder lengthBuilder) {
- mImpl.setLength(lengthBuilder.build().toProto());
- return this;
- }
-
/** Sets the thickness of this line. If not defined, defaults to 0. */
@NonNull
public Builder setThickness(@NonNull DpProp thickness) {
@@ -3692,13 +3211,6 @@
return this;
}
- /** Sets the thickness of this line. If not defined, defaults to 0. */
- @NonNull
- public Builder setThickness(@NonNull DpProp.Builder thicknessBuilder) {
- mImpl.setThickness(thicknessBuilder.build().toProto());
- return this;
- }
-
/** Sets the color of this line. */
@NonNull
public Builder setColor(@NonNull ColorProp color) {
@@ -3706,13 +3218,6 @@
return this;
}
- /** Sets the color of this line. */
- @NonNull
- public Builder setColor(@NonNull ColorProp.Builder colorBuilder) {
- mImpl.setColor(colorBuilder.build().toProto());
- return this;
- }
-
/** Sets {@link androidx.wear.tiles.ModifiersBuilders.Modifiers} for this element. */
@NonNull
public Builder setModifiers(@NonNull ArcModifiers modifiers) {
@@ -3720,13 +3225,6 @@
return this;
}
- /** Sets {@link androidx.wear.tiles.ModifiersBuilders.Modifiers} for this element. */
- @NonNull
- public Builder setModifiers(@NonNull ArcModifiers.Builder modifiersBuilder) {
- mImpl.setModifiers(modifiersBuilder.build().toProto());
- return this;
- }
-
@Override
@NonNull
public ArcLine build() {
@@ -3782,12 +3280,6 @@
}
}
- /** Returns a new {@link Builder}. */
- @NonNull
- public static Builder builder() {
- return new Builder();
- }
-
/** @hide */
@RestrictTo(Scope.LIBRARY_GROUP)
@NonNull
@@ -3815,7 +3307,7 @@
private final LayoutElementProto.ArcSpacer.Builder mImpl =
LayoutElementProto.ArcSpacer.newBuilder();
- Builder() {}
+ public Builder() {}
/** Sets the length of this spacer, in degrees. If not defined, defaults to 0. */
@NonNull
@@ -3824,13 +3316,6 @@
return this;
}
- /** Sets the length of this spacer, in degrees. If not defined, defaults to 0. */
- @NonNull
- public Builder setLength(@NonNull DegreesProp.Builder lengthBuilder) {
- mImpl.setLength(lengthBuilder.build().toProto());
- return this;
- }
-
/** Sets the thickness of this spacer, in DP. If not defined, defaults to 0. */
@NonNull
public Builder setThickness(@NonNull DpProp thickness) {
@@ -3838,13 +3323,6 @@
return this;
}
- /** Sets the thickness of this spacer, in DP. If not defined, defaults to 0. */
- @NonNull
- public Builder setThickness(@NonNull DpProp.Builder thicknessBuilder) {
- mImpl.setThickness(thicknessBuilder.build().toProto());
- return this;
- }
-
/** Sets {@link androidx.wear.tiles.ModifiersBuilders.Modifiers} for this element. */
@NonNull
public Builder setModifiers(@NonNull ArcModifiers modifiers) {
@@ -3852,13 +3330,6 @@
return this;
}
- /** Sets {@link androidx.wear.tiles.ModifiersBuilders.Modifiers} for this element. */
- @NonNull
- public Builder setModifiers(@NonNull ArcModifiers.Builder modifiersBuilder) {
- mImpl.setModifiers(modifiersBuilder.build().toProto());
- return this;
- }
-
@Override
@NonNull
public ArcSpacer build() {
@@ -3903,12 +3374,6 @@
}
}
- /** Returns a new {@link Builder}. */
- @NonNull
- public static Builder builder() {
- return new Builder();
- }
-
/** @hide */
@RestrictTo(Scope.LIBRARY_GROUP)
@NonNull
@@ -3936,7 +3401,7 @@
private final LayoutElementProto.ArcAdapter.Builder mImpl =
LayoutElementProto.ArcAdapter.newBuilder();
- Builder() {}
+ public Builder() {}
/** Sets the element to adapt to an {@link Arc}. */
@NonNull
@@ -3945,13 +3410,6 @@
return this;
}
- /** Sets the element to adapt to an {@link Arc}. */
- @NonNull
- public Builder setContent(@NonNull LayoutElement.Builder contentBuilder) {
- mImpl.setContent(contentBuilder.build().toLayoutElementProto());
- return this;
- }
-
/**
* Sets whether this adapter's contents should be rotated, according to its position in
* the arc or not. As an example, assume that an {@link Image} has been added to the
@@ -4117,12 +3575,6 @@
}
}
- /** Returns a new {@link Builder}. */
- @NonNull
- public static Builder builder() {
- return new Builder();
- }
-
/** @hide */
@RestrictTo(Scope.LIBRARY_GROUP)
@NonNull
@@ -4142,7 +3594,7 @@
private final LayoutElementProto.Layout.Builder mImpl =
LayoutElementProto.Layout.newBuilder();
- Builder() {}
+ public Builder() {}
/** Sets the root element in the layout. */
@NonNull
@@ -4151,13 +3603,6 @@
return this;
}
- /** Sets the root element in the layout. */
- @NonNull
- public Builder setRoot(@NonNull LayoutElement.Builder rootBuilder) {
- mImpl.setRoot(rootBuilder.build().toLayoutElementProto());
- return this;
- }
-
/** Builds an instance from accumulated values. */
@NonNull
public Layout build() {
@@ -4170,153 +3615,17 @@
public static class FontStyles {
private static final int LARGE_SCREEN_WIDTH_DP = 210;
- private final DeviceParameters mDeviceParameters;
-
- private FontStyles(DeviceParameters deviceParameters) {
- this.mDeviceParameters = deviceParameters;
+ private FontStyles() {
}
private static boolean isLargeScreen(@NonNull DeviceParameters deviceParameters) {
return deviceParameters.getScreenWidthDp() >= LARGE_SCREEN_WIDTH_DP;
}
- /**
- * Create a FontStyles instance, using the given device parameters to determine font sizes.
- *
- * @deprecated Use static functions, accepting a {@link DeviceParameters} instance instead
- * (e.g. {@link FontStyles#display1(DeviceParameters)}).
- */
- @Deprecated
- @NonNull
- public static FontStyles withDeviceParameters(@NonNull DeviceParameters deviceParameters) {
- return new FontStyles(deviceParameters);
- }
-
- /**
- * Font style for large display text.
- *
- * @deprecated Use {@link FontStyles#display1(DeviceParameters)} instead.
- */
- @Deprecated
- @NonNull
- public FontStyle.Builder display1() {
- return display1(mDeviceParameters);
- }
-
- /**
- * Font style for medium display text.
- *
- * @deprecated Use {@link FontStyles#display2(DeviceParameters)} instead.
- */
- @Deprecated
- @NonNull
- public FontStyle.Builder display2() {
- return display2(mDeviceParameters);
- }
-
- /**
- * Font style for small display text.
- *
- * @deprecated Use {@link FontStyles#display3(DeviceParameters)} instead.
- */
- @Deprecated
- @NonNull
- public FontStyle.Builder display3() {
- return display3(mDeviceParameters);
- }
-
- /**
- * Font style for large title text.
- *
- * @deprecated Use {@link FontStyles#title1(DeviceParameters)} instead.
- */
- @Deprecated
- @NonNull
- public FontStyle.Builder title1() {
- return title1(mDeviceParameters);
- }
-
- /**
- * Font style for medium title text.
- *
- * @deprecated Use {@link FontStyles#title2(DeviceParameters)} instead.
- */
- @Deprecated
- @NonNull
- public FontStyle.Builder title2() {
- return title2(mDeviceParameters);
- }
-
- /**
- * Font style for small title text.
- *
- * @deprecated Use {@link FontStyles#title3(DeviceParameters)} instead.
- */
- @Deprecated
- @NonNull
- public FontStyle.Builder title3() {
- return title3(mDeviceParameters);
- }
-
- /**
- * Font style for large body text.
- *
- * @deprecated Use {@link FontStyles#body1(DeviceParameters)} instead.
- */
- @Deprecated
- @NonNull
- public FontStyle.Builder body1() {
- return body1(mDeviceParameters);
- }
-
- /**
- * Font style for medium body text.
- *
- * @deprecated Use {@link FontStyles#body2(DeviceParameters)} instead.
- */
- @Deprecated
- @NonNull
- public FontStyle.Builder body2() {
- return body2(mDeviceParameters);
- }
-
- /**
- * Font style for button text.
- *
- * @deprecated Use {@link FontStyles#button(DeviceParameters)} instead.
- */
- @Deprecated
- @NonNull
- public FontStyle.Builder button() {
- return button(mDeviceParameters);
- }
-
- /**
- * Font style for large caption text.
- *
- * @deprecated Use {@link FontStyles#caption1(DeviceParameters)} instead.
- */
- @Deprecated
- @NonNull
- public FontStyle.Builder caption1() {
- return caption1(mDeviceParameters);
- }
-
- /**
- * Font style for medium caption text.
- *
- * @deprecated Use {@link FontStyles#caption2(DeviceParameters)} instead.
- */
- @Deprecated
- @NonNull
- public FontStyle.Builder caption2() {
- return caption2(mDeviceParameters);
- }
-
/** Font style for large display text. */
@NonNull
public static FontStyle.Builder display1(@NonNull DeviceParameters deviceParameters) {
- return FontStyle.builder()
+ return new FontStyle.Builder()
.setWeight(FONT_WEIGHT_BOLD)
.setSize(DimensionBuilders.sp(isLargeScreen(deviceParameters) ? 54 : 50));
}
@@ -4324,7 +3633,7 @@
/** Font style for medium display text. */
@NonNull
public static FontStyle.Builder display2(@NonNull DeviceParameters deviceParameters) {
- return FontStyle.builder()
+ return new FontStyle.Builder()
.setWeight(FONT_WEIGHT_BOLD)
.setSize(DimensionBuilders.sp(isLargeScreen(deviceParameters) ? 44 : 40));
}
@@ -4332,7 +3641,7 @@
/** Font style for small display text. */
@NonNull
public static FontStyle.Builder display3(@NonNull DeviceParameters deviceParameters) {
- return FontStyle.builder()
+ return new FontStyle.Builder()
.setWeight(FONT_WEIGHT_BOLD)
.setSize(DimensionBuilders.sp(isLargeScreen(deviceParameters) ? 34 : 30));
}
@@ -4340,7 +3649,7 @@
/** Font style for large title text. */
@NonNull
public static FontStyle.Builder title1(@NonNull DeviceParameters deviceParameters) {
- return FontStyle.builder()
+ return new FontStyle.Builder()
.setWeight(FONT_WEIGHT_BOLD)
.setSize(DimensionBuilders.sp(isLargeScreen(deviceParameters) ? 26 : 24));
}
@@ -4348,7 +3657,7 @@
/** Font style for medium title text. */
@NonNull
public static FontStyle.Builder title2(@NonNull DeviceParameters deviceParameters) {
- return FontStyle.builder()
+ return new FontStyle.Builder()
.setWeight(FONT_WEIGHT_BOLD)
.setSize(DimensionBuilders.sp(isLargeScreen(deviceParameters) ? 22 : 20));
}
@@ -4356,7 +3665,7 @@
/** Font style for small title text. */
@NonNull
public static FontStyle.Builder title3(@NonNull DeviceParameters deviceParameters) {
- return FontStyle.builder()
+ return new FontStyle.Builder()
.setWeight(FONT_WEIGHT_BOLD)
.setSize(DimensionBuilders.sp(isLargeScreen(deviceParameters) ? 18 : 16));
}
@@ -4364,21 +3673,21 @@
/** Font style for large body text. */
@NonNull
public static FontStyle.Builder body1(@NonNull DeviceParameters deviceParameters) {
- return FontStyle.builder()
+ return new FontStyle.Builder()
.setSize(DimensionBuilders.sp(isLargeScreen(deviceParameters) ? 18 : 16));
}
/** Font style for medium body text. */
@NonNull
public static FontStyle.Builder body2(@NonNull DeviceParameters deviceParameters) {
- return FontStyle.builder()
+ return new FontStyle.Builder()
.setSize(DimensionBuilders.sp(isLargeScreen(deviceParameters) ? 16 : 14));
}
/** Font style for button text. */
@NonNull
public static FontStyle.Builder button(@NonNull DeviceParameters deviceParameters) {
- return FontStyle.builder()
+ return new FontStyle.Builder()
.setWeight(FONT_WEIGHT_BOLD)
.setSize(DimensionBuilders.sp(isLargeScreen(deviceParameters) ? 16 : 14));
}
@@ -4386,14 +3695,14 @@
/** Font style for large caption text. */
@NonNull
public static FontStyle.Builder caption1(@NonNull DeviceParameters deviceParameters) {
- return FontStyle.builder()
+ return new FontStyle.Builder()
.setSize(DimensionBuilders.sp(isLargeScreen(deviceParameters) ? 16 : 14));
}
/** Font style for medium caption text. */
@NonNull
public static FontStyle.Builder caption2(@NonNull DeviceParameters deviceParameters) {
- return FontStyle.builder()
+ return new FontStyle.Builder()
.setSize(DimensionBuilders.sp(isLargeScreen(deviceParameters) ? 14 : 12));
}
}
diff --git a/wear/tiles/tiles/src/main/java/androidx/wear/tiles/ModifiersBuilders.java b/wear/tiles/tiles/src/main/java/androidx/wear/tiles/ModifiersBuilders.java
index ba77d87..6d18b86 100644
--- a/wear/tiles/tiles/src/main/java/androidx/wear/tiles/ModifiersBuilders.java
+++ b/wear/tiles/tiles/src/main/java/androidx/wear/tiles/ModifiersBuilders.java
@@ -63,12 +63,6 @@
}
}
- /** Returns a new {@link Builder}. */
- @NonNull
- public static Builder builder() {
- return new Builder();
- }
-
/** @hide */
@RestrictTo(Scope.LIBRARY_GROUP)
@NonNull
@@ -88,7 +82,7 @@
private final ModifiersProto.Clickable.Builder mImpl =
ModifiersProto.Clickable.newBuilder();
- Builder() {}
+ public Builder() {}
/** Sets the ID associated with this action. */
@NonNull
@@ -106,15 +100,6 @@
return this;
}
- /**
- * Sets the action to perform when the element this modifier is attached to is clicked.
- */
- @NonNull
- public Builder setOnClick(@NonNull Action.Builder onClickBuilder) {
- mImpl.setOnClick(onClickBuilder.build().toActionProto());
- return this;
- }
-
/** Builds an instance from accumulated values. */
@NonNull
public Clickable build() {
@@ -144,12 +129,6 @@
return mImpl.getContentDescription();
}
- /** Returns a new {@link Builder}. */
- @NonNull
- public static Builder builder() {
- return new Builder();
- }
-
/** @hide */
@RestrictTo(Scope.LIBRARY_GROUP)
@NonNull
@@ -169,7 +148,7 @@
private final ModifiersProto.Semantics.Builder mImpl =
ModifiersProto.Semantics.newBuilder();
- Builder() {}
+ public Builder() {}
/**
* Sets the content description associated with this element. This will be dictated when
@@ -258,12 +237,6 @@
}
}
- /** Returns a new {@link Builder}. */
- @NonNull
- public static Builder builder() {
- return new Builder();
- }
-
/** @hide */
@RestrictTo(Scope.LIBRARY_GROUP)
@NonNull
@@ -283,7 +256,7 @@
private final ModifiersProto.Padding.Builder mImpl =
ModifiersProto.Padding.newBuilder();
- Builder() {}
+ public Builder() {}
/**
* Sets the padding on the end of the content, depending on the layout direction, in DP
@@ -296,16 +269,6 @@
}
/**
- * Sets the padding on the end of the content, depending on the layout direction, in DP
- * and the value of "rtl_aware".
- */
- @NonNull
- public Builder setEnd(@NonNull DpProp.Builder endBuilder) {
- mImpl.setEnd(endBuilder.build().toProto());
- return this;
- }
-
- /**
* Sets the padding on the start of the content, depending on the layout direction, in
* DP and the value of "rtl_aware".
*/
@@ -315,16 +278,6 @@
return this;
}
- /**
- * Sets the padding on the start of the content, depending on the layout direction, in
- * DP and the value of "rtl_aware".
- */
- @NonNull
- public Builder setStart(@NonNull DpProp.Builder startBuilder) {
- mImpl.setStart(startBuilder.build().toProto());
- return this;
- }
-
/** Sets the padding at the top, in DP. */
@NonNull
public Builder setTop(@NonNull DpProp top) {
@@ -332,13 +285,6 @@
return this;
}
- /** Sets the padding at the top, in DP. */
- @NonNull
- public Builder setTop(@NonNull DpProp.Builder topBuilder) {
- mImpl.setTop(topBuilder.build().toProto());
- return this;
- }
-
/** Sets the padding at the bottom, in DP. */
@NonNull
public Builder setBottom(@NonNull DpProp bottom) {
@@ -346,13 +292,6 @@
return this;
}
- /** Sets the padding at the bottom, in DP. */
- @NonNull
- public Builder setBottom(@NonNull DpProp.Builder bottomBuilder) {
- mImpl.setBottom(bottomBuilder.build().toProto());
- return this;
- }
-
/**
* Sets whether the start/end padding is aware of RTL support. If true, the values for
* start/end will follow the layout direction (i.e. start will refer to the right hand
@@ -384,16 +323,6 @@
return setStart(value).setEnd(value).setTop(value).setBottom(value);
}
- /** Sets the padding for all sides of the content, in DP. */
- @NonNull
- @SuppressLint("MissingGetterMatchingBuilder")
- public Builder setAll(@NonNull DpProp.Builder valueBuilder) {
- return setStart(valueBuilder)
- .setEnd(valueBuilder)
- .setTop(valueBuilder)
- .setBottom(valueBuilder);
- }
-
/** Builds an instance from accumulated values. */
@NonNull
public Padding build() {
@@ -430,12 +359,6 @@
}
}
- /** Returns a new {@link Builder}. */
- @NonNull
- public static Builder builder() {
- return new Builder();
- }
-
/** @hide */
@RestrictTo(Scope.LIBRARY_GROUP)
@NonNull
@@ -454,7 +377,7 @@
public static final class Builder {
private final ModifiersProto.Border.Builder mImpl = ModifiersProto.Border.newBuilder();
- Builder() {}
+ public Builder() {}
/** Sets the width of the border, in DP. */
@NonNull
@@ -463,13 +386,6 @@
return this;
}
- /** Sets the width of the border, in DP. */
- @NonNull
- public Builder setWidth(@NonNull DpProp.Builder widthBuilder) {
- mImpl.setWidth(widthBuilder.build().toProto());
- return this;
- }
-
/** Sets the color of the border. */
@NonNull
public Builder setColor(@NonNull ColorProp color) {
@@ -477,13 +393,6 @@
return this;
}
- /** Sets the color of the border. */
- @NonNull
- public Builder setColor(@NonNull ColorProp.Builder colorBuilder) {
- mImpl.setColor(colorBuilder.build().toProto());
- return this;
- }
-
/** Builds an instance from accumulated values. */
@NonNull
public Border build() {
@@ -510,12 +419,6 @@
}
}
- /** Returns a new {@link Builder}. */
- @NonNull
- public static Builder builder() {
- return new Builder();
- }
-
/** @hide */
@RestrictTo(Scope.LIBRARY_GROUP)
@NonNull
@@ -534,7 +437,7 @@
public static final class Builder {
private final ModifiersProto.Corner.Builder mImpl = ModifiersProto.Corner.newBuilder();
- Builder() {}
+ public Builder() {}
/** Sets the radius of the corner in DP. */
@NonNull
@@ -543,13 +446,6 @@
return this;
}
- /** Sets the radius of the corner in DP. */
- @NonNull
- public Builder setRadius(@NonNull DpProp.Builder radiusBuilder) {
- mImpl.setRadius(radiusBuilder.build().toProto());
- return this;
- }
-
/** Builds an instance from accumulated values. */
@NonNull
public Corner build() {
@@ -593,12 +489,6 @@
}
}
- /** Returns a new {@link Builder}. */
- @NonNull
- public static Builder builder() {
- return new Builder();
- }
-
/** @hide */
@RestrictTo(Scope.LIBRARY_GROUP)
@NonNull
@@ -618,7 +508,7 @@
private final ModifiersProto.Background.Builder mImpl =
ModifiersProto.Background.newBuilder();
- Builder() {}
+ public Builder() {}
/**
* Sets the background color for this element. If not defined, defaults to being
@@ -631,16 +521,6 @@
}
/**
- * Sets the background color for this element. If not defined, defaults to being
- * transparent.
- */
- @NonNull
- public Builder setColor(@NonNull ColorProp.Builder colorBuilder) {
- mImpl.setColor(colorBuilder.build().toProto());
- return this;
- }
-
- /**
* Sets the corner properties of this element. This only affects the drawing of this
* element if it has a background color or border. If not defined, defaults to having a
* square corner.
@@ -651,17 +531,6 @@
return this;
}
- /**
- * Sets the corner properties of this element. This only affects the drawing of this
- * element if it has a background color or border. If not defined, defaults to having a
- * square corner.
- */
- @NonNull
- public Builder setCorner(@NonNull Corner.Builder cornerBuilder) {
- mImpl.setCorner(cornerBuilder.build().toProto());
- return this;
- }
-
/** Builds an instance from accumulated values. */
@NonNull
public Background build() {
@@ -741,12 +610,6 @@
}
}
- /** Returns a new {@link Builder}. */
- @NonNull
- public static Builder builder() {
- return new Builder();
- }
-
/** @hide */
@RestrictTo(Scope.LIBRARY_GROUP)
@NonNull
@@ -766,7 +629,7 @@
private final ModifiersProto.Modifiers.Builder mImpl =
ModifiersProto.Modifiers.newBuilder();
- Builder() {}
+ public Builder() {}
/**
* Sets allows its wrapped element to have actions associated with it, which will be
@@ -779,16 +642,6 @@
}
/**
- * Sets allows its wrapped element to have actions associated with it, which will be
- * executed when the element is tapped.
- */
- @NonNull
- public Builder setClickable(@NonNull Clickable.Builder clickableBuilder) {
- mImpl.setClickable(clickableBuilder.build().toProto());
- return this;
- }
-
- /**
* Sets adds metadata for the modified element, for example, screen reader content
* descriptions.
*/
@@ -798,16 +651,6 @@
return this;
}
- /**
- * Sets adds metadata for the modified element, for example, screen reader content
- * descriptions.
- */
- @NonNull
- public Builder setSemantics(@NonNull Semantics.Builder semanticsBuilder) {
- mImpl.setSemantics(semanticsBuilder.build().toProto());
- return this;
- }
-
/** Sets adds padding to the modified element. */
@NonNull
public Builder setPadding(@NonNull Padding padding) {
@@ -815,13 +658,6 @@
return this;
}
- /** Sets adds padding to the modified element. */
- @NonNull
- public Builder setPadding(@NonNull Padding.Builder paddingBuilder) {
- mImpl.setPadding(paddingBuilder.build().toProto());
- return this;
- }
-
/** Sets draws a border around the modified element. */
@NonNull
public Builder setBorder(@NonNull Border border) {
@@ -829,13 +665,6 @@
return this;
}
- /** Sets draws a border around the modified element. */
- @NonNull
- public Builder setBorder(@NonNull Border.Builder borderBuilder) {
- mImpl.setBorder(borderBuilder.build().toProto());
- return this;
- }
-
/** Sets adds a background (with optional corner radius) to the modified element. */
@NonNull
public Builder setBackground(@NonNull Background background) {
@@ -843,13 +672,6 @@
return this;
}
- /** Sets adds a background (with optional corner radius) to the modified element. */
- @NonNull
- public Builder setBackground(@NonNull Background.Builder backgroundBuilder) {
- mImpl.setBackground(backgroundBuilder.build().toProto());
- return this;
- }
-
/** Builds an instance from accumulated values. */
@NonNull
public Modifiers build() {
@@ -895,12 +717,6 @@
}
}
- /** Returns a new {@link Builder}. */
- @NonNull
- public static Builder builder() {
- return new Builder();
- }
-
/** @hide */
@RestrictTo(Scope.LIBRARY_GROUP)
@NonNull
@@ -920,7 +736,7 @@
private final ModifiersProto.ArcModifiers.Builder mImpl =
ModifiersProto.ArcModifiers.newBuilder();
- Builder() {}
+ public Builder() {}
/**
* Sets allows its wrapped element to have actions associated with it, which will be
@@ -933,16 +749,6 @@
}
/**
- * Sets allows its wrapped element to have actions associated with it, which will be
- * executed when the element is tapped.
- */
- @NonNull
- public Builder setClickable(@NonNull Clickable.Builder clickableBuilder) {
- mImpl.setClickable(clickableBuilder.build().toProto());
- return this;
- }
-
- /**
* Sets adds metadata for the modified element, for example, screen reader content
* descriptions.
*/
@@ -952,16 +758,6 @@
return this;
}
- /**
- * Sets adds metadata for the modified element, for example, screen reader content
- * descriptions.
- */
- @NonNull
- public Builder setSemantics(@NonNull Semantics.Builder semanticsBuilder) {
- mImpl.setSemantics(semanticsBuilder.build().toProto());
- return this;
- }
-
/** Builds an instance from accumulated values. */
@NonNull
public ArcModifiers build() {
@@ -995,12 +791,6 @@
}
}
- /** Returns a new {@link Builder}. */
- @NonNull
- public static Builder builder() {
- return new Builder();
- }
-
/** @hide */
@RestrictTo(Scope.LIBRARY_GROUP)
@NonNull
@@ -1020,7 +810,7 @@
private final ModifiersProto.SpanModifiers.Builder mImpl =
ModifiersProto.SpanModifiers.newBuilder();
- Builder() {}
+ public Builder() {}
/**
* Sets allows its wrapped element to have actions associated with it, which will be
@@ -1032,16 +822,6 @@
return this;
}
- /**
- * Sets allows its wrapped element to have actions associated with it, which will be
- * executed when the element is tapped.
- */
- @NonNull
- public Builder setClickable(@NonNull Clickable.Builder clickableBuilder) {
- mImpl.setClickable(clickableBuilder.build().toProto());
- return this;
- }
-
/** Builds an instance from accumulated values. */
@NonNull
public SpanModifiers build() {
diff --git a/wear/tiles/tiles/src/main/java/androidx/wear/tiles/RequestBuilders.java b/wear/tiles/tiles/src/main/java/androidx/wear/tiles/RequestBuilders.java
index c722af6..0fb7806 100644
--- a/wear/tiles/tiles/src/main/java/androidx/wear/tiles/RequestBuilders.java
+++ b/wear/tiles/tiles/src/main/java/androidx/wear/tiles/RequestBuilders.java
@@ -61,12 +61,6 @@
}
}
- /** Returns a new {@link Builder}. */
- @NonNull
- public static Builder builder() {
- return new Builder();
- }
-
/** @hide */
@RestrictTo(Scope.LIBRARY_GROUP)
@NonNull
@@ -86,7 +80,7 @@
private final RequestProto.TileRequest.Builder mImpl =
RequestProto.TileRequest.newBuilder();
- Builder() {}
+ public Builder() {}
/** Sets parameters describing the device requesting the tile update. */
@NonNull
@@ -95,14 +89,6 @@
return this;
}
- /** Sets parameters describing the device requesting the tile update. */
- @NonNull
- public Builder setDeviceParameters(
- @NonNull DeviceParameters.Builder deviceParametersBuilder) {
- mImpl.setDeviceParameters(deviceParametersBuilder.build().toProto());
- return this;
- }
-
/** Sets the state that should be used when building the tile. */
@NonNull
public Builder setState(@NonNull State state) {
@@ -110,13 +96,6 @@
return this;
}
- /** Sets the state that should be used when building the tile. */
- @NonNull
- public Builder setState(@NonNull State.Builder stateBuilder) {
- mImpl.setState(stateBuilder.build().toProto());
- return this;
- }
-
/** Builds an instance from accumulated values. */
@NonNull
public TileRequest build() {
@@ -172,12 +151,6 @@
}
}
- /** Returns a new {@link Builder}. */
- @NonNull
- public static Builder builder() {
- return new Builder();
- }
-
/** @hide */
@RestrictTo(Scope.LIBRARY_GROUP)
@NonNull
@@ -197,7 +170,7 @@
private final RequestProto.ResourcesRequest.Builder mImpl =
RequestProto.ResourcesRequest.newBuilder();
- Builder() {}
+ public Builder() {}
/**
* Sets the version of the resources being fetched. This is the same as the requested
@@ -232,14 +205,6 @@
return this;
}
- /** Sets parameters describing the device requesting the resources. */
- @NonNull
- public Builder setDeviceParameters(
- @NonNull DeviceParameters.Builder deviceParametersBuilder) {
- mImpl.setDeviceParameters(deviceParametersBuilder.build().toProto());
- return this;
- }
-
/** Builds an instance from accumulated values. */
@NonNull
public ResourcesRequest build() {
diff --git a/wear/tiles/tiles/src/main/java/androidx/wear/tiles/ResourceBuilders.java b/wear/tiles/tiles/src/main/java/androidx/wear/tiles/ResourceBuilders.java
index c8b8750..1a042a8 100644
--- a/wear/tiles/tiles/src/main/java/androidx/wear/tiles/ResourceBuilders.java
+++ b/wear/tiles/tiles/src/main/java/androidx/wear/tiles/ResourceBuilders.java
@@ -77,12 +77,6 @@
return mImpl.getResourceId();
}
- /** Returns a new {@link Builder}. */
- @NonNull
- public static Builder builder() {
- return new Builder();
- }
-
/** @hide */
@RestrictTo(Scope.LIBRARY_GROUP)
@NonNull
@@ -103,7 +97,7 @@
private final ResourceProto.AndroidImageResourceByResId.Builder mImpl =
ResourceProto.AndroidImageResourceByResId.newBuilder();
- Builder() {}
+ public Builder() {}
/**
* Sets the Android resource ID of this image. This must refer to a drawable under
@@ -171,12 +165,6 @@
return mImpl.getFormat().getNumber();
}
- /** Returns a new {@link Builder}. */
- @NonNull
- public static Builder builder() {
- return new Builder();
- }
-
/** @hide */
@RestrictTo(Scope.LIBRARY_GROUP)
@NonNull
@@ -197,7 +185,7 @@
private final ResourceProto.InlineImageResource.Builder mImpl =
ResourceProto.InlineImageResource.newBuilder();
- Builder() {}
+ public Builder() {}
/** Sets the byte array representing the image. */
@NonNull
@@ -283,12 +271,6 @@
}
}
- /** Returns a new {@link Builder}. */
- @NonNull
- public static Builder builder() {
- return new Builder();
- }
-
/** @hide */
@RestrictTo(Scope.LIBRARY_GROUP)
@NonNull
@@ -308,7 +290,7 @@
private final ResourceProto.ImageResource.Builder mImpl =
ResourceProto.ImageResource.newBuilder();
- Builder() {}
+ public Builder() {}
/** Sets an image resource that maps to an Android drawable by resource ID. */
@NonNull
@@ -318,14 +300,6 @@
return this;
}
- /** Sets an image resource that maps to an Android drawable by resource ID. */
- @NonNull
- public Builder setAndroidResourceByResId(
- @NonNull AndroidImageResourceByResId.Builder androidResourceByResIdBuilder) {
- mImpl.setAndroidResourceByResId(androidResourceByResIdBuilder.build().toProto());
- return this;
- }
-
/** Sets an image resource that contains the image data inline. */
@NonNull
public Builder setInlineResource(@NonNull InlineImageResource inlineResource) {
@@ -333,14 +307,6 @@
return this;
}
- /** Sets an image resource that contains the image data inline. */
- @NonNull
- public Builder setInlineResource(
- @NonNull InlineImageResource.Builder inlineResourceBuilder) {
- mImpl.setInlineResource(inlineResourceBuilder.build().toProto());
- return this;
- }
-
/** Builds an instance from accumulated values. */
@NonNull
public ImageResource build() {
@@ -388,12 +354,6 @@
f -> ImageResource.fromProto(f.getValue()))));
}
- /** Returns a new {@link Builder}. */
- @NonNull
- public static Builder builder() {
- return new Builder();
- }
-
/** @hide */
@RestrictTo(Scope.LIBRARY_GROUP)
@NonNull
@@ -413,7 +373,7 @@
private final ResourceProto.Resources.Builder mImpl =
ResourceProto.Resources.newBuilder();
- Builder() {}
+ public Builder() {}
/**
* Sets the version of this {@link Resources} instance.
@@ -440,15 +400,6 @@
return this;
}
- /** Adds an entry into a map of resource_ids to images, which can be used by layouts. */
- @SuppressLint("MissingGetterMatchingBuilder")
- @NonNull
- public Builder addIdToImageMapping(
- @NonNull String id, @NonNull ImageResource.Builder imageBuilder) {
- mImpl.putIdToImage(id, imageBuilder.build().toProto());
- return this;
- }
-
/** Builds an instance from accumulated values. */
@NonNull
public Resources build() {
diff --git a/wear/tiles/tiles/src/main/java/androidx/wear/tiles/StateBuilders.java b/wear/tiles/tiles/src/main/java/androidx/wear/tiles/StateBuilders.java
index 55a07ee..37a8cbc 100644
--- a/wear/tiles/tiles/src/main/java/androidx/wear/tiles/StateBuilders.java
+++ b/wear/tiles/tiles/src/main/java/androidx/wear/tiles/StateBuilders.java
@@ -39,12 +39,6 @@
return mImpl.getLastClickableId();
}
- /** Returns a new {@link Builder}. */
- @NonNull
- public static Builder builder() {
- return new Builder();
- }
-
/** @hide */
@RestrictTo(Scope.LIBRARY_GROUP)
@NonNull
@@ -63,7 +57,7 @@
public static final class Builder {
private final StateProto.State.Builder mImpl = StateProto.State.newBuilder();
- Builder() {}
+ public Builder() {}
/** Builds an instance from accumulated values. */
@NonNull
diff --git a/wear/tiles/tiles/src/main/java/androidx/wear/tiles/SysUiTileUpdateRequester.java b/wear/tiles/tiles/src/main/java/androidx/wear/tiles/SysUiTileUpdateRequester.java
index 628fc33..c1d54c8 100644
--- a/wear/tiles/tiles/src/main/java/androidx/wear/tiles/SysUiTileUpdateRequester.java
+++ b/wear/tiles/tiles/src/main/java/androidx/wear/tiles/SysUiTileUpdateRequester.java
@@ -143,7 +143,8 @@
// we'll unbind, then immediately rebind. That said, this class should be
// used pretty rarely
// (and it'll be rare to have two in-flight update requests at once
- // regardless), so it's probably fine.
+ // regardless), so
+ // it's probably fine.
TileUpdateRequesterService updateRequesterService =
TileUpdateRequesterService.Stub.asInterface(service);
diff --git a/wear/tiles/tiles/src/main/java/androidx/wear/tiles/TileBuilders.java b/wear/tiles/tiles/src/main/java/androidx/wear/tiles/TileBuilders.java
index aef9ccf..7200f76 100644
--- a/wear/tiles/tiles/src/main/java/androidx/wear/tiles/TileBuilders.java
+++ b/wear/tiles/tiles/src/main/java/androidx/wear/tiles/TileBuilders.java
@@ -80,12 +80,6 @@
return mImpl.getFreshnessIntervalMillis();
}
- /** Returns a new {@link Builder}. */
- @NonNull
- public static Builder builder() {
- return new Builder();
- }
-
/** @hide */
@RestrictTo(Scope.LIBRARY_GROUP)
@NonNull
@@ -104,7 +98,7 @@
public static final class Builder {
private final TileProto.Tile.Builder mImpl = TileProto.Tile.newBuilder();
- Builder() {}
+ public Builder() {}
/**
* Sets the resource version required for these tiles. This can be any developer-defined
@@ -125,13 +119,6 @@
return this;
}
- /** Sets the tiles to show in the carousel, along with their validity periods. */
- @NonNull
- public Builder setTimeline(@NonNull Timeline.Builder timelineBuilder) {
- mImpl.setTimeline(timelineBuilder.build().toProto());
- return this;
- }
-
/**
* Sets how many milliseconds of elapsed time (**not** wall clock time) this tile can be
* considered to be "fresh". The platform will attempt to refresh your tile at some
diff --git a/wear/tiles/tiles/src/main/java/androidx/wear/tiles/TileProviderService.java b/wear/tiles/tiles/src/main/java/androidx/wear/tiles/TileProviderService.java
index 9dce43d..2dff303 100644
--- a/wear/tiles/tiles/src/main/java/androidx/wear/tiles/TileProviderService.java
+++ b/wear/tiles/tiles/src/main/java/androidx/wear/tiles/TileProviderService.java
@@ -300,7 +300,7 @@
Log.e(
TAG,
"RemoteException while returning resources"
- + " payload",
+ + " payload",
ex);
}
},
diff --git a/wear/tiles/tiles/src/main/java/androidx/wear/tiles/TimelineBuilders.java b/wear/tiles/tiles/src/main/java/androidx/wear/tiles/TimelineBuilders.java
index 9c1f3eb0..7902f89 100644
--- a/wear/tiles/tiles/src/main/java/androidx/wear/tiles/TimelineBuilders.java
+++ b/wear/tiles/tiles/src/main/java/androidx/wear/tiles/TimelineBuilders.java
@@ -61,12 +61,6 @@
return mImpl.getEndMillis();
}
- /** Returns a new {@link Builder}. */
- @NonNull
- public static Builder builder() {
- return new Builder();
- }
-
/** @hide */
@RestrictTo(Scope.LIBRARY_GROUP)
@NonNull
@@ -86,7 +80,7 @@
private final TimelineProto.TimeInterval.Builder mImpl =
TimelineProto.TimeInterval.newBuilder();
- Builder() {}
+ public Builder() {}
/** Sets starting point of the time interval, in milliseconds since the Unix epoch. */
@NonNull
@@ -138,12 +132,6 @@
}
}
- /** Returns a new {@link Builder}. */
- @NonNull
- public static Builder builder() {
- return new Builder();
- }
-
/** @hide */
@RestrictTo(Scope.LIBRARY_GROUP)
@NonNull
@@ -163,7 +151,7 @@
private final TimelineProto.TimelineEntry.Builder mImpl =
TimelineProto.TimelineEntry.newBuilder();
- Builder() {}
+ public Builder() {}
/** Sets the validity period for this timeline entry. */
@NonNull
@@ -172,13 +160,6 @@
return this;
}
- /** Sets the validity period for this timeline entry. */
- @NonNull
- public Builder setValidity(@NonNull TimeInterval.Builder validityBuilder) {
- mImpl.setValidity(validityBuilder.build().toProto());
- return this;
- }
-
/** Sets the contents of this timeline entry. */
@NonNull
public Builder setLayout(@NonNull Layout layout) {
@@ -186,13 +167,6 @@
return this;
}
- /** Sets the contents of this timeline entry. */
- @NonNull
- public Builder setLayout(@NonNull Layout.Builder layoutBuilder) {
- mImpl.setLayout(layoutBuilder.build().toProto());
- return this;
- }
-
/** Builds an instance from accumulated values. */
@NonNull
public TimelineEntry build() {
@@ -231,12 +205,6 @@
.collect(toList()));
}
- /** Returns a new {@link Builder}. */
- @NonNull
- public static Builder builder() {
- return new Builder();
- }
-
/** @hide */
@RestrictTo(Scope.LIBRARY_GROUP)
@NonNull
@@ -256,7 +224,7 @@
private final TimelineProto.Timeline.Builder mImpl =
TimelineProto.Timeline.newBuilder();
- Builder() {}
+ public Builder() {}
/** Adds one item to the entries in a timeline. */
@NonNull
@@ -265,13 +233,6 @@
return this;
}
- /** Adds one item to the entries in a timeline. */
- @NonNull
- public Builder addTimelineEntry(@NonNull TimelineEntry.Builder timelineEntryBuilder) {
- mImpl.addTimelineEntries(timelineEntryBuilder.build().toProto());
- return this;
- }
-
/** Builds an instance from accumulated values. */
@NonNull
public Timeline build() {
diff --git a/wear/tiles/tiles/src/main/java/androidx/wear/tiles/TypeBuilders.java b/wear/tiles/tiles/src/main/java/androidx/wear/tiles/TypeBuilders.java
index adc96e1..80ec6ac 100644
--- a/wear/tiles/tiles/src/main/java/androidx/wear/tiles/TypeBuilders.java
+++ b/wear/tiles/tiles/src/main/java/androidx/wear/tiles/TypeBuilders.java
@@ -40,12 +40,6 @@
return mImpl.getValue();
}
- /** Returns a new {@link Builder}. */
- @NonNull
- public static Builder builder() {
- return new Builder();
- }
-
/** @hide */
@RestrictTo(Scope.LIBRARY_GROUP)
@NonNull
@@ -64,7 +58,7 @@
public static final class Builder {
private final TypesProto.Int32Prop.Builder mImpl = TypesProto.Int32Prop.newBuilder();
- Builder() {}
+ public Builder() {}
/** Sets the value. */
@NonNull
@@ -95,12 +89,6 @@
return mImpl.getValue();
}
- /** Returns a new {@link Builder}. */
- @NonNull
- public static Builder builder() {
- return new Builder();
- }
-
/** @hide */
@RestrictTo(Scope.LIBRARY_GROUP)
@NonNull
@@ -119,7 +107,7 @@
public static final class Builder {
private final TypesProto.StringProp.Builder mImpl = TypesProto.StringProp.newBuilder();
- Builder() {}
+ public Builder() {}
/** Sets the value. */
@NonNull
@@ -149,12 +137,6 @@
return mImpl.getValue();
}
- /** Returns a new {@link Builder}. */
- @NonNull
- public static Builder builder() {
- return new Builder();
- }
-
/** @hide */
@RestrictTo(Scope.LIBRARY_GROUP)
@NonNull
@@ -173,7 +155,7 @@
public static final class Builder {
private final TypesProto.FloatProp.Builder mImpl = TypesProto.FloatProp.newBuilder();
- Builder() {}
+ public Builder() {}
/** Sets the value. */
@NonNull
@@ -203,12 +185,6 @@
return mImpl.getValue();
}
- /** Returns a new {@link Builder}. */
- @NonNull
- public static Builder builder() {
- return new Builder();
- }
-
/** @hide */
@RestrictTo(Scope.LIBRARY_GROUP)
@NonNull
@@ -227,7 +203,7 @@
public static final class Builder {
private final TypesProto.BoolProp.Builder mImpl = TypesProto.BoolProp.newBuilder();
- Builder() {}
+ public Builder() {}
/** Sets the value. */
@SuppressLint("MissingGetterMatchingBuilder")
diff --git a/wear/tiles/tiles/src/test/java/androidx/wear/tiles/TileProviderServiceTest.java b/wear/tiles/tiles/src/test/java/androidx/wear/tiles/TileProviderServiceTest.java
index cdcd478..e8df68f 100644
--- a/wear/tiles/tiles/src/test/java/androidx/wear/tiles/TileProviderServiceTest.java
+++ b/wear/tiles/tiles/src/test/java/androidx/wear/tiles/TileProviderServiceTest.java
@@ -64,7 +64,7 @@
// TileProviderService. For that, we need the builder form (for DummyTileProviderService to
// return), and the protobuf form (to compare against, which also includes the version).
private static final TileBuilders.Tile DUMMY_TILE_TO_RETURN =
- TileBuilders.Tile.builder().setResourcesVersion("5").build();
+ new TileBuilders.Tile.Builder().setResourcesVersion("5").build();
private static final Tile DUMMY_TILE_PROTOBUF =
Tile.newBuilder().setResourcesVersion("5").setSchemaVersion(Version.CURRENT).build();
@@ -215,7 +215,7 @@
protected ListenableFuture<ResourceBuilders.Resources> onResourcesRequest(
@NonNull ResourcesRequest requestParams) {
ResourceBuilders.Resources resources =
- ResourceBuilders.Resources.builder()
+ new ResourceBuilders.Resources.Builder()
.setVersion(requestParams.getVersion())
.build();
diff --git a/wear/wear-complications-data-source-ktx/build.gradle b/wear/wear-complications-data-source-ktx/build.gradle
index 43db873..7608bd3 100644
--- a/wear/wear-complications-data-source-ktx/build.gradle
+++ b/wear/wear-complications-data-source-ktx/build.gradle
@@ -37,7 +37,7 @@
android {
defaultConfig {
- minSdkVersion 25
+ minSdkVersion 26
}
// Use Robolectric 4.+
diff --git a/wear/wear-complications-data-source-ktx/src/test/java/androidx/wear/complications/datasource/SuspendingComplicationDataSourceServiceTest.kt b/wear/wear-complications-data-source-ktx/src/test/java/androidx/wear/complications/datasource/SuspendingComplicationDataSourceServiceTest.kt
index cdd7d9d..bb821ade2 100644
--- a/wear/wear-complications-data-source-ktx/src/test/java/androidx/wear/complications/datasource/SuspendingComplicationDataSourceServiceTest.kt
+++ b/wear/wear-complications-data-source-ktx/src/test/java/androidx/wear/complications/datasource/SuspendingComplicationDataSourceServiceTest.kt
@@ -30,6 +30,7 @@
import org.robolectric.RobolectricTestRunner
import org.robolectric.annotation.internal.DoNotInstrument
import org.robolectric.internal.bytecode.InstrumentationConfiguration
+import java.time.Instant
class TestService : SuspendingComplicationDataSourceService() {
override suspend fun onComplicationRequest(request: ComplicationRequest) =
@@ -79,7 +80,7 @@
assertThat(
(result as ShortTextComplicationData).text.getTextAt(
ApplicationProvider.getApplicationContext<Context>().resources,
- 0
+ Instant.EPOCH
)
).isEqualTo("Complication")
}
@@ -91,7 +92,7 @@
assertThat(
testService.getPreviewData(ComplicationType.SMALL_IMAGE).text.getTextAt(
ApplicationProvider.getApplicationContext<Context>().resources,
- 0
+ Instant.EPOCH
)
).isEqualTo("Preview")
}
diff --git a/wear/wear-complications-data-source-samples/build.gradle b/wear/wear-complications-data-source-samples/build.gradle
index a930d97..2690093 100644
--- a/wear/wear-complications-data-source-samples/build.gradle
+++ b/wear/wear-complications-data-source-samples/build.gradle
@@ -29,6 +29,6 @@
android {
defaultConfig {
- minSdkVersion 25
+ minSdkVersion 26
}
}
diff --git a/wear/wear-complications-data-source/build.gradle b/wear/wear-complications-data-source/build.gradle
index f4b7b25..ac9d00d 100644
--- a/wear/wear-complications-data-source/build.gradle
+++ b/wear/wear-complications-data-source/build.gradle
@@ -44,7 +44,7 @@
aidl = true
}
defaultConfig {
- minSdkVersion 25
+ minSdkVersion 26
}
// Use Robolectric 4.+
diff --git a/wear/wear-complications-data/api/current.txt b/wear/wear-complications-data/api/current.txt
index 14fd82e..07d84a3 100644
--- a/wear/wear-complications-data/api/current.txt
+++ b/wear/wear-complications-data/api/current.txt
@@ -67,8 +67,6 @@
field public static final int DATA_SOURCE_DAY_OF_WEEK = 13; // 0xd
field public static final int DATA_SOURCE_FAVORITE_CONTACT = 14; // 0xe
field public static final int DATA_SOURCE_NEXT_EVENT = 9; // 0x9
- field public static final int DATA_SOURCE_RETAIL_CHAT = 11; // 0xb
- field public static final int DATA_SOURCE_RETAIL_STEP_COUNT = 10; // 0xa
field public static final int DATA_SOURCE_STEP_COUNT = 4; // 0x4
field public static final int DATA_SOURCE_SUNRISE_SUNSET = 12; // 0xc
field public static final int DATA_SOURCE_TIME_AND_DATE = 3; // 0x3
@@ -95,10 +93,10 @@
}
public interface ComplicationText {
- method public long getNextChangeTime(long fromDateTimeMillis);
- method public CharSequence getTextAt(android.content.res.Resources resources, long dateTimeMillis);
+ method public java.time.Instant getNextChangeTime(java.time.Instant afterInstant);
+ method public CharSequence getTextAt(android.content.res.Resources resources, java.time.Instant instant);
method public boolean isAlwaysEmpty();
- method public boolean returnsSameText(long firstDateTimeMillis, long secondDateTimeMillis);
+ method public boolean returnsSameText(java.time.Instant firstInstant, java.time.Instant secondInstant);
field public static final androidx.wear.complications.data.ComplicationText.Companion Companion;
field public static final androidx.wear.complications.data.ComplicationText EMPTY;
}
@@ -120,15 +118,15 @@
}
public final class CountDownTimeReference {
- ctor public CountDownTimeReference(long dateTimeMillis);
- method public long getDateTimeMillis();
- property public final long dateTimeMillis;
+ ctor public CountDownTimeReference(java.time.Instant instant);
+ method public java.time.Instant getInstant();
+ property public final java.time.Instant instant;
}
public final class CountUpTimeReference {
- ctor public CountUpTimeReference(long dateTimeMillis);
- method public long getDateTimeMillis();
- property public final long dateTimeMillis;
+ ctor public CountUpTimeReference(java.time.Instant instant);
+ method public java.time.Instant getInstant();
+ property public final java.time.Instant instant;
}
public final class DataKt {
@@ -369,22 +367,22 @@
}
public final class TimeRange {
- method public static androidx.wear.complications.data.TimeRange after(long startDateTimeMillis);
- method public static androidx.wear.complications.data.TimeRange before(long endDateTimeMillis);
- method public static androidx.wear.complications.data.TimeRange between(long startDateTimeMillis, long endDateTimeMillis);
- method public operator boolean contains(long dateTimeMillis);
- method public long getEndDateTimeMillis();
- method public long getStartDateTimeMillis();
- property public final long endDateTimeMillis;
- property public final long startDateTimeMillis;
+ method public static androidx.wear.complications.data.TimeRange after(java.time.Instant startInstant);
+ method public static androidx.wear.complications.data.TimeRange before(java.time.Instant endInstant);
+ method public static androidx.wear.complications.data.TimeRange between(java.time.Instant startInstant, java.time.Instant endInstant);
+ method public operator boolean contains(java.time.Instant dateTimeMillis);
+ method public java.time.Instant getEndDateTimeMillis();
+ method public java.time.Instant getStartDateTimeMillis();
+ property public final java.time.Instant endDateTimeMillis;
+ property public final java.time.Instant startDateTimeMillis;
field public static final androidx.wear.complications.data.TimeRange ALWAYS;
field public static final androidx.wear.complications.data.TimeRange.Companion Companion;
}
public static final class TimeRange.Companion {
- method public androidx.wear.complications.data.TimeRange after(long startDateTimeMillis);
- method public androidx.wear.complications.data.TimeRange before(long endDateTimeMillis);
- method public androidx.wear.complications.data.TimeRange between(long startDateTimeMillis, long endDateTimeMillis);
+ method public androidx.wear.complications.data.TimeRange after(java.time.Instant startInstant);
+ method public androidx.wear.complications.data.TimeRange before(java.time.Instant endInstant);
+ method public androidx.wear.complications.data.TimeRange between(java.time.Instant startInstant, java.time.Instant endInstant);
}
public final class TypeKt {
diff --git a/wear/wear-complications-data/api/public_plus_experimental_current.txt b/wear/wear-complications-data/api/public_plus_experimental_current.txt
index 14fd82e..07d84a3 100644
--- a/wear/wear-complications-data/api/public_plus_experimental_current.txt
+++ b/wear/wear-complications-data/api/public_plus_experimental_current.txt
@@ -67,8 +67,6 @@
field public static final int DATA_SOURCE_DAY_OF_WEEK = 13; // 0xd
field public static final int DATA_SOURCE_FAVORITE_CONTACT = 14; // 0xe
field public static final int DATA_SOURCE_NEXT_EVENT = 9; // 0x9
- field public static final int DATA_SOURCE_RETAIL_CHAT = 11; // 0xb
- field public static final int DATA_SOURCE_RETAIL_STEP_COUNT = 10; // 0xa
field public static final int DATA_SOURCE_STEP_COUNT = 4; // 0x4
field public static final int DATA_SOURCE_SUNRISE_SUNSET = 12; // 0xc
field public static final int DATA_SOURCE_TIME_AND_DATE = 3; // 0x3
@@ -95,10 +93,10 @@
}
public interface ComplicationText {
- method public long getNextChangeTime(long fromDateTimeMillis);
- method public CharSequence getTextAt(android.content.res.Resources resources, long dateTimeMillis);
+ method public java.time.Instant getNextChangeTime(java.time.Instant afterInstant);
+ method public CharSequence getTextAt(android.content.res.Resources resources, java.time.Instant instant);
method public boolean isAlwaysEmpty();
- method public boolean returnsSameText(long firstDateTimeMillis, long secondDateTimeMillis);
+ method public boolean returnsSameText(java.time.Instant firstInstant, java.time.Instant secondInstant);
field public static final androidx.wear.complications.data.ComplicationText.Companion Companion;
field public static final androidx.wear.complications.data.ComplicationText EMPTY;
}
@@ -120,15 +118,15 @@
}
public final class CountDownTimeReference {
- ctor public CountDownTimeReference(long dateTimeMillis);
- method public long getDateTimeMillis();
- property public final long dateTimeMillis;
+ ctor public CountDownTimeReference(java.time.Instant instant);
+ method public java.time.Instant getInstant();
+ property public final java.time.Instant instant;
}
public final class CountUpTimeReference {
- ctor public CountUpTimeReference(long dateTimeMillis);
- method public long getDateTimeMillis();
- property public final long dateTimeMillis;
+ ctor public CountUpTimeReference(java.time.Instant instant);
+ method public java.time.Instant getInstant();
+ property public final java.time.Instant instant;
}
public final class DataKt {
@@ -369,22 +367,22 @@
}
public final class TimeRange {
- method public static androidx.wear.complications.data.TimeRange after(long startDateTimeMillis);
- method public static androidx.wear.complications.data.TimeRange before(long endDateTimeMillis);
- method public static androidx.wear.complications.data.TimeRange between(long startDateTimeMillis, long endDateTimeMillis);
- method public operator boolean contains(long dateTimeMillis);
- method public long getEndDateTimeMillis();
- method public long getStartDateTimeMillis();
- property public final long endDateTimeMillis;
- property public final long startDateTimeMillis;
+ method public static androidx.wear.complications.data.TimeRange after(java.time.Instant startInstant);
+ method public static androidx.wear.complications.data.TimeRange before(java.time.Instant endInstant);
+ method public static androidx.wear.complications.data.TimeRange between(java.time.Instant startInstant, java.time.Instant endInstant);
+ method public operator boolean contains(java.time.Instant dateTimeMillis);
+ method public java.time.Instant getEndDateTimeMillis();
+ method public java.time.Instant getStartDateTimeMillis();
+ property public final java.time.Instant endDateTimeMillis;
+ property public final java.time.Instant startDateTimeMillis;
field public static final androidx.wear.complications.data.TimeRange ALWAYS;
field public static final androidx.wear.complications.data.TimeRange.Companion Companion;
}
public static final class TimeRange.Companion {
- method public androidx.wear.complications.data.TimeRange after(long startDateTimeMillis);
- method public androidx.wear.complications.data.TimeRange before(long endDateTimeMillis);
- method public androidx.wear.complications.data.TimeRange between(long startDateTimeMillis, long endDateTimeMillis);
+ method public androidx.wear.complications.data.TimeRange after(java.time.Instant startInstant);
+ method public androidx.wear.complications.data.TimeRange before(java.time.Instant endInstant);
+ method public androidx.wear.complications.data.TimeRange between(java.time.Instant startInstant, java.time.Instant endInstant);
}
public final class TypeKt {
diff --git a/wear/wear-complications-data/api/restricted_current.txt b/wear/wear-complications-data/api/restricted_current.txt
index 4e68347..d7aaa47 100644
--- a/wear/wear-complications-data/api/restricted_current.txt
+++ b/wear/wear-complications-data/api/restricted_current.txt
@@ -232,8 +232,6 @@
field public static final int DATA_SOURCE_DAY_OF_WEEK = 13; // 0xd
field public static final int DATA_SOURCE_FAVORITE_CONTACT = 14; // 0xe
field public static final int DATA_SOURCE_NEXT_EVENT = 9; // 0x9
- field public static final int DATA_SOURCE_RETAIL_CHAT = 11; // 0xb
- field public static final int DATA_SOURCE_RETAIL_STEP_COUNT = 10; // 0xa
field public static final int DATA_SOURCE_STEP_COUNT = 4; // 0x4
field public static final int DATA_SOURCE_SUNRISE_SUNSET = 12; // 0xc
field public static final int DATA_SOURCE_TIME_AND_DATE = 3; // 0x3
@@ -246,7 +244,7 @@
public static final class SystemDataSources.Companion {
}
- @IntDef({androidx.wear.complications.SystemDataSources.NO_DATA_SOURCE, androidx.wear.complications.SystemDataSources.DATA_SOURCE_WATCH_BATTERY, androidx.wear.complications.SystemDataSources.DATA_SOURCE_DATE, androidx.wear.complications.SystemDataSources.DATA_SOURCE_TIME_AND_DATE, androidx.wear.complications.SystemDataSources.DATA_SOURCE_STEP_COUNT, androidx.wear.complications.SystemDataSources.DATA_SOURCE_WORLD_CLOCK, androidx.wear.complications.SystemDataSources.DATA_SOURCE_APP_SHORTCUT, androidx.wear.complications.SystemDataSources.DATA_SOURCE_UNREAD_NOTIFICATION_COUNT, androidx.wear.complications.SystemDataSources.DATA_SOURCE_NEXT_EVENT, androidx.wear.complications.SystemDataSources.DATA_SOURCE_RETAIL_STEP_COUNT, androidx.wear.complications.SystemDataSources.DATA_SOURCE_RETAIL_CHAT, androidx.wear.complications.SystemDataSources.DATA_SOURCE_SUNRISE_SUNSET, androidx.wear.complications.SystemDataSources.DATA_SOURCE_DAY_OF_WEEK, androidx.wear.complications.SystemDataSources.DATA_SOURCE_FAVORITE_CONTACT, androidx.wear.complications.SystemDataSources.DATA_SOURCE_DAY_AND_DATE}) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) @kotlin.annotation.Retention(kotlin.annotation.AnnotationRetention) public static @interface SystemDataSources.DataSourceId {
+ @IntDef({androidx.wear.complications.SystemDataSources.NO_DATA_SOURCE, androidx.wear.complications.SystemDataSources.DATA_SOURCE_WATCH_BATTERY, androidx.wear.complications.SystemDataSources.DATA_SOURCE_DATE, androidx.wear.complications.SystemDataSources.DATA_SOURCE_TIME_AND_DATE, androidx.wear.complications.SystemDataSources.DATA_SOURCE_STEP_COUNT, androidx.wear.complications.SystemDataSources.DATA_SOURCE_WORLD_CLOCK, androidx.wear.complications.SystemDataSources.DATA_SOURCE_APP_SHORTCUT, androidx.wear.complications.SystemDataSources.DATA_SOURCE_UNREAD_NOTIFICATION_COUNT, androidx.wear.complications.SystemDataSources.DATA_SOURCE_NEXT_EVENT, androidx.wear.complications.SystemDataSources.DATA_SOURCE_SUNRISE_SUNSET, androidx.wear.complications.SystemDataSources.DATA_SOURCE_DAY_OF_WEEK, androidx.wear.complications.SystemDataSources.DATA_SOURCE_FAVORITE_CONTACT, androidx.wear.complications.SystemDataSources.DATA_SOURCE_DAY_AND_DATE}) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) @kotlin.annotation.Retention(kotlin.annotation.AnnotationRetention) public static @interface SystemDataSources.DataSourceId {
}
}
@@ -264,10 +262,10 @@
}
public interface ComplicationText {
- method public long getNextChangeTime(long fromDateTimeMillis);
- method public CharSequence getTextAt(android.content.res.Resources resources, long dateTimeMillis);
+ method public java.time.Instant getNextChangeTime(java.time.Instant afterInstant);
+ method public CharSequence getTextAt(android.content.res.Resources resources, java.time.Instant instant);
method public boolean isAlwaysEmpty();
- method public boolean returnsSameText(long firstDateTimeMillis, long secondDateTimeMillis);
+ method public boolean returnsSameText(java.time.Instant firstInstant, java.time.Instant secondInstant);
method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public android.support.wearable.complications.ComplicationText toWireComplicationText();
field public static final androidx.wear.complications.data.ComplicationText.Companion Companion;
field public static final androidx.wear.complications.data.ComplicationText EMPTY;
@@ -299,15 +297,15 @@
}
public final class CountDownTimeReference {
- ctor public CountDownTimeReference(long dateTimeMillis);
- method public long getDateTimeMillis();
- property public final long dateTimeMillis;
+ ctor public CountDownTimeReference(java.time.Instant instant);
+ method public java.time.Instant getInstant();
+ property public final java.time.Instant instant;
}
public final class CountUpTimeReference {
- ctor public CountUpTimeReference(long dateTimeMillis);
- method public long getDateTimeMillis();
- property public final long dateTimeMillis;
+ ctor public CountUpTimeReference(java.time.Instant instant);
+ method public java.time.Instant getInstant();
+ property public final java.time.Instant instant;
}
public final class DataKt {
@@ -560,22 +558,22 @@
}
public final class TimeRange {
- method public static androidx.wear.complications.data.TimeRange after(long startDateTimeMillis);
- method public static androidx.wear.complications.data.TimeRange before(long endDateTimeMillis);
- method public static androidx.wear.complications.data.TimeRange between(long startDateTimeMillis, long endDateTimeMillis);
- method public operator boolean contains(long dateTimeMillis);
- method public long getEndDateTimeMillis();
- method public long getStartDateTimeMillis();
- property public final long endDateTimeMillis;
- property public final long startDateTimeMillis;
+ method public static androidx.wear.complications.data.TimeRange after(java.time.Instant startInstant);
+ method public static androidx.wear.complications.data.TimeRange before(java.time.Instant endInstant);
+ method public static androidx.wear.complications.data.TimeRange between(java.time.Instant startInstant, java.time.Instant endInstant);
+ method public operator boolean contains(java.time.Instant dateTimeMillis);
+ method public java.time.Instant getEndDateTimeMillis();
+ method public java.time.Instant getStartDateTimeMillis();
+ property public final java.time.Instant endDateTimeMillis;
+ property public final java.time.Instant startDateTimeMillis;
field public static final androidx.wear.complications.data.TimeRange ALWAYS;
field public static final androidx.wear.complications.data.TimeRange.Companion Companion;
}
public static final class TimeRange.Companion {
- method public androidx.wear.complications.data.TimeRange after(long startDateTimeMillis);
- method public androidx.wear.complications.data.TimeRange before(long endDateTimeMillis);
- method public androidx.wear.complications.data.TimeRange between(long startDateTimeMillis, long endDateTimeMillis);
+ method public androidx.wear.complications.data.TimeRange after(java.time.Instant startInstant);
+ method public androidx.wear.complications.data.TimeRange before(java.time.Instant endInstant);
+ method public androidx.wear.complications.data.TimeRange between(java.time.Instant startInstant, java.time.Instant endInstant);
}
public final class TypeKt {
diff --git a/wear/wear-complications-data/build.gradle b/wear/wear-complications-data/build.gradle
index 84c99d1..ffb01a0 100644
--- a/wear/wear-complications-data/build.gradle
+++ b/wear/wear-complications-data/build.gradle
@@ -53,7 +53,7 @@
aidl = true
}
defaultConfig {
- minSdkVersion 25
+ minSdkVersion 26
}
buildTypes.all {
consumerProguardFiles "proguard-rules.pro"
diff --git a/wear/wear-complications-data/src/androidTest/java/androidx/wear/complications/ComplicationDataSourceInfoRetrieverTest.kt b/wear/wear-complications-data/src/androidTest/java/androidx/wear/complications/ComplicationDataSourceInfoRetrieverTest.kt
index 6f320b8..1e60e79 100644
--- a/wear/wear-complications-data/src/androidTest/java/androidx/wear/complications/ComplicationDataSourceInfoRetrieverTest.kt
+++ b/wear/wear-complications-data/src/androidTest/java/androidx/wear/complications/ComplicationDataSourceInfoRetrieverTest.kt
@@ -39,6 +39,7 @@
import kotlinx.coroutines.runBlocking
import org.junit.Test
import org.junit.runner.RunWith
+import java.time.Instant
private typealias WireComplicationProviderInfo =
android.support.wearable.complications.ComplicationProviderInfo
@@ -164,7 +165,9 @@
dataSource1,
ComplicationType.SHORT_TEXT
) as ShortTextComplicationData
- assertThat(complicationData.text.getTextAt(context.resources, 0)).isEqualTo("Left")
+ assertThat(
+ complicationData.text.getTextAt(context.resources, Instant.EPOCH)
+ ).isEqualTo("Left")
complicationDataSourceInfoRetriever.close()
}
}
diff --git a/wear/wear-complications-data/src/main/java/androidx/wear/complications/SystemDataSources.kt b/wear/wear-complications-data/src/main/java/androidx/wear/complications/SystemDataSources.kt
index 2e00e8a..037c51b 100644
--- a/wear/wear-complications-data/src/main/java/androidx/wear/complications/SystemDataSources.kt
+++ b/wear/wear-complications-data/src/main/java/androidx/wear/complications/SystemDataSources.kt
@@ -123,28 +123,6 @@
public const val DATA_SOURCE_NEXT_EVENT: Int = 9
/**
- * Id for the 'retail mode step count' complication complication data source.
- *
- * This complication data source shows fake step count data, and the tap action launches the
- * retail mode health app. This complication data source should only be set as a default if
- * the device is in retail mode.
- *
- * This complication data source supports only [ComplicationType.SHORT_TEXT].
- */
- public const val DATA_SOURCE_RETAIL_STEP_COUNT: Int = 10
-
- /**
- * Id for the 'retail mode chat' complication complication data source.
- *
- * This complication data source shows fake 'unread chat messages' data, and the tap action
- * launches the retail mode chat app. This complication data source should only be set as
- * a default if the device is in retail mode.
- *
- * This complication data source supports only [ComplicationType.SHORT_TEXT].
- */
- public const val DATA_SOURCE_RETAIL_CHAT: Int = 11
-
- /**
* Id for the 'sunrise sunset' complication complication data source.
*
* This complication data source shows next sunrise or sunset time according to current
@@ -203,8 +181,6 @@
DATA_SOURCE_APP_SHORTCUT,
DATA_SOURCE_UNREAD_NOTIFICATION_COUNT,
DATA_SOURCE_NEXT_EVENT,
- DATA_SOURCE_RETAIL_STEP_COUNT,
- DATA_SOURCE_RETAIL_CHAT,
DATA_SOURCE_SUNRISE_SUNSET,
DATA_SOURCE_DAY_OF_WEEK,
DATA_SOURCE_FAVORITE_CONTACT,
@@ -215,4 +191,4 @@
)
@Retention(AnnotationRetention.SOURCE)
public annotation class DataSourceId
-}
\ No newline at end of file
+}
diff --git a/wear/wear-complications-data/src/main/java/androidx/wear/complications/data/Data.kt b/wear/wear-complications-data/src/main/java/androidx/wear/complications/data/Data.kt
index 3101501..03238c2 100644
--- a/wear/wear-complications-data/src/main/java/androidx/wear/complications/data/Data.kt
+++ b/wear/wear-complications-data/src/main/java/androidx/wear/complications/data/Data.kt
@@ -19,6 +19,7 @@
import android.app.PendingIntent
import android.graphics.drawable.Icon
import androidx.annotation.RestrictTo
+import java.time.Instant
/** The wire format for [ComplicationData]. */
internal typealias WireComplicationData = android.support.wearable.complications.ComplicationData
@@ -869,7 +870,10 @@
if ((startDateTimeMillis == 0L) and (endDateTimeMillis == Long.MAX_VALUE)) {
null
} else {
- TimeRange(startDateTimeMillis, endDateTimeMillis)
+ TimeRange(
+ Instant.ofEpochMilli(startDateTimeMillis),
+ Instant.ofEpochMilli(endDateTimeMillis)
+ )
}
private fun WireComplicationData.parseIcon() =
@@ -897,11 +901,11 @@
internal fun setValidTimeRange(validTimeRange: TimeRange?, data: WireComplicationDataBuilder) {
validTimeRange?.let {
- if (it.startDateTimeMillis > 0) {
- data.setStartDateTimeMillis(it.startDateTimeMillis)
+ if (it.startDateTimeMillis > Instant.MIN) {
+ data.setStartDateTimeMillis(it.startDateTimeMillis.toEpochMilli())
}
- if (it.endDateTimeMillis != Long.MAX_VALUE) {
- data.setEndDateTimeMillis(it.endDateTimeMillis)
+ if (it.endDateTimeMillis != Instant.MAX) {
+ data.setEndDateTimeMillis(it.endDateTimeMillis.toEpochMilli())
}
}
}
diff --git a/wear/wear-complications-data/src/main/java/androidx/wear/complications/data/Text.kt b/wear/wear-complications-data/src/main/java/androidx/wear/complications/data/Text.kt
index cbce229..38cc7b6 100644
--- a/wear/wear-complications-data/src/main/java/androidx/wear/complications/data/Text.kt
+++ b/wear/wear-complications-data/src/main/java/androidx/wear/complications/data/Text.kt
@@ -29,6 +29,7 @@
import android.text.style.TypefaceSpan
import android.text.style.UnderlineSpan
import androidx.annotation.RestrictTo
+import java.time.Instant
import java.util.concurrent.TimeUnit
/** The wire format for [ComplicationText]. */
@@ -54,24 +55,21 @@
* Returns the text that should be displayed for the given timestamp.
*
* @param resources [Resources] from the current context
- * @param dateTimeMillis milliseconds since epoch, e.g. from [System.currentTimeMillis]
+ * @param instant The [Instant] at which to sample the text
*/
public fun getTextAt(
resources: Resources,
- dateTimeMillis: Long
+ instant: Instant
): CharSequence
/**
- * Returns true if the result of [getTextAt] will be the same for both [firstDateTimeMillis]
- * and [secondDateTimeMillis].
+ * Returns true if the result of [getTextAt] will be the same for both [firstInstant] and
+ * [secondInstant].
*/
- public fun returnsSameText(
- firstDateTimeMillis: Long,
- secondDateTimeMillis: Long
- ): Boolean
+ public fun returnsSameText(firstInstant: Instant, secondInstant: Instant): Boolean
- /** Returns the next time after [fromDateTimeMillis] at which the text may change. */
- public fun getNextChangeTime(fromDateTimeMillis: Long): Long
+ /** Returns the next time after [afterInstant] at which the text may change. */
+ public fun getNextChangeTime(afterInstant: Instant): Instant
public fun isAlwaysEmpty(): Boolean
@@ -225,8 +223,8 @@
*/
public class Builder private constructor(
private val style: TimeDifferenceStyle,
- private val startDateTimeMillis: Long?,
- private val endDateTimeMillis: Long?
+ private val startInstant: Instant?,
+ private val endInstant: Instant?
) {
private var text: CharSequence? = null
private var displayAsNow: Boolean? = null
@@ -242,7 +240,7 @@
public constructor(
style: TimeDifferenceStyle,
countUpTimeReference: CountUpTimeReference
- ) : this(style, null, countUpTimeReference.dateTimeMillis)
+ ) : this(style, null, countUpTimeReference.instant)
/**
* Constructs a [TimeDifferenceComplicationText.Builder] where the complication is counting
@@ -254,7 +252,7 @@
public constructor(
style: TimeDifferenceStyle,
countDownTimeReference: CountDownTimeReference
- ) : this(style, countDownTimeReference.dateTimeMillis, null)
+ ) : this(style, countDownTimeReference.instant, null)
/**
* Sets the text within which the time difference will be displayed.
@@ -304,11 +302,11 @@
WireComplicationTextTimeDifferenceBuilder().apply {
setStyle(style.wireStyle)
setSurroundingText(text)
- startDateTimeMillis?.let {
- setReferencePeriodStartMillis(it)
+ startInstant?.let {
+ setReferencePeriodStartMillis(it.toEpochMilli())
}
- endDateTimeMillis?.let {
- setReferencePeriodEndMillis(it)
+ endInstant?.let {
+ setReferencePeriodEndMillis(it.toEpochMilli())
}
displayAsNow?.let { setShowNowText(it) }
setMinimumUnit(minimumUnit)
@@ -384,14 +382,14 @@
private class DelegatingComplicationText(
private val delegate: WireComplicationText
) : ComplicationText {
- override fun getTextAt(resources: Resources, dateTimeMillis: Long) =
- delegate.getTextAt(resources, dateTimeMillis)
+ override fun getTextAt(resources: Resources, instant: Instant) =
+ delegate.getTextAt(resources, instant.toEpochMilli())
- override fun returnsSameText(firstDateTimeMillis: Long, secondDateTimeMillis: Long) =
- delegate.returnsSameText(firstDateTimeMillis, secondDateTimeMillis)
+ override fun returnsSameText(firstInstant: Instant, secondInstant: Instant) =
+ delegate.returnsSameText(firstInstant.toEpochMilli(), secondInstant.toEpochMilli())
- override fun getNextChangeTime(fromDateTimeMillis: Long) =
- delegate.getNextChangeTime(fromDateTimeMillis)
+ override fun getNextChangeTime(afterInstant: Instant) =
+ Instant.ofEpochMilli(delegate.getNextChangeTime(afterInstant.toEpochMilli()))
override fun isAlwaysEmpty() = delegate.isAlwaysEmpty
override fun getTimeDependentText(): TimeDependentText = delegate.timeDependentText
@@ -413,14 +411,14 @@
private class DelegatingTimeDependentText(
private val delegate: WireTimeDependentText
) : ComplicationText {
- override fun getTextAt(resources: Resources, dateTimeMillis: Long) =
- delegate.getTextAt(resources, dateTimeMillis)
+ override fun getTextAt(resources: Resources, instant: Instant) =
+ delegate.getTextAt(resources, instant.toEpochMilli())
- override fun returnsSameText(firstDateTimeMillis: Long, secondDateTimeMillis: Long) =
- delegate.returnsSameText(firstDateTimeMillis, secondDateTimeMillis)
+ override fun returnsSameText(firstInstant: Instant, secondInstant: Instant) =
+ delegate.returnsSameText(firstInstant.toEpochMilli(), secondInstant.toEpochMilli())
- override fun getNextChangeTime(fromDateTimeMillis: Long) =
- delegate.getNextChangeTime(fromDateTimeMillis)
+ override fun getNextChangeTime(afterInstant: Instant) =
+ Instant.ofEpochMilli(delegate.getNextChangeTime(afterInstant.toEpochMilli()))
override fun isAlwaysEmpty() = false
diff --git a/wear/wear-complications-data/src/main/java/androidx/wear/complications/data/Time.kt b/wear/wear-complications-data/src/main/java/androidx/wear/complications/data/Time.kt
index 1205662..e1962a1 100644
--- a/wear/wear-complications-data/src/main/java/androidx/wear/complications/data/Time.kt
+++ b/wear/wear-complications-data/src/main/java/androidx/wear/complications/data/Time.kt
@@ -16,40 +16,42 @@
package androidx.wear.complications.data
+import java.time.Instant
+
/** A range of time, that may be unbounded on either side. */
public class TimeRange internal constructor(
- public val startDateTimeMillis: Long,
- public val endDateTimeMillis: Long
+ public val startDateTimeMillis: Instant,
+ public val endDateTimeMillis: Instant
) {
/** Returns whether the [TimeRange] contains a given point in time. */
- public operator fun contains(dateTimeMillis: Long): Boolean =
+ public operator fun contains(dateTimeMillis: Instant): Boolean =
(dateTimeMillis >= startDateTimeMillis) and (dateTimeMillis <= endDateTimeMillis)
public companion object {
/** The [TimeRange] that includes every point in time. */
@JvmField
- public val ALWAYS: TimeRange = TimeRange(0, Long.MAX_VALUE)
+ public val ALWAYS: TimeRange = TimeRange(Instant.MIN, Instant.MAX)
/** Constructs a time range after a given point in time. */
@JvmStatic
- public fun after(startDateTimeMillis: Long): TimeRange =
- TimeRange(startDateTimeMillis, Long.MAX_VALUE)
+ public fun after(startInstant: Instant): TimeRange =
+ TimeRange(startInstant, Instant.MAX)
/** Constructs a time range until a given point in time. */
@JvmStatic
- public fun before(endDateTimeMillis: Long): TimeRange = TimeRange(0, endDateTimeMillis)
+ public fun before(endInstant: Instant): TimeRange = TimeRange(Instant.MIN, endInstant)
/** Constructs a time range between two points in time, inclusive of the points
* themselves.
*/
@JvmStatic
- public fun between(startDateTimeMillis: Long, endDateTimeMillis: Long): TimeRange =
- TimeRange(startDateTimeMillis, endDateTimeMillis)
+ public fun between(startInstant: Instant, endInstant: Instant): TimeRange =
+ TimeRange(startInstant, endInstant)
}
}
/** Defines a point in time the complication is counting down until. */
-public class CountDownTimeReference(public val dateTimeMillis: Long)
+public class CountDownTimeReference(public val instant: Instant)
/** Defines a point in time the complication is counting up from. */
-public class CountUpTimeReference(public val dateTimeMillis: Long)
+public class CountUpTimeReference(public val instant: Instant)
diff --git a/wear/wear-complications-data/src/test/java/androidx/wear/complications/ComplicationDataSourceInfoRetrieverTest.kt b/wear/wear-complications-data/src/test/java/androidx/wear/complications/ComplicationDataSourceInfoRetrieverTest.kt
index 9133d05..8ae1a28 100644
--- a/wear/wear-complications-data/src/test/java/androidx/wear/complications/ComplicationDataSourceInfoRetrieverTest.kt
+++ b/wear/wear-complications-data/src/test/java/androidx/wear/complications/ComplicationDataSourceInfoRetrieverTest.kt
@@ -41,6 +41,7 @@
import org.mockito.ArgumentMatchers.eq
import org.mockito.Mockito
import org.mockito.Mockito.doAnswer
+import java.time.Instant
/*
* Copyright 2021 The Android Open Source Project
@@ -98,7 +99,8 @@
assertThat(previewData.type).isEqualTo(type)
assertThat(
(previewData as LongTextComplicationData).text.getTextAt(
- ApplicationProvider.getApplicationContext<Context>().resources, 0
+ ApplicationProvider.getApplicationContext<Context>().resources,
+ Instant.EPOCH
)
).isEqualTo("Test Text")
}
@@ -197,9 +199,12 @@
ComplicationType.SHORT_TEXT,
componentName = null
).fallbackPreviewData as ShortTextComplicationData
- assertThat(shortTextPreviewData.text.getTextAt(resources, 0)).isEqualTo("complic")
- assertThat(shortTextPreviewData.contentDescription!!.getTextAt(resources, 0))
- .isEqualTo("complicationName")
+ assertThat(
+ shortTextPreviewData.text.getTextAt(resources, Instant.EPOCH)
+ ).isEqualTo("complic")
+ assertThat(
+ shortTextPreviewData.contentDescription!!.getTextAt(resources, Instant.EPOCH)
+ ).isEqualTo("complicationName")
assertThat(shortTextPreviewData.monochromaticImage!!.image).isEqualTo(icon)
}
@@ -213,9 +218,12 @@
ComplicationType.LONG_TEXT,
componentName = null
).fallbackPreviewData as LongTextComplicationData
- assertThat(longTextPreviewData.text.getTextAt(resources, 0)).isEqualTo("complicationName")
- assertThat(longTextPreviewData.contentDescription!!.getTextAt(resources, 0))
- .isEqualTo("complicationName")
+ assertThat(
+ longTextPreviewData.text.getTextAt(resources, Instant.EPOCH)
+ ).isEqualTo("complicationName")
+ assertThat(
+ longTextPreviewData.contentDescription!!.getTextAt(resources, Instant.EPOCH)
+ ).isEqualTo("complicationName")
assertThat(longTextPreviewData.monochromaticImage!!.image).isEqualTo(icon)
}
@@ -230,8 +238,9 @@
componentName = null
).fallbackPreviewData as SmallImageComplicationData
assertThat(smallImagePreviewData.smallImage.image).isEqualTo(icon)
- assertThat(smallImagePreviewData.contentDescription!!.getTextAt(resources, 0))
- .isEqualTo("complicationName")
+ assertThat(
+ smallImagePreviewData.contentDescription!!.getTextAt(resources, Instant.EPOCH)
+ ).isEqualTo("complicationName")
}
@Test
@@ -245,8 +254,9 @@
componentName = null
).fallbackPreviewData as PhotoImageComplicationData
assertThat(photoImagePreviewData.photoImage).isEqualTo(icon)
- assertThat(photoImagePreviewData.contentDescription!!.getTextAt(resources, 0))
- .isEqualTo("complicationName")
+ assertThat(
+ photoImagePreviewData.contentDescription!!.getTextAt(resources, Instant.EPOCH)
+ ).isEqualTo("complicationName")
}
@Test
@@ -260,8 +270,12 @@
componentName = null
).fallbackPreviewData as MonochromaticImageComplicationData
assertThat(monochromaticImagePreviewData.monochromaticImage.image).isEqualTo(icon)
- assertThat(monochromaticImagePreviewData.contentDescription!!.getTextAt(resources, 0))
- .isEqualTo("complicationName")
+ assertThat(
+ monochromaticImagePreviewData.contentDescription!!.getTextAt(
+ resources,
+ Instant.EPOCH
+ )
+ ).isEqualTo("complicationName")
}
@Test
@@ -277,11 +291,15 @@
assertThat(rangedValuePreviewData.min).isEqualTo(0.0f)
assertThat(rangedValuePreviewData.max).isEqualTo(100.0f)
assertThat(rangedValuePreviewData.value).isEqualTo(42.0f)
- assertThat(rangedValuePreviewData.text!!.getTextAt(resources, 0)).isEqualTo(
- "complicationName"
- )
+ assertThat(
+ rangedValuePreviewData.text!!.getTextAt(resources, Instant.EPOCH)
+ ).isEqualTo("complicationName")
assertThat(rangedValuePreviewData.monochromaticImage!!.image).isEqualTo(icon)
- assertThat(rangedValuePreviewData.contentDescription!!.getTextAt(resources, 0))
- .isEqualTo("complicationName")
+ assertThat(
+ rangedValuePreviewData.contentDescription!!.getTextAt(
+ resources,
+ Instant.EPOCH
+ )
+ ).isEqualTo("complicationName")
}
}
\ No newline at end of file
diff --git a/wear/wear-complications-data/src/test/java/androidx/wear/complications/data/DataTest.kt b/wear/wear-complications-data/src/test/java/androidx/wear/complications/data/DataTest.kt
index b5db646..49fbd691 100644
--- a/wear/wear-complications-data/src/test/java/androidx/wear/complications/data/DataTest.kt
+++ b/wear/wear-complications-data/src/test/java/androidx/wear/complications/data/DataTest.kt
@@ -25,6 +25,7 @@
import com.google.common.truth.Truth.assertThat
import org.junit.Test
import org.junit.runner.RunWith
+import java.time.Instant
@RunWith(SharedRobolectricTestRunner::class)
public class AsWireComplicationDataTest {
@@ -387,22 +388,22 @@
@RunWith(SharedRobolectricTestRunner::class)
public class ValidTimeRangeTest {
- private val testStartDateTimeMillis = 1000L
- private val testEndDateTimeMillis = 2000L
+ private val testStartInstant = Instant.ofEpochMilli(1000L)
+ private val testEndDateInstant = Instant.ofEpochMilli(2000L)
@Test
public fun shortTextComplicationData() {
val data = ShortTextComplicationData.Builder(
"text".complicationText, ComplicationText.EMPTY
)
- .setValidTimeRange(TimeRange.between(testStartDateTimeMillis, testEndDateTimeMillis))
+ .setValidTimeRange(TimeRange.between(testStartInstant, testEndDateInstant))
.build()
ParcelableSubject.assertThat(data.asWireComplicationData())
.hasSameSerializationAs(
WireComplicationDataBuilder(WireComplicationData.TYPE_SHORT_TEXT)
.setShortText(WireComplicationText.plainText("text"))
- .setStartDateTimeMillis(testStartDateTimeMillis)
- .setEndDateTimeMillis(testEndDateTimeMillis)
+ .setStartDateTimeMillis(testStartInstant.toEpochMilli())
+ .setEndDateTimeMillis(testEndDateInstant.toEpochMilli())
.build()
)
}
@@ -410,14 +411,14 @@
@Test
public fun longTextComplicationData() {
val data = LongTextComplicationData.Builder("text".complicationText, ComplicationText.EMPTY)
- .setValidTimeRange(TimeRange.between(testStartDateTimeMillis, testEndDateTimeMillis))
+ .setValidTimeRange(TimeRange.between(testStartInstant, testEndDateInstant))
.build()
ParcelableSubject.assertThat(data.asWireComplicationData())
.hasSameSerializationAs(
WireComplicationDataBuilder(WireComplicationData.TYPE_LONG_TEXT)
.setLongText(WireComplicationText.plainText("text"))
- .setStartDateTimeMillis(testStartDateTimeMillis)
- .setEndDateTimeMillis(testEndDateTimeMillis)
+ .setStartDateTimeMillis(testStartInstant.toEpochMilli())
+ .setEndDateTimeMillis(testEndDateInstant.toEpochMilli())
.build()
)
}
@@ -428,7 +429,7 @@
value = 95f, min = 0f, max = 100f,
contentDescription = ComplicationText.EMPTY
)
- .setValidTimeRange(TimeRange.between(testStartDateTimeMillis, testEndDateTimeMillis))
+ .setValidTimeRange(TimeRange.between(testStartInstant, testEndDateInstant))
.build()
ParcelableSubject.assertThat(data.asWireComplicationData())
.hasSameSerializationAs(
@@ -436,8 +437,8 @@
.setRangedValue(95f)
.setRangedMinValue(0f)
.setRangedMaxValue(100f)
- .setStartDateTimeMillis(testStartDateTimeMillis)
- .setEndDateTimeMillis(testEndDateTimeMillis)
+ .setStartDateTimeMillis(testStartInstant.toEpochMilli())
+ .setEndDateTimeMillis(testEndDateInstant.toEpochMilli())
.build()
)
}
@@ -447,14 +448,14 @@
val icon = Icon.createWithContentUri("someuri")
val image = MonochromaticImage.Builder(icon).build()
val data = MonochromaticImageComplicationData.Builder(image, ComplicationText.EMPTY)
- .setValidTimeRange(TimeRange.between(testStartDateTimeMillis, testEndDateTimeMillis))
+ .setValidTimeRange(TimeRange.between(testStartInstant, testEndDateInstant))
.build()
ParcelableSubject.assertThat(data.asWireComplicationData())
.hasSameSerializationAs(
WireComplicationDataBuilder(WireComplicationData.TYPE_ICON)
.setIcon(icon)
- .setStartDateTimeMillis(testStartDateTimeMillis)
- .setEndDateTimeMillis(testEndDateTimeMillis)
+ .setStartDateTimeMillis(testStartInstant.toEpochMilli())
+ .setEndDateTimeMillis(testEndDateInstant.toEpochMilli())
.build()
)
}
@@ -464,15 +465,15 @@
val icon = Icon.createWithContentUri("someuri")
val image = SmallImage.Builder(icon, SmallImageType.PHOTO).build()
val data = SmallImageComplicationData.Builder(image, ComplicationText.EMPTY)
- .setValidTimeRange(TimeRange.between(testStartDateTimeMillis, testEndDateTimeMillis))
+ .setValidTimeRange(TimeRange.between(testStartInstant, testEndDateInstant))
.build()
ParcelableSubject.assertThat(data.asWireComplicationData())
.hasSameSerializationAs(
WireComplicationDataBuilder(WireComplicationData.TYPE_SMALL_IMAGE)
.setSmallImage(icon)
.setSmallImageStyle(WireComplicationData.IMAGE_STYLE_PHOTO)
- .setStartDateTimeMillis(testStartDateTimeMillis)
- .setEndDateTimeMillis(testEndDateTimeMillis)
+ .setStartDateTimeMillis(testStartInstant.toEpochMilli())
+ .setEndDateTimeMillis(testEndDateInstant.toEpochMilli())
.build()
)
}
@@ -481,14 +482,14 @@
public fun photoImageComplicationData() {
val photoImage = Icon.createWithContentUri("someuri")
val data = PhotoImageComplicationData.Builder(photoImage, ComplicationText.EMPTY)
- .setValidTimeRange(TimeRange.between(testStartDateTimeMillis, testEndDateTimeMillis))
+ .setValidTimeRange(TimeRange.between(testStartInstant, testEndDateInstant))
.build()
ParcelableSubject.assertThat(data.asWireComplicationData())
.hasSameSerializationAs(
WireComplicationDataBuilder(WireComplicationData.TYPE_LARGE_IMAGE)
.setLargeImage(photoImage)
- .setStartDateTimeMillis(testStartDateTimeMillis)
- .setEndDateTimeMillis(testEndDateTimeMillis)
+ .setStartDateTimeMillis(testStartInstant.toEpochMilli())
+ .setEndDateTimeMillis(testEndDateInstant.toEpochMilli())
.build()
)
}
diff --git a/wear/wear-complications-data/src/test/java/androidx/wear/complications/data/TextTest.kt b/wear/wear-complications-data/src/test/java/androidx/wear/complications/data/TextTest.kt
index 048b391..bc350df 100644
--- a/wear/wear-complications-data/src/test/java/androidx/wear/complications/data/TextTest.kt
+++ b/wear/wear-complications-data/src/test/java/androidx/wear/complications/data/TextTest.kt
@@ -49,10 +49,10 @@
@Test
public fun timeDifferenceText_CountUpTimeReference() {
- val referenceMillis = Instant.parse("2020-12-30T10:15:30.001Z").toEpochMilli()
+ val referenceInstant = Instant.parse("2020-12-30T10:15:30.001Z")
val text = TimeDifferenceComplicationText.Builder(
TimeDifferenceStyle.STOPWATCH,
- CountUpTimeReference(referenceMillis)
+ CountUpTimeReference(referenceInstant)
)
.setText("^1 after lunch")
.setDisplayAsNow(false)
@@ -66,11 +66,12 @@
.setSurroundingText("^1 after lunch")
.setShowNowText(false)
.setMinimumUnit(TimeUnit.SECONDS)
- .setReferencePeriodEndMillis(referenceMillis)
+ .setReferencePeriodEndMillis(referenceInstant.toEpochMilli())
.build()
)
- val twoMinutesThreeSecondAfter = referenceMillis + 2.minutes + 3.seconds
+ val twoMinutesThreeSecondAfter =
+ Instant.ofEpochMilli(referenceInstant.toEpochMilli() + 2.minutes + 3.seconds)
assertThat(
text.getTextAt(getResource(), twoMinutesThreeSecondAfter).toString()
).isEqualTo("02:03 after lunch")
@@ -78,10 +79,10 @@
@Test
public fun timeDifferenceText_CountDownTimeReference() {
- val referenceMillis = Instant.parse("2020-12-30T10:15:30.001Z").toEpochMilli()
+ val referenceInstant = Instant.parse("2020-12-30T10:15:30.001Z")
val text = TimeDifferenceComplicationText.Builder(
TimeDifferenceStyle.STOPWATCH,
- CountDownTimeReference(referenceMillis)
+ CountDownTimeReference(referenceInstant)
)
.setText("^1 before lunch")
.setDisplayAsNow(false)
@@ -95,11 +96,12 @@
.setSurroundingText("^1 before lunch")
.setShowNowText(false)
.setMinimumUnit(TimeUnit.SECONDS)
- .setReferencePeriodStartMillis(referenceMillis)
+ .setReferencePeriodStartMillis(referenceInstant.toEpochMilli())
.build()
)
- val twoMinutesThreeSecondBefore = referenceMillis - 2.minutes - 3.seconds
+ val twoMinutesThreeSecondBefore =
+ Instant.ofEpochMilli(referenceInstant.toEpochMilli() - 2.minutes - 3.seconds)
assertThat(
text.getTextAt(getResource(), twoMinutesThreeSecondBefore).toString()
).isEqualTo("02:03 before lunch")
@@ -134,26 +136,34 @@
val wireText = WireComplicationText.plainText("abc")
val text = wireText.toApiComplicationText()
- assertThat(text.getTextAt(getResource(), 0)).isEqualTo("abc")
- assertThat(text.getNextChangeTime(0)).isEqualTo(Long.MAX_VALUE)
+ assertThat(text.getTextAt(getResource(), Instant.EPOCH))
+ .isEqualTo("abc")
+ assertThat(text.getNextChangeTime(Instant.EPOCH))
+ .isEqualTo(Instant.ofEpochMilli(Long.MAX_VALUE))
assertThat(text.isAlwaysEmpty()).isFalse()
- assertThat(text.returnsSameText(0, Long.MAX_VALUE)).isTrue()
+ assertThat(
+ text.returnsSameText(
+ Instant.EPOCH,
+ Instant.ofEpochMilli(Long.MAX_VALUE)
+ )
+ ).isTrue()
}
@Test
public fun timeDifferenceText() {
- val startPointMillis = Instant.parse("2020-12-30T10:15:30.001Z").toEpochMilli()
+ val startPoint = Instant.parse("2020-12-30T10:15:30.001Z")
val wireText = WireTimeDifferenceBuilder()
.setStyle(WireComplicationText.DIFFERENCE_STYLE_STOPWATCH)
.setSurroundingText("^1 before lunch")
.setShowNowText(false)
.setMinimumUnit(TimeUnit.SECONDS)
- .setReferencePeriodEndMillis(startPointMillis)
+ .setReferencePeriodEndMillis(startPoint.toEpochMilli())
.build()
val text = wireText.toApiComplicationText()
- val twoMinutesThreeSecondAfter = startPointMillis + 2.minutes + 3.seconds
+ val twoMinutesThreeSecondAfter =
+ Instant.ofEpochMilli(startPoint.toEpochMilli() + 2.minutes + 3.seconds)
assertThat(
text.getTextAt(
getResource(),
@@ -161,14 +171,16 @@
).toString()
).isEqualTo("02:03 before lunch")
assertThat(text.getNextChangeTime(twoMinutesThreeSecondAfter))
- .isEqualTo(twoMinutesThreeSecondAfter + 1.seconds)
+ .isEqualTo(
+ Instant.ofEpochMilli(twoMinutesThreeSecondAfter.toEpochMilli() + 1.seconds)
+ )
assertThat(text.isAlwaysEmpty()).isFalse()
- assertThat(text.returnsSameText(twoMinutesThreeSecondAfter, startPointMillis)).isFalse()
+ assertThat(text.returnsSameText(twoMinutesThreeSecondAfter, startPoint)).isFalse()
}
@Test
public fun timeFormatText() {
- val dateTimeMillis = Instant.parse("2020-12-30T10:15:20.00Z").toEpochMilli()
+ val dateTime = Instant.parse("2020-12-30T10:15:20.00Z")
val wireText = WireTimeFormatBuilder()
.setFormat("h:m")
.setStyle(WireComplicationText.FORMAT_STYLE_UPPER_CASE)
@@ -178,23 +190,33 @@
val text = wireText.toApiComplicationText()
- assertThat(text.getTextAt(getResource(), dateTimeMillis).toString())
+ assertThat(text.getTextAt(getResource(), dateTime).toString())
.isEqualTo("10:15 in London")
- assertThat(text.getNextChangeTime(dateTimeMillis))
- .isEqualTo(dateTimeMillis + 40.seconds)
+ assertThat(text.getNextChangeTime(dateTime))
+ .isEqualTo(Instant.ofEpochMilli(dateTime.toEpochMilli() + 40.seconds))
assertThat(text.isAlwaysEmpty()).isFalse()
- assertThat(text.returnsSameText(dateTimeMillis, dateTimeMillis + 20.seconds)).isTrue()
- assertThat(text.returnsSameText(dateTimeMillis, dateTimeMillis + 60.seconds)).isFalse()
+ assertThat(
+ text.returnsSameText(
+ dateTime,
+ Instant.ofEpochMilli(dateTime.toEpochMilli() + 20.seconds)
+ )
+ ).isTrue()
+ assertThat(
+ text.returnsSameText(
+ dateTime,
+ Instant.ofEpochMilli(dateTime.toEpochMilli() + 60.seconds)
+ )
+ ).isFalse()
}
@Test
public fun testGetMinimumTimeUnit_WithValidTimeDependentTextObject() {
val minimumTimeUnit = TimeUnit.SECONDS
- val referenceMillis = Instant.parse("2020-12-30T10:15:30.001Z").toEpochMilli()
+ val referenceInstant = Instant.parse("2020-12-30T10:15:30.001Z")
val text = TimeDifferenceComplicationText.Builder(
TimeDifferenceStyle.STOPWATCH,
- CountUpTimeReference(referenceMillis)
+ CountUpTimeReference(referenceInstant)
)
.setMinimumTimeUnit(minimumTimeUnit)
.build()
@@ -204,12 +226,11 @@
@Test
public fun testGetMinimumTimeUnit_WithoutTimeDependentTextObject() {
- val referenceMillis = Instant.parse("2020-12-30T10:15:30.001Z").toEpochMilli()
+ val referenceInstant = Instant.parse("2020-12-30T10:15:30.001Z")
val text = TimeDifferenceComplicationText.Builder(
TimeDifferenceStyle.STOPWATCH,
- CountUpTimeReference(referenceMillis)
- )
- .build()
+ CountUpTimeReference(referenceInstant)
+ ).build()
assertNull(text.getMinimumTimeUnit())
}
diff --git a/wear/wear-complications-data/src/test/java/androidx/wear/complications/data/TimeRangeTest.kt b/wear/wear-complications-data/src/test/java/androidx/wear/complications/data/TimeRangeTest.kt
index 4c002ef..bd966c8 100644
--- a/wear/wear-complications-data/src/test/java/androidx/wear/complications/data/TimeRangeTest.kt
+++ b/wear/wear-complications-data/src/test/java/androidx/wear/complications/data/TimeRangeTest.kt
@@ -20,54 +20,58 @@
import com.google.common.truth.Truth.assertThat
import org.junit.Test
import org.junit.runner.RunWith
+import java.time.Instant
@RunWith(SharedRobolectricTestRunner::class)
public class TimeRangeTest {
@Test
public fun beforeGivenTime() {
- val range = TimeRange.before(1000)
- assertThat(range.contains(100)).isTrue()
- assertThat(range.contains(999)).isTrue()
- assertThat(range.contains(1000)).isTrue()
- assertThat(range.contains(1001)).isFalse()
- assertThat(range.contains(10000)).isFalse()
+ val range = TimeRange.before(Instant.ofEpochMilli(1000))
+ assertThat(range.contains(Instant.ofEpochMilli(100))).isTrue()
+ assertThat(range.contains(Instant.ofEpochMilli(999))).isTrue()
+ assertThat(range.contains(Instant.ofEpochMilli(1000))).isTrue()
+ assertThat(range.contains(Instant.ofEpochMilli(1001))).isFalse()
+ assertThat(range.contains(Instant.ofEpochMilli(10000))).isFalse()
}
@Test
public fun afterGivenTime() {
- val range = TimeRange.after(1000)
- assertThat(range.contains(100)).isFalse()
- assertThat(range.contains(999)).isFalse()
- assertThat(range.contains(1000)).isTrue()
- assertThat(range.contains(1001)).isTrue()
- assertThat(range.contains(10000)).isTrue()
+ val range = TimeRange.after(Instant.ofEpochMilli(1000))
+ assertThat(range.contains(Instant.ofEpochMilli(100))).isFalse()
+ assertThat(range.contains(Instant.ofEpochMilli(999))).isFalse()
+ assertThat(range.contains(Instant.ofEpochMilli(1000))).isTrue()
+ assertThat(range.contains(Instant.ofEpochMilli(1001))).isTrue()
+ assertThat(range.contains(Instant.ofEpochMilli(10000))).isTrue()
}
@Test
public fun betweenTwoTimes() {
- val range = TimeRange.between(1000, 2000)
- assertThat(range.contains(100)).isFalse()
- assertThat(range.contains(999)).isFalse()
- assertThat(range.contains(1000)).isTrue()
- assertThat(range.contains(1001)).isTrue()
- assertThat(range.contains(1999)).isTrue()
- assertThat(range.contains(2000)).isTrue()
- assertThat(range.contains(2001)).isFalse()
- assertThat(range.contains(10000)).isFalse()
+ val range = TimeRange.between(
+ Instant.ofEpochMilli(1000),
+ Instant.ofEpochMilli(2000)
+ )
+ assertThat(range.contains(Instant.ofEpochMilli(100))).isFalse()
+ assertThat(range.contains(Instant.ofEpochMilli(999))).isFalse()
+ assertThat(range.contains(Instant.ofEpochMilli(1000))).isTrue()
+ assertThat(range.contains(Instant.ofEpochMilli(1001))).isTrue()
+ assertThat(range.contains(Instant.ofEpochMilli(1999))).isTrue()
+ assertThat(range.contains(Instant.ofEpochMilli(2000))).isTrue()
+ assertThat(range.contains(Instant.ofEpochMilli(2001))).isFalse()
+ assertThat(range.contains(Instant.ofEpochMilli(10000))).isFalse()
}
@Test
public fun always() {
var range = TimeRange.ALWAYS
- assertThat(range.contains(0)).isTrue()
- assertThat(range.contains(100)).isTrue()
- assertThat(range.contains(999)).isTrue()
- assertThat(range.contains(1000)).isTrue()
- assertThat(range.contains(1001)).isTrue()
- assertThat(range.contains(1999)).isTrue()
- assertThat(range.contains(2000)).isTrue()
- assertThat(range.contains(2001)).isTrue()
- assertThat(range.contains(10000)).isTrue()
- assertThat(range.contains(Long.MAX_VALUE)).isTrue()
+ assertThat(range.contains(Instant.EPOCH)).isTrue()
+ assertThat(range.contains(Instant.ofEpochMilli(100))).isTrue()
+ assertThat(range.contains(Instant.ofEpochMilli(999))).isTrue()
+ assertThat(range.contains(Instant.ofEpochMilli(1000))).isTrue()
+ assertThat(range.contains(Instant.ofEpochMilli(1001))).isTrue()
+ assertThat(range.contains(Instant.ofEpochMilli(1999))).isTrue()
+ assertThat(range.contains(Instant.ofEpochMilli(2000))).isTrue()
+ assertThat(range.contains(Instant.ofEpochMilli(2001))).isTrue()
+ assertThat(range.contains(Instant.ofEpochMilli(10000))).isTrue()
+ assertThat(range.contains(Instant.ofEpochMilli(Long.MAX_VALUE))).isTrue()
}
}
\ No newline at end of file
diff --git a/wear/wear-phone-interactions/api/1.0.0-beta02.txt b/wear/wear-phone-interactions/api/1.0.0-beta02.txt
new file mode 100644
index 0000000..bff73eca
--- /dev/null
+++ b/wear/wear-phone-interactions/api/1.0.0-beta02.txt
@@ -0,0 +1,146 @@
+// Signature format: 4.0
+package androidx.wear.phone.interactions {
+
+ public final class PhoneTypeHelper {
+ method public static int getPhoneDeviceType(android.content.Context context);
+ field public static final androidx.wear.phone.interactions.PhoneTypeHelper.Companion Companion;
+ field public static final int DEVICE_TYPE_ANDROID = 1; // 0x1
+ field public static final int DEVICE_TYPE_ERROR = 0; // 0x0
+ field public static final int DEVICE_TYPE_IOS = 2; // 0x2
+ field public static final int DEVICE_TYPE_UNKNOWN = 3; // 0x3
+ }
+
+ public static final class PhoneTypeHelper.Companion {
+ method public int getPhoneDeviceType(android.content.Context context);
+ }
+
+}
+
+package androidx.wear.phone.interactions.authentication {
+
+ @RequiresApi(android.os.Build.VERSION_CODES.O) public final class CodeChallenge {
+ ctor public CodeChallenge(androidx.wear.phone.interactions.authentication.CodeVerifier codeVerifier);
+ method public String getValue();
+ property public final String value;
+ }
+
+ @RequiresApi(android.os.Build.VERSION_CODES.O) public final class CodeVerifier {
+ ctor public CodeVerifier(optional int byteLength);
+ ctor public CodeVerifier(String value);
+ method public String getValue();
+ property public final String value;
+ }
+
+ public final class OAuthRequest {
+ method public String getPackageName();
+ method public android.net.Uri getRequestUrl();
+ property public final String packageName;
+ property public final android.net.Uri requestUrl;
+ field public static final androidx.wear.phone.interactions.authentication.OAuthRequest.Companion Companion;
+ field public static final String WEAR_REDIRECT_URL_PREFIX = "https://wear.googleapis.com/3p_auth/";
+ field public static final String WEAR_REDIRECT_URL_PREFIX_CN = "https://wear.googleapis-cn.com/3p_auth/";
+ }
+
+ public static final class OAuthRequest.Builder {
+ ctor public OAuthRequest.Builder(android.content.Context context);
+ method @RequiresApi(android.os.Build.VERSION_CODES.O) public androidx.wear.phone.interactions.authentication.OAuthRequest build();
+ method public androidx.wear.phone.interactions.authentication.OAuthRequest.Builder setAuthProviderUrl(android.net.Uri authProviderUrl);
+ method public androidx.wear.phone.interactions.authentication.OAuthRequest.Builder setClientId(String clientId);
+ method public androidx.wear.phone.interactions.authentication.OAuthRequest.Builder setCodeChallenge(androidx.wear.phone.interactions.authentication.CodeChallenge codeChallenge);
+ method public androidx.wear.phone.interactions.authentication.OAuthRequest.Builder setRedirectUrl(android.net.Uri redirectUrl);
+ }
+
+ public static final class OAuthRequest.Companion {
+ }
+
+ public final class OAuthResponse {
+ method public int getErrorCode();
+ method public android.net.Uri? getResponseUrl();
+ property public final int errorCode;
+ property public final android.net.Uri? responseUrl;
+ }
+
+ public static final class OAuthResponse.Builder {
+ ctor public OAuthResponse.Builder();
+ method public androidx.wear.phone.interactions.authentication.OAuthResponse build();
+ method public androidx.wear.phone.interactions.authentication.OAuthResponse.Builder setErrorCode(int errorCode);
+ method public androidx.wear.phone.interactions.authentication.OAuthResponse.Builder setResponseUrl(android.net.Uri responseUrl);
+ }
+
+ public final class RemoteAuthClient implements java.lang.AutoCloseable {
+ method @UiThread public void close();
+ method public static androidx.wear.phone.interactions.authentication.RemoteAuthClient create(android.content.Context context);
+ method protected void finalize();
+ method @UiThread public void sendAuthorizationRequest(androidx.wear.phone.interactions.authentication.OAuthRequest request, java.util.concurrent.Executor executor, androidx.wear.phone.interactions.authentication.RemoteAuthClient.Callback clientCallback);
+ field public static final androidx.wear.phone.interactions.authentication.RemoteAuthClient.Companion Companion;
+ field public static final int ERROR_PHONE_UNAVAILABLE = 1; // 0x1
+ field public static final int ERROR_UNSUPPORTED = 0; // 0x0
+ field public static final int NO_ERROR = -1; // 0xffffffff
+ }
+
+ public abstract static class RemoteAuthClient.Callback {
+ ctor public RemoteAuthClient.Callback();
+ method @UiThread public abstract void onAuthorizationError(androidx.wear.phone.interactions.authentication.OAuthRequest request, int errorCode);
+ method @UiThread public abstract void onAuthorizationResponse(androidx.wear.phone.interactions.authentication.OAuthRequest request, androidx.wear.phone.interactions.authentication.OAuthResponse response);
+ }
+
+ public static final class RemoteAuthClient.Companion {
+ method public androidx.wear.phone.interactions.authentication.RemoteAuthClient create(android.content.Context context);
+ }
+
+ public interface RemoteAuthRequestHandler {
+ method public boolean isAuthSupported();
+ method public void sendAuthRequest(androidx.wear.phone.interactions.authentication.OAuthRequest request, kotlin.Pair<java.lang.String,java.lang.Integer> packageNameAndRequestId);
+ }
+
+ public abstract class RemoteAuthService extends android.app.Service {
+ ctor public RemoteAuthService();
+ method protected final android.os.IBinder onBind(android.content.Intent intent, androidx.wear.phone.interactions.authentication.RemoteAuthRequestHandler remoteAuthRequestHandler);
+ method public static final void sendResponseToCallback(androidx.wear.phone.interactions.authentication.OAuthResponse response, kotlin.Pair<java.lang.String,java.lang.Integer> packageNameAndRequestId);
+ method protected boolean verifyPackageName(android.content.Context context, String? requestPackageName);
+ field public static final androidx.wear.phone.interactions.authentication.RemoteAuthService.Companion Companion;
+ }
+
+ public static final class RemoteAuthService.Companion {
+ method public void sendResponseToCallback(androidx.wear.phone.interactions.authentication.OAuthResponse response, kotlin.Pair<java.lang.String,java.lang.Integer> packageNameAndRequestId);
+ }
+
+}
+
+package androidx.wear.phone.interactions.notifications {
+
+ public final class BridgingConfig {
+ method public java.util.Set<java.lang.String>? getExcludedTags();
+ method public boolean isBridgingEnabled();
+ property public final java.util.Set<java.lang.String>? excludedTags;
+ property public final boolean isBridgingEnabled;
+ }
+
+ public static final class BridgingConfig.Builder {
+ ctor public BridgingConfig.Builder(android.content.Context context, boolean isBridgingEnabled);
+ method public androidx.wear.phone.interactions.notifications.BridgingConfig.Builder addExcludedTag(String tag);
+ method public androidx.wear.phone.interactions.notifications.BridgingConfig.Builder addExcludedTags(java.util.Collection<java.lang.String> tags);
+ method public androidx.wear.phone.interactions.notifications.BridgingConfig build();
+ }
+
+ public fun interface BridgingConfigurationHandler {
+ method public void applyBridgingConfiguration(androidx.wear.phone.interactions.notifications.BridgingConfig bridgingConfig);
+ }
+
+ public final class BridgingManager {
+ method public static androidx.wear.phone.interactions.notifications.BridgingManager fromContext(android.content.Context context);
+ method public void setConfig(androidx.wear.phone.interactions.notifications.BridgingConfig bridgingConfig);
+ field public static final androidx.wear.phone.interactions.notifications.BridgingManager.Companion Companion;
+ }
+
+ public static final class BridgingManager.Companion {
+ method public androidx.wear.phone.interactions.notifications.BridgingManager fromContext(android.content.Context context);
+ }
+
+ public final class BridgingManagerService extends android.app.Service {
+ ctor public BridgingManagerService(android.content.Context context, androidx.wear.phone.interactions.notifications.BridgingConfigurationHandler bridgingConfigurationHandler);
+ method public android.os.IBinder? onBind(android.content.Intent? intent);
+ }
+
+}
+
diff --git a/wear/wear-phone-interactions/api/public_plus_experimental_1.0.0-beta02.txt b/wear/wear-phone-interactions/api/public_plus_experimental_1.0.0-beta02.txt
new file mode 100644
index 0000000..bff73eca
--- /dev/null
+++ b/wear/wear-phone-interactions/api/public_plus_experimental_1.0.0-beta02.txt
@@ -0,0 +1,146 @@
+// Signature format: 4.0
+package androidx.wear.phone.interactions {
+
+ public final class PhoneTypeHelper {
+ method public static int getPhoneDeviceType(android.content.Context context);
+ field public static final androidx.wear.phone.interactions.PhoneTypeHelper.Companion Companion;
+ field public static final int DEVICE_TYPE_ANDROID = 1; // 0x1
+ field public static final int DEVICE_TYPE_ERROR = 0; // 0x0
+ field public static final int DEVICE_TYPE_IOS = 2; // 0x2
+ field public static final int DEVICE_TYPE_UNKNOWN = 3; // 0x3
+ }
+
+ public static final class PhoneTypeHelper.Companion {
+ method public int getPhoneDeviceType(android.content.Context context);
+ }
+
+}
+
+package androidx.wear.phone.interactions.authentication {
+
+ @RequiresApi(android.os.Build.VERSION_CODES.O) public final class CodeChallenge {
+ ctor public CodeChallenge(androidx.wear.phone.interactions.authentication.CodeVerifier codeVerifier);
+ method public String getValue();
+ property public final String value;
+ }
+
+ @RequiresApi(android.os.Build.VERSION_CODES.O) public final class CodeVerifier {
+ ctor public CodeVerifier(optional int byteLength);
+ ctor public CodeVerifier(String value);
+ method public String getValue();
+ property public final String value;
+ }
+
+ public final class OAuthRequest {
+ method public String getPackageName();
+ method public android.net.Uri getRequestUrl();
+ property public final String packageName;
+ property public final android.net.Uri requestUrl;
+ field public static final androidx.wear.phone.interactions.authentication.OAuthRequest.Companion Companion;
+ field public static final String WEAR_REDIRECT_URL_PREFIX = "https://wear.googleapis.com/3p_auth/";
+ field public static final String WEAR_REDIRECT_URL_PREFIX_CN = "https://wear.googleapis-cn.com/3p_auth/";
+ }
+
+ public static final class OAuthRequest.Builder {
+ ctor public OAuthRequest.Builder(android.content.Context context);
+ method @RequiresApi(android.os.Build.VERSION_CODES.O) public androidx.wear.phone.interactions.authentication.OAuthRequest build();
+ method public androidx.wear.phone.interactions.authentication.OAuthRequest.Builder setAuthProviderUrl(android.net.Uri authProviderUrl);
+ method public androidx.wear.phone.interactions.authentication.OAuthRequest.Builder setClientId(String clientId);
+ method public androidx.wear.phone.interactions.authentication.OAuthRequest.Builder setCodeChallenge(androidx.wear.phone.interactions.authentication.CodeChallenge codeChallenge);
+ method public androidx.wear.phone.interactions.authentication.OAuthRequest.Builder setRedirectUrl(android.net.Uri redirectUrl);
+ }
+
+ public static final class OAuthRequest.Companion {
+ }
+
+ public final class OAuthResponse {
+ method public int getErrorCode();
+ method public android.net.Uri? getResponseUrl();
+ property public final int errorCode;
+ property public final android.net.Uri? responseUrl;
+ }
+
+ public static final class OAuthResponse.Builder {
+ ctor public OAuthResponse.Builder();
+ method public androidx.wear.phone.interactions.authentication.OAuthResponse build();
+ method public androidx.wear.phone.interactions.authentication.OAuthResponse.Builder setErrorCode(int errorCode);
+ method public androidx.wear.phone.interactions.authentication.OAuthResponse.Builder setResponseUrl(android.net.Uri responseUrl);
+ }
+
+ public final class RemoteAuthClient implements java.lang.AutoCloseable {
+ method @UiThread public void close();
+ method public static androidx.wear.phone.interactions.authentication.RemoteAuthClient create(android.content.Context context);
+ method protected void finalize();
+ method @UiThread public void sendAuthorizationRequest(androidx.wear.phone.interactions.authentication.OAuthRequest request, java.util.concurrent.Executor executor, androidx.wear.phone.interactions.authentication.RemoteAuthClient.Callback clientCallback);
+ field public static final androidx.wear.phone.interactions.authentication.RemoteAuthClient.Companion Companion;
+ field public static final int ERROR_PHONE_UNAVAILABLE = 1; // 0x1
+ field public static final int ERROR_UNSUPPORTED = 0; // 0x0
+ field public static final int NO_ERROR = -1; // 0xffffffff
+ }
+
+ public abstract static class RemoteAuthClient.Callback {
+ ctor public RemoteAuthClient.Callback();
+ method @UiThread public abstract void onAuthorizationError(androidx.wear.phone.interactions.authentication.OAuthRequest request, int errorCode);
+ method @UiThread public abstract void onAuthorizationResponse(androidx.wear.phone.interactions.authentication.OAuthRequest request, androidx.wear.phone.interactions.authentication.OAuthResponse response);
+ }
+
+ public static final class RemoteAuthClient.Companion {
+ method public androidx.wear.phone.interactions.authentication.RemoteAuthClient create(android.content.Context context);
+ }
+
+ public interface RemoteAuthRequestHandler {
+ method public boolean isAuthSupported();
+ method public void sendAuthRequest(androidx.wear.phone.interactions.authentication.OAuthRequest request, kotlin.Pair<java.lang.String,java.lang.Integer> packageNameAndRequestId);
+ }
+
+ public abstract class RemoteAuthService extends android.app.Service {
+ ctor public RemoteAuthService();
+ method protected final android.os.IBinder onBind(android.content.Intent intent, androidx.wear.phone.interactions.authentication.RemoteAuthRequestHandler remoteAuthRequestHandler);
+ method public static final void sendResponseToCallback(androidx.wear.phone.interactions.authentication.OAuthResponse response, kotlin.Pair<java.lang.String,java.lang.Integer> packageNameAndRequestId);
+ method protected boolean verifyPackageName(android.content.Context context, String? requestPackageName);
+ field public static final androidx.wear.phone.interactions.authentication.RemoteAuthService.Companion Companion;
+ }
+
+ public static final class RemoteAuthService.Companion {
+ method public void sendResponseToCallback(androidx.wear.phone.interactions.authentication.OAuthResponse response, kotlin.Pair<java.lang.String,java.lang.Integer> packageNameAndRequestId);
+ }
+
+}
+
+package androidx.wear.phone.interactions.notifications {
+
+ public final class BridgingConfig {
+ method public java.util.Set<java.lang.String>? getExcludedTags();
+ method public boolean isBridgingEnabled();
+ property public final java.util.Set<java.lang.String>? excludedTags;
+ property public final boolean isBridgingEnabled;
+ }
+
+ public static final class BridgingConfig.Builder {
+ ctor public BridgingConfig.Builder(android.content.Context context, boolean isBridgingEnabled);
+ method public androidx.wear.phone.interactions.notifications.BridgingConfig.Builder addExcludedTag(String tag);
+ method public androidx.wear.phone.interactions.notifications.BridgingConfig.Builder addExcludedTags(java.util.Collection<java.lang.String> tags);
+ method public androidx.wear.phone.interactions.notifications.BridgingConfig build();
+ }
+
+ public fun interface BridgingConfigurationHandler {
+ method public void applyBridgingConfiguration(androidx.wear.phone.interactions.notifications.BridgingConfig bridgingConfig);
+ }
+
+ public final class BridgingManager {
+ method public static androidx.wear.phone.interactions.notifications.BridgingManager fromContext(android.content.Context context);
+ method public void setConfig(androidx.wear.phone.interactions.notifications.BridgingConfig bridgingConfig);
+ field public static final androidx.wear.phone.interactions.notifications.BridgingManager.Companion Companion;
+ }
+
+ public static final class BridgingManager.Companion {
+ method public androidx.wear.phone.interactions.notifications.BridgingManager fromContext(android.content.Context context);
+ }
+
+ public final class BridgingManagerService extends android.app.Service {
+ ctor public BridgingManagerService(android.content.Context context, androidx.wear.phone.interactions.notifications.BridgingConfigurationHandler bridgingConfigurationHandler);
+ method public android.os.IBinder? onBind(android.content.Intent? intent);
+ }
+
+}
+
diff --git a/work/workmanager-ktx/api/res-1.0.0-beta02.txt b/wear/wear-phone-interactions/api/res-1.0.0-beta02.txt
similarity index 100%
copy from work/workmanager-ktx/api/res-1.0.0-beta02.txt
copy to wear/wear-phone-interactions/api/res-1.0.0-beta02.txt
diff --git a/wear/wear-phone-interactions/api/restricted_1.0.0-beta02.txt b/wear/wear-phone-interactions/api/restricted_1.0.0-beta02.txt
new file mode 100644
index 0000000..bff73eca
--- /dev/null
+++ b/wear/wear-phone-interactions/api/restricted_1.0.0-beta02.txt
@@ -0,0 +1,146 @@
+// Signature format: 4.0
+package androidx.wear.phone.interactions {
+
+ public final class PhoneTypeHelper {
+ method public static int getPhoneDeviceType(android.content.Context context);
+ field public static final androidx.wear.phone.interactions.PhoneTypeHelper.Companion Companion;
+ field public static final int DEVICE_TYPE_ANDROID = 1; // 0x1
+ field public static final int DEVICE_TYPE_ERROR = 0; // 0x0
+ field public static final int DEVICE_TYPE_IOS = 2; // 0x2
+ field public static final int DEVICE_TYPE_UNKNOWN = 3; // 0x3
+ }
+
+ public static final class PhoneTypeHelper.Companion {
+ method public int getPhoneDeviceType(android.content.Context context);
+ }
+
+}
+
+package androidx.wear.phone.interactions.authentication {
+
+ @RequiresApi(android.os.Build.VERSION_CODES.O) public final class CodeChallenge {
+ ctor public CodeChallenge(androidx.wear.phone.interactions.authentication.CodeVerifier codeVerifier);
+ method public String getValue();
+ property public final String value;
+ }
+
+ @RequiresApi(android.os.Build.VERSION_CODES.O) public final class CodeVerifier {
+ ctor public CodeVerifier(optional int byteLength);
+ ctor public CodeVerifier(String value);
+ method public String getValue();
+ property public final String value;
+ }
+
+ public final class OAuthRequest {
+ method public String getPackageName();
+ method public android.net.Uri getRequestUrl();
+ property public final String packageName;
+ property public final android.net.Uri requestUrl;
+ field public static final androidx.wear.phone.interactions.authentication.OAuthRequest.Companion Companion;
+ field public static final String WEAR_REDIRECT_URL_PREFIX = "https://wear.googleapis.com/3p_auth/";
+ field public static final String WEAR_REDIRECT_URL_PREFIX_CN = "https://wear.googleapis-cn.com/3p_auth/";
+ }
+
+ public static final class OAuthRequest.Builder {
+ ctor public OAuthRequest.Builder(android.content.Context context);
+ method @RequiresApi(android.os.Build.VERSION_CODES.O) public androidx.wear.phone.interactions.authentication.OAuthRequest build();
+ method public androidx.wear.phone.interactions.authentication.OAuthRequest.Builder setAuthProviderUrl(android.net.Uri authProviderUrl);
+ method public androidx.wear.phone.interactions.authentication.OAuthRequest.Builder setClientId(String clientId);
+ method public androidx.wear.phone.interactions.authentication.OAuthRequest.Builder setCodeChallenge(androidx.wear.phone.interactions.authentication.CodeChallenge codeChallenge);
+ method public androidx.wear.phone.interactions.authentication.OAuthRequest.Builder setRedirectUrl(android.net.Uri redirectUrl);
+ }
+
+ public static final class OAuthRequest.Companion {
+ }
+
+ public final class OAuthResponse {
+ method public int getErrorCode();
+ method public android.net.Uri? getResponseUrl();
+ property public final int errorCode;
+ property public final android.net.Uri? responseUrl;
+ }
+
+ public static final class OAuthResponse.Builder {
+ ctor public OAuthResponse.Builder();
+ method public androidx.wear.phone.interactions.authentication.OAuthResponse build();
+ method public androidx.wear.phone.interactions.authentication.OAuthResponse.Builder setErrorCode(int errorCode);
+ method public androidx.wear.phone.interactions.authentication.OAuthResponse.Builder setResponseUrl(android.net.Uri responseUrl);
+ }
+
+ public final class RemoteAuthClient implements java.lang.AutoCloseable {
+ method @UiThread public void close();
+ method public static androidx.wear.phone.interactions.authentication.RemoteAuthClient create(android.content.Context context);
+ method protected void finalize();
+ method @UiThread public void sendAuthorizationRequest(androidx.wear.phone.interactions.authentication.OAuthRequest request, java.util.concurrent.Executor executor, androidx.wear.phone.interactions.authentication.RemoteAuthClient.Callback clientCallback);
+ field public static final androidx.wear.phone.interactions.authentication.RemoteAuthClient.Companion Companion;
+ field public static final int ERROR_PHONE_UNAVAILABLE = 1; // 0x1
+ field public static final int ERROR_UNSUPPORTED = 0; // 0x0
+ field public static final int NO_ERROR = -1; // 0xffffffff
+ }
+
+ public abstract static class RemoteAuthClient.Callback {
+ ctor public RemoteAuthClient.Callback();
+ method @UiThread public abstract void onAuthorizationError(androidx.wear.phone.interactions.authentication.OAuthRequest request, int errorCode);
+ method @UiThread public abstract void onAuthorizationResponse(androidx.wear.phone.interactions.authentication.OAuthRequest request, androidx.wear.phone.interactions.authentication.OAuthResponse response);
+ }
+
+ public static final class RemoteAuthClient.Companion {
+ method public androidx.wear.phone.interactions.authentication.RemoteAuthClient create(android.content.Context context);
+ }
+
+ public interface RemoteAuthRequestHandler {
+ method public boolean isAuthSupported();
+ method public void sendAuthRequest(androidx.wear.phone.interactions.authentication.OAuthRequest request, kotlin.Pair<java.lang.String,java.lang.Integer> packageNameAndRequestId);
+ }
+
+ public abstract class RemoteAuthService extends android.app.Service {
+ ctor public RemoteAuthService();
+ method protected final android.os.IBinder onBind(android.content.Intent intent, androidx.wear.phone.interactions.authentication.RemoteAuthRequestHandler remoteAuthRequestHandler);
+ method public static final void sendResponseToCallback(androidx.wear.phone.interactions.authentication.OAuthResponse response, kotlin.Pair<java.lang.String,java.lang.Integer> packageNameAndRequestId);
+ method protected boolean verifyPackageName(android.content.Context context, String? requestPackageName);
+ field public static final androidx.wear.phone.interactions.authentication.RemoteAuthService.Companion Companion;
+ }
+
+ public static final class RemoteAuthService.Companion {
+ method public void sendResponseToCallback(androidx.wear.phone.interactions.authentication.OAuthResponse response, kotlin.Pair<java.lang.String,java.lang.Integer> packageNameAndRequestId);
+ }
+
+}
+
+package androidx.wear.phone.interactions.notifications {
+
+ public final class BridgingConfig {
+ method public java.util.Set<java.lang.String>? getExcludedTags();
+ method public boolean isBridgingEnabled();
+ property public final java.util.Set<java.lang.String>? excludedTags;
+ property public final boolean isBridgingEnabled;
+ }
+
+ public static final class BridgingConfig.Builder {
+ ctor public BridgingConfig.Builder(android.content.Context context, boolean isBridgingEnabled);
+ method public androidx.wear.phone.interactions.notifications.BridgingConfig.Builder addExcludedTag(String tag);
+ method public androidx.wear.phone.interactions.notifications.BridgingConfig.Builder addExcludedTags(java.util.Collection<java.lang.String> tags);
+ method public androidx.wear.phone.interactions.notifications.BridgingConfig build();
+ }
+
+ public fun interface BridgingConfigurationHandler {
+ method public void applyBridgingConfiguration(androidx.wear.phone.interactions.notifications.BridgingConfig bridgingConfig);
+ }
+
+ public final class BridgingManager {
+ method public static androidx.wear.phone.interactions.notifications.BridgingManager fromContext(android.content.Context context);
+ method public void setConfig(androidx.wear.phone.interactions.notifications.BridgingConfig bridgingConfig);
+ field public static final androidx.wear.phone.interactions.notifications.BridgingManager.Companion Companion;
+ }
+
+ public static final class BridgingManager.Companion {
+ method public androidx.wear.phone.interactions.notifications.BridgingManager fromContext(android.content.Context context);
+ }
+
+ public final class BridgingManagerService extends android.app.Service {
+ ctor public BridgingManagerService(android.content.Context context, androidx.wear.phone.interactions.notifications.BridgingConfigurationHandler bridgingConfigurationHandler);
+ method public android.os.IBinder? onBind(android.content.Intent? intent);
+ }
+
+}
+
diff --git a/wear/wear-remote-interactions/api/1.0.0-beta02.txt b/wear/wear-remote-interactions/api/1.0.0-beta02.txt
new file mode 100644
index 0000000..208fcb7
--- /dev/null
+++ b/wear/wear-remote-interactions/api/1.0.0-beta02.txt
@@ -0,0 +1,41 @@
+// Signature format: 4.0
+package androidx.wear.remote.interactions {
+
+ public final class RemoteActivityHelper {
+ ctor public RemoteActivityHelper(android.content.Context context, optional java.util.concurrent.Executor executor);
+ method public static android.content.Intent? getTargetIntent(android.content.Intent intent);
+ method public static String? getTargetNodeId(android.content.Intent intent);
+ method public com.google.common.util.concurrent.ListenableFuture<java.lang.Void> startRemoteActivity(android.content.Intent targetIntent, optional String? targetNodeId);
+ method public com.google.common.util.concurrent.ListenableFuture<java.lang.Void> startRemoteActivity(android.content.Intent targetIntent);
+ field public static final String ACTION_REMOTE_INTENT = "com.google.android.wearable.intent.action.REMOTE_INTENT";
+ field public static final androidx.wear.remote.interactions.RemoteActivityHelper.Companion Companion;
+ field public static final int RESULT_FAILED = 1; // 0x1
+ field public static final int RESULT_OK = 0; // 0x0
+ }
+
+ public static final class RemoteActivityHelper.Companion {
+ method public android.content.Intent? getTargetIntent(android.content.Intent intent);
+ method public String? getTargetNodeId(android.content.Intent intent);
+ }
+
+ public static final class RemoteActivityHelper.RemoteIntentException extends java.lang.Exception {
+ ctor public RemoteActivityHelper.RemoteIntentException(String message);
+ }
+
+ public final class WatchFaceConfigIntentHelper {
+ method public static String? getPeerIdExtra(android.content.Intent watchFaceIntent);
+ method public static android.content.ComponentName? getWatchFaceComponentExtra(android.content.Intent watchFaceIntent);
+ method public static android.content.Intent putPeerIdExtra(android.content.Intent watchFaceIntent, String peerId);
+ method public static android.content.Intent putWatchFaceComponentExtra(android.content.Intent watchFaceIntent, android.content.ComponentName componentName);
+ field public static final androidx.wear.remote.interactions.WatchFaceConfigIntentHelper.Companion Companion;
+ }
+
+ public static final class WatchFaceConfigIntentHelper.Companion {
+ method public String? getPeerIdExtra(android.content.Intent watchFaceIntent);
+ method public android.content.ComponentName? getWatchFaceComponentExtra(android.content.Intent watchFaceIntent);
+ method public android.content.Intent putPeerIdExtra(android.content.Intent watchFaceIntent, String peerId);
+ method public android.content.Intent putWatchFaceComponentExtra(android.content.Intent watchFaceIntent, android.content.ComponentName componentName);
+ }
+
+}
+
diff --git a/wear/wear-remote-interactions/api/public_plus_experimental_1.0.0-beta02.txt b/wear/wear-remote-interactions/api/public_plus_experimental_1.0.0-beta02.txt
new file mode 100644
index 0000000..208fcb7
--- /dev/null
+++ b/wear/wear-remote-interactions/api/public_plus_experimental_1.0.0-beta02.txt
@@ -0,0 +1,41 @@
+// Signature format: 4.0
+package androidx.wear.remote.interactions {
+
+ public final class RemoteActivityHelper {
+ ctor public RemoteActivityHelper(android.content.Context context, optional java.util.concurrent.Executor executor);
+ method public static android.content.Intent? getTargetIntent(android.content.Intent intent);
+ method public static String? getTargetNodeId(android.content.Intent intent);
+ method public com.google.common.util.concurrent.ListenableFuture<java.lang.Void> startRemoteActivity(android.content.Intent targetIntent, optional String? targetNodeId);
+ method public com.google.common.util.concurrent.ListenableFuture<java.lang.Void> startRemoteActivity(android.content.Intent targetIntent);
+ field public static final String ACTION_REMOTE_INTENT = "com.google.android.wearable.intent.action.REMOTE_INTENT";
+ field public static final androidx.wear.remote.interactions.RemoteActivityHelper.Companion Companion;
+ field public static final int RESULT_FAILED = 1; // 0x1
+ field public static final int RESULT_OK = 0; // 0x0
+ }
+
+ public static final class RemoteActivityHelper.Companion {
+ method public android.content.Intent? getTargetIntent(android.content.Intent intent);
+ method public String? getTargetNodeId(android.content.Intent intent);
+ }
+
+ public static final class RemoteActivityHelper.RemoteIntentException extends java.lang.Exception {
+ ctor public RemoteActivityHelper.RemoteIntentException(String message);
+ }
+
+ public final class WatchFaceConfigIntentHelper {
+ method public static String? getPeerIdExtra(android.content.Intent watchFaceIntent);
+ method public static android.content.ComponentName? getWatchFaceComponentExtra(android.content.Intent watchFaceIntent);
+ method public static android.content.Intent putPeerIdExtra(android.content.Intent watchFaceIntent, String peerId);
+ method public static android.content.Intent putWatchFaceComponentExtra(android.content.Intent watchFaceIntent, android.content.ComponentName componentName);
+ field public static final androidx.wear.remote.interactions.WatchFaceConfigIntentHelper.Companion Companion;
+ }
+
+ public static final class WatchFaceConfigIntentHelper.Companion {
+ method public String? getPeerIdExtra(android.content.Intent watchFaceIntent);
+ method public android.content.ComponentName? getWatchFaceComponentExtra(android.content.Intent watchFaceIntent);
+ method public android.content.Intent putPeerIdExtra(android.content.Intent watchFaceIntent, String peerId);
+ method public android.content.Intent putWatchFaceComponentExtra(android.content.Intent watchFaceIntent, android.content.ComponentName componentName);
+ }
+
+}
+
diff --git a/work/workmanager-ktx/api/res-1.0.0-beta02.txt b/wear/wear-remote-interactions/api/res-1.0.0-beta02.txt
similarity index 100%
copy from work/workmanager-ktx/api/res-1.0.0-beta02.txt
copy to wear/wear-remote-interactions/api/res-1.0.0-beta02.txt
diff --git a/wear/wear-remote-interactions/api/restricted_1.0.0-beta02.txt b/wear/wear-remote-interactions/api/restricted_1.0.0-beta02.txt
new file mode 100644
index 0000000..208fcb7
--- /dev/null
+++ b/wear/wear-remote-interactions/api/restricted_1.0.0-beta02.txt
@@ -0,0 +1,41 @@
+// Signature format: 4.0
+package androidx.wear.remote.interactions {
+
+ public final class RemoteActivityHelper {
+ ctor public RemoteActivityHelper(android.content.Context context, optional java.util.concurrent.Executor executor);
+ method public static android.content.Intent? getTargetIntent(android.content.Intent intent);
+ method public static String? getTargetNodeId(android.content.Intent intent);
+ method public com.google.common.util.concurrent.ListenableFuture<java.lang.Void> startRemoteActivity(android.content.Intent targetIntent, optional String? targetNodeId);
+ method public com.google.common.util.concurrent.ListenableFuture<java.lang.Void> startRemoteActivity(android.content.Intent targetIntent);
+ field public static final String ACTION_REMOTE_INTENT = "com.google.android.wearable.intent.action.REMOTE_INTENT";
+ field public static final androidx.wear.remote.interactions.RemoteActivityHelper.Companion Companion;
+ field public static final int RESULT_FAILED = 1; // 0x1
+ field public static final int RESULT_OK = 0; // 0x0
+ }
+
+ public static final class RemoteActivityHelper.Companion {
+ method public android.content.Intent? getTargetIntent(android.content.Intent intent);
+ method public String? getTargetNodeId(android.content.Intent intent);
+ }
+
+ public static final class RemoteActivityHelper.RemoteIntentException extends java.lang.Exception {
+ ctor public RemoteActivityHelper.RemoteIntentException(String message);
+ }
+
+ public final class WatchFaceConfigIntentHelper {
+ method public static String? getPeerIdExtra(android.content.Intent watchFaceIntent);
+ method public static android.content.ComponentName? getWatchFaceComponentExtra(android.content.Intent watchFaceIntent);
+ method public static android.content.Intent putPeerIdExtra(android.content.Intent watchFaceIntent, String peerId);
+ method public static android.content.Intent putWatchFaceComponentExtra(android.content.Intent watchFaceIntent, android.content.ComponentName componentName);
+ field public static final androidx.wear.remote.interactions.WatchFaceConfigIntentHelper.Companion Companion;
+ }
+
+ public static final class WatchFaceConfigIntentHelper.Companion {
+ method public String? getPeerIdExtra(android.content.Intent watchFaceIntent);
+ method public android.content.ComponentName? getWatchFaceComponentExtra(android.content.Intent watchFaceIntent);
+ method public android.content.Intent putPeerIdExtra(android.content.Intent watchFaceIntent, String peerId);
+ method public android.content.Intent putWatchFaceComponentExtra(android.content.Intent watchFaceIntent, android.content.ComponentName componentName);
+ }
+
+}
+
diff --git a/wear/wear-remote-interactions/src/main/java/androidx/wear/remote/interactions/RemoteActivityHelper.kt b/wear/wear-remote-interactions/src/main/java/androidx/wear/remote/interactions/RemoteActivityHelper.kt
index 4401cdc..ac6f4a1 100644
--- a/wear/wear-remote-interactions/src/main/java/androidx/wear/remote/interactions/RemoteActivityHelper.kt
+++ b/wear/wear-remote-interactions/src/main/java/androidx/wear/remote/interactions/RemoteActivityHelper.kt
@@ -40,9 +40,9 @@
* The following example opens play store for the given app on another device:
*
* ```
- * val remoteIntentHelper = RemoteIntentHelper(context, executor)
+ * val remoteActivityHelper = RemoteActivityHelper(context, executor)
*
- * val result = remoteIntentHelper.startRemoteActivity(
+ * val result = remoteActivityHelper.startRemoteActivity(
* new Intent(Intent.ACTION_VIEW).setData(
* Uri.parse("http://play.google.com/store/apps/details?id=com.example.myapp")
* ),
diff --git a/wear/wear-watchface-client-guava/build.gradle b/wear/wear-watchface-client-guava/build.gradle
index 8d7f45f..88de01c 100644
--- a/wear/wear-watchface-client-guava/build.gradle
+++ b/wear/wear-watchface-client-guava/build.gradle
@@ -59,6 +59,6 @@
android {
defaultConfig {
- minSdkVersion 25
+ minSdkVersion 26
}
}
diff --git a/wear/wear-watchface-client/api/current.txt b/wear/wear-watchface-client/api/current.txt
index b220099..7162aea 100644
--- a/wear/wear-watchface-client/api/current.txt
+++ b/wear/wear-watchface-client/api/current.txt
@@ -78,15 +78,15 @@
method @AnyThread public void addClientDisconnectListener(androidx.wear.watchface.client.HeadlessWatchFaceClient.ClientDisconnectListener listener, java.util.concurrent.Executor executor);
method public default static androidx.wear.watchface.client.HeadlessWatchFaceClient createFromBundle(android.os.Bundle bundle);
method @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public java.util.Map<java.lang.Integer,androidx.wear.watchface.client.ComplicationSlotState> getComplicationSlotsState();
- method @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public long getPreviewReferenceTimeMillis();
+ method @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public java.time.Instant getPreviewReferenceInstant();
method @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public androidx.wear.watchface.style.UserStyleSchema getUserStyleSchema();
method @AnyThread public boolean isConnectionAlive();
method @AnyThread public void removeClientDisconnectListener(androidx.wear.watchface.client.HeadlessWatchFaceClient.ClientDisconnectListener listener);
- method @RequiresApi(27) @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public android.graphics.Bitmap? renderComplicationToBitmap(int complicationSlotId, androidx.wear.watchface.RenderParameters renderParameters, long calendarTimeMillis, androidx.wear.complications.data.ComplicationData complicationData, androidx.wear.watchface.style.UserStyle? userStyle) throws android.os.RemoteException;
- method @RequiresApi(27) @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public android.graphics.Bitmap renderWatchFaceToBitmap(androidx.wear.watchface.RenderParameters renderParameters, long calendarTimeMillis, androidx.wear.watchface.style.UserStyle? userStyle, java.util.Map<java.lang.Integer,? extends androidx.wear.complications.data.ComplicationData>? slotIdToComplicationData) throws android.os.RemoteException;
+ method @RequiresApi(27) @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public android.graphics.Bitmap? renderComplicationToBitmap(int complicationSlotId, androidx.wear.watchface.RenderParameters renderParameters, java.time.Instant instant, androidx.wear.complications.data.ComplicationData complicationData, androidx.wear.watchface.style.UserStyle? userStyle) throws android.os.RemoteException;
+ method @RequiresApi(27) @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public android.graphics.Bitmap renderWatchFaceToBitmap(androidx.wear.watchface.RenderParameters renderParameters, java.time.Instant instant, androidx.wear.watchface.style.UserStyle? userStyle, java.util.Map<java.lang.Integer,? extends androidx.wear.complications.data.ComplicationData>? slotIdToComplicationData) throws android.os.RemoteException;
method public android.os.Bundle toBundle();
property @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public abstract java.util.Map<java.lang.Integer,androidx.wear.watchface.client.ComplicationSlotState> complicationSlotsState;
- property @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public abstract long previewReferenceTimeMillis;
+ property @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public abstract java.time.Instant previewReferenceInstant;
property @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public abstract androidx.wear.watchface.style.UserStyleSchema userStyleSchema;
field public static final String BINDER_KEY = "HeadlessWatchFaceClient";
field public static final androidx.wear.watchface.client.HeadlessWatchFaceClient.Companion Companion;
@@ -106,12 +106,12 @@
method @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public java.util.Map<java.lang.Integer,androidx.wear.watchface.client.ComplicationSlotState> getComplicationSlotsState();
method @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public java.util.List<androidx.wear.watchface.ContentDescriptionLabel> getContentDescriptionLabels();
method @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public String getInstanceId();
- method @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public long getPreviewReferenceTimeMillis();
+ method @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public java.time.Instant getPreviewReferenceInstant();
method @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public androidx.wear.watchface.style.UserStyleSchema getUserStyleSchema();
method @AnyThread public boolean isConnectionAlive();
method @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public void performAmbientTick() throws android.os.RemoteException;
method @AnyThread public void removeClientDisconnectListener(androidx.wear.watchface.client.InteractiveWatchFaceClient.ClientDisconnectListener listener);
- method @RequiresApi(27) @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public android.graphics.Bitmap renderWatchFaceToBitmap(androidx.wear.watchface.RenderParameters renderParameters, long calendarTimeMillis, androidx.wear.watchface.style.UserStyle? userStyle, java.util.Map<java.lang.Integer,? extends androidx.wear.complications.data.ComplicationData>? idAndComplicationData) throws android.os.RemoteException;
+ method @RequiresApi(27) @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public android.graphics.Bitmap renderWatchFaceToBitmap(androidx.wear.watchface.RenderParameters renderParameters, java.time.Instant instant, androidx.wear.watchface.style.UserStyle? userStyle, java.util.Map<java.lang.Integer,? extends androidx.wear.complications.data.ComplicationData>? idAndComplicationData) throws android.os.RemoteException;
method @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public void sendTouchEvent(@Px int xPosition, @Px int yPosition, @androidx.wear.watchface.TapType int tapType) throws android.os.RemoteException;
method @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public void setWatchUiState(androidx.wear.watchface.client.WatchUiState watchUiState) throws android.os.RemoteException;
method @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public void updateComplicationData(java.util.Map<java.lang.Integer,? extends androidx.wear.complications.data.ComplicationData> slotIdToComplicationData) throws android.os.RemoteException;
@@ -120,7 +120,7 @@
property @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public abstract java.util.Map<java.lang.Integer,androidx.wear.watchface.client.ComplicationSlotState> complicationSlotsState;
property @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public abstract java.util.List<androidx.wear.watchface.ContentDescriptionLabel> contentDescriptionLabels;
property @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public abstract String instanceId;
- property @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public abstract long previewReferenceTimeMillis;
+ property @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public abstract java.time.Instant previewReferenceInstant;
property @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public abstract androidx.wear.watchface.style.UserStyleSchema userStyleSchema;
field public static final androidx.wear.watchface.client.InteractiveWatchFaceClient.Companion Companion;
field public static final int TAP_TYPE_CANCEL = 1; // 0x1
diff --git a/wear/wear-watchface-client/api/public_plus_experimental_current.txt b/wear/wear-watchface-client/api/public_plus_experimental_current.txt
index 4c99be7..c547d88 100644
--- a/wear/wear-watchface-client/api/public_plus_experimental_current.txt
+++ b/wear/wear-watchface-client/api/public_plus_experimental_current.txt
@@ -98,15 +98,15 @@
method @AnyThread public void addClientDisconnectListener(androidx.wear.watchface.client.HeadlessWatchFaceClient.ClientDisconnectListener listener, java.util.concurrent.Executor executor);
method public default static androidx.wear.watchface.client.HeadlessWatchFaceClient createFromBundle(android.os.Bundle bundle);
method @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public java.util.Map<java.lang.Integer,androidx.wear.watchface.client.ComplicationSlotState> getComplicationSlotsState();
- method @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public long getPreviewReferenceTimeMillis();
+ method @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public java.time.Instant getPreviewReferenceInstant();
method @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public androidx.wear.watchface.style.UserStyleSchema getUserStyleSchema();
method @AnyThread public boolean isConnectionAlive();
method @AnyThread public void removeClientDisconnectListener(androidx.wear.watchface.client.HeadlessWatchFaceClient.ClientDisconnectListener listener);
- method @RequiresApi(27) @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public android.graphics.Bitmap? renderComplicationToBitmap(int complicationSlotId, androidx.wear.watchface.RenderParameters renderParameters, long calendarTimeMillis, androidx.wear.complications.data.ComplicationData complicationData, androidx.wear.watchface.style.UserStyle? userStyle) throws android.os.RemoteException;
- method @RequiresApi(27) @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public android.graphics.Bitmap renderWatchFaceToBitmap(androidx.wear.watchface.RenderParameters renderParameters, long calendarTimeMillis, androidx.wear.watchface.style.UserStyle? userStyle, java.util.Map<java.lang.Integer,? extends androidx.wear.complications.data.ComplicationData>? slotIdToComplicationData) throws android.os.RemoteException;
+ method @RequiresApi(27) @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public android.graphics.Bitmap? renderComplicationToBitmap(int complicationSlotId, androidx.wear.watchface.RenderParameters renderParameters, java.time.Instant instant, androidx.wear.complications.data.ComplicationData complicationData, androidx.wear.watchface.style.UserStyle? userStyle) throws android.os.RemoteException;
+ method @RequiresApi(27) @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public android.graphics.Bitmap renderWatchFaceToBitmap(androidx.wear.watchface.RenderParameters renderParameters, java.time.Instant instant, androidx.wear.watchface.style.UserStyle? userStyle, java.util.Map<java.lang.Integer,? extends androidx.wear.complications.data.ComplicationData>? slotIdToComplicationData) throws android.os.RemoteException;
method public android.os.Bundle toBundle();
property @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public abstract java.util.Map<java.lang.Integer,androidx.wear.watchface.client.ComplicationSlotState> complicationSlotsState;
- property @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public abstract long previewReferenceTimeMillis;
+ property @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public abstract java.time.Instant previewReferenceInstant;
property @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public abstract androidx.wear.watchface.style.UserStyleSchema userStyleSchema;
field public static final String BINDER_KEY = "HeadlessWatchFaceClient";
field public static final androidx.wear.watchface.client.HeadlessWatchFaceClient.Companion Companion;
@@ -126,12 +126,12 @@
method @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public java.util.Map<java.lang.Integer,androidx.wear.watchface.client.ComplicationSlotState> getComplicationSlotsState();
method @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public java.util.List<androidx.wear.watchface.ContentDescriptionLabel> getContentDescriptionLabels();
method @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public String getInstanceId();
- method @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public long getPreviewReferenceTimeMillis();
+ method @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public java.time.Instant getPreviewReferenceInstant();
method @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public androidx.wear.watchface.style.UserStyleSchema getUserStyleSchema();
method @AnyThread public boolean isConnectionAlive();
method @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public void performAmbientTick() throws android.os.RemoteException;
method @AnyThread public void removeClientDisconnectListener(androidx.wear.watchface.client.InteractiveWatchFaceClient.ClientDisconnectListener listener);
- method @RequiresApi(27) @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public android.graphics.Bitmap renderWatchFaceToBitmap(androidx.wear.watchface.RenderParameters renderParameters, long calendarTimeMillis, androidx.wear.watchface.style.UserStyle? userStyle, java.util.Map<java.lang.Integer,? extends androidx.wear.complications.data.ComplicationData>? idAndComplicationData) throws android.os.RemoteException;
+ method @RequiresApi(27) @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public android.graphics.Bitmap renderWatchFaceToBitmap(androidx.wear.watchface.RenderParameters renderParameters, java.time.Instant instant, androidx.wear.watchface.style.UserStyle? userStyle, java.util.Map<java.lang.Integer,? extends androidx.wear.complications.data.ComplicationData>? idAndComplicationData) throws android.os.RemoteException;
method @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public void sendTouchEvent(@Px int xPosition, @Px int yPosition, @androidx.wear.watchface.TapType int tapType) throws android.os.RemoteException;
method @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public void setWatchUiState(androidx.wear.watchface.client.WatchUiState watchUiState) throws android.os.RemoteException;
method @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public void updateComplicationData(java.util.Map<java.lang.Integer,? extends androidx.wear.complications.data.ComplicationData> slotIdToComplicationData) throws android.os.RemoteException;
@@ -140,7 +140,7 @@
property @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public abstract java.util.Map<java.lang.Integer,androidx.wear.watchface.client.ComplicationSlotState> complicationSlotsState;
property @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public abstract java.util.List<androidx.wear.watchface.ContentDescriptionLabel> contentDescriptionLabels;
property @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public abstract String instanceId;
- property @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public abstract long previewReferenceTimeMillis;
+ property @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public abstract java.time.Instant previewReferenceInstant;
property @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public abstract androidx.wear.watchface.style.UserStyleSchema userStyleSchema;
field public static final androidx.wear.watchface.client.InteractiveWatchFaceClient.Companion Companion;
field public static final int TAP_TYPE_CANCEL = 1; // 0x1
diff --git a/wear/wear-watchface-client/api/restricted_current.txt b/wear/wear-watchface-client/api/restricted_current.txt
index 8479190..5957bf9 100644
--- a/wear/wear-watchface-client/api/restricted_current.txt
+++ b/wear/wear-watchface-client/api/restricted_current.txt
@@ -82,15 +82,15 @@
method @AnyThread public void addClientDisconnectListener(androidx.wear.watchface.client.HeadlessWatchFaceClient.ClientDisconnectListener listener, java.util.concurrent.Executor executor);
method public default static androidx.wear.watchface.client.HeadlessWatchFaceClient createFromBundle(android.os.Bundle bundle);
method @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public java.util.Map<java.lang.Integer,androidx.wear.watchface.client.ComplicationSlotState> getComplicationSlotsState();
- method @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public long getPreviewReferenceTimeMillis();
+ method @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public java.time.Instant getPreviewReferenceInstant();
method @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public androidx.wear.watchface.style.UserStyleSchema getUserStyleSchema();
method @AnyThread public boolean isConnectionAlive();
method @AnyThread public void removeClientDisconnectListener(androidx.wear.watchface.client.HeadlessWatchFaceClient.ClientDisconnectListener listener);
- method @RequiresApi(27) @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public android.graphics.Bitmap? renderComplicationToBitmap(int complicationSlotId, androidx.wear.watchface.RenderParameters renderParameters, long calendarTimeMillis, androidx.wear.complications.data.ComplicationData complicationData, androidx.wear.watchface.style.UserStyle? userStyle) throws android.os.RemoteException;
- method @RequiresApi(27) @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public android.graphics.Bitmap renderWatchFaceToBitmap(androidx.wear.watchface.RenderParameters renderParameters, long calendarTimeMillis, androidx.wear.watchface.style.UserStyle? userStyle, java.util.Map<java.lang.Integer,? extends androidx.wear.complications.data.ComplicationData>? slotIdToComplicationData) throws android.os.RemoteException;
+ method @RequiresApi(27) @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public android.graphics.Bitmap? renderComplicationToBitmap(int complicationSlotId, androidx.wear.watchface.RenderParameters renderParameters, java.time.Instant instant, androidx.wear.complications.data.ComplicationData complicationData, androidx.wear.watchface.style.UserStyle? userStyle) throws android.os.RemoteException;
+ method @RequiresApi(27) @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public android.graphics.Bitmap renderWatchFaceToBitmap(androidx.wear.watchface.RenderParameters renderParameters, java.time.Instant instant, androidx.wear.watchface.style.UserStyle? userStyle, java.util.Map<java.lang.Integer,? extends androidx.wear.complications.data.ComplicationData>? slotIdToComplicationData) throws android.os.RemoteException;
method public android.os.Bundle toBundle();
property @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public abstract java.util.Map<java.lang.Integer,androidx.wear.watchface.client.ComplicationSlotState> complicationSlotsState;
- property @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public abstract long previewReferenceTimeMillis;
+ property @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public abstract java.time.Instant previewReferenceInstant;
property @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public abstract androidx.wear.watchface.style.UserStyleSchema userStyleSchema;
field public static final String BINDER_KEY = "HeadlessWatchFaceClient";
field public static final androidx.wear.watchface.client.HeadlessWatchFaceClient.Companion Companion;
@@ -110,12 +110,12 @@
method @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public java.util.Map<java.lang.Integer,androidx.wear.watchface.client.ComplicationSlotState> getComplicationSlotsState();
method @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public java.util.List<androidx.wear.watchface.ContentDescriptionLabel> getContentDescriptionLabels();
method @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public String getInstanceId();
- method @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public long getPreviewReferenceTimeMillis();
+ method @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public java.time.Instant getPreviewReferenceInstant();
method @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public androidx.wear.watchface.style.UserStyleSchema getUserStyleSchema();
method @AnyThread public boolean isConnectionAlive();
method @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public void performAmbientTick() throws android.os.RemoteException;
method @AnyThread public void removeClientDisconnectListener(androidx.wear.watchface.client.InteractiveWatchFaceClient.ClientDisconnectListener listener);
- method @RequiresApi(27) @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public android.graphics.Bitmap renderWatchFaceToBitmap(androidx.wear.watchface.RenderParameters renderParameters, long calendarTimeMillis, androidx.wear.watchface.style.UserStyle? userStyle, java.util.Map<java.lang.Integer,? extends androidx.wear.complications.data.ComplicationData>? idAndComplicationData) throws android.os.RemoteException;
+ method @RequiresApi(27) @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public android.graphics.Bitmap renderWatchFaceToBitmap(androidx.wear.watchface.RenderParameters renderParameters, java.time.Instant instant, androidx.wear.watchface.style.UserStyle? userStyle, java.util.Map<java.lang.Integer,? extends androidx.wear.complications.data.ComplicationData>? idAndComplicationData) throws android.os.RemoteException;
method @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public void sendTouchEvent(@Px int xPosition, @Px int yPosition, @androidx.wear.watchface.TapType int tapType) throws android.os.RemoteException;
method @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public void setWatchUiState(androidx.wear.watchface.client.WatchUiState watchUiState) throws android.os.RemoteException;
method @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public void updateComplicationData(java.util.Map<java.lang.Integer,? extends androidx.wear.complications.data.ComplicationData> slotIdToComplicationData) throws android.os.RemoteException;
@@ -124,7 +124,7 @@
property @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public abstract java.util.Map<java.lang.Integer,androidx.wear.watchface.client.ComplicationSlotState> complicationSlotsState;
property @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public abstract java.util.List<androidx.wear.watchface.ContentDescriptionLabel> contentDescriptionLabels;
property @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public abstract String instanceId;
- property @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public abstract long previewReferenceTimeMillis;
+ property @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public abstract java.time.Instant previewReferenceInstant;
property @kotlin.jvm.Throws(exceptionClasses=RemoteException::class) public abstract androidx.wear.watchface.style.UserStyleSchema userStyleSchema;
field public static final androidx.wear.watchface.client.InteractiveWatchFaceClient.Companion Companion;
field public static final int TAP_TYPE_CANCEL = 1; // 0x1
diff --git a/wear/wear-watchface-client/build.gradle b/wear/wear-watchface-client/build.gradle
index 19c0402..732cae8 100644
--- a/wear/wear-watchface-client/build.gradle
+++ b/wear/wear-watchface-client/build.gradle
@@ -33,7 +33,7 @@
api(project(":wear:wear-complications-data"))
api(libs.kotlinCoroutinesAndroid)
- androidTestImplementation(project(":test:screenshot:test-screenshot"))
+ androidTestImplementation(project(":test:screenshot:screenshot"))
androidTestImplementation(project(":wear:wear-watchface-samples"))
androidTestImplementation(libs.testExtJunit)
androidTestImplementation(libs.testCore)
@@ -61,7 +61,7 @@
android {
defaultConfig {
- minSdkVersion 25
+ minSdkVersion 26
}
sourceSets.androidTest.assets.srcDirs +=
project.rootDir.absolutePath + "/../../golden/wear/wear-watchface-client"
diff --git a/wear/wear-watchface-client/src/androidTest/java/androidx/wear/watchface/client/test/SerializationTest.kt b/wear/wear-watchface-client/src/androidTest/java/androidx/wear/watchface/client/test/SerializationTest.kt
index 0040600..8d8b84a 100644
--- a/wear/wear-watchface-client/src/androidTest/java/androidx/wear/watchface/client/test/SerializationTest.kt
+++ b/wear/wear-watchface-client/src/androidTest/java/androidx/wear/watchface/client/test/SerializationTest.kt
@@ -46,6 +46,7 @@
import com.google.common.truth.Truth.assertThat
import org.junit.Test
import org.junit.runner.RunWith
+import java.time.Instant
import java.util.Base64
/** Tests that we can deserialize golden resources correctly to ensure backwards compatibility. */
@@ -87,8 +88,9 @@
val complication =
deserialized.complicationData!!.toApiComplicationData() as LongTextComplicationData
- assertThat(complication.text.getTextAt(context.resources, 0)).isEqualTo("Example")
- assertThat(complication.title!!.getTextAt(context.resources, 0))
+ assertThat(complication.text.getTextAt(context.resources, Instant.EPOCH))
+ .isEqualTo("Example")
+ assertThat(complication.title!!.getTextAt(context.resources, Instant.EPOCH))
.isEqualTo("complication")
}
@@ -121,9 +123,9 @@
val complication =
deserialized.idAndComplicationDataWireFormats!![0].complicationData
.toApiComplicationData() as LongTextComplicationData
- assertThat(complication.text.getTextAt(context.resources, 0))
+ assertThat(complication.text.getTextAt(context.resources, Instant.EPOCH))
.isEqualTo("Test Text")
- assertThat(complication.title!!.getTextAt(context.resources, 0))
+ assertThat(complication.title!!.getTextAt(context.resources, Instant.EPOCH))
.isEqualTo("Test Title")
assertThat(deserialized.deviceConfig.hasBurnInProtection).isTrue()
@@ -174,16 +176,18 @@
val complicationA =
deserialized.idAndComplicationDatumWireFormats!![0].complicationData
.toApiComplicationData() as LongTextComplicationData
- assertThat(complicationA.text.getTextAt(context.resources, 0)).isEqualTo("A Text")
- assertThat(complicationA.title!!.getTextAt(context.resources, 0))
+ assertThat(complicationA.text.getTextAt(context.resources, Instant.EPOCH))
+ .isEqualTo("A Text")
+ assertThat(complicationA.title!!.getTextAt(context.resources, Instant.EPOCH))
.isEqualTo("A Title")
assertThat(deserialized.idAndComplicationDatumWireFormats!![1].id).isEqualTo(2)
val complicationB =
deserialized.idAndComplicationDatumWireFormats!![1].complicationData
.toApiComplicationData() as ShortTextComplicationData
- assertThat(complicationB.text.getTextAt(context.resources, 0)).isEqualTo("B Text")
- assertThat(complicationB.title!!.getTextAt(context.resources, 0))
+ assertThat(complicationB.text.getTextAt(context.resources, Instant.EPOCH))
+ .isEqualTo("B Text")
+ assertThat(complicationB.title!!.getTextAt(context.resources, Instant.EPOCH))
.isEqualTo("B Title")
}
@@ -231,10 +235,14 @@
val complicationA = deserialized.previewComplicationsData[10] as ShortTextComplicationData
val complicationB = deserialized.previewComplicationsData[20] as LongTextComplicationData
- assertThat(complicationA.text.getTextAt(context.resources, 0)).isEqualTo("Mon")
- assertThat(complicationA.title!!.getTextAt(context.resources, 0)).isEqualTo("23rd")
- assertThat(complicationB.text.getTextAt(context.resources, 0)).isEqualTo("Example")
- assertThat(complicationB.title!!.getTextAt(context.resources, 0)).isEqualTo("complication")
+ assertThat(complicationA.text.getTextAt(context.resources, Instant.EPOCH))
+ .isEqualTo("Mon")
+ assertThat(complicationA.title!!.getTextAt(context.resources, Instant.EPOCH))
+ .isEqualTo("23rd")
+ assertThat(complicationB.text.getTextAt(context.resources, Instant.EPOCH))
+ .isEqualTo("Example")
+ assertThat(complicationB.title!!.getTextAt(context.resources, Instant.EPOCH))
+ .isEqualTo("complication")
}
@Test
diff --git a/wear/wear-watchface-client/src/androidTest/java/androidx/wear/watchface/client/test/WatchFaceControlClientTest.kt b/wear/wear-watchface-client/src/androidTest/java/androidx/wear/watchface/client/test/WatchFaceControlClientTest.kt
index 258e3e3..65ac7c1 100644
--- a/wear/wear-watchface-client/src/androidTest/java/androidx/wear/watchface/client/test/WatchFaceControlClientTest.kt
+++ b/wear/wear-watchface-client/src/androidTest/java/androidx/wear/watchface/client/test/WatchFaceControlClientTest.kt
@@ -90,6 +90,7 @@
import org.mockito.Mock
import org.mockito.Mockito
import org.mockito.MockitoAnnotations
+import java.time.Instant
import java.util.concurrent.CountDownLatch
import java.util.concurrent.TimeUnit
import java.util.concurrent.TimeoutException
@@ -222,7 +223,7 @@
WatchFaceLayer.ALL_WATCH_FACE_LAYERS,
null
),
- 1234567,
+ Instant.ofEpochMilli(1234567),
null,
complications
)
@@ -256,7 +257,7 @@
Color.argb(128, 0, 0, 0) // Darken everything else.
)
),
- 1234567,
+ Instant.ofEpochMilli(1234567),
null,
complications
)
@@ -290,7 +291,7 @@
Color.argb(128, 0, 0, 0) // Darken everything else.
)
),
- 1234567,
+ Instant.ofEpochMilli(1234567),
null,
complications
)
@@ -424,7 +425,7 @@
WatchFaceLayer.ALL_WATCH_FACE_LAYERS,
null
),
- 1234567,
+ Instant.ofEpochMilli(1234567),
null,
complications
)
@@ -467,7 +468,7 @@
WatchFaceLayer.ALL_WATCH_FACE_LAYERS,
null
),
- 1234567,
+ Instant.ofEpochMilli(1234567),
null,
complications
)
@@ -691,7 +692,7 @@
WatchFaceLayer.ALL_WATCH_FACE_LAYERS,
null
),
- 1234567,
+ Instant.ofEpochMilli(1234567),
null,
complications
)
@@ -773,17 +774,21 @@
// Central clock element. Note we don't know the timezone this test will be running in
// so we can't assert the contents of the clock's test.
assertThat(contentDescriptionLabels[0].bounds).isEqualTo(Rect(100, 100, 300, 300))
- assertThat(contentDescriptionLabels[0].getTextAt(context.resources, 0).isNotEmpty())
+ assertThat(
+ contentDescriptionLabels[0].getTextAt(context.resources, Instant.EPOCH)
+ ).isNotEqualTo("")
// Left complication.
assertThat(contentDescriptionLabels[1].bounds).isEqualTo(Rect(80, 160, 160, 240))
- assertThat(contentDescriptionLabels[1].getTextAt(context.resources, 0))
- .isEqualTo("ID Left")
+ assertThat(
+ contentDescriptionLabels[1].getTextAt(context.resources, Instant.EPOCH)
+ ).isEqualTo("ID Left")
// Right complication.
assertThat(contentDescriptionLabels[2].bounds).isEqualTo(Rect(240, 160, 320, 240))
- assertThat(contentDescriptionLabels[2].getTextAt(context.resources, 0))
- .isEqualTo("ID Right")
+ assertThat(
+ contentDescriptionLabels[2].getTextAt(context.resources, Instant.EPOCH)
+ ).isEqualTo("ID Right")
sysUiInterface.close()
}
@@ -840,27 +845,33 @@
// Central clock element. Note we don't know the timezone this test will be running in
// so we can't assert the contents of the clock's test.
assertThat(contentDescriptionLabels[0].bounds).isEqualTo(Rect(100, 100, 300, 300))
- assertThat(contentDescriptionLabels[0].getTextAt(context.resources, 0).isNotEmpty())
+ assertThat(
+ contentDescriptionLabels[0].getTextAt(context.resources, Instant.EPOCH)
+ ).isNotEqualTo("")
// First additional ContentDescriptionLabel.
assertThat(contentDescriptionLabels[1].bounds).isEqualTo(Rect(10, 10, 20, 20))
- assertThat(contentDescriptionLabels[1].getTextAt(context.resources, 0))
- .isEqualTo("Before")
+ assertThat(
+ contentDescriptionLabels[1].getTextAt(context.resources, Instant.EPOCH)
+ ).isEqualTo("Before")
// Left complication.
assertThat(contentDescriptionLabels[2].bounds).isEqualTo(Rect(80, 160, 160, 240))
- assertThat(contentDescriptionLabels[2].getTextAt(context.resources, 0))
- .isEqualTo("ID Left")
+ assertThat(
+ contentDescriptionLabels[2].getTextAt(context.resources, Instant.EPOCH)
+ ).isEqualTo("ID Left")
// Right complication.
assertThat(contentDescriptionLabels[3].bounds).isEqualTo(Rect(240, 160, 320, 240))
- assertThat(contentDescriptionLabels[3].getTextAt(context.resources, 0))
- .isEqualTo("ID Right")
+ assertThat(
+ contentDescriptionLabels[3].getTextAt(context.resources, Instant.EPOCH)
+ ).isEqualTo("ID Right")
// Second additional ContentDescriptionLabel.
assertThat(contentDescriptionLabels[4].bounds).isEqualTo(Rect(30, 30, 40, 40))
- assertThat(contentDescriptionLabels[4].getTextAt(context.resources, 0))
- .isEqualTo("After")
+ assertThat(
+ contentDescriptionLabels[4].getTextAt(context.resources, Instant.EPOCH)
+ ).isEqualTo("After")
}
@SuppressLint("NewApi") // renderWatchFaceToBitmap
@@ -918,7 +929,7 @@
WatchFaceLayer.ALL_WATCH_FACE_LAYERS,
null
),
- 1234567,
+ Instant.ofEpochMilli(1234567),
null,
complications
)
diff --git a/wear/wear-watchface-client/src/androidTest/java/androidx/wear/watchface/client/test/WatchFaceControlTestService.kt b/wear/wear-watchface-client/src/androidTest/java/androidx/wear/watchface/client/test/WatchFaceControlTestService.kt
index ae3b4a2..e7ff1f4 100644
--- a/wear/wear-watchface-client/src/androidTest/java/androidx/wear/watchface/client/test/WatchFaceControlTestService.kt
+++ b/wear/wear-watchface-client/src/androidTest/java/androidx/wear/watchface/client/test/WatchFaceControlTestService.kt
@@ -19,9 +19,11 @@
import android.app.Service
import android.content.Context
import android.content.Intent
+import android.os.Build
import android.os.Handler
import android.os.IBinder
import android.os.Looper
+import androidx.annotation.RequiresApi
import androidx.test.core.app.ApplicationProvider
import androidx.wear.watchface.control.IWatchFaceInstanceServiceStub
import androidx.wear.watchface.control.WatchFaceControlService
@@ -41,6 +43,7 @@
private val realService = object : WatchFaceControlService() {
override fun createServiceStub(): IWatchFaceInstanceServiceStub =
object : IWatchFaceInstanceServiceStub(this, Handler(Looper.getMainLooper())) {
+ @RequiresApi(Build.VERSION_CODES.O_MR1)
override fun getApiVersion(): Int = apiVersionOverride ?: super.getApiVersion()
}
@@ -49,5 +52,6 @@
}
}
+ @RequiresApi(Build.VERSION_CODES.O_MR1)
override fun onBind(intent: Intent?): IBinder? = realService.onBind(intent)
}
diff --git a/wear/wear-watchface-client/src/main/java/androidx/wear/watchface/client/BindHelper.kt b/wear/wear-watchface-client/src/main/java/androidx/wear/watchface/client/BindHelper.kt
new file mode 100644
index 0000000..7871341
--- /dev/null
+++ b/wear/wear-watchface-client/src/main/java/androidx/wear/watchface/client/BindHelper.kt
@@ -0,0 +1,79 @@
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * 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.
+ */
+
+package androidx.wear.watchface.client
+
+import android.content.Context
+import android.content.Intent
+import android.content.ServiceConnection
+import android.os.Build
+import androidx.annotation.RequiresApi
+
+/** Wrapper around [Context.bindService]. */
+internal class BindHelper {
+ companion object {
+ /**
+ * Wrapper around [Context.bindService] which uses an immediate executor where possible for
+ * [serviceConnection].
+ *
+ * @param context The [Context] on which to call [Context.bindService]
+ * @param intent The [Intent] to pass to [Context.bindService]
+ * @param serviceConnection The [ServiceConnection] to pass to [Context.bindService].
+ * Note on API 29 and above this will be called on a binder thread, before that it will be
+ * called on the UI thread.
+ * @return The result of [Context.bindService]
+ */
+ fun bindService(
+ context: Context,
+ intent: Intent,
+ serviceConnection: ServiceConnection
+ ): Boolean {
+ return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
+ // API 29 lets us specify an executor to avoid a round trip via the potentially
+ // congested UI thread.
+ BindHelper29.bindServiceWithImmediateExecutor(
+ context,
+ intent,
+ serviceConnection
+ )
+ } else {
+ /** Note serviceConnection will be dispatched on the UI thread. */
+ context.bindService(
+ intent,
+ serviceConnection,
+ Context.BIND_AUTO_CREATE or Context.BIND_IMPORTANT
+ )
+ }
+ }
+ }
+}
+
+private class BindHelper29 {
+ @RequiresApi(Build.VERSION_CODES.Q)
+ companion object {
+ /** Note serviceConnection will be dispatched on a binder thread. */
+ fun bindServiceWithImmediateExecutor(
+ context: Context,
+ intent: Intent,
+ serviceConnection: ServiceConnection
+ ) = context.bindService(
+ intent,
+ Context.BIND_AUTO_CREATE or Context.BIND_IMPORTANT,
+ { command -> command.run() },
+ serviceConnection
+ )
+ }
+}
\ No newline at end of file
diff --git a/wear/wear-watchface-client/src/main/java/androidx/wear/watchface/client/HeadlessWatchFaceClient.kt b/wear/wear-watchface-client/src/main/java/androidx/wear/watchface/client/HeadlessWatchFaceClient.kt
index 8911fa2..1079820 100644
--- a/wear/wear-watchface-client/src/main/java/androidx/wear/watchface/client/HeadlessWatchFaceClient.kt
+++ b/wear/wear-watchface-client/src/main/java/androidx/wear/watchface/client/HeadlessWatchFaceClient.kt
@@ -34,6 +34,7 @@
import androidx.wear.watchface.style.UserStyle
import androidx.wear.watchface.style.UserStyleSchema
import androidx.wear.watchface.style.UserStyleSetting.ComplicationSlotsUserStyleSetting
+import java.time.Instant
import java.util.concurrent.Executor
/**
@@ -54,9 +55,9 @@
)
}
- /** The UTC reference preview time for this watch face in milliseconds since the epoch. */
+ /** The [Instant] to use when rendering previews. */
@get:Throws(RemoteException::class)
- public val previewReferenceTimeMillis: Long
+ public val previewReferenceInstant: Instant
/** The watch face's [UserStyleSchema]. */
@get:Throws(RemoteException::class)
@@ -77,7 +78,7 @@
* Renders the watchface to a shared memory backed [Bitmap] with the given settings.
*
* @param renderParameters The [RenderParameters] to draw with.
- * @param calendarTimeMillis The UTC time in milliseconds since the epoch to render with.
+ * @param instant The [Instant] to render with
* @param userStyle Optional [UserStyle] to render with, if null the default style is used.
* @param slotIdToComplicationData Map of [androidx.wear.watchface.ComplicationSlot] ids to
* [ComplicationData] to render with, or if `null` [androidx.wear.watchface.ComplicationSlot]
@@ -89,7 +90,7 @@
@Throws(RemoteException::class)
public fun renderWatchFaceToBitmap(
renderParameters: RenderParameters,
- calendarTimeMillis: Long,
+ instant: Instant,
userStyle: UserStyle?,
slotIdToComplicationData: Map<Int, ComplicationData>?
): Bitmap
@@ -100,7 +101,7 @@
*
* @param complicationSlotId The id of the complication to render
* @param renderParameters The [RenderParameters] to draw with
- * @param calendarTimeMillis The UTC time in milliseconds since the epoch to render with
+ * @param instant The [Instant] to render with
* @param complicationData the [ComplicationData] to render with
* @param userStyle Optional [UserStyle] to render with, if null the default style is used
* @return A shared memory backed [Bitmap] containing a screenshot of the watch face with the
@@ -111,7 +112,7 @@
public fun renderComplicationToBitmap(
complicationSlotId: Int,
renderParameters: RenderParameters,
- calendarTimeMillis: Long,
+ instant: Instant,
complicationData: ComplicationData,
userStyle: UserStyle?,
): Bitmap?
@@ -170,8 +171,8 @@
)
}
- override val previewReferenceTimeMillis: Long
- get() = iHeadlessWatchFace.previewReferenceTimeMillis
+ override val previewReferenceInstant: Instant
+ get() = Instant.ofEpochMilli(iHeadlessWatchFace.previewReferenceTimeMillis)
override val userStyleSchema: UserStyleSchema
get() = UserStyleSchema(iHeadlessWatchFace.userStyleSchema)
@@ -185,7 +186,7 @@
@RequiresApi(27)
override fun renderWatchFaceToBitmap(
renderParameters: RenderParameters,
- calendarTimeMillis: Long,
+ instant: Instant,
userStyle: UserStyle?,
slotIdToComplicationData: Map<Int, ComplicationData>?
): Bitmap = TraceEvent("HeadlessWatchFaceClientImpl.renderWatchFaceToBitmap").use {
@@ -193,7 +194,7 @@
iHeadlessWatchFace.renderWatchFaceToBitmap(
WatchFaceRenderParams(
renderParameters.toWireFormat(),
- calendarTimeMillis,
+ instant.toEpochMilli(),
userStyle?.toWireFormat(),
slotIdToComplicationData?.map {
IdAndComplicationDataWireFormat(
@@ -210,7 +211,7 @@
override fun renderComplicationToBitmap(
complicationSlotId: Int,
renderParameters: RenderParameters,
- calendarTimeMillis: Long,
+ instant: Instant,
complicationData: ComplicationData,
userStyle: UserStyle?,
): Bitmap? = TraceEvent("HeadlessWatchFaceClientImpl.renderComplicationToBitmap").use {
@@ -218,7 +219,7 @@
ComplicationRenderParams(
complicationSlotId,
renderParameters.toWireFormat(),
- calendarTimeMillis,
+ instant.toEpochMilli(),
complicationData.asWireComplicationData(),
userStyle?.toWireFormat(),
)
diff --git a/wear/wear-watchface-client/src/main/java/androidx/wear/watchface/client/InteractiveWatchFaceClient.kt b/wear/wear-watchface-client/src/main/java/androidx/wear/watchface/client/InteractiveWatchFaceClient.kt
index 888fcd0..eba08b2 100644
--- a/wear/wear-watchface-client/src/main/java/androidx/wear/watchface/client/InteractiveWatchFaceClient.kt
+++ b/wear/wear-watchface-client/src/main/java/androidx/wear/watchface/client/InteractiveWatchFaceClient.kt
@@ -39,6 +39,7 @@
import androidx.wear.watchface.style.UserStyleSchema
import androidx.wear.watchface.style.UserStyleSetting.ComplicationSlotsUserStyleSetting
import androidx.wear.watchface.style.UserStyleData
+import java.time.Instant
import java.util.concurrent.Executor
/**
@@ -63,7 +64,7 @@
* Renders the watchface to a shared memory backed [Bitmap] with the given settings.
*
* @param renderParameters The [RenderParameters] to draw with.
- * @param calendarTimeMillis The UTC time in milliseconds since the epoch to render with.
+ * @param instant The [Instant] render with.
* @param userStyle Optional [UserStyle] to render with, if null the current style is used.
* @param idAndComplicationData Map of complication ids to [ComplicationData] to render with, or
* if null then the existing complication data if any is used.
@@ -74,14 +75,14 @@
@Throws(RemoteException::class)
public fun renderWatchFaceToBitmap(
renderParameters: RenderParameters,
- calendarTimeMillis: Long,
+ instant: Instant,
userStyle: UserStyle?,
idAndComplicationData: Map<Int, ComplicationData>?
): Bitmap
/** The UTC reference preview time for this watch face in milliseconds since the epoch. */
@get:Throws(RemoteException::class)
- public val previewReferenceTimeMillis: Long
+ public val previewReferenceInstant: Instant
/**
* Renames this instance to [newInstanceId] (must be unique, usually this would be different
@@ -248,7 +249,7 @@
@RequiresApi(27)
override fun renderWatchFaceToBitmap(
renderParameters: RenderParameters,
- calendarTimeMillis: Long,
+ instant: Instant,
userStyle: UserStyle?,
idAndComplicationData: Map<Int, ComplicationData>?
): Bitmap = TraceEvent("InteractiveWatchFaceClientImpl.renderWatchFaceToBitmap").use {
@@ -256,7 +257,7 @@
iInteractiveWatchFace.renderWatchFaceToBitmap(
WatchFaceRenderParams(
renderParameters.toWireFormat(),
- calendarTimeMillis,
+ instant.toEpochMilli(),
userStyle?.toWireFormat(),
idAndComplicationData?.map {
IdAndComplicationDataWireFormat(
@@ -269,8 +270,8 @@
)
}
- override val previewReferenceTimeMillis: Long
- get() = iInteractiveWatchFace.previewReferenceTimeMillis
+ override val previewReferenceInstant: Instant
+ get() = Instant.ofEpochMilli(iInteractiveWatchFace.previewReferenceTimeMillis)
override fun updateWatchFaceInstance(newInstanceId: String, userStyle: UserStyle) = TraceEvent(
"InteractiveWatchFaceClientImpl.updateInstance"
diff --git a/wear/wear-watchface-client/src/main/java/androidx/wear/watchface/client/WatchFaceControlClient.kt b/wear/wear-watchface-client/src/main/java/androidx/wear/watchface/client/WatchFaceControlClient.kt
index 6e441c9..d8e2e4cd 100644
--- a/wear/wear-watchface-client/src/main/java/androidx/wear/watchface/client/WatchFaceControlClient.kt
+++ b/wear/wear-watchface-client/src/main/java/androidx/wear/watchface/client/WatchFaceControlClient.kt
@@ -94,12 +94,7 @@
deferredService.completeExceptionally(ServiceStartFailureException())
}
}
- if (!context.bindService(
- intent,
- serviceConnection,
- Context.BIND_AUTO_CREATE or Context.BIND_IMPORTANT
- )
- ) {
+ if (!BindHelper.bindService(context, intent, serviceConnection)) {
traceEvent.close()
throw ServiceNotBoundException()
}
diff --git a/wear/wear-watchface-client/src/main/java/androidx/wear/watchface/client/WatchFaceMetadataClient.kt b/wear/wear-watchface-client/src/main/java/androidx/wear/watchface/client/WatchFaceMetadataClient.kt
index 1cd79b4..7028eb3 100644
--- a/wear/wear-watchface-client/src/main/java/androidx/wear/watchface/client/WatchFaceMetadataClient.kt
+++ b/wear/wear-watchface-client/src/main/java/androidx/wear/watchface/client/WatchFaceMetadataClient.kt
@@ -97,12 +97,7 @@
deferredService.completeExceptionally(ServiceStartFailureException())
}
}
- if (!context.bindService(
- intent,
- serviceConnection,
- Context.BIND_AUTO_CREATE or Context.BIND_IMPORTANT
- )
- ) {
+ if (!BindHelper.bindService(context, intent, serviceConnection)) {
traceEvent.close()
throw ServiceNotBoundException()
}
diff --git a/wear/wear-watchface-complications-rendering/api/current.txt b/wear/wear-watchface-complications-rendering/api/current.txt
index f8923f6..0836044 100644
--- a/wear/wear-watchface-complications-rendering/api/current.txt
+++ b/wear/wear-watchface-complications-rendering/api/current.txt
@@ -3,11 +3,11 @@
public class CanvasComplicationDrawable implements androidx.wear.watchface.CanvasComplication {
ctor public CanvasComplicationDrawable(androidx.wear.watchface.complications.rendering.ComplicationDrawable drawable, androidx.wear.watchface.WatchState watchState, androidx.wear.watchface.CanvasComplication.InvalidateCallback invalidateCallback);
- method public void drawHighlight(android.graphics.Canvas canvas, android.graphics.Rect bounds, int boundsType, android.icu.util.Calendar calendar, @ColorInt int color);
- method public androidx.wear.complications.data.ComplicationData? getData();
+ method public void drawHighlight(android.graphics.Canvas canvas, android.graphics.Rect bounds, int boundsType, java.time.ZonedDateTime zonedDateTime, @ColorInt int color);
+ method public androidx.wear.complications.data.ComplicationData getData();
method public final androidx.wear.watchface.complications.rendering.ComplicationDrawable getDrawable();
- method @CallSuper public void loadData(androidx.wear.complications.data.ComplicationData? complicationData, boolean loadDrawablesAsynchronous);
- method public void render(android.graphics.Canvas canvas, android.graphics.Rect bounds, android.icu.util.Calendar calendar, androidx.wear.watchface.RenderParameters renderParameters, int slotId);
+ method @CallSuper public void loadData(androidx.wear.complications.data.ComplicationData complicationData, boolean loadDrawablesAsynchronous);
+ method public void render(android.graphics.Canvas canvas, android.graphics.Rect bounds, java.time.ZonedDateTime zonedDateTime, androidx.wear.watchface.RenderParameters renderParameters, int slotId);
method public final void setDrawable(androidx.wear.watchface.complications.rendering.ComplicationDrawable value);
property public final androidx.wear.watchface.complications.rendering.ComplicationDrawable drawable;
}
@@ -19,9 +19,9 @@
method public void draw(android.graphics.Canvas canvas);
method public androidx.wear.watchface.complications.rendering.ComplicationStyle getActiveStyle();
method public androidx.wear.watchface.complications.rendering.ComplicationStyle getAmbientStyle();
- method public androidx.wear.complications.data.ComplicationData? getComplicationData();
+ method public androidx.wear.complications.data.ComplicationData getComplicationData();
method public android.content.Context? getContext();
- method public long getCurrentTimeMillis();
+ method public java.time.Instant getCurrentTime();
method public static androidx.wear.watchface.complications.rendering.ComplicationDrawable? getDrawable(android.content.Context context, int id);
method public long getHighlightDuration();
method public CharSequence? getNoDataText();
@@ -35,9 +35,9 @@
method public void setAlpha(@IntRange(from=0, to=255) int alpha);
method public void setBurnInProtectionOn(boolean isBurnInProtectionOn);
method public void setColorFilter(android.graphics.ColorFilter? colorFilter);
- method public void setComplicationData(androidx.wear.complications.data.ComplicationData? complicationData, boolean loadDrawablesAsync);
+ method public void setComplicationData(androidx.wear.complications.data.ComplicationData complicationData, boolean loadDrawablesAsync);
method public void setContext(android.content.Context context);
- method public void setCurrentTimeMillis(long currentTimeMillis);
+ method public void setCurrentTime(java.time.Instant currentTime);
method public void setHighlightDuration(@IntRange(from=0) long highlightDurationMillis);
method public void setHighlighted(boolean isHighlighted);
method public void setInAmbientMode(boolean isInAmbientMode);
@@ -46,9 +46,9 @@
method public void setRangedValueProgressHidden(boolean rangedValueProgressHidden);
property public final androidx.wear.watchface.complications.rendering.ComplicationStyle activeStyle;
property public final androidx.wear.watchface.complications.rendering.ComplicationStyle ambientStyle;
- property public final androidx.wear.complications.data.ComplicationData? complicationData;
+ property public final androidx.wear.complications.data.ComplicationData complicationData;
property public final android.content.Context? context;
- property public final long currentTimeMillis;
+ property public final java.time.Instant currentTime;
property public final long highlightDuration;
property public final boolean isBurnInProtectionOn;
property public final boolean isHighlighted;
@@ -145,7 +145,7 @@
ctor public GlesTextureComplication(androidx.wear.watchface.ComplicationSlot complicationSlot, @Px int textureWidth, @Px int textureHeight, int textureType);
method public void bind();
method public androidx.wear.watchface.ComplicationSlot getComplicationSlot();
- method public void renderToTexture(android.icu.util.Calendar calendar, androidx.wear.watchface.RenderParameters renderParameters);
+ method public void renderToTexture(java.time.ZonedDateTime zonedDateTime, androidx.wear.watchface.RenderParameters renderParameters);
property public final androidx.wear.watchface.ComplicationSlot complicationSlot;
}
diff --git a/wear/wear-watchface-complications-rendering/api/public_plus_experimental_current.txt b/wear/wear-watchface-complications-rendering/api/public_plus_experimental_current.txt
index f8923f6..0836044 100644
--- a/wear/wear-watchface-complications-rendering/api/public_plus_experimental_current.txt
+++ b/wear/wear-watchface-complications-rendering/api/public_plus_experimental_current.txt
@@ -3,11 +3,11 @@
public class CanvasComplicationDrawable implements androidx.wear.watchface.CanvasComplication {
ctor public CanvasComplicationDrawable(androidx.wear.watchface.complications.rendering.ComplicationDrawable drawable, androidx.wear.watchface.WatchState watchState, androidx.wear.watchface.CanvasComplication.InvalidateCallback invalidateCallback);
- method public void drawHighlight(android.graphics.Canvas canvas, android.graphics.Rect bounds, int boundsType, android.icu.util.Calendar calendar, @ColorInt int color);
- method public androidx.wear.complications.data.ComplicationData? getData();
+ method public void drawHighlight(android.graphics.Canvas canvas, android.graphics.Rect bounds, int boundsType, java.time.ZonedDateTime zonedDateTime, @ColorInt int color);
+ method public androidx.wear.complications.data.ComplicationData getData();
method public final androidx.wear.watchface.complications.rendering.ComplicationDrawable getDrawable();
- method @CallSuper public void loadData(androidx.wear.complications.data.ComplicationData? complicationData, boolean loadDrawablesAsynchronous);
- method public void render(android.graphics.Canvas canvas, android.graphics.Rect bounds, android.icu.util.Calendar calendar, androidx.wear.watchface.RenderParameters renderParameters, int slotId);
+ method @CallSuper public void loadData(androidx.wear.complications.data.ComplicationData complicationData, boolean loadDrawablesAsynchronous);
+ method public void render(android.graphics.Canvas canvas, android.graphics.Rect bounds, java.time.ZonedDateTime zonedDateTime, androidx.wear.watchface.RenderParameters renderParameters, int slotId);
method public final void setDrawable(androidx.wear.watchface.complications.rendering.ComplicationDrawable value);
property public final androidx.wear.watchface.complications.rendering.ComplicationDrawable drawable;
}
@@ -19,9 +19,9 @@
method public void draw(android.graphics.Canvas canvas);
method public androidx.wear.watchface.complications.rendering.ComplicationStyle getActiveStyle();
method public androidx.wear.watchface.complications.rendering.ComplicationStyle getAmbientStyle();
- method public androidx.wear.complications.data.ComplicationData? getComplicationData();
+ method public androidx.wear.complications.data.ComplicationData getComplicationData();
method public android.content.Context? getContext();
- method public long getCurrentTimeMillis();
+ method public java.time.Instant getCurrentTime();
method public static androidx.wear.watchface.complications.rendering.ComplicationDrawable? getDrawable(android.content.Context context, int id);
method public long getHighlightDuration();
method public CharSequence? getNoDataText();
@@ -35,9 +35,9 @@
method public void setAlpha(@IntRange(from=0, to=255) int alpha);
method public void setBurnInProtectionOn(boolean isBurnInProtectionOn);
method public void setColorFilter(android.graphics.ColorFilter? colorFilter);
- method public void setComplicationData(androidx.wear.complications.data.ComplicationData? complicationData, boolean loadDrawablesAsync);
+ method public void setComplicationData(androidx.wear.complications.data.ComplicationData complicationData, boolean loadDrawablesAsync);
method public void setContext(android.content.Context context);
- method public void setCurrentTimeMillis(long currentTimeMillis);
+ method public void setCurrentTime(java.time.Instant currentTime);
method public void setHighlightDuration(@IntRange(from=0) long highlightDurationMillis);
method public void setHighlighted(boolean isHighlighted);
method public void setInAmbientMode(boolean isInAmbientMode);
@@ -46,9 +46,9 @@
method public void setRangedValueProgressHidden(boolean rangedValueProgressHidden);
property public final androidx.wear.watchface.complications.rendering.ComplicationStyle activeStyle;
property public final androidx.wear.watchface.complications.rendering.ComplicationStyle ambientStyle;
- property public final androidx.wear.complications.data.ComplicationData? complicationData;
+ property public final androidx.wear.complications.data.ComplicationData complicationData;
property public final android.content.Context? context;
- property public final long currentTimeMillis;
+ property public final java.time.Instant currentTime;
property public final long highlightDuration;
property public final boolean isBurnInProtectionOn;
property public final boolean isHighlighted;
@@ -145,7 +145,7 @@
ctor public GlesTextureComplication(androidx.wear.watchface.ComplicationSlot complicationSlot, @Px int textureWidth, @Px int textureHeight, int textureType);
method public void bind();
method public androidx.wear.watchface.ComplicationSlot getComplicationSlot();
- method public void renderToTexture(android.icu.util.Calendar calendar, androidx.wear.watchface.RenderParameters renderParameters);
+ method public void renderToTexture(java.time.ZonedDateTime zonedDateTime, androidx.wear.watchface.RenderParameters renderParameters);
property public final androidx.wear.watchface.ComplicationSlot complicationSlot;
}
diff --git a/wear/wear-watchface-complications-rendering/api/restricted_current.txt b/wear/wear-watchface-complications-rendering/api/restricted_current.txt
index 8781006..c4bdb37 100644
--- a/wear/wear-watchface-complications-rendering/api/restricted_current.txt
+++ b/wear/wear-watchface-complications-rendering/api/restricted_current.txt
@@ -3,11 +3,11 @@
public class CanvasComplicationDrawable implements androidx.wear.watchface.CanvasComplication {
ctor public CanvasComplicationDrawable(androidx.wear.watchface.complications.rendering.ComplicationDrawable drawable, androidx.wear.watchface.WatchState watchState, androidx.wear.watchface.CanvasComplication.InvalidateCallback invalidateCallback);
- method public void drawHighlight(android.graphics.Canvas canvas, android.graphics.Rect bounds, int boundsType, android.icu.util.Calendar calendar, @ColorInt int color);
- method public androidx.wear.complications.data.ComplicationData? getData();
+ method public void drawHighlight(android.graphics.Canvas canvas, android.graphics.Rect bounds, int boundsType, java.time.ZonedDateTime zonedDateTime, @ColorInt int color);
+ method public androidx.wear.complications.data.ComplicationData getData();
method public final androidx.wear.watchface.complications.rendering.ComplicationDrawable getDrawable();
- method @CallSuper public void loadData(androidx.wear.complications.data.ComplicationData? complicationData, boolean loadDrawablesAsynchronous);
- method public void render(android.graphics.Canvas canvas, android.graphics.Rect bounds, android.icu.util.Calendar calendar, androidx.wear.watchface.RenderParameters renderParameters, int slotId);
+ method @CallSuper public void loadData(androidx.wear.complications.data.ComplicationData complicationData, boolean loadDrawablesAsynchronous);
+ method public void render(android.graphics.Canvas canvas, android.graphics.Rect bounds, java.time.ZonedDateTime zonedDateTime, androidx.wear.watchface.RenderParameters renderParameters, int slotId);
method public final void setDrawable(androidx.wear.watchface.complications.rendering.ComplicationDrawable value);
property public final androidx.wear.watchface.complications.rendering.ComplicationDrawable drawable;
}
@@ -19,9 +19,9 @@
method public void draw(android.graphics.Canvas canvas);
method public androidx.wear.watchface.complications.rendering.ComplicationStyle getActiveStyle();
method public androidx.wear.watchface.complications.rendering.ComplicationStyle getAmbientStyle();
- method public androidx.wear.complications.data.ComplicationData? getComplicationData();
+ method public androidx.wear.complications.data.ComplicationData getComplicationData();
method public android.content.Context? getContext();
- method public long getCurrentTimeMillis();
+ method public java.time.Instant getCurrentTime();
method public static androidx.wear.watchface.complications.rendering.ComplicationDrawable? getDrawable(android.content.Context context, int id);
method public long getHighlightDuration();
method public CharSequence? getNoDataText();
@@ -35,9 +35,9 @@
method public void setAlpha(@IntRange(from=0, to=255) int alpha);
method public void setBurnInProtectionOn(boolean isBurnInProtectionOn);
method public void setColorFilter(android.graphics.ColorFilter? colorFilter);
- method public void setComplicationData(androidx.wear.complications.data.ComplicationData? complicationData, boolean loadDrawablesAsync);
+ method public void setComplicationData(androidx.wear.complications.data.ComplicationData complicationData, boolean loadDrawablesAsync);
method public void setContext(android.content.Context context);
- method public void setCurrentTimeMillis(long currentTimeMillis);
+ method public void setCurrentTime(java.time.Instant currentTime);
method public void setHighlightDuration(@IntRange(from=0) long highlightDurationMillis);
method public void setHighlighted(boolean isHighlighted);
method public void setInAmbientMode(boolean isInAmbientMode);
@@ -46,9 +46,9 @@
method public void setRangedValueProgressHidden(boolean rangedValueProgressHidden);
property public final androidx.wear.watchface.complications.rendering.ComplicationStyle activeStyle;
property public final androidx.wear.watchface.complications.rendering.ComplicationStyle ambientStyle;
- property public final androidx.wear.complications.data.ComplicationData? complicationData;
+ property public final androidx.wear.complications.data.ComplicationData complicationData;
property public final android.content.Context? context;
- property public final long currentTimeMillis;
+ property public final java.time.Instant currentTime;
property public final long highlightDuration;
property public final boolean isBurnInProtectionOn;
property public final boolean isHighlighted;
@@ -148,7 +148,7 @@
ctor public GlesTextureComplication(androidx.wear.watchface.ComplicationSlot complicationSlot, @Px int textureWidth, @Px int textureHeight, int textureType);
method public void bind();
method public androidx.wear.watchface.ComplicationSlot getComplicationSlot();
- method public void renderToTexture(android.icu.util.Calendar calendar, androidx.wear.watchface.RenderParameters renderParameters);
+ method public void renderToTexture(java.time.ZonedDateTime zonedDateTime, androidx.wear.watchface.RenderParameters renderParameters);
property public final androidx.wear.watchface.ComplicationSlot complicationSlot;
}
diff --git a/wear/wear-watchface-complications-rendering/build.gradle b/wear/wear-watchface-complications-rendering/build.gradle
index 708f68d..bcd44e9 100644
--- a/wear/wear-watchface-complications-rendering/build.gradle
+++ b/wear/wear-watchface-complications-rendering/build.gradle
@@ -52,7 +52,7 @@
aidl = true
}
defaultConfig {
- minSdkVersion 25
+ minSdkVersion 26
}
// Use Robolectric 4.+
diff --git a/wear/wear-watchface-complications-rendering/src/main/java/androidx/wear/watchface/complications/rendering/CanvasComplicationDrawable.kt b/wear/wear-watchface-complications-rendering/src/main/java/androidx/wear/watchface/complications/rendering/CanvasComplicationDrawable.kt
index 8e5c1bd..dd4f493 100644
--- a/wear/wear-watchface-complications-rendering/src/main/java/androidx/wear/watchface/complications/rendering/CanvasComplicationDrawable.kt
+++ b/wear/wear-watchface-complications-rendering/src/main/java/androidx/wear/watchface/complications/rendering/CanvasComplicationDrawable.kt
@@ -21,11 +21,11 @@
import android.graphics.Canvas
import android.graphics.Rect
import android.graphics.drawable.Drawable
-import android.icu.util.Calendar
import android.util.TypedValue
import androidx.annotation.CallSuper
import androidx.annotation.ColorInt
import androidx.wear.complications.data.ComplicationData
+import androidx.wear.complications.data.NoDataComplicationData
import androidx.wear.utility.TraceEvent
import androidx.wear.watchface.CanvasComplication
import androidx.wear.watchface.DrawMode
@@ -33,6 +33,7 @@
import androidx.wear.watchface.WatchState
import androidx.wear.watchface.ComplicationSlotBoundsType
import androidx.wear.watchface.style.WatchFaceLayer
+import java.time.ZonedDateTime
/**
* A complication rendered with [ComplicationDrawable] which renders complicationSlots in a material
@@ -104,7 +105,7 @@
override fun render(
canvas: Canvas,
bounds: Rect,
- calendar: Calendar,
+ zonedDateTime: ZonedDateTime,
renderParameters: RenderParameters,
slotId: Int
) {
@@ -114,11 +115,11 @@
drawable.isInAmbientMode = renderParameters.drawMode == DrawMode.AMBIENT
drawable.bounds = bounds
- drawable.currentTimeMillis = calendar.timeInMillis
+ drawable.currentTime = zonedDateTime.toInstant()
drawable.isHighlighted = renderParameters.lastComplicationTapDownEvents[slotId]?.let {
- val startTime = it.tapTimeMillis
- val endTime = it.tapTimeMillis + COMPLICATION_HIGHLIGHT_DURATION_MS
- calendar.timeInMillis in startTime until endTime
+ val startTime = it.tapTime.toEpochMilli()
+ val endTime = it.tapTime.toEpochMilli() + COMPLICATION_HIGHLIGHT_DURATION_MS
+ zonedDateTime.toInstant().toEpochMilli() in startTime until endTime
} ?: false
drawable.draw(canvas)
}
@@ -127,7 +128,7 @@
canvas: Canvas,
bounds: Rect,
boundsType: Int,
- calendar: Calendar,
+ zonedDateTime: ZonedDateTime,
@ColorInt color: Int
) {
if (boundsType == ComplicationSlotBoundsType.ROUND_RECT) {
@@ -139,10 +140,10 @@
}
}
- private var _data: ComplicationData? = null
+ private var _data: ComplicationData = NoDataComplicationData()
- /** Returns the [ComplicationData] to render with. */
- override fun getData(): ComplicationData? = _data
+ /** Returns the [ComplicationData] to render with. This defaults to [NoDataComplicationData]. */
+ override fun getData(): ComplicationData = _data
/**
* Updates the [ComplicationData] used for rendering and loads any [Drawable]s within the
@@ -157,7 +158,7 @@
*/
@CallSuper
override fun loadData(
- complicationData: ComplicationData?,
+ complicationData: ComplicationData,
loadDrawablesAsynchronous: Boolean
): Unit = TraceEvent("CanvasComplicationDrawable.setIdAndData").use {
_data = complicationData
diff --git a/wear/wear-watchface-complications-rendering/src/main/java/androidx/wear/watchface/complications/rendering/ComplicationDrawable.kt b/wear/wear-watchface-complications-rendering/src/main/java/androidx/wear/watchface/complications/rendering/ComplicationDrawable.kt
index d90af48..de55990 100644
--- a/wear/wear-watchface-complications-rendering/src/main/java/androidx/wear/watchface/complications/rendering/ComplicationDrawable.kt
+++ b/wear/wear-watchface-complications-rendering/src/main/java/androidx/wear/watchface/complications/rendering/ComplicationDrawable.kt
@@ -39,11 +39,13 @@
import androidx.wear.complications.data.ComplicationType.NO_DATA
import androidx.wear.complications.data.ComplicationType.NO_PERMISSION
import androidx.wear.complications.data.ComplicationType.RANGED_VALUE
+import androidx.wear.complications.data.NoDataComplicationData
import androidx.wear.watchface.ComplicationHelperActivity
import androidx.wear.watchface.complications.rendering.ComplicationRenderer.OnInvalidateListener
import org.xmlpull.v1.XmlPullParser
import org.xmlpull.v1.XmlPullParserException
import java.io.IOException
+import java.time.Instant
/**
* A styleable drawable object that draws complicationSlots. You can create a ComplicationDrawable from
@@ -209,7 +211,7 @@
* The time in milliseconds since the epoch used for rendering [ComplicationData] with time
* dependent text.
*/
- public var currentTimeMillis: Long = 0
+ public var currentTime: Instant = Instant.EPOCH
/** Whether the complication is rendered in ambient mode. */
public var isInAmbientMode: Boolean = false
@@ -259,7 +261,7 @@
ambientStyle = ComplicationStyle(drawable.ambientStyle)
noDataText = drawable.noDataText!!.subSequence(0, drawable.noDataText!!.length)
highlightDuration = drawable.highlightDuration
- currentTimeMillis = drawable.currentTimeMillis
+ currentTime = drawable.currentTime
bounds = drawable.bounds
isInAmbientMode = drawable.isInAmbientMode
isLowBitAmbient = drawable.isLowBitAmbient
@@ -509,7 +511,7 @@
updateStyleIfRequired()
complicationRenderer?.draw(
canvas,
- currentTimeMillis,
+ currentTime,
isInAmbientMode,
isLowBitAmbient,
isBurnInProtectionOn,
@@ -568,7 +570,7 @@
* otherwise they will be loaded synchronously.
*/
public fun setComplicationData(
- complicationData: ComplicationData?,
+ complicationData: ComplicationData,
loadDrawablesAsync: Boolean
) {
this.complicationData = complicationData
@@ -587,21 +589,29 @@
// Replace this InvalidateListener with the normal one.
nextRenderer.setOnInvalidateListener(rendererInvalidateListener)
}
- nextRenderer.setComplicationData(complicationData?.asWireComplicationData(), true)
+ nextRenderer.setComplicationData(complicationData.asWireComplicationData(), true)
} else {
complicationRenderer?.setComplicationData(
- complicationData?.asWireComplicationData(),
+ complicationData.asWireComplicationData(),
false
)
}
}
/**
- * Returns the [ComplicationData] to be drawn by this ComplicationDrawable.
+ * Returns the [ComplicationData] to be drawn by this ComplicationDrawable. This defaults to
+ * [NoDataComplicationData].
*/
- public var complicationData: ComplicationData? = null
+ public var complicationData: ComplicationData = NoDataComplicationData()
private set
+ init {
+ complicationRenderer?.setComplicationData(
+ complicationData.asWireComplicationData(),
+ false
+ )
+ }
+
/**
* Sends the tap action for the complication if tap coordinates are inside the complication
* bounds.
diff --git a/wear/wear-watchface-complications-rendering/src/main/java/androidx/wear/watchface/complications/rendering/ComplicationRenderer.java b/wear/wear-watchface-complications-rendering/src/main/java/androidx/wear/watchface/complications/rendering/ComplicationRenderer.java
index 868cee7..e4059ff 100644
--- a/wear/wear-watchface-complications-rendering/src/main/java/androidx/wear/watchface/complications/rendering/ComplicationRenderer.java
+++ b/wear/wear-watchface-complications-rendering/src/main/java/androidx/wear/watchface/complications/rendering/ComplicationRenderer.java
@@ -53,6 +53,7 @@
import androidx.wear.watchface.complications.rendering.utils.ShortTextLayoutHelper;
import androidx.wear.watchface.complications.rendering.utils.SmallImageLayoutHelper;
+import java.time.Instant;
import java.util.Objects;
/**
@@ -314,7 +315,7 @@
* 'empty' or 'not configured', or is not active.
*
* @param canvas canvas to be drawn on.
- * @param currentTimeMillis current system time in millis since epoch.
+ * @param currentTime current time as an {@link Instant}
* @param inAmbientMode true if the device is in ambient mode.
* @param lowBitAmbient true if the screen supports fewer bits for each color in ambient
* mode.
@@ -324,7 +325,7 @@
*/
public void draw(
@NonNull Canvas canvas,
- long currentTimeMillis,
+ Instant currentTime,
boolean inAmbientMode,
boolean lowBitAmbient,
boolean burnInProtection,
@@ -333,7 +334,7 @@
if (mComplicationData == null
|| mComplicationData.getType() == ComplicationData.TYPE_EMPTY
|| mComplicationData.getType() == ComplicationData.TYPE_NOT_CONFIGURED
- || !mComplicationData.isActiveAt(currentTimeMillis)
+ || !mComplicationData.isActiveAt(currentTime.toEpochMilli())
|| mBounds.isEmpty()) {
return;
}
@@ -347,7 +348,7 @@
// Choose the correct paint set to use
PaintSet currentPaintSet = inAmbientMode ? mAmbientPaintSet : mActivePaintSet;
// Update complication texts
- updateComplicationTexts(currentTimeMillis);
+ updateComplicationTexts(currentTime.toEpochMilli());
canvas.save();
canvas.translate(mBounds.left, mBounds.top);
// Draw background first
diff --git a/wear/wear-watchface-complications-rendering/src/main/java/androidx/wear/watchface/complications/rendering/GlesTextureComplication.kt b/wear/wear-watchface-complications-rendering/src/main/java/androidx/wear/watchface/complications/rendering/GlesTextureComplication.kt
index c7b9a45..e1ed591 100644
--- a/wear/wear-watchface-complications-rendering/src/main/java/androidx/wear/watchface/complications/rendering/GlesTextureComplication.kt
+++ b/wear/wear-watchface-complications-rendering/src/main/java/androidx/wear/watchface/complications/rendering/GlesTextureComplication.kt
@@ -20,12 +20,12 @@
import android.graphics.Canvas
import android.graphics.Color
import android.graphics.Rect
-import android.icu.util.Calendar
import android.opengl.GLES20
import android.opengl.GLUtils
import androidx.annotation.Px
import androidx.wear.watchface.ComplicationSlot
import androidx.wear.watchface.RenderParameters
+import java.time.ZonedDateTime
/**
* Helper for rendering a [ComplicationSlot] to a GLES20 texture. To use call [renderToTexture]
@@ -52,12 +52,12 @@
private val bounds = Rect(0, 0, textureWidth, textureHeight)
/** Renders [complicationSlot] to an OpenGL texture. */
- public fun renderToTexture(calendar: Calendar, renderParameters: RenderParameters) {
+ public fun renderToTexture(zonedDateTime: ZonedDateTime, renderParameters: RenderParameters) {
canvas.drawColor(Color.BLACK)
complicationSlot.renderer.render(
canvas,
bounds,
- calendar,
+ zonedDateTime,
renderParameters,
complicationSlot.id
)
diff --git a/wear/wear-watchface-complications-rendering/src/test/java/androidx/wear/watchface/complications/rendering/CanvasComplicationDrawableTest.kt b/wear/wear-watchface-complications-rendering/src/test/java/androidx/wear/watchface/complications/rendering/CanvasComplicationDrawableTest.kt
index 972e9fc..f3d831e 100644
--- a/wear/wear-watchface-complications-rendering/src/test/java/androidx/wear/watchface/complications/rendering/CanvasComplicationDrawableTest.kt
+++ b/wear/wear-watchface-complications-rendering/src/test/java/androidx/wear/watchface/complications/rendering/CanvasComplicationDrawableTest.kt
@@ -19,8 +19,6 @@
import android.graphics.Bitmap
import android.graphics.Canvas
import android.graphics.Rect
-import android.icu.util.Calendar
-import android.icu.util.TimeZone
import androidx.test.core.app.ApplicationProvider
import androidx.wear.watchface.CanvasComplication
import androidx.wear.watchface.DrawMode
@@ -32,6 +30,9 @@
import org.junit.Test
import org.junit.runner.RunWith
import org.mockito.Mockito
+import java.time.Instant
+import java.time.ZoneId
+import java.time.ZonedDateTime
@RunWith(ComplicationsTestRunner::class)
public class CanvasComplicationDrawableTest {
@@ -42,7 +43,8 @@
private val bitmap = Bitmap.createBitmap(100, 100, Bitmap.Config.ARGB_8888)
private val bounds = Rect(0, 0, 100, 100)
private val canvas = Canvas(bitmap)
- private val calendar = Calendar.getInstance(TimeZone.GMT_ZONE)
+ private val zonedDateTime =
+ ZonedDateTime.ofInstant(Instant.ofEpochMilli(1234), ZoneId.of("UTC"))
private val canvasComplicationDrawable = CanvasComplicationDrawable(
complicationDrawable,
watchState.asWatchState(),
@@ -55,7 +57,7 @@
canvasComplicationDrawable.render(
canvas,
bounds,
- calendar,
+ zonedDateTime,
RenderParameters(
DrawMode.AMBIENT,
setOf(WatchFaceLayer.BASE, WatchFaceLayer.COMPLICATIONS),
@@ -69,7 +71,7 @@
canvasComplicationDrawable.render(
canvas,
bounds,
- calendar,
+ zonedDateTime,
RenderParameters(
DrawMode.INTERACTIVE,
setOf(WatchFaceLayer.BASE, WatchFaceLayer.COMPLICATIONS),
@@ -86,7 +88,7 @@
canvasComplicationDrawable.render(
canvas,
bounds,
- calendar,
+ zonedDateTime,
RenderParameters(
DrawMode.INTERACTIVE,
setOf(WatchFaceLayer.BASE, WatchFaceLayer.COMPLICATIONS),
@@ -100,11 +102,10 @@
@Test
public fun render_currentTimeMillis() {
- calendar.timeInMillis = 1234
canvasComplicationDrawable.render(
canvas,
bounds,
- calendar,
+ zonedDateTime,
RenderParameters(
DrawMode.INTERACTIVE,
setOf(WatchFaceLayer.BASE, WatchFaceLayer.COMPLICATIONS),
@@ -113,7 +114,7 @@
),
slotId
)
- assertThat(complicationDrawable.currentTimeMillis).isEqualTo(1234)
+ assertThat(complicationDrawable.currentTime.toEpochMilli()).isEqualTo(1234)
}
@Test
@@ -122,23 +123,34 @@
DrawMode.INTERACTIVE,
setOf(WatchFaceLayer.BASE, WatchFaceLayer.COMPLICATIONS),
null,
- mapOf(slotId to TapEvent(50, 50, 1100))
+ mapOf(slotId to TapEvent(50, 50, Instant.ofEpochMilli(1100)))
)
- calendar.timeInMillis = 1099
- canvasComplicationDrawable.render(canvas, bounds, calendar, renderParameters, slotId)
+ val t1099 = ZonedDateTime.ofInstant(Instant.ofEpochMilli(1099), ZoneId.of("UTC"))
+ canvasComplicationDrawable.render(canvas, bounds, t1099, renderParameters, slotId)
assertThat(complicationDrawable.isHighlighted).isFalse()
- calendar.timeInMillis = 1100
- canvasComplicationDrawable.render(canvas, bounds, calendar, renderParameters, slotId)
+ val t1100 = ZonedDateTime.ofInstant(Instant.ofEpochMilli(1100), ZoneId.of("UTC"))
+ canvasComplicationDrawable.render(canvas, bounds, t1100, renderParameters, slotId)
assertThat(complicationDrawable.isHighlighted).isTrue()
- calendar.timeInMillis = 1099 + CanvasComplicationDrawable.COMPLICATION_HIGHLIGHT_DURATION_MS
- canvasComplicationDrawable.render(canvas, bounds, calendar, renderParameters, slotId)
+ val t1099_plus = ZonedDateTime.ofInstant(
+ Instant.ofEpochMilli(
+ 1099 + CanvasComplicationDrawable.COMPLICATION_HIGHLIGHT_DURATION_MS
+ ),
+ ZoneId.of("UTC")
+ )
+
+ canvasComplicationDrawable.render(canvas, bounds, t1099_plus, renderParameters, slotId)
assertThat(complicationDrawable.isHighlighted).isTrue()
- calendar.timeInMillis = 1100 + CanvasComplicationDrawable.COMPLICATION_HIGHLIGHT_DURATION_MS
- canvasComplicationDrawable.render(canvas, bounds, calendar, renderParameters, slotId)
+ val t1100_plus = ZonedDateTime.ofInstant(
+ Instant.ofEpochMilli(
+ 1100 + CanvasComplicationDrawable.COMPLICATION_HIGHLIGHT_DURATION_MS
+ ),
+ ZoneId.of("UTC")
+ )
+ canvasComplicationDrawable.render(canvas, bounds, t1100_plus, renderParameters, slotId)
assertThat(complicationDrawable.isHighlighted).isFalse()
}
-}
\ No newline at end of file
+}
diff --git a/wear/wear-watchface-complications-rendering/src/test/java/androidx/wear/watchface/complications/rendering/ComplicationDrawableTest.java b/wear/wear-watchface-complications-rendering/src/test/java/androidx/wear/watchface/complications/rendering/ComplicationDrawableTest.java
index 50f93d2..19624f1 100644
--- a/wear/wear-watchface-complications-rendering/src/test/java/androidx/wear/watchface/complications/rendering/ComplicationDrawableTest.java
+++ b/wear/wear-watchface-complications-rendering/src/test/java/androidx/wear/watchface/complications/rendering/ComplicationDrawableTest.java
@@ -42,7 +42,6 @@
import android.graphics.Rect;
import android.graphics.Typeface;
import android.graphics.drawable.Drawable;
-import android.icu.util.Calendar;
import android.support.wearable.complications.ComplicationData;
import android.support.wearable.complications.ComplicationText;
import android.view.SurfaceHolder;
@@ -50,6 +49,7 @@
import androidx.annotation.NonNull;
import androidx.test.core.app.ApplicationProvider;
import androidx.wear.complications.data.DataKt;
+import androidx.wear.complications.data.NoDataComplicationData;
import androidx.wear.watchface.CanvasType;
import androidx.wear.watchface.ComplicationHelperActivity;
import androidx.wear.watchface.ComplicationSlotsManager;
@@ -70,6 +70,7 @@
import org.robolectric.Robolectric;
import org.robolectric.annotation.internal.DoNotInstrument;
+import java.time.ZonedDateTime;
import java.util.concurrent.TimeUnit;
import kotlin.coroutines.Continuation;
@@ -371,7 +372,7 @@
@Test
public void onTapReturnsFalseIfNoComplicationData() {
mComplicationDrawable.setContext(ApplicationProvider.getApplicationContext());
- mComplicationDrawable.setComplicationData(null, true);
+ mComplicationDrawable.setComplicationData(new NoDataComplicationData(), true);
mComplicationDrawable.setBounds(new Rect(0, 0, 100, 100));
assertThat(mComplicationDrawable.onTap(50, 50)).isFalse();
@@ -752,11 +753,11 @@
CanvasType.SOFTWARE, 16L) {
@Override
public void renderHighlightLayer(@NonNull Canvas canvas,
- @NonNull Rect bounds, @NonNull Calendar calendar) {}
+ @NonNull Rect bounds, @NonNull ZonedDateTime zonedDateTime) {}
@Override
public void render(@NonNull Canvas canvas, @NonNull Rect bounds,
- @NonNull Calendar calendar) {}
+ @NonNull ZonedDateTime zonedDateTime) {}
}
);
}
diff --git a/wear/wear-watchface-complications-rendering/src/test/java/androidx/wear/watchface/complications/rendering/ComplicationRendererTest.java b/wear/wear-watchface-complications-rendering/src/test/java/androidx/wear/watchface/complications/rendering/ComplicationRendererTest.java
index 2b9bbce..c7339c0 100644
--- a/wear/wear-watchface-complications-rendering/src/test/java/androidx/wear/watchface/complications/rendering/ComplicationRendererTest.java
+++ b/wear/wear-watchface-complications-rendering/src/test/java/androidx/wear/watchface/complications/rendering/ComplicationRendererTest.java
@@ -59,12 +59,15 @@
import org.mockito.MockitoAnnotations;
import org.robolectric.annotation.internal.DoNotInstrument;
+import java.time.Instant;
+
/** Tests for {@link ComplicationRenderer}. */
@RunWith(ComplicationsTestRunner.class)
@DoNotInstrument
public class ComplicationRendererTest {
- private static final long REFERENCE_TIME = 1234567890123L; // Fri, 13 Feb 2009 23:31:30.123 GMT
+ private static final Instant REFERENCE_TIME =
+ Instant.ofEpochMilli(1234567890123L); // Fri, 13 Feb 2009 23:31:30.123 GMT
private static final int BOUNDS_WIDTH = 100;
private static final int BOUNDS_HEIGHT = 100;
@@ -110,7 +113,7 @@
assertThat(mComplicationRenderer
.getComplicationData()
.getShortText()
- .getTextAt(mResurces, REFERENCE_TIME))
+ .getTextAt(mResurces, REFERENCE_TIME.toEpochMilli()))
.isEqualTo(noDataText);
}
@@ -126,14 +129,14 @@
mComplicationRenderer
.getComplicationData()
.getShortText()
- .getTextAt(mResurces, REFERENCE_TIME);
+ .getTextAt(mResurces, REFERENCE_TIME.toEpochMilli());
mComplicationRenderer.setNoDataText(secondText);
CharSequence secondResult =
mComplicationRenderer
.getComplicationData()
.getShortText()
- .getTextAt(mResurces, REFERENCE_TIME);
+ .getTextAt(mResurces, REFERENCE_TIME.toEpochMilli());
assertThat(firstResult).isEqualTo(firstText);
assertThat(secondResult).isEqualTo(secondText);
@@ -153,7 +156,7 @@
mComplicationRenderer
.getComplicationData()
.getShortText()
- .getTextAt(mResurces, REFERENCE_TIME);
+ .getTextAt(mResurces, REFERENCE_TIME.toEpochMilli());
text.setSpan(blueSpan, 0, 2, Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
mComplicationRenderer.setNoDataText(text);
@@ -161,7 +164,7 @@
mComplicationRenderer
.getComplicationData()
.getShortText()
- .getTextAt(mResurces, REFERENCE_TIME);
+ .getTextAt(mResurces, REFERENCE_TIME.toEpochMilli());
assertThat(text).isEqualTo(secondResult);
assertThat(firstResult).isNotEqualTo(secondResult);
@@ -182,7 +185,7 @@
mComplicationRenderer
.getComplicationData()
.getShortText()
- .getTextAt(mResurces, REFERENCE_TIME);
+ .getTextAt(mResurces, REFERENCE_TIME.toEpochMilli());
text.setSpan(blueSpan, 0, 2, Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
@@ -192,7 +195,7 @@
mComplicationRenderer
.getComplicationData()
.getShortText()
- .getTextAt(mResurces, REFERENCE_TIME);
+ .getTextAt(mResurces, REFERENCE_TIME.toEpochMilli());
assertThat(firstResult).isEqualTo(secondResult);
assertThat(text).isNotEqualTo(firstResult);
@@ -321,7 +324,7 @@
mComplicationRenderer.setComplicationData(
new ComplicationData.Builder(ComplicationData.TYPE_SHORT_TEXT)
.setShortText(ComplicationText.plainText("hello"))
- .setEndDateTimeMillis(REFERENCE_TIME - 100)
+ .setEndDateTimeMillis(REFERENCE_TIME.toEpochMilli() - 100)
.build(),
true);
@@ -338,8 +341,8 @@
mComplicationRenderer.setComplicationData(
new ComplicationData.Builder(ComplicationData.TYPE_SHORT_TEXT)
.setShortText(ComplicationText.plainText("hello"))
- .setStartDateTimeMillis(REFERENCE_TIME - 5000)
- .setEndDateTimeMillis(REFERENCE_TIME + 2000)
+ .setStartDateTimeMillis(REFERENCE_TIME.toEpochMilli() - 5000)
+ .setEndDateTimeMillis(REFERENCE_TIME.toEpochMilli() + 2000)
.build(),
true);
diff --git a/wear/wear-watchface-data/build.gradle b/wear/wear-watchface-data/build.gradle
index 806ea2d..a3127f8 100644
--- a/wear/wear-watchface-data/build.gradle
+++ b/wear/wear-watchface-data/build.gradle
@@ -36,7 +36,7 @@
android {
defaultConfig {
- minSdkVersion 25
+ minSdkVersion 26
}
buildFeatures {
diff --git a/wear/wear-watchface-editor-guava/api/current.txt b/wear/wear-watchface-editor-guava/api/current.txt
index e1412d2..96bcc7b 100644
--- a/wear/wear-watchface-editor-guava/api/current.txt
+++ b/wear/wear-watchface-editor-guava/api/current.txt
@@ -12,7 +12,7 @@
method public suspend Object? getComplicationsPreviewData(kotlin.coroutines.Continuation<? super java.util.Map<java.lang.Integer,? extends androidx.wear.complications.data.ComplicationData>> p);
method public com.google.common.util.concurrent.ListenableFuture<java.util.Map<java.lang.Integer,androidx.wear.complications.data.ComplicationData>> getListenableComplicationPreviewData();
method public com.google.common.util.concurrent.ListenableFuture<java.util.Map<java.lang.Integer,androidx.wear.complications.ComplicationDataSourceInfo>> getListenableComplicationsProviderInfo();
- method public long getPreviewReferenceTimeMillis();
+ method public java.time.Instant getPreviewReferenceInstant();
method public androidx.wear.watchface.style.UserStyle getUserStyle();
method public androidx.wear.watchface.style.UserStyleSchema getUserStyleSchema();
method public android.content.ComponentName getWatchFaceComponentName();
@@ -21,13 +21,13 @@
method @UiThread public static com.google.common.util.concurrent.ListenableFuture<androidx.wear.watchface.editor.ListenableEditorSession> listenableCreateOnWatchEditorSession(androidx.activity.ComponentActivity activity, android.content.Intent editIntent);
method public com.google.common.util.concurrent.ListenableFuture<androidx.wear.watchface.editor.ChosenComplicationDataSource> listenableOpenComplicationDataSourceChooser(int complicationSlotId);
method public suspend Object? openComplicationDataSourceChooser(int complicationSlotId, kotlin.coroutines.Continuation<? super androidx.wear.watchface.editor.ChosenComplicationDataSource> p);
- method public android.graphics.Bitmap renderWatchFaceToBitmap(androidx.wear.watchface.RenderParameters renderParameters, long calendarTimeMillis, java.util.Map<java.lang.Integer,? extends androidx.wear.complications.data.ComplicationData>? slotIdToComplicationData);
+ method public android.graphics.Bitmap renderWatchFaceToBitmap(androidx.wear.watchface.RenderParameters renderParameters, java.time.Instant instant, java.util.Map<java.lang.Integer,? extends androidx.wear.complications.data.ComplicationData>? slotIdToComplicationData);
method public void setCommitChangesOnClose(boolean commitChangesOnClose);
method public void setUserStyle(androidx.wear.watchface.style.UserStyle userStyle);
property public Integer? backgroundComplicationSlotId;
property public boolean commitChangesOnClose;
property public java.util.Map<java.lang.Integer,androidx.wear.watchface.client.ComplicationSlotState> complicationSlotsState;
- property public long previewReferenceTimeMillis;
+ property public java.time.Instant previewReferenceInstant;
property public androidx.wear.watchface.style.UserStyle userStyle;
property public androidx.wear.watchface.style.UserStyleSchema userStyleSchema;
property public android.content.ComponentName watchFaceComponentName;
diff --git a/wear/wear-watchface-editor-guava/api/public_plus_experimental_current.txt b/wear/wear-watchface-editor-guava/api/public_plus_experimental_current.txt
index e1412d2..96bcc7b 100644
--- a/wear/wear-watchface-editor-guava/api/public_plus_experimental_current.txt
+++ b/wear/wear-watchface-editor-guava/api/public_plus_experimental_current.txt
@@ -12,7 +12,7 @@
method public suspend Object? getComplicationsPreviewData(kotlin.coroutines.Continuation<? super java.util.Map<java.lang.Integer,? extends androidx.wear.complications.data.ComplicationData>> p);
method public com.google.common.util.concurrent.ListenableFuture<java.util.Map<java.lang.Integer,androidx.wear.complications.data.ComplicationData>> getListenableComplicationPreviewData();
method public com.google.common.util.concurrent.ListenableFuture<java.util.Map<java.lang.Integer,androidx.wear.complications.ComplicationDataSourceInfo>> getListenableComplicationsProviderInfo();
- method public long getPreviewReferenceTimeMillis();
+ method public java.time.Instant getPreviewReferenceInstant();
method public androidx.wear.watchface.style.UserStyle getUserStyle();
method public androidx.wear.watchface.style.UserStyleSchema getUserStyleSchema();
method public android.content.ComponentName getWatchFaceComponentName();
@@ -21,13 +21,13 @@
method @UiThread public static com.google.common.util.concurrent.ListenableFuture<androidx.wear.watchface.editor.ListenableEditorSession> listenableCreateOnWatchEditorSession(androidx.activity.ComponentActivity activity, android.content.Intent editIntent);
method public com.google.common.util.concurrent.ListenableFuture<androidx.wear.watchface.editor.ChosenComplicationDataSource> listenableOpenComplicationDataSourceChooser(int complicationSlotId);
method public suspend Object? openComplicationDataSourceChooser(int complicationSlotId, kotlin.coroutines.Continuation<? super androidx.wear.watchface.editor.ChosenComplicationDataSource> p);
- method public android.graphics.Bitmap renderWatchFaceToBitmap(androidx.wear.watchface.RenderParameters renderParameters, long calendarTimeMillis, java.util.Map<java.lang.Integer,? extends androidx.wear.complications.data.ComplicationData>? slotIdToComplicationData);
+ method public android.graphics.Bitmap renderWatchFaceToBitmap(androidx.wear.watchface.RenderParameters renderParameters, java.time.Instant instant, java.util.Map<java.lang.Integer,? extends androidx.wear.complications.data.ComplicationData>? slotIdToComplicationData);
method public void setCommitChangesOnClose(boolean commitChangesOnClose);
method public void setUserStyle(androidx.wear.watchface.style.UserStyle userStyle);
property public Integer? backgroundComplicationSlotId;
property public boolean commitChangesOnClose;
property public java.util.Map<java.lang.Integer,androidx.wear.watchface.client.ComplicationSlotState> complicationSlotsState;
- property public long previewReferenceTimeMillis;
+ property public java.time.Instant previewReferenceInstant;
property public androidx.wear.watchface.style.UserStyle userStyle;
property public androidx.wear.watchface.style.UserStyleSchema userStyleSchema;
property public android.content.ComponentName watchFaceComponentName;
diff --git a/wear/wear-watchface-editor-guava/api/restricted_current.txt b/wear/wear-watchface-editor-guava/api/restricted_current.txt
index e1412d2..96bcc7b 100644
--- a/wear/wear-watchface-editor-guava/api/restricted_current.txt
+++ b/wear/wear-watchface-editor-guava/api/restricted_current.txt
@@ -12,7 +12,7 @@
method public suspend Object? getComplicationsPreviewData(kotlin.coroutines.Continuation<? super java.util.Map<java.lang.Integer,? extends androidx.wear.complications.data.ComplicationData>> p);
method public com.google.common.util.concurrent.ListenableFuture<java.util.Map<java.lang.Integer,androidx.wear.complications.data.ComplicationData>> getListenableComplicationPreviewData();
method public com.google.common.util.concurrent.ListenableFuture<java.util.Map<java.lang.Integer,androidx.wear.complications.ComplicationDataSourceInfo>> getListenableComplicationsProviderInfo();
- method public long getPreviewReferenceTimeMillis();
+ method public java.time.Instant getPreviewReferenceInstant();
method public androidx.wear.watchface.style.UserStyle getUserStyle();
method public androidx.wear.watchface.style.UserStyleSchema getUserStyleSchema();
method public android.content.ComponentName getWatchFaceComponentName();
@@ -21,13 +21,13 @@
method @UiThread public static com.google.common.util.concurrent.ListenableFuture<androidx.wear.watchface.editor.ListenableEditorSession> listenableCreateOnWatchEditorSession(androidx.activity.ComponentActivity activity, android.content.Intent editIntent);
method public com.google.common.util.concurrent.ListenableFuture<androidx.wear.watchface.editor.ChosenComplicationDataSource> listenableOpenComplicationDataSourceChooser(int complicationSlotId);
method public suspend Object? openComplicationDataSourceChooser(int complicationSlotId, kotlin.coroutines.Continuation<? super androidx.wear.watchface.editor.ChosenComplicationDataSource> p);
- method public android.graphics.Bitmap renderWatchFaceToBitmap(androidx.wear.watchface.RenderParameters renderParameters, long calendarTimeMillis, java.util.Map<java.lang.Integer,? extends androidx.wear.complications.data.ComplicationData>? slotIdToComplicationData);
+ method public android.graphics.Bitmap renderWatchFaceToBitmap(androidx.wear.watchface.RenderParameters renderParameters, java.time.Instant instant, java.util.Map<java.lang.Integer,? extends androidx.wear.complications.data.ComplicationData>? slotIdToComplicationData);
method public void setCommitChangesOnClose(boolean commitChangesOnClose);
method public void setUserStyle(androidx.wear.watchface.style.UserStyle userStyle);
property public Integer? backgroundComplicationSlotId;
property public boolean commitChangesOnClose;
property public java.util.Map<java.lang.Integer,androidx.wear.watchface.client.ComplicationSlotState> complicationSlotsState;
- property public long previewReferenceTimeMillis;
+ property public java.time.Instant previewReferenceInstant;
property public androidx.wear.watchface.style.UserStyle userStyle;
property public androidx.wear.watchface.style.UserStyleSchema userStyleSchema;
property public android.content.ComponentName watchFaceComponentName;
diff --git a/wear/wear-watchface-editor-guava/build.gradle b/wear/wear-watchface-editor-guava/build.gradle
index e3b65a5..8a9c745 100644
--- a/wear/wear-watchface-editor-guava/build.gradle
+++ b/wear/wear-watchface-editor-guava/build.gradle
@@ -50,6 +50,6 @@
android {
defaultConfig {
- minSdkVersion 25
+ minSdkVersion 26
}
}
diff --git a/wear/wear-watchface-editor-guava/src/main/java/androidx/wear/watchface/editor/ListenableEditorSession.kt b/wear/wear-watchface-editor-guava/src/main/java/androidx/wear/watchface/editor/ListenableEditorSession.kt
index 0c30a81..0f1cb57 100644
--- a/wear/wear-watchface-editor-guava/src/main/java/androidx/wear/watchface/editor/ListenableEditorSession.kt
+++ b/wear/wear-watchface-editor-guava/src/main/java/androidx/wear/watchface/editor/ListenableEditorSession.kt
@@ -37,6 +37,7 @@
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.TimeoutCancellationException
import kotlinx.coroutines.launch
+import java.time.Instant
import kotlin.coroutines.CoroutineContext
/**
@@ -120,7 +121,7 @@
override var userStyle: UserStyle by wrappedEditorSession::userStyle
- override val previewReferenceTimeMillis: Long = wrappedEditorSession.previewReferenceTimeMillis
+ override val previewReferenceInstant: Instant = wrappedEditorSession.previewReferenceInstant
override val userStyleSchema: UserStyleSchema by wrappedEditorSession::userStyleSchema
@@ -175,11 +176,11 @@
override fun renderWatchFaceToBitmap(
renderParameters: RenderParameters,
- calendarTimeMillis: Long,
+ instant: Instant,
slotIdToComplicationData: Map<Int, ComplicationData>?
): Bitmap = wrappedEditorSession.renderWatchFaceToBitmap(
renderParameters,
- calendarTimeMillis,
+ instant,
slotIdToComplicationData
)
diff --git a/wear/wear-watchface-editor/api/current.txt b/wear/wear-watchface-editor/api/current.txt
index 2ec06d2..8431eff 100644
--- a/wear/wear-watchface-editor/api/current.txt
+++ b/wear/wear-watchface-editor/api/current.txt
@@ -42,44 +42,42 @@
method public java.util.Map<java.lang.Integer,androidx.wear.watchface.client.ComplicationSlotState> getComplicationSlotsState();
method @UiThread public suspend Object? getComplicationsDataSourceInfo(kotlin.coroutines.Continuation<? super java.util.Map<java.lang.Integer,? extends androidx.wear.complications.ComplicationDataSourceInfo>> p);
method @UiThread public suspend Object? getComplicationsPreviewData(kotlin.coroutines.Continuation<? super java.util.Map<java.lang.Integer,? extends androidx.wear.complications.data.ComplicationData>> p);
- method public long getPreviewReferenceTimeMillis();
+ method public java.time.Instant getPreviewReferenceInstant();
method public androidx.wear.watchface.style.UserStyle getUserStyle();
method public androidx.wear.watchface.style.UserStyleSchema getUserStyleSchema();
method public android.content.ComponentName getWatchFaceComponentName();
method @RequiresApi(android.os.Build.VERSION_CODES.R) public androidx.wear.watchface.client.WatchFaceId getWatchFaceId();
method @UiThread public boolean isCommitChangesOnClose();
method @UiThread public suspend Object? openComplicationDataSourceChooser(int complicationSlotId, kotlin.coroutines.Continuation<? super androidx.wear.watchface.editor.ChosenComplicationDataSource> p);
- method @UiThread public android.graphics.Bitmap renderWatchFaceToBitmap(androidx.wear.watchface.RenderParameters renderParameters, long calendarTimeMillis, java.util.Map<java.lang.Integer,? extends androidx.wear.complications.data.ComplicationData>? slotIdToComplicationData);
+ method @UiThread public android.graphics.Bitmap renderWatchFaceToBitmap(androidx.wear.watchface.RenderParameters renderParameters, java.time.Instant instant, java.util.Map<java.lang.Integer,? extends androidx.wear.complications.data.ComplicationData>? slotIdToComplicationData);
method @UiThread public void setCommitChangesOnClose(boolean commitChangesOnClose);
method public void setUserStyle(androidx.wear.watchface.style.UserStyle userStyle);
property public abstract Integer? backgroundComplicationSlotId;
property @UiThread public abstract boolean commitChangesOnClose;
property public abstract java.util.Map<java.lang.Integer,androidx.wear.watchface.client.ComplicationSlotState> complicationSlotsState;
- property public abstract long previewReferenceTimeMillis;
+ property public abstract java.time.Instant previewReferenceInstant;
property public abstract androidx.wear.watchface.style.UserStyle userStyle;
property public abstract androidx.wear.watchface.style.UserStyleSchema userStyleSchema;
property public abstract android.content.ComponentName watchFaceComponentName;
property @RequiresApi(android.os.Build.VERSION_CODES.R) public abstract androidx.wear.watchface.client.WatchFaceId watchFaceId;
field public static final androidx.wear.watchface.editor.EditorSession.Companion Companion;
- field public static final long DEFAULT_PREVIEW_TIME_MILLIS = -1L; // 0xffffffffffffffffL
- field public static final long EDITING_SESSION_TIMEOUT_MILLIS = 4000L; // 0xfa0L
+ field public static final java.time.Instant DEFAULT_PREVIEW_INSTANT;
+ field public static final java.time.Duration EDITING_SESSION_TIMEOUT;
}
public static final class EditorSession.Companion {
method @RequiresApi(27) @UiThread public androidx.wear.watchface.editor.EditorSession createHeadlessEditorSession(androidx.activity.ComponentActivity activity, android.content.Intent editIntent, androidx.wear.watchface.client.HeadlessWatchFaceClient headlessWatchFaceClient);
method @UiThread @kotlin.jvm.Throws(exceptionClasses=TimeoutCancellationException::class) public suspend Object? createOnWatchEditorSession(androidx.activity.ComponentActivity activity, android.content.Intent editIntent, kotlin.coroutines.Continuation<? super androidx.wear.watchface.editor.EditorSession> p) throws kotlinx.coroutines.TimeoutCancellationException;
- field public static final long DEFAULT_PREVIEW_TIME_MILLIS = -1L; // 0xffffffffffffffffL
- field public static final long EDITING_SESSION_TIMEOUT_MILLIS = 4000L; // 0xfa0L
}
public final class EditorSessionKt {
}
public final class PreviewScreenshotParams {
- ctor public PreviewScreenshotParams(androidx.wear.watchface.RenderParameters renderParameters, long calendarTimeMillis);
- method public long getCalendarTimeMillis();
+ ctor public PreviewScreenshotParams(androidx.wear.watchface.RenderParameters renderParameters, java.time.Instant instant);
+ method public java.time.Instant getInstant();
method public androidx.wear.watchface.RenderParameters getRenderParameters();
- property public final long calendarTimeMillis;
+ property public final java.time.Instant instant;
property public final androidx.wear.watchface.RenderParameters renderParameters;
}
diff --git a/wear/wear-watchface-editor/api/public_plus_experimental_current.txt b/wear/wear-watchface-editor/api/public_plus_experimental_current.txt
index 2ec06d2..8431eff 100644
--- a/wear/wear-watchface-editor/api/public_plus_experimental_current.txt
+++ b/wear/wear-watchface-editor/api/public_plus_experimental_current.txt
@@ -42,44 +42,42 @@
method public java.util.Map<java.lang.Integer,androidx.wear.watchface.client.ComplicationSlotState> getComplicationSlotsState();
method @UiThread public suspend Object? getComplicationsDataSourceInfo(kotlin.coroutines.Continuation<? super java.util.Map<java.lang.Integer,? extends androidx.wear.complications.ComplicationDataSourceInfo>> p);
method @UiThread public suspend Object? getComplicationsPreviewData(kotlin.coroutines.Continuation<? super java.util.Map<java.lang.Integer,? extends androidx.wear.complications.data.ComplicationData>> p);
- method public long getPreviewReferenceTimeMillis();
+ method public java.time.Instant getPreviewReferenceInstant();
method public androidx.wear.watchface.style.UserStyle getUserStyle();
method public androidx.wear.watchface.style.UserStyleSchema getUserStyleSchema();
method public android.content.ComponentName getWatchFaceComponentName();
method @RequiresApi(android.os.Build.VERSION_CODES.R) public androidx.wear.watchface.client.WatchFaceId getWatchFaceId();
method @UiThread public boolean isCommitChangesOnClose();
method @UiThread public suspend Object? openComplicationDataSourceChooser(int complicationSlotId, kotlin.coroutines.Continuation<? super androidx.wear.watchface.editor.ChosenComplicationDataSource> p);
- method @UiThread public android.graphics.Bitmap renderWatchFaceToBitmap(androidx.wear.watchface.RenderParameters renderParameters, long calendarTimeMillis, java.util.Map<java.lang.Integer,? extends androidx.wear.complications.data.ComplicationData>? slotIdToComplicationData);
+ method @UiThread public android.graphics.Bitmap renderWatchFaceToBitmap(androidx.wear.watchface.RenderParameters renderParameters, java.time.Instant instant, java.util.Map<java.lang.Integer,? extends androidx.wear.complications.data.ComplicationData>? slotIdToComplicationData);
method @UiThread public void setCommitChangesOnClose(boolean commitChangesOnClose);
method public void setUserStyle(androidx.wear.watchface.style.UserStyle userStyle);
property public abstract Integer? backgroundComplicationSlotId;
property @UiThread public abstract boolean commitChangesOnClose;
property public abstract java.util.Map<java.lang.Integer,androidx.wear.watchface.client.ComplicationSlotState> complicationSlotsState;
- property public abstract long previewReferenceTimeMillis;
+ property public abstract java.time.Instant previewReferenceInstant;
property public abstract androidx.wear.watchface.style.UserStyle userStyle;
property public abstract androidx.wear.watchface.style.UserStyleSchema userStyleSchema;
property public abstract android.content.ComponentName watchFaceComponentName;
property @RequiresApi(android.os.Build.VERSION_CODES.R) public abstract androidx.wear.watchface.client.WatchFaceId watchFaceId;
field public static final androidx.wear.watchface.editor.EditorSession.Companion Companion;
- field public static final long DEFAULT_PREVIEW_TIME_MILLIS = -1L; // 0xffffffffffffffffL
- field public static final long EDITING_SESSION_TIMEOUT_MILLIS = 4000L; // 0xfa0L
+ field public static final java.time.Instant DEFAULT_PREVIEW_INSTANT;
+ field public static final java.time.Duration EDITING_SESSION_TIMEOUT;
}
public static final class EditorSession.Companion {
method @RequiresApi(27) @UiThread public androidx.wear.watchface.editor.EditorSession createHeadlessEditorSession(androidx.activity.ComponentActivity activity, android.content.Intent editIntent, androidx.wear.watchface.client.HeadlessWatchFaceClient headlessWatchFaceClient);
method @UiThread @kotlin.jvm.Throws(exceptionClasses=TimeoutCancellationException::class) public suspend Object? createOnWatchEditorSession(androidx.activity.ComponentActivity activity, android.content.Intent editIntent, kotlin.coroutines.Continuation<? super androidx.wear.watchface.editor.EditorSession> p) throws kotlinx.coroutines.TimeoutCancellationException;
- field public static final long DEFAULT_PREVIEW_TIME_MILLIS = -1L; // 0xffffffffffffffffL
- field public static final long EDITING_SESSION_TIMEOUT_MILLIS = 4000L; // 0xfa0L
}
public final class EditorSessionKt {
}
public final class PreviewScreenshotParams {
- ctor public PreviewScreenshotParams(androidx.wear.watchface.RenderParameters renderParameters, long calendarTimeMillis);
- method public long getCalendarTimeMillis();
+ ctor public PreviewScreenshotParams(androidx.wear.watchface.RenderParameters renderParameters, java.time.Instant instant);
+ method public java.time.Instant getInstant();
method public androidx.wear.watchface.RenderParameters getRenderParameters();
- property public final long calendarTimeMillis;
+ property public final java.time.Instant instant;
property public final androidx.wear.watchface.RenderParameters renderParameters;
}
diff --git a/wear/wear-watchface-editor/api/restricted_current.txt b/wear/wear-watchface-editor/api/restricted_current.txt
index d4bb86a..b750738 100644
--- a/wear/wear-watchface-editor/api/restricted_current.txt
+++ b/wear/wear-watchface-editor/api/restricted_current.txt
@@ -66,44 +66,42 @@
method public java.util.Map<java.lang.Integer,androidx.wear.watchface.client.ComplicationSlotState> getComplicationSlotsState();
method @UiThread public suspend Object? getComplicationsDataSourceInfo(kotlin.coroutines.Continuation<? super java.util.Map<java.lang.Integer,? extends androidx.wear.complications.ComplicationDataSourceInfo>> p);
method @UiThread public suspend Object? getComplicationsPreviewData(kotlin.coroutines.Continuation<? super java.util.Map<java.lang.Integer,? extends androidx.wear.complications.data.ComplicationData>> p);
- method public long getPreviewReferenceTimeMillis();
+ method public java.time.Instant getPreviewReferenceInstant();
method public androidx.wear.watchface.style.UserStyle getUserStyle();
method public androidx.wear.watchface.style.UserStyleSchema getUserStyleSchema();
method public android.content.ComponentName getWatchFaceComponentName();
method @RequiresApi(android.os.Build.VERSION_CODES.R) public androidx.wear.watchface.client.WatchFaceId getWatchFaceId();
method @UiThread public boolean isCommitChangesOnClose();
method @UiThread public suspend Object? openComplicationDataSourceChooser(int complicationSlotId, kotlin.coroutines.Continuation<? super androidx.wear.watchface.editor.ChosenComplicationDataSource> p);
- method @UiThread public android.graphics.Bitmap renderWatchFaceToBitmap(androidx.wear.watchface.RenderParameters renderParameters, long calendarTimeMillis, java.util.Map<java.lang.Integer,? extends androidx.wear.complications.data.ComplicationData>? slotIdToComplicationData);
+ method @UiThread public android.graphics.Bitmap renderWatchFaceToBitmap(androidx.wear.watchface.RenderParameters renderParameters, java.time.Instant instant, java.util.Map<java.lang.Integer,? extends androidx.wear.complications.data.ComplicationData>? slotIdToComplicationData);
method @UiThread public void setCommitChangesOnClose(boolean commitChangesOnClose);
method public void setUserStyle(androidx.wear.watchface.style.UserStyle userStyle);
property public abstract Integer? backgroundComplicationSlotId;
property @UiThread public abstract boolean commitChangesOnClose;
property public abstract java.util.Map<java.lang.Integer,androidx.wear.watchface.client.ComplicationSlotState> complicationSlotsState;
- property public abstract long previewReferenceTimeMillis;
+ property public abstract java.time.Instant previewReferenceInstant;
property public abstract androidx.wear.watchface.style.UserStyle userStyle;
property public abstract androidx.wear.watchface.style.UserStyleSchema userStyleSchema;
property public abstract android.content.ComponentName watchFaceComponentName;
property @RequiresApi(android.os.Build.VERSION_CODES.R) public abstract androidx.wear.watchface.client.WatchFaceId watchFaceId;
field public static final androidx.wear.watchface.editor.EditorSession.Companion Companion;
- field public static final long DEFAULT_PREVIEW_TIME_MILLIS = -1L; // 0xffffffffffffffffL
- field public static final long EDITING_SESSION_TIMEOUT_MILLIS = 4000L; // 0xfa0L
+ field public static final java.time.Instant DEFAULT_PREVIEW_INSTANT;
+ field public static final java.time.Duration EDITING_SESSION_TIMEOUT;
}
public static final class EditorSession.Companion {
method @RequiresApi(27) @UiThread public androidx.wear.watchface.editor.EditorSession createHeadlessEditorSession(androidx.activity.ComponentActivity activity, android.content.Intent editIntent, androidx.wear.watchface.client.HeadlessWatchFaceClient headlessWatchFaceClient);
method @UiThread @kotlin.jvm.Throws(exceptionClasses=TimeoutCancellationException::class) public suspend Object? createOnWatchEditorSession(androidx.activity.ComponentActivity activity, android.content.Intent editIntent, kotlin.coroutines.Continuation<? super androidx.wear.watchface.editor.EditorSession> p) throws kotlinx.coroutines.TimeoutCancellationException;
- field public static final long DEFAULT_PREVIEW_TIME_MILLIS = -1L; // 0xffffffffffffffffL
- field public static final long EDITING_SESSION_TIMEOUT_MILLIS = 4000L; // 0xfa0L
}
public final class EditorSessionKt {
}
public final class PreviewScreenshotParams {
- ctor public PreviewScreenshotParams(androidx.wear.watchface.RenderParameters renderParameters, long calendarTimeMillis);
- method public long getCalendarTimeMillis();
+ ctor public PreviewScreenshotParams(androidx.wear.watchface.RenderParameters renderParameters, java.time.Instant instant);
+ method public java.time.Instant getInstant();
method public androidx.wear.watchface.RenderParameters getRenderParameters();
- property public final long calendarTimeMillis;
+ property public final java.time.Instant instant;
property public final androidx.wear.watchface.RenderParameters renderParameters;
}
diff --git a/wear/wear-watchface-editor/build.gradle b/wear/wear-watchface-editor/build.gradle
index bb223c3..34614f6 100644
--- a/wear/wear-watchface-editor/build.gradle
+++ b/wear/wear-watchface-editor/build.gradle
@@ -49,7 +49,7 @@
android {
defaultConfig {
- minSdkVersion 25
+ minSdkVersion 26
}
}
diff --git a/wear/wear-watchface-editor/samples/build.gradle b/wear/wear-watchface-editor/samples/build.gradle
index 848ed1d..8a391bb 100644
--- a/wear/wear-watchface-editor/samples/build.gradle
+++ b/wear/wear-watchface-editor/samples/build.gradle
@@ -43,6 +43,6 @@
android {
defaultConfig {
- minSdkVersion 25
+ minSdkVersion 26
}
}
diff --git a/wear/wear-watchface-editor/samples/src/main/java/androidx/wear/watchface/editor/sample/ComplicationConfigFragment.kt b/wear/wear-watchface-editor/samples/src/main/java/androidx/wear/watchface/editor/sample/ComplicationConfigFragment.kt
index caccf65..b2ccf67 100644
--- a/wear/wear-watchface-editor/samples/src/main/java/androidx/wear/watchface/editor/sample/ComplicationConfigFragment.kt
+++ b/wear/wear-watchface-editor/samples/src/main/java/androidx/wear/watchface/editor/sample/ComplicationConfigFragment.kt
@@ -113,13 +113,11 @@
}.resourceId
)
setOnClickListener { onComplicationButtonClicked(stateEntry.key) }
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
- setOnLongClickListener {
- TooltipApi26.updateTooltip(it, watchFaceConfigActivity, stateEntry.key)
- // Do not consume the long click so that the tooltip is shown by the
- // default handler.
- false
- }
+ setOnLongClickListener {
+ TooltipApi26.updateTooltip(it, watchFaceConfigActivity, stateEntry.key)
+ // Do not consume the long click so that the tooltip is shown by the
+ // default handler.
+ false
}
addView(this)
}
@@ -194,7 +192,7 @@
Color.argb(128, 0, 0, 0) // Darken everything else.
)
),
- editingSession.previewReferenceTimeMillis,
+ editingSession.previewReferenceInstant,
previewComplicationData
)
canvas.drawBitmap(bitmap, drawRect, drawRect, null)
diff --git a/wear/wear-watchface-editor/src/androidTest/java/androidx/wear/watchface/editor/EditorSessionGuavaTest.kt b/wear/wear-watchface-editor/src/androidTest/java/androidx/wear/watchface/editor/EditorSessionGuavaTest.kt
index 3aca315..e82a15e 100644
--- a/wear/wear-watchface-editor/src/androidTest/java/androidx/wear/watchface/editor/EditorSessionGuavaTest.kt
+++ b/wear/wear-watchface-editor/src/androidTest/java/androidx/wear/watchface/editor/EditorSessionGuavaTest.kt
@@ -16,6 +16,7 @@
package androidx.wear.watchface.editor
+import android.annotation.SuppressLint
import android.content.ComponentName
import android.content.Context
import android.content.Intent
@@ -57,6 +58,7 @@
import org.junit.Test
import org.junit.runner.RunWith
import org.mockito.Mockito
+import java.time.Instant
import java.util.concurrent.TimeUnit
private const val TIMEOUT_MS = 500L
@@ -123,11 +125,12 @@
private val backgroundHandler = Handler(backgroundHandlerThread.looper)
+ @SuppressLint("NewApi")
private fun createOnWatchFaceEditingTestActivity(
userStyleSettings: List<UserStyleSetting>,
complicationSlots: List<ComplicationSlot>,
watchFaceId: WatchFaceId = testInstanceId,
- previewReferenceTimeMillis: Long = 12345
+ previewReferenceInstant: Instant = Instant.ofEpochMilli(12345)
): ActivityScenario<OnWatchFaceEditingTestActivity> {
val userStyleRepository = CurrentUserStyleRepository(UserStyleSchema(userStyleSettings))
val complicationSlotsManager =
@@ -139,8 +142,7 @@
Mockito.`when`(editorDelegate.userStyleSchema).thenReturn(userStyleRepository.schema)
Mockito.`when`(editorDelegate.userStyle).thenReturn(userStyleRepository.userStyle)
Mockito.`when`(editorDelegate.screenBounds).thenReturn(screenBounds)
- Mockito.`when`(editorDelegate.previewReferenceTimeMillis)
- .thenReturn(previewReferenceTimeMillis)
+ Mockito.`when`(editorDelegate.previewReferenceInstant).thenReturn(previewReferenceInstant)
Mockito.`when`(editorDelegate.backgroundThreadHandler).thenReturn(backgroundHandler)
OnWatchFaceEditingTestActivity.complicationDataSourceInfoRetrieverProvider =
@@ -194,13 +196,13 @@
val leftComplicationData = previewData[LEFT_COMPLICATION_ID] as
ShortTextComplicationData
assertThat(
- leftComplicationData.text.getTextAt(resources, 0)
+ leftComplicationData.text.getTextAt(resources, Instant.EPOCH)
).isEqualTo("Left")
val rightComplicationData = previewData[RIGHT_COMPLICATION_ID] as
LongTextComplicationData
assertThat(
- rightComplicationData.text.getTextAt(resources, 0)
+ rightComplicationData.text.getTextAt(resources, Instant.EPOCH)
).isEqualTo("Right")
}
@@ -259,7 +261,7 @@
assertThat(
previewComplication.text.getTextAt(
ApplicationProvider.getApplicationContext<Context>().resources,
- 0
+ Instant.EPOCH
)
).isEqualTo("DataSource3")
}
diff --git a/wear/wear-watchface-editor/src/androidTest/java/androidx/wear/watchface/editor/EditorSessionTest.kt b/wear/wear-watchface-editor/src/androidTest/java/androidx/wear/watchface/editor/EditorSessionTest.kt
index 0f6f667..7e22fa9 100644
--- a/wear/wear-watchface-editor/src/androidTest/java/androidx/wear/watchface/editor/EditorSessionTest.kt
+++ b/wear/wear-watchface-editor/src/androidTest/java/androidx/wear/watchface/editor/EditorSessionTest.kt
@@ -27,13 +27,11 @@
import android.graphics.Rect
import android.graphics.RectF
import android.graphics.drawable.Icon
-import android.icu.util.Calendar
import android.os.Build
import android.os.Bundle
import android.os.Handler
import android.os.HandlerThread
import android.os.IBinder
-import android.os.Looper
import android.support.wearable.complications.IPreviewComplicationDataCallback
import android.support.wearable.complications.IProviderInfoService
import android.support.wearable.watchface.Constants
@@ -78,7 +76,7 @@
import androidx.wear.watchface.complications.rendering.CanvasComplicationDrawable
import androidx.wear.watchface.complications.rendering.ComplicationDrawable
import androidx.wear.watchface.ComplicationSlotBoundsType
-import androidx.wear.watchface.editor.EditorSession.Companion.EDITING_SESSION_TIMEOUT_MILLIS
+import androidx.wear.watchface.editor.EditorSession.Companion.EDITING_SESSION_TIMEOUT
import androidx.wear.watchface.editor.data.EditorStateWireFormat
import androidx.wear.watchface.style.CurrentUserStyleRepository
import androidx.wear.watchface.style.UserStyle
@@ -91,6 +89,7 @@
import com.google.common.truth.Truth.assertThat
import kotlinx.coroutines.CompletableDeferred
import kotlinx.coroutines.CoroutineScope
+import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.TimeoutCancellationException
import kotlinx.coroutines.android.asCoroutineDispatcher
import kotlinx.coroutines.async
@@ -112,6 +111,8 @@
import org.mockito.Mockito.`when`
import org.mockito.Mockito.doAnswer
import org.mockito.Mockito.mock
+import java.time.Instant
+import java.time.ZonedDateTime
import java.util.concurrent.CountDownLatch
import java.util.concurrent.TimeUnit
import java.util.concurrent.TimeUnit.MILLISECONDS
@@ -254,7 +255,7 @@
CanvasType.SOFTWARE,
100
) {
- override fun render(canvas: Canvas, bounds: Rect, calendar: Calendar) {
+ override fun render(canvas: Canvas, bounds: Rect, zonedDateTime: ZonedDateTime) {
when (currentUserStyleRepository.userStyle[colorStyleSetting]!!) {
redStyleOption -> canvas.drawColor(Color.RED)
greenStyleOption -> canvas.drawColor(Color.GREEN)
@@ -262,7 +263,11 @@
}
}
- override fun renderHighlightLayer(canvas: Canvas, bounds: Rect, calendar: Calendar) {
+ override fun renderHighlightLayer(
+ canvas: Canvas,
+ bounds: Rect,
+ zonedDateTime: ZonedDateTime
+ ) {
// NOP
}
}
@@ -285,8 +290,7 @@
ComplicationDataSourceInfoRetrieverProvider? = null
}
- public val immediateCoroutineScope: CoroutineScope =
- CoroutineScope(Handler(Looper.getMainLooper()).asCoroutineDispatcher().immediate)
+ public val immediateCoroutineScope: CoroutineScope = CoroutineScope(Dispatchers.Main.immediate)
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
@@ -398,7 +402,7 @@
lastIntent = intent
- CoroutineScope(Handler(Looper.getMainLooper()).asCoroutineDispatcher()).launch {
+ CoroutineScope(Dispatchers.Main.immediate).launch {
setResult(123, resultIntent!!.await())
finish()
}
@@ -502,7 +506,7 @@
userStyleSettings: List<UserStyleSetting>,
complicationSlots: List<ComplicationSlot>,
watchFaceId: WatchFaceId = testInstanceId,
- previewReferenceTimeMillis: Long = 12345,
+ previewReferenceInstant: Instant = Instant.ofEpochMilli(12345),
complicationDataSourceInfoRetrieverProvider: ComplicationDataSourceInfoRetrieverProvider =
TestComplicationDataSourceInfoRetrieverProvider(),
shouldTimeout: Boolean = false,
@@ -534,12 +538,12 @@
override val complicationSlotsManager = complicationSlotsManager
override val screenBounds = this@EditorSessionTest.screenBounds
- override val previewReferenceTimeMillis = previewReferenceTimeMillis
+ override val previewReferenceInstant = previewReferenceInstant
override val backgroundThreadHandler = backgroundHandler
override fun renderWatchFaceToBitmap(
renderParameters: RenderParameters,
- calendarTimeMillis: Long,
+ instant: Instant,
slotIdToComplicationData:
Map<Int, androidx.wear.complications.data.ComplicationData>?
) = fakeBitmap
@@ -608,7 +612,7 @@
val scenario = createOnWatchFaceEditingTestActivityThatThrowsTimeoutException()
lateinit var activity: OnWatchFaceEditingTestActivity
scenario.onActivity { activity = it }
- activity.creationLatch.await(EDITING_SESSION_TIMEOUT_MILLIS + 500, MILLISECONDS)
+ activity.creationLatch.await(EDITING_SESSION_TIMEOUT.toMillis() + 500, MILLISECONDS)
assert(activity.onCreateException is TimeoutCancellationException)
}
@@ -675,14 +679,16 @@
}
@Test
- public fun previewReferenceTimeMillis() {
+ public fun previewReferenceInstant() {
val scenario = createOnWatchFaceEditingTestActivity(
emptyList(),
emptyList(),
- previewReferenceTimeMillis = 54321L
+ previewReferenceInstant = Instant.ofEpochMilli(54321L)
)
scenario.onActivity {
- assertThat(it.editorSession.previewReferenceTimeMillis).isEqualTo(54321L)
+ assertThat(it.editorSession.previewReferenceInstant).isEqualTo(
+ Instant.ofEpochMilli(54321L)
+ )
}
}
@@ -895,7 +901,7 @@
assertThat(
(result as ShortTextComplicationData).text.getTextAt(
ApplicationProvider.getApplicationContext<Context>().resources,
- 0
+ Instant.EPOCH
)
).isEqualTo(complicationText)
@@ -956,7 +962,7 @@
assertThat(
(result as LongTextComplicationData).text.getTextAt(
ApplicationProvider.getApplicationContext<Context>().resources,
- 0
+ Instant.EPOCH
)
).isEqualTo("dataSource") // Fallback has been used.
@@ -995,7 +1001,7 @@
assertThat(
previewComplication.text.getTextAt(
ApplicationProvider.getApplicationContext<Context>().resources,
- 0
+ Instant.EPOCH
)
).isEqualTo("dataSou")
@@ -1040,7 +1046,7 @@
assertThat(
previewComplication.text.getTextAt(
ApplicationProvider.getApplicationContext<Context>().resources,
- 0
+ Instant.EPOCH
)
).isEqualTo("dataSou") // Fallback truncates for short text.
}
@@ -1102,7 +1108,7 @@
assertThat(
previewComplication.text.getTextAt(
ApplicationProvider.getApplicationContext<Context>().resources,
- 0
+ Instant.EPOCH
)
).isEqualTo("DataSource3")
@@ -1400,7 +1406,7 @@
assertThat(
it.editorSession.renderWatchFaceToBitmap(
RenderParameters.DEFAULT_INTERACTIVE,
- 1234L,
+ Instant.ofEpochMilli(1234L),
null
)
).isEqualTo(fakeBitmap)
@@ -1474,7 +1480,7 @@
assertThat(
leftComplicationData.text.getTextAt(
ApplicationProvider.getApplicationContext<Context>().resources,
- 0
+ Instant.EPOCH
)
).isEqualTo("Left")
@@ -1483,7 +1489,7 @@
assertThat(
rightComplicationData.text.getTextAt(
ApplicationProvider.getApplicationContext<Context>().resources,
- 0
+ Instant.EPOCH
)
).isEqualTo("Right")
@@ -1629,8 +1635,10 @@
emptyList(),
headlessDeviceConfig = DeviceConfig(false, false, 0, 0),
watchComponentName = headlessWatchFaceComponentName,
- previewScreenshotParams =
- PreviewScreenshotParams(RenderParameters.DEFAULT_INTERACTIVE, 0)
+ previewScreenshotParams = PreviewScreenshotParams(
+ RenderParameters.DEFAULT_INTERACTIVE,
+ Instant.EPOCH
+ )
)
val editorObserver = TestEditorObserver()
val observerId = EditorService.globalEditorService.registerObserver(editorObserver)
@@ -1669,8 +1677,10 @@
val scenario = createOnWatchFaceEditingTestActivity(
listOf(colorStyleSetting, watchHandStyleSetting),
emptyList(),
- previewScreenshotParams =
- PreviewScreenshotParams(RenderParameters.DEFAULT_INTERACTIVE, 0)
+ previewScreenshotParams = PreviewScreenshotParams(
+ RenderParameters.DEFAULT_INTERACTIVE,
+ Instant.EPOCH
+ )
)
val editorObserver = TestEditorObserver()
val observerId = EditorService.globalEditorService.registerObserver(editorObserver)
@@ -1977,7 +1987,7 @@
assertThat(
leftComplicationData.text.getTextAt(
ApplicationProvider.getApplicationContext<Context>().resources,
- 0
+ Instant.EPOCH
)
).isEqualTo("Left")
@@ -1988,7 +1998,7 @@
assertThat(
rightComplicationData.text.getTextAt(
ApplicationProvider.getApplicationContext<Context>().resources,
- 0
+ Instant.EPOCH
)
).isEqualTo("Right")
}
@@ -2012,7 +2022,7 @@
assertThat(
leftComplicationData.text.getTextAt(
ApplicationProvider.getApplicationContext<Context>().resources,
- 0
+ Instant.EPOCH
)
).isEqualTo("Left")
@@ -2076,12 +2086,16 @@
watchState, CanvasType.SOFTWARE,
16
) {
- override fun render(canvas: Canvas, bounds: Rect, calendar: Calendar) {}
+ override fun render(
+ canvas: Canvas,
+ bounds: Rect,
+ zonedDateTime: ZonedDateTime
+ ) {}
override fun renderHighlightLayer(
canvas: Canvas,
bounds: Rect,
- calendar: Calendar
+ zonedDateTime: ZonedDateTime
) {
}
}
@@ -2090,7 +2104,6 @@
watchState,
currentUserStyleRepository,
ComplicationSlotsManager(emptyList(), currentUserStyleRepository),
- Calendar.getInstance(),
BroadcastsObserver(
watchState,
mockWatchFaceHostApi,
diff --git a/wear/wear-watchface-editor/src/main/java/androidx/wear/watchface/editor/EditorSession.kt b/wear/wear-watchface-editor/src/main/java/androidx/wear/watchface/editor/EditorSession.kt
index 39ad69f..1c2dc59 100644
--- a/wear/wear-watchface-editor/src/main/java/androidx/wear/watchface/editor/EditorSession.kt
+++ b/wear/wear-watchface-editor/src/main/java/androidx/wear/watchface/editor/EditorSession.kt
@@ -36,7 +36,6 @@
import androidx.wear.complications.ComplicationDataSourceInfo
import androidx.wear.complications.ComplicationDataSourceInfoRetriever
import androidx.wear.complications.data.ComplicationData
-import androidx.wear.complications.data.ComplicationType
import androidx.wear.complications.data.EmptyComplicationData
import androidx.wear.complications.toApiComplicationDataSourceInfo
import androidx.wear.watchface.ComplicationHelperActivity
@@ -61,6 +60,7 @@
import androidx.wear.watchface.style.UserStyleSchema
import kotlinx.coroutines.CompletableDeferred
import kotlinx.coroutines.CoroutineScope
+import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.Job
import kotlinx.coroutines.TimeoutCancellationException
import kotlinx.coroutines.android.asCoroutineDispatcher
@@ -70,9 +70,8 @@
import kotlinx.coroutines.runBlocking
import kotlinx.coroutines.withContext
import kotlinx.coroutines.withTimeout
-
-private typealias WireComplicationProviderInfo =
- android.support.wearable.complications.ComplicationProviderInfo
+import java.time.Duration
+import java.time.Instant
/**
* Interface for manipulating watch face state during a watch face editing session. The editor
@@ -105,8 +104,8 @@
*/
public var userStyle: UserStyle
- /** The UTC reference preview time for this watch face in milliseconds since the epoch. */
- public val previewReferenceTimeMillis: Long
+ /** The reference preview [Instant] for this watch face to render previews with. */
+ public val previewReferenceInstant: Instant
/** The watch face's [UserStyleSchema]. */
public val userStyleSchema: UserStyleSchema
@@ -175,16 +174,14 @@
* Renders the watch face to a [Bitmap] using the current [userStyle].
*
* @param renderParameters The [RenderParameters] to render with. Must be [DrawMode.INTERACTIVE]
- * @param calendarTimeMillis The UTC time in milliseconds since the epoch to render with. If
- * [DEFAULT_PREVIEW_TIME_MILLIS] is passed then the watch face's default preview time will be
- * used.
+ * @param instant The [Instant] to render with
* @param slotIdToComplicationData The [ComplicationData] for each
* [androidx.wear.watchface.ComplicationSlot] to render with
*/
@UiThread
public fun renderWatchFaceToBitmap(
renderParameters: RenderParameters,
- calendarTimeMillis: Long,
+ instant: Instant,
slotIdToComplicationData: Map<Int, ComplicationData>?
): Bitmap
@@ -213,7 +210,8 @@
* If passed [renderWatchFaceToBitmap] this will signal that the watch face's default
* preview time should be used.
*/
- const val DEFAULT_PREVIEW_TIME_MILLIS = -1L
+ @JvmField
+ val DEFAULT_PREVIEW_INSTANT: Instant = Instant.ofEpochMilli(-1L)
/**
* Constructs an [EditorSession] for an on watch face editor. This registers an activity
@@ -224,8 +222,8 @@
* @param editIntent The [Intent] sent by SysUI to launch the editing session.
* @return Deferred<EditorSession?> which is resolved with either the [EditorSession] or
* `null` if it can't be constructed.
- * @throws [TimeoutCancellationException] if it takes more than
- * [EDITING_SESSION_TIMEOUT_MILLIS] milliseconds to create a watch face editor.
+ * @throws [TimeoutCancellationException] if it takes longer than
+ * [EDITING_SESSION_TIMEOUT] to create a watch face editor.
*/
@SuppressWarnings("ExecutorRegistration")
@JvmStatic
@@ -252,8 +250,7 @@
): EditorSession = TraceEvent(
"EditorSession.createOnWatchEditorSessionAsyncImpl"
).use {
- val coroutineScope =
- CoroutineScope(Handler(Looper.getMainLooper()).asCoroutineDispatcher().immediate)
+ val coroutineScope = CoroutineScope(Dispatchers.Main.immediate)
var isRFlow = true
val editorRequest = editIntent.getParcelableExtra<ComponentName>(
Constants.EXTRA_WATCH_FACE_COMPONENT
@@ -276,7 +273,7 @@
// [WatchFace.getOrCreateEditorDelegate] is async.
// Resolve only after init has been completed.
withContext(coroutineScope.coroutineContext) {
- withTimeout(EDITING_SESSION_TIMEOUT_MILLIS) {
+ withTimeout(EDITING_SESSION_TIMEOUT.toMillis()) {
session.setEditorDelegate(
// Either create a delegate for a new headless client or await an
// interactive one.
@@ -339,7 +336,8 @@
}
/** Timeout allowed for waiting for creating the watch face editing session. */
- public const val EDITING_SESSION_TIMEOUT_MILLIS: Long = 4000L
+ @JvmField
+ public val EDITING_SESSION_TIMEOUT: Duration = Duration.ofSeconds(4)
}
}
@@ -628,7 +626,7 @@
SharedMemoryImage.ashmemWriteImageBundle(
renderWatchFaceToBitmap(
previewScreenshotParams.renderParameters,
- previewScreenshotParams.calendarTimeMillis,
+ previewScreenshotParams.instant,
getComplicationsPreviewData()
)
)
@@ -707,7 +705,9 @@
editorDelegate.userStyleSchema
}
- override val previewReferenceTimeMillis by lazy { editorDelegate.previewReferenceTimeMillis }
+ override val previewReferenceInstant: Instant by lazy {
+ editorDelegate.previewReferenceInstant
+ }
override val complicationSlotsState
get() = editorDelegate.complicationSlotsManager.complicationSlots.mapValues {
@@ -720,7 +720,7 @@
it.value.defaultDataSourceType,
it.value.enabled,
it.value.initiallyEnabled,
- it.value.renderer.getData()?.type ?: ComplicationType.NO_DATA,
+ it.value.renderer.getData().type,
it.value.fixedComplicationDataSource,
it.value.configExtras
)
@@ -750,7 +750,7 @@
override fun renderWatchFaceToBitmap(
renderParameters: RenderParameters,
- calendarTimeMillis: Long,
+ instant: Instant,
slotIdToComplicationData: Map<Int, ComplicationData>?
): Bitmap {
requireNotClosed()
@@ -759,10 +759,10 @@
}
return editorDelegate.renderWatchFaceToBitmap(
renderParameters,
- if (calendarTimeMillis == EditorSession.DEFAULT_PREVIEW_TIME_MILLIS) {
- editorDelegate.previewReferenceTimeMillis
+ if (instant == EditorSession.DEFAULT_PREVIEW_INSTANT) {
+ editorDelegate.previewReferenceInstant
} else {
- calendarTimeMillis
+ instant
},
slotIdToComplicationData
)
@@ -838,22 +838,22 @@
override var userStyle = UserStyle(initialUserStyle, userStyleSchema)
- override val previewReferenceTimeMillis = headlessWatchFaceClient.previewReferenceTimeMillis
+ override val previewReferenceInstant = headlessWatchFaceClient.previewReferenceInstant
override val complicationSlotsState = headlessWatchFaceClient.complicationSlotsState
override fun renderWatchFaceToBitmap(
renderParameters: RenderParameters,
- calendarTimeMillis: Long,
+ instant: Instant,
slotIdToComplicationData: Map<Int, ComplicationData>?
): Bitmap {
requireNotClosed()
return headlessWatchFaceClient.renderWatchFaceToBitmap(
renderParameters,
- if (calendarTimeMillis == EditorSession.DEFAULT_PREVIEW_TIME_MILLIS) {
- headlessWatchFaceClient.previewReferenceTimeMillis
+ if (instant == EditorSession.DEFAULT_PREVIEW_INSTANT) {
+ headlessWatchFaceClient.previewReferenceInstant
} else {
- calendarTimeMillis
+ instant
},
userStyle,
slotIdToComplicationData
diff --git a/wear/wear-watchface-editor/src/main/java/androidx/wear/watchface/editor/WatchFaceEditorContract.kt b/wear/wear-watchface-editor/src/main/java/androidx/wear/watchface/editor/WatchFaceEditorContract.kt
index 1e95ae4..af52c49 100644
--- a/wear/wear-watchface-editor/src/main/java/androidx/wear/watchface/editor/WatchFaceEditorContract.kt
+++ b/wear/wear-watchface-editor/src/main/java/androidx/wear/watchface/editor/WatchFaceEditorContract.kt
@@ -35,6 +35,7 @@
import androidx.wear.watchface.style.UserStyle
import androidx.wear.watchface.style.UserStyleData
import kotlinx.coroutines.TimeoutCancellationException
+import java.time.Instant
internal const val INSTANCE_ID_KEY: String = "INSTANCE_ID_KEY"
internal const val COMPONENT_NAME_KEY: String = "COMPONENT_NAME_KEY"
@@ -51,14 +52,30 @@
* [EditorState].
*
* @param renderParameters The [RenderParameters] to use when rendering the screen shot
- * @param calendarTimeMillis The UTC time in milliseconds since the epoch to render with. If
- * [EditorSession.DEFAULT_PREVIEW_TIME_MILLIS] is passed then the watch face's default preview time
- * will be used.
+ * @param instant The [Instant] to render with.
*/
public class PreviewScreenshotParams(
public val renderParameters: RenderParameters,
- public val calendarTimeMillis: Long
-)
+ public val instant: Instant
+) {
+ override fun equals(other: Any?): Boolean {
+ if (this === other) return true
+ if (javaClass != other?.javaClass) return false
+
+ other as PreviewScreenshotParams
+
+ if (renderParameters != other.renderParameters) return false
+ if (instant != other.instant) return false
+
+ return true
+ }
+
+ override fun hashCode(): Int {
+ var result = renderParameters.hashCode()
+ result = 31 * result + instant.hashCode()
+ return result
+ }
+}
/**
* The request sent by [WatchFaceEditorContract.createIntent].
@@ -143,7 +160,7 @@
)?.let {
PreviewScreenshotParams(
RenderParameters(it),
- intent.getLongExtra(RENDER_TIME_MILLIS_KEY, 0)
+ Instant.ofEpochMilli(intent.getLongExtra(RENDER_TIME_MILLIS_KEY, 0))
)
}
)
@@ -181,7 +198,7 @@
putExtra(HEADLESS_DEVICE_CONFIG_KEY, input.headlessDeviceConfig?.asWireDeviceConfig())
input.previewScreenshotParams?.let {
putExtra(RENDER_PARAMETERS_KEY, it.renderParameters.toWireFormat())
- putExtra(RENDER_TIME_MILLIS_KEY, it.calendarTimeMillis)
+ putExtra(RENDER_TIME_MILLIS_KEY, it.instant.toEpochMilli())
}
}
}
diff --git a/wear/wear-watchface-guava/build.gradle b/wear/wear-watchface-guava/build.gradle
index e9f5714..62b5606 100644
--- a/wear/wear-watchface-guava/build.gradle
+++ b/wear/wear-watchface-guava/build.gradle
@@ -55,7 +55,7 @@
android {
defaultConfig {
- minSdkVersion 25
+ minSdkVersion 26
}
// Use Robolectric 4.+
diff --git a/wear/wear-watchface-guava/src/androidTest/java/AsyncListenableWatchFaceServiceTest.kt b/wear/wear-watchface-guava/src/androidTest/java/AsyncListenableWatchFaceServiceTest.kt
index c6fcb19..28173f1 100644
--- a/wear/wear-watchface-guava/src/androidTest/java/AsyncListenableWatchFaceServiceTest.kt
+++ b/wear/wear-watchface-guava/src/androidTest/java/AsyncListenableWatchFaceServiceTest.kt
@@ -16,7 +16,7 @@
import android.graphics.Canvas
import android.graphics.Rect
-import android.icu.util.Calendar
+
import android.view.SurfaceHolder
import androidx.wear.watchface.CanvasType
import androidx.wear.watchface.ComplicationSlotsManager
@@ -34,8 +34,10 @@
import kotlinx.coroutines.runBlocking
import org.junit.Test
import org.mockito.Mockito
+import java.time.Instant
+import java.time.ZonedDateTime
-private const val REFERENCE_PREVIEW_TIME = 123456L
+private val REFERENCE_PREVIEW_TIME = Instant.ofEpochMilli(123456L)
private class FakeRenderer(
surfaceHolder: SurfaceHolder,
@@ -48,9 +50,9 @@
CanvasType.SOFTWARE,
16
) {
- override fun render(canvas: Canvas, bounds: Rect, calendar: Calendar) {}
+ override fun render(canvas: Canvas, bounds: Rect, zonedDateTime: ZonedDateTime) {}
- override fun renderHighlightLayer(canvas: Canvas, bounds: Rect, calendar: Calendar) {}
+ override fun renderHighlightLayer(canvas: Canvas, bounds: Rect, zonedDateTime: ZonedDateTime) {}
}
private class TestAsyncListenableWatchFaceService :
@@ -68,7 +70,7 @@
WatchFace(
WatchFaceType.DIGITAL,
FakeRenderer(surfaceHolder, watchState, currentUserStyleRepository)
- ).apply { setOverridePreviewReferenceTimeMillis(REFERENCE_PREVIEW_TIME) }
+ ).apply { setOverridePreviewReferenceInstant(REFERENCE_PREVIEW_TIME) }
)
}
return future
@@ -112,9 +114,9 @@
)
// Simple check that [watchFace] looks sensible.
- assertThat(watchFace.overridePreviewReferenceTimeMillis).isEqualTo(
+ assertThat(watchFace.overridePreviewReferenceInstant).isEqualTo(
REFERENCE_PREVIEW_TIME
)
}
}
-}
\ No newline at end of file
+}
diff --git a/wear/wear-watchface-guava/src/test/java/androidx/wear/watchface/ListenableWatchFaceServiceTest.kt b/wear/wear-watchface-guava/src/test/java/androidx/wear/watchface/ListenableWatchFaceServiceTest.kt
index 70281e3..530cf2a 100644
--- a/wear/wear-watchface-guava/src/test/java/androidx/wear/watchface/ListenableWatchFaceServiceTest.kt
+++ b/wear/wear-watchface-guava/src/test/java/androidx/wear/watchface/ListenableWatchFaceServiceTest.kt
@@ -18,7 +18,6 @@
import android.graphics.Canvas
import android.graphics.Rect
-import android.icu.util.Calendar
import android.view.SurfaceHolder
import androidx.wear.watchface.style.CurrentUserStyleRepository
import androidx.wear.watchface.style.UserStyleSchema
@@ -33,8 +32,10 @@
import org.mockito.Mockito.`when`
import org.robolectric.RobolectricTestRunner
import org.robolectric.internal.bytecode.InstrumentationConfiguration
+import java.time.Instant
+import java.time.ZonedDateTime
-private const val REFERENCE_PREVIEW_TIME = 123456L
+private val REFERENCE_PREVIEW_TIME = Instant.ofEpochMilli(123456L)
private class TestListenableWatchFaceService : ListenableWatchFaceService() {
override fun createWatchFaceFuture(
@@ -53,15 +54,19 @@
CanvasType.SOFTWARE,
16
) {
- override fun render(canvas: Canvas, bounds: Rect, calendar: Calendar) {}
+ override fun render(
+ canvas: Canvas,
+ bounds: Rect,
+ zonedDateTime: ZonedDateTime
+ ) {}
override fun renderHighlightLayer(
canvas: Canvas,
bounds: Rect,
- calendar: Calendar
+ zonedDateTime: ZonedDateTime
) {}
}
- ).apply { setOverridePreviewReferenceTimeMillis(REFERENCE_PREVIEW_TIME) }
+ ).apply { setOverridePreviewReferenceInstant(REFERENCE_PREVIEW_TIME) }
)
}
@@ -100,7 +105,7 @@
)
// Simple check that [watchFace] looks sensible.
- assertThat(watchFace.overridePreviewReferenceTimeMillis).isEqualTo(
+ assertThat(watchFace.overridePreviewReferenceInstant).isEqualTo(
REFERENCE_PREVIEW_TIME
)
}
diff --git a/wear/wear-watchface-samples-minimal-complications/build.gradle b/wear/wear-watchface-samples-minimal-complications/build.gradle
index de0ad5e..d3624bb3 100644
--- a/wear/wear-watchface-samples-minimal-complications/build.gradle
+++ b/wear/wear-watchface-samples-minimal-complications/build.gradle
@@ -44,7 +44,7 @@
android {
defaultConfig {
- minSdkVersion 25
+ minSdkVersion 26
}
buildTypes {
diff --git a/wear/wear-watchface-samples-minimal-complications/src/main/java/androidx/wear/watchface/samples/minimal/complications/WatchFaceRenderer.java b/wear/wear-watchface-samples-minimal-complications/src/main/java/androidx/wear/watchface/samples/minimal/complications/WatchFaceRenderer.java
index 4648c93..86c89a6 100644
--- a/wear/wear-watchface-samples-minimal-complications/src/main/java/androidx/wear/watchface/samples/minimal/complications/WatchFaceRenderer.java
+++ b/wear/wear-watchface-samples-minimal-complications/src/main/java/androidx/wear/watchface/samples/minimal/complications/WatchFaceRenderer.java
@@ -29,7 +29,6 @@
import android.graphics.PorterDuff.Mode;
import android.graphics.PorterDuffXfermode;
import android.graphics.Rect;
-import android.icu.util.Calendar;
import android.view.SurfaceHolder;
import androidx.annotation.NonNull;
@@ -43,6 +42,7 @@
import androidx.wear.watchface.WatchState;
import androidx.wear.watchface.style.CurrentUserStyleRepository;
+import java.time.ZonedDateTime;
import java.util.concurrent.TimeUnit;
class WatchFaceRenderer extends Renderer.CanvasRenderer {
@@ -87,21 +87,22 @@
}
@Override
- public void render(@NonNull Canvas canvas, @NonNull Rect rect, @NonNull Calendar calendar) {
+ public void render(@NonNull Canvas canvas, @NonNull Rect rect,
+ @NonNull ZonedDateTime zonedDateTime) {
mPaint.setColor(Color.BLACK);
canvas.drawRect(rect, mPaint);
for (ComplicationSlot complication :
mComplicationSlotsManager.getComplicationSlots().values()) {
if (complication.isEnabled()) {
- complication.render(canvas, calendar, getRenderParameters());
+ complication.render(canvas, zonedDateTime, getRenderParameters());
}
}
mPaint.setColor(Color.WHITE);
- int hour = calendar.get(Calendar.HOUR_OF_DAY);
- int minute = calendar.get(Calendar.MINUTE);
- int second = calendar.get(Calendar.SECOND);
+ int hour = zonedDateTime.getHour() % 12;
+ int minute = zonedDateTime.getMinute();
+ int second = zonedDateTime.getSecond();
mTime[0] = DIGITS[hour / 10];
mTime[1] = DIGITS[hour % 10];
mTime[2] = second % 2 == 0 ? ':' : ' ';
@@ -120,21 +121,22 @@
Bitmap.createBitmap(rect.width(), rect.height(), Config.ARGB_8888);
}
renderHighlightLayer(
- new Canvas(mHighlightBitmap), rect, calendar, highlightLayerParams);
+ new Canvas(mHighlightBitmap), rect, zonedDateTime, highlightLayerParams);
canvas.drawBitmap(mHighlightBitmap, rect.left, rect.top, mPaint);
}
}
@Override
public void renderHighlightLayer(
- @NonNull Canvas canvas, @NonNull Rect rect, @NonNull Calendar calendar) {
- renderHighlightLayer(canvas, rect, calendar, getRenderParameters().getHighlightLayer());
+ @NonNull Canvas canvas, @NonNull Rect rect, @NonNull ZonedDateTime zonedDateTime) {
+ renderHighlightLayer(canvas, rect, zonedDateTime,
+ getRenderParameters().getHighlightLayer());
}
private void renderHighlightLayer(
@NonNull Canvas canvas,
@NonNull Rect rect,
- @SuppressWarnings("UnusedVariable") @NonNull Calendar calendar,
+ @SuppressWarnings("UnusedVariable") @NonNull ZonedDateTime zonedDateTime,
HighlightLayer params) {
// There is no style defined, so the only options are rendering the highlight for the
// only complication or for all complications, which is essentially the same.
diff --git a/wear/wear-watchface-samples-minimal-complications/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/wear/wear-watchface-samples-minimal-complications/src/main/res/mipmap-anydpi/ic_launcher.xml
similarity index 100%
rename from wear/wear-watchface-samples-minimal-complications/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
rename to wear/wear-watchface-samples-minimal-complications/src/main/res/mipmap-anydpi/ic_launcher.xml
diff --git a/wear/wear-watchface-samples-minimal-style/build.gradle b/wear/wear-watchface-samples-minimal-style/build.gradle
index c696635..f0175ab 100644
--- a/wear/wear-watchface-samples-minimal-style/build.gradle
+++ b/wear/wear-watchface-samples-minimal-style/build.gradle
@@ -43,7 +43,7 @@
android {
defaultConfig {
- minSdkVersion 25
+ minSdkVersion 26
}
buildTypes {
diff --git a/wear/wear-watchface-samples-minimal-style/src/main/java/androidx/wear/watchface/samples/minimal/style/WatchFaceRenderer.java b/wear/wear-watchface-samples-minimal-style/src/main/java/androidx/wear/watchface/samples/minimal/style/WatchFaceRenderer.java
index 56c55db..30da679 100644
--- a/wear/wear-watchface-samples-minimal-style/src/main/java/androidx/wear/watchface/samples/minimal/style/WatchFaceRenderer.java
+++ b/wear/wear-watchface-samples-minimal-style/src/main/java/androidx/wear/watchface/samples/minimal/style/WatchFaceRenderer.java
@@ -21,7 +21,6 @@
import android.graphics.Paint;
import android.graphics.Paint.Align;
import android.graphics.Rect;
-import android.icu.util.Calendar;
import android.view.SurfaceHolder;
import androidx.annotation.NonNull;
@@ -35,6 +34,7 @@
import org.jetbrains.annotations.NotNull;
+import java.time.ZonedDateTime;
import java.util.concurrent.TimeUnit;
/**
@@ -68,13 +68,14 @@
}
@Override
- public void render(@NotNull Canvas canvas, @NotNull Rect rect, @NotNull Calendar calendar) {
- mTimeRenderer.render(canvas, rect, calendar, getRenderParameters());
+ public void render(@NotNull Canvas canvas, @NotNull Rect rect,
+ @NotNull ZonedDateTime zonedDateTime) {
+ mTimeRenderer.render(canvas, rect, zonedDateTime, getRenderParameters());
}
@Override
public void renderHighlightLayer(@NonNull Canvas canvas, @NonNull Rect bounds,
- @NonNull Calendar calendar) {
+ @NonNull ZonedDateTime zonedDateTime) {
RenderParameters.HighlightLayer highlightLayer = getRenderParameters().getHighlightLayer();
canvas.drawColor(highlightLayer.getBackgroundTint());
mHighlightPaint.setColor(highlightLayer.getHighlightTint());
@@ -96,7 +97,7 @@
private interface TimeRenderer {
void render(
- @NotNull Canvas canvas, @NotNull Rect rect, @NotNull Calendar calendar,
+ @NotNull Canvas canvas, @NotNull Rect rect, @NotNull ZonedDateTime zonedDateTime,
RenderParameters renderParameters);
}
@@ -114,14 +115,14 @@
@Override
public void render(
- @NotNull Canvas canvas, @NotNull Rect rect, @NotNull Calendar calendar,
+ @NotNull Canvas canvas, @NotNull Rect rect, @NotNull ZonedDateTime zonedDateTime,
RenderParameters renderParameters) {
mPaint.setColor(Color.BLACK);
canvas.drawRect(rect, mPaint);
mPaint.setColor(Color.WHITE);
- int hour = calendar.get(Calendar.HOUR_OF_DAY);
- int minute = calendar.get(Calendar.MINUTE);
- int second = calendar.get(Calendar.SECOND);
+ int hour = zonedDateTime.getHour() % 12;
+ int minute = zonedDateTime.getMinute();
+ int second = zonedDateTime.getSecond();
mTimeText[0] = DIGITS[hour / 10];
mTimeText[1] = DIGITS[hour % 10];
mTimeText[2] = second % 2 == 0 ? ':' : ' ';
@@ -185,12 +186,12 @@
@Override
public void render(
- @NotNull Canvas canvas, @NotNull Rect rect, @NotNull Calendar calendar,
+ @NotNull Canvas canvas, @NotNull Rect rect, @NotNull ZonedDateTime zonedDateTime,
RenderParameters renderParameters) {
boolean isActive = renderParameters.getDrawMode() != DrawMode.AMBIENT;
- int hour = calendar.get(Calendar.HOUR_OF_DAY);
- int minute = calendar.get(Calendar.MINUTE);
- int second = calendar.get(Calendar.SECOND);
+ int hour = zonedDateTime.getHour() % 12;
+ int minute = zonedDateTime.getMinute();
+ int second = zonedDateTime.getSecond();
if (isActive) {
mPaint.setColor(Color.rgb(64 + 192 * second / 60, 0, 0));
diff --git a/wear/wear-watchface-samples-minimal-style/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/wear/wear-watchface-samples-minimal-style/src/main/res/mipmap-anydpi/ic_launcher.xml
similarity index 100%
rename from wear/wear-watchface-samples-minimal-style/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
rename to wear/wear-watchface-samples-minimal-style/src/main/res/mipmap-anydpi/ic_launcher.xml
diff --git a/wear/wear-watchface-style/build.gradle b/wear/wear-watchface-style/build.gradle
index 0770a62..e7be489 100644
--- a/wear/wear-watchface-style/build.gradle
+++ b/wear/wear-watchface-style/build.gradle
@@ -51,7 +51,7 @@
android {
defaultConfig {
- minSdkVersion 25
+ minSdkVersion 26
}
// Use Robolectric 4.+
diff --git a/wear/wear-watchface-style/src/test/java/androidx/wear/watchface/style/StyleParcelableTest.kt b/wear/wear-watchface-style/src/test/java/androidx/wear/watchface/style/StyleParcelableTest.kt
index 592728a..b737cfe 100644
--- a/wear/wear-watchface-style/src/test/java/androidx/wear/watchface/style/StyleParcelableTest.kt
+++ b/wear/wear-watchface-style/src/test/java/androidx/wear/watchface/style/StyleParcelableTest.kt
@@ -17,7 +17,9 @@
package androidx.wear.watchface.style
import android.graphics.drawable.Icon
+import android.os.Build
import android.os.Parcel
+import androidx.annotation.RequiresApi
import androidx.wear.watchface.style.UserStyleSetting.BooleanUserStyleSetting
import androidx.wear.watchface.style.UserStyleSetting.ComplicationSlotsUserStyleSetting
@@ -33,11 +35,14 @@
import com.google.common.truth.Truth.assertThat
import org.junit.Assert.assertFalse
import org.junit.Assert.assertTrue
+import org.junit.Assume.assumeTrue
+import org.junit.Before
import org.junit.Ignore
import org.junit.Test
import org.junit.runner.RunWith
@RunWith(StyleTestRunner::class)
+@RequiresApi(Build.VERSION_CODES.P)
public class StyleParcelableTest {
private val icon1 = Icon.createWithContentUri("icon1")
@@ -49,6 +54,11 @@
private val option3 = ListOption(Option.Id("3"), "three", icon3)
private val option4 = ListOption(Option.Id("4"), "four", icon4)
+ @Before
+ public fun setUp() {
+ assumeTrue("These tests require API 28", Build.VERSION.SDK_INT >= 28)
+ }
+
@Test
public fun parcelAndUnparcelStyleSettingAndOption() {
val settingIcon = Icon.createWithContentUri("settingIcon")
diff --git a/wear/wear-watchface/api/current.txt b/wear/wear-watchface/api/current.txt
index 90fb09f..1e6e94f 100644
--- a/wear/wear-watchface/api/current.txt
+++ b/wear/wear-watchface/api/current.txt
@@ -7,11 +7,11 @@
}
public interface CanvasComplication {
- method public void drawHighlight(android.graphics.Canvas canvas, android.graphics.Rect bounds, int boundsType, android.icu.util.Calendar calendar, @ColorInt int color);
- method public androidx.wear.complications.data.ComplicationData? getData();
- method public void loadData(androidx.wear.complications.data.ComplicationData? complicationData, boolean loadDrawablesAsynchronous);
+ method public void drawHighlight(android.graphics.Canvas canvas, android.graphics.Rect bounds, int boundsType, java.time.ZonedDateTime zonedDateTime, @ColorInt int color);
+ method public androidx.wear.complications.data.ComplicationData getData();
+ method public void loadData(androidx.wear.complications.data.ComplicationData complicationData, boolean loadDrawablesAsynchronous);
method @WorkerThread public default void onRendererCreated(androidx.wear.watchface.Renderer renderer);
- method @UiThread public void render(android.graphics.Canvas canvas, android.graphics.Rect bounds, android.icu.util.Calendar calendar, androidx.wear.watchface.RenderParameters renderParameters, int slotId);
+ method @UiThread public void render(android.graphics.Canvas canvas, android.graphics.Rect bounds, java.time.ZonedDateTime zonedDateTime, androidx.wear.watchface.RenderParameters renderParameters, int slotId);
}
public static interface CanvasComplication.InvalidateCallback {
@@ -41,10 +41,10 @@
method public androidx.wear.watchface.CanvasComplication getRenderer();
method @UiThread public java.util.List<androidx.wear.complications.data.ComplicationType> getSupportedTypes();
method public androidx.wear.watchface.ComplicationTapFilter getTapFilter();
- method public boolean isActiveAt(long dateTimeMillis);
+ method public boolean isActiveAt(java.time.Instant instant);
method @UiThread public boolean isEnabled();
- method @UiThread public void render(android.graphics.Canvas canvas, android.icu.util.Calendar calendar, androidx.wear.watchface.RenderParameters renderParameters);
- method @UiThread public void renderHighlightLayer(android.graphics.Canvas canvas, android.icu.util.Calendar calendar, androidx.wear.watchface.RenderParameters renderParameters);
+ method @UiThread public void render(android.graphics.Canvas canvas, java.time.ZonedDateTime zonedDateTime, androidx.wear.watchface.RenderParameters renderParameters);
+ method @UiThread public void renderHighlightLayer(android.graphics.Canvas canvas, java.time.ZonedDateTime zonedDateTime, androidx.wear.watchface.RenderParameters renderParameters);
property @UiThread public final int accessibilityTraversalIndex;
property public final int boundsType;
property public final androidx.wear.watchface.CanvasComplicationFactory canvasComplicationFactory;
@@ -107,7 +107,7 @@
method public android.graphics.Rect getBounds();
method public android.app.PendingIntent? getTapAction();
method public androidx.wear.complications.data.ComplicationText getText();
- method public CharSequence getTextAt(android.content.res.Resources resources, long dateTimeMillis);
+ method public CharSequence getTextAt(android.content.res.Resources resources, java.time.Instant instant);
property public final android.graphics.Rect bounds;
property public final android.app.PendingIntent? tapAction;
property public final androidx.wear.complications.data.ComplicationText text;
@@ -220,8 +220,8 @@
public abstract static class Renderer.CanvasRenderer extends androidx.wear.watchface.Renderer {
ctor @WorkerThread public Renderer.CanvasRenderer(android.view.SurfaceHolder surfaceHolder, androidx.wear.watchface.style.CurrentUserStyleRepository currentUserStyleRepository, androidx.wear.watchface.WatchState watchState, int canvasType, @IntRange(from=0, to=60000) long interactiveDrawModeUpdateDelayMillis);
method @UiThread public void init();
- method @UiThread public abstract void render(android.graphics.Canvas canvas, android.graphics.Rect bounds, android.icu.util.Calendar calendar);
- method @UiThread public abstract void renderHighlightLayer(android.graphics.Canvas canvas, android.graphics.Rect bounds, android.icu.util.Calendar calendar);
+ method @UiThread public abstract void render(android.graphics.Canvas canvas, android.graphics.Rect bounds, java.time.ZonedDateTime zonedDateTime);
+ method @UiThread public abstract void renderHighlightLayer(android.graphics.Canvas canvas, android.graphics.Rect bounds, java.time.ZonedDateTime zonedDateTime);
method public void uiThreadInitInternal$metalava_module();
}
@@ -235,8 +235,8 @@
method public final android.opengl.EGLContext getEglUiThreadContext();
method @WorkerThread public void onBackgroundThreadGlContextCreated();
method @UiThread public void onUiThreadGlSurfaceCreated(@Px int width, @Px int height);
- method @UiThread public abstract void render(android.icu.util.Calendar calendar);
- method @UiThread public abstract void renderHighlightLayer(android.icu.util.Calendar calendar);
+ method @UiThread public abstract void render(java.time.ZonedDateTime zonedDateTime);
+ method @UiThread public abstract void renderHighlightLayer(java.time.ZonedDateTime zonedDateTime);
method @WorkerThread public final void runBackgroundThreadGlCommands(Runnable runnable);
method @UiThread public final void runUiThreadGlCommands(Runnable runnable);
method public final void setEglConfig(android.opengl.EGLConfig eglConfig);
@@ -260,11 +260,11 @@
}
public final class TapEvent {
- ctor public TapEvent(@Px int xPos, @Px int yPos, long tapTimeMillis);
- method public long getTapTimeMillis();
+ ctor public TapEvent(@Px int xPos, @Px int yPos, java.time.Instant tapTime);
+ method public java.time.Instant getTapTime();
method public int getXPos();
method public int getYPos();
- property public final long tapTimeMillis;
+ property public final java.time.Instant tapTime;
property public final int xPos;
property public final int yPos;
}
@@ -272,16 +272,16 @@
public final class WatchFace {
ctor public WatchFace(int watchFaceType, androidx.wear.watchface.Renderer renderer);
method public androidx.wear.watchface.WatchFace.LegacyWatchFaceOverlayStyle getLegacyWatchFaceStyle();
- method public Long? getOverridePreviewReferenceTimeMillis();
+ method public java.time.Instant? getOverridePreviewReferenceInstant();
method public androidx.wear.watchface.Renderer getRenderer();
method public int getWatchFaceType();
method public static boolean isLegacyWatchFaceOverlayStyleSupported();
method public androidx.wear.watchface.WatchFace setLegacyWatchFaceStyle(androidx.wear.watchface.WatchFace.LegacyWatchFaceOverlayStyle legacyWatchFaceStyle);
- method public androidx.wear.watchface.WatchFace setOverridePreviewReferenceTimeMillis(@IntRange(from=0) long previewReferenceTimeMillis);
+ method public androidx.wear.watchface.WatchFace setOverridePreviewReferenceInstant(java.time.Instant previewReferenceTimeMillis);
method public androidx.wear.watchface.WatchFace setTapListener(androidx.wear.watchface.WatchFace.TapListener? tapListener);
method public void setWatchFaceType(int watchFaceType);
property public final androidx.wear.watchface.WatchFace.LegacyWatchFaceOverlayStyle legacyWatchFaceStyle;
- property public final Long? overridePreviewReferenceTimeMillis;
+ property public final java.time.Instant? overridePreviewReferenceInstant;
property public final androidx.wear.watchface.Renderer renderer;
property public final int watchFaceType;
field public static final androidx.wear.watchface.WatchFace.Companion Companion;
diff --git a/wear/wear-watchface/api/public_plus_experimental_current.txt b/wear/wear-watchface/api/public_plus_experimental_current.txt
index 90fb09f..1e6e94f 100644
--- a/wear/wear-watchface/api/public_plus_experimental_current.txt
+++ b/wear/wear-watchface/api/public_plus_experimental_current.txt
@@ -7,11 +7,11 @@
}
public interface CanvasComplication {
- method public void drawHighlight(android.graphics.Canvas canvas, android.graphics.Rect bounds, int boundsType, android.icu.util.Calendar calendar, @ColorInt int color);
- method public androidx.wear.complications.data.ComplicationData? getData();
- method public void loadData(androidx.wear.complications.data.ComplicationData? complicationData, boolean loadDrawablesAsynchronous);
+ method public void drawHighlight(android.graphics.Canvas canvas, android.graphics.Rect bounds, int boundsType, java.time.ZonedDateTime zonedDateTime, @ColorInt int color);
+ method public androidx.wear.complications.data.ComplicationData getData();
+ method public void loadData(androidx.wear.complications.data.ComplicationData complicationData, boolean loadDrawablesAsynchronous);
method @WorkerThread public default void onRendererCreated(androidx.wear.watchface.Renderer renderer);
- method @UiThread public void render(android.graphics.Canvas canvas, android.graphics.Rect bounds, android.icu.util.Calendar calendar, androidx.wear.watchface.RenderParameters renderParameters, int slotId);
+ method @UiThread public void render(android.graphics.Canvas canvas, android.graphics.Rect bounds, java.time.ZonedDateTime zonedDateTime, androidx.wear.watchface.RenderParameters renderParameters, int slotId);
}
public static interface CanvasComplication.InvalidateCallback {
@@ -41,10 +41,10 @@
method public androidx.wear.watchface.CanvasComplication getRenderer();
method @UiThread public java.util.List<androidx.wear.complications.data.ComplicationType> getSupportedTypes();
method public androidx.wear.watchface.ComplicationTapFilter getTapFilter();
- method public boolean isActiveAt(long dateTimeMillis);
+ method public boolean isActiveAt(java.time.Instant instant);
method @UiThread public boolean isEnabled();
- method @UiThread public void render(android.graphics.Canvas canvas, android.icu.util.Calendar calendar, androidx.wear.watchface.RenderParameters renderParameters);
- method @UiThread public void renderHighlightLayer(android.graphics.Canvas canvas, android.icu.util.Calendar calendar, androidx.wear.watchface.RenderParameters renderParameters);
+ method @UiThread public void render(android.graphics.Canvas canvas, java.time.ZonedDateTime zonedDateTime, androidx.wear.watchface.RenderParameters renderParameters);
+ method @UiThread public void renderHighlightLayer(android.graphics.Canvas canvas, java.time.ZonedDateTime zonedDateTime, androidx.wear.watchface.RenderParameters renderParameters);
property @UiThread public final int accessibilityTraversalIndex;
property public final int boundsType;
property public final androidx.wear.watchface.CanvasComplicationFactory canvasComplicationFactory;
@@ -107,7 +107,7 @@
method public android.graphics.Rect getBounds();
method public android.app.PendingIntent? getTapAction();
method public androidx.wear.complications.data.ComplicationText getText();
- method public CharSequence getTextAt(android.content.res.Resources resources, long dateTimeMillis);
+ method public CharSequence getTextAt(android.content.res.Resources resources, java.time.Instant instant);
property public final android.graphics.Rect bounds;
property public final android.app.PendingIntent? tapAction;
property public final androidx.wear.complications.data.ComplicationText text;
@@ -220,8 +220,8 @@
public abstract static class Renderer.CanvasRenderer extends androidx.wear.watchface.Renderer {
ctor @WorkerThread public Renderer.CanvasRenderer(android.view.SurfaceHolder surfaceHolder, androidx.wear.watchface.style.CurrentUserStyleRepository currentUserStyleRepository, androidx.wear.watchface.WatchState watchState, int canvasType, @IntRange(from=0, to=60000) long interactiveDrawModeUpdateDelayMillis);
method @UiThread public void init();
- method @UiThread public abstract void render(android.graphics.Canvas canvas, android.graphics.Rect bounds, android.icu.util.Calendar calendar);
- method @UiThread public abstract void renderHighlightLayer(android.graphics.Canvas canvas, android.graphics.Rect bounds, android.icu.util.Calendar calendar);
+ method @UiThread public abstract void render(android.graphics.Canvas canvas, android.graphics.Rect bounds, java.time.ZonedDateTime zonedDateTime);
+ method @UiThread public abstract void renderHighlightLayer(android.graphics.Canvas canvas, android.graphics.Rect bounds, java.time.ZonedDateTime zonedDateTime);
method public void uiThreadInitInternal$metalava_module();
}
@@ -235,8 +235,8 @@
method public final android.opengl.EGLContext getEglUiThreadContext();
method @WorkerThread public void onBackgroundThreadGlContextCreated();
method @UiThread public void onUiThreadGlSurfaceCreated(@Px int width, @Px int height);
- method @UiThread public abstract void render(android.icu.util.Calendar calendar);
- method @UiThread public abstract void renderHighlightLayer(android.icu.util.Calendar calendar);
+ method @UiThread public abstract void render(java.time.ZonedDateTime zonedDateTime);
+ method @UiThread public abstract void renderHighlightLayer(java.time.ZonedDateTime zonedDateTime);
method @WorkerThread public final void runBackgroundThreadGlCommands(Runnable runnable);
method @UiThread public final void runUiThreadGlCommands(Runnable runnable);
method public final void setEglConfig(android.opengl.EGLConfig eglConfig);
@@ -260,11 +260,11 @@
}
public final class TapEvent {
- ctor public TapEvent(@Px int xPos, @Px int yPos, long tapTimeMillis);
- method public long getTapTimeMillis();
+ ctor public TapEvent(@Px int xPos, @Px int yPos, java.time.Instant tapTime);
+ method public java.time.Instant getTapTime();
method public int getXPos();
method public int getYPos();
- property public final long tapTimeMillis;
+ property public final java.time.Instant tapTime;
property public final int xPos;
property public final int yPos;
}
@@ -272,16 +272,16 @@
public final class WatchFace {
ctor public WatchFace(int watchFaceType, androidx.wear.watchface.Renderer renderer);
method public androidx.wear.watchface.WatchFace.LegacyWatchFaceOverlayStyle getLegacyWatchFaceStyle();
- method public Long? getOverridePreviewReferenceTimeMillis();
+ method public java.time.Instant? getOverridePreviewReferenceInstant();
method public androidx.wear.watchface.Renderer getRenderer();
method public int getWatchFaceType();
method public static boolean isLegacyWatchFaceOverlayStyleSupported();
method public androidx.wear.watchface.WatchFace setLegacyWatchFaceStyle(androidx.wear.watchface.WatchFace.LegacyWatchFaceOverlayStyle legacyWatchFaceStyle);
- method public androidx.wear.watchface.WatchFace setOverridePreviewReferenceTimeMillis(@IntRange(from=0) long previewReferenceTimeMillis);
+ method public androidx.wear.watchface.WatchFace setOverridePreviewReferenceInstant(java.time.Instant previewReferenceTimeMillis);
method public androidx.wear.watchface.WatchFace setTapListener(androidx.wear.watchface.WatchFace.TapListener? tapListener);
method public void setWatchFaceType(int watchFaceType);
property public final androidx.wear.watchface.WatchFace.LegacyWatchFaceOverlayStyle legacyWatchFaceStyle;
- property public final Long? overridePreviewReferenceTimeMillis;
+ property public final java.time.Instant? overridePreviewReferenceInstant;
property public final androidx.wear.watchface.Renderer renderer;
property public final int watchFaceType;
field public static final androidx.wear.watchface.WatchFace.Companion Companion;
diff --git a/wear/wear-watchface/api/restricted_current.txt b/wear/wear-watchface/api/restricted_current.txt
index 0469576..807bc31 100644
--- a/wear/wear-watchface/api/restricted_current.txt
+++ b/wear/wear-watchface/api/restricted_current.txt
@@ -33,11 +33,11 @@
}
public interface CanvasComplication {
- method public void drawHighlight(android.graphics.Canvas canvas, android.graphics.Rect bounds, @androidx.wear.watchface.ComplicationSlotBoundsType int boundsType, android.icu.util.Calendar calendar, @ColorInt int color);
- method public androidx.wear.complications.data.ComplicationData? getData();
- method public void loadData(androidx.wear.complications.data.ComplicationData? complicationData, boolean loadDrawablesAsynchronous);
+ method public void drawHighlight(android.graphics.Canvas canvas, android.graphics.Rect bounds, @androidx.wear.watchface.ComplicationSlotBoundsType int boundsType, java.time.ZonedDateTime zonedDateTime, @ColorInt int color);
+ method public androidx.wear.complications.data.ComplicationData getData();
+ method public void loadData(androidx.wear.complications.data.ComplicationData complicationData, boolean loadDrawablesAsynchronous);
method @WorkerThread public default void onRendererCreated(androidx.wear.watchface.Renderer renderer);
- method @UiThread public void render(android.graphics.Canvas canvas, android.graphics.Rect bounds, android.icu.util.Calendar calendar, androidx.wear.watchface.RenderParameters renderParameters, int slotId);
+ method @UiThread public void render(android.graphics.Canvas canvas, android.graphics.Rect bounds, java.time.ZonedDateTime zonedDateTime, androidx.wear.watchface.RenderParameters renderParameters, int slotId);
}
public static interface CanvasComplication.InvalidateCallback {
@@ -90,10 +90,10 @@
method public androidx.wear.watchface.CanvasComplication getRenderer();
method @UiThread public java.util.List<androidx.wear.complications.data.ComplicationType> getSupportedTypes();
method public androidx.wear.watchface.ComplicationTapFilter getTapFilter();
- method public boolean isActiveAt(long dateTimeMillis);
+ method public boolean isActiveAt(java.time.Instant instant);
method @UiThread public boolean isEnabled();
- method @UiThread public void render(android.graphics.Canvas canvas, android.icu.util.Calendar calendar, androidx.wear.watchface.RenderParameters renderParameters);
- method @UiThread public void renderHighlightLayer(android.graphics.Canvas canvas, android.icu.util.Calendar calendar, androidx.wear.watchface.RenderParameters renderParameters);
+ method @UiThread public void render(android.graphics.Canvas canvas, java.time.ZonedDateTime zonedDateTime, androidx.wear.watchface.RenderParameters renderParameters);
+ method @UiThread public void renderHighlightLayer(android.graphics.Canvas canvas, java.time.ZonedDateTime zonedDateTime, androidx.wear.watchface.RenderParameters renderParameters);
property @UiThread public final int accessibilityTraversalIndex;
property public final int boundsType;
property public final androidx.wear.watchface.CanvasComplicationFactory canvasComplicationFactory;
@@ -170,7 +170,7 @@
method public android.graphics.Rect getBounds();
method public android.app.PendingIntent? getTapAction();
method public androidx.wear.complications.data.ComplicationText getText();
- method public CharSequence getTextAt(android.content.res.Resources resources, long dateTimeMillis);
+ method public CharSequence getTextAt(android.content.res.Resources resources, java.time.Instant instant);
property public final android.graphics.Rect bounds;
property public final android.app.PendingIntent? tapAction;
property public final androidx.wear.complications.data.ComplicationText text;
@@ -316,8 +316,8 @@
public abstract static class Renderer.CanvasRenderer extends androidx.wear.watchface.Renderer {
ctor @WorkerThread public Renderer.CanvasRenderer(android.view.SurfaceHolder surfaceHolder, androidx.wear.watchface.style.CurrentUserStyleRepository currentUserStyleRepository, androidx.wear.watchface.WatchState watchState, int canvasType, @IntRange(from=0, to=60000) long interactiveDrawModeUpdateDelayMillis);
method @UiThread public void init();
- method @UiThread public abstract void render(android.graphics.Canvas canvas, android.graphics.Rect bounds, android.icu.util.Calendar calendar);
- method @UiThread public abstract void renderHighlightLayer(android.graphics.Canvas canvas, android.graphics.Rect bounds, android.icu.util.Calendar calendar);
+ method @UiThread public abstract void render(android.graphics.Canvas canvas, android.graphics.Rect bounds, java.time.ZonedDateTime zonedDateTime);
+ method @UiThread public abstract void renderHighlightLayer(android.graphics.Canvas canvas, android.graphics.Rect bounds, java.time.ZonedDateTime zonedDateTime);
method public void uiThreadInitInternal$metalava_module();
}
@@ -331,8 +331,8 @@
method public final android.opengl.EGLContext getEglUiThreadContext();
method @WorkerThread public void onBackgroundThreadGlContextCreated();
method @UiThread public void onUiThreadGlSurfaceCreated(@Px int width, @Px int height);
- method @UiThread public abstract void render(android.icu.util.Calendar calendar);
- method @UiThread public abstract void renderHighlightLayer(android.icu.util.Calendar calendar);
+ method @UiThread public abstract void render(java.time.ZonedDateTime zonedDateTime);
+ method @UiThread public abstract void renderHighlightLayer(java.time.ZonedDateTime zonedDateTime);
method @WorkerThread public final void runBackgroundThreadGlCommands(Runnable runnable);
method @UiThread public final void runUiThreadGlCommands(Runnable runnable);
method public final void setEglConfig(android.opengl.EGLConfig eglConfig);
@@ -356,11 +356,11 @@
}
public final class TapEvent {
- ctor public TapEvent(@Px int xPos, @Px int yPos, long tapTimeMillis);
- method public long getTapTimeMillis();
+ ctor public TapEvent(@Px int xPos, @Px int yPos, java.time.Instant tapTime);
+ method public java.time.Instant getTapTime();
method public int getXPos();
method public int getYPos();
- property public final long tapTimeMillis;
+ property public final java.time.Instant tapTime;
property public final int xPos;
property public final int yPos;
}
@@ -371,18 +371,18 @@
method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) @UiThread public static suspend Object? createHeadlessSessionDelegate(android.content.ComponentName componentName, androidx.wear.watchface.control.data.HeadlessWatchFaceInstanceParams params, android.content.Context context, kotlin.coroutines.Continuation<? super androidx.wear.watchface.WatchFace.EditorDelegate> p);
method public androidx.wear.watchface.WatchFace.LegacyWatchFaceOverlayStyle getLegacyWatchFaceStyle();
method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) @UiThread public static kotlinx.coroutines.CompletableDeferred<androidx.wear.watchface.WatchFace.EditorDelegate> getOrCreateEditorDelegate(android.content.ComponentName componentName);
- method public Long? getOverridePreviewReferenceTimeMillis();
+ method public java.time.Instant? getOverridePreviewReferenceInstant();
method public androidx.wear.watchface.Renderer getRenderer();
method public int getWatchFaceType();
method public static boolean isLegacyWatchFaceOverlayStyleSupported();
method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) @UiThread public static void registerEditorDelegate(android.content.ComponentName componentName, androidx.wear.watchface.WatchFace.EditorDelegate editorDelegate);
method public androidx.wear.watchface.WatchFace setLegacyWatchFaceStyle(androidx.wear.watchface.WatchFace.LegacyWatchFaceOverlayStyle legacyWatchFaceStyle);
- method public androidx.wear.watchface.WatchFace setOverridePreviewReferenceTimeMillis(@IntRange(from=0) long previewReferenceTimeMillis);
+ method public androidx.wear.watchface.WatchFace setOverridePreviewReferenceInstant(java.time.Instant previewReferenceTimeMillis);
method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public androidx.wear.watchface.WatchFace setSystemTimeProvider(androidx.wear.watchface.WatchFace.SystemTimeProvider systemTimeProvider);
method public androidx.wear.watchface.WatchFace setTapListener(androidx.wear.watchface.WatchFace.TapListener? tapListener);
method public void setWatchFaceType(int watchFaceType);
property public final androidx.wear.watchface.WatchFace.LegacyWatchFaceOverlayStyle legacyWatchFaceStyle;
- property public final Long? overridePreviewReferenceTimeMillis;
+ property public final java.time.Instant? overridePreviewReferenceInstant;
property public final androidx.wear.watchface.Renderer renderer;
property public final int watchFaceType;
field public static final androidx.wear.watchface.WatchFace.Companion Companion;
@@ -399,16 +399,16 @@
@RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public static interface WatchFace.EditorDelegate {
method public android.os.Handler getBackgroundThreadHandler();
method public androidx.wear.watchface.ComplicationSlotsManager getComplicationSlotsManager();
- method public long getPreviewReferenceTimeMillis();
+ method public java.time.Instant getPreviewReferenceInstant();
method public android.graphics.Rect getScreenBounds();
method public androidx.wear.watchface.style.UserStyle getUserStyle();
method public androidx.wear.watchface.style.UserStyleSchema getUserStyleSchema();
method public void onDestroy();
- method public android.graphics.Bitmap renderWatchFaceToBitmap(androidx.wear.watchface.RenderParameters renderParameters, long calendarTimeMillis, java.util.Map<java.lang.Integer,? extends androidx.wear.complications.data.ComplicationData>? slotIdToComplicationData);
+ method public android.graphics.Bitmap renderWatchFaceToBitmap(androidx.wear.watchface.RenderParameters renderParameters, java.time.Instant instant, java.util.Map<java.lang.Integer,? extends androidx.wear.complications.data.ComplicationData>? slotIdToComplicationData);
method public void setUserStyle(androidx.wear.watchface.style.UserStyle userStyle);
property public abstract android.os.Handler backgroundThreadHandler;
property public abstract androidx.wear.watchface.ComplicationSlotsManager complicationSlotsManager;
- property public abstract long previewReferenceTimeMillis;
+ property public abstract java.time.Instant previewReferenceInstant;
property public abstract android.graphics.Rect screenBounds;
property public abstract androidx.wear.watchface.style.UserStyle userStyle;
property public abstract androidx.wear.watchface.style.UserStyleSchema userStyleSchema;
@@ -429,6 +429,7 @@
@RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public static interface WatchFace.SystemTimeProvider {
method public long getSystemTimeMillis();
+ method public java.time.ZoneId getSystemTimeZoneId();
}
public static interface WatchFace.TapListener {
@@ -447,10 +448,10 @@
}
@RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public final class WatchFaceImpl {
- ctor @UiThread public WatchFaceImpl(androidx.wear.watchface.WatchFace watchface, androidx.wear.watchface.WatchFaceHostApi watchFaceHostApi, androidx.wear.watchface.WatchState watchState, androidx.wear.watchface.style.CurrentUserStyleRepository currentUserStyleRepository, androidx.wear.watchface.ComplicationSlotsManager complicationSlotsManager, android.icu.util.Calendar calendar, androidx.wear.watchface.BroadcastsObserver broadcastsObserver, androidx.wear.watchface.BroadcastsReceiver? broadcastsReceiver);
- method public long getPreviewReferenceTimeMillis();
+ ctor @UiThread public WatchFaceImpl(androidx.wear.watchface.WatchFace watchface, androidx.wear.watchface.WatchFaceHostApi watchFaceHostApi, androidx.wear.watchface.WatchState watchState, androidx.wear.watchface.style.CurrentUserStyleRepository currentUserStyleRepository, androidx.wear.watchface.ComplicationSlotsManager complicationSlotsManager, androidx.wear.watchface.BroadcastsObserver broadcastsObserver, androidx.wear.watchface.BroadcastsReceiver? broadcastsReceiver);
+ method public java.time.Instant getPreviewReferenceInstant();
method public void setComplicationSlotsManager(androidx.wear.watchface.ComplicationSlotsManager complicationSlotsManager);
- property public final long previewReferenceTimeMillis;
+ property public final java.time.Instant previewReferenceInstant;
}
public final class WatchFaceKt {
diff --git a/wear/wear-watchface/build.gradle b/wear/wear-watchface/build.gradle
index ddab07e..d8bcf45 100644
--- a/wear/wear-watchface/build.gradle
+++ b/wear/wear-watchface/build.gradle
@@ -35,7 +35,7 @@
implementation("androidx.core:core:1.1.0")
- androidTestImplementation(project(":test:screenshot:test-screenshot"))
+ androidTestImplementation(project(":test:screenshot:screenshot"))
androidTestImplementation(project(":wear:wear-watchface-samples"))
androidTestImplementation(libs.testExtJunit)
androidTestImplementation(libs.testCore)
@@ -57,7 +57,7 @@
android {
defaultConfig {
- minSdkVersion 25
+ minSdkVersion 26
}
sourceSets.androidTest.assets.srcDirs +=
diff --git a/wear/wear-watchface/samples/app/build.gradle b/wear/wear-watchface/samples/app/build.gradle
index 056b9a9..6e58e91 100644
--- a/wear/wear-watchface/samples/app/build.gradle
+++ b/wear/wear-watchface/samples/app/build.gradle
@@ -38,7 +38,7 @@
android {
defaultConfig {
- minSdkVersion 25
+ minSdkVersion 26
}
buildTypes {
diff --git a/wear/wear-watchface/samples/build.gradle b/wear/wear-watchface/samples/build.gradle
index 8f9974ec..6d6d005 100644
--- a/wear/wear-watchface/samples/build.gradle
+++ b/wear/wear-watchface/samples/build.gradle
@@ -43,6 +43,6 @@
android {
defaultConfig {
- minSdkVersion 25
+ minSdkVersion 26
}
}
diff --git a/wear/wear-watchface/samples/minimal/build.gradle b/wear/wear-watchface/samples/minimal/build.gradle
index d12ae40..48af133 100644
--- a/wear/wear-watchface/samples/minimal/build.gradle
+++ b/wear/wear-watchface/samples/minimal/build.gradle
@@ -40,7 +40,7 @@
android {
defaultConfig {
- minSdkVersion 25
+ minSdkVersion 26
}
buildTypes {
diff --git a/wear/wear-watchface/samples/minimal/src/main/java/androidx/wear/watchface/samples/minimal/WatchFaceRenderer.java b/wear/wear-watchface/samples/minimal/src/main/java/androidx/wear/watchface/samples/minimal/WatchFaceRenderer.java
index 2466d7a..76a0753 100644
--- a/wear/wear-watchface/samples/minimal/src/main/java/androidx/wear/watchface/samples/minimal/WatchFaceRenderer.java
+++ b/wear/wear-watchface/samples/minimal/src/main/java/androidx/wear/watchface/samples/minimal/WatchFaceRenderer.java
@@ -21,7 +21,6 @@
import android.graphics.Paint;
import android.graphics.Paint.Align;
import android.graphics.Rect;
-import android.icu.util.Calendar;
import android.view.SurfaceHolder;
import androidx.annotation.NonNull;
@@ -32,6 +31,7 @@
import org.jetbrains.annotations.NotNull;
+import java.time.ZonedDateTime;
import java.util.concurrent.TimeUnit;
/**
@@ -60,13 +60,14 @@
}
@Override
- public void render(@NotNull Canvas canvas, @NotNull Rect rect, @NotNull Calendar calendar) {
+ public void render(@NotNull Canvas canvas, @NotNull Rect rect,
+ @NotNull ZonedDateTime zonedDateTime) {
mPaint.setColor(Color.BLACK);
canvas.drawRect(rect, mPaint);
mPaint.setColor(Color.WHITE);
- int hour = calendar.get(Calendar.HOUR_OF_DAY);
- int minute = calendar.get(Calendar.MINUTE);
- int second = calendar.get(Calendar.SECOND);
+ int hour = zonedDateTime.getHour() % 12;
+ int minute = zonedDateTime.getMinute();
+ int second = zonedDateTime.getSecond();
mTimeText[0] = DIGITS[hour / 10];
mTimeText[1] = DIGITS[hour % 10];
mTimeText[2] = second % 2 == 0 ? ':' : ' ';
@@ -82,7 +83,7 @@
@Override
public void renderHighlightLayer(@NonNull Canvas canvas, @NonNull Rect bounds,
- @NonNull Calendar calendar) {
+ @NonNull ZonedDateTime zonedDateTime) {
canvas.drawColor(getRenderParameters().getHighlightLayer().getBackgroundTint());
}
}
diff --git a/wear/wear-watchface/samples/minimal/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/wear/wear-watchface/samples/minimal/src/main/res/mipmap-anydpi/ic_launcher.xml
similarity index 100%
rename from wear/wear-watchface/samples/minimal/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
rename to wear/wear-watchface/samples/minimal/src/main/res/mipmap-anydpi/ic_launcher.xml
diff --git a/wear/wear-watchface/samples/src/main/java/androidx/wear/watchface/samples/ExampleCanvasAnalogWatchFaceService.kt b/wear/wear-watchface/samples/src/main/java/androidx/wear/watchface/samples/ExampleCanvasAnalogWatchFaceService.kt
index 8c6a938..b463269 100644
--- a/wear/wear-watchface/samples/src/main/java/androidx/wear/watchface/samples/ExampleCanvasAnalogWatchFaceService.kt
+++ b/wear/wear-watchface/samples/src/main/java/androidx/wear/watchface/samples/ExampleCanvasAnalogWatchFaceService.kt
@@ -24,7 +24,6 @@
import android.graphics.Rect
import android.graphics.RectF
import android.graphics.drawable.Icon
-import android.icu.util.Calendar
import android.view.SurfaceHolder
import androidx.wear.complications.ComplicationSlotBounds
import androidx.wear.complications.DefaultComplicationDataSourcePolicy
@@ -54,6 +53,7 @@
import androidx.wear.watchface.style.UserStyleSetting.ListUserStyleSetting
import androidx.wear.watchface.style.UserStyleSetting.Option
import androidx.wear.watchface.style.WatchFaceLayer
+import java.time.ZonedDateTime
import kotlin.math.cos
import kotlin.math.sin
@@ -371,7 +371,7 @@
)
}
- override fun render(canvas: Canvas, bounds: Rect, calendar: Calendar) {
+ override fun render(canvas: Canvas, bounds: Rect, zonedDateTime: ZonedDateTime) {
val style = if (renderParameters.drawMode == DrawMode.AMBIENT) {
watchFaceColorStyle.ambientStyle
} else {
@@ -384,13 +384,13 @@
// CanvasComplicationDrawable does that for us.
for ((_, complication) in complicationSlotsManager.complicationSlots) {
if (complication.enabled) {
- complication.render(canvas, calendar, renderParameters)
+ complication.render(canvas, zonedDateTime, renderParameters)
}
}
if (renderParameters.watchFaceLayers.contains(WatchFaceLayer.COMPLICATIONS_OVERLAY)
) {
- drawClockHands(canvas, bounds, calendar, style)
+ drawClockHands(canvas, bounds, zonedDateTime, style)
}
if (renderParameters.drawMode != DrawMode.AMBIENT &&
@@ -400,12 +400,12 @@
}
}
- override fun renderHighlightLayer(canvas: Canvas, bounds: Rect, calendar: Calendar) {
+ override fun renderHighlightLayer(canvas: Canvas, bounds: Rect, zonedDateTime: ZonedDateTime) {
canvas.drawColor(renderParameters.highlightLayer!!.backgroundTint)
for ((_, complication) in complicationSlotsManager.complicationSlots) {
if (complication.enabled) {
- complication.renderHighlightLayer(canvas, calendar, renderParameters)
+ complication.renderHighlightLayer(canvas, zonedDateTime, renderParameters)
}
}
}
@@ -413,14 +413,14 @@
private fun drawClockHands(
canvas: Canvas,
bounds: Rect,
- calendar: Calendar,
+ zonedDateTime: ZonedDateTime,
style: ColorStyle
) {
recalculateClockHands(bounds)
- val hours = calendar.get(Calendar.HOUR).toFloat()
- val minutes = calendar.get(Calendar.MINUTE).toFloat()
- val seconds = calendar.get(Calendar.SECOND).toFloat() +
- (calendar.get(Calendar.MILLISECOND).toFloat() / 1000f)
+ val hours = (zonedDateTime.hour % 12).toFloat()
+ val minutes = zonedDateTime.minute.toFloat()
+ val seconds = zonedDateTime.second.toFloat() +
+ (zonedDateTime.nano.toDouble() / 1000000000.0).toFloat()
val hourRot = (hours + minutes / 60.0f + seconds / 3600.0f) / 12.0f * 360.0f
val minuteRot = (minutes + seconds / 60.0f) / 60.0f * 360.0f
diff --git a/wear/wear-watchface/samples/src/main/java/androidx/wear/watchface/samples/ExampleCanvasDigitalWatchFaceService.kt b/wear/wear-watchface/samples/src/main/java/androidx/wear/watchface/samples/ExampleCanvasDigitalWatchFaceService.kt
index 72f2630..7a6e366 100644
--- a/wear/wear-watchface/samples/src/main/java/androidx/wear/watchface/samples/ExampleCanvasDigitalWatchFaceService.kt
+++ b/wear/wear-watchface/samples/src/main/java/androidx/wear/watchface/samples/ExampleCanvasDigitalWatchFaceService.kt
@@ -30,8 +30,6 @@
import android.graphics.RectF
import android.graphics.Typeface
import android.graphics.drawable.Icon
-import android.icu.util.Calendar
-import android.icu.util.GregorianCalendar
import android.text.format.DateFormat
import android.util.FloatProperty
import android.util.SparseArray
@@ -60,6 +58,7 @@
import androidx.wear.watchface.style.UserStyleSetting
import androidx.wear.watchface.style.UserStyleSetting.Option
import androidx.wear.watchface.style.WatchFaceLayer
+import java.time.ZonedDateTime
import kotlin.math.max
import kotlin.math.min
@@ -249,13 +248,13 @@
private var secondUnits = ""
/** Sets the time represented by this instance. */
- fun set(time: Calendar, is24Hour: Boolean) {
+ fun set(zonedDateTime: ZonedDateTime, is24Hour: Boolean) {
if (is24Hour) {
- val hourValue = time.get(Calendar.HOUR_OF_DAY)
+ val hourValue = zonedDateTime.hour
hourTens = getTensDigitString(hourValue, true)
hourUnits = getUnitsDigitString(hourValue)
} else {
- var hourValue = time.get(Calendar.HOUR)
+ var hourValue = zonedDateTime.hour % 12
// We should show 12 for noon and midnight.
if (hourValue == 0) {
hourValue = 12
@@ -264,10 +263,10 @@
hourUnits = getUnitsDigitString(hourValue)
}
- val minuteValue = time.get(Calendar.MINUTE)
+ val minuteValue = zonedDateTime.minute
minuteTens = getTensDigitString(minuteValue, true)
minuteUnits = getUnitsDigitString(minuteValue)
- val secondsValue = time.get(Calendar.SECOND)
+ val secondsValue = zonedDateTime.second
secondTens = getTensDigitString(secondsValue, true)
secondUnits = getUnitsDigitString(secondsValue)
}
@@ -705,7 +704,6 @@
private var smallDigitWidth = 0
private var digitVerticalPadding = 0
private var gapWidth = 0f
- private val nextSecondTime = GregorianCalendar()
private val currentDigitStrings = DigitStrings()
private val nextDigitStrings = DigitStrings()
private val digitDrawProperties = DigitDrawProperties()
@@ -853,8 +851,8 @@
}
}
- override fun render(canvas: Canvas, bounds: Rect, calendar: Calendar) {
- recalculateBoundsIfChanged(bounds, calendar)
+ override fun render(canvas: Canvas, bounds: Rect, zonedDateTime: ZonedDateTime) {
+ recalculateBoundsIfChanged(bounds, zonedDateTime)
applyColorStyleAndDrawMode(renderParameters.drawMode)
@@ -862,19 +860,15 @@
drawBackground(canvas)
}
- drawComplications(canvas, calendar)
+ drawComplications(canvas, zonedDateTime)
if (renderParameters.watchFaceLayers.contains(WatchFaceLayer.BASE)) {
val is24Hour: Boolean = DateFormat.is24HourFormat(context)
- nextSecondTime.timeInMillis = calendar.timeInMillis
- nextSecondTime.timeZone = calendar.timeZone
- nextSecondTime.add(Calendar.SECOND, 1)
+ currentDigitStrings.set(zonedDateTime, is24Hour)
+ nextDigitStrings.set(zonedDateTime.plusSeconds(1), is24Hour)
- currentDigitStrings.set(calendar, is24Hour)
- nextDigitStrings.set(nextSecondTime, is24Hour)
-
- val secondProgress = calendar.get(Calendar.MILLISECOND) / 1000f
+ val secondProgress = (zonedDateTime.nano.toDouble() / 1000000000.0).toFloat()
val animationStartFraction = DIGIT_ANIMATION_START_TIME_FRACTION[DigitMode.OUTGOING]!!
this.interactiveDrawModeUpdateDelayMillis =
@@ -1008,31 +1002,31 @@
}
}
- override fun renderHighlightLayer(canvas: Canvas, bounds: Rect, calendar: Calendar) {
+ override fun renderHighlightLayer(canvas: Canvas, bounds: Rect, zonedDateTime: ZonedDateTime) {
canvas.drawColor(renderParameters.highlightLayer!!.backgroundTint)
- drawComplicationHighlights(canvas, calendar)
+ drawComplicationHighlights(canvas, zonedDateTime)
}
override fun getMainClockElementBounds() = clockBounds
- private fun recalculateBoundsIfChanged(bounds: Rect, calendar: Calendar) {
+ private fun recalculateBoundsIfChanged(bounds: Rect, zonedDateTime: ZonedDateTime) {
if (oldBounds == bounds) {
return
}
oldBounds.set(bounds)
- calculateClockBound(bounds, calendar)
+ calculateClockBound(bounds, zonedDateTime)
}
- private fun calculateClockBound(bounds: Rect, calendar: Calendar) {
+ private fun calculateClockBound(bounds: Rect, zonedDateTime: ZonedDateTime) {
val hasVerticalComplication =
VERTICAL_COMPLICATION_IDS.any {
- complicationSlotsManager[it]!!.isActiveAt(calendar.timeInMillis)
+ complicationSlotsManager[it]!!.isActiveAt(zonedDateTime.toInstant())
}
val hasHorizontalComplication =
HORIZONTAL_COMPLICATION_IDS.any {
- complicationSlotsManager[it]!!.isActiveAt(calendar.timeInMillis)
+ complicationSlotsManager[it]!!.isActiveAt(zonedDateTime.toInstant())
}
val marginX = if (hasHorizontalComplication) {
@@ -1117,25 +1111,25 @@
)
}
- private fun drawComplications(canvas: Canvas, calendar: Calendar) {
+ private fun drawComplications(canvas: Canvas, zonedDateTime: ZonedDateTime) {
// First, draw the background complication if not in ambient mode
if (renderParameters.drawMode != DrawMode.AMBIENT) {
complicationSlotsManager[ComplicationID.BACKGROUND.ordinal]!!.render(
canvas,
- calendar,
+ zonedDateTime,
renderParameters
)
}
for (i in FOREGROUND_COMPLICATION_IDS) {
val complication = complicationSlotsManager[i] as ComplicationSlot
- complication.render(canvas, calendar, renderParameters)
+ complication.render(canvas, zonedDateTime, renderParameters)
}
}
- private fun drawComplicationHighlights(canvas: Canvas, calendar: Calendar) {
+ private fun drawComplicationHighlights(canvas: Canvas, zonedDateTime: ZonedDateTime) {
for (i in FOREGROUND_COMPLICATION_IDS) {
val complication = complicationSlotsManager[i] as ComplicationSlot
- complication.renderHighlightLayer(canvas, calendar, renderParameters)
+ complication.renderHighlightLayer(canvas, zonedDateTime, renderParameters)
}
}
diff --git a/wear/wear-watchface/samples/src/main/java/androidx/wear/watchface/samples/ExampleOpenGLBackgroundInitWatchFaceService.kt b/wear/wear-watchface/samples/src/main/java/androidx/wear/watchface/samples/ExampleOpenGLBackgroundInitWatchFaceService.kt
index 9a5278b..c76bd2e 100644
--- a/wear/wear-watchface/samples/src/main/java/androidx/wear/watchface/samples/ExampleOpenGLBackgroundInitWatchFaceService.kt
+++ b/wear/wear-watchface/samples/src/main/java/androidx/wear/watchface/samples/ExampleOpenGLBackgroundInitWatchFaceService.kt
@@ -19,7 +19,6 @@
import android.content.res.Resources
import android.graphics.BitmapFactory
import android.graphics.Color
-import android.icu.util.Calendar
import android.opengl.GLES20
import android.opengl.GLUtils
import android.opengl.Matrix
@@ -31,6 +30,7 @@
import androidx.wear.watchface.WatchFaceType
import androidx.wear.watchface.WatchState
import androidx.wear.watchface.style.CurrentUserStyleRepository
+import java.time.ZonedDateTime
/** Expected frame rate in interactive mode. */
private const val FPS: Long = 60
@@ -219,7 +219,7 @@
)
)
- override fun render(calendar: Calendar) {
+ override fun render(zonedDateTime: ZonedDateTime) {
checkGLError("renders")
GLES20.glClearColor(0f, 1f, 0f, 1f)
GLES20.glClear(GLES20.GL_COLOR_BUFFER_BIT)
@@ -236,10 +236,10 @@
GLES20.glBlendFunc(GLES20.GL_SRC_ALPHA, GLES20.GL_ONE_MINUS_SRC_ALPHA)
GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, watchHandTexture)
- val hours = calendar.get(Calendar.HOUR).toFloat()
- val minutes = calendar.get(Calendar.MINUTE).toFloat()
- val seconds = calendar.get(Calendar.SECOND).toFloat() +
- (calendar.get(Calendar.MILLISECOND).toFloat() / 1000f)
+ val hours = (zonedDateTime.hour % 12).toFloat()
+ val minutes = zonedDateTime.minute.toFloat()
+ val seconds = zonedDateTime.second.toFloat() +
+ (zonedDateTime.nano.toDouble() / 1000000000.0).toFloat()
val secondsRot = seconds / 60.0f * 360.0f
Matrix.setRotateM(handPositionMatrix, 0, secondsRot, 0f, 0f, 1f)
@@ -262,7 +262,7 @@
triangleTextureProgram.unbindAttribs()
}
- override fun renderHighlightLayer(calendar: Calendar) {
+ override fun renderHighlightLayer(zonedDateTime: ZonedDateTime) {
val highlightLayer = renderParameters.highlightLayer!!
GLES20.glClearColor(
Color.red(highlightLayer.backgroundTint).toFloat() / 256.0f,
diff --git a/wear/wear-watchface/samples/src/main/java/androidx/wear/watchface/samples/ExampleOpenGLWatchFaceService.kt b/wear/wear-watchface/samples/src/main/java/androidx/wear/watchface/samples/ExampleOpenGLWatchFaceService.kt
index d571efd..ccd06ac 100644
--- a/wear/wear-watchface/samples/src/main/java/androidx/wear/watchface/samples/ExampleOpenGLWatchFaceService.kt
+++ b/wear/wear-watchface/samples/src/main/java/androidx/wear/watchface/samples/ExampleOpenGLWatchFaceService.kt
@@ -19,7 +19,6 @@
import android.graphics.Color
import android.graphics.RectF
import android.graphics.drawable.Icon
-import android.icu.util.Calendar
import android.opengl.GLES20
import android.opengl.GLU
import android.opengl.GLUtils
@@ -50,6 +49,7 @@
import java.nio.ByteBuffer
import java.nio.ByteOrder
import java.nio.FloatBuffer
+import java.time.ZonedDateTime
import kotlin.math.cos
import kotlin.math.sin
@@ -626,7 +626,7 @@
}
}
- override fun render(calendar: Calendar) {
+ override fun render(zonedDateTime: ZonedDateTime) {
// Draw background color and select the appropriate view projection matrix. The background
// should always be black in ambient mode. The view projection matrix used is overhead in
// ambient. In interactive mode, it's tilted depending on the current time.
@@ -638,14 +638,16 @@
"red_style" -> GLES20.glClearColor(0.5f, 0.2f, 0.2f, 1f)
"green_style" -> GLES20.glClearColor(0.2f, 0.5f, 0.2f, 1f)
}
- val cameraIndex = (calendar.timeInMillis / FRAME_PERIOD_MS % numCameraAngles).toInt()
+ val cameraIndex =
+ (zonedDateTime.toInstant().toEpochMilli() / FRAME_PERIOD_MS % numCameraAngles)
+ .toInt()
vpMatrices[cameraIndex]
}
GLES20.glClear(GLES20.GL_COLOR_BUFFER_BIT)
// Draw the complication first.
if (renderParameters.watchFaceLayers.contains(WatchFaceLayer.COMPLICATIONS)) {
- complicationTexture.renderToTexture(calendar, renderParameters)
+ complicationTexture.renderToTexture(zonedDateTime, renderParameters)
textureTriangleProgram.bindProgramAndAttribs()
complicationTexture.bind()
@@ -661,16 +663,15 @@
}
// Compute angle indices for the three hands.
- val seconds = calendar.get(Calendar.SECOND) + calendar.get(Calendar.MILLISECOND) / 1000f
- val minutes = calendar.get(Calendar.MINUTE) + seconds / 60f
- val hours = calendar.get(Calendar.HOUR) + minutes / 60f
+ val seconds = zonedDateTime.second + (zonedDateTime.nano / 1000000000.0)
+ val minutes = zonedDateTime.minute + seconds / 60f
+ val hours = (zonedDateTime.hour % 12) + minutes / 60f
val secIndex = (seconds / 60f * 360f).toInt()
val minIndex = (minutes / 60f * 360f).toInt()
val hoursIndex = (hours / 12f * 360f).toInt()
// Render hands.
- if (renderParameters.watchFaceLayers.contains(WatchFaceLayer.COMPLICATIONS_OVERLAY)
- ) {
+ if (renderParameters.watchFaceLayers.contains(WatchFaceLayer.COMPLICATIONS_OVERLAY)) {
Matrix.multiplyMM(
mvpMatrix,
0,
@@ -713,8 +714,9 @@
}
}
- override fun renderHighlightLayer(calendar: Calendar) {
- val cameraIndex = (calendar.timeInMillis / FRAME_PERIOD_MS % numCameraAngles).toInt()
+ override fun renderHighlightLayer(zonedDateTime: ZonedDateTime) {
+ val cameraIndex =
+ (zonedDateTime.toInstant().toEpochMilli() / FRAME_PERIOD_MS % numCameraAngles).toInt()
val vpMatrix = vpMatrices[cameraIndex]
val highlightLayer = renderParameters.highlightLayer!!
@@ -1336,4 +1338,4 @@
return shader
}
}
-}
+}
\ No newline at end of file
diff --git a/wear/wear-watchface/samples/src/main/java/androidx/wear/watchface/samples/KDocExampleWatchFace.kt b/wear/wear-watchface/samples/src/main/java/androidx/wear/watchface/samples/KDocExampleWatchFace.kt
index aa3216b..a603697 100644
--- a/wear/wear-watchface/samples/src/main/java/androidx/wear/watchface/samples/KDocExampleWatchFace.kt
+++ b/wear/wear-watchface/samples/src/main/java/androidx/wear/watchface/samples/KDocExampleWatchFace.kt
@@ -21,7 +21,6 @@
import android.graphics.Canvas
import android.graphics.Rect
import android.graphics.RectF
-import android.icu.util.Calendar
import android.view.SurfaceHolder
import androidx.annotation.Sampled
import androidx.wear.complications.ComplicationSlotBounds
@@ -46,6 +45,7 @@
import androidx.wear.watchface.style.UserStyleSetting.ListUserStyleSetting
import androidx.wear.watchface.style.UserStyleSetting.Option
import androidx.wear.watchface.style.WatchFaceLayer
+import java.time.ZonedDateTime
@Sampled
fun kDocCreateExampleWatchFaceService(): WatchFaceService {
@@ -178,7 +178,7 @@
override fun render(
canvas: Canvas,
bounds: Rect,
- calendar: Calendar
+ zonedDateTime: ZonedDateTime
) {
// ...
}
@@ -186,7 +186,7 @@
override fun renderHighlightLayer(
canvas: Canvas,
bounds: Rect,
- calendar: Calendar
+ zonedDateTime: ZonedDateTime
) {
canvas.drawColor(renderParameters.highlightLayer!!.backgroundTint)
diff --git a/wear/wear-watchface/src/androidTest/java/androidx/wear/watchface/test/TestCanvasAnalogWatchFaceService.kt b/wear/wear-watchface/src/androidTest/java/androidx/wear/watchface/test/TestCanvasAnalogWatchFaceService.kt
index 0ecb3ca..72c96ce 100644
--- a/wear/wear-watchface/src/androidTest/java/androidx/wear/watchface/test/TestCanvasAnalogWatchFaceService.kt
+++ b/wear/wear-watchface/src/androidTest/java/androidx/wear/watchface/test/TestCanvasAnalogWatchFaceService.kt
@@ -27,12 +27,14 @@
import androidx.wear.watchface.control.data.WallpaperInteractiveWatchFaceInstanceParams
import androidx.wear.watchface.samples.ExampleCanvasAnalogWatchFaceService
import androidx.wear.watchface.style.CurrentUserStyleRepository
+import java.time.ZoneId
/** A simple canvas test analog watch face for integration tests. */
internal class TestCanvasAnalogWatchFaceService(
testContext: Context,
private val handler: Handler,
var mockSystemTimeMillis: Long,
+ var mockZoneId: ZoneId,
var surfaceHolderOverride: SurfaceHolder,
var preRInitFlow: Boolean,
var directBootParams: WallpaperInteractiveWatchFaceInstanceParams?
@@ -72,9 +74,9 @@
complicationSlotsManager,
currentUserStyleRepository
).setSystemTimeProvider(object : WatchFace.SystemTimeProvider {
- override fun getSystemTimeMillis(): Long {
- return mockSystemTimeMillis
- }
+ override fun getSystemTimeMillis() = mockSystemTimeMillis
+
+ override fun getSystemTimeZoneId() = mockZoneId
})
}
diff --git a/wear/wear-watchface/src/androidTest/java/androidx/wear/watchface/test/TestGlesWatchFaceService.kt b/wear/wear-watchface/src/androidTest/java/androidx/wear/watchface/test/TestGlesWatchFaceService.kt
index ec97f1fb..a866b83 100644
--- a/wear/wear-watchface/src/androidTest/java/androidx/wear/watchface/test/TestGlesWatchFaceService.kt
+++ b/wear/wear-watchface/src/androidTest/java/androidx/wear/watchface/test/TestGlesWatchFaceService.kt
@@ -27,12 +27,14 @@
import androidx.wear.watchface.control.data.WallpaperInteractiveWatchFaceInstanceParams
import androidx.wear.watchface.samples.ExampleOpenGLWatchFaceService
import androidx.wear.watchface.style.CurrentUserStyleRepository
+import java.time.ZoneId
/** A simple OpenGL test watch face for integration tests. */
internal class TestGlesWatchFaceService(
testContext: Context,
private val handler: Handler,
var mockSystemTimeMillis: Long,
+ var mockZoneId: ZoneId,
var surfacHolderOverride: SurfaceHolder?,
var directBootParams: WallpaperInteractiveWatchFaceInstanceParams?
) : WatchFaceService() {
@@ -71,9 +73,9 @@
complicationSlotsManager,
currentUserStyleRepository
).setSystemTimeProvider(object : WatchFace.SystemTimeProvider {
- override fun getSystemTimeMillis(): Long {
- return mockSystemTimeMillis
- }
+ override fun getSystemTimeMillis() = mockSystemTimeMillis
+
+ override fun getSystemTimeZoneId() = mockZoneId
})
}
diff --git a/wear/wear-watchface/src/androidTest/java/androidx/wear/watchface/test/WatchFaceControlServiceTest.kt b/wear/wear-watchface/src/androidTest/java/androidx/wear/watchface/test/WatchFaceControlServiceTest.kt
index bcc5c10..2ef3593 100644
--- a/wear/wear-watchface/src/androidTest/java/androidx/wear/watchface/test/WatchFaceControlServiceTest.kt
+++ b/wear/wear-watchface/src/androidTest/java/androidx/wear/watchface/test/WatchFaceControlServiceTest.kt
@@ -21,11 +21,10 @@
import android.content.Intent
import android.graphics.Canvas
import android.graphics.Rect
-import android.icu.util.Calendar
-import android.os.Handler
-import android.os.Looper
+import android.os.Build
import android.support.wearable.watchface.SharedMemoryImage
import android.view.SurfaceHolder
+import androidx.annotation.RequiresApi
import androidx.test.core.app.ApplicationProvider
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.MediumTest
@@ -60,17 +59,18 @@
import androidx.wear.watchface.style.WatchFaceLayer
import com.google.common.truth.Truth.assertThat
import kotlinx.coroutines.CoroutineScope
-import kotlinx.coroutines.android.asCoroutineDispatcher
+import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.withContext
+import org.junit.Assume
+import org.junit.Before
import org.junit.Rule
import org.junit.Test
import org.junit.runner.RunWith
+import java.time.ZonedDateTime
// This service constructs a WatchFace with a task that's posted on the UI thread.
internal class AsyncInitWithUiThreadTaskWatchFace : WatchFaceService() {
- private val mainThreadCoroutineScope = CoroutineScope(
- Handler(Looper.getMainLooper()).asCoroutineDispatcher()
- )
+ private val mainThreadCoroutineScope = CoroutineScope(Dispatchers.Main.immediate)
override suspend fun createWatchFace(
surfaceHolder: SurfaceHolder,
@@ -87,12 +87,12 @@
CanvasType.SOFTWARE,
16
) {
- override fun render(canvas: Canvas, bounds: Rect, calendar: Calendar) {}
+ override fun render(canvas: Canvas, bounds: Rect, zonedDateTime: ZonedDateTime) {}
override fun renderHighlightLayer(
canvas: Canvas,
bounds: Rect,
- calendar: Calendar
+ zonedDateTime: ZonedDateTime
) {}
}
)
@@ -100,12 +100,18 @@
}
@RunWith(AndroidJUnit4::class)
+@RequiresApi(Build.VERSION_CODES.O_MR1)
@MediumTest
public class WatchFaceControlServiceTest {
@get:Rule
internal val screenshotRule = AndroidXScreenshotTestRule("wear/wear-watchface")
+ @Before
+ public fun setUp() {
+ Assume.assumeTrue("This test suite assumes API 27", Build.VERSION.SDK_INT >= 27)
+ }
+
private fun createInstance(width: Int, height: Int): IHeadlessWatchFace {
val instanceService = IWatchFaceControlService.Stub.asInterface(
WatchFaceControlService().apply {
diff --git a/wear/wear-watchface/src/androidTest/java/androidx/wear/watchface/test/WatchFaceServiceImageTest.kt b/wear/wear-watchface/src/androidTest/java/androidx/wear/watchface/test/WatchFaceServiceImageTest.kt
index d1d7dbe..c2fafbf 100644
--- a/wear/wear-watchface/src/androidTest/java/androidx/wear/watchface/test/WatchFaceServiceImageTest.kt
+++ b/wear/wear-watchface/src/androidTest/java/androidx/wear/watchface/test/WatchFaceServiceImageTest.kt
@@ -27,14 +27,14 @@
import android.graphics.Paint
import android.graphics.Rect
import android.graphics.SurfaceTexture
-import android.icu.util.Calendar
-import android.icu.util.TimeZone
+import android.os.Build
import android.os.Bundle
import android.os.Handler
import android.os.Looper
import android.support.wearable.watchface.SharedMemoryImage
import android.view.Surface
import android.view.SurfaceHolder
+import androidx.annotation.RequiresApi
import androidx.test.core.app.ApplicationProvider
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.MediumTest
@@ -76,10 +76,10 @@
import com.google.common.truth.Truth.assertThat
import kotlinx.coroutines.CompletableDeferred
import kotlinx.coroutines.Deferred
-import kotlinx.coroutines.launch
import kotlinx.coroutines.runBlocking
import org.junit.After
import org.junit.Assert.fail
+import org.junit.Assume
import org.junit.Before
import org.junit.Ignore
import org.junit.Rule
@@ -88,6 +88,9 @@
import org.mockito.Mock
import org.mockito.Mockito
import org.mockito.MockitoAnnotations
+import java.time.Instant
+import java.time.ZoneId
+import java.time.ZonedDateTime
import java.util.concurrent.CountDownLatch
import java.util.concurrent.TimeUnit
@@ -149,7 +152,7 @@
}
val mTimeText = TEST_TIME
- override fun render(canvas: Canvas, bounds: Rect, calendar: Calendar) {
+ override fun render(canvas: Canvas, bounds: Rect, zonedDateTime: ZonedDateTime) {
mPaint.color = Color.BLACK
canvas.drawRect(bounds, mPaint)
mPaint.color = Color.WHITE
@@ -163,7 +166,7 @@
)
}
- override fun renderHighlightLayer(canvas: Canvas, bounds: Rect, calendar: Calendar) {
+ override fun renderHighlightLayer(canvas: Canvas, bounds: Rect, zonedDateTime: ZonedDateTime) {
renderParameters.highlightLayer?.backgroundTint?.let { canvas.drawColor(it) }
}
@@ -240,6 +243,7 @@
@RunWith(AndroidJUnit4::class)
@MediumTest
+@RequiresApi(Build.VERSION_CODES.O_MR1)
public class WatchFaceServiceImageTest {
@Mock
@@ -301,6 +305,7 @@
@Before
public fun setUp() {
+ Assume.assumeTrue("This test suite assumes API 27", Build.VERSION.SDK_INT >= 27)
MockitoAnnotations.initMocks(this)
}
@@ -321,6 +326,7 @@
ApplicationProvider.getApplicationContext<Context>(),
handler,
100000,
+ ZoneId.of("UTC"),
surfaceHolder,
true, // Not direct boot.
null
@@ -339,11 +345,6 @@
engineWrapper =
canvasAnalogWatchFaceService.onCreateEngine() as WatchFaceService.EngineWrapper
- engineWrapper.uiThreadCoroutineScope.launch {
- // Set the timezone so it doesn't matter where the bots are running.
- engineWrapper.deferredWatchFaceImpl.await().calendar.timeZone =
- TimeZone.getTimeZone("UTC")
- }
}
private fun initControllableWatchFace() {
@@ -377,11 +378,6 @@
engineWrapper =
testControllableWatchFaceService.onCreateEngine() as WatchFaceService.EngineWrapper
- engineWrapper.uiThreadCoroutineScope.launch {
- // Set the timezone so it doesn't matter where the bots are running.
- engineWrapper.deferredWatchFaceImpl.await().calendar.timeZone =
- TimeZone.getTimeZone("UTC")
- }
}
private fun initGles2WatchFace() {
@@ -389,6 +385,7 @@
ApplicationProvider.getApplicationContext<Context>(),
handler,
100000,
+ ZoneId.of("UTC"),
surfaceHolder,
null
)
@@ -402,11 +399,6 @@
setPendingWallpaperInteractiveWatchFaceInstance()
engineWrapper = glesWatchFaceService.onCreateEngine() as WatchFaceService.EngineWrapper
- engineWrapper.uiThreadCoroutineScope.launch {
- // Set the timezone so it doesn't matter where the bots are running.
- engineWrapper.deferredWatchFaceImpl.await().calendar.timeZone =
- TimeZone.getTimeZone("UTC")
- }
}
private fun setPendingWallpaperInteractiveWatchFaceInstance() {
@@ -623,6 +615,24 @@
bitmap.assertAgainstGolden(screenshotRule, "green_screenshot")
}
+ @Test
+ public fun testSetGreenStyleButDontResendComplications() {
+ handler.post(this::initCanvasWatchFace)
+ assertThat(initLatch.await(TIMEOUT_MS, TimeUnit.MILLISECONDS)).isTrue()
+ // Note this will clear complicationSlots.
+ interactiveWatchFaceInstance.updateWatchfaceInstance(
+ "newId",
+ UserStyleWireFormat(mapOf(COLOR_STYLE_SETTING to GREEN_STYLE.encodeToByteArray()))
+ )
+
+ handler.post {
+ engineWrapper.draw()
+ }
+
+ assertThat(renderDoneLatch.await(TIMEOUT_MS, TimeUnit.MILLISECONDS)).isTrue()
+ bitmap.assertAgainstGolden(screenshotRule, "green_screenshot_no_complication_data")
+ }
+
@SuppressLint("NewApi")
@Test
public fun testHighlightAllComplicationsInScreenshot() {
@@ -682,7 +692,7 @@
null,
mapOf(
EXAMPLE_CANVAS_WATCHFACE_LEFT_COMPLICATION_ID to
- TapEvent(1, 1, 123456789)
+ TapEvent(1, 1, Instant.ofEpochMilli(123456789))
)
).toWireFormat(),
123456789,
@@ -818,6 +828,7 @@
ApplicationProvider.getApplicationContext<Context>(),
handler,
100000,
+ ZoneId.of("UTC"),
surfaceHolder,
false, // Direct boot.
WallpaperInteractiveWatchFaceInstanceParams(
diff --git a/wear/wear-watchface/src/main/java/androidx/wear/watchface/ComplicationSlot.kt b/wear/wear-watchface/src/main/java/androidx/wear/watchface/ComplicationSlot.kt
index 199e386..b071647 100644
--- a/wear/wear-watchface/src/main/java/androidx/wear/watchface/ComplicationSlot.kt
+++ b/wear/wear-watchface/src/main/java/androidx/wear/watchface/ComplicationSlot.kt
@@ -20,7 +20,6 @@
import android.graphics.Rect
import android.graphics.RectF
import android.graphics.drawable.Drawable
-import android.icu.util.Calendar
import android.os.Bundle
import androidx.annotation.ColorInt
import androidx.annotation.IntDef
@@ -32,11 +31,14 @@
import androidx.wear.complications.DefaultComplicationDataSourcePolicy
import androidx.wear.complications.data.ComplicationData
import androidx.wear.complications.data.ComplicationType
+import androidx.wear.complications.data.NoDataComplicationData
import androidx.wear.watchface.ObservableWatchData.MutableObservableWatchData
import androidx.wear.watchface.style.UserStyleSetting
import androidx.wear.watchface.style.UserStyleSetting.ComplicationSlotsUserStyleSetting
import androidx.wear.watchface.style.UserStyleSetting.ComplicationSlotsUserStyleSetting.ComplicationSlotOverlay
import androidx.wear.watchface.RenderParameters.HighlightedElement
+import java.time.Instant
+import java.time.ZonedDateTime
/**
* Interface for rendering complicationSlots onto a [Canvas]. These should be created by
@@ -68,7 +70,7 @@
*
* @param canvas The [Canvas] to render into
* @param bounds A [Rect] describing the bounds of the complication
- * @param calendar The current [Calendar]
+ * @param zonedDateTime The [ZonedDateTime] to render with
* @param renderParameters The current [RenderParameters]
* @param slotId The Id of the [ComplicationSlot] being rendered
*/
@@ -76,7 +78,7 @@
public fun render(
canvas: Canvas,
bounds: Rect,
- calendar: Calendar,
+ zonedDateTime: ZonedDateTime,
renderParameters: RenderParameters,
slotId: Int
)
@@ -89,19 +91,19 @@
* @param canvas The [Canvas] to render into
* @param bounds A [Rect] describing the bounds of the complication
* @param boundsType The [ComplicationSlotBoundsType] of the complication
- * @param calendar The current [Calendar]
+ * @param zonedDateTime The [ZonedDateTime] to render the highlight with
* @param color The color to render the highlight with
*/
public fun drawHighlight(
canvas: Canvas,
bounds: Rect,
@ComplicationSlotBoundsType boundsType: Int,
- calendar: Calendar,
+ zonedDateTime: ZonedDateTime,
@ColorInt color: Int
)
/** Returns the [ComplicationData] to render with. */
- public fun getData(): ComplicationData?
+ public fun getData(): ComplicationData
/**
* Sets the [ComplicationData] to render with and loads any [Drawable]s contained within the
@@ -112,7 +114,7 @@
* @param complicationData The [ComplicationData] to render with
* @param loadDrawablesAsynchronous Whether or not any drawables should be loaded asynchronously
*/
- public fun loadData(complicationData: ComplicationData?, loadDrawablesAsynchronous: Boolean)
+ public fun loadData(complicationData: ComplicationData, loadDrawablesAsynchronous: Boolean)
}
/** Interface for determining whether a tap hits a complication. */
@@ -595,25 +597,21 @@
/**
* The [androidx.wear.complications.data.ComplicationData] associated with the
- * [ComplicationSlot].
+ * [ComplicationSlot]. This defaults to [NoDataComplicationData].
*/
- public val complicationData:
- ObservableWatchData<androidx.wear.complications.data.ComplicationData> =
- MutableObservableWatchData()
+ public val complicationData: ObservableWatchData<ComplicationData> =
+ MutableObservableWatchData(NoDataComplicationData())
/**
* Whether or not the complication should be considered active and should be rendered at the
* specified time.
*/
- public fun isActiveAt(dateTimeMillis: Long): Boolean {
- if (!complicationData.hasValue()) {
- return false
- }
+ public fun isActiveAt(instant: Instant): Boolean {
return when (complicationData.value.type) {
ComplicationType.NO_DATA -> false
ComplicationType.NO_PERMISSION -> false
ComplicationType.EMPTY -> false
- else -> complicationData.value.validTimeRange.contains(dateTimeMillis)
+ else -> complicationData.value.validTimeRange.contains(instant)
}
}
@@ -621,17 +619,17 @@
* Watch faces should use this method to render a complication. Note the system may call this.
*
* @param canvas The [Canvas] to render into
- * @param calendar The current [Calendar]
+ * @param zonedDateTime The [ZonedDateTime] to render with
* @param renderParameters The current [RenderParameters]
*/
@UiThread
public fun render(
canvas: Canvas,
- calendar: Calendar,
+ zonedDateTime: ZonedDateTime,
renderParameters: RenderParameters
) {
val bounds = computeBounds(Rect(0, 0, canvas.width, canvas.height))
- renderer.render(canvas, bounds, calendar, renderParameters, id)
+ renderer.render(canvas, bounds, zonedDateTime, renderParameters, id)
}
/**
@@ -639,13 +637,13 @@
* layer pass. Note the system may call this.
*
* @param canvas The [Canvas] to render into
- * @param calendar The current [Calendar]
+ * @param zonedDateTime The [ZonedDateTime] to render with
* @param renderParameters The current [RenderParameters]
*/
@UiThread
public fun renderHighlightLayer(
canvas: Canvas,
- calendar: Calendar,
+ zonedDateTime: ZonedDateTime,
renderParameters: RenderParameters
) {
// It's only sensible to render a highlight for non-fixed ComplicationSlots because you
@@ -661,7 +659,7 @@
canvas,
bounds,
boundsType,
- calendar,
+ zonedDateTime,
renderParameters.highlightLayer.highlightTint
)
}
@@ -672,7 +670,7 @@
canvas,
bounds,
boundsType,
- calendar,
+ zonedDateTime,
renderParameters.highlightLayer.highlightTint
)
}
@@ -689,9 +687,7 @@
// Try the current type if there is one, otherwise fall back to the bounds for the default
// complication data source type.
val unitSquareBounds =
- renderer.getData()?.let {
- complicationSlotBounds.perComplicationTypeBounds[it.type]
- } ?: complicationSlotBounds.perComplicationTypeBounds[defaultDataSourceType]!!
+ complicationSlotBounds.perComplicationTypeBounds[complicationData.value.type]!!
unitSquareBounds.intersect(unitSquare)
// We add 0.5 to make toInt() round to the nearest whole number rather than truncating.
return Rect(
diff --git a/wear/wear-watchface/src/main/java/androidx/wear/watchface/ComplicationSlotsManager.kt b/wear/wear-watchface/src/main/java/androidx/wear/watchface/ComplicationSlotsManager.kt
index f91f60a..accb143 100644
--- a/wear/wear-watchface/src/main/java/androidx/wear/watchface/ComplicationSlotsManager.kt
+++ b/wear/wear-watchface/src/main/java/androidx/wear/watchface/ComplicationSlotsManager.kt
@@ -21,7 +21,6 @@
import android.content.ComponentName
import android.content.Context
import android.content.Intent
-import android.icu.util.Calendar
import androidx.annotation.Px
import androidx.annotation.RestrictTo
import androidx.annotation.UiThread
@@ -30,7 +29,7 @@
import androidx.wear.complications.ComplicationSlotBounds
import androidx.wear.complications.data.ComplicationData
import androidx.wear.complications.data.ComplicationType
-import androidx.wear.complications.data.EmptyComplicationData
+import androidx.wear.complications.data.NoDataComplicationData
import androidx.wear.utility.TraceEvent
import androidx.wear.watchface.ObservableWatchData.MutableObservableWatchData
import androidx.wear.watchface.control.data.IdTypeAndDefaultProviderPolicyWireFormat
@@ -82,7 +81,6 @@
public lateinit var watchState: WatchState
private lateinit var watchFaceHostApi: WatchFaceHostApi
- private lateinit var calendar: Calendar
internal lateinit var renderer: Renderer
/** A map of complication IDs to complicationSlots. */
@@ -161,12 +159,10 @@
@WorkerThread
internal fun init(
watchFaceHostApi: WatchFaceHostApi,
- calendar: Calendar,
renderer: Renderer,
complicationSlotInvalidateListener: ComplicationSlot.InvalidateListener
) = TraceEvent("ComplicationSlotsManager.init").use {
this.watchFaceHostApi = watchFaceHostApi
- this.calendar = calendar
this.renderer = renderer
for ((_, complication) in complicationSlots) {
@@ -273,9 +269,9 @@
@UiThread
internal fun clearComplicationData() {
for ((_, complication) in complicationSlots) {
- complication.renderer.loadData(null, false)
+ complication.renderer.loadData(NoDataComplicationData(), false)
(complication.complicationData as MutableObservableWatchData).value =
- EmptyComplicationData()
+ NoDataComplicationData()
}
}
diff --git a/wear/wear-watchface/src/main/java/androidx/wear/watchface/ContentDescriptionLabel.kt b/wear/wear-watchface/src/main/java/androidx/wear/watchface/ContentDescriptionLabel.kt
index de96271..2e4736d 100644
--- a/wear/wear-watchface/src/main/java/androidx/wear/watchface/ContentDescriptionLabel.kt
+++ b/wear/wear-watchface/src/main/java/androidx/wear/watchface/ContentDescriptionLabel.kt
@@ -20,6 +20,7 @@
import android.content.res.Resources
import android.graphics.Rect
import androidx.wear.complications.data.ComplicationText
+import java.time.Instant
import java.util.Objects
/**
@@ -39,10 +40,10 @@
* Returns the text that should be displayed for the given timestamp.
*
* @param resources [Resources] from the current [android.content.Context]
- * @param dateTimeMillis milliseconds since epoch, e.g. from [System.currentTimeMillis]
+ * @param instant the [Instant] at which to sample the text
*/
- public fun getTextAt(resources: Resources, dateTimeMillis: Long): CharSequence =
- text.getTextAt(resources, dateTimeMillis)
+ public fun getTextAt(resources: Resources, instant: Instant): CharSequence =
+ text.getTextAt(resources, instant)
override fun equals(other: Any?): Boolean =
other is ContentDescriptionLabel &&
diff --git a/wear/wear-watchface/src/main/java/androidx/wear/watchface/RenderParameters.kt b/wear/wear-watchface/src/main/java/androidx/wear/watchface/RenderParameters.kt
index f2d75bcb0..31c2454 100644
--- a/wear/wear-watchface/src/main/java/androidx/wear/watchface/RenderParameters.kt
+++ b/wear/wear-watchface/src/main/java/androidx/wear/watchface/RenderParameters.kt
@@ -24,6 +24,7 @@
import androidx.wear.watchface.data.RenderParametersWireFormat
import androidx.wear.watchface.style.WatchFaceLayer
import androidx.wear.watchface.style.UserStyleSetting
+import java.time.Instant
/* Used to parameterize watch face drawing based on the current system state. */
public enum class DrawMode {
@@ -246,7 +247,7 @@
else -> null
},
wireFormat.idAndTapEventWireFormat?.associate {
- Pair(it.id, TapEvent(it.x, it.y, it.calendarTapTimeMillis))
+ Pair(it.id, TapEvent(it.x, it.y, Instant.ofEpochMilli(it.calendarTapTimeMillis)))
} ?: emptyMap()
)
@@ -258,7 +259,7 @@
it.key,
it.value.xPos,
it.value.yPos,
- it.value.tapTimeMillis
+ it.value.tapTime.toEpochMilli()
)
}
return when (val thingHighlighted = highlightLayer?.highlightedElement) {
diff --git a/wear/wear-watchface/src/main/java/androidx/wear/watchface/Renderer.kt b/wear/wear-watchface/src/main/java/androidx/wear/watchface/Renderer.kt
index 0da2f9f..c12d527 100644
--- a/wear/wear-watchface/src/main/java/androidx/wear/watchface/Renderer.kt
+++ b/wear/wear-watchface/src/main/java/androidx/wear/watchface/Renderer.kt
@@ -25,7 +25,6 @@
import android.graphics.PorterDuff
import android.graphics.PorterDuffXfermode
import android.graphics.Rect
-import android.icu.util.Calendar
import android.opengl.EGL14
import android.opengl.EGLConfig
import android.opengl.EGLContext
@@ -36,11 +35,9 @@
import android.util.Log
import android.view.SurfaceHolder
import androidx.annotation.CallSuper
-import androidx.annotation.DoNotInline
import androidx.annotation.IntDef
import androidx.annotation.IntRange
import androidx.annotation.Px
-import androidx.annotation.RequiresApi
import androidx.annotation.UiThread
import androidx.annotation.WorkerThread
import androidx.wear.utility.TraceEvent
@@ -49,6 +46,7 @@
import androidx.wear.watchface.Renderer.GlesRenderer.GlesException
import androidx.wear.watchface.style.CurrentUserStyleRepository
import java.nio.ByteBuffer
+import java.time.ZonedDateTime
/**
* Describes the type of [Canvas] a [CanvasRenderer] should request from a [SurfaceHolder].
@@ -207,25 +205,25 @@
* Renders the watch face into the [surfaceHolder] using the current [renderParameters]
* with the user style specified by the [currentUserStyleRepository].
*
- * @param calendar The Calendar to use when rendering the watch face
+ * @param zonedDateTime The [ZonedDateTime] to use when rendering the watch face
* @return A [Bitmap] containing a screenshot of the watch face
*/
@Suppress("HiddenAbstractMethod")
@UiThread
- internal abstract fun renderInternal(calendar: Calendar)
+ internal abstract fun renderInternal(zonedDateTime: ZonedDateTime)
/**
* Renders the watch face into a Bitmap with the user style specified by the
* [currentUserStyleRepository].
*
- * @param calendar The Calendar to use when rendering the watch face
+ * @param zonedDateTime The [ZonedDateTime] to use when rendering the watch face
* @param renderParameters The [RenderParameters] to use when rendering the watch face
* @return A [Bitmap] containing a screenshot of the watch face
*/
@Suppress("HiddenAbstractMethod")
@UiThread
internal abstract fun takeScreenshot(
- calendar: Calendar,
+ zonedDateTime: ZonedDateTime,
renderParameters: RenderParameters
): Bitmap
@@ -333,27 +331,19 @@
watchState,
interactiveDrawModeUpdateDelayMillis
) {
- @RequiresApi(26)
- private object Api26Impl {
- @JvmStatic
- @DoNotInline
- fun callLockHardwareCanvas(surfaceHolder: SurfaceHolder): Canvas? =
- surfaceHolder.lockHardwareCanvas()
- }
-
internal override fun renderInternal(
- calendar: Calendar
+ zonedDateTime: ZonedDateTime
) {
val canvas = (
- if (canvasType == CanvasType.HARDWARE && Build.VERSION.SDK_INT >= 26) {
- Api26Impl.callLockHardwareCanvas(surfaceHolder)
+ if (canvasType == CanvasType.HARDWARE) {
+ surfaceHolder.lockHardwareCanvas()
} else {
surfaceHolder.lockCanvas()
}
) ?: return
try {
if (Build.VERSION.SDK_INT >= 30 || watchState.isVisible.value) {
- renderAndComposite(canvas, calendar)
+ renderAndComposite(canvas, zonedDateTime)
} else {
canvas.drawColor(Color.BLACK)
}
@@ -363,7 +353,7 @@
}
internal override fun takeScreenshot(
- calendar: Calendar,
+ zonedDateTime: ZonedDateTime,
renderParameters: RenderParameters
): Bitmap = TraceEvent("CanvasRenderer.takeScreenshot").use {
val bitmap = Bitmap.createBitmap(
@@ -373,15 +363,15 @@
)
val prevRenderParameters = this.renderParameters
this.renderParameters = renderParameters
- renderAndComposite(Canvas(bitmap), calendar)
+ renderAndComposite(Canvas(bitmap), zonedDateTime)
this.renderParameters = prevRenderParameters
return bitmap
}
- private fun renderAndComposite(canvas: Canvas, calendar: Calendar) {
+ private fun renderAndComposite(canvas: Canvas, zonedDateTime: ZonedDateTime) {
// Usually renderParameters.watchFaceWatchFaceLayers will be non-empty.
if (renderParameters.watchFaceLayers.isNotEmpty()) {
- render(canvas, screenBounds, calendar)
+ render(canvas, screenBounds, zonedDateTime)
// Render and composite the HighlightLayer
if (renderParameters.highlightLayer != null) {
@@ -390,7 +380,7 @@
screenBounds.height(),
Bitmap.Config.ARGB_8888
)
- renderHighlightLayer(Canvas(highlightLayer), screenBounds, calendar)
+ renderHighlightLayer(Canvas(highlightLayer), screenBounds, zonedDateTime)
canvas.drawBitmap(highlightLayer, 0f, 0f, HIGHLIGHT_LAYER_COMPOSITE_PAINT)
highlightLayer.recycle()
}
@@ -399,7 +389,7 @@
"We don't support empty renderParameters.watchFaceWatchFaceLayers without a " +
"non-null renderParameters.highlightLayer"
}
- renderHighlightLayer(canvas, screenBounds, calendar)
+ renderHighlightLayer(canvas, screenBounds, zonedDateTime)
}
}
@@ -418,7 +408,7 @@
* Sub-classes should override this to implement their watch face rendering logic which
* should respect the current [renderParameters]. Any highlights due to
* [RenderParameters.highlightLayer] should be rendered by [renderHighlightLayer] instead
- * where possible. For correct behavior this function must use the supplied [Calendar]
+ * where possible. For correct behavior this function must use the supplied [ZonedDateTime]
* in favor of any other ways of getting the time.
*
* Before any calls to render, [init] will be called once.
@@ -426,13 +416,13 @@
* @param canvas The [Canvas] to render into. Don't assume this is always the canvas from
* the [SurfaceHolder] backing the display
* @param bounds A [Rect] describing the bonds of the canvas to draw into
- * @param calendar The current [Calendar]
+ * @param zonedDateTime The [ZonedDateTime] to render with
*/
@UiThread
public abstract fun render(
canvas: Canvas,
bounds: Rect,
- calendar: Calendar
+ zonedDateTime: ZonedDateTime
)
/**
@@ -442,18 +432,19 @@
* [RenderParameters.HighlightLayer.backgroundTint] before rendering a transparent highlight
* or a solid outline around the [RenderParameters.HighlightLayer.highlightedElement]. This
* will be composited as needed on top of the results of [render]. For correct behavior this
- * function must use the supplied [Calendar] in favor of any other ways of getting the time.
+ * function must use the supplied [ZonedDateTime] in favor of any other ways of getting the
+ * time.
*
* @param canvas The [Canvas] to render into. Don't assume this is always the canvas from
* the [SurfaceHolder] backing the display
* @param bounds A [Rect] describing the bonds of the canvas to draw into
- * @param calendar The current [Calendar]
+ * @param zonedDateTime the [ZonedDateTime] to render with
*/
@UiThread
public abstract fun renderHighlightLayer(
canvas: Canvas,
bounds: Rect,
- calendar: Calendar
+ zonedDateTime: ZonedDateTime
)
internal override fun dump(writer: IndentingPrintWriter) {
@@ -878,10 +869,10 @@
}
internal override fun renderInternal(
- calendar: Calendar
+ zonedDateTime: ZonedDateTime
) {
runUiThreadGlCommands {
- renderAndComposite(calendar)
+ renderAndComposite(zonedDateTime)
if (!EGL14.eglSwapBuffers(eglDisplay, eglSurface)) {
Log.w(TAG, "eglSwapBuffers failed")
}
@@ -889,7 +880,7 @@
}
internal override fun takeScreenshot(
- calendar: Calendar,
+ zonedDateTime: ZonedDateTime,
renderParameters: RenderParameters
): Bitmap = TraceEvent("GlesRenderer.takeScreenshot").use {
val width = screenBounds.width()
@@ -899,7 +890,7 @@
runUiThreadGlCommands {
val prevRenderParameters = this.renderParameters
this.renderParameters = renderParameters
- renderAndComposite(calendar)
+ renderAndComposite(zonedDateTime)
this.renderParameters = prevRenderParameters
GLES20.glFinish()
GLES20.glReadPixels(
@@ -919,18 +910,18 @@
return bitmap
}
- private fun renderAndComposite(calendar: Calendar) {
+ private fun renderAndComposite(zonedDateTime: ZonedDateTime) {
GLES20.glBlendFunc(GLES20.GL_ONE, GLES20.GL_ZERO)
// Usually renderParameters.watchFaceWatchFaceLayers will be non-empty.
if (renderParameters.watchFaceLayers.isNotEmpty()) {
- render(calendar)
+ render(zonedDateTime)
// Render and composite the HighlightLayer
if (renderParameters.highlightLayer != null) {
renderBufferTexture.bindFrameBuffer()
GLES20.glBlendFunc(GLES20.GL_ONE, GLES20.GL_ZERO)
- renderHighlightLayer(calendar)
+ renderHighlightLayer(zonedDateTime)
GLES20.glFlush()
GLES20.glBindFramebuffer(GLES20.GL_FRAMEBUFFER, 0)
@@ -941,7 +932,7 @@
"We don't support empty renderParameters.watchFaceWatchFaceLayers without a " +
"non-null renderParameters.highlightLayer"
}
- renderHighlightLayer(calendar)
+ renderHighlightLayer(zonedDateTime)
}
}
@@ -976,7 +967,7 @@
* Sub-classes should override this to implement their watch face rendering logic which
* should respect the current [renderParameters]. Any highlights due to
* [RenderParameters.highlightLayer] should be rendered by [renderHighlightLayer] instead
- * where possible. For correct behavior this function must use the supplied [Calendar]
+ * where possible. For correct behavior this function must use the supplied [ZonedDateTime]
* in favor of any other ways of getting the time.
*
* Note this function is called inside a lambda passed to [runUiThreadGlCommands] which
@@ -988,10 +979,10 @@
* Before any calls to this function [onBackgroundThreadGlContextCreated] and
* [onUiThreadGlSurfaceCreated] will have been called once on their respective threads.
*
- * @param calendar The current [Calendar]
+ * @param zonedDateTime The zonedDateTime [ZonedDateTime] to render with
*/
@UiThread
- public abstract fun render(calendar: Calendar)
+ public abstract fun render(zonedDateTime: ZonedDateTime)
/**
* Sub-classes should override this to implement their watch face highlight layer rendering
@@ -1000,7 +991,8 @@
* [RenderParameters.HighlightLayer.backgroundTint] before rendering a transparent highlight
* or a solid outline around the [RenderParameters.HighlightLayer.highlightedElement]. This
* will be composited as needed on top of the results of [render]. For correct behavior this
- * function must use the supplied [Calendar] in favor of any other ways of getting the time.
+ * function must use the supplied [ZonedDateTime] in favor of any other ways of getting the
+ * time.
*
* Note this function is called inside a lambda passed to [runUiThreadGlCommands] which
* has synchronized access to the GL context.
@@ -1008,10 +1000,10 @@
* Note also `GLES20.glBlendFunc(GLES20.GL_ONE, GLES20.GL_ZERO)` is called by the library
* before this method.
*
- * @param calendar The current [Calendar]
+ * @param zonedDateTime The zonedDateTime [ZonedDateTime] to render with
*/
@UiThread
- public abstract fun renderHighlightLayer(calendar: Calendar)
+ public abstract fun renderHighlightLayer(zonedDateTime: ZonedDateTime)
internal override fun dump(writer: IndentingPrintWriter) {
writer.println("GlesRenderer:")
diff --git a/wear/wear-watchface/src/main/java/androidx/wear/watchface/TapEvent.kt b/wear/wear-watchface/src/main/java/androidx/wear/watchface/TapEvent.kt
index 87e91a5..982e7a7 100644
--- a/wear/wear-watchface/src/main/java/androidx/wear/watchface/TapEvent.kt
+++ b/wear/wear-watchface/src/main/java/androidx/wear/watchface/TapEvent.kt
@@ -19,6 +19,7 @@
import androidx.annotation.IntDef
import androidx.annotation.Px
import androidx.wear.watchface.control.IInteractiveWatchFace
+import java.time.Instant
/** @hide */
@IntDef(
@@ -66,12 +67,12 @@
*
* @param xPos X coordinate of the event
* @param yPos Y coordinate of the event
- * @param tapTimeMillis The UTC time of the tap in milliseconds since the epoch
+ * @param tapTime The [Instant] at which the tap event occurred
*/
public class TapEvent(
@Px public val xPos: Int,
@Px public val yPos: Int,
- public val tapTimeMillis: Long // TODO(b/195536041): Maybe use Instant
+ public val tapTime: Instant
) {
override fun equals(other: Any?): Boolean {
if (this === other) return true
@@ -81,7 +82,7 @@
if (xPos != other.xPos) return false
if (yPos != other.yPos) return false
- if (tapTimeMillis != other.tapTimeMillis) return false
+ if (tapTime != other.tapTime) return false
return true
}
@@ -89,9 +90,9 @@
override fun hashCode(): Int {
var result = xPos
result = 31 * result + yPos
- result = 31 * result + tapTimeMillis.hashCode()
+ result = 31 * result + tapTime.hashCode()
return result
}
- override fun toString(): String = "[$xPos, $yPos @$tapTimeMillis]"
-}
\ No newline at end of file
+ override fun toString(): String = "[$xPos, $yPos @$tapTime]"
+}
diff --git a/wear/wear-watchface/src/main/java/androidx/wear/watchface/WatchFace.kt b/wear/wear-watchface/src/main/java/androidx/wear/watchface/WatchFace.kt
index c53d63b..67bde2d 100644
--- a/wear/wear-watchface/src/main/java/androidx/wear/watchface/WatchFace.kt
+++ b/wear/wear-watchface/src/main/java/androidx/wear/watchface/WatchFace.kt
@@ -25,8 +25,6 @@
import android.graphics.Bitmap
import android.graphics.Canvas
import android.graphics.Rect
-import android.icu.util.Calendar
-import android.icu.util.TimeZone
import android.os.BatteryManager
import android.os.Build
import android.os.Bundle
@@ -37,7 +35,6 @@
import android.view.Surface.FRAME_RATE_COMPATIBILITY_DEFAULT
import androidx.annotation.ColorInt
import androidx.annotation.IntDef
-import androidx.annotation.IntRange
import androidx.annotation.RequiresApi
import androidx.annotation.RestrictTo
import androidx.annotation.UiThread
@@ -60,6 +57,9 @@
import androidx.wear.watchface.style.WatchFaceLayer
import kotlinx.coroutines.CompletableDeferred
import java.security.InvalidParameterException
+import java.time.Instant
+import java.time.ZoneId
+import java.time.ZonedDateTime
import kotlin.math.max
// Human reaction time is limited to ~100ms.
@@ -225,8 +225,8 @@
/** The [WatchFace]'s screen bounds [Rect]. */
public val screenBounds: Rect
- /** The UTC reference time to use for previews in milliseconds since the epoch. */
- public val previewReferenceTimeMillis: Long
+ /** Th reference [Instant] for previews. */
+ public val previewReferenceInstant: Instant
/** The [Handler] for the background thread. */
public val backgroundThreadHandler: Handler
@@ -234,7 +234,7 @@
/** Renders the watchface to a [Bitmap] with the [CurrentUserStyleRepository]'s [UserStyle]. */
public fun renderWatchFaceToBitmap(
renderParameters: RenderParameters,
- calendarTimeMillis: Long,
+ instant: Instant,
slotIdToComplicationData: Map<Int, ComplicationData>?
): Bitmap
@@ -250,6 +250,9 @@
public interface SystemTimeProvider {
/** Returns the current system time in milliseconds. */
public fun getSystemTimeMillis(): Long
+
+ /** Returns the current system [ZoneId]. */
+ public fun getSystemTimeZoneId(): ZoneId
}
/** Listens for taps on the watchface which didn't land on [ComplicationSlot]s. */
@@ -322,10 +325,11 @@
}
}
- /** The UTC preview time in milliseconds since the epoch, or null if not set. */
- @get:SuppressWarnings("AutoBoxing")
- @IntRange(from = 0)
- public var overridePreviewReferenceTimeMillis: Long? = null
+ /**
+ * The [Instant] to use for preview rendering, or `null` if not set in which case the system
+ * chooses the Instant to use.
+ */
+ public var overridePreviewReferenceInstant: Instant? = null
private set
/** The legacy [LegacyWatchFaceOverlayStyle] which only affects Wear 2.0 devices. */
@@ -338,6 +342,8 @@
internal var systemTimeProvider: SystemTimeProvider = object : SystemTimeProvider {
override fun getSystemTimeMillis() = System.currentTimeMillis()
+
+ override fun getSystemTimeZoneId() = ZoneId.systemDefault()
}
/**
@@ -345,11 +351,8 @@
*
* @param previewReferenceTimeMillis The UTC preview time in milliseconds since the epoch
*/
- public fun setOverridePreviewReferenceTimeMillis(
- @IntRange(from = 0) previewReferenceTimeMillis: Long
- ): WatchFace = apply {
- overridePreviewReferenceTimeMillis = previewReferenceTimeMillis
- }
+ public fun setOverridePreviewReferenceInstant(previewReferenceTimeMillis: Instant): WatchFace =
+ apply { overridePreviewReferenceInstant = previewReferenceTimeMillis }
/**
* Sets the legacy [LegacyWatchFaceOverlayStyle] which only affects Wear 2.0 devices.
@@ -376,7 +379,21 @@
}
}
-internal data class MockTime(var speed: Double, var minTime: Long, var maxTime: Long)
+internal class MockTime(var speed: Double, var minTime: Long, var maxTime: Long) {
+ /** Apply mock time adjustments. */
+ fun applyMockTime(timeMillis: Long): Long {
+ // This adjustment allows time to be sped up or slowed down and to wrap between two
+ // instants. This is useful when developing animations that occur infrequently (e.g.
+ // hourly).
+ val millis = (speed * (timeMillis - minTime).toDouble()).toLong()
+ val range = maxTime - minTime
+ var delta = millis % range
+ if (delta < 0) {
+ delta += range
+ }
+ return minTime + delta
+ }
+}
/** @hide */
@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
@@ -390,10 +407,6 @@
@get:VisibleForTesting(otherwise = VisibleForTesting.PRIVATE)
public var complicationSlotsManager: ComplicationSlotsManager,
- /** @hide */
- @get:RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
- @get:VisibleForTesting(otherwise = VisibleForTesting.PRIVATE)
- public val calendar: Calendar,
private val broadcastsObserver: BroadcastsObserver,
internal var broadcastsReceiver: BroadcastsReceiver?
) {
@@ -462,7 +475,7 @@
),
)
- private val systemTimeProvider = watchface.systemTimeProvider
+ internal val systemTimeProvider = watchface.systemTimeProvider
private val legacyWatchFaceStyle = watchface.legacyWatchFaceStyle
internal val renderer = watchface.renderer
private val tapListener = watchface.tapListener
@@ -495,7 +508,6 @@
)
internal fun onActionTimeZoneChanged() {
- calendar.timeZone = TimeZone.getDefault()
renderer.invalidate()
}
@@ -521,13 +533,15 @@
mockTime.maxTime = intent.getLongExtra(EXTRA_MOCK_TIME_WRAPPING_MAX_TIME, Long.MAX_VALUE)
}
- /** The UTC reference time for editor preview images in milliseconds since the epoch. */
- public val previewReferenceTimeMillis: Long =
- watchface.overridePreviewReferenceTimeMillis ?: when (watchface.watchFaceType) {
- WatchFaceType.ANALOG -> watchState.analogPreviewReferenceTimeMillis
- WatchFaceType.DIGITAL -> watchState.digitalPreviewReferenceTimeMillis
- else -> throw InvalidParameterException("Unrecognized watchFaceType")
- }
+ /** The reference [Instant] time for editor preview images in milliseconds since the epoch. */
+ public val previewReferenceInstant: Instant =
+ watchface.overridePreviewReferenceInstant ?: Instant.ofEpochMilli(
+ when (watchface.watchFaceType) {
+ WatchFaceType.ANALOG -> watchState.analogPreviewReferenceTimeMillis
+ WatchFaceType.DIGITAL -> watchState.digitalPreviewReferenceTimeMillis
+ else -> throw InvalidParameterException("Unrecognized watchFaceType")
+ }
+ )
private var inOnSetStyle = false
internal var initComplete = false
@@ -559,8 +573,6 @@
TraceEvent("WatchFaceImpl.visibilityObserver").use {
if (isVisible) {
registerReceivers()
- // Update time zone in case it changed while we weren't visible.
- calendar.timeZone = TimeZone.getDefault()
watchFaceHostApi.invalidate()
// It's not safe to draw until initComplete because the ComplicationSlotManager init
@@ -646,15 +658,15 @@
override val screenBounds
get() = renderer.screenBounds
- override val previewReferenceTimeMillis
- get() = this@WatchFaceImpl.previewReferenceTimeMillis
+ override val previewReferenceInstant
+ get() = this@WatchFaceImpl.previewReferenceInstant
override val backgroundThreadHandler
get() = watchFaceHostApi.getBackgroundThreadHandler()
override fun renderWatchFaceToBitmap(
renderParameters: RenderParameters,
- calendarTimeMillis: Long,
+ instant: Instant,
slotIdToComplicationData: Map<Int, ComplicationData>?
): Bitmap = TraceEvent("WFEditorDelegate.takeScreenshot").use {
val oldComplicationData =
@@ -669,9 +681,7 @@
}
}
val screenShot = renderer.takeScreenshot(
- Calendar.getInstance(TimeZone.getTimeZone("UTC")).apply {
- timeInMillis = calendarTimeMillis
- },
+ ZonedDateTime.ofInstant(instant, ZoneId.of("UTC")),
renderParameters
)
if (slotIdToComplicationData != null) {
@@ -757,7 +767,6 @@
return
}
- setCalendarTime(systemTimeProvider.getSystemTimeMillis())
if (renderer.shouldAnimate()) {
pendingUpdateTime.postUnique {
watchFaceHostApi.invalidate()
@@ -765,20 +774,12 @@
}
}
- /** Sets the calendar's time in milliseconds adjusted by the mock time controls. */
+ /** Gets the [ZonedDateTime] from [systemTimeProvider] adjusted by the mock time controls. */
@UiThread
- private fun setCalendarTime(timeMillis: Long) {
- // This adjustment allows time to be sped up or slowed down and to wrap between two
- // instants. This is useful when developing animations that occur infrequently (e.g.
- // hourly).
- val millis = (mockTime.speed * (timeMillis - mockTime.minTime).toDouble()).toLong()
- val range = mockTime.maxTime - mockTime.minTime
- var delta = millis % range
- if (delta < 0) {
- delta += range
- }
- calendar.timeInMillis = mockTime.minTime + delta
- }
+ private fun getZonedDateTime() = ZonedDateTime.ofInstant(
+ Instant.ofEpochMilli(mockTime.applyMockTime(systemTimeProvider.getSystemTimeMillis())),
+ systemTimeProvider.getSystemTimeZoneId()
+ )
/** @hide */
@UiThread
@@ -804,12 +805,10 @@
/** @hide */
@UiThread
internal fun onDraw() {
- setCalendarTime(systemTimeProvider.getSystemTimeMillis())
maybeUpdateDrawMode()
- renderer.renderInternal(calendar)
+ renderer.renderInternal(getZonedDateTime())
val currentTimeMillis = systemTimeProvider.getSystemTimeMillis()
- setCalendarTime(currentTimeMillis)
if (renderer.shouldAnimate()) {
val delayMillis = computeDelayTillNextFrame(nextDrawTimeMillis, currentTimeMillis)
nextDrawTimeMillis = currentTimeMillis + delayMillis
@@ -818,9 +817,8 @@
}
internal fun onSurfaceRedrawNeeded() {
- setCalendarTime(systemTimeProvider.getSystemTimeMillis())
maybeUpdateDrawMode()
- renderer.renderInternal(calendar)
+ renderer.renderInternal(getZonedDateTime())
}
/** @hide */
@@ -867,13 +865,6 @@
watchFaceHostApi.invalidate()
}
- /** Clears all [ComplicationData]. */
- @UiThread
- internal fun clearComplicationData() {
- complicationSlotsManager.clearComplicationData()
- watchFaceHostApi.invalidate()
- }
-
/**
* Called when a tap or touch related event occurs. Detects taps on [ComplicationSlot]s and
* triggers the associated action.
@@ -927,8 +918,7 @@
it.value.defaultDataSourceType.toWireComplicationType(),
it.value.enabled,
it.value.initiallyEnabled,
- it.value.renderer.getData()?.type?.toWireComplicationType()
- ?: ComplicationType.NO_DATA.toWireComplicationType(),
+ it.value.renderer.getData().type.toWireComplicationType(),
it.value.fixedComplicationDataSource,
it.value.configExtras
)
@@ -966,9 +956,10 @@
}
val bitmap = renderer.takeScreenshot(
- Calendar.getInstance(TimeZone.getTimeZone("UTC")).apply {
- timeInMillis = params.calendarTimeMillis
- },
+ ZonedDateTime.ofInstant(
+ Instant.ofEpochMilli(params.calendarTimeMillis),
+ ZoneId.of("UTC")
+ ),
RenderParameters(params.renderParametersWireFormat)
)
@@ -991,9 +982,10 @@
internal fun renderComplicationToBitmap(
params: ComplicationRenderParams
): Bundle? = TraceEvent("WatchFaceImpl.renderComplicationToBitmap").use {
- val calendar = Calendar.getInstance(TimeZone.getTimeZone("UTC")).apply {
- timeInMillis = params.calendarTimeMillis
- }
+ val zonedDateTime = ZonedDateTime.ofInstant(
+ Instant.ofEpochMilli(params.calendarTimeMillis),
+ ZoneId.of("UTC")
+ )
return complicationSlotsManager[params.complicationSlotId]?.let {
val oldStyle = currentUserStyleRepository.userStyle
@@ -1021,13 +1013,13 @@
it.renderer.render(
Canvas(complicationBitmap),
Rect(0, 0, bounds.width(), bounds.height()),
- calendar,
+ zonedDateTime,
RenderParameters(params.renderParametersWireFormat),
params.complicationSlotId
)
// Restore previous ComplicationData & style if required.
- if (params.complicationData != null) {
+ if (prevData != null) {
it.renderer.loadData(prevData, false)
}
@@ -1043,7 +1035,6 @@
internal fun dump(writer: IndentingPrintWriter) {
writer.println("WatchFaceImpl ($componentName): ")
writer.increaseIndent()
- writer.println("calendar=$calendar")
writer.println("mockTime.maxTime=${mockTime.maxTime}")
writer.println("mockTime.minTime=${mockTime.minTime}")
writer.println("mockTime.speed=${mockTime.speed}")
diff --git a/wear/wear-watchface/src/main/java/androidx/wear/watchface/WatchFaceService.kt b/wear/wear-watchface/src/main/java/androidx/wear/watchface/WatchFaceService.kt
index a34102f..151c791 100644
--- a/wear/wear-watchface/src/main/java/androidx/wear/watchface/WatchFaceService.kt
+++ b/wear/wear-watchface/src/main/java/androidx/wear/watchface/WatchFaceService.kt
@@ -22,7 +22,6 @@
import android.content.Intent
import android.graphics.Canvas
import android.graphics.Rect
-import android.icu.util.Calendar
import android.os.Build
import android.os.Bundle
import android.os.Handler
@@ -85,6 +84,7 @@
import java.io.FileNotFoundException
import java.io.InputStreamReader
import java.io.PrintWriter
+import java.time.Instant
import java.util.concurrent.CountDownLatch
/** The wire format for [ComplicationData]. */
@@ -869,7 +869,7 @@
// It's unlikely an ambient tick would be sent to a watch face that hasn't loaded
// yet. The watch face will render at least once upon loading so we don't need to do
// anything special here.
- getWatchFaceImplOrNull()?.renderer?.invalidate()
+ invalidate()
ambientUpdateWakelock.acquire(SURFACE_DRAW_TIMEOUT_MS)
}
}
@@ -921,6 +921,11 @@
}
@UiThread
+ internal suspend fun clearComplicationData() {
+ deferredWatchFaceImpl.await().complicationSlotsManager.clearComplicationData()
+ }
+
+ @UiThread
internal fun setImmutableSystemState(deviceConfig: DeviceConfig) {
// These properties never change so set them once only.
if (!immutableSystemStateDone) {
@@ -1122,7 +1127,13 @@
val watchFaceImpl = deferredWatchFaceImpl.await()
watchFaceImpl.onTapCommand(
TapType.UP,
- TapEvent(x, y, watchFaceImpl.calendar.timeInMillis)
+ TapEvent(
+ x,
+ y,
+ Instant.ofEpochMilli(
+ watchFaceImpl.systemTimeProvider.getSystemTimeMillis()
+ )
+ )
)
}
Constants.COMMAND_TOUCH ->
@@ -1130,7 +1141,13 @@
val watchFaceImpl = deferredWatchFaceImpl.await()
watchFaceImpl.onTapCommand(
TapType.DOWN,
- TapEvent(x, y, watchFaceImpl.calendar.timeInMillis)
+ TapEvent(
+ x,
+ y,
+ Instant.ofEpochMilli(
+ watchFaceImpl.systemTimeProvider.getSystemTimeMillis()
+ )
+ )
)
}
Constants.COMMAND_TOUCH_CANCEL ->
@@ -1140,7 +1157,13 @@
val watchFaceImpl = deferredWatchFaceImpl.await()
watchFaceImpl.onTapCommand(
TapType.CANCEL,
- TapEvent(x, y, watchFaceImpl.calendar.timeInMillis)
+ TapEvent(
+ x,
+ y,
+ Instant.ofEpochMilli(
+ watchFaceImpl.systemTimeProvider.getSystemTimeMillis()
+ )
+ )
)
}
else -> {
@@ -1333,7 +1356,6 @@
}
complicationSlotsManager.watchState = watchState
- val calendar = Calendar.getInstance()
val deferredWatchFace = CompletableDeferred<WatchFace>()
val initStyleAndComplicationsDone = CompletableDeferred<Unit>()
@@ -1342,7 +1364,6 @@
// createWatchFace.
uiThreadCoroutineScope.launch {
createWatchFaceImpl(
- calendar,
complicationSlotsManager,
currentUserStyleRepository,
deferredWatchFace,
@@ -1393,8 +1414,7 @@
initStyleAndComplications(
complicationSlotsManager,
currentUserStyleRepository,
- watchFace.renderer,
- calendar
+ watchFace.renderer
)
// Now init has completed, it's OK to complete deferredWatchFaceImpl.
@@ -1418,7 +1438,6 @@
*/
@UiThread
private suspend fun createWatchFaceImpl(
- calendar: Calendar,
complicationSlotsManager: ComplicationSlotsManager,
currentUserStyleRepository: CurrentUserStyleRepository,
deferredWatchFace: CompletableDeferred<WatchFace>,
@@ -1458,7 +1477,6 @@
watchState,
currentUserStyleRepository,
complicationSlotsManager,
- calendar,
broadcastsObserver,
broadcastsReceiver
)
@@ -1500,8 +1518,7 @@
internal fun initStyleAndComplications(
complicationSlotsManager: ComplicationSlotsManager,
currentUserStyleRepository: CurrentUserStyleRepository,
- renderer: Renderer,
- calendar: Calendar
+ renderer: Renderer
) = TraceEvent("initStyleAndComplications").use {
// If the system has a stored user style then Home/SysUI is in charge of style
// persistence, otherwise we need to do our own.
@@ -1537,7 +1554,7 @@
// to render soon anyway.
var initFinished = false
complicationSlotsManager.init(
- this, calendar, renderer,
+ this, renderer,
object : ComplicationSlot.InvalidateListener {
@SuppressWarnings("SyntheticAccessor")
override fun onInvalidate() {
@@ -1711,19 +1728,17 @@
if (complication.boundsType == ComplicationSlotBoundsType.BACKGROUND) {
ComplicationSlotBoundsType.BACKGROUND
} else {
- if (complication.complicationData.hasValue()) {
- labels.add(
- Pair(
- complication.accessibilityTraversalIndex,
- ContentDescriptionLabel(
- _context,
- complication.computeBounds(screenBounds),
- complication.complicationData.value
- .asWireComplicationData()
- )
+ labels.add(
+ Pair(
+ complication.accessibilityTraversalIndex,
+ ContentDescriptionLabel(
+ _context,
+ complication.computeBounds(screenBounds),
+ complication.complicationData.value
+ .asWireComplicationData()
)
)
- }
+ )
}
}
}
diff --git a/wear/wear-watchface/src/main/java/androidx/wear/watchface/control/HeadlessWatchFaceImpl.kt b/wear/wear-watchface/src/main/java/androidx/wear/watchface/control/HeadlessWatchFaceImpl.kt
index c7ddf8e..658a469 100644
--- a/wear/wear-watchface/src/main/java/androidx/wear/watchface/control/HeadlessWatchFaceImpl.kt
+++ b/wear/wear-watchface/src/main/java/androidx/wear/watchface/control/HeadlessWatchFaceImpl.kt
@@ -100,7 +100,7 @@
override fun getPreviewReferenceTimeMillis() =
awaitDeferredWatchFaceImplThenRunOnUiThreadBlocking(
"HeadlessWatchFaceImpl.getPreviewReferenceTimeMillis"
- ) { watchFaceImpl -> watchFaceImpl.previewReferenceTimeMillis }
+ ) { watchFaceImpl -> watchFaceImpl.previewReferenceInstant.toEpochMilli() }
override fun getComplicationState() =
awaitDeferredWatchFaceImplThenRunOnUiThreadBlocking(
diff --git a/wear/wear-watchface/src/main/java/androidx/wear/watchface/control/InteractiveInstanceManager.kt b/wear/wear-watchface/src/main/java/androidx/wear/watchface/control/InteractiveInstanceManager.kt
index 1087df1..6e33c04 100644
--- a/wear/wear-watchface/src/main/java/androidx/wear/watchface/control/InteractiveInstanceManager.kt
+++ b/wear/wear-watchface/src/main/java/androidx/wear/watchface/control/InteractiveInstanceManager.kt
@@ -17,7 +17,6 @@
package androidx.wear.watchface.control
import android.annotation.SuppressLint
-import androidx.annotation.RequiresApi
import androidx.annotation.UiThread
import androidx.wear.utility.TraceEvent
import androidx.wear.watchface.IndentingPrintWriter
@@ -108,7 +107,6 @@
/** Can be called on any thread. */
@SuppressLint("SyntheticAccessor")
- @RequiresApi(27)
fun getExistingInstanceOrSetPendingWallpaperInteractiveWatchFaceInstance(
value: PendingWallpaperInteractiveWatchFaceInstance
): IInteractiveWatchFace? {
diff --git a/wear/wear-watchface/src/main/java/androidx/wear/watchface/control/InteractiveWatchFaceImpl.kt b/wear/wear-watchface/src/main/java/androidx/wear/watchface/control/InteractiveWatchFaceImpl.kt
index 03c763b..cf57c1c 100644
--- a/wear/wear-watchface/src/main/java/androidx/wear/watchface/control/InteractiveWatchFaceImpl.kt
+++ b/wear/wear-watchface/src/main/java/androidx/wear/watchface/control/InteractiveWatchFaceImpl.kt
@@ -16,6 +16,7 @@
package androidx.wear.watchface.control
+import android.os.Build
import android.util.Log
import androidx.annotation.RequiresApi
import androidx.wear.utility.TraceEvent
@@ -29,9 +30,9 @@
import androidx.wear.watchface.style.data.UserStyleWireFormat
import kotlinx.coroutines.runBlocking
import kotlinx.coroutines.withContext
+import java.time.Instant
/** An interactive watch face instance with SysUI and WCS facing interfaces.*/
-@RequiresApi(27)
internal class InteractiveWatchFaceImpl(
internal val engine: WatchFaceService.EngineWrapper,
internal var instanceId: String
@@ -66,7 +67,13 @@
) { watchFaceImpl ->
watchFaceImpl.onTapCommand(
tapType,
- TapEvent(xPos, yPos, watchFaceImpl.calendar.timeInMillis)
+ TapEvent(
+ xPos,
+ yPos,
+ Instant.ofEpochMilli(
+ watchFaceImpl.systemTimeProvider.getSystemTimeMillis()
+ )
+ )
)
}
@@ -75,6 +82,7 @@
"InteractiveWatchFaceImpl.getContentDescriptionLabels"
) { engine.contentDescriptionLabels }
+ @RequiresApi(Build.VERSION_CODES.O_MR1)
override fun renderWatchFaceToBitmap(params: WatchFaceRenderParams) =
awaitDeferredWatchFaceImplThenRunOnUiThreadBlocking(
"InteractiveWatchFaceImpl.renderWatchFaceToBitmap"
@@ -83,7 +91,7 @@
override fun getPreviewReferenceTimeMillis() =
awaitDeferredWatchFaceImplThenRunOnUiThreadBlocking(
"InteractiveWatchFaceImpl.getPreviewReferenceTimeMillis"
- ) { watchFaceImpl -> watchFaceImpl.previewReferenceTimeMillis }
+ ) { watchFaceImpl -> watchFaceImpl.previewReferenceInstant.toEpochMilli() }
override fun setWatchUiState(watchUiState: WatchUiState) =
awaitDeferredWatchFaceImplThenRunOnUiThreadBlocking(
@@ -130,6 +138,8 @@
"InteractiveWatchFaceImpl.updateWatchfaceInstance"
) {
if (instanceId != newInstanceId) {
+ // If the favorite ID has changed then the complications are probably invalid.
+ engine.clearComplicationData()
InteractiveInstanceManager.renameInstance(instanceId, newInstanceId)
instanceId = newInstanceId
}
diff --git a/wear/wear-watchface/src/test/java/androidx/wear/watchface/AsyncWatchFaceInitTest.kt b/wear/wear-watchface/src/test/java/androidx/wear/watchface/AsyncWatchFaceInitTest.kt
index e4dee61..e7add7c 100644
--- a/wear/wear-watchface/src/test/java/androidx/wear/watchface/AsyncWatchFaceInitTest.kt
+++ b/wear/wear-watchface/src/test/java/androidx/wear/watchface/AsyncWatchFaceInitTest.kt
@@ -18,9 +18,11 @@
import android.content.Context
import android.graphics.Rect
+import android.os.Build
import android.os.Handler
import android.os.Looper
import android.view.SurfaceHolder
+import androidx.annotation.RequiresApi
import androidx.test.core.app.ApplicationProvider
import androidx.wear.watchface.control.IInteractiveWatchFace
import androidx.wear.watchface.control.IPendingInteractiveWatchFace
@@ -186,6 +188,7 @@
}.`when`(handler).removeCallbacks(ArgumentMatchers.any())
}
+ @RequiresApi(Build.VERSION_CODES.O_MR1)
@Test
public fun createInteractiveInstanceFailsIfDirectBootWatchFaceCreationIsInProgress() {
val completableWatchFace = CompletableDeferred<WatchFace>()
@@ -228,6 +231,7 @@
assertThat(pendingException.message).startsWith("WatchFace already exists!")
}
+ @RequiresApi(Build.VERSION_CODES.O_MR1)
@Test
public fun directBootAndGetExistingInstanceOrSetPendingWallpaperInteractiveWatchFaceInstance() {
val completableDirectBootWatchFace = CompletableDeferred<WatchFace>()
diff --git a/wear/wear-watchface/src/test/java/androidx/wear/watchface/TestCommon.kt b/wear/wear-watchface/src/test/java/androidx/wear/watchface/TestCommon.kt
index a120616..376186c 100644
--- a/wear/wear-watchface/src/test/java/androidx/wear/watchface/TestCommon.kt
+++ b/wear/wear-watchface/src/test/java/androidx/wear/watchface/TestCommon.kt
@@ -22,7 +22,6 @@
import android.content.Intent
import android.graphics.Canvas
import android.graphics.Rect
-import android.icu.util.Calendar
import android.os.Handler
import android.support.wearable.complications.ComplicationData
import android.support.wearable.complications.ComplicationText
@@ -39,6 +38,8 @@
import org.junit.runners.model.FrameworkMethod
import org.robolectric.RobolectricTestRunner
import org.robolectric.internal.bytecode.InstrumentationConfiguration
+import java.time.ZoneId
+import java.time.ZonedDateTime
internal class TestWatchFaceService(
@WatchFaceType private val watchFaceType: Int,
@@ -60,6 +61,7 @@
get() = mutableTappedComplicationIds
var complicationSelected: Int? = null
var mockSystemTimeMillis = 0L
+ var mockZoneId: ZoneId = ZoneId.of("UTC")
var lastUserStyle: UserStyle? = null
var renderer: TestRenderer? = null
@@ -69,7 +71,7 @@
fun reset() {
clearTappedState()
complicationSelected = null
- renderer?.lastOnDrawCalendar = null
+ renderer?.lastOnDrawZonedDateTime = null
mockSystemTimeMillis = 0L
}
@@ -115,9 +117,9 @@
renderer = rendererFactory(surfaceHolder, currentUserStyleRepository, watchState)
return WatchFace(watchFaceType, renderer!!)
.setSystemTimeProvider(object : WatchFace.SystemTimeProvider {
- override fun getSystemTimeMillis(): Long {
- return mockSystemTimeMillis
- }
+ override fun getSystemTimeMillis() = mockSystemTimeMillis
+
+ override fun getSystemTimeZoneId() = mockZoneId
}).setTapListener(tapListener)
}
@@ -220,19 +222,19 @@
CanvasType.HARDWARE,
interactiveFrameRateMs
) {
- public var lastOnDrawCalendar: Calendar? = null
+ public var lastOnDrawZonedDateTime: ZonedDateTime? = null
public var lastRenderParameters: RenderParameters = RenderParameters.DEFAULT_INTERACTIVE
override fun render(
canvas: Canvas,
bounds: Rect,
- calendar: Calendar
+ zonedDateTime: ZonedDateTime
) {
- lastOnDrawCalendar = calendar
+ lastOnDrawZonedDateTime = zonedDateTime
lastRenderParameters = renderParameters
}
- override fun renderHighlightLayer(canvas: Canvas, bounds: Rect, calendar: Calendar) {
+ override fun renderHighlightLayer(canvas: Canvas, bounds: Rect, zonedDateTime: ZonedDateTime) {
}
}
diff --git a/wear/wear-watchface/src/test/java/androidx/wear/watchface/WatchFaceServiceTest.kt b/wear/wear-watchface/src/test/java/androidx/wear/watchface/WatchFaceServiceTest.kt
index 4fc4e68..db2a279 100644
--- a/wear/wear-watchface/src/test/java/androidx/wear/watchface/WatchFaceServiceTest.kt
+++ b/wear/wear-watchface/src/test/java/androidx/wear/watchface/WatchFaceServiceTest.kt
@@ -16,16 +16,19 @@
package androidx.wear.watchface
+import android.annotation.SuppressLint
import android.app.NotificationManager
import android.content.ComponentName
import android.content.Context
import android.content.Intent
import android.graphics.Bitmap
+import android.graphics.Canvas
import android.graphics.Insets
import android.graphics.Rect
import android.graphics.RectF
import android.graphics.drawable.Icon
import android.os.BatteryManager
+import android.os.Build
import android.os.Bundle
import android.os.Handler
import android.os.Looper
@@ -39,12 +42,14 @@
import android.view.SurfaceHolder
import android.view.WindowInsets
import androidx.annotation.Px
+import androidx.annotation.RequiresApi
import androidx.test.core.app.ApplicationProvider
import androidx.test.filters.SdkSuppress
import androidx.wear.complications.ComplicationSlotBounds
import androidx.wear.complications.DefaultComplicationDataSourcePolicy
import androidx.wear.complications.SystemDataSources
import androidx.wear.complications.data.ComplicationType
+import androidx.wear.complications.data.NoDataComplicationData
import androidx.wear.complications.data.PlainComplicationText
import androidx.wear.complications.data.ShortTextComplicationData
import androidx.wear.watchface.complications.rendering.CanvasComplicationDrawable
@@ -76,6 +81,7 @@
import org.junit.Assert.assertNull
import org.junit.Assert.assertTrue
import org.junit.Assert.fail
+import org.junit.Assume
import org.junit.Before
import org.junit.Test
import org.junit.runner.RunWith
@@ -90,6 +96,7 @@
import org.mockito.Mockito.validateMockitoUsage
import org.mockito.Mockito.verify
import org.robolectric.annotation.Config
+import java.time.Instant
import java.util.ArrayDeque
import java.util.PriorityQueue
@@ -105,6 +112,7 @@
private const val RIGHT_AND_LEFT_COMPLICATIONS = "RIGHT_AND_LEFT_COMPLICATIONS"
@Config(manifest = Config.NONE)
+@RequiresApi(Build.VERSION_CODES.O)
@RunWith(WatchFaceTestRunner::class)
public class WatchFaceServiceTest {
@@ -116,6 +124,7 @@
init {
`when`(surfaceHolder.surfaceFrame).thenReturn(ONE_HUNDRED_BY_ONE_HUNDRED_RECT)
+ `when`(surfaceHolder.lockHardwareCanvas()).thenReturn(Canvas())
}
private companion object {
@@ -346,7 +355,8 @@
apiVersion: Int = 2,
hasLowBitAmbient: Boolean = false,
hasBurnInProtection: Boolean = false,
- tapListener: WatchFace.TapListener? = null
+ tapListener: WatchFace.TapListener? = null,
+ setInitialComplicationData: Boolean = true
) {
testWatchFaceService = TestWatchFaceService(
watchFaceType,
@@ -371,23 +381,25 @@
engineWrapper.onCreate(surfaceHolder)
// Set some initial complication data.
- for (complication in complicationSlots) {
- setComplicationViaWallpaperCommand(
- complication.id,
- when (complication.defaultDataSourceType) {
- ComplicationType.SHORT_TEXT ->
- ComplicationData.Builder(ComplicationData.TYPE_SHORT_TEXT)
- .setShortText(ComplicationText.plainText("Initial Short"))
- .build()
+ if (setInitialComplicationData) {
+ for (complication in complicationSlots) {
+ setComplicationViaWallpaperCommand(
+ complication.id,
+ when (complication.defaultDataSourceType) {
+ ComplicationType.SHORT_TEXT ->
+ ComplicationData.Builder(ComplicationData.TYPE_SHORT_TEXT)
+ .setShortText(ComplicationText.plainText("Initial Short"))
+ .build()
- ComplicationType.PHOTO_IMAGE ->
- ComplicationData.Builder(ComplicationData.TYPE_LARGE_IMAGE)
- .setLargeImage(Icon.createWithContentUri("someuri"))
- .build()
+ ComplicationType.PHOTO_IMAGE ->
+ ComplicationData.Builder(ComplicationData.TYPE_LARGE_IMAGE)
+ .setLargeImage(Icon.createWithContentUri("someuri"))
+ .build()
- else -> throw UnsupportedOperationException()
- }
- )
+ else -> throw UnsupportedOperationException()
+ }
+ )
+ }
}
// Trigger watch face creation by setting the binder and the immutable properties.
@@ -519,6 +531,8 @@
@Before
public fun setUp() {
+ Assume.assumeTrue("This test suite assumes API 26", Build.VERSION.SDK_INT >= 26)
+
`when`(handler.getLooper()).thenReturn(Looper.myLooper())
// Capture tasks posted to mHandler and insert in mPendingTasks which is under our control.
@@ -618,7 +632,7 @@
}
@Test
- public fun onDraw_calendar_setFromSystemTime() {
+ public fun onDraw_zonedDateTime_setFromSystemTime() {
initEngine(
WatchFaceType.ANALOG,
listOf(leftComplication, rightComplication),
@@ -628,11 +642,11 @@
watchState.isAmbient.value = false
testWatchFaceService.mockSystemTimeMillis = 1000L
watchFaceImpl.onDraw()
- assertThat(watchFaceImpl.calendar.timeInMillis).isEqualTo(1000L)
+ assertThat(renderer.lastOnDrawZonedDateTime!!.toInstant().toEpochMilli()).isEqualTo(1000L)
}
@Test
- public fun onDraw_calendar_affectedCorrectly_with2xMockTime() {
+ public fun onDraw_zonedDateTime_affectedCorrectly_with2xMockTime() {
initEngine(
WatchFaceType.ANALOG,
listOf(leftComplication, rightComplication),
@@ -651,16 +665,16 @@
// Time should not diverge initially.
watchFaceImpl.onDraw()
- assertThat(watchFaceImpl.calendar.timeInMillis).isEqualTo(1000L)
+ assertThat(renderer.lastOnDrawZonedDateTime!!.toInstant().toEpochMilli()).isEqualTo(1000L)
// However 1000ms of real time should result in 2000ms observed by onDraw.
testWatchFaceService.mockSystemTimeMillis = 2000L
watchFaceImpl.onDraw()
- assertThat(watchFaceImpl.calendar.timeInMillis).isEqualTo(3000L)
+ assertThat(renderer.lastOnDrawZonedDateTime!!.toInstant().toEpochMilli()).isEqualTo(3000L)
}
@Test
- public fun onDraw_calendar_affectedCorrectly_withMockTimeWrapping() {
+ public fun onDraw_zonedDateTime_affectedCorrectly_withMockTimeWrapping() {
initEngine(
WatchFaceType.ANALOG,
listOf(leftComplication, rightComplication),
@@ -680,42 +694,54 @@
// Time in millis observed by onDraw should wrap betwween 1000 and 2000.
watchFaceImpl.onDraw()
- assertThat(watchFaceImpl.calendar.timeInMillis).isEqualTo(1000L)
+ assertThat(renderer.lastOnDrawZonedDateTime!!.toInstant().toEpochMilli()).isEqualTo(1000L)
testWatchFaceService.mockSystemTimeMillis = 1250L
watchFaceImpl.onDraw()
- assertThat(watchFaceImpl.calendar.timeInMillis).isEqualTo(1500L)
+ assertThat(renderer.lastOnDrawZonedDateTime!!.toInstant().toEpochMilli()).isEqualTo(1500L)
testWatchFaceService.mockSystemTimeMillis = 1499L
watchFaceImpl.onDraw()
- assertThat(watchFaceImpl.calendar.timeInMillis).isEqualTo(1998L)
+ assertThat(renderer.lastOnDrawZonedDateTime!!.toInstant().toEpochMilli()).isEqualTo(1998L)
testWatchFaceService.mockSystemTimeMillis = 1500L
watchFaceImpl.onDraw()
- assertThat(watchFaceImpl.calendar.timeInMillis).isEqualTo(1000L)
+ assertThat(renderer.lastOnDrawZonedDateTime!!.toInstant().toEpochMilli()).isEqualTo(1000L)
testWatchFaceService.mockSystemTimeMillis = 1750L
watchFaceImpl.onDraw()
- assertThat(watchFaceImpl.calendar.timeInMillis).isEqualTo(1500L)
+ assertThat(renderer.lastOnDrawZonedDateTime!!.toInstant().toEpochMilli()).isEqualTo(1500L)
testWatchFaceService.mockSystemTimeMillis = 1999L
watchFaceImpl.onDraw()
- assertThat(watchFaceImpl.calendar.timeInMillis).isEqualTo(1998L)
+ assertThat(renderer.lastOnDrawZonedDateTime!!.toInstant().toEpochMilli()).isEqualTo(1998L)
testWatchFaceService.mockSystemTimeMillis = 2000L
watchFaceImpl.onDraw()
- assertThat(watchFaceImpl.calendar.timeInMillis).isEqualTo(1000L)
+ assertThat(renderer.lastOnDrawZonedDateTime!!.toInstant().toEpochMilli()).isEqualTo(1000L)
}
private fun tapAt(x: Int, y: Int) {
// The eventTime is ignored.
- watchFaceImpl.onTapCommand(TapType.DOWN, TapEvent(x, y, looperTimeMillis))
- watchFaceImpl.onTapCommand(TapType.UP, TapEvent(x, y, looperTimeMillis))
+ watchFaceImpl.onTapCommand(
+ TapType.DOWN,
+ TapEvent(x, y, Instant.ofEpochMilli(looperTimeMillis))
+ )
+ watchFaceImpl.onTapCommand(
+ TapType.UP,
+ TapEvent(x, y, Instant.ofEpochMilli(looperTimeMillis))
+ )
}
private fun tapCancelAt(x: Int, y: Int) {
- watchFaceImpl.onTapCommand(TapType.DOWN, TapEvent(x, y, looperTimeMillis))
- watchFaceImpl.onTapCommand(TapType.CANCEL, TapEvent(x, y, looperTimeMillis))
+ watchFaceImpl.onTapCommand(
+ TapType.DOWN,
+ TapEvent(x, y, Instant.ofEpochMilli(looperTimeMillis))
+ )
+ watchFaceImpl.onTapCommand(
+ TapType.CANCEL,
+ TapEvent(x, y, Instant.ofEpochMilli(looperTimeMillis))
+ )
}
@Test
@@ -734,7 +760,7 @@
// Tap left complication.
tapAt(30, 50)
assertThat(complicationSlotsManager.lastComplicationTapDownEvents[LEFT_COMPLICATION_ID])
- .isEqualTo(TapEvent(30, 50, 0))
+ .isEqualTo(TapEvent(30, 50, Instant.EPOCH))
assertThat(complicationSlotsManager.lastComplicationTapDownEvents[RIGHT_COMPLICATION_ID])
.isNull()
assertThat(testWatchFaceService.tappedComplicationSlotIds)
@@ -746,9 +772,9 @@
testWatchFaceService.reset()
tapAt(70, 50)
assertThat(complicationSlotsManager.lastComplicationTapDownEvents[LEFT_COMPLICATION_ID])
- .isEqualTo(TapEvent(30, 50, 0))
+ .isEqualTo(TapEvent(30, 50, Instant.EPOCH))
assertThat(complicationSlotsManager.lastComplicationTapDownEvents[RIGHT_COMPLICATION_ID])
- .isEqualTo(TapEvent(70, 50, 100))
+ .isEqualTo(TapEvent(70, 50, Instant.ofEpochMilli(100)))
assertThat(testWatchFaceService.tappedComplicationSlotIds)
.isEqualTo(listOf(RIGHT_COMPLICATION_ID))
@@ -759,9 +785,9 @@
tapAt(1, 1)
// No change in lastComplicationTapDownEvents
assertThat(complicationSlotsManager.lastComplicationTapDownEvents[LEFT_COMPLICATION_ID])
- .isEqualTo(TapEvent(30, 50, 0))
+ .isEqualTo(TapEvent(30, 50, Instant.EPOCH))
assertThat(complicationSlotsManager.lastComplicationTapDownEvents[RIGHT_COMPLICATION_ID])
- .isEqualTo(TapEvent(70, 50, 100))
+ .isEqualTo(TapEvent(70, 50, Instant.ofEpochMilli(100)))
assertThat(testWatchFaceService.tappedComplicationSlotIds).isEmpty()
}
@@ -784,9 +810,9 @@
// Taps are registered on both complicationSlots.
assertThat(complicationSlotsManager.lastComplicationTapDownEvents[LEFT_COMPLICATION_ID])
- .isEqualTo(TapEvent(30, 50, 0))
+ .isEqualTo(TapEvent(30, 50, Instant.EPOCH))
assertThat(complicationSlotsManager.lastComplicationTapDownEvents[RIGHT_COMPLICATION_ID])
- .isEqualTo(TapEvent(70, 50, 0))
+ .isEqualTo(TapEvent(70, 50, Instant.EPOCH))
assertThat(testWatchFaceService.tappedComplicationSlotIds)
.isEqualTo(listOf(LEFT_COMPLICATION_ID, RIGHT_COMPLICATION_ID))
}
@@ -829,7 +855,7 @@
// Tap the edge complication.
tapAt(0, 50)
assertThat(complicationSlotsManager.lastComplicationTapDownEvents[EDGE_COMPLICATION_ID])
- .isEqualTo(TapEvent(0, 50, 0))
+ .isEqualTo(TapEvent(0, 50, Instant.EPOCH))
assertThat(testWatchFaceService.tappedComplicationSlotIds)
.isEqualTo(listOf(EDGE_COMPLICATION_ID))
}
@@ -846,8 +872,14 @@
// Tap on nothing.
tapAt(1, 1)
- verify(tapListener).onTapEvent(TapType.DOWN, TapEvent(1, 1, looperTimeMillis))
- verify(tapListener).onTapEvent(TapType.UP, TapEvent(1, 1, looperTimeMillis))
+ verify(tapListener).onTapEvent(
+ TapType.DOWN,
+ TapEvent(1, 1, Instant.ofEpochMilli(looperTimeMillis))
+ )
+ verify(tapListener).onTapEvent(
+ TapType.UP,
+ TapEvent(1, 1, Instant.ofEpochMilli(looperTimeMillis))
+ )
}
@Test
@@ -888,8 +920,14 @@
false
)
- verify(tapListener).onTapEvent(TapType.DOWN, TapEvent(10, 20, looperTimeMillis))
- verify(tapListener).onTapEvent(TapType.UP, TapEvent(10, 20, looperTimeMillis))
+ verify(tapListener).onTapEvent(
+ TapType.DOWN,
+ TapEvent(10, 20, Instant.ofEpochMilli(looperTimeMillis))
+ )
+ verify(tapListener).onTapEvent(
+ TapType.UP,
+ TapEvent(10, 20, Instant.ofEpochMilli(looperTimeMillis))
+ )
}
@Test
@@ -904,8 +942,14 @@
// Tap right complication.
tapAt(70, 50)
- verify(tapListener, times(0)).onTapEvent(TapType.DOWN, TapEvent(70, 50, looperTimeMillis))
- verify(tapListener, times(0)).onTapEvent(TapType.UP, TapEvent(70, 50, looperTimeMillis))
+ verify(tapListener, times(0)).onTapEvent(
+ TapType.DOWN,
+ TapEvent(70, 50, Instant.ofEpochMilli(looperTimeMillis))
+ )
+ verify(tapListener, times(0)).onTapEvent(
+ TapType.UP,
+ TapEvent(70, 50, Instant.ofEpochMilli(looperTimeMillis))
+ )
}
@Test
@@ -1676,7 +1720,7 @@
instanceParams
)
- assertThat(watchFaceImpl.previewReferenceTimeMillis).isEqualTo(1000)
+ assertThat(watchFaceImpl.previewReferenceInstant.toEpochMilli()).isEqualTo(1000)
}
@Test
@@ -1706,7 +1750,7 @@
instanceParams
)
- assertThat(watchFaceImpl.previewReferenceTimeMillis).isEqualTo(2000)
+ assertThat(watchFaceImpl.previewReferenceInstant.toEpochMilli()).isEqualTo(2000)
}
@Test
@@ -2096,6 +2140,23 @@
}
@Test
+ public fun complicationsInitialized_with_NoComplicationComplicationData() {
+ initEngine(
+ WatchFaceType.DIGITAL,
+ listOf(leftComplication, rightComplication),
+ UserStyleSchema(listOf(complicationsStyleSetting)),
+ setInitialComplicationData = false
+ )
+
+ assertThat(
+ watchFaceImpl.complicationSlotsManager[LEFT_COMPLICATION_ID]!!.complicationData.value
+ ).isInstanceOf(NoDataComplicationData::class.java)
+ assertThat(
+ watchFaceImpl.complicationSlotsManager[RIGHT_COMPLICATION_ID]!!.complicationData.value
+ ).isInstanceOf(NoDataComplicationData::class.java)
+ }
+
+ @Test
public fun complication_isActiveAt() {
initWallpaperInteractiveWatchFaceInstance(
WatchFaceType.ANALOG,
@@ -2127,7 +2188,7 @@
)
// Initially the complication should be active.
- assertThat(leftComplication.isActiveAt(0)).isTrue()
+ assertThat(leftComplication.isActiveAt(Instant.EPOCH)).isTrue()
// Send empty data.
interactiveWatchFaceInstance.updateComplicationData(
@@ -2139,7 +2200,7 @@
)
)
- assertThat(leftComplication.isActiveAt(0)).isFalse()
+ assertThat(leftComplication.isActiveAt(Instant.EPOCH)).isFalse()
// Send a complication that is active for a time range.
interactiveWatchFaceInstance.updateComplicationData(
@@ -2155,10 +2216,10 @@
)
)
- assertThat(leftComplication.isActiveAt(999999)).isFalse()
- assertThat(leftComplication.isActiveAt(1000000)).isTrue()
- assertThat(leftComplication.isActiveAt(2000000)).isTrue()
- assertThat(leftComplication.isActiveAt(2000001)).isFalse()
+ assertThat(leftComplication.isActiveAt(Instant.ofEpochMilli(999999))).isFalse()
+ assertThat(leftComplication.isActiveAt(Instant.ofEpochMilli(1000000))).isTrue()
+ assertThat(leftComplication.isActiveAt(Instant.ofEpochMilli(2000000))).isTrue()
+ assertThat(leftComplication.isActiveAt(Instant.ofEpochMilli(2000001))).isFalse()
}
@Test
@@ -2364,7 +2425,7 @@
assertThat(
complication.text.getTextAt(
ApplicationProvider.getApplicationContext<Context>().resources,
- 0
+ Instant.EPOCH
)
).isEqualTo("Override")
}
@@ -2411,7 +2472,7 @@
assertThat(
complication.text.getTextAt(
ApplicationProvider.getApplicationContext<Context>().resources,
- 0
+ Instant.EPOCH
)
).isEqualTo("INITIAL_VALUE")
}
@@ -2937,12 +2998,14 @@
assertThat(unparceled.isInitiallyEnabled).isTrue()
}
+ @SuppressLint("NewApi")
@Suppress("DEPRECATION")
private fun getChinWindowInsetsApi25(@Px chinHeight: Int): WindowInsets =
WindowInsets.Builder().setSystemWindowInsets(
Insets.of(0, 0, 0, chinHeight)
).build()
+ @SuppressLint("NewApi")
private fun getChinWindowInsetsApi30(@Px chinHeight: Int): WindowInsets =
WindowInsets.Builder().setInsets(
WindowInsets.Type.systemBars(),
diff --git a/wear/wear/api/1.2.0-beta02.txt b/wear/wear/api/1.2.0-beta02.txt
new file mode 100644
index 0000000..65a6853
--- /dev/null
+++ b/wear/wear/api/1.2.0-beta02.txt
@@ -0,0 +1,463 @@
+// Signature format: 4.0
+package androidx.wear.activity {
+
+ public class ConfirmationActivity extends android.app.Activity {
+ ctor public ConfirmationActivity();
+ method protected void onAnimationFinished();
+ method public void onCreate(android.os.Bundle!);
+ field public static final String EXTRA_ANIMATION_DURATION_MILLIS = "androidx.wear.activity.extra.ANIMATION_DURATION_MILLIS";
+ field public static final String EXTRA_ANIMATION_TYPE = "androidx.wear.activity.extra.ANIMATION_TYPE";
+ field public static final String EXTRA_MESSAGE = "androidx.wear.activity.extra.MESSAGE";
+ field public static final int FAILURE_ANIMATION = 3; // 0x3
+ field public static final int OPEN_ON_PHONE_ANIMATION = 2; // 0x2
+ field public static final int SUCCESS_ANIMATION = 1; // 0x1
+ }
+
+}
+
+package androidx.wear.ambient {
+
+ @Deprecated public final class AmbientMode extends android.app.Fragment {
+ ctor @Deprecated public AmbientMode();
+ method @Deprecated public static <T extends android.app.Activity> androidx.wear.ambient.AmbientMode.AmbientController! attachAmbientSupport(T!);
+ method @Deprecated public void dump(String!, java.io.FileDescriptor!, java.io.PrintWriter!, String![]!);
+ method @Deprecated @CallSuper public void onAttach(android.content.Context!);
+ method @Deprecated @CallSuper public void onCreate(android.os.Bundle!);
+ method @Deprecated @CallSuper public void onDestroy();
+ method @Deprecated @CallSuper public void onDetach();
+ method @Deprecated @CallSuper public void onPause();
+ method @Deprecated @CallSuper public void onResume();
+ method @Deprecated @CallSuper public void onStop();
+ field @Deprecated public static final String EXTRA_BURN_IN_PROTECTION = "com.google.android.wearable.compat.extra.BURN_IN_PROTECTION";
+ field @Deprecated public static final String EXTRA_LOWBIT_AMBIENT = "com.google.android.wearable.compat.extra.LOWBIT_AMBIENT";
+ field @Deprecated public static final String FRAGMENT_TAG = "android.support.wearable.ambient.AmbientMode";
+ }
+
+ @Deprecated public abstract static class AmbientMode.AmbientCallback {
+ ctor @Deprecated public AmbientMode.AmbientCallback();
+ method @Deprecated public void onAmbientOffloadInvalidated();
+ method @Deprecated public void onEnterAmbient(android.os.Bundle!);
+ method @Deprecated public void onExitAmbient();
+ method @Deprecated public void onUpdateAmbient();
+ }
+
+ @Deprecated public static interface AmbientMode.AmbientCallbackProvider {
+ method @Deprecated public androidx.wear.ambient.AmbientMode.AmbientCallback! getAmbientCallback();
+ }
+
+ @Deprecated public final class AmbientMode.AmbientController {
+ method @Deprecated public boolean isAmbient();
+ method @Deprecated public void setAmbientOffloadEnabled(boolean);
+ }
+
+ public final class AmbientModeSupport extends androidx.fragment.app.Fragment {
+ ctor public AmbientModeSupport();
+ method public static <T extends androidx.fragment.app.FragmentActivity> androidx.wear.ambient.AmbientModeSupport.AmbientController! attach(T!);
+ field public static final String EXTRA_BURN_IN_PROTECTION = "com.google.android.wearable.compat.extra.BURN_IN_PROTECTION";
+ field public static final String EXTRA_LOWBIT_AMBIENT = "com.google.android.wearable.compat.extra.LOWBIT_AMBIENT";
+ field public static final String FRAGMENT_TAG = "android.support.wearable.ambient.AmbientMode";
+ }
+
+ public abstract static class AmbientModeSupport.AmbientCallback {
+ ctor public AmbientModeSupport.AmbientCallback();
+ method public void onAmbientOffloadInvalidated();
+ method public void onEnterAmbient(android.os.Bundle!);
+ method public void onExitAmbient();
+ method public void onUpdateAmbient();
+ }
+
+ public static interface AmbientModeSupport.AmbientCallbackProvider {
+ method public androidx.wear.ambient.AmbientModeSupport.AmbientCallback! getAmbientCallback();
+ }
+
+ public final class AmbientModeSupport.AmbientController {
+ method public boolean isAmbient();
+ method public void setAmbientOffloadEnabled(boolean);
+ method public void setAutoResumeEnabled(boolean);
+ }
+
+}
+
+package androidx.wear.provider {
+
+ public class WearableCalendarContract {
+ method public static void addCalendarAuthorityUri(android.content.UriMatcher, String, int);
+ method public static void addCalendarDataAuthority(android.content.IntentFilter, String?);
+ field public static final android.net.Uri CONTENT_URI;
+ }
+
+ public static final class WearableCalendarContract.Attendees {
+ field public static final android.net.Uri CONTENT_URI;
+ }
+
+ public static final class WearableCalendarContract.Instances {
+ field public static final android.net.Uri CONTENT_URI;
+ }
+
+ public static final class WearableCalendarContract.Reminders {
+ field public static final android.net.Uri CONTENT_URI;
+ }
+
+}
+
+package androidx.wear.utils {
+
+ public class MetadataConstants {
+ method public static int getPreviewDrawableResourceId(android.content.Context!, boolean);
+ method public static boolean isNotificationBridgingEnabled(android.content.Context!);
+ method public static boolean isStandalone(android.content.Context!);
+ field public static final String NOTIFICATION_BRIDGE_MODE_BRIDGING = "BRIDGING";
+ field public static final String NOTIFICATION_BRIDGE_MODE_METADATA_NAME = "com.google.android.wearable.notificationBridgeMode";
+ field public static final String NOTIFICATION_BRIDGE_MODE_NO_BRIDGING = "NO_BRIDGING";
+ field public static final String STANDALONE_METADATA_NAME = "com.google.android.wearable.standalone";
+ field public static final String WATCH_FACE_PREVIEW_CIRCULAR_METADATA_NAME = "com.google.android.wearable.watchface.preview_circular";
+ field public static final String WATCH_FACE_PREVIEW_METADATA_NAME = "com.google.android.wearable.watchface.preview";
+ }
+
+ public final class WearTypeHelper {
+ method public static boolean isChinaBuild(android.content.Context);
+ }
+
+}
+
+package androidx.wear.widget {
+
+ @UiThread public class ArcLayout extends android.view.ViewGroup {
+ ctor public ArcLayout(android.content.Context);
+ ctor public ArcLayout(android.content.Context, android.util.AttributeSet?);
+ ctor public ArcLayout(android.content.Context, android.util.AttributeSet?, int);
+ ctor public ArcLayout(android.content.Context, android.util.AttributeSet?, int, int);
+ method @FloatRange(from=0.0f, to=360.0f, toInclusive=true) public float getAnchorAngleDegrees();
+ method public int getAnchorType();
+ method public boolean isClockwise();
+ method public void setAnchorAngleDegrees(@FloatRange(from=0.0f, to=360.0f, toInclusive=true) float);
+ method public void setAnchorType(int);
+ method public void setClockwise(boolean);
+ field public static final int ANCHOR_CENTER = 1; // 0x1
+ field public static final int ANCHOR_END = 2; // 0x2
+ field public static final int ANCHOR_START = 0; // 0x0
+ }
+
+ public static class ArcLayout.LayoutParams extends android.view.ViewGroup.MarginLayoutParams {
+ ctor public ArcLayout.LayoutParams(android.content.Context, android.util.AttributeSet?);
+ ctor public ArcLayout.LayoutParams(int, int);
+ ctor public ArcLayout.LayoutParams(android.view.ViewGroup.LayoutParams);
+ method public int getVerticalAlignment();
+ method public boolean isRotated();
+ method public void setRotated(boolean);
+ method public void setVerticalAlignment(int);
+ field public static final int VERTICAL_ALIGN_CENTER = 1; // 0x1
+ field public static final int VERTICAL_ALIGN_INNER = 2; // 0x2
+ field public static final int VERTICAL_ALIGN_OUTER = 0; // 0x0
+ }
+
+ public static interface ArcLayout.Widget {
+ method public void checkInvalidAttributeAsChild();
+ method @FloatRange(from=0.0f, to=360.0f, toInclusive=true) public float getSweepAngleDegrees();
+ method @Px public int getThickness();
+ method public boolean isPointInsideClickArea(float, float);
+ }
+
+ @UiThread public class BoxInsetLayout extends android.view.ViewGroup {
+ ctor public BoxInsetLayout(android.content.Context);
+ ctor public BoxInsetLayout(android.content.Context, android.util.AttributeSet?);
+ ctor public BoxInsetLayout(android.content.Context, android.util.AttributeSet?, @StyleRes int);
+ method public androidx.wear.widget.BoxInsetLayout.LayoutParams! generateLayoutParams(android.util.AttributeSet!);
+ }
+
+ public static class BoxInsetLayout.LayoutParams extends android.widget.FrameLayout.LayoutParams {
+ ctor public BoxInsetLayout.LayoutParams(android.content.Context, android.util.AttributeSet?);
+ ctor public BoxInsetLayout.LayoutParams(int, int);
+ ctor public BoxInsetLayout.LayoutParams(int, int, int);
+ ctor public BoxInsetLayout.LayoutParams(int, int, int, int);
+ ctor public BoxInsetLayout.LayoutParams(android.view.ViewGroup.LayoutParams);
+ ctor public BoxInsetLayout.LayoutParams(android.view.ViewGroup.MarginLayoutParams);
+ ctor public BoxInsetLayout.LayoutParams(android.widget.FrameLayout.LayoutParams);
+ ctor public BoxInsetLayout.LayoutParams(androidx.wear.widget.BoxInsetLayout.LayoutParams);
+ field public static final int BOX_ALL = 15; // 0xf
+ field public static final int BOX_BOTTOM = 8; // 0x8
+ field public static final int BOX_LEFT = 1; // 0x1
+ field public static final int BOX_NONE = 0; // 0x0
+ field public static final int BOX_RIGHT = 4; // 0x4
+ field public static final int BOX_TOP = 2; // 0x2
+ field public int boxedEdges;
+ }
+
+ public class CircularProgressLayout extends android.widget.FrameLayout {
+ ctor public CircularProgressLayout(android.content.Context!);
+ ctor public CircularProgressLayout(android.content.Context!, android.util.AttributeSet!);
+ ctor public CircularProgressLayout(android.content.Context!, android.util.AttributeSet!, int);
+ ctor public CircularProgressLayout(android.content.Context!, android.util.AttributeSet!, int, int);
+ method @ColorInt public int getBackgroundColor();
+ method public int[]! getColorSchemeColors();
+ method public androidx.wear.widget.CircularProgressLayout.OnTimerFinishedListener? getOnTimerFinishedListener();
+ method public androidx.swiperefreshlayout.widget.CircularProgressDrawable getProgressDrawable();
+ method public float getStartingRotation();
+ method public float getStrokeWidth();
+ method public long getTotalTime();
+ method public boolean isIndeterminate();
+ method public boolean isTimerRunning();
+ method public void setColorSchemeColors(int...);
+ method public void setIndeterminate(boolean);
+ method public void setOnTimerFinishedListener(androidx.wear.widget.CircularProgressLayout.OnTimerFinishedListener?);
+ method public void setStartingRotation(float);
+ method public void setStrokeWidth(float);
+ method public void setTotalTime(long);
+ method public void startTimer();
+ method public void stopTimer();
+ }
+
+ public static interface CircularProgressLayout.OnTimerFinishedListener {
+ method public void onTimerFinished(androidx.wear.widget.CircularProgressLayout!);
+ }
+
+ public class ConfirmationOverlay {
+ ctor public ConfirmationOverlay();
+ method public androidx.wear.widget.ConfirmationOverlay setDuration(int);
+ method @Deprecated public androidx.wear.widget.ConfirmationOverlay setFinishedAnimationListener(androidx.wear.widget.ConfirmationOverlay.OnAnimationFinishedListener?);
+ method @Deprecated public androidx.wear.widget.ConfirmationOverlay setMessage(String);
+ method public androidx.wear.widget.ConfirmationOverlay setMessage(CharSequence);
+ method public androidx.wear.widget.ConfirmationOverlay setOnAnimationFinishedListener(androidx.wear.widget.ConfirmationOverlay.OnAnimationFinishedListener?);
+ method public androidx.wear.widget.ConfirmationOverlay setType(@androidx.wear.widget.ConfirmationOverlay.OverlayType int);
+ method @MainThread public void showAbove(android.view.View);
+ method @MainThread public void showOn(android.app.Activity);
+ field public static final int DEFAULT_ANIMATION_DURATION_MS = 1000; // 0x3e8
+ field public static final int FAILURE_ANIMATION = 1; // 0x1
+ field public static final int OPEN_ON_PHONE_ANIMATION = 2; // 0x2
+ field public static final int SUCCESS_ANIMATION = 0; // 0x0
+ }
+
+ public static interface ConfirmationOverlay.OnAnimationFinishedListener {
+ method public void onAnimationFinished();
+ }
+
+ @IntDef({androidx.wear.widget.ConfirmationOverlay.SUCCESS_ANIMATION, androidx.wear.widget.ConfirmationOverlay.FAILURE_ANIMATION, androidx.wear.widget.ConfirmationOverlay.OPEN_ON_PHONE_ANIMATION}) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface ConfirmationOverlay.OverlayType {
+ }
+
+ public class CurvedTextView extends android.view.View implements androidx.wear.widget.ArcLayout.Widget {
+ ctor public CurvedTextView(android.content.Context);
+ ctor public CurvedTextView(android.content.Context, android.util.AttributeSet?);
+ ctor public CurvedTextView(android.content.Context, android.util.AttributeSet?, int);
+ ctor public CurvedTextView(android.content.Context, android.util.AttributeSet?, int, int);
+ method public void checkInvalidAttributeAsChild();
+ method @FloatRange(from=0.0f, to=360.0f, toInclusive=true) public float getAnchorAngleDegrees();
+ method public int getAnchorType();
+ method public android.text.TextUtils.TruncateAt? getEllipsize();
+ method public String? getFontFeatureSettings();
+ method public String? getFontVariationSettings();
+ method public float getLetterSpacing();
+ method @FloatRange(from=0.0f, to=360.0f, toInclusive=true) public float getMaxSweepDegrees();
+ method @FloatRange(from=0.0f, to=360.0f, toInclusive=true) public float getMinSweepDegrees();
+ method @FloatRange(from=0.0f, to=360.0f, toInclusive=true) public float getSweepAngleDegrees();
+ method public String? getText();
+ method @ColorInt public int getTextColor();
+ method public float getTextSize();
+ method @Px public int getThickness();
+ method public android.graphics.Typeface? getTypeface();
+ method public boolean isClockwise();
+ method public boolean isPointInsideClickArea(float, float);
+ method public void setAnchorAngleDegrees(@FloatRange(from=0.0f, to=360.0f, toInclusive=true) float);
+ method public void setAnchorType(int);
+ method public void setClockwise(boolean);
+ method public void setEllipsize(android.text.TextUtils.TruncateAt?);
+ method public void setFontFeatureSettings(String?);
+ method public void setFontVariationSettings(String?);
+ method public void setLetterSpacing(float);
+ method public void setSweepRangeDegrees(@FloatRange(from=0.0f, to=360.0f, toInclusive=true) float, @FloatRange(from=0.0f, to=360.0f, toInclusive=true) float);
+ method public void setText(String?);
+ method public void setTextColor(@ColorInt int);
+ method public void setTextSize(float);
+ method public void setTypeface(android.graphics.Typeface?, int);
+ method public void setTypeface(android.graphics.Typeface?);
+ }
+
+ public class CurvingLayoutCallback extends androidx.wear.widget.WearableLinearLayoutManager.LayoutCallback {
+ ctor public CurvingLayoutCallback(android.content.Context!);
+ method public void adjustAnchorOffsetXY(android.view.View!, float[]!);
+ method public void onLayoutFinished(android.view.View!, androidx.recyclerview.widget.RecyclerView!);
+ }
+
+ @UiThread public class DismissibleFrameLayout extends android.widget.FrameLayout {
+ ctor public DismissibleFrameLayout(android.content.Context);
+ ctor public DismissibleFrameLayout(android.content.Context, android.util.AttributeSet?);
+ ctor public DismissibleFrameLayout(android.content.Context, android.util.AttributeSet?, int);
+ ctor public DismissibleFrameLayout(android.content.Context, android.util.AttributeSet?, int, int);
+ method public boolean isDismissableByBackButton();
+ method public boolean isDismissableBySwipe();
+ method protected void performDismissCanceledCallbacks();
+ method protected void performDismissFinishedCallbacks();
+ method protected void performDismissStartedCallbacks();
+ method @UiThread public final void registerCallback(androidx.wear.widget.DismissibleFrameLayout.Callback);
+ method public final void setBackButtonDismissible(boolean);
+ method public final void setSwipeDismissible(boolean);
+ method @UiThread public final void unregisterCallback(androidx.wear.widget.DismissibleFrameLayout.Callback);
+ }
+
+ @UiThread public abstract static class DismissibleFrameLayout.Callback {
+ ctor public DismissibleFrameLayout.Callback();
+ method public void onDismissCanceled(androidx.wear.widget.DismissibleFrameLayout);
+ method public void onDismissFinished(androidx.wear.widget.DismissibleFrameLayout);
+ method public void onDismissStarted(androidx.wear.widget.DismissibleFrameLayout);
+ }
+
+ public class RoundedDrawable extends android.graphics.drawable.Drawable {
+ ctor public RoundedDrawable();
+ method public void draw(android.graphics.Canvas);
+ method @ColorInt public int getBackgroundColor();
+ method public android.graphics.drawable.Drawable? getDrawable();
+ method public int getOpacity();
+ method public int getRadius();
+ method public boolean isClipEnabled();
+ method public void setAlpha(int);
+ method public void setBackgroundColor(@ColorInt int);
+ method public void setClipEnabled(boolean);
+ method public void setColorFilter(android.graphics.ColorFilter!);
+ method public void setDrawable(android.graphics.drawable.Drawable?);
+ method public void setRadius(int);
+ }
+
+ @UiThread public class SwipeDismissFrameLayout extends androidx.wear.widget.DismissibleFrameLayout {
+ ctor public SwipeDismissFrameLayout(android.content.Context!);
+ ctor public SwipeDismissFrameLayout(android.content.Context!, android.util.AttributeSet!);
+ ctor public SwipeDismissFrameLayout(android.content.Context!, android.util.AttributeSet!, int);
+ ctor public SwipeDismissFrameLayout(android.content.Context!, android.util.AttributeSet!, int, int);
+ method public void addCallback(androidx.wear.widget.SwipeDismissFrameLayout.Callback!);
+ method public float getDismissMinDragWidthRatio();
+ method public boolean isSwipeable();
+ method public void removeCallback(androidx.wear.widget.SwipeDismissFrameLayout.Callback!);
+ method public void setDismissMinDragWidthRatio(float);
+ method public void setSwipeable(boolean);
+ field public static final float DEFAULT_DISMISS_DRAG_WIDTH_RATIO = 0.33f;
+ }
+
+ @UiThread public abstract static class SwipeDismissFrameLayout.Callback {
+ ctor public SwipeDismissFrameLayout.Callback();
+ method public void onDismissed(androidx.wear.widget.SwipeDismissFrameLayout!);
+ method public void onSwipeCanceled(androidx.wear.widget.SwipeDismissFrameLayout!);
+ method public void onSwipeStarted(androidx.wear.widget.SwipeDismissFrameLayout!);
+ }
+
+ public class WearableLinearLayoutManager extends androidx.recyclerview.widget.LinearLayoutManager {
+ ctor public WearableLinearLayoutManager(android.content.Context!, androidx.wear.widget.WearableLinearLayoutManager.LayoutCallback!);
+ ctor public WearableLinearLayoutManager(android.content.Context!);
+ method public androidx.wear.widget.WearableLinearLayoutManager.LayoutCallback? getLayoutCallback();
+ method public void setLayoutCallback(androidx.wear.widget.WearableLinearLayoutManager.LayoutCallback?);
+ }
+
+ public abstract static class WearableLinearLayoutManager.LayoutCallback {
+ ctor public WearableLinearLayoutManager.LayoutCallback();
+ method public abstract void onLayoutFinished(android.view.View!, androidx.recyclerview.widget.RecyclerView!);
+ }
+
+ public class WearableRecyclerView extends androidx.recyclerview.widget.RecyclerView {
+ ctor public WearableRecyclerView(android.content.Context!);
+ ctor public WearableRecyclerView(android.content.Context!, android.util.AttributeSet?);
+ ctor public WearableRecyclerView(android.content.Context!, android.util.AttributeSet?, int);
+ ctor public WearableRecyclerView(android.content.Context!, android.util.AttributeSet?, int, int);
+ method public float getBezelFraction();
+ method public float getScrollDegreesPerScreen();
+ method public boolean isCircularScrollingGestureEnabled();
+ method public boolean isEdgeItemsCenteringEnabled();
+ method public void setBezelFraction(float);
+ method public void setCircularScrollingGestureEnabled(boolean);
+ method public void setEdgeItemsCenteringEnabled(boolean);
+ method public void setScrollDegreesPerScreen(float);
+ }
+
+}
+
+package androidx.wear.widget.drawer {
+
+ public class WearableActionDrawerView extends androidx.wear.widget.drawer.WearableDrawerView {
+ ctor public WearableActionDrawerView(android.content.Context!);
+ ctor public WearableActionDrawerView(android.content.Context!, android.util.AttributeSet!);
+ ctor public WearableActionDrawerView(android.content.Context!, android.util.AttributeSet!, int);
+ ctor public WearableActionDrawerView(android.content.Context!, android.util.AttributeSet!, int, int);
+ method public android.view.Menu! getMenu();
+ method public void setOnMenuItemClickListener(android.view.MenuItem.OnMenuItemClickListener!);
+ method public void setTitle(CharSequence?);
+ }
+
+ public class WearableDrawerController {
+ method public void closeDrawer();
+ method public void openDrawer();
+ method public void peekDrawer();
+ }
+
+ public class WearableDrawerLayout extends android.widget.FrameLayout implements androidx.core.view.NestedScrollingParent android.view.View.OnLayoutChangeListener {
+ ctor public WearableDrawerLayout(android.content.Context!);
+ ctor public WearableDrawerLayout(android.content.Context!, android.util.AttributeSet!);
+ ctor public WearableDrawerLayout(android.content.Context!, android.util.AttributeSet!, int);
+ ctor public WearableDrawerLayout(android.content.Context!, android.util.AttributeSet!, int, int);
+ method public void onFlingComplete(android.view.View!);
+ method public void onLayoutChange(android.view.View!, int, int, int, int, int, int, int, int);
+ method public void setDrawerStateCallback(androidx.wear.widget.drawer.WearableDrawerLayout.DrawerStateCallback!);
+ }
+
+ public static class WearableDrawerLayout.DrawerStateCallback {
+ ctor public WearableDrawerLayout.DrawerStateCallback();
+ method public void onDrawerClosed(androidx.wear.widget.drawer.WearableDrawerLayout!, androidx.wear.widget.drawer.WearableDrawerView!);
+ method public void onDrawerOpened(androidx.wear.widget.drawer.WearableDrawerLayout!, androidx.wear.widget.drawer.WearableDrawerView!);
+ method public void onDrawerStateChanged(androidx.wear.widget.drawer.WearableDrawerLayout!, int);
+ }
+
+ public class WearableDrawerView extends android.widget.FrameLayout {
+ ctor public WearableDrawerView(android.content.Context!);
+ ctor public WearableDrawerView(android.content.Context!, android.util.AttributeSet!);
+ ctor public WearableDrawerView(android.content.Context!, android.util.AttributeSet!, int);
+ ctor public WearableDrawerView(android.content.Context!, android.util.AttributeSet!, int, int);
+ method public androidx.wear.widget.drawer.WearableDrawerController! getController();
+ method public android.view.View? getDrawerContent();
+ method public int getDrawerState();
+ method public boolean isAutoPeekEnabled();
+ method public boolean isClosed();
+ method public boolean isLocked();
+ method public boolean isLockedWhenClosed();
+ method public boolean isOpenOnlyAtTopEnabled();
+ method public boolean isOpened();
+ method public boolean isPeekOnScrollDownEnabled();
+ method public boolean isPeeking();
+ method public void onDrawerClosed();
+ method public void onDrawerOpened();
+ method public void onDrawerStateChanged(int);
+ method public void onPeekContainerClicked(android.view.View!);
+ method public void setDrawerContent(android.view.View?);
+ method public void setIsAutoPeekEnabled(boolean);
+ method public void setIsLocked(boolean);
+ method public void setLockedWhenClosed(boolean);
+ method public void setOpenOnlyAtTopEnabled(boolean);
+ method public void setPeekContent(android.view.View!);
+ method public void setPeekOnScrollDownEnabled(boolean);
+ field public static final int STATE_DRAGGING = 1; // 0x1
+ field public static final int STATE_IDLE = 0; // 0x0
+ field public static final int STATE_SETTLING = 2; // 0x2
+ }
+
+ public class WearableNavigationDrawerView extends androidx.wear.widget.drawer.WearableDrawerView {
+ ctor public WearableNavigationDrawerView(android.content.Context!);
+ ctor public WearableNavigationDrawerView(android.content.Context!, android.util.AttributeSet!);
+ ctor public WearableNavigationDrawerView(android.content.Context!, android.util.AttributeSet!, int);
+ ctor public WearableNavigationDrawerView(android.content.Context!, android.util.AttributeSet!, int, int);
+ method public void addOnItemSelectedListener(androidx.wear.widget.drawer.WearableNavigationDrawerView.OnItemSelectedListener!);
+ method public int getNavigationStyle();
+ method public void removeOnItemSelectedListener(androidx.wear.widget.drawer.WearableNavigationDrawerView.OnItemSelectedListener!);
+ method public void setAdapter(androidx.wear.widget.drawer.WearableNavigationDrawerView.WearableNavigationDrawerAdapter!);
+ method public void setCurrentItem(int, boolean);
+ field public static final int MULTI_PAGE = 1; // 0x1
+ field public static final int SINGLE_PAGE = 0; // 0x0
+ }
+
+ public static interface WearableNavigationDrawerView.OnItemSelectedListener {
+ method public void onItemSelected(int);
+ }
+
+ public abstract static class WearableNavigationDrawerView.WearableNavigationDrawerAdapter {
+ ctor public WearableNavigationDrawerView.WearableNavigationDrawerAdapter();
+ method public abstract int getCount();
+ method public abstract android.graphics.drawable.Drawable! getItemDrawable(int);
+ method public abstract CharSequence! getItemText(int);
+ method public void notifyDataSetChanged();
+ }
+
+}
+
diff --git a/wear/wear/api/public_plus_experimental_1.2.0-beta02.txt b/wear/wear/api/public_plus_experimental_1.2.0-beta02.txt
new file mode 100644
index 0000000..65a6853
--- /dev/null
+++ b/wear/wear/api/public_plus_experimental_1.2.0-beta02.txt
@@ -0,0 +1,463 @@
+// Signature format: 4.0
+package androidx.wear.activity {
+
+ public class ConfirmationActivity extends android.app.Activity {
+ ctor public ConfirmationActivity();
+ method protected void onAnimationFinished();
+ method public void onCreate(android.os.Bundle!);
+ field public static final String EXTRA_ANIMATION_DURATION_MILLIS = "androidx.wear.activity.extra.ANIMATION_DURATION_MILLIS";
+ field public static final String EXTRA_ANIMATION_TYPE = "androidx.wear.activity.extra.ANIMATION_TYPE";
+ field public static final String EXTRA_MESSAGE = "androidx.wear.activity.extra.MESSAGE";
+ field public static final int FAILURE_ANIMATION = 3; // 0x3
+ field public static final int OPEN_ON_PHONE_ANIMATION = 2; // 0x2
+ field public static final int SUCCESS_ANIMATION = 1; // 0x1
+ }
+
+}
+
+package androidx.wear.ambient {
+
+ @Deprecated public final class AmbientMode extends android.app.Fragment {
+ ctor @Deprecated public AmbientMode();
+ method @Deprecated public static <T extends android.app.Activity> androidx.wear.ambient.AmbientMode.AmbientController! attachAmbientSupport(T!);
+ method @Deprecated public void dump(String!, java.io.FileDescriptor!, java.io.PrintWriter!, String![]!);
+ method @Deprecated @CallSuper public void onAttach(android.content.Context!);
+ method @Deprecated @CallSuper public void onCreate(android.os.Bundle!);
+ method @Deprecated @CallSuper public void onDestroy();
+ method @Deprecated @CallSuper public void onDetach();
+ method @Deprecated @CallSuper public void onPause();
+ method @Deprecated @CallSuper public void onResume();
+ method @Deprecated @CallSuper public void onStop();
+ field @Deprecated public static final String EXTRA_BURN_IN_PROTECTION = "com.google.android.wearable.compat.extra.BURN_IN_PROTECTION";
+ field @Deprecated public static final String EXTRA_LOWBIT_AMBIENT = "com.google.android.wearable.compat.extra.LOWBIT_AMBIENT";
+ field @Deprecated public static final String FRAGMENT_TAG = "android.support.wearable.ambient.AmbientMode";
+ }
+
+ @Deprecated public abstract static class AmbientMode.AmbientCallback {
+ ctor @Deprecated public AmbientMode.AmbientCallback();
+ method @Deprecated public void onAmbientOffloadInvalidated();
+ method @Deprecated public void onEnterAmbient(android.os.Bundle!);
+ method @Deprecated public void onExitAmbient();
+ method @Deprecated public void onUpdateAmbient();
+ }
+
+ @Deprecated public static interface AmbientMode.AmbientCallbackProvider {
+ method @Deprecated public androidx.wear.ambient.AmbientMode.AmbientCallback! getAmbientCallback();
+ }
+
+ @Deprecated public final class AmbientMode.AmbientController {
+ method @Deprecated public boolean isAmbient();
+ method @Deprecated public void setAmbientOffloadEnabled(boolean);
+ }
+
+ public final class AmbientModeSupport extends androidx.fragment.app.Fragment {
+ ctor public AmbientModeSupport();
+ method public static <T extends androidx.fragment.app.FragmentActivity> androidx.wear.ambient.AmbientModeSupport.AmbientController! attach(T!);
+ field public static final String EXTRA_BURN_IN_PROTECTION = "com.google.android.wearable.compat.extra.BURN_IN_PROTECTION";
+ field public static final String EXTRA_LOWBIT_AMBIENT = "com.google.android.wearable.compat.extra.LOWBIT_AMBIENT";
+ field public static final String FRAGMENT_TAG = "android.support.wearable.ambient.AmbientMode";
+ }
+
+ public abstract static class AmbientModeSupport.AmbientCallback {
+ ctor public AmbientModeSupport.AmbientCallback();
+ method public void onAmbientOffloadInvalidated();
+ method public void onEnterAmbient(android.os.Bundle!);
+ method public void onExitAmbient();
+ method public void onUpdateAmbient();
+ }
+
+ public static interface AmbientModeSupport.AmbientCallbackProvider {
+ method public androidx.wear.ambient.AmbientModeSupport.AmbientCallback! getAmbientCallback();
+ }
+
+ public final class AmbientModeSupport.AmbientController {
+ method public boolean isAmbient();
+ method public void setAmbientOffloadEnabled(boolean);
+ method public void setAutoResumeEnabled(boolean);
+ }
+
+}
+
+package androidx.wear.provider {
+
+ public class WearableCalendarContract {
+ method public static void addCalendarAuthorityUri(android.content.UriMatcher, String, int);
+ method public static void addCalendarDataAuthority(android.content.IntentFilter, String?);
+ field public static final android.net.Uri CONTENT_URI;
+ }
+
+ public static final class WearableCalendarContract.Attendees {
+ field public static final android.net.Uri CONTENT_URI;
+ }
+
+ public static final class WearableCalendarContract.Instances {
+ field public static final android.net.Uri CONTENT_URI;
+ }
+
+ public static final class WearableCalendarContract.Reminders {
+ field public static final android.net.Uri CONTENT_URI;
+ }
+
+}
+
+package androidx.wear.utils {
+
+ public class MetadataConstants {
+ method public static int getPreviewDrawableResourceId(android.content.Context!, boolean);
+ method public static boolean isNotificationBridgingEnabled(android.content.Context!);
+ method public static boolean isStandalone(android.content.Context!);
+ field public static final String NOTIFICATION_BRIDGE_MODE_BRIDGING = "BRIDGING";
+ field public static final String NOTIFICATION_BRIDGE_MODE_METADATA_NAME = "com.google.android.wearable.notificationBridgeMode";
+ field public static final String NOTIFICATION_BRIDGE_MODE_NO_BRIDGING = "NO_BRIDGING";
+ field public static final String STANDALONE_METADATA_NAME = "com.google.android.wearable.standalone";
+ field public static final String WATCH_FACE_PREVIEW_CIRCULAR_METADATA_NAME = "com.google.android.wearable.watchface.preview_circular";
+ field public static final String WATCH_FACE_PREVIEW_METADATA_NAME = "com.google.android.wearable.watchface.preview";
+ }
+
+ public final class WearTypeHelper {
+ method public static boolean isChinaBuild(android.content.Context);
+ }
+
+}
+
+package androidx.wear.widget {
+
+ @UiThread public class ArcLayout extends android.view.ViewGroup {
+ ctor public ArcLayout(android.content.Context);
+ ctor public ArcLayout(android.content.Context, android.util.AttributeSet?);
+ ctor public ArcLayout(android.content.Context, android.util.AttributeSet?, int);
+ ctor public ArcLayout(android.content.Context, android.util.AttributeSet?, int, int);
+ method @FloatRange(from=0.0f, to=360.0f, toInclusive=true) public float getAnchorAngleDegrees();
+ method public int getAnchorType();
+ method public boolean isClockwise();
+ method public void setAnchorAngleDegrees(@FloatRange(from=0.0f, to=360.0f, toInclusive=true) float);
+ method public void setAnchorType(int);
+ method public void setClockwise(boolean);
+ field public static final int ANCHOR_CENTER = 1; // 0x1
+ field public static final int ANCHOR_END = 2; // 0x2
+ field public static final int ANCHOR_START = 0; // 0x0
+ }
+
+ public static class ArcLayout.LayoutParams extends android.view.ViewGroup.MarginLayoutParams {
+ ctor public ArcLayout.LayoutParams(android.content.Context, android.util.AttributeSet?);
+ ctor public ArcLayout.LayoutParams(int, int);
+ ctor public ArcLayout.LayoutParams(android.view.ViewGroup.LayoutParams);
+ method public int getVerticalAlignment();
+ method public boolean isRotated();
+ method public void setRotated(boolean);
+ method public void setVerticalAlignment(int);
+ field public static final int VERTICAL_ALIGN_CENTER = 1; // 0x1
+ field public static final int VERTICAL_ALIGN_INNER = 2; // 0x2
+ field public static final int VERTICAL_ALIGN_OUTER = 0; // 0x0
+ }
+
+ public static interface ArcLayout.Widget {
+ method public void checkInvalidAttributeAsChild();
+ method @FloatRange(from=0.0f, to=360.0f, toInclusive=true) public float getSweepAngleDegrees();
+ method @Px public int getThickness();
+ method public boolean isPointInsideClickArea(float, float);
+ }
+
+ @UiThread public class BoxInsetLayout extends android.view.ViewGroup {
+ ctor public BoxInsetLayout(android.content.Context);
+ ctor public BoxInsetLayout(android.content.Context, android.util.AttributeSet?);
+ ctor public BoxInsetLayout(android.content.Context, android.util.AttributeSet?, @StyleRes int);
+ method public androidx.wear.widget.BoxInsetLayout.LayoutParams! generateLayoutParams(android.util.AttributeSet!);
+ }
+
+ public static class BoxInsetLayout.LayoutParams extends android.widget.FrameLayout.LayoutParams {
+ ctor public BoxInsetLayout.LayoutParams(android.content.Context, android.util.AttributeSet?);
+ ctor public BoxInsetLayout.LayoutParams(int, int);
+ ctor public BoxInsetLayout.LayoutParams(int, int, int);
+ ctor public BoxInsetLayout.LayoutParams(int, int, int, int);
+ ctor public BoxInsetLayout.LayoutParams(android.view.ViewGroup.LayoutParams);
+ ctor public BoxInsetLayout.LayoutParams(android.view.ViewGroup.MarginLayoutParams);
+ ctor public BoxInsetLayout.LayoutParams(android.widget.FrameLayout.LayoutParams);
+ ctor public BoxInsetLayout.LayoutParams(androidx.wear.widget.BoxInsetLayout.LayoutParams);
+ field public static final int BOX_ALL = 15; // 0xf
+ field public static final int BOX_BOTTOM = 8; // 0x8
+ field public static final int BOX_LEFT = 1; // 0x1
+ field public static final int BOX_NONE = 0; // 0x0
+ field public static final int BOX_RIGHT = 4; // 0x4
+ field public static final int BOX_TOP = 2; // 0x2
+ field public int boxedEdges;
+ }
+
+ public class CircularProgressLayout extends android.widget.FrameLayout {
+ ctor public CircularProgressLayout(android.content.Context!);
+ ctor public CircularProgressLayout(android.content.Context!, android.util.AttributeSet!);
+ ctor public CircularProgressLayout(android.content.Context!, android.util.AttributeSet!, int);
+ ctor public CircularProgressLayout(android.content.Context!, android.util.AttributeSet!, int, int);
+ method @ColorInt public int getBackgroundColor();
+ method public int[]! getColorSchemeColors();
+ method public androidx.wear.widget.CircularProgressLayout.OnTimerFinishedListener? getOnTimerFinishedListener();
+ method public androidx.swiperefreshlayout.widget.CircularProgressDrawable getProgressDrawable();
+ method public float getStartingRotation();
+ method public float getStrokeWidth();
+ method public long getTotalTime();
+ method public boolean isIndeterminate();
+ method public boolean isTimerRunning();
+ method public void setColorSchemeColors(int...);
+ method public void setIndeterminate(boolean);
+ method public void setOnTimerFinishedListener(androidx.wear.widget.CircularProgressLayout.OnTimerFinishedListener?);
+ method public void setStartingRotation(float);
+ method public void setStrokeWidth(float);
+ method public void setTotalTime(long);
+ method public void startTimer();
+ method public void stopTimer();
+ }
+
+ public static interface CircularProgressLayout.OnTimerFinishedListener {
+ method public void onTimerFinished(androidx.wear.widget.CircularProgressLayout!);
+ }
+
+ public class ConfirmationOverlay {
+ ctor public ConfirmationOverlay();
+ method public androidx.wear.widget.ConfirmationOverlay setDuration(int);
+ method @Deprecated public androidx.wear.widget.ConfirmationOverlay setFinishedAnimationListener(androidx.wear.widget.ConfirmationOverlay.OnAnimationFinishedListener?);
+ method @Deprecated public androidx.wear.widget.ConfirmationOverlay setMessage(String);
+ method public androidx.wear.widget.ConfirmationOverlay setMessage(CharSequence);
+ method public androidx.wear.widget.ConfirmationOverlay setOnAnimationFinishedListener(androidx.wear.widget.ConfirmationOverlay.OnAnimationFinishedListener?);
+ method public androidx.wear.widget.ConfirmationOverlay setType(@androidx.wear.widget.ConfirmationOverlay.OverlayType int);
+ method @MainThread public void showAbove(android.view.View);
+ method @MainThread public void showOn(android.app.Activity);
+ field public static final int DEFAULT_ANIMATION_DURATION_MS = 1000; // 0x3e8
+ field public static final int FAILURE_ANIMATION = 1; // 0x1
+ field public static final int OPEN_ON_PHONE_ANIMATION = 2; // 0x2
+ field public static final int SUCCESS_ANIMATION = 0; // 0x0
+ }
+
+ public static interface ConfirmationOverlay.OnAnimationFinishedListener {
+ method public void onAnimationFinished();
+ }
+
+ @IntDef({androidx.wear.widget.ConfirmationOverlay.SUCCESS_ANIMATION, androidx.wear.widget.ConfirmationOverlay.FAILURE_ANIMATION, androidx.wear.widget.ConfirmationOverlay.OPEN_ON_PHONE_ANIMATION}) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface ConfirmationOverlay.OverlayType {
+ }
+
+ public class CurvedTextView extends android.view.View implements androidx.wear.widget.ArcLayout.Widget {
+ ctor public CurvedTextView(android.content.Context);
+ ctor public CurvedTextView(android.content.Context, android.util.AttributeSet?);
+ ctor public CurvedTextView(android.content.Context, android.util.AttributeSet?, int);
+ ctor public CurvedTextView(android.content.Context, android.util.AttributeSet?, int, int);
+ method public void checkInvalidAttributeAsChild();
+ method @FloatRange(from=0.0f, to=360.0f, toInclusive=true) public float getAnchorAngleDegrees();
+ method public int getAnchorType();
+ method public android.text.TextUtils.TruncateAt? getEllipsize();
+ method public String? getFontFeatureSettings();
+ method public String? getFontVariationSettings();
+ method public float getLetterSpacing();
+ method @FloatRange(from=0.0f, to=360.0f, toInclusive=true) public float getMaxSweepDegrees();
+ method @FloatRange(from=0.0f, to=360.0f, toInclusive=true) public float getMinSweepDegrees();
+ method @FloatRange(from=0.0f, to=360.0f, toInclusive=true) public float getSweepAngleDegrees();
+ method public String? getText();
+ method @ColorInt public int getTextColor();
+ method public float getTextSize();
+ method @Px public int getThickness();
+ method public android.graphics.Typeface? getTypeface();
+ method public boolean isClockwise();
+ method public boolean isPointInsideClickArea(float, float);
+ method public void setAnchorAngleDegrees(@FloatRange(from=0.0f, to=360.0f, toInclusive=true) float);
+ method public void setAnchorType(int);
+ method public void setClockwise(boolean);
+ method public void setEllipsize(android.text.TextUtils.TruncateAt?);
+ method public void setFontFeatureSettings(String?);
+ method public void setFontVariationSettings(String?);
+ method public void setLetterSpacing(float);
+ method public void setSweepRangeDegrees(@FloatRange(from=0.0f, to=360.0f, toInclusive=true) float, @FloatRange(from=0.0f, to=360.0f, toInclusive=true) float);
+ method public void setText(String?);
+ method public void setTextColor(@ColorInt int);
+ method public void setTextSize(float);
+ method public void setTypeface(android.graphics.Typeface?, int);
+ method public void setTypeface(android.graphics.Typeface?);
+ }
+
+ public class CurvingLayoutCallback extends androidx.wear.widget.WearableLinearLayoutManager.LayoutCallback {
+ ctor public CurvingLayoutCallback(android.content.Context!);
+ method public void adjustAnchorOffsetXY(android.view.View!, float[]!);
+ method public void onLayoutFinished(android.view.View!, androidx.recyclerview.widget.RecyclerView!);
+ }
+
+ @UiThread public class DismissibleFrameLayout extends android.widget.FrameLayout {
+ ctor public DismissibleFrameLayout(android.content.Context);
+ ctor public DismissibleFrameLayout(android.content.Context, android.util.AttributeSet?);
+ ctor public DismissibleFrameLayout(android.content.Context, android.util.AttributeSet?, int);
+ ctor public DismissibleFrameLayout(android.content.Context, android.util.AttributeSet?, int, int);
+ method public boolean isDismissableByBackButton();
+ method public boolean isDismissableBySwipe();
+ method protected void performDismissCanceledCallbacks();
+ method protected void performDismissFinishedCallbacks();
+ method protected void performDismissStartedCallbacks();
+ method @UiThread public final void registerCallback(androidx.wear.widget.DismissibleFrameLayout.Callback);
+ method public final void setBackButtonDismissible(boolean);
+ method public final void setSwipeDismissible(boolean);
+ method @UiThread public final void unregisterCallback(androidx.wear.widget.DismissibleFrameLayout.Callback);
+ }
+
+ @UiThread public abstract static class DismissibleFrameLayout.Callback {
+ ctor public DismissibleFrameLayout.Callback();
+ method public void onDismissCanceled(androidx.wear.widget.DismissibleFrameLayout);
+ method public void onDismissFinished(androidx.wear.widget.DismissibleFrameLayout);
+ method public void onDismissStarted(androidx.wear.widget.DismissibleFrameLayout);
+ }
+
+ public class RoundedDrawable extends android.graphics.drawable.Drawable {
+ ctor public RoundedDrawable();
+ method public void draw(android.graphics.Canvas);
+ method @ColorInt public int getBackgroundColor();
+ method public android.graphics.drawable.Drawable? getDrawable();
+ method public int getOpacity();
+ method public int getRadius();
+ method public boolean isClipEnabled();
+ method public void setAlpha(int);
+ method public void setBackgroundColor(@ColorInt int);
+ method public void setClipEnabled(boolean);
+ method public void setColorFilter(android.graphics.ColorFilter!);
+ method public void setDrawable(android.graphics.drawable.Drawable?);
+ method public void setRadius(int);
+ }
+
+ @UiThread public class SwipeDismissFrameLayout extends androidx.wear.widget.DismissibleFrameLayout {
+ ctor public SwipeDismissFrameLayout(android.content.Context!);
+ ctor public SwipeDismissFrameLayout(android.content.Context!, android.util.AttributeSet!);
+ ctor public SwipeDismissFrameLayout(android.content.Context!, android.util.AttributeSet!, int);
+ ctor public SwipeDismissFrameLayout(android.content.Context!, android.util.AttributeSet!, int, int);
+ method public void addCallback(androidx.wear.widget.SwipeDismissFrameLayout.Callback!);
+ method public float getDismissMinDragWidthRatio();
+ method public boolean isSwipeable();
+ method public void removeCallback(androidx.wear.widget.SwipeDismissFrameLayout.Callback!);
+ method public void setDismissMinDragWidthRatio(float);
+ method public void setSwipeable(boolean);
+ field public static final float DEFAULT_DISMISS_DRAG_WIDTH_RATIO = 0.33f;
+ }
+
+ @UiThread public abstract static class SwipeDismissFrameLayout.Callback {
+ ctor public SwipeDismissFrameLayout.Callback();
+ method public void onDismissed(androidx.wear.widget.SwipeDismissFrameLayout!);
+ method public void onSwipeCanceled(androidx.wear.widget.SwipeDismissFrameLayout!);
+ method public void onSwipeStarted(androidx.wear.widget.SwipeDismissFrameLayout!);
+ }
+
+ public class WearableLinearLayoutManager extends androidx.recyclerview.widget.LinearLayoutManager {
+ ctor public WearableLinearLayoutManager(android.content.Context!, androidx.wear.widget.WearableLinearLayoutManager.LayoutCallback!);
+ ctor public WearableLinearLayoutManager(android.content.Context!);
+ method public androidx.wear.widget.WearableLinearLayoutManager.LayoutCallback? getLayoutCallback();
+ method public void setLayoutCallback(androidx.wear.widget.WearableLinearLayoutManager.LayoutCallback?);
+ }
+
+ public abstract static class WearableLinearLayoutManager.LayoutCallback {
+ ctor public WearableLinearLayoutManager.LayoutCallback();
+ method public abstract void onLayoutFinished(android.view.View!, androidx.recyclerview.widget.RecyclerView!);
+ }
+
+ public class WearableRecyclerView extends androidx.recyclerview.widget.RecyclerView {
+ ctor public WearableRecyclerView(android.content.Context!);
+ ctor public WearableRecyclerView(android.content.Context!, android.util.AttributeSet?);
+ ctor public WearableRecyclerView(android.content.Context!, android.util.AttributeSet?, int);
+ ctor public WearableRecyclerView(android.content.Context!, android.util.AttributeSet?, int, int);
+ method public float getBezelFraction();
+ method public float getScrollDegreesPerScreen();
+ method public boolean isCircularScrollingGestureEnabled();
+ method public boolean isEdgeItemsCenteringEnabled();
+ method public void setBezelFraction(float);
+ method public void setCircularScrollingGestureEnabled(boolean);
+ method public void setEdgeItemsCenteringEnabled(boolean);
+ method public void setScrollDegreesPerScreen(float);
+ }
+
+}
+
+package androidx.wear.widget.drawer {
+
+ public class WearableActionDrawerView extends androidx.wear.widget.drawer.WearableDrawerView {
+ ctor public WearableActionDrawerView(android.content.Context!);
+ ctor public WearableActionDrawerView(android.content.Context!, android.util.AttributeSet!);
+ ctor public WearableActionDrawerView(android.content.Context!, android.util.AttributeSet!, int);
+ ctor public WearableActionDrawerView(android.content.Context!, android.util.AttributeSet!, int, int);
+ method public android.view.Menu! getMenu();
+ method public void setOnMenuItemClickListener(android.view.MenuItem.OnMenuItemClickListener!);
+ method public void setTitle(CharSequence?);
+ }
+
+ public class WearableDrawerController {
+ method public void closeDrawer();
+ method public void openDrawer();
+ method public void peekDrawer();
+ }
+
+ public class WearableDrawerLayout extends android.widget.FrameLayout implements androidx.core.view.NestedScrollingParent android.view.View.OnLayoutChangeListener {
+ ctor public WearableDrawerLayout(android.content.Context!);
+ ctor public WearableDrawerLayout(android.content.Context!, android.util.AttributeSet!);
+ ctor public WearableDrawerLayout(android.content.Context!, android.util.AttributeSet!, int);
+ ctor public WearableDrawerLayout(android.content.Context!, android.util.AttributeSet!, int, int);
+ method public void onFlingComplete(android.view.View!);
+ method public void onLayoutChange(android.view.View!, int, int, int, int, int, int, int, int);
+ method public void setDrawerStateCallback(androidx.wear.widget.drawer.WearableDrawerLayout.DrawerStateCallback!);
+ }
+
+ public static class WearableDrawerLayout.DrawerStateCallback {
+ ctor public WearableDrawerLayout.DrawerStateCallback();
+ method public void onDrawerClosed(androidx.wear.widget.drawer.WearableDrawerLayout!, androidx.wear.widget.drawer.WearableDrawerView!);
+ method public void onDrawerOpened(androidx.wear.widget.drawer.WearableDrawerLayout!, androidx.wear.widget.drawer.WearableDrawerView!);
+ method public void onDrawerStateChanged(androidx.wear.widget.drawer.WearableDrawerLayout!, int);
+ }
+
+ public class WearableDrawerView extends android.widget.FrameLayout {
+ ctor public WearableDrawerView(android.content.Context!);
+ ctor public WearableDrawerView(android.content.Context!, android.util.AttributeSet!);
+ ctor public WearableDrawerView(android.content.Context!, android.util.AttributeSet!, int);
+ ctor public WearableDrawerView(android.content.Context!, android.util.AttributeSet!, int, int);
+ method public androidx.wear.widget.drawer.WearableDrawerController! getController();
+ method public android.view.View? getDrawerContent();
+ method public int getDrawerState();
+ method public boolean isAutoPeekEnabled();
+ method public boolean isClosed();
+ method public boolean isLocked();
+ method public boolean isLockedWhenClosed();
+ method public boolean isOpenOnlyAtTopEnabled();
+ method public boolean isOpened();
+ method public boolean isPeekOnScrollDownEnabled();
+ method public boolean isPeeking();
+ method public void onDrawerClosed();
+ method public void onDrawerOpened();
+ method public void onDrawerStateChanged(int);
+ method public void onPeekContainerClicked(android.view.View!);
+ method public void setDrawerContent(android.view.View?);
+ method public void setIsAutoPeekEnabled(boolean);
+ method public void setIsLocked(boolean);
+ method public void setLockedWhenClosed(boolean);
+ method public void setOpenOnlyAtTopEnabled(boolean);
+ method public void setPeekContent(android.view.View!);
+ method public void setPeekOnScrollDownEnabled(boolean);
+ field public static final int STATE_DRAGGING = 1; // 0x1
+ field public static final int STATE_IDLE = 0; // 0x0
+ field public static final int STATE_SETTLING = 2; // 0x2
+ }
+
+ public class WearableNavigationDrawerView extends androidx.wear.widget.drawer.WearableDrawerView {
+ ctor public WearableNavigationDrawerView(android.content.Context!);
+ ctor public WearableNavigationDrawerView(android.content.Context!, android.util.AttributeSet!);
+ ctor public WearableNavigationDrawerView(android.content.Context!, android.util.AttributeSet!, int);
+ ctor public WearableNavigationDrawerView(android.content.Context!, android.util.AttributeSet!, int, int);
+ method public void addOnItemSelectedListener(androidx.wear.widget.drawer.WearableNavigationDrawerView.OnItemSelectedListener!);
+ method public int getNavigationStyle();
+ method public void removeOnItemSelectedListener(androidx.wear.widget.drawer.WearableNavigationDrawerView.OnItemSelectedListener!);
+ method public void setAdapter(androidx.wear.widget.drawer.WearableNavigationDrawerView.WearableNavigationDrawerAdapter!);
+ method public void setCurrentItem(int, boolean);
+ field public static final int MULTI_PAGE = 1; // 0x1
+ field public static final int SINGLE_PAGE = 0; // 0x0
+ }
+
+ public static interface WearableNavigationDrawerView.OnItemSelectedListener {
+ method public void onItemSelected(int);
+ }
+
+ public abstract static class WearableNavigationDrawerView.WearableNavigationDrawerAdapter {
+ ctor public WearableNavigationDrawerView.WearableNavigationDrawerAdapter();
+ method public abstract int getCount();
+ method public abstract android.graphics.drawable.Drawable! getItemDrawable(int);
+ method public abstract CharSequence! getItemText(int);
+ method public void notifyDataSetChanged();
+ }
+
+}
+
diff --git a/wear/wear/api/res-1.2.0-beta02.txt b/wear/wear/api/res-1.2.0-beta02.txt
new file mode 100644
index 0000000..44b0b55
--- /dev/null
+++ b/wear/wear/api/res-1.2.0-beta02.txt
@@ -0,0 +1 @@
+style Widget_Wear_RoundSwitch
diff --git a/wear/wear/api/restricted_1.2.0-beta02.txt b/wear/wear/api/restricted_1.2.0-beta02.txt
new file mode 100644
index 0000000..9fa9f23
--- /dev/null
+++ b/wear/wear/api/restricted_1.2.0-beta02.txt
@@ -0,0 +1,470 @@
+// Signature format: 4.0
+package androidx.wear.activity {
+
+ public class ConfirmationActivity extends android.app.Activity {
+ ctor public ConfirmationActivity();
+ method protected void onAnimationFinished();
+ method public void onCreate(android.os.Bundle!);
+ field public static final String EXTRA_ANIMATION_DURATION_MILLIS = "androidx.wear.activity.extra.ANIMATION_DURATION_MILLIS";
+ field public static final String EXTRA_ANIMATION_TYPE = "androidx.wear.activity.extra.ANIMATION_TYPE";
+ field public static final String EXTRA_MESSAGE = "androidx.wear.activity.extra.MESSAGE";
+ field public static final int FAILURE_ANIMATION = 3; // 0x3
+ field public static final int OPEN_ON_PHONE_ANIMATION = 2; // 0x2
+ field public static final int SUCCESS_ANIMATION = 1; // 0x1
+ }
+
+}
+
+package androidx.wear.ambient {
+
+ @Deprecated public final class AmbientMode extends android.app.Fragment {
+ ctor @Deprecated public AmbientMode();
+ method @Deprecated public static <T extends android.app.Activity> androidx.wear.ambient.AmbientMode.AmbientController! attachAmbientSupport(T!);
+ method @Deprecated public void dump(String!, java.io.FileDescriptor!, java.io.PrintWriter!, String![]!);
+ method @Deprecated @CallSuper public void onAttach(android.content.Context!);
+ method @Deprecated @CallSuper public void onCreate(android.os.Bundle!);
+ method @Deprecated @CallSuper public void onDestroy();
+ method @Deprecated @CallSuper public void onDetach();
+ method @Deprecated @CallSuper public void onPause();
+ method @Deprecated @CallSuper public void onResume();
+ method @Deprecated @CallSuper public void onStop();
+ field @Deprecated public static final String EXTRA_BURN_IN_PROTECTION = "com.google.android.wearable.compat.extra.BURN_IN_PROTECTION";
+ field @Deprecated public static final String EXTRA_LOWBIT_AMBIENT = "com.google.android.wearable.compat.extra.LOWBIT_AMBIENT";
+ field @Deprecated public static final String FRAGMENT_TAG = "android.support.wearable.ambient.AmbientMode";
+ }
+
+ @Deprecated public abstract static class AmbientMode.AmbientCallback {
+ ctor @Deprecated public AmbientMode.AmbientCallback();
+ method @Deprecated public void onAmbientOffloadInvalidated();
+ method @Deprecated public void onEnterAmbient(android.os.Bundle!);
+ method @Deprecated public void onExitAmbient();
+ method @Deprecated public void onUpdateAmbient();
+ }
+
+ @Deprecated public static interface AmbientMode.AmbientCallbackProvider {
+ method @Deprecated public androidx.wear.ambient.AmbientMode.AmbientCallback! getAmbientCallback();
+ }
+
+ @Deprecated public final class AmbientMode.AmbientController {
+ method @Deprecated public boolean isAmbient();
+ method @Deprecated public void setAmbientOffloadEnabled(boolean);
+ }
+
+ public final class AmbientModeSupport extends androidx.fragment.app.Fragment {
+ ctor public AmbientModeSupport();
+ method public static <T extends androidx.fragment.app.FragmentActivity> androidx.wear.ambient.AmbientModeSupport.AmbientController! attach(T!);
+ field public static final String EXTRA_BURN_IN_PROTECTION = "com.google.android.wearable.compat.extra.BURN_IN_PROTECTION";
+ field public static final String EXTRA_LOWBIT_AMBIENT = "com.google.android.wearable.compat.extra.LOWBIT_AMBIENT";
+ field public static final String FRAGMENT_TAG = "android.support.wearable.ambient.AmbientMode";
+ }
+
+ public abstract static class AmbientModeSupport.AmbientCallback {
+ ctor public AmbientModeSupport.AmbientCallback();
+ method public void onAmbientOffloadInvalidated();
+ method public void onEnterAmbient(android.os.Bundle!);
+ method public void onExitAmbient();
+ method public void onUpdateAmbient();
+ }
+
+ public static interface AmbientModeSupport.AmbientCallbackProvider {
+ method public androidx.wear.ambient.AmbientModeSupport.AmbientCallback! getAmbientCallback();
+ }
+
+ public final class AmbientModeSupport.AmbientController {
+ method public boolean isAmbient();
+ method public void setAmbientOffloadEnabled(boolean);
+ method public void setAutoResumeEnabled(boolean);
+ }
+
+}
+
+package androidx.wear.provider {
+
+ public class WearableCalendarContract {
+ method public static void addCalendarAuthorityUri(android.content.UriMatcher, String, int);
+ method public static void addCalendarDataAuthority(android.content.IntentFilter, String?);
+ field public static final android.net.Uri CONTENT_URI;
+ }
+
+ public static final class WearableCalendarContract.Attendees {
+ field public static final android.net.Uri CONTENT_URI;
+ }
+
+ public static final class WearableCalendarContract.Instances {
+ field public static final android.net.Uri CONTENT_URI;
+ }
+
+ public static final class WearableCalendarContract.Reminders {
+ field public static final android.net.Uri CONTENT_URI;
+ }
+
+}
+
+package androidx.wear.utils {
+
+ public class MetadataConstants {
+ method public static int getPreviewDrawableResourceId(android.content.Context!, boolean);
+ method public static boolean isNotificationBridgingEnabled(android.content.Context!);
+ method public static boolean isStandalone(android.content.Context!);
+ field public static final String NOTIFICATION_BRIDGE_MODE_BRIDGING = "BRIDGING";
+ field public static final String NOTIFICATION_BRIDGE_MODE_METADATA_NAME = "com.google.android.wearable.notificationBridgeMode";
+ field public static final String NOTIFICATION_BRIDGE_MODE_NO_BRIDGING = "NO_BRIDGING";
+ field public static final String STANDALONE_METADATA_NAME = "com.google.android.wearable.standalone";
+ field public static final String WATCH_FACE_PREVIEW_CIRCULAR_METADATA_NAME = "com.google.android.wearable.watchface.preview_circular";
+ field public static final String WATCH_FACE_PREVIEW_METADATA_NAME = "com.google.android.wearable.watchface.preview";
+ }
+
+ public final class WearTypeHelper {
+ method public static boolean isChinaBuild(android.content.Context);
+ }
+
+}
+
+package androidx.wear.widget {
+
+ @UiThread public class ArcLayout extends android.view.ViewGroup {
+ ctor public ArcLayout(android.content.Context);
+ ctor public ArcLayout(android.content.Context, android.util.AttributeSet?);
+ ctor public ArcLayout(android.content.Context, android.util.AttributeSet?, int);
+ ctor public ArcLayout(android.content.Context, android.util.AttributeSet?, int, int);
+ method @FloatRange(from=0.0f, to=360.0f, toInclusive=true) public float getAnchorAngleDegrees();
+ method @androidx.wear.widget.ArcLayout.AnchorType public int getAnchorType();
+ method public boolean isClockwise();
+ method public void setAnchorAngleDegrees(@FloatRange(from=0.0f, to=360.0f, toInclusive=true) float);
+ method public void setAnchorType(@androidx.wear.widget.ArcLayout.AnchorType int);
+ method public void setClockwise(boolean);
+ field public static final int ANCHOR_CENTER = 1; // 0x1
+ field public static final int ANCHOR_END = 2; // 0x2
+ field public static final int ANCHOR_START = 0; // 0x0
+ }
+
+ @IntDef({androidx.wear.widget.ArcLayout.ANCHOR_START, androidx.wear.widget.ArcLayout.ANCHOR_CENTER, androidx.wear.widget.ArcLayout.ANCHOR_END}) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface ArcLayout.AnchorType {
+ }
+
+ public static class ArcLayout.LayoutParams extends android.view.ViewGroup.MarginLayoutParams {
+ ctor public ArcLayout.LayoutParams(android.content.Context, android.util.AttributeSet?);
+ ctor public ArcLayout.LayoutParams(int, int);
+ ctor public ArcLayout.LayoutParams(android.view.ViewGroup.LayoutParams);
+ method @androidx.wear.widget.ArcLayout.LayoutParams.VerticalAlignment public int getVerticalAlignment();
+ method public boolean isRotated();
+ method public void setRotated(boolean);
+ method public void setVerticalAlignment(@androidx.wear.widget.ArcLayout.LayoutParams.VerticalAlignment int);
+ field public static final int VERTICAL_ALIGN_CENTER = 1; // 0x1
+ field public static final int VERTICAL_ALIGN_INNER = 2; // 0x2
+ field public static final int VERTICAL_ALIGN_OUTER = 0; // 0x0
+ }
+
+ @IntDef({androidx.wear.widget.ArcLayout.LayoutParams.VERTICAL_ALIGN_OUTER, androidx.wear.widget.ArcLayout.LayoutParams.VERTICAL_ALIGN_CENTER, androidx.wear.widget.ArcLayout.LayoutParams.VERTICAL_ALIGN_INNER}) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface ArcLayout.LayoutParams.VerticalAlignment {
+ }
+
+ public static interface ArcLayout.Widget {
+ method public void checkInvalidAttributeAsChild();
+ method @FloatRange(from=0.0f, to=360.0f, toInclusive=true) public float getSweepAngleDegrees();
+ method @Px public int getThickness();
+ method public boolean isPointInsideClickArea(float, float);
+ }
+
+ @UiThread public class BoxInsetLayout extends android.view.ViewGroup {
+ ctor public BoxInsetLayout(android.content.Context);
+ ctor public BoxInsetLayout(android.content.Context, android.util.AttributeSet?);
+ ctor public BoxInsetLayout(android.content.Context, android.util.AttributeSet?, @StyleRes int);
+ method public androidx.wear.widget.BoxInsetLayout.LayoutParams! generateLayoutParams(android.util.AttributeSet!);
+ }
+
+ public static class BoxInsetLayout.LayoutParams extends android.widget.FrameLayout.LayoutParams {
+ ctor public BoxInsetLayout.LayoutParams(android.content.Context, android.util.AttributeSet?);
+ ctor public BoxInsetLayout.LayoutParams(int, int);
+ ctor public BoxInsetLayout.LayoutParams(int, int, int);
+ ctor public BoxInsetLayout.LayoutParams(int, int, int, int);
+ ctor public BoxInsetLayout.LayoutParams(android.view.ViewGroup.LayoutParams);
+ ctor public BoxInsetLayout.LayoutParams(android.view.ViewGroup.MarginLayoutParams);
+ ctor public BoxInsetLayout.LayoutParams(android.widget.FrameLayout.LayoutParams);
+ ctor public BoxInsetLayout.LayoutParams(androidx.wear.widget.BoxInsetLayout.LayoutParams);
+ field public static final int BOX_ALL = 15; // 0xf
+ field public static final int BOX_BOTTOM = 8; // 0x8
+ field public static final int BOX_LEFT = 1; // 0x1
+ field public static final int BOX_NONE = 0; // 0x0
+ field public static final int BOX_RIGHT = 4; // 0x4
+ field public static final int BOX_TOP = 2; // 0x2
+ field public int boxedEdges;
+ }
+
+ public class CircularProgressLayout extends android.widget.FrameLayout {
+ ctor public CircularProgressLayout(android.content.Context!);
+ ctor public CircularProgressLayout(android.content.Context!, android.util.AttributeSet!);
+ ctor public CircularProgressLayout(android.content.Context!, android.util.AttributeSet!, int);
+ ctor public CircularProgressLayout(android.content.Context!, android.util.AttributeSet!, int, int);
+ method @ColorInt public int getBackgroundColor();
+ method public int[]! getColorSchemeColors();
+ method public androidx.wear.widget.CircularProgressLayout.OnTimerFinishedListener? getOnTimerFinishedListener();
+ method public androidx.swiperefreshlayout.widget.CircularProgressDrawable getProgressDrawable();
+ method public float getStartingRotation();
+ method public float getStrokeWidth();
+ method public long getTotalTime();
+ method public boolean isIndeterminate();
+ method public boolean isTimerRunning();
+ method public void setColorSchemeColors(int...);
+ method public void setIndeterminate(boolean);
+ method public void setOnTimerFinishedListener(androidx.wear.widget.CircularProgressLayout.OnTimerFinishedListener?);
+ method public void setStartingRotation(float);
+ method public void setStrokeWidth(float);
+ method public void setTotalTime(long);
+ method public void startTimer();
+ method public void stopTimer();
+ }
+
+ public static interface CircularProgressLayout.OnTimerFinishedListener {
+ method public void onTimerFinished(androidx.wear.widget.CircularProgressLayout!);
+ }
+
+ public class ConfirmationOverlay {
+ ctor public ConfirmationOverlay();
+ method @MainThread @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @VisibleForTesting public void hide();
+ method public androidx.wear.widget.ConfirmationOverlay setDuration(int);
+ method @Deprecated public androidx.wear.widget.ConfirmationOverlay setFinishedAnimationListener(androidx.wear.widget.ConfirmationOverlay.OnAnimationFinishedListener?);
+ method @Deprecated public androidx.wear.widget.ConfirmationOverlay setMessage(String);
+ method public androidx.wear.widget.ConfirmationOverlay setMessage(CharSequence);
+ method public androidx.wear.widget.ConfirmationOverlay setOnAnimationFinishedListener(androidx.wear.widget.ConfirmationOverlay.OnAnimationFinishedListener?);
+ method public androidx.wear.widget.ConfirmationOverlay setType(@androidx.wear.widget.ConfirmationOverlay.OverlayType int);
+ method @MainThread public void showAbove(android.view.View);
+ method @MainThread public void showOn(android.app.Activity);
+ field public static final int DEFAULT_ANIMATION_DURATION_MS = 1000; // 0x3e8
+ field public static final int FAILURE_ANIMATION = 1; // 0x1
+ field public static final int OPEN_ON_PHONE_ANIMATION = 2; // 0x2
+ field public static final int SUCCESS_ANIMATION = 0; // 0x0
+ }
+
+ public static interface ConfirmationOverlay.OnAnimationFinishedListener {
+ method public void onAnimationFinished();
+ }
+
+ @IntDef({androidx.wear.widget.ConfirmationOverlay.SUCCESS_ANIMATION, androidx.wear.widget.ConfirmationOverlay.FAILURE_ANIMATION, androidx.wear.widget.ConfirmationOverlay.OPEN_ON_PHONE_ANIMATION}) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface ConfirmationOverlay.OverlayType {
+ }
+
+ public class CurvedTextView extends android.view.View implements androidx.wear.widget.ArcLayout.Widget {
+ ctor public CurvedTextView(android.content.Context);
+ ctor public CurvedTextView(android.content.Context, android.util.AttributeSet?);
+ ctor public CurvedTextView(android.content.Context, android.util.AttributeSet?, int);
+ ctor public CurvedTextView(android.content.Context, android.util.AttributeSet?, int, int);
+ method public void checkInvalidAttributeAsChild();
+ method @FloatRange(from=0.0f, to=360.0f, toInclusive=true) public float getAnchorAngleDegrees();
+ method @androidx.wear.widget.ArcLayout.AnchorType public int getAnchorType();
+ method public android.text.TextUtils.TruncateAt? getEllipsize();
+ method public String? getFontFeatureSettings();
+ method public String? getFontVariationSettings();
+ method public float getLetterSpacing();
+ method @FloatRange(from=0.0f, to=360.0f, toInclusive=true) public float getMaxSweepDegrees();
+ method @FloatRange(from=0.0f, to=360.0f, toInclusive=true) public float getMinSweepDegrees();
+ method @FloatRange(from=0.0f, to=360.0f, toInclusive=true) public float getSweepAngleDegrees();
+ method public String? getText();
+ method @ColorInt public int getTextColor();
+ method public float getTextSize();
+ method @Px public int getThickness();
+ method public android.graphics.Typeface? getTypeface();
+ method public boolean isClockwise();
+ method public boolean isPointInsideClickArea(float, float);
+ method public void setAnchorAngleDegrees(@FloatRange(from=0.0f, to=360.0f, toInclusive=true) float);
+ method public void setAnchorType(@androidx.wear.widget.ArcLayout.AnchorType int);
+ method public void setClockwise(boolean);
+ method public void setEllipsize(android.text.TextUtils.TruncateAt?);
+ method public void setFontFeatureSettings(String?);
+ method public void setFontVariationSettings(String?);
+ method public void setLetterSpacing(float);
+ method public void setSweepRangeDegrees(@FloatRange(from=0.0f, to=360.0f, toInclusive=true) float, @FloatRange(from=0.0f, to=360.0f, toInclusive=true) float);
+ method public void setText(String?);
+ method public void setTextColor(@ColorInt int);
+ method public void setTextSize(float);
+ method public void setTypeface(android.graphics.Typeface?, int);
+ method public void setTypeface(android.graphics.Typeface?);
+ }
+
+ public class CurvingLayoutCallback extends androidx.wear.widget.WearableLinearLayoutManager.LayoutCallback {
+ ctor public CurvingLayoutCallback(android.content.Context!);
+ method public void adjustAnchorOffsetXY(android.view.View!, float[]!);
+ method public void onLayoutFinished(android.view.View!, androidx.recyclerview.widget.RecyclerView!);
+ }
+
+ @UiThread public class DismissibleFrameLayout extends android.widget.FrameLayout {
+ ctor public DismissibleFrameLayout(android.content.Context);
+ ctor public DismissibleFrameLayout(android.content.Context, android.util.AttributeSet?);
+ ctor public DismissibleFrameLayout(android.content.Context, android.util.AttributeSet?, int);
+ ctor public DismissibleFrameLayout(android.content.Context, android.util.AttributeSet?, int, int);
+ method public boolean isDismissableByBackButton();
+ method public boolean isDismissableBySwipe();
+ method protected void performDismissCanceledCallbacks();
+ method protected void performDismissFinishedCallbacks();
+ method protected void performDismissStartedCallbacks();
+ method @UiThread public final void registerCallback(androidx.wear.widget.DismissibleFrameLayout.Callback);
+ method public final void setBackButtonDismissible(boolean);
+ method public final void setSwipeDismissible(boolean);
+ method @UiThread public final void unregisterCallback(androidx.wear.widget.DismissibleFrameLayout.Callback);
+ }
+
+ @UiThread public abstract static class DismissibleFrameLayout.Callback {
+ ctor public DismissibleFrameLayout.Callback();
+ method public void onDismissCanceled(androidx.wear.widget.DismissibleFrameLayout);
+ method public void onDismissFinished(androidx.wear.widget.DismissibleFrameLayout);
+ method public void onDismissStarted(androidx.wear.widget.DismissibleFrameLayout);
+ }
+
+ public class RoundedDrawable extends android.graphics.drawable.Drawable {
+ ctor public RoundedDrawable();
+ method public void draw(android.graphics.Canvas);
+ method @ColorInt public int getBackgroundColor();
+ method public android.graphics.drawable.Drawable? getDrawable();
+ method public int getOpacity();
+ method public int getRadius();
+ method public boolean isClipEnabled();
+ method public void setAlpha(int);
+ method public void setBackgroundColor(@ColorInt int);
+ method public void setClipEnabled(boolean);
+ method public void setColorFilter(android.graphics.ColorFilter!);
+ method public void setDrawable(android.graphics.drawable.Drawable?);
+ method public void setRadius(int);
+ }
+
+ @UiThread public class SwipeDismissFrameLayout extends androidx.wear.widget.DismissibleFrameLayout {
+ ctor public SwipeDismissFrameLayout(android.content.Context!);
+ ctor public SwipeDismissFrameLayout(android.content.Context!, android.util.AttributeSet!);
+ ctor public SwipeDismissFrameLayout(android.content.Context!, android.util.AttributeSet!, int);
+ ctor public SwipeDismissFrameLayout(android.content.Context!, android.util.AttributeSet!, int, int);
+ method public void addCallback(androidx.wear.widget.SwipeDismissFrameLayout.Callback!);
+ method public float getDismissMinDragWidthRatio();
+ method public boolean isSwipeable();
+ method public void removeCallback(androidx.wear.widget.SwipeDismissFrameLayout.Callback!);
+ method public void setDismissMinDragWidthRatio(float);
+ method public void setSwipeable(boolean);
+ field public static final float DEFAULT_DISMISS_DRAG_WIDTH_RATIO = 0.33f;
+ }
+
+ @UiThread public abstract static class SwipeDismissFrameLayout.Callback {
+ ctor public SwipeDismissFrameLayout.Callback();
+ method public void onDismissed(androidx.wear.widget.SwipeDismissFrameLayout!);
+ method public void onSwipeCanceled(androidx.wear.widget.SwipeDismissFrameLayout!);
+ method public void onSwipeStarted(androidx.wear.widget.SwipeDismissFrameLayout!);
+ }
+
+ public class WearableLinearLayoutManager extends androidx.recyclerview.widget.LinearLayoutManager {
+ ctor public WearableLinearLayoutManager(android.content.Context!, androidx.wear.widget.WearableLinearLayoutManager.LayoutCallback!);
+ ctor public WearableLinearLayoutManager(android.content.Context!);
+ method public androidx.wear.widget.WearableLinearLayoutManager.LayoutCallback? getLayoutCallback();
+ method public void setLayoutCallback(androidx.wear.widget.WearableLinearLayoutManager.LayoutCallback?);
+ }
+
+ public abstract static class WearableLinearLayoutManager.LayoutCallback {
+ ctor public WearableLinearLayoutManager.LayoutCallback();
+ method public abstract void onLayoutFinished(android.view.View!, androidx.recyclerview.widget.RecyclerView!);
+ }
+
+ public class WearableRecyclerView extends androidx.recyclerview.widget.RecyclerView {
+ ctor public WearableRecyclerView(android.content.Context!);
+ ctor public WearableRecyclerView(android.content.Context!, android.util.AttributeSet?);
+ ctor public WearableRecyclerView(android.content.Context!, android.util.AttributeSet?, int);
+ ctor public WearableRecyclerView(android.content.Context!, android.util.AttributeSet?, int, int);
+ method public float getBezelFraction();
+ method public float getScrollDegreesPerScreen();
+ method public boolean isCircularScrollingGestureEnabled();
+ method public boolean isEdgeItemsCenteringEnabled();
+ method public void setBezelFraction(float);
+ method public void setCircularScrollingGestureEnabled(boolean);
+ method public void setEdgeItemsCenteringEnabled(boolean);
+ method public void setScrollDegreesPerScreen(float);
+ }
+
+}
+
+package androidx.wear.widget.drawer {
+
+ public class WearableActionDrawerView extends androidx.wear.widget.drawer.WearableDrawerView {
+ ctor public WearableActionDrawerView(android.content.Context!);
+ ctor public WearableActionDrawerView(android.content.Context!, android.util.AttributeSet!);
+ ctor public WearableActionDrawerView(android.content.Context!, android.util.AttributeSet!, int);
+ ctor public WearableActionDrawerView(android.content.Context!, android.util.AttributeSet!, int, int);
+ method public android.view.Menu! getMenu();
+ method public void setOnMenuItemClickListener(android.view.MenuItem.OnMenuItemClickListener!);
+ method public void setTitle(CharSequence?);
+ }
+
+ public class WearableDrawerController {
+ method public void closeDrawer();
+ method public void openDrawer();
+ method public void peekDrawer();
+ }
+
+ public class WearableDrawerLayout extends android.widget.FrameLayout implements androidx.core.view.NestedScrollingParent android.view.View.OnLayoutChangeListener {
+ ctor public WearableDrawerLayout(android.content.Context!);
+ ctor public WearableDrawerLayout(android.content.Context!, android.util.AttributeSet!);
+ ctor public WearableDrawerLayout(android.content.Context!, android.util.AttributeSet!, int);
+ ctor public WearableDrawerLayout(android.content.Context!, android.util.AttributeSet!, int, int);
+ method public void onFlingComplete(android.view.View!);
+ method public void onLayoutChange(android.view.View!, int, int, int, int, int, int, int, int);
+ method public void setDrawerStateCallback(androidx.wear.widget.drawer.WearableDrawerLayout.DrawerStateCallback!);
+ }
+
+ public static class WearableDrawerLayout.DrawerStateCallback {
+ ctor public WearableDrawerLayout.DrawerStateCallback();
+ method public void onDrawerClosed(androidx.wear.widget.drawer.WearableDrawerLayout!, androidx.wear.widget.drawer.WearableDrawerView!);
+ method public void onDrawerOpened(androidx.wear.widget.drawer.WearableDrawerLayout!, androidx.wear.widget.drawer.WearableDrawerView!);
+ method public void onDrawerStateChanged(androidx.wear.widget.drawer.WearableDrawerLayout!, int);
+ }
+
+ public class WearableDrawerView extends android.widget.FrameLayout {
+ ctor public WearableDrawerView(android.content.Context!);
+ ctor public WearableDrawerView(android.content.Context!, android.util.AttributeSet!);
+ ctor public WearableDrawerView(android.content.Context!, android.util.AttributeSet!, int);
+ ctor public WearableDrawerView(android.content.Context!, android.util.AttributeSet!, int, int);
+ method public androidx.wear.widget.drawer.WearableDrawerController! getController();
+ method public android.view.View? getDrawerContent();
+ method public int getDrawerState();
+ method public boolean isAutoPeekEnabled();
+ method public boolean isClosed();
+ method public boolean isLocked();
+ method public boolean isLockedWhenClosed();
+ method public boolean isOpenOnlyAtTopEnabled();
+ method public boolean isOpened();
+ method public boolean isPeekOnScrollDownEnabled();
+ method public boolean isPeeking();
+ method public void onDrawerClosed();
+ method public void onDrawerOpened();
+ method public void onDrawerStateChanged(int);
+ method public void onPeekContainerClicked(android.view.View!);
+ method public void setDrawerContent(android.view.View?);
+ method public void setIsAutoPeekEnabled(boolean);
+ method public void setIsLocked(boolean);
+ method public void setLockedWhenClosed(boolean);
+ method public void setOpenOnlyAtTopEnabled(boolean);
+ method public void setPeekContent(android.view.View!);
+ method public void setPeekOnScrollDownEnabled(boolean);
+ field public static final int STATE_DRAGGING = 1; // 0x1
+ field public static final int STATE_IDLE = 0; // 0x0
+ field public static final int STATE_SETTLING = 2; // 0x2
+ }
+
+ public class WearableNavigationDrawerView extends androidx.wear.widget.drawer.WearableDrawerView {
+ ctor public WearableNavigationDrawerView(android.content.Context!);
+ ctor public WearableNavigationDrawerView(android.content.Context!, android.util.AttributeSet!);
+ ctor public WearableNavigationDrawerView(android.content.Context!, android.util.AttributeSet!, int);
+ ctor public WearableNavigationDrawerView(android.content.Context!, android.util.AttributeSet!, int, int);
+ method public void addOnItemSelectedListener(androidx.wear.widget.drawer.WearableNavigationDrawerView.OnItemSelectedListener!);
+ method public int getNavigationStyle();
+ method public void removeOnItemSelectedListener(androidx.wear.widget.drawer.WearableNavigationDrawerView.OnItemSelectedListener!);
+ method public void setAdapter(androidx.wear.widget.drawer.WearableNavigationDrawerView.WearableNavigationDrawerAdapter!);
+ method public void setCurrentItem(int, boolean);
+ field public static final int MULTI_PAGE = 1; // 0x1
+ field public static final int SINGLE_PAGE = 0; // 0x0
+ }
+
+ public static interface WearableNavigationDrawerView.OnItemSelectedListener {
+ method public void onItemSelected(int);
+ }
+
+ public abstract static class WearableNavigationDrawerView.WearableNavigationDrawerAdapter {
+ ctor public WearableNavigationDrawerView.WearableNavigationDrawerAdapter();
+ method public abstract int getCount();
+ method public abstract android.graphics.drawable.Drawable! getItemDrawable(int);
+ method public abstract CharSequence! getItemText(int);
+ method public void notifyDataSetChanged();
+ }
+
+}
+
diff --git a/wear/wear/build.gradle b/wear/wear/build.gradle
index 1747ba3..36abd85 100644
--- a/wear/wear/build.gradle
+++ b/wear/wear/build.gradle
@@ -16,7 +16,7 @@
api("androidx.core:core:1.6.0")
api("androidx.versionedparcelable:versionedparcelable:1.1.1")
- androidTestImplementation(project(":test:screenshot:test-screenshot"))
+ androidTestImplementation(project(":test:screenshot:screenshot"))
androidTestImplementation(libs.kotlinStdlib)
androidTestImplementation(libs.testExtJunit)
androidTestImplementation(libs.testCore)
diff --git a/window/window-extensions/api/api_lint.ignore b/window/window-extensions/api/api_lint.ignore
index d5594c7..c929e8e 100644
--- a/window/window-extensions/api/api_lint.ignore
+++ b/window/window-extensions/api/api_lint.ignore
@@ -1,3 +1,3 @@
// Baseline format: 1.0
-ExecutorRegistration: androidx.window.extensions.ExtensionInterface#setExtensionCallback(androidx.window.extensions.ExtensionInterface.ExtensionCallback):
+ExecutorRegistration: androidx.window.extensions.layout.ExtensionInterface#setExtensionCallback(androidx.window.extensions.layout.ExtensionInterface.ExtensionCallback):
Registration methods should have overload that accepts delivery Executor: `setExtensionCallback`
diff --git a/window/window-extensions/api/current.txt b/window/window-extensions/api/current.txt
index 4e1cb6c..61c0df3 100644
--- a/window/window-extensions/api/current.txt
+++ b/window/window-extensions/api/current.txt
@@ -1,12 +1,31 @@
// Signature format: 4.0
package androidx.window.extensions {
- public interface ExtensionDisplayFeature {
+ public final class ExtensionProvider {
+ method public static String? getApiVersion();
+ method public static androidx.window.extensions.layout.ExtensionInterface? getExtensionImpl(android.content.Context);
+ }
+
+}
+
+package androidx.window.extensions.layout {
+
+ public interface DisplayFeature {
method public android.graphics.Rect getBounds();
}
- public class ExtensionFoldingFeature implements androidx.window.extensions.ExtensionDisplayFeature {
- ctor public ExtensionFoldingFeature(android.graphics.Rect, int, int);
+ public interface ExtensionInterface {
+ method public void onWindowLayoutChangeListenerAdded(android.app.Activity);
+ method public void onWindowLayoutChangeListenerRemoved(android.app.Activity);
+ method public void setExtensionCallback(androidx.window.extensions.layout.ExtensionInterface.ExtensionCallback);
+ }
+
+ public static interface ExtensionInterface.ExtensionCallback {
+ method public void onWindowLayoutChanged(android.app.Activity, androidx.window.extensions.layout.WindowLayoutInfo);
+ }
+
+ public class FoldingFeature implements androidx.window.extensions.layout.DisplayFeature {
+ ctor public FoldingFeature(android.graphics.Rect, int, int);
method public android.graphics.Rect getBounds();
method public int getState();
method public int getType();
@@ -16,24 +35,9 @@
field public static final int TYPE_HINGE = 2; // 0x2
}
- public interface ExtensionInterface {
- method public void onWindowLayoutChangeListenerAdded(android.app.Activity);
- method public void onWindowLayoutChangeListenerRemoved(android.app.Activity);
- method public void setExtensionCallback(androidx.window.extensions.ExtensionInterface.ExtensionCallback);
- }
-
- public static interface ExtensionInterface.ExtensionCallback {
- method public void onWindowLayoutChanged(android.app.Activity, androidx.window.extensions.ExtensionWindowLayoutInfo);
- }
-
- public final class ExtensionProvider {
- method public static String? getApiVersion();
- method public static androidx.window.extensions.ExtensionInterface? getExtensionImpl(android.content.Context);
- }
-
- public class ExtensionWindowLayoutInfo {
- ctor public ExtensionWindowLayoutInfo(java.util.List<androidx.window.extensions.ExtensionDisplayFeature!>);
- method public java.util.List<androidx.window.extensions.ExtensionDisplayFeature!> getDisplayFeatures();
+ public class WindowLayoutInfo {
+ ctor public WindowLayoutInfo(java.util.List<androidx.window.extensions.layout.DisplayFeature!>);
+ method public java.util.List<androidx.window.extensions.layout.DisplayFeature!> getDisplayFeatures();
}
}
diff --git a/window/window-extensions/api/public_plus_experimental_current.txt b/window/window-extensions/api/public_plus_experimental_current.txt
index 4e1cb6c..61c0df3 100644
--- a/window/window-extensions/api/public_plus_experimental_current.txt
+++ b/window/window-extensions/api/public_plus_experimental_current.txt
@@ -1,12 +1,31 @@
// Signature format: 4.0
package androidx.window.extensions {
- public interface ExtensionDisplayFeature {
+ public final class ExtensionProvider {
+ method public static String? getApiVersion();
+ method public static androidx.window.extensions.layout.ExtensionInterface? getExtensionImpl(android.content.Context);
+ }
+
+}
+
+package androidx.window.extensions.layout {
+
+ public interface DisplayFeature {
method public android.graphics.Rect getBounds();
}
- public class ExtensionFoldingFeature implements androidx.window.extensions.ExtensionDisplayFeature {
- ctor public ExtensionFoldingFeature(android.graphics.Rect, int, int);
+ public interface ExtensionInterface {
+ method public void onWindowLayoutChangeListenerAdded(android.app.Activity);
+ method public void onWindowLayoutChangeListenerRemoved(android.app.Activity);
+ method public void setExtensionCallback(androidx.window.extensions.layout.ExtensionInterface.ExtensionCallback);
+ }
+
+ public static interface ExtensionInterface.ExtensionCallback {
+ method public void onWindowLayoutChanged(android.app.Activity, androidx.window.extensions.layout.WindowLayoutInfo);
+ }
+
+ public class FoldingFeature implements androidx.window.extensions.layout.DisplayFeature {
+ ctor public FoldingFeature(android.graphics.Rect, int, int);
method public android.graphics.Rect getBounds();
method public int getState();
method public int getType();
@@ -16,24 +35,9 @@
field public static final int TYPE_HINGE = 2; // 0x2
}
- public interface ExtensionInterface {
- method public void onWindowLayoutChangeListenerAdded(android.app.Activity);
- method public void onWindowLayoutChangeListenerRemoved(android.app.Activity);
- method public void setExtensionCallback(androidx.window.extensions.ExtensionInterface.ExtensionCallback);
- }
-
- public static interface ExtensionInterface.ExtensionCallback {
- method public void onWindowLayoutChanged(android.app.Activity, androidx.window.extensions.ExtensionWindowLayoutInfo);
- }
-
- public final class ExtensionProvider {
- method public static String? getApiVersion();
- method public static androidx.window.extensions.ExtensionInterface? getExtensionImpl(android.content.Context);
- }
-
- public class ExtensionWindowLayoutInfo {
- ctor public ExtensionWindowLayoutInfo(java.util.List<androidx.window.extensions.ExtensionDisplayFeature!>);
- method public java.util.List<androidx.window.extensions.ExtensionDisplayFeature!> getDisplayFeatures();
+ public class WindowLayoutInfo {
+ ctor public WindowLayoutInfo(java.util.List<androidx.window.extensions.layout.DisplayFeature!>);
+ method public java.util.List<androidx.window.extensions.layout.DisplayFeature!> getDisplayFeatures();
}
}
diff --git a/window/window-extensions/api/restricted_current.txt b/window/window-extensions/api/restricted_current.txt
index 4e1cb6c..61c0df3 100644
--- a/window/window-extensions/api/restricted_current.txt
+++ b/window/window-extensions/api/restricted_current.txt
@@ -1,12 +1,31 @@
// Signature format: 4.0
package androidx.window.extensions {
- public interface ExtensionDisplayFeature {
+ public final class ExtensionProvider {
+ method public static String? getApiVersion();
+ method public static androidx.window.extensions.layout.ExtensionInterface? getExtensionImpl(android.content.Context);
+ }
+
+}
+
+package androidx.window.extensions.layout {
+
+ public interface DisplayFeature {
method public android.graphics.Rect getBounds();
}
- public class ExtensionFoldingFeature implements androidx.window.extensions.ExtensionDisplayFeature {
- ctor public ExtensionFoldingFeature(android.graphics.Rect, int, int);
+ public interface ExtensionInterface {
+ method public void onWindowLayoutChangeListenerAdded(android.app.Activity);
+ method public void onWindowLayoutChangeListenerRemoved(android.app.Activity);
+ method public void setExtensionCallback(androidx.window.extensions.layout.ExtensionInterface.ExtensionCallback);
+ }
+
+ public static interface ExtensionInterface.ExtensionCallback {
+ method public void onWindowLayoutChanged(android.app.Activity, androidx.window.extensions.layout.WindowLayoutInfo);
+ }
+
+ public class FoldingFeature implements androidx.window.extensions.layout.DisplayFeature {
+ ctor public FoldingFeature(android.graphics.Rect, int, int);
method public android.graphics.Rect getBounds();
method public int getState();
method public int getType();
@@ -16,24 +35,9 @@
field public static final int TYPE_HINGE = 2; // 0x2
}
- public interface ExtensionInterface {
- method public void onWindowLayoutChangeListenerAdded(android.app.Activity);
- method public void onWindowLayoutChangeListenerRemoved(android.app.Activity);
- method public void setExtensionCallback(androidx.window.extensions.ExtensionInterface.ExtensionCallback);
- }
-
- public static interface ExtensionInterface.ExtensionCallback {
- method public void onWindowLayoutChanged(android.app.Activity, androidx.window.extensions.ExtensionWindowLayoutInfo);
- }
-
- public final class ExtensionProvider {
- method public static String? getApiVersion();
- method public static androidx.window.extensions.ExtensionInterface? getExtensionImpl(android.content.Context);
- }
-
- public class ExtensionWindowLayoutInfo {
- ctor public ExtensionWindowLayoutInfo(java.util.List<androidx.window.extensions.ExtensionDisplayFeature!>);
- method public java.util.List<androidx.window.extensions.ExtensionDisplayFeature!> getDisplayFeatures();
+ public class WindowLayoutInfo {
+ ctor public WindowLayoutInfo(java.util.List<androidx.window.extensions.layout.DisplayFeature!>);
+ method public java.util.List<androidx.window.extensions.layout.DisplayFeature!> getDisplayFeatures();
}
}
diff --git a/window/window-extensions/src/androidTest/java/androidx/window/extensions/ExtensionDisplayFeatureTest.java b/window/window-extensions/src/androidTest/java/androidx/window/extensions/ExtensionDisplayFeatureTest.java
deleted file mode 100644
index 151fe2d..0000000
--- a/window/window-extensions/src/androidTest/java/androidx/window/extensions/ExtensionDisplayFeatureTest.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * Copyright 2021 The Android Open Source Project
- *
- * 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.
- */
-
-package androidx.window.extensions;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotEquals;
-
-import android.graphics.Rect;
-
-import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.SmallTest;
-
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-/** Tests for {@link ExtensionFoldingFeature} class. */
-@SmallTest
-@RunWith(AndroidJUnit4.class)
-public final class ExtensionDisplayFeatureTest {
-
- @Test
- public void testEquals_sameAttributes() {
- Rect bounds = new Rect(1, 0, 1, 10);
- int type = ExtensionFoldingFeature.TYPE_FOLD;
- int state = ExtensionFoldingFeature.STATE_FLAT;
-
- ExtensionFoldingFeature original = new ExtensionFoldingFeature(bounds, type, state);
- ExtensionFoldingFeature copy = new ExtensionFoldingFeature(bounds, type, state);
-
- assertEquals(original, copy);
- }
-
- @Test
- public void testEquals_differentRect() {
- Rect originalRect = new Rect(1, 0, 1, 10);
- Rect otherRect = new Rect(2, 0, 2, 10);
- int type = ExtensionFoldingFeature.TYPE_FOLD;
- int state = ExtensionFoldingFeature.STATE_FLAT;
-
- ExtensionFoldingFeature original = new ExtensionFoldingFeature(originalRect, type,
- state);
- ExtensionFoldingFeature other = new ExtensionFoldingFeature(otherRect, type, state);
-
- assertNotEquals(original, other);
- }
-
- @Test
- public void testEquals_differentType() {
- Rect rect = new Rect(1, 0, 1, 10);
- int originalType = ExtensionFoldingFeature.TYPE_FOLD;
- int otherType = ExtensionFoldingFeature.TYPE_HINGE;
- int state = ExtensionFoldingFeature.STATE_FLAT;
-
- ExtensionFoldingFeature original = new ExtensionFoldingFeature(rect, originalType,
- state);
- ExtensionFoldingFeature other = new ExtensionFoldingFeature(rect, otherType, state);
-
- assertNotEquals(original, other);
- }
-
- @Test
- public void testEquals_differentState() {
- Rect rect = new Rect(1, 0, 1, 10);
- int type = ExtensionFoldingFeature.TYPE_FOLD;
- int originalState = ExtensionFoldingFeature.STATE_FLAT;
- int otherState = ExtensionFoldingFeature.STATE_HALF_OPENED;
-
- ExtensionFoldingFeature original = new ExtensionFoldingFeature(rect, type,
- originalState);
- ExtensionFoldingFeature other = new ExtensionFoldingFeature(rect, type, otherState);
-
- assertNotEquals(original, other);
- }
-
- @Test
- public void testHashCode_matchesIfEqual() {
- Rect originalRect = new Rect(1, 0, 1, 10);
- Rect matchingRect = new Rect(1, 0, 1, 10);
- int type = ExtensionFoldingFeature.TYPE_FOLD;
- int state = ExtensionFoldingFeature.STATE_FLAT;
-
- ExtensionFoldingFeature original = new ExtensionFoldingFeature(originalRect, type,
- state);
- ExtensionFoldingFeature matching = new ExtensionFoldingFeature(matchingRect, type,
- state);
-
- assertEquals(original, matching);
- assertEquals(original.hashCode(), matching.hashCode());
- }
-}
diff --git a/window/window-extensions/src/androidTest/java/androidx/window/extensions/ExtensionWindowLayoutInfoTest.java b/window/window-extensions/src/androidTest/java/androidx/window/extensions/ExtensionWindowLayoutInfoTest.java
deleted file mode 100644
index 968ddb9..0000000
--- a/window/window-extensions/src/androidTest/java/androidx/window/extensions/ExtensionWindowLayoutInfoTest.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * Copyright 2021 The Android Open Source Project
- *
- * 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.
- */
-
-package androidx.window.extensions;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotEquals;
-
-import android.graphics.Rect;
-
-import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.SmallTest;
-
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-/** Tests for {@link ExtensionWindowLayoutInfo} class. */
-@SmallTest
-@RunWith(AndroidJUnit4.class)
-public final class ExtensionWindowLayoutInfoTest {
-
- @Test
- public void testEquals_sameFeatures() {
- List<ExtensionDisplayFeature> features = new ArrayList<>();
-
- ExtensionWindowLayoutInfo original = new ExtensionWindowLayoutInfo(features);
- ExtensionWindowLayoutInfo copy = new ExtensionWindowLayoutInfo(features);
-
- assertEquals(original, copy);
- }
-
- @Test
- public void testEquals_differentFeatures() {
- List<ExtensionDisplayFeature> originalFeatures = new ArrayList<>();
- List<ExtensionDisplayFeature> differentFeatures = new ArrayList<>();
- Rect rect = new Rect(1, 0, 1, 10);
- differentFeatures.add(new ExtensionFoldingFeature(
- rect, ExtensionFoldingFeature.TYPE_HINGE,
- ExtensionFoldingFeature.STATE_FLAT));
-
- ExtensionWindowLayoutInfo original = new ExtensionWindowLayoutInfo(originalFeatures);
- ExtensionWindowLayoutInfo different = new ExtensionWindowLayoutInfo(differentFeatures);
-
- assertNotEquals(original, different);
- }
-
- @Test
- public void testHashCode_matchesIfEqual() {
- List<ExtensionDisplayFeature> firstFeatures = new ArrayList<>();
- List<ExtensionDisplayFeature> secondFeatures = new ArrayList<>();
- ExtensionWindowLayoutInfo first = new ExtensionWindowLayoutInfo(firstFeatures);
- ExtensionWindowLayoutInfo second = new ExtensionWindowLayoutInfo(secondFeatures);
-
- assertEquals(first, second);
- assertEquals(first.hashCode(), second.hashCode());
- }
-
- @Test
- public void testHashCode_matchesIfEqualFeatures() {
- ExtensionDisplayFeature originalFeature = new ExtensionFoldingFeature(
- new Rect(0, 0, 100, 0),
- ExtensionFoldingFeature.TYPE_HINGE,
- ExtensionFoldingFeature.STATE_FLAT
- );
- ExtensionDisplayFeature matchingFeature = new ExtensionFoldingFeature(
- new Rect(0, 0, 100, 0),
- ExtensionFoldingFeature.TYPE_HINGE,
- ExtensionFoldingFeature.STATE_FLAT
- );
- List<ExtensionDisplayFeature> firstFeatures = Collections.singletonList(originalFeature);
- List<ExtensionDisplayFeature> secondFeatures = Collections.singletonList(matchingFeature);
- ExtensionWindowLayoutInfo first = new ExtensionWindowLayoutInfo(firstFeatures);
- ExtensionWindowLayoutInfo second = new ExtensionWindowLayoutInfo(secondFeatures);
-
- assertEquals(first, second);
- assertEquals(first.hashCode(), second.hashCode());
- }
-}
diff --git a/window/window-extensions/src/androidTest/java/androidx/window/extensions/layout/FoldingFeatureTest.java b/window/window-extensions/src/androidTest/java/androidx/window/extensions/layout/FoldingFeatureTest.java
new file mode 100644
index 0000000..49dcb8f
--- /dev/null
+++ b/window/window-extensions/src/androidTest/java/androidx/window/extensions/layout/FoldingFeatureTest.java
@@ -0,0 +1,104 @@
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * 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.
+ */
+
+package androidx.window.extensions.layout;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotEquals;
+
+import android.graphics.Rect;
+
+import androidx.test.ext.junit.runners.AndroidJUnit4;
+import androidx.test.filters.SmallTest;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+/** Tests for {@link FoldingFeature} class. */
+@SmallTest
+@RunWith(AndroidJUnit4.class)
+public final class FoldingFeatureTest {
+
+ @Test
+ public void testEquals_sameAttributes() {
+ Rect bounds = new Rect(1, 0, 1, 10);
+ int type = FoldingFeature.TYPE_FOLD;
+ int state = FoldingFeature.STATE_FLAT;
+
+ FoldingFeature original = new FoldingFeature(bounds, type, state);
+ FoldingFeature copy = new FoldingFeature(bounds, type, state);
+
+ assertEquals(original, copy);
+ }
+
+ @Test
+ public void testEquals_differentRect() {
+ Rect originalRect = new Rect(1, 0, 1, 10);
+ Rect otherRect = new Rect(2, 0, 2, 10);
+ int type = FoldingFeature.TYPE_FOLD;
+ int state = FoldingFeature.STATE_FLAT;
+
+ FoldingFeature original = new FoldingFeature(originalRect, type,
+ state);
+ FoldingFeature other = new FoldingFeature(otherRect, type, state);
+
+ assertNotEquals(original, other);
+ }
+
+ @Test
+ public void testEquals_differentType() {
+ Rect rect = new Rect(1, 0, 1, 10);
+ int originalType = FoldingFeature.TYPE_FOLD;
+ int otherType = FoldingFeature.TYPE_HINGE;
+ int state = FoldingFeature.STATE_FLAT;
+
+ FoldingFeature original = new FoldingFeature(rect, originalType,
+ state);
+ FoldingFeature other = new FoldingFeature(rect, otherType, state);
+
+ assertNotEquals(original, other);
+ }
+
+ @Test
+ public void testEquals_differentState() {
+ Rect rect = new Rect(1, 0, 1, 10);
+ int type = FoldingFeature.TYPE_FOLD;
+ int originalState = FoldingFeature.STATE_FLAT;
+ int otherState = FoldingFeature.STATE_HALF_OPENED;
+
+ FoldingFeature original = new FoldingFeature(rect, type,
+ originalState);
+ FoldingFeature other = new FoldingFeature(rect, type, otherState);
+
+ assertNotEquals(original, other);
+ }
+
+ @Test
+ public void testHashCode_matchesIfEqual() {
+ Rect originalRect = new Rect(1, 0, 1, 10);
+ Rect matchingRect = new Rect(1, 0, 1, 10);
+ int type = FoldingFeature.TYPE_FOLD;
+ int state = FoldingFeature.STATE_FLAT;
+
+ FoldingFeature original = new FoldingFeature(originalRect, type,
+ state);
+ FoldingFeature matching = new FoldingFeature(matchingRect, type,
+ state);
+
+ assertEquals(original, matching);
+ assertEquals(original.hashCode(), matching.hashCode());
+ }
+}
diff --git a/window/window-extensions/src/androidTest/java/androidx/window/extensions/layout/WindowLayoutInfoTest.java b/window/window-extensions/src/androidTest/java/androidx/window/extensions/layout/WindowLayoutInfoTest.java
new file mode 100644
index 0000000..3d51790
--- /dev/null
+++ b/window/window-extensions/src/androidTest/java/androidx/window/extensions/layout/WindowLayoutInfoTest.java
@@ -0,0 +1,95 @@
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * 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.
+ */
+
+package androidx.window.extensions.layout;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotEquals;
+
+import android.graphics.Rect;
+
+import androidx.test.ext.junit.runners.AndroidJUnit4;
+import androidx.test.filters.SmallTest;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+/** Tests for {@link WindowLayoutInfo} class. */
+@SmallTest
+@RunWith(AndroidJUnit4.class)
+public final class WindowLayoutInfoTest {
+
+ @Test
+ public void testEquals_sameFeatures() {
+ List<DisplayFeature> features = new ArrayList<>();
+
+ WindowLayoutInfo original = new WindowLayoutInfo(features);
+ WindowLayoutInfo copy = new WindowLayoutInfo(features);
+
+ assertEquals(original, copy);
+ }
+
+ @Test
+ public void testEquals_differentFeatures() {
+ List<DisplayFeature> originalFeatures = new ArrayList<>();
+ List<DisplayFeature> differentFeatures = new ArrayList<>();
+ Rect rect = new Rect(1, 0, 1, 10);
+ differentFeatures.add(new FoldingFeature(
+ rect, FoldingFeature.TYPE_HINGE,
+ FoldingFeature.STATE_FLAT));
+
+ WindowLayoutInfo original = new WindowLayoutInfo(originalFeatures);
+ WindowLayoutInfo different = new WindowLayoutInfo(differentFeatures);
+
+ assertNotEquals(original, different);
+ }
+
+ @Test
+ public void testHashCode_matchesIfEqual() {
+ List<DisplayFeature> firstFeatures = new ArrayList<>();
+ List<DisplayFeature> secondFeatures = new ArrayList<>();
+ WindowLayoutInfo first = new WindowLayoutInfo(firstFeatures);
+ WindowLayoutInfo second = new WindowLayoutInfo(secondFeatures);
+
+ assertEquals(first, second);
+ assertEquals(first.hashCode(), second.hashCode());
+ }
+
+ @Test
+ public void testHashCode_matchesIfEqualFeatures() {
+ DisplayFeature originalFeature = new FoldingFeature(
+ new Rect(0, 0, 100, 0),
+ FoldingFeature.TYPE_HINGE,
+ FoldingFeature.STATE_FLAT
+ );
+ DisplayFeature matchingFeature = new FoldingFeature(
+ new Rect(0, 0, 100, 0),
+ FoldingFeature.TYPE_HINGE,
+ FoldingFeature.STATE_FLAT
+ );
+ List<DisplayFeature> firstFeatures = Collections.singletonList(originalFeature);
+ List<DisplayFeature> secondFeatures = Collections.singletonList(matchingFeature);
+ WindowLayoutInfo first = new WindowLayoutInfo(firstFeatures);
+ WindowLayoutInfo second = new WindowLayoutInfo(secondFeatures);
+
+ assertEquals(first, second);
+ assertEquals(first.hashCode(), second.hashCode());
+ }
+}
diff --git a/window/window-extensions/src/main/java/androidx/window/extensions/ExtensionProvider.java b/window/window-extensions/src/main/java/androidx/window/extensions/ExtensionProvider.java
index 536389a..fe75056 100644
--- a/window/window-extensions/src/main/java/androidx/window/extensions/ExtensionProvider.java
+++ b/window/window-extensions/src/main/java/androidx/window/extensions/ExtensionProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2020 The Android Open Source Project
+ * Copyright 2021 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -20,6 +20,7 @@
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
+import androidx.window.extensions.layout.ExtensionInterface;
/**
* A stub implementation for the class that will instantiate the Extension.
diff --git a/window/window-extensions/src/main/java/androidx/window/extensions/StubExtension.java b/window/window-extensions/src/main/java/androidx/window/extensions/StubExtension.java
index 283b5a1..f764c2f 100644
--- a/window/window-extensions/src/main/java/androidx/window/extensions/StubExtension.java
+++ b/window/window-extensions/src/main/java/androidx/window/extensions/StubExtension.java
@@ -19,6 +19,8 @@
import android.app.Activity;
import androidx.annotation.NonNull;
+import androidx.window.extensions.layout.ExtensionInterface;
+import androidx.window.extensions.layout.WindowLayoutInfo;
import java.util.HashSet;
import java.util.Set;
@@ -49,7 +51,7 @@
}
protected void updateWindowLayout(@NonNull Activity activity,
- @NonNull ExtensionWindowLayoutInfo newLayout) {
+ @NonNull WindowLayoutInfo newLayout) {
if (mExtensionCallback != null) {
mExtensionCallback.onWindowLayoutChanged(activity, newLayout);
}
diff --git a/window/window-extensions/src/main/java/androidx/window/extensions/ExtensionDisplayFeature.java b/window/window-extensions/src/main/java/androidx/window/extensions/layout/DisplayFeature.java
similarity index 92%
rename from window/window-extensions/src/main/java/androidx/window/extensions/ExtensionDisplayFeature.java
rename to window/window-extensions/src/main/java/androidx/window/extensions/layout/DisplayFeature.java
index 76625ac..32b0fa1 100644
--- a/window/window-extensions/src/main/java/androidx/window/extensions/ExtensionDisplayFeature.java
+++ b/window/window-extensions/src/main/java/androidx/window/extensions/layout/DisplayFeature.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package androidx.window.extensions;
+package androidx.window.extensions.layout;
import android.graphics.Rect;
@@ -23,7 +23,7 @@
/**
* Description of a physical feature on the display.
*/
-public interface ExtensionDisplayFeature {
+public interface DisplayFeature {
/**
* The bounding rectangle of the feature within the application window
diff --git a/window/window-extensions/src/main/java/androidx/window/extensions/ExtensionInterface.java b/window/window-extensions/src/main/java/androidx/window/extensions/layout/ExtensionInterface.java
similarity index 91%
rename from window/window-extensions/src/main/java/androidx/window/extensions/ExtensionInterface.java
rename to window/window-extensions/src/main/java/androidx/window/extensions/layout/ExtensionInterface.java
index 62e04ee..b708006 100644
--- a/window/window-extensions/src/main/java/androidx/window/extensions/ExtensionInterface.java
+++ b/window/window-extensions/src/main/java/androidx/window/extensions/layout/ExtensionInterface.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2020 The Android Open Source Project
+ * Copyright 2021 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -14,11 +14,12 @@
* limitations under the License.
*/
-package androidx.window.extensions;
+package androidx.window.extensions.layout;
import android.app.Activity;
import androidx.annotation.NonNull;
+import androidx.window.extensions.ExtensionProvider;
/**
* Main Extension interface definition that will be used by the WindowManager library to get custom
@@ -58,6 +59,6 @@
* should be provided as soon as possible.
*/
void onWindowLayoutChanged(@NonNull Activity activity,
- @NonNull ExtensionWindowLayoutInfo newLayout);
+ @NonNull WindowLayoutInfo newLayout);
}
}
diff --git a/window/window-extensions/src/main/java/androidx/window/extensions/ExtensionFoldingFeature.java b/window/window-extensions/src/main/java/androidx/window/extensions/layout/FoldingFeature.java
similarity index 93%
rename from window/window-extensions/src/main/java/androidx/window/extensions/ExtensionFoldingFeature.java
rename to window/window-extensions/src/main/java/androidx/window/extensions/layout/FoldingFeature.java
index 89d184d..0e74057 100644
--- a/window/window-extensions/src/main/java/androidx/window/extensions/ExtensionFoldingFeature.java
+++ b/window/window-extensions/src/main/java/androidx/window/extensions/layout/FoldingFeature.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package androidx.window.extensions;
+package androidx.window.extensions.layout;
import android.graphics.Rect;
@@ -29,7 +29,7 @@
* A feature that describes a fold in a flexible display
* or a hinge between two physical display panels.
*/
-public class ExtensionFoldingFeature implements ExtensionDisplayFeature {
+public class FoldingFeature implements DisplayFeature {
/**
* A fold in the flexible screen without a physical gap.
@@ -91,7 +91,7 @@
@State
private final int mState;
- public ExtensionFoldingFeature(@NonNull Rect bounds, @Type int type, @State int state) {
+ public FoldingFeature(@NonNull Rect bounds, @Type int type, @State int state) {
validateFeatureBounds(bounds);
mBounds = new Rect(bounds);
mType = type;
@@ -166,10 +166,10 @@
if (this == obj) {
return true;
}
- if (!(obj instanceof ExtensionFoldingFeature)) {
+ if (!(obj instanceof FoldingFeature)) {
return false;
}
- final ExtensionFoldingFeature other = (ExtensionFoldingFeature) obj;
+ final FoldingFeature other = (FoldingFeature) obj;
if (mType != other.mType) {
return false;
}
diff --git a/window/window-extensions/src/main/java/androidx/window/extensions/ExtensionWindowLayoutInfo.java b/window/window-extensions/src/main/java/androidx/window/extensions/layout/WindowLayoutInfo.java
similarity index 83%
rename from window/window-extensions/src/main/java/androidx/window/extensions/ExtensionWindowLayoutInfo.java
rename to window/window-extensions/src/main/java/androidx/window/extensions/layout/WindowLayoutInfo.java
index fe2ef90..9041f0a 100644
--- a/window/window-extensions/src/main/java/androidx/window/extensions/ExtensionWindowLayoutInfo.java
+++ b/window/window-extensions/src/main/java/androidx/window/extensions/layout/WindowLayoutInfo.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package androidx.window.extensions;
+package androidx.window.extensions.layout;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
@@ -25,7 +25,7 @@
/**
* Contains information about the layout of display features within the window.
*/
-public class ExtensionWindowLayoutInfo {
+public class WindowLayoutInfo {
/**
* List of display features within the window.
@@ -33,9 +33,9 @@
* window and reported within the coordinate space of the window that was provided by the app.
*/
@NonNull
- private List<ExtensionDisplayFeature> mDisplayFeatures;
+ private List<DisplayFeature> mDisplayFeatures;
- public ExtensionWindowLayoutInfo(@NonNull List<ExtensionDisplayFeature> displayFeatures) {
+ public WindowLayoutInfo(@NonNull List<DisplayFeature> displayFeatures) {
mDisplayFeatures = Collections.unmodifiableList(displayFeatures);
}
@@ -43,7 +43,7 @@
* Gets the list of display features present within the window.
*/
@NonNull
- public List<ExtensionDisplayFeature> getDisplayFeatures() {
+ public List<DisplayFeature> getDisplayFeatures() {
return mDisplayFeatures;
}
@@ -67,11 +67,11 @@
if (this == obj) {
return true;
}
- if (!(obj instanceof ExtensionWindowLayoutInfo)) {
+ if (!(obj instanceof WindowLayoutInfo)) {
return false;
}
- final ExtensionWindowLayoutInfo
- other = (ExtensionWindowLayoutInfo) obj;
+ final WindowLayoutInfo
+ other = (WindowLayoutInfo) obj;
if (mDisplayFeatures == null) {
return other.mDisplayFeatures == null;
}
diff --git a/window/window-testing/api/public_plus_experimental_1.0.0-beta01.txt b/window/window-testing/api/public_plus_experimental_1.0.0-beta01.txt
index 5712b93..0ebaf19 100644
--- a/window/window-testing/api/public_plus_experimental_1.0.0-beta01.txt
+++ b/window/window-testing/api/public_plus_experimental_1.0.0-beta01.txt
@@ -7,6 +7,11 @@
method public static androidx.window.layout.FoldingFeature createFoldingFeature(android.app.Activity activity, optional int center, optional int size);
method public static androidx.window.layout.FoldingFeature createFoldingFeature(android.app.Activity activity, optional int center);
method public static androidx.window.layout.FoldingFeature createFoldingFeature(android.app.Activity activity);
+ method @androidx.window.core.ExperimentalWindowApi public static androidx.window.layout.FoldingFeature createFoldingFeature(android.graphics.Rect windowBounds, optional int center, optional int size, optional androidx.window.layout.FoldingFeature.State state, optional androidx.window.layout.FoldingFeature.Orientation orientation);
+ method @androidx.window.core.ExperimentalWindowApi public static androidx.window.layout.FoldingFeature createFoldingFeature(android.graphics.Rect windowBounds, optional int center, optional int size, optional androidx.window.layout.FoldingFeature.State state);
+ method @androidx.window.core.ExperimentalWindowApi public static androidx.window.layout.FoldingFeature createFoldingFeature(android.graphics.Rect windowBounds, optional int center, optional int size);
+ method @androidx.window.core.ExperimentalWindowApi public static androidx.window.layout.FoldingFeature createFoldingFeature(android.graphics.Rect windowBounds, optional int center);
+ method @androidx.window.core.ExperimentalWindowApi public static androidx.window.layout.FoldingFeature createFoldingFeature(android.graphics.Rect windowBounds);
}
public final class WindowLayoutInfoPublisherRule implements org.junit.rules.TestRule {
diff --git a/window/window-testing/api/public_plus_experimental_current.txt b/window/window-testing/api/public_plus_experimental_current.txt
index 5712b93..0ebaf19 100644
--- a/window/window-testing/api/public_plus_experimental_current.txt
+++ b/window/window-testing/api/public_plus_experimental_current.txt
@@ -7,6 +7,11 @@
method public static androidx.window.layout.FoldingFeature createFoldingFeature(android.app.Activity activity, optional int center, optional int size);
method public static androidx.window.layout.FoldingFeature createFoldingFeature(android.app.Activity activity, optional int center);
method public static androidx.window.layout.FoldingFeature createFoldingFeature(android.app.Activity activity);
+ method @androidx.window.core.ExperimentalWindowApi public static androidx.window.layout.FoldingFeature createFoldingFeature(android.graphics.Rect windowBounds, optional int center, optional int size, optional androidx.window.layout.FoldingFeature.State state, optional androidx.window.layout.FoldingFeature.Orientation orientation);
+ method @androidx.window.core.ExperimentalWindowApi public static androidx.window.layout.FoldingFeature createFoldingFeature(android.graphics.Rect windowBounds, optional int center, optional int size, optional androidx.window.layout.FoldingFeature.State state);
+ method @androidx.window.core.ExperimentalWindowApi public static androidx.window.layout.FoldingFeature createFoldingFeature(android.graphics.Rect windowBounds, optional int center, optional int size);
+ method @androidx.window.core.ExperimentalWindowApi public static androidx.window.layout.FoldingFeature createFoldingFeature(android.graphics.Rect windowBounds, optional int center);
+ method @androidx.window.core.ExperimentalWindowApi public static androidx.window.layout.FoldingFeature createFoldingFeature(android.graphics.Rect windowBounds);
}
public final class WindowLayoutInfoPublisherRule implements org.junit.rules.TestRule {
diff --git a/window/window-testing/src/androidTest/java/androidx/window/testing/layout/DisplayFeatureTestingTest.kt b/window/window-testing/src/androidTest/java/androidx/window/testing/layout/DisplayFeatureTestingTest.kt
index b626525..d9ab535 100644
--- a/window/window-testing/src/androidTest/java/androidx/window/testing/layout/DisplayFeatureTestingTest.kt
+++ b/window/window-testing/src/androidTest/java/androidx/window/testing/layout/DisplayFeatureTestingTest.kt
@@ -18,6 +18,7 @@
import android.graphics.Rect
import androidx.test.ext.junit.rules.ActivityScenarioRule
+import androidx.window.core.ExperimentalWindowApi
import androidx.window.layout.FoldingFeature.OcclusionType.Companion.FULL
import androidx.window.layout.FoldingFeature.OcclusionType.Companion.NONE
import androidx.window.layout.FoldingFeature.Orientation.Companion.HORIZONTAL
@@ -38,110 +39,113 @@
public val activityRule: ActivityScenarioRule<TestActivity> =
ActivityScenarioRule(TestActivity::class.java)
- @OptIn(ExperimentalCoroutinesApi::class)
+ private val windowBounds = Rect(0, 0, 320, 640)
+
+ @OptIn(ExperimentalCoroutinesApi::class, ExperimentalWindowApi::class)
@Test
public fun testFold_emptyWidthIsFold() {
- activityRule.scenario.onActivity { activity ->
- val metrics = WindowMetricsCalculator.getOrCreate()
- .computeCurrentWindowMetrics(activity)
- val bounds = metrics.bounds
- val center = bounds.centerX()
- val actual = FoldingFeature(activity = activity, state = FLAT, orientation = VERTICAL)
- val expectedBounds = Rect(center, 0, center, bounds.height())
- assertEquals(expectedBounds.left, actual.bounds.left)
- assertEquals(expectedBounds.right, actual.bounds.right)
- assertEquals(expectedBounds.top, actual.bounds.top)
- assertEquals(expectedBounds.bottom, actual.bounds.bottom)
- assertFalse(actual.isSeparating)
- assertEquals(NONE, actual.occlusionType)
- assertEquals(VERTICAL, actual.orientation)
- assertEquals(FLAT, actual.state)
- }
+ val center = windowBounds.centerX()
+ val actual = FoldingFeature(
+ windowBounds = windowBounds,
+ state = FLAT,
+ orientation = VERTICAL
+ )
+ val expectedBounds = Rect(center, 0, center, windowBounds.height())
+ assertEquals(expectedBounds.left, actual.bounds.left)
+ assertEquals(expectedBounds.right, actual.bounds.right)
+ assertEquals(expectedBounds.top, actual.bounds.top)
+ assertEquals(expectedBounds.bottom, actual.bounds.bottom)
+ assertFalse(actual.isSeparating)
+ assertEquals(NONE, actual.occlusionType)
+ assertEquals(VERTICAL, actual.orientation)
+ assertEquals(FLAT, actual.state)
}
- @OptIn(ExperimentalCoroutinesApi::class)
+ @OptIn(ExperimentalCoroutinesApi::class, ExperimentalWindowApi::class)
@Test
public fun testFold_boundsMatchOrientation() {
- activityRule.scenario.onActivity { activity ->
- val metrics = WindowMetricsCalculator.getOrCreate()
- .computeCurrentWindowMetrics(activity)
- val bounds = metrics.bounds
- val center = bounds.centerY()
- val actual = FoldingFeature(activity = activity, state = FLAT, orientation = HORIZONTAL)
- val expectedBounds = Rect(0, center, bounds.width(), center)
- assertEquals(expectedBounds.left, actual.bounds.left)
- assertEquals(expectedBounds.right, actual.bounds.right)
- assertEquals(expectedBounds.top, actual.bounds.top)
- assertEquals(expectedBounds.bottom, actual.bounds.bottom)
- assertFalse(actual.isSeparating)
- assertEquals(NONE, actual.occlusionType)
- assertEquals(HORIZONTAL, actual.orientation)
- assertEquals(FLAT, actual.state)
- }
+ val bounds = Rect(0, 0, 320, 640)
+ val center = bounds.centerY()
+ val actual = FoldingFeature(windowBounds = bounds, state = FLAT, orientation = HORIZONTAL)
+ val expectedBounds = Rect(0, center, bounds.width(), center)
+ assertEquals(expectedBounds.left, actual.bounds.left)
+ assertEquals(expectedBounds.right, actual.bounds.right)
+ assertEquals(expectedBounds.top, actual.bounds.top)
+ assertEquals(expectedBounds.bottom, actual.bounds.bottom)
+ assertFalse(actual.isSeparating)
+ assertEquals(NONE, actual.occlusionType)
+ assertEquals(HORIZONTAL, actual.orientation)
+ assertEquals(FLAT, actual.state)
}
- @OptIn(ExperimentalCoroutinesApi::class)
+ @OptIn(ExperimentalCoroutinesApi::class, ExperimentalWindowApi::class)
@Test
public fun testFold_centerMatchOrientation_vertical() {
- activityRule.scenario.onActivity { activity ->
- val metrics = WindowMetricsCalculator.getOrCreate()
- .computeCurrentWindowMetrics(activity)
- val bounds = metrics.bounds
- val center = bounds.centerX()
- val actual = FoldingFeature(activity = activity, orientation = VERTICAL)
- val expectedBounds = Rect(center, 0, center, bounds.height())
- assertEquals(expectedBounds.left, actual.bounds.left)
- assertEquals(expectedBounds.right, actual.bounds.right)
- assertEquals(expectedBounds.top, actual.bounds.top)
- assertEquals(expectedBounds.bottom, actual.bounds.bottom)
- assertEquals(NONE, actual.occlusionType)
- assertEquals(VERTICAL, actual.orientation)
- }
+ val center = windowBounds.centerX()
+ val actual = FoldingFeature(windowBounds = windowBounds, orientation = VERTICAL)
+ val expectedBounds = Rect(center, 0, center, windowBounds.height())
+ assertEquals(expectedBounds.left, actual.bounds.left)
+ assertEquals(expectedBounds.right, actual.bounds.right)
+ assertEquals(expectedBounds.top, actual.bounds.top)
+ assertEquals(expectedBounds.bottom, actual.bounds.bottom)
+ assertEquals(NONE, actual.occlusionType)
+ assertEquals(VERTICAL, actual.orientation)
}
- @OptIn(ExperimentalCoroutinesApi::class)
+ @OptIn(ExperimentalCoroutinesApi::class, ExperimentalWindowApi::class)
@Test
public fun testFold_centerMatchOrientation_horizontal() {
- activityRule.scenario.onActivity { activity ->
- val metrics = WindowMetricsCalculator.getOrCreate()
- .computeCurrentWindowMetrics(activity)
- val bounds = metrics.bounds
- val center = bounds.centerY()
- val actual = FoldingFeature(activity = activity, orientation = HORIZONTAL)
- val expectedBounds = Rect(0, center, bounds.width(), center)
- assertEquals(expectedBounds.left, actual.bounds.left)
- assertEquals(expectedBounds.right, actual.bounds.right)
- assertEquals(expectedBounds.top, actual.bounds.top)
- assertEquals(expectedBounds.bottom, actual.bounds.bottom)
- assertEquals(NONE, actual.occlusionType)
- assertEquals(HORIZONTAL, actual.orientation)
- }
+ val center = windowBounds.centerY()
+ val actual = FoldingFeature(windowBounds = windowBounds, orientation = HORIZONTAL)
+ val expectedBounds = Rect(0, center, windowBounds.width(), center)
+ assertEquals(expectedBounds.left, actual.bounds.left)
+ assertEquals(expectedBounds.right, actual.bounds.right)
+ assertEquals(expectedBounds.top, actual.bounds.top)
+ assertEquals(expectedBounds.bottom, actual.bounds.bottom)
+ assertEquals(NONE, actual.occlusionType)
+ assertEquals(HORIZONTAL, actual.orientation)
}
- @OptIn(ExperimentalCoroutinesApi::class)
+ @OptIn(ExperimentalCoroutinesApi::class, ExperimentalWindowApi::class)
@Test
public fun testFold_nonEmptyWidthIsFold() {
+ val center = windowBounds.centerX()
+ val width = 20
+ val actual = FoldingFeature(
+ windowBounds = windowBounds,
+ size = width,
+ state = FLAT,
+ orientation = VERTICAL
+ )
+ val expectedBounds = Rect(center - width / 2, 0, center + width / 2, windowBounds.height())
+ assertEquals(expectedBounds.left, actual.bounds.left)
+ assertEquals(expectedBounds.right, actual.bounds.right)
+ assertEquals(expectedBounds.top, actual.bounds.top)
+ assertEquals(expectedBounds.bottom, actual.bounds.bottom)
+ assertTrue(actual.isSeparating)
+ assertEquals(FULL, actual.occlusionType)
+ assertEquals(VERTICAL, actual.orientation)
+ assertEquals(FLAT, actual.state)
+ }
+
+ @OptIn(ExperimentalCoroutinesApi::class, ExperimentalWindowApi::class)
+ @Test
+ public fun testFold_windowBoundsFromActivity() {
activityRule.scenario.onActivity { activity ->
- val metrics = WindowMetricsCalculator.getOrCreate()
+ val windowBounds = WindowMetricsCalculator.getOrCreate()
.computeCurrentWindowMetrics(activity)
- val bounds = metrics.bounds
- val center = bounds.centerX()
- val width = 20
- val actual = FoldingFeature(
- activity = activity,
- size = width,
- state = FLAT,
- orientation = VERTICAL
- )
- val expectedBounds = Rect(center - width / 2, 0, center + width / 2, bounds.height())
+ .bounds
+ val actual = FoldingFeature(activity = activity)
+ val expected = FoldingFeature(windowBounds = windowBounds)
+ val expectedBounds = expected.bounds
assertEquals(expectedBounds.left, actual.bounds.left)
assertEquals(expectedBounds.right, actual.bounds.right)
assertEquals(expectedBounds.top, actual.bounds.top)
assertEquals(expectedBounds.bottom, actual.bounds.bottom)
- assertTrue(actual.isSeparating)
- assertEquals(FULL, actual.occlusionType)
- assertEquals(VERTICAL, actual.orientation)
- assertEquals(FLAT, actual.state)
+ assertEquals(expected.isSeparating, actual.isSeparating)
+ assertEquals(expected.occlusionType, actual.occlusionType)
+ assertEquals(expected.orientation, actual.orientation)
+ assertEquals(expected.state, actual.state)
}
}
}
\ No newline at end of file
diff --git a/window/window-testing/src/main/java/androidx/window/testing/layout/DisplayFeatureTesting.kt b/window/window-testing/src/main/java/androidx/window/testing/layout/DisplayFeatureTesting.kt
index c9ee014..61c160a1 100644
--- a/window/window-testing/src/main/java/androidx/window/testing/layout/DisplayFeatureTesting.kt
+++ b/window/window-testing/src/main/java/androidx/window/testing/layout/DisplayFeatureTesting.kt
@@ -19,6 +19,7 @@
import android.app.Activity
import android.graphics.Rect
+import androidx.window.core.ExperimentalWindowApi
import androidx.window.layout.FoldingFeature
import androidx.window.layout.FoldingFeature.OcclusionType.Companion.FULL
import androidx.window.layout.FoldingFeature.OcclusionType.Companion.NONE
@@ -59,11 +60,41 @@
state: State = HALF_OPENED,
orientation: Orientation = HORIZONTAL
): FoldingFeature {
+ val metricsCalculator = WindowMetricsCalculator.getOrCreate()
+ val windowBounds = metricsCalculator.computeCurrentWindowMetrics(activity).bounds
+ return foldingFeatureInternal(
+ windowBounds = windowBounds,
+ center = center,
+ size = size,
+ state = state,
+ orientation = orientation
+ )
+}
+
+@Suppress("FunctionName")
+@JvmOverloads
+@JvmName("createFoldingFeature")
+@ExperimentalWindowApi
+fun FoldingFeature(
+ windowBounds: Rect,
+ center: Int = -1,
+ size: Int = 0,
+ state: State = HALF_OPENED,
+ orientation: Orientation = HORIZONTAL
+): FoldingFeature {
+ return foldingFeatureInternal(windowBounds, center, size, state, orientation)
+}
+
+private fun foldingFeatureInternal(
+ windowBounds: Rect,
+ center: Int = -1,
+ size: Int = 0,
+ state: State = HALF_OPENED,
+ orientation: Orientation = HORIZONTAL
+): FoldingFeature {
val shouldTreatAsHinge = size != 0
val isSeparating = shouldTreatAsHinge || state == HALF_OPENED
val offset = size / 2
- val metricsCalculator = WindowMetricsCalculator.getOrCreate()
- val windowBounds = metricsCalculator.computeCurrentWindowMetrics(activity).bounds
val actualCenter = if (center < 0) {
when (orientation) {
HORIZONTAL -> windowBounds.centerY()
@@ -75,12 +106,11 @@
}
val start = actualCenter - offset
val end = actualCenter + offset
- val metrics = WindowMetricsCalculator.getOrCreate().computeCurrentWindowMetrics(activity)
val bounds = if (orientation == VERTICAL) {
- val windowHeight = metrics.bounds.height()
+ val windowHeight = windowBounds.height()
Rect(start, 0, end, windowHeight)
} else {
- val windowWidth = metrics.bounds.width()
+ val windowWidth = windowBounds.width()
Rect(0, start, windowWidth, end)
}
val occlusionType = if (shouldTreatAsHinge) {
diff --git a/window/window/api/public_plus_experimental_1.0.0-beta01.txt b/window/window/api/public_plus_experimental_1.0.0-beta01.txt
index f87dfd1..125d6da 100644
--- a/window/window/api/public_plus_experimental_1.0.0-beta01.txt
+++ b/window/window/api/public_plus_experimental_1.0.0-beta01.txt
@@ -1,4 +1,11 @@
// Signature format: 4.0
+package androidx.window.core {
+
+ @kotlin.RequiresOptIn(level=kotlin.RequiresOptIn.Level) @kotlin.annotation.MustBeDocumented @kotlin.annotation.Retention(kotlin.annotation.AnnotationRetention) public @interface ExperimentalWindowApi {
+ }
+
+}
+
package androidx.window.layout {
public interface DisplayFeature {
diff --git a/window/window/api/public_plus_experimental_current.txt b/window/window/api/public_plus_experimental_current.txt
index f87dfd1..125d6da 100644
--- a/window/window/api/public_plus_experimental_current.txt
+++ b/window/window/api/public_plus_experimental_current.txt
@@ -1,4 +1,11 @@
// Signature format: 4.0
+package androidx.window.core {
+
+ @kotlin.RequiresOptIn(level=kotlin.RequiresOptIn.Level) @kotlin.annotation.MustBeDocumented @kotlin.annotation.Retention(kotlin.annotation.AnnotationRetention) public @interface ExperimentalWindowApi {
+ }
+
+}
+
package androidx.window.layout {
public interface DisplayFeature {
diff --git a/window/window/src/androidTest/java/androidx/window/layout/ExtensionTest.kt b/window/window/src/androidTest/java/androidx/window/layout/ExtensionTest.kt
index 494c133..ee4a1b3 100644
--- a/window/window/src/androidTest/java/androidx/window/layout/ExtensionTest.kt
+++ b/window/window/src/androidTest/java/androidx/window/layout/ExtensionTest.kt
@@ -31,7 +31,7 @@
import androidx.window.TestConfigChangeHandlingActivity
import androidx.window.WindowTestBase
import androidx.window.core.Version
-import androidx.window.extensions.ExtensionFoldingFeature
+import androidx.window.extensions.layout.FoldingFeature as ExtensionFoldingFeature
import androidx.window.layout.ExtensionInterfaceCompat.ExtensionCallbackInterface
import com.nhaarman.mockitokotlin2.any
import com.nhaarman.mockitokotlin2.argThat
@@ -257,7 +257,7 @@
private companion object {
private fun isValid(activity: TestActivity, displayFeature: DisplayFeature): Boolean {
- if (displayFeature !is FoldingFeature) {
+ if (displayFeature as? FoldingFeature == null) {
return false
}
val featureRect: Rect = displayFeature.bounds
diff --git a/development/project-creator/compose-template/groupId/artifactId/src/main/groupId/package-info.java b/window/window/src/main/java/androidx/window/core/ExperimentalWindowApi.kt
similarity index 69%
copy from development/project-creator/compose-template/groupId/artifactId/src/main/groupId/package-info.java
copy to window/window/src/main/java/androidx/window/core/ExperimentalWindowApi.kt
index a51e68c..686d49a 100644
--- a/development/project-creator/compose-template/groupId/artifactId/src/main/groupId/package-info.java
+++ b/window/window/src/main/java/androidx/window/core/ExperimentalWindowApi.kt
@@ -1,5 +1,5 @@
/*
- * Copyright (C) <YEAR> The Android Open Source Project
+ * Copyright 2021 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -14,7 +14,9 @@
* limitations under the License.
*/
-/**
- * Insert package level documentation here
- */
-package <PACKAGE>;
+package androidx.window.core
+
+@MustBeDocumented
+@Retention(value = AnnotationRetention.BINARY)
+@RequiresOptIn(level = RequiresOptIn.Level.WARNING)
+public annotation class ExperimentalWindowApi
\ No newline at end of file
diff --git a/work/buildSrc b/work/buildSrc
new file mode 120000
index 0000000..053a423
--- /dev/null
+++ b/work/buildSrc
@@ -0,0 +1 @@
+../buildSrc
\ No newline at end of file
diff --git a/work/buildSrc/build.gradle b/work/buildSrc/build.gradle
deleted file mode 100644
index 2a9efcc..0000000
--- a/work/buildSrc/build.gradle
+++ /dev/null
@@ -1,17 +0,0 @@
-apply plugin: "java-gradle-plugin"
-
-sourceSets {
- main.java.srcDirs += "${supportRootFolder}/inspection/inspection-gradle-plugin/src/main/kotlin"
- main.resources.srcDirs += "${supportRootFolder}/inspection/inspection-gradle-plugin/src/main" +
- "/resources"
-}
-
-gradlePlugin {
- plugins {
- inspection {
- id = "androidx.inspection"
- implementationClass = "androidx.inspection.gradle.InspectionPlugin"
- }
- }
-}
-
diff --git a/work/workmanager-benchmark/build.gradle b/work/work-benchmark/build.gradle
similarity index 100%
rename from work/workmanager-benchmark/build.gradle
rename to work/work-benchmark/build.gradle
diff --git a/work/workmanager-benchmark/src/androidTest/AndroidManifest.xml b/work/work-benchmark/src/androidTest/AndroidManifest.xml
similarity index 72%
rename from work/workmanager-benchmark/src/androidTest/AndroidManifest.xml
rename to work/work-benchmark/src/androidTest/AndroidManifest.xml
index f48b579..f07f839 100644
--- a/work/workmanager-benchmark/src/androidTest/AndroidManifest.xml
+++ b/work/work-benchmark/src/androidTest/AndroidManifest.xml
@@ -15,15 +15,9 @@
~ limitations under the License.
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:tools="http://schemas.android.com/tools"
package="androidx.work.benchmark.test">
-
- <!-- Important: disable debuggable for accurate performance results -->
- <application
- android:debuggable="false"
- tools:replace="android:debuggable">
- <!-- enable profileableByShell for non-intrusive profiling tools -->
- <!--suppress AndroidElementNotAllowed -->
+ <application>
+ <!-- enable profiling by shell for non-intrusive profiling tools -->
<profileable android:shell="true"/>
</application>
</manifest>
diff --git a/work/workmanager-benchmark/src/androidTest/java/androidx/work/benchmark/DispatchingExecutor.kt b/work/work-benchmark/src/androidTest/java/androidx/work/benchmark/DispatchingExecutor.kt
similarity index 100%
rename from work/workmanager-benchmark/src/androidTest/java/androidx/work/benchmark/DispatchingExecutor.kt
rename to work/work-benchmark/src/androidTest/java/androidx/work/benchmark/DispatchingExecutor.kt
diff --git a/work/workmanager-benchmark/src/androidTest/java/androidx/work/benchmark/InitializeBenchmark.kt b/work/work-benchmark/src/androidTest/java/androidx/work/benchmark/InitializeBenchmark.kt
similarity index 100%
rename from work/workmanager-benchmark/src/androidTest/java/androidx/work/benchmark/InitializeBenchmark.kt
rename to work/work-benchmark/src/androidTest/java/androidx/work/benchmark/InitializeBenchmark.kt
diff --git a/work/workmanager-benchmark/src/androidTest/java/androidx/work/benchmark/MarshallingBenchmark.kt b/work/work-benchmark/src/androidTest/java/androidx/work/benchmark/MarshallingBenchmark.kt
similarity index 100%
rename from work/workmanager-benchmark/src/androidTest/java/androidx/work/benchmark/MarshallingBenchmark.kt
rename to work/work-benchmark/src/androidTest/java/androidx/work/benchmark/MarshallingBenchmark.kt
diff --git a/work/workmanager-benchmark/src/androidTest/java/androidx/work/benchmark/NoOpWorker.kt b/work/work-benchmark/src/androidTest/java/androidx/work/benchmark/NoOpWorker.kt
similarity index 100%
rename from work/workmanager-benchmark/src/androidTest/java/androidx/work/benchmark/NoOpWorker.kt
rename to work/work-benchmark/src/androidTest/java/androidx/work/benchmark/NoOpWorker.kt
diff --git a/work/workmanager-benchmark/src/main/AndroidManifest.xml b/work/work-benchmark/src/main/AndroidManifest.xml
similarity index 100%
rename from work/workmanager-benchmark/src/main/AndroidManifest.xml
rename to work/work-benchmark/src/main/AndroidManifest.xml
diff --git a/work/workmanager-gcm/api/2.2.0-beta01.txt b/work/work-gcm/api/2.2.0-beta01.txt
similarity index 100%
rename from work/workmanager-gcm/api/2.2.0-beta01.txt
rename to work/work-gcm/api/2.2.0-beta01.txt
diff --git a/work/workmanager-gcm/api/2.3.0-beta01.txt b/work/work-gcm/api/2.3.0-beta01.txt
similarity index 100%
rename from work/workmanager-gcm/api/2.3.0-beta01.txt
rename to work/work-gcm/api/2.3.0-beta01.txt
diff --git a/work/workmanager-gcm/api/2.3.0-beta02.txt b/work/work-gcm/api/2.3.0-beta02.txt
similarity index 100%
rename from work/workmanager-gcm/api/2.3.0-beta02.txt
rename to work/work-gcm/api/2.3.0-beta02.txt
diff --git a/work/workmanager-gcm/api/2.3.0-rc01.txt b/work/work-gcm/api/2.3.0-rc01.txt
similarity index 100%
rename from work/workmanager-gcm/api/2.3.0-rc01.txt
rename to work/work-gcm/api/2.3.0-rc01.txt
diff --git a/work/workmanager-gcm/api/2.4.0-beta01.txt b/work/work-gcm/api/2.4.0-beta01.txt
similarity index 100%
rename from work/workmanager-gcm/api/2.4.0-beta01.txt
rename to work/work-gcm/api/2.4.0-beta01.txt
diff --git a/work/workmanager-gcm/api/2.4.0-beta02.txt b/work/work-gcm/api/2.4.0-beta02.txt
similarity index 100%
rename from work/workmanager-gcm/api/2.4.0-beta02.txt
rename to work/work-gcm/api/2.4.0-beta02.txt
diff --git a/work/workmanager-gcm/api/2.4.0-rc01.txt b/work/work-gcm/api/2.4.0-rc01.txt
similarity index 100%
rename from work/workmanager-gcm/api/2.4.0-rc01.txt
rename to work/work-gcm/api/2.4.0-rc01.txt
diff --git a/work/workmanager-gcm/api/2.5.0-beta01.txt b/work/work-gcm/api/2.5.0-beta01.txt
similarity index 100%
rename from work/workmanager-gcm/api/2.5.0-beta01.txt
rename to work/work-gcm/api/2.5.0-beta01.txt
diff --git a/work/workmanager-gcm/api/2.5.0-beta02.txt b/work/work-gcm/api/2.5.0-beta02.txt
similarity index 100%
rename from work/workmanager-gcm/api/2.5.0-beta02.txt
rename to work/work-gcm/api/2.5.0-beta02.txt
diff --git a/work/workmanager-gcm/api/2.5.0-beta01.txt b/work/work-gcm/api/2.7.0-beta01.txt
similarity index 100%
copy from work/workmanager-gcm/api/2.5.0-beta01.txt
copy to work/work-gcm/api/2.7.0-beta01.txt
diff --git a/work/workmanager-gcm/api/current.txt b/work/work-gcm/api/current.txt
similarity index 100%
rename from work/workmanager-gcm/api/current.txt
rename to work/work-gcm/api/current.txt
diff --git a/work/workmanager-gcm/api/public_plus_experimental_2.2.0-beta01.txt b/work/work-gcm/api/public_plus_experimental_2.2.0-beta01.txt
similarity index 100%
rename from work/workmanager-gcm/api/public_plus_experimental_2.2.0-beta01.txt
rename to work/work-gcm/api/public_plus_experimental_2.2.0-beta01.txt
diff --git a/work/workmanager-gcm/api/public_plus_experimental_2.3.0-beta01.txt b/work/work-gcm/api/public_plus_experimental_2.3.0-beta01.txt
similarity index 100%
rename from work/workmanager-gcm/api/public_plus_experimental_2.3.0-beta01.txt
rename to work/work-gcm/api/public_plus_experimental_2.3.0-beta01.txt
diff --git a/work/workmanager-gcm/api/public_plus_experimental_2.3.0-beta02.txt b/work/work-gcm/api/public_plus_experimental_2.3.0-beta02.txt
similarity index 100%
rename from work/workmanager-gcm/api/public_plus_experimental_2.3.0-beta02.txt
rename to work/work-gcm/api/public_plus_experimental_2.3.0-beta02.txt
diff --git a/work/workmanager-gcm/api/public_plus_experimental_2.3.0-rc01.txt b/work/work-gcm/api/public_plus_experimental_2.3.0-rc01.txt
similarity index 100%
rename from work/workmanager-gcm/api/public_plus_experimental_2.3.0-rc01.txt
rename to work/work-gcm/api/public_plus_experimental_2.3.0-rc01.txt
diff --git a/work/workmanager-gcm/api/public_plus_experimental_2.4.0-beta01.txt b/work/work-gcm/api/public_plus_experimental_2.4.0-beta01.txt
similarity index 100%
rename from work/workmanager-gcm/api/public_plus_experimental_2.4.0-beta01.txt
rename to work/work-gcm/api/public_plus_experimental_2.4.0-beta01.txt
diff --git a/work/workmanager-gcm/api/public_plus_experimental_2.4.0-beta02.txt b/work/work-gcm/api/public_plus_experimental_2.4.0-beta02.txt
similarity index 100%
rename from work/workmanager-gcm/api/public_plus_experimental_2.4.0-beta02.txt
rename to work/work-gcm/api/public_plus_experimental_2.4.0-beta02.txt
diff --git a/work/workmanager-gcm/api/public_plus_experimental_2.4.0-rc01.txt b/work/work-gcm/api/public_plus_experimental_2.4.0-rc01.txt
similarity index 100%
rename from work/workmanager-gcm/api/public_plus_experimental_2.4.0-rc01.txt
rename to work/work-gcm/api/public_plus_experimental_2.4.0-rc01.txt
diff --git a/work/workmanager-gcm/api/public_plus_experimental_2.5.0-beta01.txt b/work/work-gcm/api/public_plus_experimental_2.5.0-beta01.txt
similarity index 100%
rename from work/workmanager-gcm/api/public_plus_experimental_2.5.0-beta01.txt
rename to work/work-gcm/api/public_plus_experimental_2.5.0-beta01.txt
diff --git a/work/workmanager-gcm/api/public_plus_experimental_2.5.0-beta02.txt b/work/work-gcm/api/public_plus_experimental_2.5.0-beta02.txt
similarity index 100%
rename from work/workmanager-gcm/api/public_plus_experimental_2.5.0-beta02.txt
rename to work/work-gcm/api/public_plus_experimental_2.5.0-beta02.txt
diff --git a/work/workmanager-gcm/api/2.5.0-beta01.txt b/work/work-gcm/api/public_plus_experimental_2.7.0-beta01.txt
similarity index 100%
copy from work/workmanager-gcm/api/2.5.0-beta01.txt
copy to work/work-gcm/api/public_plus_experimental_2.7.0-beta01.txt
diff --git a/work/workmanager-gcm/api/public_plus_experimental_current.txt b/work/work-gcm/api/public_plus_experimental_current.txt
similarity index 100%
rename from work/workmanager-gcm/api/public_plus_experimental_current.txt
rename to work/work-gcm/api/public_plus_experimental_current.txt
diff --git a/work/workmanager-gcm/api/res-2.2.0-beta01.txt b/work/work-gcm/api/res-2.2.0-beta01.txt
similarity index 100%
rename from work/workmanager-gcm/api/res-2.2.0-beta01.txt
rename to work/work-gcm/api/res-2.2.0-beta01.txt
diff --git a/work/workmanager-gcm/api/res-2.3.0-beta01.txt b/work/work-gcm/api/res-2.3.0-beta01.txt
similarity index 100%
rename from work/workmanager-gcm/api/res-2.3.0-beta01.txt
rename to work/work-gcm/api/res-2.3.0-beta01.txt
diff --git a/work/workmanager-gcm/api/res-2.3.0-beta02.txt b/work/work-gcm/api/res-2.3.0-beta02.txt
similarity index 100%
rename from work/workmanager-gcm/api/res-2.3.0-beta02.txt
rename to work/work-gcm/api/res-2.3.0-beta02.txt
diff --git a/work/workmanager-gcm/api/res-2.3.0-rc01.txt b/work/work-gcm/api/res-2.3.0-rc01.txt
similarity index 100%
rename from work/workmanager-gcm/api/res-2.3.0-rc01.txt
rename to work/work-gcm/api/res-2.3.0-rc01.txt
diff --git a/work/workmanager-gcm/api/res-2.4.0-beta01.txt b/work/work-gcm/api/res-2.4.0-beta01.txt
similarity index 100%
rename from work/workmanager-gcm/api/res-2.4.0-beta01.txt
rename to work/work-gcm/api/res-2.4.0-beta01.txt
diff --git a/work/workmanager-gcm/api/res-2.4.0-beta02.txt b/work/work-gcm/api/res-2.4.0-beta02.txt
similarity index 100%
rename from work/workmanager-gcm/api/res-2.4.0-beta02.txt
rename to work/work-gcm/api/res-2.4.0-beta02.txt
diff --git a/work/workmanager-gcm/api/res-2.4.0-rc01.txt b/work/work-gcm/api/res-2.4.0-rc01.txt
similarity index 100%
rename from work/workmanager-gcm/api/res-2.4.0-rc01.txt
rename to work/work-gcm/api/res-2.4.0-rc01.txt
diff --git a/work/workmanager-gcm/api/res-2.5.0-beta01.txt b/work/work-gcm/api/res-2.5.0-beta01.txt
similarity index 100%
rename from work/workmanager-gcm/api/res-2.5.0-beta01.txt
rename to work/work-gcm/api/res-2.5.0-beta01.txt
diff --git a/work/workmanager-gcm/api/res-2.5.0-beta02.txt b/work/work-gcm/api/res-2.5.0-beta02.txt
similarity index 100%
rename from work/workmanager-gcm/api/res-2.5.0-beta02.txt
rename to work/work-gcm/api/res-2.5.0-beta02.txt
diff --git a/work/workmanager-gcm/api/res-2.2.0-beta01.txt b/work/work-gcm/api/res-2.7.0-beta01.txt
similarity index 100%
copy from work/workmanager-gcm/api/res-2.2.0-beta01.txt
copy to work/work-gcm/api/res-2.7.0-beta01.txt
diff --git a/work/workmanager-gcm/api/res-current.txt b/work/work-gcm/api/res-current.txt
similarity index 100%
rename from work/workmanager-gcm/api/res-current.txt
rename to work/work-gcm/api/res-current.txt
diff --git a/work/workmanager-gcm/api/restricted_2.2.0-beta01.txt b/work/work-gcm/api/restricted_2.2.0-beta01.txt
similarity index 100%
rename from work/workmanager-gcm/api/restricted_2.2.0-beta01.txt
rename to work/work-gcm/api/restricted_2.2.0-beta01.txt
diff --git a/work/workmanager-gcm/api/restricted_2.3.0-beta01.txt b/work/work-gcm/api/restricted_2.3.0-beta01.txt
similarity index 100%
rename from work/workmanager-gcm/api/restricted_2.3.0-beta01.txt
rename to work/work-gcm/api/restricted_2.3.0-beta01.txt
diff --git a/work/workmanager-gcm/api/restricted_2.3.0-beta02.txt b/work/work-gcm/api/restricted_2.3.0-beta02.txt
similarity index 100%
rename from work/workmanager-gcm/api/restricted_2.3.0-beta02.txt
rename to work/work-gcm/api/restricted_2.3.0-beta02.txt
diff --git a/work/workmanager-gcm/api/restricted_2.3.0-rc01.txt b/work/work-gcm/api/restricted_2.3.0-rc01.txt
similarity index 100%
rename from work/workmanager-gcm/api/restricted_2.3.0-rc01.txt
rename to work/work-gcm/api/restricted_2.3.0-rc01.txt
diff --git a/work/workmanager-gcm/api/restricted_2.4.0-beta01.txt b/work/work-gcm/api/restricted_2.4.0-beta01.txt
similarity index 100%
rename from work/workmanager-gcm/api/restricted_2.4.0-beta01.txt
rename to work/work-gcm/api/restricted_2.4.0-beta01.txt
diff --git a/work/workmanager-gcm/api/restricted_2.4.0-beta02.txt b/work/work-gcm/api/restricted_2.4.0-beta02.txt
similarity index 100%
rename from work/workmanager-gcm/api/restricted_2.4.0-beta02.txt
rename to work/work-gcm/api/restricted_2.4.0-beta02.txt
diff --git a/work/workmanager-gcm/api/restricted_2.4.0-rc01.txt b/work/work-gcm/api/restricted_2.4.0-rc01.txt
similarity index 100%
rename from work/workmanager-gcm/api/restricted_2.4.0-rc01.txt
rename to work/work-gcm/api/restricted_2.4.0-rc01.txt
diff --git a/work/workmanager-gcm/api/restricted_2.5.0-beta01.txt b/work/work-gcm/api/restricted_2.5.0-beta01.txt
similarity index 100%
rename from work/workmanager-gcm/api/restricted_2.5.0-beta01.txt
rename to work/work-gcm/api/restricted_2.5.0-beta01.txt
diff --git a/work/workmanager-gcm/api/restricted_2.5.0-beta02.txt b/work/work-gcm/api/restricted_2.5.0-beta02.txt
similarity index 100%
rename from work/workmanager-gcm/api/restricted_2.5.0-beta02.txt
rename to work/work-gcm/api/restricted_2.5.0-beta02.txt
diff --git a/work/workmanager-gcm/api/2.5.0-beta01.txt b/work/work-gcm/api/restricted_2.7.0-beta01.txt
similarity index 100%
copy from work/workmanager-gcm/api/2.5.0-beta01.txt
copy to work/work-gcm/api/restricted_2.7.0-beta01.txt
diff --git a/work/workmanager-gcm/api/restricted_current.txt b/work/work-gcm/api/restricted_current.txt
similarity index 100%
rename from work/workmanager-gcm/api/restricted_current.txt
rename to work/work-gcm/api/restricted_current.txt
diff --git a/work/workmanager-gcm/build.gradle b/work/work-gcm/build.gradle
similarity index 100%
rename from work/workmanager-gcm/build.gradle
rename to work/work-gcm/build.gradle
diff --git a/work/workmanager-gcm/lint-baseline.xml b/work/work-gcm/lint-baseline.xml
similarity index 100%
rename from work/workmanager-gcm/lint-baseline.xml
rename to work/work-gcm/lint-baseline.xml
diff --git a/work/workmanager-gcm/proguard-rules.pro b/work/work-gcm/proguard-rules.pro
similarity index 100%
rename from work/workmanager-gcm/proguard-rules.pro
rename to work/work-gcm/proguard-rules.pro
diff --git a/work/workmanager-gcm/src/androidTest/java/androidx/work/impl/background/gcm/GcmTaskConverterTest.kt b/work/work-gcm/src/androidTest/java/androidx/work/impl/background/gcm/GcmTaskConverterTest.kt
similarity index 100%
rename from work/workmanager-gcm/src/androidTest/java/androidx/work/impl/background/gcm/GcmTaskConverterTest.kt
rename to work/work-gcm/src/androidTest/java/androidx/work/impl/background/gcm/GcmTaskConverterTest.kt
diff --git a/work/workmanager-gcm/src/androidTest/java/androidx/work/impl/background/gcm/TestWorker.kt b/work/work-gcm/src/androidTest/java/androidx/work/impl/background/gcm/TestWorker.kt
similarity index 100%
rename from work/workmanager-gcm/src/androidTest/java/androidx/work/impl/background/gcm/TestWorker.kt
rename to work/work-gcm/src/androidTest/java/androidx/work/impl/background/gcm/TestWorker.kt
diff --git a/work/workmanager-gcm/src/androidTest/java/androidx/work/impl/background/gcm/WorkManagerGcmDispatcherTest.kt b/work/work-gcm/src/androidTest/java/androidx/work/impl/background/gcm/WorkManagerGcmDispatcherTest.kt
similarity index 100%
rename from work/workmanager-gcm/src/androidTest/java/androidx/work/impl/background/gcm/WorkManagerGcmDispatcherTest.kt
rename to work/work-gcm/src/androidTest/java/androidx/work/impl/background/gcm/WorkManagerGcmDispatcherTest.kt
diff --git a/work/workmanager-gcm/src/androidTest/res/values/values.xml b/work/work-gcm/src/androidTest/res/values/values.xml
similarity index 100%
rename from work/workmanager-gcm/src/androidTest/res/values/values.xml
rename to work/work-gcm/src/androidTest/res/values/values.xml
diff --git a/work/workmanager-gcm/src/main/AndroidManifest.xml b/work/work-gcm/src/main/AndroidManifest.xml
similarity index 100%
rename from work/workmanager-gcm/src/main/AndroidManifest.xml
rename to work/work-gcm/src/main/AndroidManifest.xml
diff --git a/work/workmanager-gcm/src/main/java/androidx/work/impl/background/gcm/GcmScheduler.java b/work/work-gcm/src/main/java/androidx/work/impl/background/gcm/GcmScheduler.java
similarity index 100%
rename from work/workmanager-gcm/src/main/java/androidx/work/impl/background/gcm/GcmScheduler.java
rename to work/work-gcm/src/main/java/androidx/work/impl/background/gcm/GcmScheduler.java
diff --git a/work/workmanager-gcm/src/main/java/androidx/work/impl/background/gcm/GcmTaskConverter.java b/work/work-gcm/src/main/java/androidx/work/impl/background/gcm/GcmTaskConverter.java
similarity index 100%
rename from work/workmanager-gcm/src/main/java/androidx/work/impl/background/gcm/GcmTaskConverter.java
rename to work/work-gcm/src/main/java/androidx/work/impl/background/gcm/GcmTaskConverter.java
diff --git a/work/workmanager-gcm/src/main/java/androidx/work/impl/background/gcm/WorkManagerGcmDispatcher.java b/work/work-gcm/src/main/java/androidx/work/impl/background/gcm/WorkManagerGcmDispatcher.java
similarity index 100%
rename from work/workmanager-gcm/src/main/java/androidx/work/impl/background/gcm/WorkManagerGcmDispatcher.java
rename to work/work-gcm/src/main/java/androidx/work/impl/background/gcm/WorkManagerGcmDispatcher.java
diff --git a/work/workmanager-gcm/src/main/java/androidx/work/impl/background/gcm/WorkManagerGcmService.java b/work/work-gcm/src/main/java/androidx/work/impl/background/gcm/WorkManagerGcmService.java
similarity index 100%
rename from work/workmanager-gcm/src/main/java/androidx/work/impl/background/gcm/WorkManagerGcmService.java
rename to work/work-gcm/src/main/java/androidx/work/impl/background/gcm/WorkManagerGcmService.java
diff --git a/work/workmanager-gcm/src/main/java/androidx/work/impl/background/gcm/package-info.java b/work/work-gcm/src/main/java/androidx/work/impl/background/gcm/package-info.java
similarity index 100%
rename from work/workmanager-gcm/src/main/java/androidx/work/impl/background/gcm/package-info.java
rename to work/work-gcm/src/main/java/androidx/work/impl/background/gcm/package-info.java
diff --git a/work/workmanager-gcm/src/main/res/values-v23/values.xml b/work/work-gcm/src/main/res/values-v23/values.xml
similarity index 100%
rename from work/workmanager-gcm/src/main/res/values-v23/values.xml
rename to work/work-gcm/src/main/res/values-v23/values.xml
diff --git a/work/workmanager-gcm/src/main/res/values/values.xml b/work/work-gcm/src/main/res/values/values.xml
similarity index 100%
rename from work/workmanager-gcm/src/main/res/values/values.xml
rename to work/work-gcm/src/main/res/values/values.xml
diff --git a/work/workmanager-inspection/build.gradle b/work/work-inspection/build.gradle
similarity index 100%
rename from work/workmanager-inspection/build.gradle
rename to work/work-inspection/build.gradle
diff --git a/work/work-inspection/lint-baseline.xml b/work/work-inspection/lint-baseline.xml
new file mode 100644
index 0000000..db38526
--- /dev/null
+++ b/work/work-inspection/lint-baseline.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<issues format="6" by="lint 7.1.0-alpha07" type="baseline" client="gradle" dependencies="false" name="AGP (7.1.0-alpha07)" variant="all" version="7.1.0-alpha07">
+
+ <issue
+ id="RemoveWorkManagerInitializer"
+ message="Remove androidx.work.WorkManagerInitializer from your AndroidManifest.xml when using on-demand initialization.">
+ <location
+ file="work-inspection"/>
+ </issue>
+
+</issues>
diff --git a/work/workmanager-inspection/src/androidTest/AndroidManifest.xml b/work/work-inspection/src/androidTest/AndroidManifest.xml
similarity index 100%
rename from work/workmanager-inspection/src/androidTest/AndroidManifest.xml
rename to work/work-inspection/src/androidTest/AndroidManifest.xml
diff --git a/work/workmanager-inspection/src/androidTest/java/androidx/work/inspection/BasicTest.kt b/work/work-inspection/src/androidTest/java/androidx/work/inspection/BasicTest.kt
similarity index 100%
rename from work/workmanager-inspection/src/androidTest/java/androidx/work/inspection/BasicTest.kt
rename to work/work-inspection/src/androidTest/java/androidx/work/inspection/BasicTest.kt
diff --git a/work/workmanager-inspection/src/androidTest/java/androidx/work/inspection/DispatchingExecutor.kt b/work/work-inspection/src/androidTest/java/androidx/work/inspection/DispatchingExecutor.kt
similarity index 100%
rename from work/workmanager-inspection/src/androidTest/java/androidx/work/inspection/DispatchingExecutor.kt
rename to work/work-inspection/src/androidTest/java/androidx/work/inspection/DispatchingExecutor.kt
diff --git a/work/workmanager-inspection/src/androidTest/java/androidx/work/inspection/InspectorApp.kt b/work/work-inspection/src/androidTest/java/androidx/work/inspection/InspectorApp.kt
similarity index 100%
rename from work/workmanager-inspection/src/androidTest/java/androidx/work/inspection/InspectorApp.kt
rename to work/work-inspection/src/androidTest/java/androidx/work/inspection/InspectorApp.kt
diff --git a/work/workmanager-inspection/src/androidTest/java/androidx/work/inspection/WorkInfoTest.kt b/work/work-inspection/src/androidTest/java/androidx/work/inspection/WorkInfoTest.kt
similarity index 100%
rename from work/workmanager-inspection/src/androidTest/java/androidx/work/inspection/WorkInfoTest.kt
rename to work/work-inspection/src/androidTest/java/androidx/work/inspection/WorkInfoTest.kt
diff --git a/work/workmanager-inspection/src/androidTest/java/androidx/work/inspection/WorkManagerInspectorTestEnvironment.kt b/work/work-inspection/src/androidTest/java/androidx/work/inspection/WorkManagerInspectorTestEnvironment.kt
similarity index 100%
rename from work/workmanager-inspection/src/androidTest/java/androidx/work/inspection/WorkManagerInspectorTestEnvironment.kt
rename to work/work-inspection/src/androidTest/java/androidx/work/inspection/WorkManagerInspectorTestEnvironment.kt
diff --git a/work/workmanager-inspection/src/androidTest/java/androidx/work/inspection/worker/EmptyWorker.kt b/work/work-inspection/src/androidTest/java/androidx/work/inspection/worker/EmptyWorker.kt
similarity index 100%
rename from work/workmanager-inspection/src/androidTest/java/androidx/work/inspection/worker/EmptyWorker.kt
rename to work/work-inspection/src/androidTest/java/androidx/work/inspection/worker/EmptyWorker.kt
diff --git a/work/workmanager-inspection/src/androidTest/java/androidx/work/inspection/worker/IdleWorker.kt b/work/work-inspection/src/androidTest/java/androidx/work/inspection/worker/IdleWorker.kt
similarity index 100%
rename from work/workmanager-inspection/src/androidTest/java/androidx/work/inspection/worker/IdleWorker.kt
rename to work/work-inspection/src/androidTest/java/androidx/work/inspection/worker/IdleWorker.kt
diff --git a/work/workmanager-inspection/src/main/AndroidManifest.xml b/work/work-inspection/src/main/AndroidManifest.xml
similarity index 100%
rename from work/workmanager-inspection/src/main/AndroidManifest.xml
rename to work/work-inspection/src/main/AndroidManifest.xml
diff --git a/work/workmanager-inspection/src/main/java/androidx/work/inspection/WorkManagerInspector.kt b/work/work-inspection/src/main/java/androidx/work/inspection/WorkManagerInspector.kt
similarity index 100%
rename from work/workmanager-inspection/src/main/java/androidx/work/inspection/WorkManagerInspector.kt
rename to work/work-inspection/src/main/java/androidx/work/inspection/WorkManagerInspector.kt
diff --git a/work/workmanager-inspection/src/main/java/androidx/work/inspection/WorkManagerInspectorFactory.kt b/work/work-inspection/src/main/java/androidx/work/inspection/WorkManagerInspectorFactory.kt
similarity index 100%
rename from work/workmanager-inspection/src/main/java/androidx/work/inspection/WorkManagerInspectorFactory.kt
rename to work/work-inspection/src/main/java/androidx/work/inspection/WorkManagerInspectorFactory.kt
diff --git a/work/workmanager-inspection/src/main/java/androidx/work/inspection/WorkManagerProtoConversionUtil.kt b/work/work-inspection/src/main/java/androidx/work/inspection/WorkManagerProtoConversionUtil.kt
similarity index 100%
rename from work/workmanager-inspection/src/main/java/androidx/work/inspection/WorkManagerProtoConversionUtil.kt
rename to work/work-inspection/src/main/java/androidx/work/inspection/WorkManagerProtoConversionUtil.kt
diff --git a/work/workmanager-inspection/src/main/proto/workmanager_protocol.proto b/work/work-inspection/src/main/proto/workmanager_protocol.proto
similarity index 100%
rename from work/workmanager-inspection/src/main/proto/workmanager_protocol.proto
rename to work/work-inspection/src/main/proto/workmanager_protocol.proto
diff --git a/work/workmanager-inspection/src/main/resources/META-INF/services/androidx.inspection.InspectorFactory b/work/work-inspection/src/main/resources/META-INF/services/androidx.inspection.InspectorFactory
similarity index 100%
rename from work/workmanager-inspection/src/main/resources/META-INF/services/androidx.inspection.InspectorFactory
rename to work/work-inspection/src/main/resources/META-INF/services/androidx.inspection.InspectorFactory
diff --git a/work/workmanager-lint/build.gradle b/work/work-lint/build.gradle
similarity index 100%
rename from work/workmanager-lint/build.gradle
rename to work/work-lint/build.gradle
diff --git a/work/workmanager-lint/src/main/java/androidx/work/lint/BadConfigurationProviderIssueDetector.kt b/work/work-lint/src/main/java/androidx/work/lint/BadConfigurationProviderIssueDetector.kt
similarity index 100%
rename from work/workmanager-lint/src/main/java/androidx/work/lint/BadConfigurationProviderIssueDetector.kt
rename to work/work-lint/src/main/java/androidx/work/lint/BadConfigurationProviderIssueDetector.kt
diff --git a/work/workmanager-lint/src/main/java/androidx/work/lint/IdleBatteryChargingConstraintsDetector.kt b/work/work-lint/src/main/java/androidx/work/lint/IdleBatteryChargingConstraintsDetector.kt
similarity index 100%
rename from work/workmanager-lint/src/main/java/androidx/work/lint/IdleBatteryChargingConstraintsDetector.kt
rename to work/work-lint/src/main/java/androidx/work/lint/IdleBatteryChargingConstraintsDetector.kt
diff --git a/work/workmanager-lint/src/main/java/androidx/work/lint/InvalidPeriodicWorkRequestIntervalDetector.kt b/work/work-lint/src/main/java/androidx/work/lint/InvalidPeriodicWorkRequestIntervalDetector.kt
similarity index 100%
rename from work/workmanager-lint/src/main/java/androidx/work/lint/InvalidPeriodicWorkRequestIntervalDetector.kt
rename to work/work-lint/src/main/java/androidx/work/lint/InvalidPeriodicWorkRequestIntervalDetector.kt
diff --git a/work/workmanager-lint/src/main/java/androidx/work/lint/PeriodicEnqueueIssueDetector.kt b/work/work-lint/src/main/java/androidx/work/lint/PeriodicEnqueueIssueDetector.kt
similarity index 100%
rename from work/workmanager-lint/src/main/java/androidx/work/lint/PeriodicEnqueueIssueDetector.kt
rename to work/work-lint/src/main/java/androidx/work/lint/PeriodicEnqueueIssueDetector.kt
diff --git a/work/workmanager-lint/src/main/java/androidx/work/lint/RemoveWorkManagerInitializerDetector.kt b/work/work-lint/src/main/java/androidx/work/lint/RemoveWorkManagerInitializerDetector.kt
similarity index 100%
rename from work/workmanager-lint/src/main/java/androidx/work/lint/RemoveWorkManagerInitializerDetector.kt
rename to work/work-lint/src/main/java/androidx/work/lint/RemoveWorkManagerInitializerDetector.kt
diff --git a/work/workmanager-lint/src/main/java/androidx/work/lint/RxWorkerSetProgressDetector.kt b/work/work-lint/src/main/java/androidx/work/lint/RxWorkerSetProgressDetector.kt
similarity index 100%
rename from work/workmanager-lint/src/main/java/androidx/work/lint/RxWorkerSetProgressDetector.kt
rename to work/work-lint/src/main/java/androidx/work/lint/RxWorkerSetProgressDetector.kt
diff --git a/work/workmanager-lint/src/main/java/androidx/work/lint/SpecifyForegroundServiceTypeIssueDetector.kt b/work/work-lint/src/main/java/androidx/work/lint/SpecifyForegroundServiceTypeIssueDetector.kt
similarity index 100%
rename from work/workmanager-lint/src/main/java/androidx/work/lint/SpecifyForegroundServiceTypeIssueDetector.kt
rename to work/work-lint/src/main/java/androidx/work/lint/SpecifyForegroundServiceTypeIssueDetector.kt
diff --git a/work/workmanager-lint/src/main/java/androidx/work/lint/SpecifyJobSchedulerIdRangeIssueDetector.kt b/work/work-lint/src/main/java/androidx/work/lint/SpecifyJobSchedulerIdRangeIssueDetector.kt
similarity index 100%
rename from work/workmanager-lint/src/main/java/androidx/work/lint/SpecifyJobSchedulerIdRangeIssueDetector.kt
rename to work/work-lint/src/main/java/androidx/work/lint/SpecifyJobSchedulerIdRangeIssueDetector.kt
diff --git a/work/workmanager-lint/src/main/java/androidx/work/lint/WorkManagerIssueRegistry.kt b/work/work-lint/src/main/java/androidx/work/lint/WorkManagerIssueRegistry.kt
similarity index 97%
rename from work/workmanager-lint/src/main/java/androidx/work/lint/WorkManagerIssueRegistry.kt
rename to work/work-lint/src/main/java/androidx/work/lint/WorkManagerIssueRegistry.kt
index b2f4b69..370a2cf 100644
--- a/work/workmanager-lint/src/main/java/androidx/work/lint/WorkManagerIssueRegistry.kt
+++ b/work/work-lint/src/main/java/androidx/work/lint/WorkManagerIssueRegistry.kt
@@ -24,7 +24,7 @@
class WorkManagerIssueRegistry : IssueRegistry() {
override val minApi = CURRENT_API
- override val api = 10
+ override val api = 11
override val issues: List<Issue> = listOf(
BadConfigurationProviderIssueDetector.ISSUE,
IdleBatteryChargingConstraintsDetector.ISSUE,
diff --git a/work/workmanager-lint/src/main/java/androidx/work/lint/WorkerHasPublicModifierDetector.kt b/work/work-lint/src/main/java/androidx/work/lint/WorkerHasPublicModifierDetector.kt
similarity index 100%
rename from work/workmanager-lint/src/main/java/androidx/work/lint/WorkerHasPublicModifierDetector.kt
rename to work/work-lint/src/main/java/androidx/work/lint/WorkerHasPublicModifierDetector.kt
diff --git a/work/workmanager-lint/src/main/resources/META-INF/services/com.android.tools.lint.client.api.IssueRegistry b/work/work-lint/src/main/resources/META-INF/services/com.android.tools.lint.client.api.IssueRegistry
similarity index 100%
rename from work/workmanager-lint/src/main/resources/META-INF/services/com.android.tools.lint.client.api.IssueRegistry
rename to work/work-lint/src/main/resources/META-INF/services/com.android.tools.lint.client.api.IssueRegistry
diff --git a/work/workmanager-lint/src/test/java/androidx/work/lint/ApiLintVersionsTest.kt b/work/work-lint/src/test/java/androidx/work/lint/ApiLintVersionsTest.kt
similarity index 100%
rename from work/workmanager-lint/src/test/java/androidx/work/lint/ApiLintVersionsTest.kt
rename to work/work-lint/src/test/java/androidx/work/lint/ApiLintVersionsTest.kt
diff --git a/work/workmanager-lint/src/test/java/androidx/work/lint/BadConfigurationProviderTest.kt b/work/work-lint/src/test/java/androidx/work/lint/BadConfigurationProviderTest.kt
similarity index 100%
rename from work/workmanager-lint/src/test/java/androidx/work/lint/BadConfigurationProviderTest.kt
rename to work/work-lint/src/test/java/androidx/work/lint/BadConfigurationProviderTest.kt
diff --git a/work/workmanager-lint/src/test/java/androidx/work/lint/IdleBatteryChargingConstraintsDetectorTest.kt b/work/work-lint/src/test/java/androidx/work/lint/IdleBatteryChargingConstraintsDetectorTest.kt
similarity index 98%
rename from work/workmanager-lint/src/test/java/androidx/work/lint/IdleBatteryChargingConstraintsDetectorTest.kt
rename to work/work-lint/src/test/java/androidx/work/lint/IdleBatteryChargingConstraintsDetectorTest.kt
index 16babb0..02ae6d1 100644
--- a/work/workmanager-lint/src/test/java/androidx/work/lint/IdleBatteryChargingConstraintsDetectorTest.kt
+++ b/work/work-lint/src/test/java/androidx/work/lint/IdleBatteryChargingConstraintsDetectorTest.kt
@@ -19,6 +19,7 @@
import androidx.work.lint.Stubs.CONSTRAINTS
import com.android.tools.lint.checks.infrastructure.LintDetectorTest.kotlin
import com.android.tools.lint.checks.infrastructure.TestLintTask.lint
+import org.junit.Ignore
import org.junit.Test
class IdleBatteryChargingConstraintsDetectorTest {
@@ -146,6 +147,7 @@
.expectClean()
}
+ @Ignore("b/196831196")
@Test
fun noWarningsWhenSeparateConstraints() {
val customApplication = kotlin(
diff --git a/work/workmanager-lint/src/test/java/androidx/work/lint/InvalidPeriodicWorkRequestIntervalDetectorTest.kt b/work/work-lint/src/test/java/androidx/work/lint/InvalidPeriodicWorkRequestIntervalDetectorTest.kt
similarity index 99%
rename from work/workmanager-lint/src/test/java/androidx/work/lint/InvalidPeriodicWorkRequestIntervalDetectorTest.kt
rename to work/work-lint/src/test/java/androidx/work/lint/InvalidPeriodicWorkRequestIntervalDetectorTest.kt
index e0508e3..b109b25 100644
--- a/work/workmanager-lint/src/test/java/androidx/work/lint/InvalidPeriodicWorkRequestIntervalDetectorTest.kt
+++ b/work/work-lint/src/test/java/androidx/work/lint/InvalidPeriodicWorkRequestIntervalDetectorTest.kt
@@ -20,6 +20,7 @@
import androidx.work.lint.Stubs.PERIODIC_WORK_REQUEST
import com.android.tools.lint.checks.infrastructure.LintDetectorTest.kotlin
import com.android.tools.lint.checks.infrastructure.TestLintTask.lint
+import org.junit.Ignore
import org.junit.Test
class InvalidPeriodicWorkRequestIntervalDetectorTest {
@@ -118,6 +119,7 @@
.expectClean()
}
+ @Ignore("b/196831196")
@Test
fun testWithInvalidDurationType() {
val worker = kotlin(
diff --git a/work/workmanager-lint/src/test/java/androidx/work/lint/PeriodicEnqueueIssueDetectorTest.kt b/work/work-lint/src/test/java/androidx/work/lint/PeriodicEnqueueIssueDetectorTest.kt
similarity index 100%
rename from work/workmanager-lint/src/test/java/androidx/work/lint/PeriodicEnqueueIssueDetectorTest.kt
rename to work/work-lint/src/test/java/androidx/work/lint/PeriodicEnqueueIssueDetectorTest.kt
diff --git a/work/workmanager-lint/src/test/java/androidx/work/lint/RemoveWorkManagerInitializerDetectorTest.kt b/work/work-lint/src/test/java/androidx/work/lint/RemoveWorkManagerInitializerDetectorTest.kt
similarity index 100%
rename from work/workmanager-lint/src/test/java/androidx/work/lint/RemoveWorkManagerInitializerDetectorTest.kt
rename to work/work-lint/src/test/java/androidx/work/lint/RemoveWorkManagerInitializerDetectorTest.kt
diff --git a/work/workmanager-lint/src/test/java/androidx/work/lint/RxWorkerSetProgressDetectorTest.kt b/work/work-lint/src/test/java/androidx/work/lint/RxWorkerSetProgressDetectorTest.kt
similarity index 100%
rename from work/workmanager-lint/src/test/java/androidx/work/lint/RxWorkerSetProgressDetectorTest.kt
rename to work/work-lint/src/test/java/androidx/work/lint/RxWorkerSetProgressDetectorTest.kt
diff --git a/work/workmanager-lint/src/test/java/androidx/work/lint/SpecifyForegroundServiceTypeIssueDetectorTest.kt b/work/work-lint/src/test/java/androidx/work/lint/SpecifyForegroundServiceTypeIssueDetectorTest.kt
similarity index 98%
rename from work/workmanager-lint/src/test/java/androidx/work/lint/SpecifyForegroundServiceTypeIssueDetectorTest.kt
rename to work/work-lint/src/test/java/androidx/work/lint/SpecifyForegroundServiceTypeIssueDetectorTest.kt
index fcc25223..b2a8fd2 100644
--- a/work/workmanager-lint/src/test/java/androidx/work/lint/SpecifyForegroundServiceTypeIssueDetectorTest.kt
+++ b/work/work-lint/src/test/java/androidx/work/lint/SpecifyForegroundServiceTypeIssueDetectorTest.kt
@@ -21,9 +21,11 @@
import com.android.tools.lint.checks.infrastructure.LintDetectorTest.kotlin
import com.android.tools.lint.checks.infrastructure.LintDetectorTest.manifest
import com.android.tools.lint.checks.infrastructure.TestLintTask.lint
+import org.junit.Ignore
import org.junit.Test
class SpecifyForegroundServiceTypeIssueDetectorTest {
+ @Ignore("b/196831196")
@Test
fun failWhenServiceTypeIsNotSpecified() {
val application = kotlin(
@@ -62,6 +64,7 @@
/* ktlint-enable max-line-length */
}
+ @Ignore("b/196831196")
@Test
fun failWhenSpecifiedServiceTypeIsInSufficient() {
val manifest = manifest(
diff --git a/work/workmanager-lint/src/test/java/androidx/work/lint/SpecifyJobSchedulerIdRangeIssueDetectorTest.kt b/work/work-lint/src/test/java/androidx/work/lint/SpecifyJobSchedulerIdRangeIssueDetectorTest.kt
similarity index 100%
rename from work/workmanager-lint/src/test/java/androidx/work/lint/SpecifyJobSchedulerIdRangeIssueDetectorTest.kt
rename to work/work-lint/src/test/java/androidx/work/lint/SpecifyJobSchedulerIdRangeIssueDetectorTest.kt
diff --git a/work/workmanager-lint/src/test/java/androidx/work/lint/Stubs.kt b/work/work-lint/src/test/java/androidx/work/lint/Stubs.kt
similarity index 100%
rename from work/workmanager-lint/src/test/java/androidx/work/lint/Stubs.kt
rename to work/work-lint/src/test/java/androidx/work/lint/Stubs.kt
diff --git a/work/workmanager-lint/src/test/java/androidx/work/lint/WorkerHasPublicModifierDetectorTest.kt b/work/work-lint/src/test/java/androidx/work/lint/WorkerHasPublicModifierDetectorTest.kt
similarity index 100%
rename from work/workmanager-lint/src/test/java/androidx/work/lint/WorkerHasPublicModifierDetectorTest.kt
rename to work/work-lint/src/test/java/androidx/work/lint/WorkerHasPublicModifierDetectorTest.kt
diff --git a/work/workmanager-multiprocess/api/2.5.0-beta01.txt b/work/work-multiprocess/api/2.5.0-beta01.txt
similarity index 100%
rename from work/workmanager-multiprocess/api/2.5.0-beta01.txt
rename to work/work-multiprocess/api/2.5.0-beta01.txt
diff --git a/work/workmanager-multiprocess/api/2.5.0-beta02.txt b/work/work-multiprocess/api/2.5.0-beta02.txt
similarity index 100%
rename from work/workmanager-multiprocess/api/2.5.0-beta02.txt
rename to work/work-multiprocess/api/2.5.0-beta02.txt
diff --git a/work/workmanager-multiprocess/api/current.txt b/work/work-multiprocess/api/2.7.0-beta01.txt
similarity index 100%
copy from work/workmanager-multiprocess/api/current.txt
copy to work/work-multiprocess/api/2.7.0-beta01.txt
diff --git a/work/workmanager-multiprocess/api/current.txt b/work/work-multiprocess/api/current.txt
similarity index 100%
rename from work/workmanager-multiprocess/api/current.txt
rename to work/work-multiprocess/api/current.txt
diff --git a/work/workmanager-multiprocess/api/public_plus_experimental_2.5.0-beta01.txt b/work/work-multiprocess/api/public_plus_experimental_2.5.0-beta01.txt
similarity index 100%
rename from work/workmanager-multiprocess/api/public_plus_experimental_2.5.0-beta01.txt
rename to work/work-multiprocess/api/public_plus_experimental_2.5.0-beta01.txt
diff --git a/work/workmanager-multiprocess/api/public_plus_experimental_2.5.0-beta02.txt b/work/work-multiprocess/api/public_plus_experimental_2.5.0-beta02.txt
similarity index 100%
rename from work/workmanager-multiprocess/api/public_plus_experimental_2.5.0-beta02.txt
rename to work/work-multiprocess/api/public_plus_experimental_2.5.0-beta02.txt
diff --git a/work/workmanager-multiprocess/api/current.txt b/work/work-multiprocess/api/public_plus_experimental_2.7.0-beta01.txt
similarity index 100%
copy from work/workmanager-multiprocess/api/current.txt
copy to work/work-multiprocess/api/public_plus_experimental_2.7.0-beta01.txt
diff --git a/work/workmanager-multiprocess/api/public_plus_experimental_current.txt b/work/work-multiprocess/api/public_plus_experimental_current.txt
similarity index 100%
rename from work/workmanager-multiprocess/api/public_plus_experimental_current.txt
rename to work/work-multiprocess/api/public_plus_experimental_current.txt
diff --git a/work/workmanager-multiprocess/api/res-2.5.0-beta01.txt b/work/work-multiprocess/api/res-2.5.0-beta01.txt
similarity index 100%
rename from work/workmanager-multiprocess/api/res-2.5.0-beta01.txt
rename to work/work-multiprocess/api/res-2.5.0-beta01.txt
diff --git a/work/workmanager-multiprocess/api/res-2.5.0-beta02.txt b/work/work-multiprocess/api/res-2.5.0-beta02.txt
similarity index 100%
rename from work/workmanager-multiprocess/api/res-2.5.0-beta02.txt
rename to work/work-multiprocess/api/res-2.5.0-beta02.txt
diff --git a/work/workmanager-multiprocess/api/res-2.5.0-beta01.txt b/work/work-multiprocess/api/res-2.7.0-beta01.txt
similarity index 100%
copy from work/workmanager-multiprocess/api/res-2.5.0-beta01.txt
copy to work/work-multiprocess/api/res-2.7.0-beta01.txt
diff --git a/work/workmanager-multiprocess/api/res-current.txt b/work/work-multiprocess/api/res-current.txt
similarity index 100%
rename from work/workmanager-multiprocess/api/res-current.txt
rename to work/work-multiprocess/api/res-current.txt
diff --git a/work/workmanager-multiprocess/api/restricted_2.5.0-beta01.txt b/work/work-multiprocess/api/restricted_2.5.0-beta01.txt
similarity index 100%
rename from work/workmanager-multiprocess/api/restricted_2.5.0-beta01.txt
rename to work/work-multiprocess/api/restricted_2.5.0-beta01.txt
diff --git a/work/workmanager-multiprocess/api/restricted_2.5.0-beta02.txt b/work/work-multiprocess/api/restricted_2.5.0-beta02.txt
similarity index 100%
rename from work/workmanager-multiprocess/api/restricted_2.5.0-beta02.txt
rename to work/work-multiprocess/api/restricted_2.5.0-beta02.txt
diff --git a/work/workmanager-multiprocess/api/current.txt b/work/work-multiprocess/api/restricted_2.7.0-beta01.txt
similarity index 100%
copy from work/workmanager-multiprocess/api/current.txt
copy to work/work-multiprocess/api/restricted_2.7.0-beta01.txt
diff --git a/work/workmanager-multiprocess/api/restricted_current.txt b/work/work-multiprocess/api/restricted_current.txt
similarity index 100%
rename from work/workmanager-multiprocess/api/restricted_current.txt
rename to work/work-multiprocess/api/restricted_current.txt
diff --git a/work/workmanager-multiprocess/build.gradle b/work/work-multiprocess/build.gradle
similarity index 100%
rename from work/workmanager-multiprocess/build.gradle
rename to work/work-multiprocess/build.gradle
diff --git a/work/workmanager-multiprocess/proguard-rules.pro b/work/work-multiprocess/proguard-rules.pro
similarity index 100%
rename from work/workmanager-multiprocess/proguard-rules.pro
rename to work/work-multiprocess/proguard-rules.pro
diff --git a/work/workmanager-multiprocess/src/androidTest/AndroidManifest.xml b/work/work-multiprocess/src/androidTest/AndroidManifest.xml
similarity index 100%
rename from work/workmanager-multiprocess/src/androidTest/AndroidManifest.xml
rename to work/work-multiprocess/src/androidTest/AndroidManifest.xml
diff --git a/work/workmanager-multiprocess/src/androidTest/java/androidx/work/multiprocess/ListenableWorkerImplClientTest.kt b/work/work-multiprocess/src/androidTest/java/androidx/work/multiprocess/ListenableWorkerImplClientTest.kt
similarity index 100%
rename from work/workmanager-multiprocess/src/androidTest/java/androidx/work/multiprocess/ListenableWorkerImplClientTest.kt
rename to work/work-multiprocess/src/androidTest/java/androidx/work/multiprocess/ListenableWorkerImplClientTest.kt
diff --git a/work/workmanager-multiprocess/src/androidTest/java/androidx/work/multiprocess/ParcelableConstraintConvertersTest.kt b/work/work-multiprocess/src/androidTest/java/androidx/work/multiprocess/ParcelableConstraintConvertersTest.kt
similarity index 100%
rename from work/workmanager-multiprocess/src/androidTest/java/androidx/work/multiprocess/ParcelableConstraintConvertersTest.kt
rename to work/work-multiprocess/src/androidTest/java/androidx/work/multiprocess/ParcelableConstraintConvertersTest.kt
diff --git a/work/workmanager-multiprocess/src/androidTest/java/androidx/work/multiprocess/ParcelableDataTest.kt b/work/work-multiprocess/src/androidTest/java/androidx/work/multiprocess/ParcelableDataTest.kt
similarity index 100%
rename from work/workmanager-multiprocess/src/androidTest/java/androidx/work/multiprocess/ParcelableDataTest.kt
rename to work/work-multiprocess/src/androidTest/java/androidx/work/multiprocess/ParcelableDataTest.kt
diff --git a/work/workmanager-multiprocess/src/androidTest/java/androidx/work/multiprocess/ParcelableWorkContinuationImplTest.kt b/work/work-multiprocess/src/androidTest/java/androidx/work/multiprocess/ParcelableWorkContinuationImplTest.kt
similarity index 100%
rename from work/workmanager-multiprocess/src/androidTest/java/androidx/work/multiprocess/ParcelableWorkContinuationImplTest.kt
rename to work/work-multiprocess/src/androidTest/java/androidx/work/multiprocess/ParcelableWorkContinuationImplTest.kt
diff --git a/work/workmanager-multiprocess/src/androidTest/java/androidx/work/multiprocess/ParcelableWorkInfoTest.kt b/work/work-multiprocess/src/androidTest/java/androidx/work/multiprocess/ParcelableWorkInfoTest.kt
similarity index 100%
rename from work/workmanager-multiprocess/src/androidTest/java/androidx/work/multiprocess/ParcelableWorkInfoTest.kt
rename to work/work-multiprocess/src/androidTest/java/androidx/work/multiprocess/ParcelableWorkInfoTest.kt
diff --git a/work/workmanager-multiprocess/src/androidTest/java/androidx/work/multiprocess/ParcelableWorkQueryTest.kt b/work/work-multiprocess/src/androidTest/java/androidx/work/multiprocess/ParcelableWorkQueryTest.kt
similarity index 100%
rename from work/workmanager-multiprocess/src/androidTest/java/androidx/work/multiprocess/ParcelableWorkQueryTest.kt
rename to work/work-multiprocess/src/androidTest/java/androidx/work/multiprocess/ParcelableWorkQueryTest.kt
diff --git a/work/workmanager-multiprocess/src/androidTest/java/androidx/work/multiprocess/ParcelableWorkRequestConvertersTest.kt b/work/work-multiprocess/src/androidTest/java/androidx/work/multiprocess/ParcelableWorkRequestConvertersTest.kt
similarity index 100%
rename from work/workmanager-multiprocess/src/androidTest/java/androidx/work/multiprocess/ParcelableWorkRequestConvertersTest.kt
rename to work/work-multiprocess/src/androidTest/java/androidx/work/multiprocess/ParcelableWorkRequestConvertersTest.kt
diff --git a/work/workmanager-multiprocess/src/androidTest/java/androidx/work/multiprocess/RemoteCoroutineWorkerTest.kt b/work/work-multiprocess/src/androidTest/java/androidx/work/multiprocess/RemoteCoroutineWorkerTest.kt
similarity index 100%
rename from work/workmanager-multiprocess/src/androidTest/java/androidx/work/multiprocess/RemoteCoroutineWorkerTest.kt
rename to work/work-multiprocess/src/androidTest/java/androidx/work/multiprocess/RemoteCoroutineWorkerTest.kt
diff --git a/work/workmanager-multiprocess/src/androidTest/java/androidx/work/multiprocess/RemoteFailureWorker.kt b/work/work-multiprocess/src/androidTest/java/androidx/work/multiprocess/RemoteFailureWorker.kt
similarity index 100%
rename from work/workmanager-multiprocess/src/androidTest/java/androidx/work/multiprocess/RemoteFailureWorker.kt
rename to work/work-multiprocess/src/androidTest/java/androidx/work/multiprocess/RemoteFailureWorker.kt
diff --git a/work/workmanager-multiprocess/src/androidTest/java/androidx/work/multiprocess/RemoteListenableWorkerTest.kt b/work/work-multiprocess/src/androidTest/java/androidx/work/multiprocess/RemoteListenableWorkerTest.kt
similarity index 100%
rename from work/workmanager-multiprocess/src/androidTest/java/androidx/work/multiprocess/RemoteListenableWorkerTest.kt
rename to work/work-multiprocess/src/androidTest/java/androidx/work/multiprocess/RemoteListenableWorkerTest.kt
diff --git a/work/workmanager-multiprocess/src/androidTest/java/androidx/work/multiprocess/RemoteRetryWorker.kt b/work/work-multiprocess/src/androidTest/java/androidx/work/multiprocess/RemoteRetryWorker.kt
similarity index 100%
rename from work/workmanager-multiprocess/src/androidTest/java/androidx/work/multiprocess/RemoteRetryWorker.kt
rename to work/work-multiprocess/src/androidTest/java/androidx/work/multiprocess/RemoteRetryWorker.kt
diff --git a/work/workmanager-multiprocess/src/androidTest/java/androidx/work/multiprocess/RemoteSuccessWorker.kt b/work/work-multiprocess/src/androidTest/java/androidx/work/multiprocess/RemoteSuccessWorker.kt
similarity index 100%
rename from work/workmanager-multiprocess/src/androidTest/java/androidx/work/multiprocess/RemoteSuccessWorker.kt
rename to work/work-multiprocess/src/androidTest/java/androidx/work/multiprocess/RemoteSuccessWorker.kt
diff --git a/work/workmanager-multiprocess/src/androidTest/java/androidx/work/multiprocess/RemoteWorkManagerClientTest.kt b/work/work-multiprocess/src/androidTest/java/androidx/work/multiprocess/RemoteWorkManagerClientTest.kt
similarity index 100%
rename from work/workmanager-multiprocess/src/androidTest/java/androidx/work/multiprocess/RemoteWorkManagerClientTest.kt
rename to work/work-multiprocess/src/androidTest/java/androidx/work/multiprocess/RemoteWorkManagerClientTest.kt
diff --git a/work/workmanager-multiprocess/src/androidTest/java/androidx/work/multiprocess/TestWorker.kt b/work/work-multiprocess/src/androidTest/java/androidx/work/multiprocess/TestWorker.kt
similarity index 100%
rename from work/workmanager-multiprocess/src/androidTest/java/androidx/work/multiprocess/TestWorker.kt
rename to work/work-multiprocess/src/androidTest/java/androidx/work/multiprocess/TestWorker.kt
diff --git a/work/workmanager-multiprocess/src/main/AndroidManifest.xml b/work/work-multiprocess/src/main/AndroidManifest.xml
similarity index 100%
rename from work/workmanager-multiprocess/src/main/AndroidManifest.xml
rename to work/work-multiprocess/src/main/AndroidManifest.xml
diff --git a/work/workmanager-multiprocess/src/main/java/androidx/work/multiprocess/ListenableCallback.java b/work/work-multiprocess/src/main/java/androidx/work/multiprocess/ListenableCallback.java
similarity index 100%
rename from work/workmanager-multiprocess/src/main/java/androidx/work/multiprocess/ListenableCallback.java
rename to work/work-multiprocess/src/main/java/androidx/work/multiprocess/ListenableCallback.java
diff --git a/work/workmanager-multiprocess/src/main/java/androidx/work/multiprocess/ListenableWorkerImpl.java b/work/work-multiprocess/src/main/java/androidx/work/multiprocess/ListenableWorkerImpl.java
similarity index 100%
rename from work/workmanager-multiprocess/src/main/java/androidx/work/multiprocess/ListenableWorkerImpl.java
rename to work/work-multiprocess/src/main/java/androidx/work/multiprocess/ListenableWorkerImpl.java
diff --git a/work/workmanager-multiprocess/src/main/java/androidx/work/multiprocess/ListenableWorkerImplClient.java b/work/work-multiprocess/src/main/java/androidx/work/multiprocess/ListenableWorkerImplClient.java
similarity index 100%
rename from work/workmanager-multiprocess/src/main/java/androidx/work/multiprocess/ListenableWorkerImplClient.java
rename to work/work-multiprocess/src/main/java/androidx/work/multiprocess/ListenableWorkerImplClient.java
diff --git a/work/workmanager-multiprocess/src/main/java/androidx/work/multiprocess/RemoteCallback.java b/work/work-multiprocess/src/main/java/androidx/work/multiprocess/RemoteCallback.java
similarity index 100%
rename from work/workmanager-multiprocess/src/main/java/androidx/work/multiprocess/RemoteCallback.java
rename to work/work-multiprocess/src/main/java/androidx/work/multiprocess/RemoteCallback.java
diff --git a/work/workmanager-multiprocess/src/main/java/androidx/work/multiprocess/RemoteClientUtils.java b/work/work-multiprocess/src/main/java/androidx/work/multiprocess/RemoteClientUtils.java
similarity index 100%
rename from work/workmanager-multiprocess/src/main/java/androidx/work/multiprocess/RemoteClientUtils.java
rename to work/work-multiprocess/src/main/java/androidx/work/multiprocess/RemoteClientUtils.java
diff --git a/work/workmanager-multiprocess/src/main/java/androidx/work/multiprocess/RemoteCoroutineWorker.kt b/work/work-multiprocess/src/main/java/androidx/work/multiprocess/RemoteCoroutineWorker.kt
similarity index 100%
rename from work/workmanager-multiprocess/src/main/java/androidx/work/multiprocess/RemoteCoroutineWorker.kt
rename to work/work-multiprocess/src/main/java/androidx/work/multiprocess/RemoteCoroutineWorker.kt
diff --git a/work/workmanager-multiprocess/src/main/java/androidx/work/multiprocess/RemoteDispatcher.java b/work/work-multiprocess/src/main/java/androidx/work/multiprocess/RemoteDispatcher.java
similarity index 100%
rename from work/workmanager-multiprocess/src/main/java/androidx/work/multiprocess/RemoteDispatcher.java
rename to work/work-multiprocess/src/main/java/androidx/work/multiprocess/RemoteDispatcher.java
diff --git a/work/workmanager-multiprocess/src/main/java/androidx/work/multiprocess/RemoteListenableWorker.java b/work/work-multiprocess/src/main/java/androidx/work/multiprocess/RemoteListenableWorker.java
similarity index 100%
rename from work/workmanager-multiprocess/src/main/java/androidx/work/multiprocess/RemoteListenableWorker.java
rename to work/work-multiprocess/src/main/java/androidx/work/multiprocess/RemoteListenableWorker.java
diff --git a/work/workmanager-multiprocess/src/main/java/androidx/work/multiprocess/RemoteWorkContinuationImpl.java b/work/work-multiprocess/src/main/java/androidx/work/multiprocess/RemoteWorkContinuationImpl.java
similarity index 100%
rename from work/workmanager-multiprocess/src/main/java/androidx/work/multiprocess/RemoteWorkContinuationImpl.java
rename to work/work-multiprocess/src/main/java/androidx/work/multiprocess/RemoteWorkContinuationImpl.java
diff --git a/work/workmanager-multiprocess/src/main/java/androidx/work/multiprocess/RemoteWorkManagerClient.java b/work/work-multiprocess/src/main/java/androidx/work/multiprocess/RemoteWorkManagerClient.java
similarity index 100%
rename from work/workmanager-multiprocess/src/main/java/androidx/work/multiprocess/RemoteWorkManagerClient.java
rename to work/work-multiprocess/src/main/java/androidx/work/multiprocess/RemoteWorkManagerClient.java
diff --git a/work/workmanager-multiprocess/src/main/java/androidx/work/multiprocess/RemoteWorkManagerImpl.java b/work/work-multiprocess/src/main/java/androidx/work/multiprocess/RemoteWorkManagerImpl.java
similarity index 100%
rename from work/workmanager-multiprocess/src/main/java/androidx/work/multiprocess/RemoteWorkManagerImpl.java
rename to work/work-multiprocess/src/main/java/androidx/work/multiprocess/RemoteWorkManagerImpl.java
diff --git a/work/workmanager-multiprocess/src/main/java/androidx/work/multiprocess/RemoteWorkManagerService.java b/work/work-multiprocess/src/main/java/androidx/work/multiprocess/RemoteWorkManagerService.java
similarity index 100%
rename from work/workmanager-multiprocess/src/main/java/androidx/work/multiprocess/RemoteWorkManagerService.java
rename to work/work-multiprocess/src/main/java/androidx/work/multiprocess/RemoteWorkManagerService.java
diff --git a/work/workmanager-multiprocess/src/main/java/androidx/work/multiprocess/RemoteWorkerService.java b/work/work-multiprocess/src/main/java/androidx/work/multiprocess/RemoteWorkerService.java
similarity index 100%
rename from work/workmanager-multiprocess/src/main/java/androidx/work/multiprocess/RemoteWorkerService.java
rename to work/work-multiprocess/src/main/java/androidx/work/multiprocess/RemoteWorkerService.java
diff --git a/work/workmanager-multiprocess/src/main/java/androidx/work/multiprocess/parcelable/ParcelConverters.java b/work/work-multiprocess/src/main/java/androidx/work/multiprocess/parcelable/ParcelConverters.java
similarity index 100%
rename from work/workmanager-multiprocess/src/main/java/androidx/work/multiprocess/parcelable/ParcelConverters.java
rename to work/work-multiprocess/src/main/java/androidx/work/multiprocess/parcelable/ParcelConverters.java
diff --git a/work/workmanager-multiprocess/src/main/java/androidx/work/multiprocess/parcelable/ParcelUtils.java b/work/work-multiprocess/src/main/java/androidx/work/multiprocess/parcelable/ParcelUtils.java
similarity index 100%
rename from work/workmanager-multiprocess/src/main/java/androidx/work/multiprocess/parcelable/ParcelUtils.java
rename to work/work-multiprocess/src/main/java/androidx/work/multiprocess/parcelable/ParcelUtils.java
diff --git a/work/workmanager-multiprocess/src/main/java/androidx/work/multiprocess/parcelable/ParcelableConstraints.java b/work/work-multiprocess/src/main/java/androidx/work/multiprocess/parcelable/ParcelableConstraints.java
similarity index 100%
rename from work/workmanager-multiprocess/src/main/java/androidx/work/multiprocess/parcelable/ParcelableConstraints.java
rename to work/work-multiprocess/src/main/java/androidx/work/multiprocess/parcelable/ParcelableConstraints.java
diff --git a/work/workmanager-multiprocess/src/main/java/androidx/work/multiprocess/parcelable/ParcelableData.java b/work/work-multiprocess/src/main/java/androidx/work/multiprocess/parcelable/ParcelableData.java
similarity index 100%
rename from work/workmanager-multiprocess/src/main/java/androidx/work/multiprocess/parcelable/ParcelableData.java
rename to work/work-multiprocess/src/main/java/androidx/work/multiprocess/parcelable/ParcelableData.java
diff --git a/work/workmanager-multiprocess/src/main/java/androidx/work/multiprocess/parcelable/ParcelableRemoteWorkRequest.java b/work/work-multiprocess/src/main/java/androidx/work/multiprocess/parcelable/ParcelableRemoteWorkRequest.java
similarity index 100%
rename from work/workmanager-multiprocess/src/main/java/androidx/work/multiprocess/parcelable/ParcelableRemoteWorkRequest.java
rename to work/work-multiprocess/src/main/java/androidx/work/multiprocess/parcelable/ParcelableRemoteWorkRequest.java
diff --git a/work/workmanager-multiprocess/src/main/java/androidx/work/multiprocess/parcelable/ParcelableResult.java b/work/work-multiprocess/src/main/java/androidx/work/multiprocess/parcelable/ParcelableResult.java
similarity index 100%
rename from work/workmanager-multiprocess/src/main/java/androidx/work/multiprocess/parcelable/ParcelableResult.java
rename to work/work-multiprocess/src/main/java/androidx/work/multiprocess/parcelable/ParcelableResult.java
diff --git a/work/workmanager-multiprocess/src/main/java/androidx/work/multiprocess/parcelable/ParcelableRuntimeExtras.java b/work/work-multiprocess/src/main/java/androidx/work/multiprocess/parcelable/ParcelableRuntimeExtras.java
similarity index 100%
rename from work/workmanager-multiprocess/src/main/java/androidx/work/multiprocess/parcelable/ParcelableRuntimeExtras.java
rename to work/work-multiprocess/src/main/java/androidx/work/multiprocess/parcelable/ParcelableRuntimeExtras.java
diff --git a/work/workmanager-multiprocess/src/main/java/androidx/work/multiprocess/parcelable/ParcelableUpdateRequest.java b/work/work-multiprocess/src/main/java/androidx/work/multiprocess/parcelable/ParcelableUpdateRequest.java
similarity index 100%
rename from work/workmanager-multiprocess/src/main/java/androidx/work/multiprocess/parcelable/ParcelableUpdateRequest.java
rename to work/work-multiprocess/src/main/java/androidx/work/multiprocess/parcelable/ParcelableUpdateRequest.java
diff --git a/work/workmanager-multiprocess/src/main/java/androidx/work/multiprocess/parcelable/ParcelableWorkContinuationImpl.java b/work/work-multiprocess/src/main/java/androidx/work/multiprocess/parcelable/ParcelableWorkContinuationImpl.java
similarity index 100%
rename from work/workmanager-multiprocess/src/main/java/androidx/work/multiprocess/parcelable/ParcelableWorkContinuationImpl.java
rename to work/work-multiprocess/src/main/java/androidx/work/multiprocess/parcelable/ParcelableWorkContinuationImpl.java
diff --git a/work/workmanager-multiprocess/src/main/java/androidx/work/multiprocess/parcelable/ParcelableWorkInfo.java b/work/work-multiprocess/src/main/java/androidx/work/multiprocess/parcelable/ParcelableWorkInfo.java
similarity index 100%
rename from work/workmanager-multiprocess/src/main/java/androidx/work/multiprocess/parcelable/ParcelableWorkInfo.java
rename to work/work-multiprocess/src/main/java/androidx/work/multiprocess/parcelable/ParcelableWorkInfo.java
diff --git a/work/workmanager-multiprocess/src/main/java/androidx/work/multiprocess/parcelable/ParcelableWorkInfos.java b/work/work-multiprocess/src/main/java/androidx/work/multiprocess/parcelable/ParcelableWorkInfos.java
similarity index 100%
rename from work/workmanager-multiprocess/src/main/java/androidx/work/multiprocess/parcelable/ParcelableWorkInfos.java
rename to work/work-multiprocess/src/main/java/androidx/work/multiprocess/parcelable/ParcelableWorkInfos.java
diff --git a/work/workmanager-multiprocess/src/main/java/androidx/work/multiprocess/parcelable/ParcelableWorkQuery.java b/work/work-multiprocess/src/main/java/androidx/work/multiprocess/parcelable/ParcelableWorkQuery.java
similarity index 100%
rename from work/workmanager-multiprocess/src/main/java/androidx/work/multiprocess/parcelable/ParcelableWorkQuery.java
rename to work/work-multiprocess/src/main/java/androidx/work/multiprocess/parcelable/ParcelableWorkQuery.java
diff --git a/work/workmanager-multiprocess/src/main/java/androidx/work/multiprocess/parcelable/ParcelableWorkRequest.java b/work/work-multiprocess/src/main/java/androidx/work/multiprocess/parcelable/ParcelableWorkRequest.java
similarity index 100%
rename from work/workmanager-multiprocess/src/main/java/androidx/work/multiprocess/parcelable/ParcelableWorkRequest.java
rename to work/work-multiprocess/src/main/java/androidx/work/multiprocess/parcelable/ParcelableWorkRequest.java
diff --git a/work/workmanager-multiprocess/src/main/java/androidx/work/multiprocess/parcelable/ParcelableWorkRequests.java b/work/work-multiprocess/src/main/java/androidx/work/multiprocess/parcelable/ParcelableWorkRequests.java
similarity index 100%
rename from work/workmanager-multiprocess/src/main/java/androidx/work/multiprocess/parcelable/ParcelableWorkRequests.java
rename to work/work-multiprocess/src/main/java/androidx/work/multiprocess/parcelable/ParcelableWorkRequests.java
diff --git a/work/workmanager-multiprocess/src/main/java/androidx/work/multiprocess/parcelable/ParcelableWorkerParameters.java b/work/work-multiprocess/src/main/java/androidx/work/multiprocess/parcelable/ParcelableWorkerParameters.java
similarity index 100%
rename from work/workmanager-multiprocess/src/main/java/androidx/work/multiprocess/parcelable/ParcelableWorkerParameters.java
rename to work/work-multiprocess/src/main/java/androidx/work/multiprocess/parcelable/ParcelableWorkerParameters.java
diff --git a/work/workmanager-ktx/api/1.0.0-beta01.txt b/work/work-runtime-ktx/api/1.0.0-beta01.txt
similarity index 100%
rename from work/workmanager-ktx/api/1.0.0-beta01.txt
rename to work/work-runtime-ktx/api/1.0.0-beta01.txt
diff --git a/work/workmanager-ktx/api/1.0.0-beta02.txt b/work/work-runtime-ktx/api/1.0.0-beta02.txt
similarity index 100%
rename from work/workmanager-ktx/api/1.0.0-beta02.txt
rename to work/work-runtime-ktx/api/1.0.0-beta02.txt
diff --git a/work/workmanager-ktx/api/1.0.0-beta03.txt b/work/work-runtime-ktx/api/1.0.0-beta03.txt
similarity index 100%
rename from work/workmanager-ktx/api/1.0.0-beta03.txt
rename to work/work-runtime-ktx/api/1.0.0-beta03.txt
diff --git a/work/workmanager-ktx/api/1.0.0-beta04.txt b/work/work-runtime-ktx/api/1.0.0-beta04.txt
similarity index 100%
rename from work/workmanager-ktx/api/1.0.0-beta04.txt
rename to work/work-runtime-ktx/api/1.0.0-beta04.txt
diff --git a/work/workmanager-ktx/api/1.0.0-rc01.txt b/work/work-runtime-ktx/api/1.0.0-rc01.txt
similarity index 100%
rename from work/workmanager-ktx/api/1.0.0-rc01.txt
rename to work/work-runtime-ktx/api/1.0.0-rc01.txt
diff --git a/work/workmanager-ktx/api/1.0.0-rc02.txt b/work/work-runtime-ktx/api/1.0.0-rc02.txt
similarity index 100%
rename from work/workmanager-ktx/api/1.0.0-rc02.txt
rename to work/work-runtime-ktx/api/1.0.0-rc02.txt
diff --git a/work/workmanager-ktx/api/1.0.0.txt b/work/work-runtime-ktx/api/1.0.0.txt
similarity index 100%
rename from work/workmanager-ktx/api/1.0.0.txt
rename to work/work-runtime-ktx/api/1.0.0.txt
diff --git a/work/workmanager-ktx/api/2.0.0-rc01.txt b/work/work-runtime-ktx/api/2.0.0-rc01.txt
similarity index 100%
rename from work/workmanager-ktx/api/2.0.0-rc01.txt
rename to work/work-runtime-ktx/api/2.0.0-rc01.txt
diff --git a/work/workmanager-ktx/api/2.0.0.txt b/work/work-runtime-ktx/api/2.0.0.txt
similarity index 100%
rename from work/workmanager-ktx/api/2.0.0.txt
rename to work/work-runtime-ktx/api/2.0.0.txt
diff --git a/work/workmanager-ktx/api/2.1.0-beta01.txt b/work/work-runtime-ktx/api/2.1.0-beta01.txt
similarity index 100%
rename from work/workmanager-ktx/api/2.1.0-beta01.txt
rename to work/work-runtime-ktx/api/2.1.0-beta01.txt
diff --git a/work/workmanager-ktx/api/2.1.0-beta02.txt b/work/work-runtime-ktx/api/2.1.0-beta02.txt
similarity index 100%
rename from work/workmanager-ktx/api/2.1.0-beta02.txt
rename to work/work-runtime-ktx/api/2.1.0-beta02.txt
diff --git a/work/workmanager-ktx/api/2.1.0-rc01.txt b/work/work-runtime-ktx/api/2.1.0-rc01.txt
similarity index 100%
rename from work/workmanager-ktx/api/2.1.0-rc01.txt
rename to work/work-runtime-ktx/api/2.1.0-rc01.txt
diff --git a/work/workmanager-ktx/api/2.1.0.txt b/work/work-runtime-ktx/api/2.1.0.txt
similarity index 100%
rename from work/workmanager-ktx/api/2.1.0.txt
rename to work/work-runtime-ktx/api/2.1.0.txt
diff --git a/work/workmanager-ktx/api/2.2.0-beta01.txt b/work/work-runtime-ktx/api/2.2.0-beta01.txt
similarity index 100%
rename from work/workmanager-ktx/api/2.2.0-beta01.txt
rename to work/work-runtime-ktx/api/2.2.0-beta01.txt
diff --git a/work/workmanager-ktx/api/2.3.0-beta01.txt b/work/work-runtime-ktx/api/2.3.0-beta01.txt
similarity index 100%
rename from work/workmanager-ktx/api/2.3.0-beta01.txt
rename to work/work-runtime-ktx/api/2.3.0-beta01.txt
diff --git a/work/workmanager-ktx/api/2.3.0-beta02.txt b/work/work-runtime-ktx/api/2.3.0-beta02.txt
similarity index 100%
rename from work/workmanager-ktx/api/2.3.0-beta02.txt
rename to work/work-runtime-ktx/api/2.3.0-beta02.txt
diff --git a/work/workmanager-ktx/api/2.3.0-rc01.txt b/work/work-runtime-ktx/api/2.3.0-rc01.txt
similarity index 100%
rename from work/workmanager-ktx/api/2.3.0-rc01.txt
rename to work/work-runtime-ktx/api/2.3.0-rc01.txt
diff --git a/work/workmanager-ktx/api/2.4.0-beta01.txt b/work/work-runtime-ktx/api/2.4.0-beta01.txt
similarity index 100%
rename from work/workmanager-ktx/api/2.4.0-beta01.txt
rename to work/work-runtime-ktx/api/2.4.0-beta01.txt
diff --git a/work/workmanager-ktx/api/2.4.0-beta02.txt b/work/work-runtime-ktx/api/2.4.0-beta02.txt
similarity index 100%
rename from work/workmanager-ktx/api/2.4.0-beta02.txt
rename to work/work-runtime-ktx/api/2.4.0-beta02.txt
diff --git a/work/workmanager-ktx/api/2.4.0-rc01.txt b/work/work-runtime-ktx/api/2.4.0-rc01.txt
similarity index 100%
rename from work/workmanager-ktx/api/2.4.0-rc01.txt
rename to work/work-runtime-ktx/api/2.4.0-rc01.txt
diff --git a/work/workmanager-ktx/api/2.5.0-beta01.txt b/work/work-runtime-ktx/api/2.5.0-beta01.txt
similarity index 100%
rename from work/workmanager-ktx/api/2.5.0-beta01.txt
rename to work/work-runtime-ktx/api/2.5.0-beta01.txt
diff --git a/work/workmanager-ktx/api/2.5.0-beta02.txt b/work/work-runtime-ktx/api/2.5.0-beta02.txt
similarity index 100%
rename from work/workmanager-ktx/api/2.5.0-beta02.txt
rename to work/work-runtime-ktx/api/2.5.0-beta02.txt
diff --git a/work/workmanager-ktx/api/current.txt b/work/work-runtime-ktx/api/2.7.0-beta01.txt
similarity index 100%
copy from work/workmanager-ktx/api/current.txt
copy to work/work-runtime-ktx/api/2.7.0-beta01.txt
diff --git a/work/workmanager-ktx/api/api_lint.ignore b/work/work-runtime-ktx/api/api_lint.ignore
similarity index 100%
rename from work/workmanager-ktx/api/api_lint.ignore
rename to work/work-runtime-ktx/api/api_lint.ignore
diff --git a/work/workmanager-ktx/api/current.txt b/work/work-runtime-ktx/api/current.txt
similarity index 100%
rename from work/workmanager-ktx/api/current.txt
rename to work/work-runtime-ktx/api/current.txt
diff --git a/work/workmanager-ktx/api/public_plus_experimental_2.0.0-rc01.txt b/work/work-runtime-ktx/api/public_plus_experimental_2.0.0-rc01.txt
similarity index 100%
rename from work/workmanager-ktx/api/public_plus_experimental_2.0.0-rc01.txt
rename to work/work-runtime-ktx/api/public_plus_experimental_2.0.0-rc01.txt
diff --git a/work/workmanager-ktx/api/public_plus_experimental_2.0.0.txt b/work/work-runtime-ktx/api/public_plus_experimental_2.0.0.txt
similarity index 100%
rename from work/workmanager-ktx/api/public_plus_experimental_2.0.0.txt
rename to work/work-runtime-ktx/api/public_plus_experimental_2.0.0.txt
diff --git a/work/workmanager-ktx/api/public_plus_experimental_2.1.0-beta01.txt b/work/work-runtime-ktx/api/public_plus_experimental_2.1.0-beta01.txt
similarity index 100%
rename from work/workmanager-ktx/api/public_plus_experimental_2.1.0-beta01.txt
rename to work/work-runtime-ktx/api/public_plus_experimental_2.1.0-beta01.txt
diff --git a/work/workmanager-ktx/api/public_plus_experimental_2.1.0-beta02.txt b/work/work-runtime-ktx/api/public_plus_experimental_2.1.0-beta02.txt
similarity index 100%
rename from work/workmanager-ktx/api/public_plus_experimental_2.1.0-beta02.txt
rename to work/work-runtime-ktx/api/public_plus_experimental_2.1.0-beta02.txt
diff --git a/work/workmanager-ktx/api/public_plus_experimental_2.1.0-rc01.txt b/work/work-runtime-ktx/api/public_plus_experimental_2.1.0-rc01.txt
similarity index 100%
rename from work/workmanager-ktx/api/public_plus_experimental_2.1.0-rc01.txt
rename to work/work-runtime-ktx/api/public_plus_experimental_2.1.0-rc01.txt
diff --git a/work/workmanager-ktx/api/public_plus_experimental_2.1.0.txt b/work/work-runtime-ktx/api/public_plus_experimental_2.1.0.txt
similarity index 100%
rename from work/workmanager-ktx/api/public_plus_experimental_2.1.0.txt
rename to work/work-runtime-ktx/api/public_plus_experimental_2.1.0.txt
diff --git a/work/workmanager-ktx/api/public_plus_experimental_2.2.0-beta01.txt b/work/work-runtime-ktx/api/public_plus_experimental_2.2.0-beta01.txt
similarity index 100%
rename from work/workmanager-ktx/api/public_plus_experimental_2.2.0-beta01.txt
rename to work/work-runtime-ktx/api/public_plus_experimental_2.2.0-beta01.txt
diff --git a/work/workmanager-ktx/api/public_plus_experimental_2.3.0-beta01.txt b/work/work-runtime-ktx/api/public_plus_experimental_2.3.0-beta01.txt
similarity index 100%
rename from work/workmanager-ktx/api/public_plus_experimental_2.3.0-beta01.txt
rename to work/work-runtime-ktx/api/public_plus_experimental_2.3.0-beta01.txt
diff --git a/work/workmanager-ktx/api/public_plus_experimental_2.3.0-beta02.txt b/work/work-runtime-ktx/api/public_plus_experimental_2.3.0-beta02.txt
similarity index 100%
rename from work/workmanager-ktx/api/public_plus_experimental_2.3.0-beta02.txt
rename to work/work-runtime-ktx/api/public_plus_experimental_2.3.0-beta02.txt
diff --git a/work/workmanager-ktx/api/public_plus_experimental_2.3.0-rc01.txt b/work/work-runtime-ktx/api/public_plus_experimental_2.3.0-rc01.txt
similarity index 100%
rename from work/workmanager-ktx/api/public_plus_experimental_2.3.0-rc01.txt
rename to work/work-runtime-ktx/api/public_plus_experimental_2.3.0-rc01.txt
diff --git a/work/workmanager-ktx/api/public_plus_experimental_2.4.0-beta01.txt b/work/work-runtime-ktx/api/public_plus_experimental_2.4.0-beta01.txt
similarity index 100%
rename from work/workmanager-ktx/api/public_plus_experimental_2.4.0-beta01.txt
rename to work/work-runtime-ktx/api/public_plus_experimental_2.4.0-beta01.txt
diff --git a/work/workmanager-ktx/api/public_plus_experimental_2.4.0-beta02.txt b/work/work-runtime-ktx/api/public_plus_experimental_2.4.0-beta02.txt
similarity index 100%
rename from work/workmanager-ktx/api/public_plus_experimental_2.4.0-beta02.txt
rename to work/work-runtime-ktx/api/public_plus_experimental_2.4.0-beta02.txt
diff --git a/work/workmanager-ktx/api/public_plus_experimental_2.4.0-rc01.txt b/work/work-runtime-ktx/api/public_plus_experimental_2.4.0-rc01.txt
similarity index 100%
rename from work/workmanager-ktx/api/public_plus_experimental_2.4.0-rc01.txt
rename to work/work-runtime-ktx/api/public_plus_experimental_2.4.0-rc01.txt
diff --git a/work/workmanager-ktx/api/public_plus_experimental_2.5.0-beta01.txt b/work/work-runtime-ktx/api/public_plus_experimental_2.5.0-beta01.txt
similarity index 100%
rename from work/workmanager-ktx/api/public_plus_experimental_2.5.0-beta01.txt
rename to work/work-runtime-ktx/api/public_plus_experimental_2.5.0-beta01.txt
diff --git a/work/workmanager-ktx/api/public_plus_experimental_2.5.0-beta02.txt b/work/work-runtime-ktx/api/public_plus_experimental_2.5.0-beta02.txt
similarity index 100%
rename from work/workmanager-ktx/api/public_plus_experimental_2.5.0-beta02.txt
rename to work/work-runtime-ktx/api/public_plus_experimental_2.5.0-beta02.txt
diff --git a/work/workmanager-ktx/api/current.txt b/work/work-runtime-ktx/api/public_plus_experimental_2.7.0-beta01.txt
similarity index 100%
copy from work/workmanager-ktx/api/current.txt
copy to work/work-runtime-ktx/api/public_plus_experimental_2.7.0-beta01.txt
diff --git a/work/workmanager-ktx/api/public_plus_experimental_current.txt b/work/work-runtime-ktx/api/public_plus_experimental_current.txt
similarity index 100%
rename from work/workmanager-ktx/api/public_plus_experimental_current.txt
rename to work/work-runtime-ktx/api/public_plus_experimental_current.txt
diff --git a/work/workmanager-ktx/api/res-1.0.0-beta01.txt b/work/work-runtime-ktx/api/res-1.0.0-beta01.txt
similarity index 100%
rename from work/workmanager-ktx/api/res-1.0.0-beta01.txt
rename to work/work-runtime-ktx/api/res-1.0.0-beta01.txt
diff --git a/work/workmanager-ktx/api/res-1.0.0-beta02.txt b/work/work-runtime-ktx/api/res-1.0.0-beta02.txt
similarity index 100%
rename from work/workmanager-ktx/api/res-1.0.0-beta02.txt
rename to work/work-runtime-ktx/api/res-1.0.0-beta02.txt
diff --git a/work/workmanager-ktx/api/res-1.0.0-beta03.txt b/work/work-runtime-ktx/api/res-1.0.0-beta03.txt
similarity index 100%
rename from work/workmanager-ktx/api/res-1.0.0-beta03.txt
rename to work/work-runtime-ktx/api/res-1.0.0-beta03.txt
diff --git a/work/workmanager-ktx/api/res-1.0.0-beta04.txt b/work/work-runtime-ktx/api/res-1.0.0-beta04.txt
similarity index 100%
rename from work/workmanager-ktx/api/res-1.0.0-beta04.txt
rename to work/work-runtime-ktx/api/res-1.0.0-beta04.txt
diff --git a/work/workmanager-ktx/api/res-1.0.0-rc01.txt b/work/work-runtime-ktx/api/res-1.0.0-rc01.txt
similarity index 100%
rename from work/workmanager-ktx/api/res-1.0.0-rc01.txt
rename to work/work-runtime-ktx/api/res-1.0.0-rc01.txt
diff --git a/work/workmanager-ktx/api/res-1.0.0-rc02.txt b/work/work-runtime-ktx/api/res-1.0.0-rc02.txt
similarity index 100%
rename from work/workmanager-ktx/api/res-1.0.0-rc02.txt
rename to work/work-runtime-ktx/api/res-1.0.0-rc02.txt
diff --git a/work/workmanager-ktx/api/res-1.0.0.txt b/work/work-runtime-ktx/api/res-1.0.0.txt
similarity index 100%
rename from work/workmanager-ktx/api/res-1.0.0.txt
rename to work/work-runtime-ktx/api/res-1.0.0.txt
diff --git a/work/workmanager-ktx/api/res-2.0.0-rc01.txt b/work/work-runtime-ktx/api/res-2.0.0-rc01.txt
similarity index 100%
rename from work/workmanager-ktx/api/res-2.0.0-rc01.txt
rename to work/work-runtime-ktx/api/res-2.0.0-rc01.txt
diff --git a/work/workmanager-ktx/api/res-2.0.0.txt b/work/work-runtime-ktx/api/res-2.0.0.txt
similarity index 100%
rename from work/workmanager-ktx/api/res-2.0.0.txt
rename to work/work-runtime-ktx/api/res-2.0.0.txt
diff --git a/work/workmanager-ktx/api/res-2.1.0-beta01.txt b/work/work-runtime-ktx/api/res-2.1.0-beta01.txt
similarity index 100%
rename from work/workmanager-ktx/api/res-2.1.0-beta01.txt
rename to work/work-runtime-ktx/api/res-2.1.0-beta01.txt
diff --git a/work/workmanager-ktx/api/res-2.1.0-beta02.txt b/work/work-runtime-ktx/api/res-2.1.0-beta02.txt
similarity index 100%
rename from work/workmanager-ktx/api/res-2.1.0-beta02.txt
rename to work/work-runtime-ktx/api/res-2.1.0-beta02.txt
diff --git a/work/workmanager-ktx/api/res-2.1.0-rc01.txt b/work/work-runtime-ktx/api/res-2.1.0-rc01.txt
similarity index 100%
rename from work/workmanager-ktx/api/res-2.1.0-rc01.txt
rename to work/work-runtime-ktx/api/res-2.1.0-rc01.txt
diff --git a/work/workmanager-ktx/api/res-2.1.0.txt b/work/work-runtime-ktx/api/res-2.1.0.txt
similarity index 100%
rename from work/workmanager-ktx/api/res-2.1.0.txt
rename to work/work-runtime-ktx/api/res-2.1.0.txt
diff --git a/work/workmanager-ktx/api/res-2.2.0-beta01.txt b/work/work-runtime-ktx/api/res-2.2.0-beta01.txt
similarity index 100%
rename from work/workmanager-ktx/api/res-2.2.0-beta01.txt
rename to work/work-runtime-ktx/api/res-2.2.0-beta01.txt
diff --git a/work/workmanager-ktx/api/res-2.3.0-beta01.txt b/work/work-runtime-ktx/api/res-2.3.0-beta01.txt
similarity index 100%
rename from work/workmanager-ktx/api/res-2.3.0-beta01.txt
rename to work/work-runtime-ktx/api/res-2.3.0-beta01.txt
diff --git a/work/workmanager-ktx/api/res-2.3.0-beta02.txt b/work/work-runtime-ktx/api/res-2.3.0-beta02.txt
similarity index 100%
rename from work/workmanager-ktx/api/res-2.3.0-beta02.txt
rename to work/work-runtime-ktx/api/res-2.3.0-beta02.txt
diff --git a/work/workmanager-ktx/api/res-2.3.0-rc01.txt b/work/work-runtime-ktx/api/res-2.3.0-rc01.txt
similarity index 100%
rename from work/workmanager-ktx/api/res-2.3.0-rc01.txt
rename to work/work-runtime-ktx/api/res-2.3.0-rc01.txt
diff --git a/work/workmanager-ktx/api/res-2.4.0-beta01.txt b/work/work-runtime-ktx/api/res-2.4.0-beta01.txt
similarity index 100%
rename from work/workmanager-ktx/api/res-2.4.0-beta01.txt
rename to work/work-runtime-ktx/api/res-2.4.0-beta01.txt
diff --git a/work/workmanager-ktx/api/res-2.4.0-beta02.txt b/work/work-runtime-ktx/api/res-2.4.0-beta02.txt
similarity index 100%
rename from work/workmanager-ktx/api/res-2.4.0-beta02.txt
rename to work/work-runtime-ktx/api/res-2.4.0-beta02.txt
diff --git a/work/workmanager-ktx/api/res-2.4.0-rc01.txt b/work/work-runtime-ktx/api/res-2.4.0-rc01.txt
similarity index 100%
rename from work/workmanager-ktx/api/res-2.4.0-rc01.txt
rename to work/work-runtime-ktx/api/res-2.4.0-rc01.txt
diff --git a/work/workmanager-ktx/api/res-2.5.0-beta01.txt b/work/work-runtime-ktx/api/res-2.5.0-beta01.txt
similarity index 100%
rename from work/workmanager-ktx/api/res-2.5.0-beta01.txt
rename to work/work-runtime-ktx/api/res-2.5.0-beta01.txt
diff --git a/work/workmanager-ktx/api/res-2.5.0-beta02.txt b/work/work-runtime-ktx/api/res-2.5.0-beta02.txt
similarity index 100%
rename from work/workmanager-ktx/api/res-2.5.0-beta02.txt
rename to work/work-runtime-ktx/api/res-2.5.0-beta02.txt
diff --git a/work/workmanager-ktx/api/res-1.0.0-beta01.txt b/work/work-runtime-ktx/api/res-2.7.0-beta01.txt
similarity index 100%
copy from work/workmanager-ktx/api/res-1.0.0-beta01.txt
copy to work/work-runtime-ktx/api/res-2.7.0-beta01.txt
diff --git a/work/workmanager-ktx/api/res-current.txt b/work/work-runtime-ktx/api/res-current.txt
similarity index 100%
rename from work/workmanager-ktx/api/res-current.txt
rename to work/work-runtime-ktx/api/res-current.txt
diff --git a/work/workmanager-ktx/api/restricted_1.0.0-beta04.txt b/work/work-runtime-ktx/api/restricted_1.0.0-beta04.txt
similarity index 100%
rename from work/workmanager-ktx/api/restricted_1.0.0-beta04.txt
rename to work/work-runtime-ktx/api/restricted_1.0.0-beta04.txt
diff --git a/work/workmanager-ktx/api/restricted_1.0.0-rc01.txt b/work/work-runtime-ktx/api/restricted_1.0.0-rc01.txt
similarity index 100%
rename from work/workmanager-ktx/api/restricted_1.0.0-rc01.txt
rename to work/work-runtime-ktx/api/restricted_1.0.0-rc01.txt
diff --git a/work/workmanager-ktx/api/restricted_1.0.0-rc02.txt b/work/work-runtime-ktx/api/restricted_1.0.0-rc02.txt
similarity index 100%
rename from work/workmanager-ktx/api/restricted_1.0.0-rc02.txt
rename to work/work-runtime-ktx/api/restricted_1.0.0-rc02.txt
diff --git a/work/workmanager-ktx/api/restricted_1.0.0.txt b/work/work-runtime-ktx/api/restricted_1.0.0.txt
similarity index 100%
rename from work/workmanager-ktx/api/restricted_1.0.0.txt
rename to work/work-runtime-ktx/api/restricted_1.0.0.txt
diff --git a/work/workmanager-ktx/api/restricted_2.0.0-rc01.txt b/work/work-runtime-ktx/api/restricted_2.0.0-rc01.txt
similarity index 100%
rename from work/workmanager-ktx/api/restricted_2.0.0-rc01.txt
rename to work/work-runtime-ktx/api/restricted_2.0.0-rc01.txt
diff --git a/work/workmanager-ktx/api/restricted_2.0.0.txt b/work/work-runtime-ktx/api/restricted_2.0.0.txt
similarity index 100%
rename from work/workmanager-ktx/api/restricted_2.0.0.txt
rename to work/work-runtime-ktx/api/restricted_2.0.0.txt
diff --git a/work/workmanager-ktx/api/restricted_2.1.0-beta01.txt b/work/work-runtime-ktx/api/restricted_2.1.0-beta01.txt
similarity index 100%
rename from work/workmanager-ktx/api/restricted_2.1.0-beta01.txt
rename to work/work-runtime-ktx/api/restricted_2.1.0-beta01.txt
diff --git a/work/workmanager-ktx/api/restricted_2.1.0-beta02.txt b/work/work-runtime-ktx/api/restricted_2.1.0-beta02.txt
similarity index 100%
rename from work/workmanager-ktx/api/restricted_2.1.0-beta02.txt
rename to work/work-runtime-ktx/api/restricted_2.1.0-beta02.txt
diff --git a/work/workmanager-ktx/api/restricted_2.1.0-rc01.txt b/work/work-runtime-ktx/api/restricted_2.1.0-rc01.txt
similarity index 100%
rename from work/workmanager-ktx/api/restricted_2.1.0-rc01.txt
rename to work/work-runtime-ktx/api/restricted_2.1.0-rc01.txt
diff --git a/work/workmanager-ktx/api/restricted_2.1.0.txt b/work/work-runtime-ktx/api/restricted_2.1.0.txt
similarity index 100%
rename from work/workmanager-ktx/api/restricted_2.1.0.txt
rename to work/work-runtime-ktx/api/restricted_2.1.0.txt
diff --git a/work/workmanager-ktx/api/restricted_2.2.0-beta01.txt b/work/work-runtime-ktx/api/restricted_2.2.0-beta01.txt
similarity index 100%
rename from work/workmanager-ktx/api/restricted_2.2.0-beta01.txt
rename to work/work-runtime-ktx/api/restricted_2.2.0-beta01.txt
diff --git a/work/workmanager-ktx/api/restricted_2.3.0-beta01.txt b/work/work-runtime-ktx/api/restricted_2.3.0-beta01.txt
similarity index 100%
rename from work/workmanager-ktx/api/restricted_2.3.0-beta01.txt
rename to work/work-runtime-ktx/api/restricted_2.3.0-beta01.txt
diff --git a/work/workmanager-ktx/api/restricted_2.3.0-beta02.txt b/work/work-runtime-ktx/api/restricted_2.3.0-beta02.txt
similarity index 100%
rename from work/workmanager-ktx/api/restricted_2.3.0-beta02.txt
rename to work/work-runtime-ktx/api/restricted_2.3.0-beta02.txt
diff --git a/work/workmanager-ktx/api/restricted_2.3.0-rc01.txt b/work/work-runtime-ktx/api/restricted_2.3.0-rc01.txt
similarity index 100%
rename from work/workmanager-ktx/api/restricted_2.3.0-rc01.txt
rename to work/work-runtime-ktx/api/restricted_2.3.0-rc01.txt
diff --git a/work/workmanager-ktx/api/restricted_2.4.0-beta01.txt b/work/work-runtime-ktx/api/restricted_2.4.0-beta01.txt
similarity index 100%
rename from work/workmanager-ktx/api/restricted_2.4.0-beta01.txt
rename to work/work-runtime-ktx/api/restricted_2.4.0-beta01.txt
diff --git a/work/workmanager-ktx/api/restricted_2.4.0-beta02.txt b/work/work-runtime-ktx/api/restricted_2.4.0-beta02.txt
similarity index 100%
rename from work/workmanager-ktx/api/restricted_2.4.0-beta02.txt
rename to work/work-runtime-ktx/api/restricted_2.4.0-beta02.txt
diff --git a/work/workmanager-ktx/api/restricted_2.4.0-rc01.txt b/work/work-runtime-ktx/api/restricted_2.4.0-rc01.txt
similarity index 100%
rename from work/workmanager-ktx/api/restricted_2.4.0-rc01.txt
rename to work/work-runtime-ktx/api/restricted_2.4.0-rc01.txt
diff --git a/work/workmanager-ktx/api/restricted_2.5.0-beta01.txt b/work/work-runtime-ktx/api/restricted_2.5.0-beta01.txt
similarity index 100%
rename from work/workmanager-ktx/api/restricted_2.5.0-beta01.txt
rename to work/work-runtime-ktx/api/restricted_2.5.0-beta01.txt
diff --git a/work/workmanager-ktx/api/restricted_2.5.0-beta02.txt b/work/work-runtime-ktx/api/restricted_2.5.0-beta02.txt
similarity index 100%
rename from work/workmanager-ktx/api/restricted_2.5.0-beta02.txt
rename to work/work-runtime-ktx/api/restricted_2.5.0-beta02.txt
diff --git a/work/workmanager-ktx/api/current.txt b/work/work-runtime-ktx/api/restricted_2.7.0-beta01.txt
similarity index 100%
copy from work/workmanager-ktx/api/current.txt
copy to work/work-runtime-ktx/api/restricted_2.7.0-beta01.txt
diff --git a/work/workmanager-ktx/api/restricted_current.txt b/work/work-runtime-ktx/api/restricted_current.txt
similarity index 100%
rename from work/workmanager-ktx/api/restricted_current.txt
rename to work/work-runtime-ktx/api/restricted_current.txt
diff --git a/work/workmanager-ktx/build.gradle b/work/work-runtime-ktx/build.gradle
similarity index 100%
rename from work/workmanager-ktx/build.gradle
rename to work/work-runtime-ktx/build.gradle
diff --git a/work/workmanager-ktx/src/androidTest/java/androidx/work/CoroutineWorkerTest.kt b/work/work-runtime-ktx/src/androidTest/java/androidx/work/CoroutineWorkerTest.kt
similarity index 100%
rename from work/workmanager-ktx/src/androidTest/java/androidx/work/CoroutineWorkerTest.kt
rename to work/work-runtime-ktx/src/androidTest/java/androidx/work/CoroutineWorkerTest.kt
diff --git a/work/workmanager-ktx/src/androidTest/java/androidx/work/DataTest.kt b/work/work-runtime-ktx/src/androidTest/java/androidx/work/DataTest.kt
similarity index 100%
rename from work/workmanager-ktx/src/androidTest/java/androidx/work/DataTest.kt
rename to work/work-runtime-ktx/src/androidTest/java/androidx/work/DataTest.kt
diff --git a/work/workmanager-ktx/src/androidTest/java/androidx/work/ListenableFutureTest.kt b/work/work-runtime-ktx/src/androidTest/java/androidx/work/ListenableFutureTest.kt
similarity index 100%
rename from work/workmanager-ktx/src/androidTest/java/androidx/work/ListenableFutureTest.kt
rename to work/work-runtime-ktx/src/androidTest/java/androidx/work/ListenableFutureTest.kt
diff --git a/work/workmanager-ktx/src/androidTest/java/androidx/work/OneTimeWorkRequestTest.kt b/work/work-runtime-ktx/src/androidTest/java/androidx/work/OneTimeWorkRequestTest.kt
similarity index 100%
rename from work/workmanager-ktx/src/androidTest/java/androidx/work/OneTimeWorkRequestTest.kt
rename to work/work-runtime-ktx/src/androidTest/java/androidx/work/OneTimeWorkRequestTest.kt
diff --git a/work/workmanager-ktx/src/androidTest/java/androidx/work/PeriodicWorkRequestTest.kt b/work/work-runtime-ktx/src/androidTest/java/androidx/work/PeriodicWorkRequestTest.kt
similarity index 100%
rename from work/workmanager-ktx/src/androidTest/java/androidx/work/PeriodicWorkRequestTest.kt
rename to work/work-runtime-ktx/src/androidTest/java/androidx/work/PeriodicWorkRequestTest.kt
diff --git a/work/workmanager-ktx/src/androidTest/java/androidx/work/workers/ProgressUpdatingWorker.kt b/work/work-runtime-ktx/src/androidTest/java/androidx/work/workers/ProgressUpdatingWorker.kt
similarity index 100%
rename from work/workmanager-ktx/src/androidTest/java/androidx/work/workers/ProgressUpdatingWorker.kt
rename to work/work-runtime-ktx/src/androidTest/java/androidx/work/workers/ProgressUpdatingWorker.kt
diff --git a/work/workmanager-ktx/src/androidTest/java/androidx/work/workers/TestWorker.kt b/work/work-runtime-ktx/src/androidTest/java/androidx/work/workers/TestWorker.kt
similarity index 100%
rename from work/workmanager-ktx/src/androidTest/java/androidx/work/workers/TestWorker.kt
rename to work/work-runtime-ktx/src/androidTest/java/androidx/work/workers/TestWorker.kt
diff --git a/work/workmanager-ktx/src/androidTest/res/values/values.xml b/work/work-runtime-ktx/src/androidTest/res/values/values.xml
similarity index 100%
rename from work/workmanager-ktx/src/androidTest/res/values/values.xml
rename to work/work-runtime-ktx/src/androidTest/res/values/values.xml
diff --git a/work/workmanager-ktx/src/main/AndroidManifest.xml b/work/work-runtime-ktx/src/main/AndroidManifest.xml
similarity index 100%
rename from work/workmanager-ktx/src/main/AndroidManifest.xml
rename to work/work-runtime-ktx/src/main/AndroidManifest.xml
diff --git a/work/workmanager-ktx/src/main/java/androidx/work/CoroutineWorker.kt b/work/work-runtime-ktx/src/main/java/androidx/work/CoroutineWorker.kt
similarity index 100%
rename from work/workmanager-ktx/src/main/java/androidx/work/CoroutineWorker.kt
rename to work/work-runtime-ktx/src/main/java/androidx/work/CoroutineWorker.kt
diff --git a/work/workmanager-ktx/src/main/java/androidx/work/Data.kt b/work/work-runtime-ktx/src/main/java/androidx/work/Data.kt
similarity index 100%
rename from work/workmanager-ktx/src/main/java/androidx/work/Data.kt
rename to work/work-runtime-ktx/src/main/java/androidx/work/Data.kt
diff --git a/work/workmanager-ktx/src/main/java/androidx/work/DirectExecutor.kt b/work/work-runtime-ktx/src/main/java/androidx/work/DirectExecutor.kt
similarity index 100%
rename from work/workmanager-ktx/src/main/java/androidx/work/DirectExecutor.kt
rename to work/work-runtime-ktx/src/main/java/androidx/work/DirectExecutor.kt
diff --git a/work/workmanager-ktx/src/main/java/androidx/work/ListenableFuture.kt b/work/work-runtime-ktx/src/main/java/androidx/work/ListenableFuture.kt
similarity index 100%
rename from work/workmanager-ktx/src/main/java/androidx/work/ListenableFuture.kt
rename to work/work-runtime-ktx/src/main/java/androidx/work/ListenableFuture.kt
diff --git a/work/workmanager-ktx/src/main/java/androidx/work/OneTimeWorkRequest.kt b/work/work-runtime-ktx/src/main/java/androidx/work/OneTimeWorkRequest.kt
similarity index 100%
rename from work/workmanager-ktx/src/main/java/androidx/work/OneTimeWorkRequest.kt
rename to work/work-runtime-ktx/src/main/java/androidx/work/OneTimeWorkRequest.kt
diff --git a/work/workmanager-ktx/src/main/java/androidx/work/Operation.kt b/work/work-runtime-ktx/src/main/java/androidx/work/Operation.kt
similarity index 100%
rename from work/workmanager-ktx/src/main/java/androidx/work/Operation.kt
rename to work/work-runtime-ktx/src/main/java/androidx/work/Operation.kt
diff --git a/work/workmanager-ktx/src/main/java/androidx/work/PeriodicWorkRequest.kt b/work/work-runtime-ktx/src/main/java/androidx/work/PeriodicWorkRequest.kt
similarity index 100%
rename from work/workmanager-ktx/src/main/java/androidx/work/PeriodicWorkRequest.kt
rename to work/work-runtime-ktx/src/main/java/androidx/work/PeriodicWorkRequest.kt
diff --git a/work/workmanager/api/1.0.0-beta01.txt b/work/work-runtime/api/1.0.0-beta01.txt
similarity index 100%
rename from work/workmanager/api/1.0.0-beta01.txt
rename to work/work-runtime/api/1.0.0-beta01.txt
diff --git a/work/workmanager/api/1.0.0-beta02.txt b/work/work-runtime/api/1.0.0-beta02.txt
similarity index 100%
rename from work/workmanager/api/1.0.0-beta02.txt
rename to work/work-runtime/api/1.0.0-beta02.txt
diff --git a/work/workmanager/api/1.0.0-beta03.txt b/work/work-runtime/api/1.0.0-beta03.txt
similarity index 100%
rename from work/workmanager/api/1.0.0-beta03.txt
rename to work/work-runtime/api/1.0.0-beta03.txt
diff --git a/work/workmanager/api/1.0.0-beta04.txt b/work/work-runtime/api/1.0.0-beta04.txt
similarity index 100%
rename from work/workmanager/api/1.0.0-beta04.txt
rename to work/work-runtime/api/1.0.0-beta04.txt
diff --git a/work/workmanager/api/1.0.0-rc01.txt b/work/work-runtime/api/1.0.0-rc01.txt
similarity index 100%
rename from work/workmanager/api/1.0.0-rc01.txt
rename to work/work-runtime/api/1.0.0-rc01.txt
diff --git a/work/workmanager/api/1.0.0-rc02.txt b/work/work-runtime/api/1.0.0-rc02.txt
similarity index 100%
rename from work/workmanager/api/1.0.0-rc02.txt
rename to work/work-runtime/api/1.0.0-rc02.txt
diff --git a/work/workmanager/api/1.0.0.txt b/work/work-runtime/api/1.0.0.txt
similarity index 100%
rename from work/workmanager/api/1.0.0.txt
rename to work/work-runtime/api/1.0.0.txt
diff --git a/work/workmanager/api/2.0.0-rc01.txt b/work/work-runtime/api/2.0.0-rc01.txt
similarity index 100%
rename from work/workmanager/api/2.0.0-rc01.txt
rename to work/work-runtime/api/2.0.0-rc01.txt
diff --git a/work/workmanager/api/2.0.0.txt b/work/work-runtime/api/2.0.0.txt
similarity index 100%
rename from work/workmanager/api/2.0.0.txt
rename to work/work-runtime/api/2.0.0.txt
diff --git a/work/workmanager/api/2.1.0-beta01.txt b/work/work-runtime/api/2.1.0-beta01.txt
similarity index 100%
rename from work/workmanager/api/2.1.0-beta01.txt
rename to work/work-runtime/api/2.1.0-beta01.txt
diff --git a/work/workmanager/api/2.1.0-beta02.txt b/work/work-runtime/api/2.1.0-beta02.txt
similarity index 100%
rename from work/workmanager/api/2.1.0-beta02.txt
rename to work/work-runtime/api/2.1.0-beta02.txt
diff --git a/work/workmanager/api/2.1.0-rc01.txt b/work/work-runtime/api/2.1.0-rc01.txt
similarity index 100%
rename from work/workmanager/api/2.1.0-rc01.txt
rename to work/work-runtime/api/2.1.0-rc01.txt
diff --git a/work/workmanager/api/2.1.0.txt b/work/work-runtime/api/2.1.0.txt
similarity index 100%
rename from work/workmanager/api/2.1.0.txt
rename to work/work-runtime/api/2.1.0.txt
diff --git a/work/workmanager/api/2.2.0-beta01.txt b/work/work-runtime/api/2.2.0-beta01.txt
similarity index 100%
rename from work/workmanager/api/2.2.0-beta01.txt
rename to work/work-runtime/api/2.2.0-beta01.txt
diff --git a/work/workmanager/api/2.3.0-beta01.txt b/work/work-runtime/api/2.3.0-beta01.txt
similarity index 100%
rename from work/workmanager/api/2.3.0-beta01.txt
rename to work/work-runtime/api/2.3.0-beta01.txt
diff --git a/work/workmanager/api/2.3.0-beta02.txt b/work/work-runtime/api/2.3.0-beta02.txt
similarity index 100%
rename from work/workmanager/api/2.3.0-beta02.txt
rename to work/work-runtime/api/2.3.0-beta02.txt
diff --git a/work/workmanager/api/2.3.0-rc01.txt b/work/work-runtime/api/2.3.0-rc01.txt
similarity index 100%
rename from work/workmanager/api/2.3.0-rc01.txt
rename to work/work-runtime/api/2.3.0-rc01.txt
diff --git a/work/workmanager/api/2.4.0-beta01.txt b/work/work-runtime/api/2.4.0-beta01.txt
similarity index 100%
rename from work/workmanager/api/2.4.0-beta01.txt
rename to work/work-runtime/api/2.4.0-beta01.txt
diff --git a/work/workmanager/api/2.4.0-rc01.txt b/work/work-runtime/api/2.4.0-rc01.txt
similarity index 100%
rename from work/workmanager/api/2.4.0-rc01.txt
rename to work/work-runtime/api/2.4.0-rc01.txt
diff --git a/work/workmanager/api/2.5.0-alpha01.ignore b/work/work-runtime/api/2.5.0-alpha01.ignore
similarity index 100%
rename from work/workmanager/api/2.5.0-alpha01.ignore
rename to work/work-runtime/api/2.5.0-alpha01.ignore
diff --git a/work/workmanager/api/2.5.0-beta01.txt b/work/work-runtime/api/2.5.0-beta01.txt
similarity index 100%
rename from work/workmanager/api/2.5.0-beta01.txt
rename to work/work-runtime/api/2.5.0-beta01.txt
diff --git a/work/workmanager/api/2.5.0-beta02.txt b/work/work-runtime/api/2.5.0-beta02.txt
similarity index 100%
rename from work/workmanager/api/2.5.0-beta02.txt
rename to work/work-runtime/api/2.5.0-beta02.txt
diff --git a/work/workmanager/api/current.txt b/work/work-runtime/api/2.7.0-beta01.txt
similarity index 100%
copy from work/workmanager/api/current.txt
copy to work/work-runtime/api/2.7.0-beta01.txt
diff --git a/work/workmanager/api/api_lint.ignore b/work/work-runtime/api/api_lint.ignore
similarity index 100%
rename from work/workmanager/api/api_lint.ignore
rename to work/work-runtime/api/api_lint.ignore
diff --git a/work/workmanager/api/current.ignore b/work/work-runtime/api/current.ignore
similarity index 100%
rename from work/workmanager/api/current.ignore
rename to work/work-runtime/api/current.ignore
diff --git a/work/workmanager/api/current.txt b/work/work-runtime/api/current.txt
similarity index 100%
rename from work/workmanager/api/current.txt
rename to work/work-runtime/api/current.txt
diff --git a/work/workmanager/api/public_plus_experimental_2.0.0-rc01.txt b/work/work-runtime/api/public_plus_experimental_2.0.0-rc01.txt
similarity index 100%
rename from work/workmanager/api/public_plus_experimental_2.0.0-rc01.txt
rename to work/work-runtime/api/public_plus_experimental_2.0.0-rc01.txt
diff --git a/work/workmanager/api/public_plus_experimental_2.0.0.txt b/work/work-runtime/api/public_plus_experimental_2.0.0.txt
similarity index 100%
rename from work/workmanager/api/public_plus_experimental_2.0.0.txt
rename to work/work-runtime/api/public_plus_experimental_2.0.0.txt
diff --git a/work/workmanager/api/public_plus_experimental_2.1.0-beta01.txt b/work/work-runtime/api/public_plus_experimental_2.1.0-beta01.txt
similarity index 100%
rename from work/workmanager/api/public_plus_experimental_2.1.0-beta01.txt
rename to work/work-runtime/api/public_plus_experimental_2.1.0-beta01.txt
diff --git a/work/workmanager/api/public_plus_experimental_2.1.0-beta02.txt b/work/work-runtime/api/public_plus_experimental_2.1.0-beta02.txt
similarity index 100%
rename from work/workmanager/api/public_plus_experimental_2.1.0-beta02.txt
rename to work/work-runtime/api/public_plus_experimental_2.1.0-beta02.txt
diff --git a/work/workmanager/api/public_plus_experimental_2.1.0-rc01.txt b/work/work-runtime/api/public_plus_experimental_2.1.0-rc01.txt
similarity index 100%
rename from work/workmanager/api/public_plus_experimental_2.1.0-rc01.txt
rename to work/work-runtime/api/public_plus_experimental_2.1.0-rc01.txt
diff --git a/work/workmanager/api/public_plus_experimental_2.1.0.txt b/work/work-runtime/api/public_plus_experimental_2.1.0.txt
similarity index 100%
rename from work/workmanager/api/public_plus_experimental_2.1.0.txt
rename to work/work-runtime/api/public_plus_experimental_2.1.0.txt
diff --git a/work/workmanager/api/public_plus_experimental_2.2.0-beta01.txt b/work/work-runtime/api/public_plus_experimental_2.2.0-beta01.txt
similarity index 100%
rename from work/workmanager/api/public_plus_experimental_2.2.0-beta01.txt
rename to work/work-runtime/api/public_plus_experimental_2.2.0-beta01.txt
diff --git a/work/workmanager/api/public_plus_experimental_2.3.0-beta01.txt b/work/work-runtime/api/public_plus_experimental_2.3.0-beta01.txt
similarity index 100%
rename from work/workmanager/api/public_plus_experimental_2.3.0-beta01.txt
rename to work/work-runtime/api/public_plus_experimental_2.3.0-beta01.txt
diff --git a/work/workmanager/api/public_plus_experimental_2.3.0-beta02.txt b/work/work-runtime/api/public_plus_experimental_2.3.0-beta02.txt
similarity index 100%
rename from work/workmanager/api/public_plus_experimental_2.3.0-beta02.txt
rename to work/work-runtime/api/public_plus_experimental_2.3.0-beta02.txt
diff --git a/work/workmanager/api/public_plus_experimental_2.3.0-rc01.txt b/work/work-runtime/api/public_plus_experimental_2.3.0-rc01.txt
similarity index 100%
rename from work/workmanager/api/public_plus_experimental_2.3.0-rc01.txt
rename to work/work-runtime/api/public_plus_experimental_2.3.0-rc01.txt
diff --git a/work/workmanager/api/public_plus_experimental_2.4.0-beta01.txt b/work/work-runtime/api/public_plus_experimental_2.4.0-beta01.txt
similarity index 100%
rename from work/workmanager/api/public_plus_experimental_2.4.0-beta01.txt
rename to work/work-runtime/api/public_plus_experimental_2.4.0-beta01.txt
diff --git a/work/workmanager/api/public_plus_experimental_2.4.0-rc01.txt b/work/work-runtime/api/public_plus_experimental_2.4.0-rc01.txt
similarity index 100%
rename from work/workmanager/api/public_plus_experimental_2.4.0-rc01.txt
rename to work/work-runtime/api/public_plus_experimental_2.4.0-rc01.txt
diff --git a/work/workmanager/api/public_plus_experimental_2.5.0-beta01.txt b/work/work-runtime/api/public_plus_experimental_2.5.0-beta01.txt
similarity index 100%
rename from work/workmanager/api/public_plus_experimental_2.5.0-beta01.txt
rename to work/work-runtime/api/public_plus_experimental_2.5.0-beta01.txt
diff --git a/work/workmanager/api/public_plus_experimental_2.5.0-beta02.txt b/work/work-runtime/api/public_plus_experimental_2.5.0-beta02.txt
similarity index 100%
rename from work/workmanager/api/public_plus_experimental_2.5.0-beta02.txt
rename to work/work-runtime/api/public_plus_experimental_2.5.0-beta02.txt
diff --git a/work/workmanager/api/current.txt b/work/work-runtime/api/public_plus_experimental_2.7.0-beta01.txt
similarity index 100%
copy from work/workmanager/api/current.txt
copy to work/work-runtime/api/public_plus_experimental_2.7.0-beta01.txt
diff --git a/work/workmanager/api/public_plus_experimental_current.txt b/work/work-runtime/api/public_plus_experimental_current.txt
similarity index 100%
rename from work/workmanager/api/public_plus_experimental_current.txt
rename to work/work-runtime/api/public_plus_experimental_current.txt
diff --git a/work/workmanager/api/res-1.0.0-beta01.txt b/work/work-runtime/api/res-1.0.0-beta01.txt
similarity index 100%
rename from work/workmanager/api/res-1.0.0-beta01.txt
rename to work/work-runtime/api/res-1.0.0-beta01.txt
diff --git a/work/workmanager/api/res-1.0.0-beta02.txt b/work/work-runtime/api/res-1.0.0-beta02.txt
similarity index 100%
rename from work/workmanager/api/res-1.0.0-beta02.txt
rename to work/work-runtime/api/res-1.0.0-beta02.txt
diff --git a/work/workmanager/api/res-1.0.0-beta03.txt b/work/work-runtime/api/res-1.0.0-beta03.txt
similarity index 100%
rename from work/workmanager/api/res-1.0.0-beta03.txt
rename to work/work-runtime/api/res-1.0.0-beta03.txt
diff --git a/work/workmanager/api/res-1.0.0-beta04.txt b/work/work-runtime/api/res-1.0.0-beta04.txt
similarity index 100%
rename from work/workmanager/api/res-1.0.0-beta04.txt
rename to work/work-runtime/api/res-1.0.0-beta04.txt
diff --git a/work/workmanager/api/res-1.0.0-rc01.txt b/work/work-runtime/api/res-1.0.0-rc01.txt
similarity index 100%
rename from work/workmanager/api/res-1.0.0-rc01.txt
rename to work/work-runtime/api/res-1.0.0-rc01.txt
diff --git a/work/workmanager/api/res-1.0.0-rc02.txt b/work/work-runtime/api/res-1.0.0-rc02.txt
similarity index 100%
rename from work/workmanager/api/res-1.0.0-rc02.txt
rename to work/work-runtime/api/res-1.0.0-rc02.txt
diff --git a/work/workmanager/api/res-1.0.0.txt b/work/work-runtime/api/res-1.0.0.txt
similarity index 100%
rename from work/workmanager/api/res-1.0.0.txt
rename to work/work-runtime/api/res-1.0.0.txt
diff --git a/work/workmanager/api/res-2.0.0-rc01.txt b/work/work-runtime/api/res-2.0.0-rc01.txt
similarity index 100%
rename from work/workmanager/api/res-2.0.0-rc01.txt
rename to work/work-runtime/api/res-2.0.0-rc01.txt
diff --git a/work/workmanager/api/res-2.0.0.txt b/work/work-runtime/api/res-2.0.0.txt
similarity index 100%
rename from work/workmanager/api/res-2.0.0.txt
rename to work/work-runtime/api/res-2.0.0.txt
diff --git a/work/workmanager/api/res-2.1.0-beta01.txt b/work/work-runtime/api/res-2.1.0-beta01.txt
similarity index 100%
rename from work/workmanager/api/res-2.1.0-beta01.txt
rename to work/work-runtime/api/res-2.1.0-beta01.txt
diff --git a/work/workmanager/api/res-2.1.0-beta02.txt b/work/work-runtime/api/res-2.1.0-beta02.txt
similarity index 100%
rename from work/workmanager/api/res-2.1.0-beta02.txt
rename to work/work-runtime/api/res-2.1.0-beta02.txt
diff --git a/work/workmanager/api/res-2.1.0-rc01.txt b/work/work-runtime/api/res-2.1.0-rc01.txt
similarity index 100%
rename from work/workmanager/api/res-2.1.0-rc01.txt
rename to work/work-runtime/api/res-2.1.0-rc01.txt
diff --git a/work/workmanager/api/res-2.1.0.txt b/work/work-runtime/api/res-2.1.0.txt
similarity index 100%
rename from work/workmanager/api/res-2.1.0.txt
rename to work/work-runtime/api/res-2.1.0.txt
diff --git a/work/workmanager/api/res-2.2.0-beta01.txt b/work/work-runtime/api/res-2.2.0-beta01.txt
similarity index 100%
rename from work/workmanager/api/res-2.2.0-beta01.txt
rename to work/work-runtime/api/res-2.2.0-beta01.txt
diff --git a/work/workmanager/api/res-2.3.0-beta01.txt b/work/work-runtime/api/res-2.3.0-beta01.txt
similarity index 100%
rename from work/workmanager/api/res-2.3.0-beta01.txt
rename to work/work-runtime/api/res-2.3.0-beta01.txt
diff --git a/work/workmanager/api/res-2.3.0-beta02.txt b/work/work-runtime/api/res-2.3.0-beta02.txt
similarity index 100%
rename from work/workmanager/api/res-2.3.0-beta02.txt
rename to work/work-runtime/api/res-2.3.0-beta02.txt
diff --git a/work/workmanager/api/res-2.3.0-rc01.txt b/work/work-runtime/api/res-2.3.0-rc01.txt
similarity index 100%
rename from work/workmanager/api/res-2.3.0-rc01.txt
rename to work/work-runtime/api/res-2.3.0-rc01.txt
diff --git a/work/workmanager/api/res-2.4.0-beta01.txt b/work/work-runtime/api/res-2.4.0-beta01.txt
similarity index 100%
rename from work/workmanager/api/res-2.4.0-beta01.txt
rename to work/work-runtime/api/res-2.4.0-beta01.txt
diff --git a/work/workmanager/api/res-2.4.0-rc01.txt b/work/work-runtime/api/res-2.4.0-rc01.txt
similarity index 100%
rename from work/workmanager/api/res-2.4.0-rc01.txt
rename to work/work-runtime/api/res-2.4.0-rc01.txt
diff --git a/work/workmanager/api/res-2.5.0-beta01.txt b/work/work-runtime/api/res-2.5.0-beta01.txt
similarity index 100%
rename from work/workmanager/api/res-2.5.0-beta01.txt
rename to work/work-runtime/api/res-2.5.0-beta01.txt
diff --git a/work/workmanager/api/res-2.5.0-beta02.txt b/work/work-runtime/api/res-2.5.0-beta02.txt
similarity index 100%
rename from work/workmanager/api/res-2.5.0-beta02.txt
rename to work/work-runtime/api/res-2.5.0-beta02.txt
diff --git a/work/workmanager/api/res-1.0.0-beta01.txt b/work/work-runtime/api/res-2.7.0-beta01.txt
similarity index 100%
copy from work/workmanager/api/res-1.0.0-beta01.txt
copy to work/work-runtime/api/res-2.7.0-beta01.txt
diff --git a/work/workmanager/api/res-current.txt b/work/work-runtime/api/res-current.txt
similarity index 100%
rename from work/workmanager/api/res-current.txt
rename to work/work-runtime/api/res-current.txt
diff --git a/work/workmanager/api/restricted_1.0.0-beta04.txt b/work/work-runtime/api/restricted_1.0.0-beta04.txt
similarity index 100%
rename from work/workmanager/api/restricted_1.0.0-beta04.txt
rename to work/work-runtime/api/restricted_1.0.0-beta04.txt
diff --git a/work/workmanager/api/restricted_2.0.0-rc01.txt b/work/work-runtime/api/restricted_2.0.0-rc01.txt
similarity index 100%
rename from work/workmanager/api/restricted_2.0.0-rc01.txt
rename to work/work-runtime/api/restricted_2.0.0-rc01.txt
diff --git a/work/workmanager/api/restricted_2.0.0.txt b/work/work-runtime/api/restricted_2.0.0.txt
similarity index 100%
rename from work/workmanager/api/restricted_2.0.0.txt
rename to work/work-runtime/api/restricted_2.0.0.txt
diff --git a/work/workmanager/api/restricted_2.1.0-beta01.txt b/work/work-runtime/api/restricted_2.1.0-beta01.txt
similarity index 100%
rename from work/workmanager/api/restricted_2.1.0-beta01.txt
rename to work/work-runtime/api/restricted_2.1.0-beta01.txt
diff --git a/work/workmanager/api/restricted_2.1.0-beta02.txt b/work/work-runtime/api/restricted_2.1.0-beta02.txt
similarity index 100%
rename from work/workmanager/api/restricted_2.1.0-beta02.txt
rename to work/work-runtime/api/restricted_2.1.0-beta02.txt
diff --git a/work/workmanager/api/restricted_2.1.0-rc01.txt b/work/work-runtime/api/restricted_2.1.0-rc01.txt
similarity index 100%
rename from work/workmanager/api/restricted_2.1.0-rc01.txt
rename to work/work-runtime/api/restricted_2.1.0-rc01.txt
diff --git a/work/workmanager/api/restricted_2.1.0.txt b/work/work-runtime/api/restricted_2.1.0.txt
similarity index 100%
rename from work/workmanager/api/restricted_2.1.0.txt
rename to work/work-runtime/api/restricted_2.1.0.txt
diff --git a/work/workmanager/api/restricted_2.2.0-beta01.txt b/work/work-runtime/api/restricted_2.2.0-beta01.txt
similarity index 100%
rename from work/workmanager/api/restricted_2.2.0-beta01.txt
rename to work/work-runtime/api/restricted_2.2.0-beta01.txt
diff --git a/work/workmanager/api/restricted_2.3.0-beta01.txt b/work/work-runtime/api/restricted_2.3.0-beta01.txt
similarity index 100%
rename from work/workmanager/api/restricted_2.3.0-beta01.txt
rename to work/work-runtime/api/restricted_2.3.0-beta01.txt
diff --git a/work/workmanager/api/restricted_2.3.0-beta02.txt b/work/work-runtime/api/restricted_2.3.0-beta02.txt
similarity index 100%
rename from work/workmanager/api/restricted_2.3.0-beta02.txt
rename to work/work-runtime/api/restricted_2.3.0-beta02.txt
diff --git a/work/workmanager/api/restricted_2.3.0-rc01.txt b/work/work-runtime/api/restricted_2.3.0-rc01.txt
similarity index 100%
rename from work/workmanager/api/restricted_2.3.0-rc01.txt
rename to work/work-runtime/api/restricted_2.3.0-rc01.txt
diff --git a/work/workmanager/api/restricted_2.4.0-beta01.txt b/work/work-runtime/api/restricted_2.4.0-beta01.txt
similarity index 100%
rename from work/workmanager/api/restricted_2.4.0-beta01.txt
rename to work/work-runtime/api/restricted_2.4.0-beta01.txt
diff --git a/work/workmanager/api/restricted_2.4.0-rc01.txt b/work/work-runtime/api/restricted_2.4.0-rc01.txt
similarity index 100%
rename from work/workmanager/api/restricted_2.4.0-rc01.txt
rename to work/work-runtime/api/restricted_2.4.0-rc01.txt
diff --git a/work/workmanager/api/restricted_2.5.0-alpha01.ignore b/work/work-runtime/api/restricted_2.5.0-alpha01.ignore
similarity index 100%
rename from work/workmanager/api/restricted_2.5.0-alpha01.ignore
rename to work/work-runtime/api/restricted_2.5.0-alpha01.ignore
diff --git a/work/workmanager/api/restricted_2.5.0-beta01.txt b/work/work-runtime/api/restricted_2.5.0-beta01.txt
similarity index 100%
rename from work/workmanager/api/restricted_2.5.0-beta01.txt
rename to work/work-runtime/api/restricted_2.5.0-beta01.txt
diff --git a/work/workmanager/api/restricted_2.5.0-beta02.txt b/work/work-runtime/api/restricted_2.5.0-beta02.txt
similarity index 100%
rename from work/workmanager/api/restricted_2.5.0-beta02.txt
rename to work/work-runtime/api/restricted_2.5.0-beta02.txt
diff --git a/work/workmanager/api/current.txt b/work/work-runtime/api/restricted_2.7.0-beta01.txt
similarity index 100%
copy from work/workmanager/api/current.txt
copy to work/work-runtime/api/restricted_2.7.0-beta01.txt
diff --git a/work/workmanager/api/restricted_current.ignore b/work/work-runtime/api/restricted_current.ignore
similarity index 100%
rename from work/workmanager/api/restricted_current.ignore
rename to work/work-runtime/api/restricted_current.ignore
diff --git a/work/workmanager/api/restricted_current.txt b/work/work-runtime/api/restricted_current.txt
similarity index 100%
rename from work/workmanager/api/restricted_current.txt
rename to work/work-runtime/api/restricted_current.txt
diff --git a/work/workmanager/build.gradle b/work/work-runtime/build.gradle
similarity index 100%
rename from work/workmanager/build.gradle
rename to work/work-runtime/build.gradle
diff --git a/work/workmanager/lint-baseline.xml b/work/work-runtime/lint-baseline.xml
similarity index 100%
rename from work/workmanager/lint-baseline.xml
rename to work/work-runtime/lint-baseline.xml
diff --git a/work/workmanager/proguard-rules.pro b/work/work-runtime/proguard-rules.pro
similarity index 100%
rename from work/workmanager/proguard-rules.pro
rename to work/work-runtime/proguard-rules.pro
diff --git a/work/workmanager/src/androidTest/java/androidx/work/DatabaseTest.java b/work/work-runtime/src/androidTest/java/androidx/work/DatabaseTest.java
similarity index 100%
rename from work/workmanager/src/androidTest/java/androidx/work/DatabaseTest.java
rename to work/work-runtime/src/androidTest/java/androidx/work/DatabaseTest.java
diff --git a/work/workmanager/src/androidTest/java/androidx/work/DefaultWorkerFactoryTest.java b/work/work-runtime/src/androidTest/java/androidx/work/DefaultWorkerFactoryTest.java
similarity index 100%
rename from work/workmanager/src/androidTest/java/androidx/work/DefaultWorkerFactoryTest.java
rename to work/work-runtime/src/androidTest/java/androidx/work/DefaultWorkerFactoryTest.java
diff --git a/work/workmanager/src/androidTest/java/androidx/work/DelegatingWorkerFactoryTest.kt b/work/work-runtime/src/androidTest/java/androidx/work/DelegatingWorkerFactoryTest.kt
similarity index 100%
rename from work/workmanager/src/androidTest/java/androidx/work/DelegatingWorkerFactoryTest.kt
rename to work/work-runtime/src/androidTest/java/androidx/work/DelegatingWorkerFactoryTest.kt
diff --git a/work/workmanager/src/androidTest/java/androidx/work/InputMergerFactoryTest.kt b/work/work-runtime/src/androidTest/java/androidx/work/InputMergerFactoryTest.kt
similarity index 100%
rename from work/workmanager/src/androidTest/java/androidx/work/InputMergerFactoryTest.kt
rename to work/work-runtime/src/androidTest/java/androidx/work/InputMergerFactoryTest.kt
diff --git a/work/workmanager/src/androidTest/java/androidx/work/PeriodicWorkTest.java b/work/work-runtime/src/androidTest/java/androidx/work/PeriodicWorkTest.java
similarity index 100%
rename from work/workmanager/src/androidTest/java/androidx/work/PeriodicWorkTest.java
rename to work/work-runtime/src/androidTest/java/androidx/work/PeriodicWorkTest.java
diff --git a/work/workmanager/src/androidTest/java/androidx/work/RawWorkInfoDaoTest.kt b/work/work-runtime/src/androidTest/java/androidx/work/RawWorkInfoDaoTest.kt
similarity index 100%
rename from work/workmanager/src/androidTest/java/androidx/work/RawWorkInfoDaoTest.kt
rename to work/work-runtime/src/androidTest/java/androidx/work/RawWorkInfoDaoTest.kt
diff --git a/work/workmanager/src/androidTest/java/androidx/work/ResultTest.java b/work/work-runtime/src/androidTest/java/androidx/work/ResultTest.java
similarity index 100%
rename from work/workmanager/src/androidTest/java/androidx/work/ResultTest.java
rename to work/work-runtime/src/androidTest/java/androidx/work/ResultTest.java
diff --git a/work/workmanager/src/androidTest/java/androidx/work/WorkDatabaseMigrationTest.java b/work/work-runtime/src/androidTest/java/androidx/work/WorkDatabaseMigrationTest.java
similarity index 100%
rename from work/workmanager/src/androidTest/java/androidx/work/WorkDatabaseMigrationTest.java
rename to work/work-runtime/src/androidTest/java/androidx/work/WorkDatabaseMigrationTest.java
diff --git a/work/workmanager/src/androidTest/java/androidx/work/WorkDatabasePathHelperTest.kt b/work/work-runtime/src/androidTest/java/androidx/work/WorkDatabasePathHelperTest.kt
similarity index 100%
rename from work/workmanager/src/androidTest/java/androidx/work/WorkDatabasePathHelperTest.kt
rename to work/work-runtime/src/androidTest/java/androidx/work/WorkDatabasePathHelperTest.kt
diff --git a/work/workmanager/src/androidTest/java/androidx/work/WorkForegroundRunnableTest.kt b/work/work-runtime/src/androidTest/java/androidx/work/WorkForegroundRunnableTest.kt
similarity index 100%
rename from work/workmanager/src/androidTest/java/androidx/work/WorkForegroundRunnableTest.kt
rename to work/work-runtime/src/androidTest/java/androidx/work/WorkForegroundRunnableTest.kt
diff --git a/work/workmanager/src/androidTest/java/androidx/work/WorkManagerTest.java b/work/work-runtime/src/androidTest/java/androidx/work/WorkManagerTest.java
similarity index 100%
rename from work/workmanager/src/androidTest/java/androidx/work/WorkManagerTest.java
rename to work/work-runtime/src/androidTest/java/androidx/work/WorkManagerTest.java
diff --git a/work/workmanager/src/androidTest/java/androidx/work/WorkSpecDaoTest.java b/work/work-runtime/src/androidTest/java/androidx/work/WorkSpecDaoTest.java
similarity index 100%
rename from work/workmanager/src/androidTest/java/androidx/work/WorkSpecDaoTest.java
rename to work/work-runtime/src/androidTest/java/androidx/work/WorkSpecDaoTest.java
diff --git a/work/workmanager/src/androidTest/java/androidx/work/WorkSpecTest.java b/work/work-runtime/src/androidTest/java/androidx/work/WorkSpecTest.java
similarity index 100%
rename from work/workmanager/src/androidTest/java/androidx/work/WorkSpecTest.java
rename to work/work-runtime/src/androidTest/java/androidx/work/WorkSpecTest.java
diff --git a/work/workmanager/src/androidTest/java/androidx/work/WorkTest.java b/work/work-runtime/src/androidTest/java/androidx/work/WorkTest.java
similarity index 100%
rename from work/workmanager/src/androidTest/java/androidx/work/WorkTest.java
rename to work/work-runtime/src/androidTest/java/androidx/work/WorkTest.java
diff --git a/work/workmanager/src/androidTest/java/androidx/work/impl/ProcessorTest.java b/work/work-runtime/src/androidTest/java/androidx/work/impl/ProcessorTest.java
similarity index 100%
rename from work/workmanager/src/androidTest/java/androidx/work/impl/ProcessorTest.java
rename to work/work-runtime/src/androidTest/java/androidx/work/impl/ProcessorTest.java
diff --git a/work/workmanager/src/androidTest/java/androidx/work/impl/SchedulersTest.java b/work/work-runtime/src/androidTest/java/androidx/work/impl/SchedulersTest.java
similarity index 100%
rename from work/workmanager/src/androidTest/java/androidx/work/impl/SchedulersTest.java
rename to work/work-runtime/src/androidTest/java/androidx/work/impl/SchedulersTest.java
diff --git a/work/workmanager/src/androidTest/java/androidx/work/impl/WorkContinuationImplTest.java b/work/work-runtime/src/androidTest/java/androidx/work/impl/WorkContinuationImplTest.java
similarity index 100%
rename from work/workmanager/src/androidTest/java/androidx/work/impl/WorkContinuationImplTest.java
rename to work/work-runtime/src/androidTest/java/androidx/work/impl/WorkContinuationImplTest.java
diff --git a/work/workmanager/src/androidTest/java/androidx/work/impl/WorkManagerImplLargeExecutorTest.java b/work/work-runtime/src/androidTest/java/androidx/work/impl/WorkManagerImplLargeExecutorTest.java
similarity index 100%
rename from work/workmanager/src/androidTest/java/androidx/work/impl/WorkManagerImplLargeExecutorTest.java
rename to work/work-runtime/src/androidTest/java/androidx/work/impl/WorkManagerImplLargeExecutorTest.java
diff --git a/work/workmanager/src/androidTest/java/androidx/work/impl/WorkManagerImplTest.java b/work/work-runtime/src/androidTest/java/androidx/work/impl/WorkManagerImplTest.java
similarity index 100%
rename from work/workmanager/src/androidTest/java/androidx/work/impl/WorkManagerImplTest.java
rename to work/work-runtime/src/androidTest/java/androidx/work/impl/WorkManagerImplTest.java
diff --git a/work/workmanager/src/androidTest/java/androidx/work/impl/WorkManagerInitializationTest.kt b/work/work-runtime/src/androidTest/java/androidx/work/impl/WorkManagerInitializationTest.kt
similarity index 100%
rename from work/workmanager/src/androidTest/java/androidx/work/impl/WorkManagerInitializationTest.kt
rename to work/work-runtime/src/androidTest/java/androidx/work/impl/WorkManagerInitializationTest.kt
diff --git a/work/workmanager/src/androidTest/java/androidx/work/impl/WorkerWrapperTest.java b/work/work-runtime/src/androidTest/java/androidx/work/impl/WorkerWrapperTest.java
similarity index 100%
rename from work/workmanager/src/androidTest/java/androidx/work/impl/WorkerWrapperTest.java
rename to work/work-runtime/src/androidTest/java/androidx/work/impl/WorkerWrapperTest.java
diff --git a/work/workmanager/src/androidTest/java/androidx/work/impl/background/greedy/DelayedWorkTrackerTest.kt b/work/work-runtime/src/androidTest/java/androidx/work/impl/background/greedy/DelayedWorkTrackerTest.kt
similarity index 100%
rename from work/workmanager/src/androidTest/java/androidx/work/impl/background/greedy/DelayedWorkTrackerTest.kt
rename to work/work-runtime/src/androidTest/java/androidx/work/impl/background/greedy/DelayedWorkTrackerTest.kt
diff --git a/work/workmanager/src/androidTest/java/androidx/work/impl/background/greedy/GreedySchedulerTest.java b/work/work-runtime/src/androidTest/java/androidx/work/impl/background/greedy/GreedySchedulerTest.java
similarity index 100%
rename from work/workmanager/src/androidTest/java/androidx/work/impl/background/greedy/GreedySchedulerTest.java
rename to work/work-runtime/src/androidTest/java/androidx/work/impl/background/greedy/GreedySchedulerTest.java
diff --git a/work/workmanager/src/androidTest/java/androidx/work/impl/background/systemalarm/AlarmsTest.java b/work/work-runtime/src/androidTest/java/androidx/work/impl/background/systemalarm/AlarmsTest.java
similarity index 100%
rename from work/workmanager/src/androidTest/java/androidx/work/impl/background/systemalarm/AlarmsTest.java
rename to work/work-runtime/src/androidTest/java/androidx/work/impl/background/systemalarm/AlarmsTest.java
diff --git a/work/workmanager/src/androidTest/java/androidx/work/impl/background/systemalarm/SystemAlarmDispatcherTest.java b/work/work-runtime/src/androidTest/java/androidx/work/impl/background/systemalarm/SystemAlarmDispatcherTest.java
similarity index 100%
rename from work/workmanager/src/androidTest/java/androidx/work/impl/background/systemalarm/SystemAlarmDispatcherTest.java
rename to work/work-runtime/src/androidTest/java/androidx/work/impl/background/systemalarm/SystemAlarmDispatcherTest.java
diff --git a/work/workmanager/src/androidTest/java/androidx/work/impl/background/systemalarm/WorkTimerTest.java b/work/work-runtime/src/androidTest/java/androidx/work/impl/background/systemalarm/WorkTimerTest.java
similarity index 100%
rename from work/workmanager/src/androidTest/java/androidx/work/impl/background/systemalarm/WorkTimerTest.java
rename to work/work-runtime/src/androidTest/java/androidx/work/impl/background/systemalarm/WorkTimerTest.java
diff --git a/work/workmanager/src/androidTest/java/androidx/work/impl/background/systemjob/SystemJobInfoConverterTest.java b/work/work-runtime/src/androidTest/java/androidx/work/impl/background/systemjob/SystemJobInfoConverterTest.java
similarity index 100%
rename from work/workmanager/src/androidTest/java/androidx/work/impl/background/systemjob/SystemJobInfoConverterTest.java
rename to work/work-runtime/src/androidTest/java/androidx/work/impl/background/systemjob/SystemJobInfoConverterTest.java
diff --git a/work/workmanager/src/androidTest/java/androidx/work/impl/background/systemjob/SystemJobSchedulerTest.java b/work/work-runtime/src/androidTest/java/androidx/work/impl/background/systemjob/SystemJobSchedulerTest.java
similarity index 100%
rename from work/workmanager/src/androidTest/java/androidx/work/impl/background/systemjob/SystemJobSchedulerTest.java
rename to work/work-runtime/src/androidTest/java/androidx/work/impl/background/systemjob/SystemJobSchedulerTest.java
diff --git a/work/workmanager/src/androidTest/java/androidx/work/impl/background/systemjob/SystemJobServiceTest.java b/work/work-runtime/src/androidTest/java/androidx/work/impl/background/systemjob/SystemJobServiceTest.java
similarity index 100%
rename from work/workmanager/src/androidTest/java/androidx/work/impl/background/systemjob/SystemJobServiceTest.java
rename to work/work-runtime/src/androidTest/java/androidx/work/impl/background/systemjob/SystemJobServiceTest.java
diff --git a/work/workmanager/src/androidTest/java/androidx/work/impl/constraints/WorkConstraintsTrackerTest.java b/work/work-runtime/src/androidTest/java/androidx/work/impl/constraints/WorkConstraintsTrackerTest.java
similarity index 100%
rename from work/workmanager/src/androidTest/java/androidx/work/impl/constraints/WorkConstraintsTrackerTest.java
rename to work/work-runtime/src/androidTest/java/androidx/work/impl/constraints/WorkConstraintsTrackerTest.java
diff --git a/work/workmanager/src/androidTest/java/androidx/work/impl/constraints/controllers/ConstraintControllerTest.java b/work/work-runtime/src/androidTest/java/androidx/work/impl/constraints/controllers/ConstraintControllerTest.java
similarity index 100%
rename from work/workmanager/src/androidTest/java/androidx/work/impl/constraints/controllers/ConstraintControllerTest.java
rename to work/work-runtime/src/androidTest/java/androidx/work/impl/constraints/controllers/ConstraintControllerTest.java
diff --git a/work/workmanager/src/androidTest/java/androidx/work/impl/constraints/trackers/BatteryChargingTrackerTest.java b/work/work-runtime/src/androidTest/java/androidx/work/impl/constraints/trackers/BatteryChargingTrackerTest.java
similarity index 100%
rename from work/workmanager/src/androidTest/java/androidx/work/impl/constraints/trackers/BatteryChargingTrackerTest.java
rename to work/work-runtime/src/androidTest/java/androidx/work/impl/constraints/trackers/BatteryChargingTrackerTest.java
diff --git a/work/workmanager/src/androidTest/java/androidx/work/impl/constraints/trackers/BatteryNotLowTrackerTest.java b/work/work-runtime/src/androidTest/java/androidx/work/impl/constraints/trackers/BatteryNotLowTrackerTest.java
similarity index 100%
rename from work/workmanager/src/androidTest/java/androidx/work/impl/constraints/trackers/BatteryNotLowTrackerTest.java
rename to work/work-runtime/src/androidTest/java/androidx/work/impl/constraints/trackers/BatteryNotLowTrackerTest.java
diff --git a/work/workmanager/src/androidTest/java/androidx/work/impl/constraints/trackers/ConstraintTrackerTest.java b/work/work-runtime/src/androidTest/java/androidx/work/impl/constraints/trackers/ConstraintTrackerTest.java
similarity index 100%
rename from work/workmanager/src/androidTest/java/androidx/work/impl/constraints/trackers/ConstraintTrackerTest.java
rename to work/work-runtime/src/androidTest/java/androidx/work/impl/constraints/trackers/ConstraintTrackerTest.java
diff --git a/work/workmanager/src/androidTest/java/androidx/work/impl/constraints/trackers/NetworkStateTrackerTest.java b/work/work-runtime/src/androidTest/java/androidx/work/impl/constraints/trackers/NetworkStateTrackerTest.java
similarity index 100%
rename from work/workmanager/src/androidTest/java/androidx/work/impl/constraints/trackers/NetworkStateTrackerTest.java
rename to work/work-runtime/src/androidTest/java/androidx/work/impl/constraints/trackers/NetworkStateTrackerTest.java
diff --git a/work/workmanager/src/androidTest/java/androidx/work/impl/constraints/trackers/StorageNotLowTrackerTest.java b/work/work-runtime/src/androidTest/java/androidx/work/impl/constraints/trackers/StorageNotLowTrackerTest.java
similarity index 100%
rename from work/workmanager/src/androidTest/java/androidx/work/impl/constraints/trackers/StorageNotLowTrackerTest.java
rename to work/work-runtime/src/androidTest/java/androidx/work/impl/constraints/trackers/StorageNotLowTrackerTest.java
diff --git a/work/workmanager/src/androidTest/java/androidx/work/impl/foreground/SystemForegroundDispatcherTest.kt b/work/work-runtime/src/androidTest/java/androidx/work/impl/foreground/SystemForegroundDispatcherTest.kt
similarity index 100%
rename from work/workmanager/src/androidTest/java/androidx/work/impl/foreground/SystemForegroundDispatcherTest.kt
rename to work/work-runtime/src/androidTest/java/androidx/work/impl/foreground/SystemForegroundDispatcherTest.kt
diff --git a/work/workmanager/src/androidTest/java/androidx/work/impl/foreground/WorkerWrapperForegroundTest.kt b/work/work-runtime/src/androidTest/java/androidx/work/impl/foreground/WorkerWrapperForegroundTest.kt
similarity index 100%
rename from work/workmanager/src/androidTest/java/androidx/work/impl/foreground/WorkerWrapperForegroundTest.kt
rename to work/work-runtime/src/androidTest/java/androidx/work/impl/foreground/WorkerWrapperForegroundTest.kt
diff --git a/work/workmanager/src/androidTest/java/androidx/work/impl/utils/EnqueueRunnableTest.java b/work/work-runtime/src/androidTest/java/androidx/work/impl/utils/EnqueueRunnableTest.java
similarity index 100%
rename from work/workmanager/src/androidTest/java/androidx/work/impl/utils/EnqueueRunnableTest.java
rename to work/work-runtime/src/androidTest/java/androidx/work/impl/utils/EnqueueRunnableTest.java
diff --git a/work/workmanager/src/androidTest/java/androidx/work/impl/utils/ForceStopRunnableTest.java b/work/work-runtime/src/androidTest/java/androidx/work/impl/utils/ForceStopRunnableTest.java
similarity index 100%
rename from work/workmanager/src/androidTest/java/androidx/work/impl/utils/ForceStopRunnableTest.java
rename to work/work-runtime/src/androidTest/java/androidx/work/impl/utils/ForceStopRunnableTest.java
diff --git a/work/workmanager/src/androidTest/java/androidx/work/impl/utils/IdGeneratorTest.java b/work/work-runtime/src/androidTest/java/androidx/work/impl/utils/IdGeneratorTest.java
similarity index 100%
rename from work/workmanager/src/androidTest/java/androidx/work/impl/utils/IdGeneratorTest.java
rename to work/work-runtime/src/androidTest/java/androidx/work/impl/utils/IdGeneratorTest.java
diff --git a/work/workmanager/src/androidTest/java/androidx/work/impl/utils/LiveDataUtilsTest.java b/work/work-runtime/src/androidTest/java/androidx/work/impl/utils/LiveDataUtilsTest.java
similarity index 100%
rename from work/workmanager/src/androidTest/java/androidx/work/impl/utils/LiveDataUtilsTest.java
rename to work/work-runtime/src/androidTest/java/androidx/work/impl/utils/LiveDataUtilsTest.java
diff --git a/work/workmanager/src/androidTest/java/androidx/work/impl/utils/SerialExecutorTest.kt b/work/work-runtime/src/androidTest/java/androidx/work/impl/utils/SerialExecutorTest.kt
similarity index 100%
rename from work/workmanager/src/androidTest/java/androidx/work/impl/utils/SerialExecutorTest.kt
rename to work/work-runtime/src/androidTest/java/androidx/work/impl/utils/SerialExecutorTest.kt
diff --git a/work/workmanager/src/androidTest/java/androidx/work/impl/utils/WorkForegroundUpdaterTest.kt b/work/work-runtime/src/androidTest/java/androidx/work/impl/utils/WorkForegroundUpdaterTest.kt
similarity index 100%
rename from work/workmanager/src/androidTest/java/androidx/work/impl/utils/WorkForegroundUpdaterTest.kt
rename to work/work-runtime/src/androidTest/java/androidx/work/impl/utils/WorkForegroundUpdaterTest.kt
diff --git a/work/workmanager/src/androidTest/java/androidx/work/impl/utils/WorkProgressUpdaterTest.kt b/work/work-runtime/src/androidTest/java/androidx/work/impl/utils/WorkProgressUpdaterTest.kt
similarity index 100%
rename from work/workmanager/src/androidTest/java/androidx/work/impl/utils/WorkProgressUpdaterTest.kt
rename to work/work-runtime/src/androidTest/java/androidx/work/impl/utils/WorkProgressUpdaterTest.kt
diff --git a/work/workmanager/src/androidTest/java/androidx/work/impl/utils/taskexecutor/InstantWorkTaskExecutor.java b/work/work-runtime/src/androidTest/java/androidx/work/impl/utils/taskexecutor/InstantWorkTaskExecutor.java
similarity index 100%
rename from work/workmanager/src/androidTest/java/androidx/work/impl/utils/taskexecutor/InstantWorkTaskExecutor.java
rename to work/work-runtime/src/androidTest/java/androidx/work/impl/utils/taskexecutor/InstantWorkTaskExecutor.java
diff --git a/work/workmanager/src/androidTest/java/androidx/work/impl/workers/ConstraintTrackingWorkerTest.java b/work/work-runtime/src/androidTest/java/androidx/work/impl/workers/ConstraintTrackingWorkerTest.java
similarity index 100%
rename from work/workmanager/src/androidTest/java/androidx/work/impl/workers/ConstraintTrackingWorkerTest.java
rename to work/work-runtime/src/androidTest/java/androidx/work/impl/workers/ConstraintTrackingWorkerTest.java
diff --git a/work/workmanager/src/androidTest/java/androidx/work/worker/ChainedArgumentWorker.java b/work/work-runtime/src/androidTest/java/androidx/work/worker/ChainedArgumentWorker.java
similarity index 100%
rename from work/workmanager/src/androidTest/java/androidx/work/worker/ChainedArgumentWorker.java
rename to work/work-runtime/src/androidTest/java/androidx/work/worker/ChainedArgumentWorker.java
diff --git a/work/workmanager/src/androidTest/java/androidx/work/worker/EchoingWorker.java b/work/work-runtime/src/androidTest/java/androidx/work/worker/EchoingWorker.java
similarity index 100%
rename from work/workmanager/src/androidTest/java/androidx/work/worker/EchoingWorker.java
rename to work/work-runtime/src/androidTest/java/androidx/work/worker/EchoingWorker.java
diff --git a/work/workmanager/src/androidTest/java/androidx/work/worker/ExceptionWorker.java b/work/work-runtime/src/androidTest/java/androidx/work/worker/ExceptionWorker.java
similarity index 100%
rename from work/workmanager/src/androidTest/java/androidx/work/worker/ExceptionWorker.java
rename to work/work-runtime/src/androidTest/java/androidx/work/worker/ExceptionWorker.java
diff --git a/work/workmanager/src/androidTest/java/androidx/work/worker/FailureWorker.java b/work/work-runtime/src/androidTest/java/androidx/work/worker/FailureWorker.java
similarity index 100%
rename from work/workmanager/src/androidTest/java/androidx/work/worker/FailureWorker.java
rename to work/work-runtime/src/androidTest/java/androidx/work/worker/FailureWorker.java
diff --git a/work/workmanager/src/androidTest/java/androidx/work/worker/InfiniteTestWorker.java b/work/work-runtime/src/androidTest/java/androidx/work/worker/InfiniteTestWorker.java
similarity index 100%
rename from work/workmanager/src/androidTest/java/androidx/work/worker/InfiniteTestWorker.java
rename to work/work-runtime/src/androidTest/java/androidx/work/worker/InfiniteTestWorker.java
diff --git a/work/workmanager/src/androidTest/java/androidx/work/worker/InterruptionAwareWorker.java b/work/work-runtime/src/androidTest/java/androidx/work/worker/InterruptionAwareWorker.java
similarity index 100%
rename from work/workmanager/src/androidTest/java/androidx/work/worker/InterruptionAwareWorker.java
rename to work/work-runtime/src/androidTest/java/androidx/work/worker/InterruptionAwareWorker.java
diff --git a/work/workmanager/src/androidTest/java/androidx/work/worker/LatchWorker.java b/work/work-runtime/src/androidTest/java/androidx/work/worker/LatchWorker.java
similarity index 100%
rename from work/workmanager/src/androidTest/java/androidx/work/worker/LatchWorker.java
rename to work/work-runtime/src/androidTest/java/androidx/work/worker/LatchWorker.java
diff --git a/work/workmanager/src/androidTest/java/androidx/work/worker/RandomSleepTestWorker.java b/work/work-runtime/src/androidTest/java/androidx/work/worker/RandomSleepTestWorker.java
similarity index 100%
rename from work/workmanager/src/androidTest/java/androidx/work/worker/RandomSleepTestWorker.java
rename to work/work-runtime/src/androidTest/java/androidx/work/worker/RandomSleepTestWorker.java
diff --git a/work/workmanager/src/androidTest/java/androidx/work/worker/RetryWorker.java b/work/work-runtime/src/androidTest/java/androidx/work/worker/RetryWorker.java
similarity index 100%
rename from work/workmanager/src/androidTest/java/androidx/work/worker/RetryWorker.java
rename to work/work-runtime/src/androidTest/java/androidx/work/worker/RetryWorker.java
diff --git a/work/workmanager/src/androidTest/java/androidx/work/worker/ReturnNullResultWorker.java b/work/work-runtime/src/androidTest/java/androidx/work/worker/ReturnNullResultWorker.java
similarity index 100%
rename from work/workmanager/src/androidTest/java/androidx/work/worker/ReturnNullResultWorker.java
rename to work/work-runtime/src/androidTest/java/androidx/work/worker/ReturnNullResultWorker.java
diff --git a/work/workmanager/src/androidTest/java/androidx/work/worker/SleepTestWorker.java b/work/work-runtime/src/androidTest/java/androidx/work/worker/SleepTestWorker.java
similarity index 100%
rename from work/workmanager/src/androidTest/java/androidx/work/worker/SleepTestWorker.java
rename to work/work-runtime/src/androidTest/java/androidx/work/worker/SleepTestWorker.java
diff --git a/work/workmanager/src/androidTest/java/androidx/work/worker/StopAwareForegroundWorker.kt b/work/work-runtime/src/androidTest/java/androidx/work/worker/StopAwareForegroundWorker.kt
similarity index 100%
rename from work/workmanager/src/androidTest/java/androidx/work/worker/StopAwareForegroundWorker.kt
rename to work/work-runtime/src/androidTest/java/androidx/work/worker/StopAwareForegroundWorker.kt
diff --git a/work/workmanager/src/androidTest/java/androidx/work/worker/StopAwareWorker.java b/work/work-runtime/src/androidTest/java/androidx/work/worker/StopAwareWorker.java
similarity index 100%
rename from work/workmanager/src/androidTest/java/androidx/work/worker/StopAwareWorker.java
rename to work/work-runtime/src/androidTest/java/androidx/work/worker/StopAwareWorker.java
diff --git a/work/workmanager/src/androidTest/java/androidx/work/worker/TestForegroundWorker.kt b/work/work-runtime/src/androidTest/java/androidx/work/worker/TestForegroundWorker.kt
similarity index 100%
rename from work/workmanager/src/androidTest/java/androidx/work/worker/TestForegroundWorker.kt
rename to work/work-runtime/src/androidTest/java/androidx/work/worker/TestForegroundWorker.kt
diff --git a/work/workmanager/src/androidTest/java/androidx/work/worker/TestWorker.java b/work/work-runtime/src/androidTest/java/androidx/work/worker/TestWorker.java
similarity index 100%
rename from work/workmanager/src/androidTest/java/androidx/work/worker/TestWorker.java
rename to work/work-runtime/src/androidTest/java/androidx/work/worker/TestWorker.java
diff --git a/work/workmanager/src/androidTest/java/androidx/work/worker/UsedWorker.java b/work/work-runtime/src/androidTest/java/androidx/work/worker/UsedWorker.java
similarity index 100%
rename from work/workmanager/src/androidTest/java/androidx/work/worker/UsedWorker.java
rename to work/work-runtime/src/androidTest/java/androidx/work/worker/UsedWorker.java
diff --git a/work/workmanager/src/androidTest/res/values/values.xml b/work/work-runtime/src/androidTest/res/values/values.xml
similarity index 100%
rename from work/workmanager/src/androidTest/res/values/values.xml
rename to work/work-runtime/src/androidTest/res/values/values.xml
diff --git a/work/workmanager/src/main/AndroidManifest.xml b/work/work-runtime/src/main/AndroidManifest.xml
similarity index 100%
rename from work/workmanager/src/main/AndroidManifest.xml
rename to work/work-runtime/src/main/AndroidManifest.xml
diff --git a/work/workmanager/src/main/aidl/androidx/work/multiprocess/IListenableWorkerImpl.aidl b/work/work-runtime/src/main/aidl/androidx/work/multiprocess/IListenableWorkerImpl.aidl
similarity index 100%
rename from work/workmanager/src/main/aidl/androidx/work/multiprocess/IListenableWorkerImpl.aidl
rename to work/work-runtime/src/main/aidl/androidx/work/multiprocess/IListenableWorkerImpl.aidl
diff --git a/work/workmanager/src/main/aidl/androidx/work/multiprocess/IWorkManagerImpl.aidl b/work/work-runtime/src/main/aidl/androidx/work/multiprocess/IWorkManagerImpl.aidl
similarity index 100%
rename from work/workmanager/src/main/aidl/androidx/work/multiprocess/IWorkManagerImpl.aidl
rename to work/work-runtime/src/main/aidl/androidx/work/multiprocess/IWorkManagerImpl.aidl
diff --git a/work/workmanager/src/main/aidl/androidx/work/multiprocess/IWorkManagerImplCallback.aidl b/work/work-runtime/src/main/aidl/androidx/work/multiprocess/IWorkManagerImplCallback.aidl
similarity index 100%
rename from work/workmanager/src/main/aidl/androidx/work/multiprocess/IWorkManagerImplCallback.aidl
rename to work/work-runtime/src/main/aidl/androidx/work/multiprocess/IWorkManagerImplCallback.aidl
diff --git a/work/workmanager/src/main/java/androidx/work/ArrayCreatingInputMerger.java b/work/work-runtime/src/main/java/androidx/work/ArrayCreatingInputMerger.java
similarity index 100%
rename from work/workmanager/src/main/java/androidx/work/ArrayCreatingInputMerger.java
rename to work/work-runtime/src/main/java/androidx/work/ArrayCreatingInputMerger.java
diff --git a/work/workmanager/src/main/java/androidx/work/BackoffPolicy.java b/work/work-runtime/src/main/java/androidx/work/BackoffPolicy.java
similarity index 100%
rename from work/workmanager/src/main/java/androidx/work/BackoffPolicy.java
rename to work/work-runtime/src/main/java/androidx/work/BackoffPolicy.java
diff --git a/work/workmanager/src/main/java/androidx/work/Configuration.java b/work/work-runtime/src/main/java/androidx/work/Configuration.java
similarity index 100%
rename from work/workmanager/src/main/java/androidx/work/Configuration.java
rename to work/work-runtime/src/main/java/androidx/work/Configuration.java
diff --git a/work/workmanager/src/main/java/androidx/work/Constraints.java b/work/work-runtime/src/main/java/androidx/work/Constraints.java
similarity index 100%
rename from work/workmanager/src/main/java/androidx/work/Constraints.java
rename to work/work-runtime/src/main/java/androidx/work/Constraints.java
diff --git a/work/workmanager/src/main/java/androidx/work/ContentUriTriggers.java b/work/work-runtime/src/main/java/androidx/work/ContentUriTriggers.java
similarity index 100%
rename from work/workmanager/src/main/java/androidx/work/ContentUriTriggers.java
rename to work/work-runtime/src/main/java/androidx/work/ContentUriTriggers.java
diff --git a/work/workmanager/src/main/java/androidx/work/Data.java b/work/work-runtime/src/main/java/androidx/work/Data.java
similarity index 100%
rename from work/workmanager/src/main/java/androidx/work/Data.java
rename to work/work-runtime/src/main/java/androidx/work/Data.java
diff --git a/work/workmanager/src/main/java/androidx/work/DelegatingWorkerFactory.java b/work/work-runtime/src/main/java/androidx/work/DelegatingWorkerFactory.java
similarity index 100%
rename from work/workmanager/src/main/java/androidx/work/DelegatingWorkerFactory.java
rename to work/work-runtime/src/main/java/androidx/work/DelegatingWorkerFactory.java
diff --git a/work/workmanager/src/main/java/androidx/work/ExistingPeriodicWorkPolicy.java b/work/work-runtime/src/main/java/androidx/work/ExistingPeriodicWorkPolicy.java
similarity index 100%
rename from work/workmanager/src/main/java/androidx/work/ExistingPeriodicWorkPolicy.java
rename to work/work-runtime/src/main/java/androidx/work/ExistingPeriodicWorkPolicy.java
diff --git a/work/workmanager/src/main/java/androidx/work/ExistingWorkPolicy.java b/work/work-runtime/src/main/java/androidx/work/ExistingWorkPolicy.java
similarity index 100%
rename from work/workmanager/src/main/java/androidx/work/ExistingWorkPolicy.java
rename to work/work-runtime/src/main/java/androidx/work/ExistingWorkPolicy.java
diff --git a/work/workmanager/src/main/java/androidx/work/ForegroundInfo.java b/work/work-runtime/src/main/java/androidx/work/ForegroundInfo.java
similarity index 100%
rename from work/workmanager/src/main/java/androidx/work/ForegroundInfo.java
rename to work/work-runtime/src/main/java/androidx/work/ForegroundInfo.java
diff --git a/work/workmanager/src/main/java/androidx/work/ForegroundUpdater.java b/work/work-runtime/src/main/java/androidx/work/ForegroundUpdater.java
similarity index 100%
rename from work/workmanager/src/main/java/androidx/work/ForegroundUpdater.java
rename to work/work-runtime/src/main/java/androidx/work/ForegroundUpdater.java
diff --git a/work/workmanager/src/main/java/androidx/work/InitializationExceptionHandler.java b/work/work-runtime/src/main/java/androidx/work/InitializationExceptionHandler.java
similarity index 100%
rename from work/workmanager/src/main/java/androidx/work/InitializationExceptionHandler.java
rename to work/work-runtime/src/main/java/androidx/work/InitializationExceptionHandler.java
diff --git a/work/workmanager/src/main/java/androidx/work/InputMerger.java b/work/work-runtime/src/main/java/androidx/work/InputMerger.java
similarity index 100%
rename from work/workmanager/src/main/java/androidx/work/InputMerger.java
rename to work/work-runtime/src/main/java/androidx/work/InputMerger.java
diff --git a/work/workmanager/src/main/java/androidx/work/InputMergerFactory.java b/work/work-runtime/src/main/java/androidx/work/InputMergerFactory.java
similarity index 100%
rename from work/workmanager/src/main/java/androidx/work/InputMergerFactory.java
rename to work/work-runtime/src/main/java/androidx/work/InputMergerFactory.java
diff --git a/work/workmanager/src/main/java/androidx/work/ListenableWorker.java b/work/work-runtime/src/main/java/androidx/work/ListenableWorker.java
similarity index 100%
rename from work/workmanager/src/main/java/androidx/work/ListenableWorker.java
rename to work/work-runtime/src/main/java/androidx/work/ListenableWorker.java
diff --git a/work/workmanager/src/main/java/androidx/work/Logger.java b/work/work-runtime/src/main/java/androidx/work/Logger.java
similarity index 100%
rename from work/workmanager/src/main/java/androidx/work/Logger.java
rename to work/work-runtime/src/main/java/androidx/work/Logger.java
diff --git a/work/workmanager/src/main/java/androidx/work/NetworkType.java b/work/work-runtime/src/main/java/androidx/work/NetworkType.java
similarity index 100%
rename from work/workmanager/src/main/java/androidx/work/NetworkType.java
rename to work/work-runtime/src/main/java/androidx/work/NetworkType.java
diff --git a/work/workmanager/src/main/java/androidx/work/OneTimeWorkRequest.java b/work/work-runtime/src/main/java/androidx/work/OneTimeWorkRequest.java
similarity index 100%
rename from work/workmanager/src/main/java/androidx/work/OneTimeWorkRequest.java
rename to work/work-runtime/src/main/java/androidx/work/OneTimeWorkRequest.java
diff --git a/work/workmanager/src/main/java/androidx/work/Operation.java b/work/work-runtime/src/main/java/androidx/work/Operation.java
similarity index 100%
rename from work/workmanager/src/main/java/androidx/work/Operation.java
rename to work/work-runtime/src/main/java/androidx/work/Operation.java
diff --git a/work/workmanager/src/main/java/androidx/work/OutOfQuotaPolicy.java b/work/work-runtime/src/main/java/androidx/work/OutOfQuotaPolicy.java
similarity index 100%
rename from work/workmanager/src/main/java/androidx/work/OutOfQuotaPolicy.java
rename to work/work-runtime/src/main/java/androidx/work/OutOfQuotaPolicy.java
diff --git a/work/workmanager/src/main/java/androidx/work/OverwritingInputMerger.java b/work/work-runtime/src/main/java/androidx/work/OverwritingInputMerger.java
similarity index 100%
rename from work/workmanager/src/main/java/androidx/work/OverwritingInputMerger.java
rename to work/work-runtime/src/main/java/androidx/work/OverwritingInputMerger.java
diff --git a/work/workmanager/src/main/java/androidx/work/PeriodicWorkRequest.java b/work/work-runtime/src/main/java/androidx/work/PeriodicWorkRequest.java
similarity index 100%
rename from work/workmanager/src/main/java/androidx/work/PeriodicWorkRequest.java
rename to work/work-runtime/src/main/java/androidx/work/PeriodicWorkRequest.java
diff --git a/work/workmanager/src/main/java/androidx/work/ProgressUpdater.java b/work/work-runtime/src/main/java/androidx/work/ProgressUpdater.java
similarity index 100%
rename from work/workmanager/src/main/java/androidx/work/ProgressUpdater.java
rename to work/work-runtime/src/main/java/androidx/work/ProgressUpdater.java
diff --git a/work/workmanager/src/main/java/androidx/work/RunnableScheduler.java b/work/work-runtime/src/main/java/androidx/work/RunnableScheduler.java
similarity index 100%
rename from work/workmanager/src/main/java/androidx/work/RunnableScheduler.java
rename to work/work-runtime/src/main/java/androidx/work/RunnableScheduler.java
diff --git a/work/workmanager/src/main/java/androidx/work/WorkContinuation.java b/work/work-runtime/src/main/java/androidx/work/WorkContinuation.java
similarity index 100%
rename from work/workmanager/src/main/java/androidx/work/WorkContinuation.java
rename to work/work-runtime/src/main/java/androidx/work/WorkContinuation.java
diff --git a/work/workmanager/src/main/java/androidx/work/WorkInfo.java b/work/work-runtime/src/main/java/androidx/work/WorkInfo.java
similarity index 100%
rename from work/workmanager/src/main/java/androidx/work/WorkInfo.java
rename to work/work-runtime/src/main/java/androidx/work/WorkInfo.java
diff --git a/work/workmanager/src/main/java/androidx/work/WorkManager.java b/work/work-runtime/src/main/java/androidx/work/WorkManager.java
similarity index 100%
rename from work/workmanager/src/main/java/androidx/work/WorkManager.java
rename to work/work-runtime/src/main/java/androidx/work/WorkManager.java
diff --git a/work/workmanager/src/main/java/androidx/work/WorkManagerInitializer.java b/work/work-runtime/src/main/java/androidx/work/WorkManagerInitializer.java
similarity index 100%
rename from work/workmanager/src/main/java/androidx/work/WorkManagerInitializer.java
rename to work/work-runtime/src/main/java/androidx/work/WorkManagerInitializer.java
diff --git a/work/workmanager/src/main/java/androidx/work/WorkQuery.java b/work/work-runtime/src/main/java/androidx/work/WorkQuery.java
similarity index 100%
rename from work/workmanager/src/main/java/androidx/work/WorkQuery.java
rename to work/work-runtime/src/main/java/androidx/work/WorkQuery.java
diff --git a/work/workmanager/src/main/java/androidx/work/WorkRequest.java b/work/work-runtime/src/main/java/androidx/work/WorkRequest.java
similarity index 100%
rename from work/workmanager/src/main/java/androidx/work/WorkRequest.java
rename to work/work-runtime/src/main/java/androidx/work/WorkRequest.java
diff --git a/work/workmanager/src/main/java/androidx/work/Worker.java b/work/work-runtime/src/main/java/androidx/work/Worker.java
similarity index 100%
rename from work/workmanager/src/main/java/androidx/work/Worker.java
rename to work/work-runtime/src/main/java/androidx/work/Worker.java
diff --git a/work/workmanager/src/main/java/androidx/work/WorkerFactory.java b/work/work-runtime/src/main/java/androidx/work/WorkerFactory.java
similarity index 100%
rename from work/workmanager/src/main/java/androidx/work/WorkerFactory.java
rename to work/work-runtime/src/main/java/androidx/work/WorkerFactory.java
diff --git a/work/workmanager/src/main/java/androidx/work/WorkerParameters.java b/work/work-runtime/src/main/java/androidx/work/WorkerParameters.java
similarity index 100%
rename from work/workmanager/src/main/java/androidx/work/WorkerParameters.java
rename to work/work-runtime/src/main/java/androidx/work/WorkerParameters.java
diff --git a/work/workmanager/src/main/java/androidx/work/impl/DefaultRunnableScheduler.java b/work/work-runtime/src/main/java/androidx/work/impl/DefaultRunnableScheduler.java
similarity index 100%
rename from work/workmanager/src/main/java/androidx/work/impl/DefaultRunnableScheduler.java
rename to work/work-runtime/src/main/java/androidx/work/impl/DefaultRunnableScheduler.java
diff --git a/work/workmanager/src/main/java/androidx/work/impl/ExecutionListener.java b/work/work-runtime/src/main/java/androidx/work/impl/ExecutionListener.java
similarity index 100%
rename from work/workmanager/src/main/java/androidx/work/impl/ExecutionListener.java
rename to work/work-runtime/src/main/java/androidx/work/impl/ExecutionListener.java
diff --git a/work/workmanager/src/main/java/androidx/work/impl/OperationImpl.java b/work/work-runtime/src/main/java/androidx/work/impl/OperationImpl.java
similarity index 100%
rename from work/workmanager/src/main/java/androidx/work/impl/OperationImpl.java
rename to work/work-runtime/src/main/java/androidx/work/impl/OperationImpl.java
diff --git a/work/workmanager/src/main/java/androidx/work/impl/Processor.java b/work/work-runtime/src/main/java/androidx/work/impl/Processor.java
similarity index 100%
rename from work/workmanager/src/main/java/androidx/work/impl/Processor.java
rename to work/work-runtime/src/main/java/androidx/work/impl/Processor.java
diff --git a/work/workmanager/src/main/java/androidx/work/impl/Scheduler.java b/work/work-runtime/src/main/java/androidx/work/impl/Scheduler.java
similarity index 100%
rename from work/workmanager/src/main/java/androidx/work/impl/Scheduler.java
rename to work/work-runtime/src/main/java/androidx/work/impl/Scheduler.java
diff --git a/work/workmanager/src/main/java/androidx/work/impl/Schedulers.java b/work/work-runtime/src/main/java/androidx/work/impl/Schedulers.java
similarity index 100%
rename from work/workmanager/src/main/java/androidx/work/impl/Schedulers.java
rename to work/work-runtime/src/main/java/androidx/work/impl/Schedulers.java
diff --git a/work/workmanager/src/main/java/androidx/work/impl/WorkContinuationImpl.java b/work/work-runtime/src/main/java/androidx/work/impl/WorkContinuationImpl.java
similarity index 100%
rename from work/workmanager/src/main/java/androidx/work/impl/WorkContinuationImpl.java
rename to work/work-runtime/src/main/java/androidx/work/impl/WorkContinuationImpl.java
diff --git a/work/workmanager/src/main/java/androidx/work/impl/WorkDatabase.java b/work/work-runtime/src/main/java/androidx/work/impl/WorkDatabase.java
similarity index 100%
rename from work/workmanager/src/main/java/androidx/work/impl/WorkDatabase.java
rename to work/work-runtime/src/main/java/androidx/work/impl/WorkDatabase.java
diff --git a/work/workmanager/src/main/java/androidx/work/impl/WorkDatabaseMigrations.java b/work/work-runtime/src/main/java/androidx/work/impl/WorkDatabaseMigrations.java
similarity index 100%
rename from work/workmanager/src/main/java/androidx/work/impl/WorkDatabaseMigrations.java
rename to work/work-runtime/src/main/java/androidx/work/impl/WorkDatabaseMigrations.java
diff --git a/work/workmanager/src/main/java/androidx/work/impl/WorkDatabasePathHelper.java b/work/work-runtime/src/main/java/androidx/work/impl/WorkDatabasePathHelper.java
similarity index 100%
rename from work/workmanager/src/main/java/androidx/work/impl/WorkDatabasePathHelper.java
rename to work/work-runtime/src/main/java/androidx/work/impl/WorkDatabasePathHelper.java
diff --git a/work/workmanager/src/main/java/androidx/work/impl/WorkManagerImpl.java b/work/work-runtime/src/main/java/androidx/work/impl/WorkManagerImpl.java
similarity index 100%
rename from work/workmanager/src/main/java/androidx/work/impl/WorkManagerImpl.java
rename to work/work-runtime/src/main/java/androidx/work/impl/WorkManagerImpl.java
diff --git a/work/workmanager/src/main/java/androidx/work/impl/WorkRequestHolder.java b/work/work-runtime/src/main/java/androidx/work/impl/WorkRequestHolder.java
similarity index 100%
rename from work/workmanager/src/main/java/androidx/work/impl/WorkRequestHolder.java
rename to work/work-runtime/src/main/java/androidx/work/impl/WorkRequestHolder.java
diff --git a/work/workmanager/src/main/java/androidx/work/impl/WorkerWrapper.java b/work/work-runtime/src/main/java/androidx/work/impl/WorkerWrapper.java
similarity index 100%
rename from work/workmanager/src/main/java/androidx/work/impl/WorkerWrapper.java
rename to work/work-runtime/src/main/java/androidx/work/impl/WorkerWrapper.java
diff --git a/work/workmanager/src/main/java/androidx/work/impl/background/greedy/DelayedWorkTracker.java b/work/work-runtime/src/main/java/androidx/work/impl/background/greedy/DelayedWorkTracker.java
similarity index 100%
rename from work/workmanager/src/main/java/androidx/work/impl/background/greedy/DelayedWorkTracker.java
rename to work/work-runtime/src/main/java/androidx/work/impl/background/greedy/DelayedWorkTracker.java
diff --git a/work/workmanager/src/main/java/androidx/work/impl/background/greedy/GreedyScheduler.java b/work/work-runtime/src/main/java/androidx/work/impl/background/greedy/GreedyScheduler.java
similarity index 100%
rename from work/workmanager/src/main/java/androidx/work/impl/background/greedy/GreedyScheduler.java
rename to work/work-runtime/src/main/java/androidx/work/impl/background/greedy/GreedyScheduler.java
diff --git a/work/workmanager/src/main/java/androidx/work/impl/background/package-info.java b/work/work-runtime/src/main/java/androidx/work/impl/background/package-info.java
similarity index 100%
rename from work/workmanager/src/main/java/androidx/work/impl/background/package-info.java
rename to work/work-runtime/src/main/java/androidx/work/impl/background/package-info.java
diff --git a/work/workmanager/src/main/java/androidx/work/impl/background/systemalarm/Alarms.java b/work/work-runtime/src/main/java/androidx/work/impl/background/systemalarm/Alarms.java
similarity index 90%
rename from work/workmanager/src/main/java/androidx/work/impl/background/systemalarm/Alarms.java
rename to work/work-runtime/src/main/java/androidx/work/impl/background/systemalarm/Alarms.java
index 3c730f5..e98a2b8 100644
--- a/work/workmanager/src/main/java/androidx/work/impl/background/systemalarm/Alarms.java
+++ b/work/work-runtime/src/main/java/androidx/work/impl/background/systemalarm/Alarms.java
@@ -102,8 +102,11 @@
AlarmManager alarmManager = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);
Intent delayMet = CommandHandler.createDelayMetIntent(context, workSpecId);
- PendingIntent pendingIntent = PendingIntent.getService(
- context, alarmId, delayMet, PendingIntent.FLAG_NO_CREATE);
+ int flags = PendingIntent.FLAG_NO_CREATE;
+ if (Build.VERSION.SDK_INT >= 23) {
+ flags |= PendingIntent.FLAG_IMMUTABLE;
+ }
+ PendingIntent pendingIntent = PendingIntent.getService(context, alarmId, delayMet, flags);
if (pendingIntent != null && alarmManager != null) {
Logger.get().debug(TAG, String.format(
"Cancelling existing alarm with (workSpecId, systemId) (%s, %s)",
@@ -120,9 +123,12 @@
long triggerAtMillis) {
AlarmManager alarmManager = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);
+ int flags = PendingIntent.FLAG_UPDATE_CURRENT;
+ if (Build.VERSION.SDK_INT >= 23) {
+ flags |= PendingIntent.FLAG_IMMUTABLE;
+ }
Intent delayMet = CommandHandler.createDelayMetIntent(context, workSpecId);
- PendingIntent pendingIntent = PendingIntent.getService(
- context, alarmId, delayMet, PendingIntent.FLAG_UPDATE_CURRENT);
+ PendingIntent pendingIntent = PendingIntent.getService(context, alarmId, delayMet, flags);
if (alarmManager != null) {
if (Build.VERSION.SDK_INT >= 19) {
alarmManager.setExact(RTC_WAKEUP, triggerAtMillis, pendingIntent);
diff --git a/work/workmanager/src/main/java/androidx/work/impl/background/systemalarm/CommandHandler.java b/work/work-runtime/src/main/java/androidx/work/impl/background/systemalarm/CommandHandler.java
similarity index 100%
rename from work/workmanager/src/main/java/androidx/work/impl/background/systemalarm/CommandHandler.java
rename to work/work-runtime/src/main/java/androidx/work/impl/background/systemalarm/CommandHandler.java
diff --git a/work/workmanager/src/main/java/androidx/work/impl/background/systemalarm/ConstraintProxy.java b/work/work-runtime/src/main/java/androidx/work/impl/background/systemalarm/ConstraintProxy.java
similarity index 100%
rename from work/workmanager/src/main/java/androidx/work/impl/background/systemalarm/ConstraintProxy.java
rename to work/work-runtime/src/main/java/androidx/work/impl/background/systemalarm/ConstraintProxy.java
diff --git a/work/workmanager/src/main/java/androidx/work/impl/background/systemalarm/ConstraintProxyUpdateReceiver.java b/work/work-runtime/src/main/java/androidx/work/impl/background/systemalarm/ConstraintProxyUpdateReceiver.java
similarity index 100%
rename from work/workmanager/src/main/java/androidx/work/impl/background/systemalarm/ConstraintProxyUpdateReceiver.java
rename to work/work-runtime/src/main/java/androidx/work/impl/background/systemalarm/ConstraintProxyUpdateReceiver.java
diff --git a/work/workmanager/src/main/java/androidx/work/impl/background/systemalarm/ConstraintsCommandHandler.java b/work/work-runtime/src/main/java/androidx/work/impl/background/systemalarm/ConstraintsCommandHandler.java
similarity index 100%
rename from work/workmanager/src/main/java/androidx/work/impl/background/systemalarm/ConstraintsCommandHandler.java
rename to work/work-runtime/src/main/java/androidx/work/impl/background/systemalarm/ConstraintsCommandHandler.java
diff --git a/work/workmanager/src/main/java/androidx/work/impl/background/systemalarm/DelayMetCommandHandler.java b/work/work-runtime/src/main/java/androidx/work/impl/background/systemalarm/DelayMetCommandHandler.java
similarity index 100%
rename from work/workmanager/src/main/java/androidx/work/impl/background/systemalarm/DelayMetCommandHandler.java
rename to work/work-runtime/src/main/java/androidx/work/impl/background/systemalarm/DelayMetCommandHandler.java
diff --git a/work/workmanager/src/main/java/androidx/work/impl/background/systemalarm/RescheduleReceiver.java b/work/work-runtime/src/main/java/androidx/work/impl/background/systemalarm/RescheduleReceiver.java
similarity index 100%
rename from work/workmanager/src/main/java/androidx/work/impl/background/systemalarm/RescheduleReceiver.java
rename to work/work-runtime/src/main/java/androidx/work/impl/background/systemalarm/RescheduleReceiver.java
diff --git a/work/workmanager/src/main/java/androidx/work/impl/background/systemalarm/SystemAlarmDispatcher.java b/work/work-runtime/src/main/java/androidx/work/impl/background/systemalarm/SystemAlarmDispatcher.java
similarity index 100%
rename from work/workmanager/src/main/java/androidx/work/impl/background/systemalarm/SystemAlarmDispatcher.java
rename to work/work-runtime/src/main/java/androidx/work/impl/background/systemalarm/SystemAlarmDispatcher.java
diff --git a/work/workmanager/src/main/java/androidx/work/impl/background/systemalarm/SystemAlarmScheduler.java b/work/work-runtime/src/main/java/androidx/work/impl/background/systemalarm/SystemAlarmScheduler.java
similarity index 100%
rename from work/workmanager/src/main/java/androidx/work/impl/background/systemalarm/SystemAlarmScheduler.java
rename to work/work-runtime/src/main/java/androidx/work/impl/background/systemalarm/SystemAlarmScheduler.java
diff --git a/work/workmanager/src/main/java/androidx/work/impl/background/systemalarm/SystemAlarmService.java b/work/work-runtime/src/main/java/androidx/work/impl/background/systemalarm/SystemAlarmService.java
similarity index 100%
rename from work/workmanager/src/main/java/androidx/work/impl/background/systemalarm/SystemAlarmService.java
rename to work/work-runtime/src/main/java/androidx/work/impl/background/systemalarm/SystemAlarmService.java
diff --git a/work/workmanager/src/main/java/androidx/work/impl/background/systemalarm/package-info.java b/work/work-runtime/src/main/java/androidx/work/impl/background/systemalarm/package-info.java
similarity index 100%
rename from work/workmanager/src/main/java/androidx/work/impl/background/systemalarm/package-info.java
rename to work/work-runtime/src/main/java/androidx/work/impl/background/systemalarm/package-info.java
diff --git a/work/workmanager/src/main/java/androidx/work/impl/background/systemjob/SystemJobInfoConverter.java b/work/work-runtime/src/main/java/androidx/work/impl/background/systemjob/SystemJobInfoConverter.java
similarity index 100%
rename from work/workmanager/src/main/java/androidx/work/impl/background/systemjob/SystemJobInfoConverter.java
rename to work/work-runtime/src/main/java/androidx/work/impl/background/systemjob/SystemJobInfoConverter.java
diff --git a/work/workmanager/src/main/java/androidx/work/impl/background/systemjob/SystemJobScheduler.java b/work/work-runtime/src/main/java/androidx/work/impl/background/systemjob/SystemJobScheduler.java
similarity index 100%
rename from work/workmanager/src/main/java/androidx/work/impl/background/systemjob/SystemJobScheduler.java
rename to work/work-runtime/src/main/java/androidx/work/impl/background/systemjob/SystemJobScheduler.java
diff --git a/work/workmanager/src/main/java/androidx/work/impl/background/systemjob/SystemJobService.java b/work/work-runtime/src/main/java/androidx/work/impl/background/systemjob/SystemJobService.java
similarity index 100%
rename from work/workmanager/src/main/java/androidx/work/impl/background/systemjob/SystemJobService.java
rename to work/work-runtime/src/main/java/androidx/work/impl/background/systemjob/SystemJobService.java
diff --git a/work/workmanager/src/main/java/androidx/work/impl/background/systemjob/package-info.java b/work/work-runtime/src/main/java/androidx/work/impl/background/systemjob/package-info.java
similarity index 100%
rename from work/workmanager/src/main/java/androidx/work/impl/background/systemjob/package-info.java
rename to work/work-runtime/src/main/java/androidx/work/impl/background/systemjob/package-info.java
diff --git a/work/workmanager/src/main/java/androidx/work/impl/constraints/ConstraintListener.java b/work/work-runtime/src/main/java/androidx/work/impl/constraints/ConstraintListener.java
similarity index 100%
rename from work/workmanager/src/main/java/androidx/work/impl/constraints/ConstraintListener.java
rename to work/work-runtime/src/main/java/androidx/work/impl/constraints/ConstraintListener.java
diff --git a/work/workmanager/src/main/java/androidx/work/impl/constraints/NetworkState.java b/work/work-runtime/src/main/java/androidx/work/impl/constraints/NetworkState.java
similarity index 100%
rename from work/workmanager/src/main/java/androidx/work/impl/constraints/NetworkState.java
rename to work/work-runtime/src/main/java/androidx/work/impl/constraints/NetworkState.java
diff --git a/work/workmanager/src/main/java/androidx/work/impl/constraints/WorkConstraintsCallback.java b/work/work-runtime/src/main/java/androidx/work/impl/constraints/WorkConstraintsCallback.java
similarity index 100%
rename from work/workmanager/src/main/java/androidx/work/impl/constraints/WorkConstraintsCallback.java
rename to work/work-runtime/src/main/java/androidx/work/impl/constraints/WorkConstraintsCallback.java
diff --git a/work/workmanager/src/main/java/androidx/work/impl/constraints/WorkConstraintsTracker.java b/work/work-runtime/src/main/java/androidx/work/impl/constraints/WorkConstraintsTracker.java
similarity index 100%
rename from work/workmanager/src/main/java/androidx/work/impl/constraints/WorkConstraintsTracker.java
rename to work/work-runtime/src/main/java/androidx/work/impl/constraints/WorkConstraintsTracker.java
diff --git a/work/workmanager/src/main/java/androidx/work/impl/constraints/controllers/BatteryChargingController.java b/work/work-runtime/src/main/java/androidx/work/impl/constraints/controllers/BatteryChargingController.java
similarity index 100%
rename from work/workmanager/src/main/java/androidx/work/impl/constraints/controllers/BatteryChargingController.java
rename to work/work-runtime/src/main/java/androidx/work/impl/constraints/controllers/BatteryChargingController.java
diff --git a/work/workmanager/src/main/java/androidx/work/impl/constraints/controllers/BatteryNotLowController.java b/work/work-runtime/src/main/java/androidx/work/impl/constraints/controllers/BatteryNotLowController.java
similarity index 100%
rename from work/workmanager/src/main/java/androidx/work/impl/constraints/controllers/BatteryNotLowController.java
rename to work/work-runtime/src/main/java/androidx/work/impl/constraints/controllers/BatteryNotLowController.java
diff --git a/work/workmanager/src/main/java/androidx/work/impl/constraints/controllers/ConstraintController.java b/work/work-runtime/src/main/java/androidx/work/impl/constraints/controllers/ConstraintController.java
similarity index 100%
rename from work/workmanager/src/main/java/androidx/work/impl/constraints/controllers/ConstraintController.java
rename to work/work-runtime/src/main/java/androidx/work/impl/constraints/controllers/ConstraintController.java
diff --git a/work/workmanager/src/main/java/androidx/work/impl/constraints/controllers/NetworkConnectedController.java b/work/work-runtime/src/main/java/androidx/work/impl/constraints/controllers/NetworkConnectedController.java
similarity index 100%
rename from work/workmanager/src/main/java/androidx/work/impl/constraints/controllers/NetworkConnectedController.java
rename to work/work-runtime/src/main/java/androidx/work/impl/constraints/controllers/NetworkConnectedController.java
diff --git a/work/workmanager/src/main/java/androidx/work/impl/constraints/controllers/NetworkMeteredController.java b/work/work-runtime/src/main/java/androidx/work/impl/constraints/controllers/NetworkMeteredController.java
similarity index 100%
rename from work/workmanager/src/main/java/androidx/work/impl/constraints/controllers/NetworkMeteredController.java
rename to work/work-runtime/src/main/java/androidx/work/impl/constraints/controllers/NetworkMeteredController.java
diff --git a/work/workmanager/src/main/java/androidx/work/impl/constraints/controllers/NetworkNotRoamingController.java b/work/work-runtime/src/main/java/androidx/work/impl/constraints/controllers/NetworkNotRoamingController.java
similarity index 100%
rename from work/workmanager/src/main/java/androidx/work/impl/constraints/controllers/NetworkNotRoamingController.java
rename to work/work-runtime/src/main/java/androidx/work/impl/constraints/controllers/NetworkNotRoamingController.java
diff --git a/work/workmanager/src/main/java/androidx/work/impl/constraints/controllers/NetworkUnmeteredController.java b/work/work-runtime/src/main/java/androidx/work/impl/constraints/controllers/NetworkUnmeteredController.java
similarity index 100%
rename from work/workmanager/src/main/java/androidx/work/impl/constraints/controllers/NetworkUnmeteredController.java
rename to work/work-runtime/src/main/java/androidx/work/impl/constraints/controllers/NetworkUnmeteredController.java
diff --git a/work/workmanager/src/main/java/androidx/work/impl/constraints/controllers/StorageNotLowController.java b/work/work-runtime/src/main/java/androidx/work/impl/constraints/controllers/StorageNotLowController.java
similarity index 100%
rename from work/workmanager/src/main/java/androidx/work/impl/constraints/controllers/StorageNotLowController.java
rename to work/work-runtime/src/main/java/androidx/work/impl/constraints/controllers/StorageNotLowController.java
diff --git a/work/workmanager/src/main/java/androidx/work/impl/constraints/controllers/package-info.java b/work/work-runtime/src/main/java/androidx/work/impl/constraints/controllers/package-info.java
similarity index 100%
rename from work/workmanager/src/main/java/androidx/work/impl/constraints/controllers/package-info.java
rename to work/work-runtime/src/main/java/androidx/work/impl/constraints/controllers/package-info.java
diff --git a/work/workmanager/src/main/java/androidx/work/impl/constraints/package-info.java b/work/work-runtime/src/main/java/androidx/work/impl/constraints/package-info.java
similarity index 100%
rename from work/workmanager/src/main/java/androidx/work/impl/constraints/package-info.java
rename to work/work-runtime/src/main/java/androidx/work/impl/constraints/package-info.java
diff --git a/work/workmanager/src/main/java/androidx/work/impl/constraints/trackers/BatteryChargingTracker.java b/work/work-runtime/src/main/java/androidx/work/impl/constraints/trackers/BatteryChargingTracker.java
similarity index 100%
rename from work/workmanager/src/main/java/androidx/work/impl/constraints/trackers/BatteryChargingTracker.java
rename to work/work-runtime/src/main/java/androidx/work/impl/constraints/trackers/BatteryChargingTracker.java
diff --git a/work/workmanager/src/main/java/androidx/work/impl/constraints/trackers/BatteryNotLowTracker.java b/work/work-runtime/src/main/java/androidx/work/impl/constraints/trackers/BatteryNotLowTracker.java
similarity index 100%
rename from work/workmanager/src/main/java/androidx/work/impl/constraints/trackers/BatteryNotLowTracker.java
rename to work/work-runtime/src/main/java/androidx/work/impl/constraints/trackers/BatteryNotLowTracker.java
diff --git a/work/workmanager/src/main/java/androidx/work/impl/constraints/trackers/BroadcastReceiverConstraintTracker.java b/work/work-runtime/src/main/java/androidx/work/impl/constraints/trackers/BroadcastReceiverConstraintTracker.java
similarity index 100%
rename from work/workmanager/src/main/java/androidx/work/impl/constraints/trackers/BroadcastReceiverConstraintTracker.java
rename to work/work-runtime/src/main/java/androidx/work/impl/constraints/trackers/BroadcastReceiverConstraintTracker.java
diff --git a/work/workmanager/src/main/java/androidx/work/impl/constraints/trackers/ConstraintTracker.java b/work/work-runtime/src/main/java/androidx/work/impl/constraints/trackers/ConstraintTracker.java
similarity index 100%
rename from work/workmanager/src/main/java/androidx/work/impl/constraints/trackers/ConstraintTracker.java
rename to work/work-runtime/src/main/java/androidx/work/impl/constraints/trackers/ConstraintTracker.java
diff --git a/work/workmanager/src/main/java/androidx/work/impl/constraints/trackers/NetworkStateTracker.java b/work/work-runtime/src/main/java/androidx/work/impl/constraints/trackers/NetworkStateTracker.java
similarity index 100%
rename from work/workmanager/src/main/java/androidx/work/impl/constraints/trackers/NetworkStateTracker.java
rename to work/work-runtime/src/main/java/androidx/work/impl/constraints/trackers/NetworkStateTracker.java
diff --git a/work/workmanager/src/main/java/androidx/work/impl/constraints/trackers/StorageNotLowTracker.java b/work/work-runtime/src/main/java/androidx/work/impl/constraints/trackers/StorageNotLowTracker.java
similarity index 100%
rename from work/workmanager/src/main/java/androidx/work/impl/constraints/trackers/StorageNotLowTracker.java
rename to work/work-runtime/src/main/java/androidx/work/impl/constraints/trackers/StorageNotLowTracker.java
diff --git a/work/workmanager/src/main/java/androidx/work/impl/constraints/trackers/Trackers.java b/work/work-runtime/src/main/java/androidx/work/impl/constraints/trackers/Trackers.java
similarity index 100%
rename from work/workmanager/src/main/java/androidx/work/impl/constraints/trackers/Trackers.java
rename to work/work-runtime/src/main/java/androidx/work/impl/constraints/trackers/Trackers.java
diff --git a/work/workmanager/src/main/java/androidx/work/impl/constraints/trackers/package-info.java b/work/work-runtime/src/main/java/androidx/work/impl/constraints/trackers/package-info.java
similarity index 100%
rename from work/workmanager/src/main/java/androidx/work/impl/constraints/trackers/package-info.java
rename to work/work-runtime/src/main/java/androidx/work/impl/constraints/trackers/package-info.java
diff --git a/work/workmanager/src/main/java/androidx/work/impl/diagnostics/DiagnosticsReceiver.java b/work/work-runtime/src/main/java/androidx/work/impl/diagnostics/DiagnosticsReceiver.java
similarity index 100%
rename from work/workmanager/src/main/java/androidx/work/impl/diagnostics/DiagnosticsReceiver.java
rename to work/work-runtime/src/main/java/androidx/work/impl/diagnostics/DiagnosticsReceiver.java
diff --git a/work/workmanager/src/main/java/androidx/work/impl/foreground/ForegroundProcessor.java b/work/work-runtime/src/main/java/androidx/work/impl/foreground/ForegroundProcessor.java
similarity index 100%
rename from work/workmanager/src/main/java/androidx/work/impl/foreground/ForegroundProcessor.java
rename to work/work-runtime/src/main/java/androidx/work/impl/foreground/ForegroundProcessor.java
diff --git a/work/workmanager/src/main/java/androidx/work/impl/foreground/SystemForegroundDispatcher.java b/work/work-runtime/src/main/java/androidx/work/impl/foreground/SystemForegroundDispatcher.java
similarity index 100%
rename from work/workmanager/src/main/java/androidx/work/impl/foreground/SystemForegroundDispatcher.java
rename to work/work-runtime/src/main/java/androidx/work/impl/foreground/SystemForegroundDispatcher.java
diff --git a/work/workmanager/src/main/java/androidx/work/impl/foreground/SystemForegroundService.java b/work/work-runtime/src/main/java/androidx/work/impl/foreground/SystemForegroundService.java
similarity index 100%
rename from work/workmanager/src/main/java/androidx/work/impl/foreground/SystemForegroundService.java
rename to work/work-runtime/src/main/java/androidx/work/impl/foreground/SystemForegroundService.java
diff --git a/work/workmanager/src/main/java/androidx/work/impl/model/Dependency.java b/work/work-runtime/src/main/java/androidx/work/impl/model/Dependency.java
similarity index 100%
rename from work/workmanager/src/main/java/androidx/work/impl/model/Dependency.java
rename to work/work-runtime/src/main/java/androidx/work/impl/model/Dependency.java
diff --git a/work/workmanager/src/main/java/androidx/work/impl/model/DependencyDao.java b/work/work-runtime/src/main/java/androidx/work/impl/model/DependencyDao.java
similarity index 100%
rename from work/workmanager/src/main/java/androidx/work/impl/model/DependencyDao.java
rename to work/work-runtime/src/main/java/androidx/work/impl/model/DependencyDao.java
diff --git a/work/workmanager/src/main/java/androidx/work/impl/model/Preference.java b/work/work-runtime/src/main/java/androidx/work/impl/model/Preference.java
similarity index 100%
rename from work/workmanager/src/main/java/androidx/work/impl/model/Preference.java
rename to work/work-runtime/src/main/java/androidx/work/impl/model/Preference.java
diff --git a/work/workmanager/src/main/java/androidx/work/impl/model/PreferenceDao.java b/work/work-runtime/src/main/java/androidx/work/impl/model/PreferenceDao.java
similarity index 100%
rename from work/workmanager/src/main/java/androidx/work/impl/model/PreferenceDao.java
rename to work/work-runtime/src/main/java/androidx/work/impl/model/PreferenceDao.java
diff --git a/work/workmanager/src/main/java/androidx/work/impl/model/RawWorkInfoDao.java b/work/work-runtime/src/main/java/androidx/work/impl/model/RawWorkInfoDao.java
similarity index 100%
rename from work/workmanager/src/main/java/androidx/work/impl/model/RawWorkInfoDao.java
rename to work/work-runtime/src/main/java/androidx/work/impl/model/RawWorkInfoDao.java
diff --git a/work/workmanager/src/main/java/androidx/work/impl/model/SystemIdInfo.java b/work/work-runtime/src/main/java/androidx/work/impl/model/SystemIdInfo.java
similarity index 100%
rename from work/workmanager/src/main/java/androidx/work/impl/model/SystemIdInfo.java
rename to work/work-runtime/src/main/java/androidx/work/impl/model/SystemIdInfo.java
diff --git a/work/workmanager/src/main/java/androidx/work/impl/model/SystemIdInfoDao.java b/work/work-runtime/src/main/java/androidx/work/impl/model/SystemIdInfoDao.java
similarity index 100%
rename from work/workmanager/src/main/java/androidx/work/impl/model/SystemIdInfoDao.java
rename to work/work-runtime/src/main/java/androidx/work/impl/model/SystemIdInfoDao.java
diff --git a/work/workmanager/src/main/java/androidx/work/impl/model/WorkName.java b/work/work-runtime/src/main/java/androidx/work/impl/model/WorkName.java
similarity index 100%
rename from work/workmanager/src/main/java/androidx/work/impl/model/WorkName.java
rename to work/work-runtime/src/main/java/androidx/work/impl/model/WorkName.java
diff --git a/work/workmanager/src/main/java/androidx/work/impl/model/WorkNameDao.java b/work/work-runtime/src/main/java/androidx/work/impl/model/WorkNameDao.java
similarity index 100%
rename from work/workmanager/src/main/java/androidx/work/impl/model/WorkNameDao.java
rename to work/work-runtime/src/main/java/androidx/work/impl/model/WorkNameDao.java
diff --git a/work/workmanager/src/main/java/androidx/work/impl/model/WorkProgress.java b/work/work-runtime/src/main/java/androidx/work/impl/model/WorkProgress.java
similarity index 100%
rename from work/workmanager/src/main/java/androidx/work/impl/model/WorkProgress.java
rename to work/work-runtime/src/main/java/androidx/work/impl/model/WorkProgress.java
diff --git a/work/workmanager/src/main/java/androidx/work/impl/model/WorkProgressDao.java b/work/work-runtime/src/main/java/androidx/work/impl/model/WorkProgressDao.java
similarity index 100%
rename from work/workmanager/src/main/java/androidx/work/impl/model/WorkProgressDao.java
rename to work/work-runtime/src/main/java/androidx/work/impl/model/WorkProgressDao.java
diff --git a/work/workmanager/src/main/java/androidx/work/impl/model/WorkSpec.java b/work/work-runtime/src/main/java/androidx/work/impl/model/WorkSpec.java
similarity index 100%
rename from work/workmanager/src/main/java/androidx/work/impl/model/WorkSpec.java
rename to work/work-runtime/src/main/java/androidx/work/impl/model/WorkSpec.java
diff --git a/work/workmanager/src/main/java/androidx/work/impl/model/WorkSpecDao.java b/work/work-runtime/src/main/java/androidx/work/impl/model/WorkSpecDao.java
similarity index 100%
rename from work/workmanager/src/main/java/androidx/work/impl/model/WorkSpecDao.java
rename to work/work-runtime/src/main/java/androidx/work/impl/model/WorkSpecDao.java
diff --git a/work/workmanager/src/main/java/androidx/work/impl/model/WorkTag.java b/work/work-runtime/src/main/java/androidx/work/impl/model/WorkTag.java
similarity index 100%
rename from work/workmanager/src/main/java/androidx/work/impl/model/WorkTag.java
rename to work/work-runtime/src/main/java/androidx/work/impl/model/WorkTag.java
diff --git a/work/workmanager/src/main/java/androidx/work/impl/model/WorkTagDao.java b/work/work-runtime/src/main/java/androidx/work/impl/model/WorkTagDao.java
similarity index 100%
rename from work/workmanager/src/main/java/androidx/work/impl/model/WorkTagDao.java
rename to work/work-runtime/src/main/java/androidx/work/impl/model/WorkTagDao.java
diff --git a/work/workmanager/src/main/java/androidx/work/impl/model/WorkTypeConverters.java b/work/work-runtime/src/main/java/androidx/work/impl/model/WorkTypeConverters.java
similarity index 100%
rename from work/workmanager/src/main/java/androidx/work/impl/model/WorkTypeConverters.java
rename to work/work-runtime/src/main/java/androidx/work/impl/model/WorkTypeConverters.java
diff --git a/work/workmanager/src/main/java/androidx/work/impl/model/package-info.java b/work/work-runtime/src/main/java/androidx/work/impl/model/package-info.java
similarity index 100%
rename from work/workmanager/src/main/java/androidx/work/impl/model/package-info.java
rename to work/work-runtime/src/main/java/androidx/work/impl/model/package-info.java
diff --git a/work/workmanager/src/main/java/androidx/work/impl/utils/CancelWorkRunnable.java b/work/work-runtime/src/main/java/androidx/work/impl/utils/CancelWorkRunnable.java
similarity index 100%
rename from work/workmanager/src/main/java/androidx/work/impl/utils/CancelWorkRunnable.java
rename to work/work-runtime/src/main/java/androidx/work/impl/utils/CancelWorkRunnable.java
diff --git a/work/workmanager/src/main/java/androidx/work/impl/utils/EnqueueRunnable.java b/work/work-runtime/src/main/java/androidx/work/impl/utils/EnqueueRunnable.java
similarity index 100%
rename from work/workmanager/src/main/java/androidx/work/impl/utils/EnqueueRunnable.java
rename to work/work-runtime/src/main/java/androidx/work/impl/utils/EnqueueRunnable.java
diff --git a/work/workmanager/src/main/java/androidx/work/impl/utils/ForceStopRunnable.java b/work/work-runtime/src/main/java/androidx/work/impl/utils/ForceStopRunnable.java
similarity index 100%
rename from work/workmanager/src/main/java/androidx/work/impl/utils/ForceStopRunnable.java
rename to work/work-runtime/src/main/java/androidx/work/impl/utils/ForceStopRunnable.java
diff --git a/work/workmanager/src/main/java/androidx/work/impl/utils/IdGenerator.java b/work/work-runtime/src/main/java/androidx/work/impl/utils/IdGenerator.java
similarity index 100%
rename from work/workmanager/src/main/java/androidx/work/impl/utils/IdGenerator.java
rename to work/work-runtime/src/main/java/androidx/work/impl/utils/IdGenerator.java
diff --git a/work/workmanager/src/main/java/androidx/work/impl/utils/LiveDataUtils.java b/work/work-runtime/src/main/java/androidx/work/impl/utils/LiveDataUtils.java
similarity index 100%
rename from work/workmanager/src/main/java/androidx/work/impl/utils/LiveDataUtils.java
rename to work/work-runtime/src/main/java/androidx/work/impl/utils/LiveDataUtils.java
diff --git a/work/workmanager/src/main/java/androidx/work/impl/utils/PackageManagerHelper.java b/work/work-runtime/src/main/java/androidx/work/impl/utils/PackageManagerHelper.java
similarity index 100%
rename from work/workmanager/src/main/java/androidx/work/impl/utils/PackageManagerHelper.java
rename to work/work-runtime/src/main/java/androidx/work/impl/utils/PackageManagerHelper.java
diff --git a/work/workmanager/src/main/java/androidx/work/impl/utils/PreferenceUtils.java b/work/work-runtime/src/main/java/androidx/work/impl/utils/PreferenceUtils.java
similarity index 100%
rename from work/workmanager/src/main/java/androidx/work/impl/utils/PreferenceUtils.java
rename to work/work-runtime/src/main/java/androidx/work/impl/utils/PreferenceUtils.java
diff --git a/work/workmanager/src/main/java/androidx/work/impl/utils/ProcessUtils.java b/work/work-runtime/src/main/java/androidx/work/impl/utils/ProcessUtils.java
similarity index 100%
rename from work/workmanager/src/main/java/androidx/work/impl/utils/ProcessUtils.java
rename to work/work-runtime/src/main/java/androidx/work/impl/utils/ProcessUtils.java
diff --git a/work/workmanager/src/main/java/androidx/work/impl/utils/PruneWorkRunnable.java b/work/work-runtime/src/main/java/androidx/work/impl/utils/PruneWorkRunnable.java
similarity index 100%
rename from work/workmanager/src/main/java/androidx/work/impl/utils/PruneWorkRunnable.java
rename to work/work-runtime/src/main/java/androidx/work/impl/utils/PruneWorkRunnable.java
diff --git a/work/workmanager/src/main/java/androidx/work/impl/utils/RawQueries.java b/work/work-runtime/src/main/java/androidx/work/impl/utils/RawQueries.java
similarity index 100%
rename from work/workmanager/src/main/java/androidx/work/impl/utils/RawQueries.java
rename to work/work-runtime/src/main/java/androidx/work/impl/utils/RawQueries.java
diff --git a/work/workmanager/src/main/java/androidx/work/impl/utils/SerialExecutor.java b/work/work-runtime/src/main/java/androidx/work/impl/utils/SerialExecutor.java
similarity index 100%
rename from work/workmanager/src/main/java/androidx/work/impl/utils/SerialExecutor.java
rename to work/work-runtime/src/main/java/androidx/work/impl/utils/SerialExecutor.java
diff --git a/work/workmanager/src/main/java/androidx/work/impl/utils/StartWorkRunnable.java b/work/work-runtime/src/main/java/androidx/work/impl/utils/StartWorkRunnable.java
similarity index 100%
rename from work/workmanager/src/main/java/androidx/work/impl/utils/StartWorkRunnable.java
rename to work/work-runtime/src/main/java/androidx/work/impl/utils/StartWorkRunnable.java
diff --git a/work/workmanager/src/main/java/androidx/work/impl/utils/StatusRunnable.java b/work/work-runtime/src/main/java/androidx/work/impl/utils/StatusRunnable.java
similarity index 100%
rename from work/workmanager/src/main/java/androidx/work/impl/utils/StatusRunnable.java
rename to work/work-runtime/src/main/java/androidx/work/impl/utils/StatusRunnable.java
diff --git a/work/workmanager/src/main/java/androidx/work/impl/utils/StopWorkRunnable.java b/work/work-runtime/src/main/java/androidx/work/impl/utils/StopWorkRunnable.java
similarity index 100%
rename from work/workmanager/src/main/java/androidx/work/impl/utils/StopWorkRunnable.java
rename to work/work-runtime/src/main/java/androidx/work/impl/utils/StopWorkRunnable.java
diff --git a/work/workmanager/src/main/java/androidx/work/impl/utils/SynchronousExecutor.java b/work/work-runtime/src/main/java/androidx/work/impl/utils/SynchronousExecutor.java
similarity index 100%
rename from work/workmanager/src/main/java/androidx/work/impl/utils/SynchronousExecutor.java
rename to work/work-runtime/src/main/java/androidx/work/impl/utils/SynchronousExecutor.java
diff --git a/work/workmanager/src/main/java/androidx/work/impl/utils/WakeLocks.java b/work/work-runtime/src/main/java/androidx/work/impl/utils/WakeLocks.java
similarity index 100%
rename from work/workmanager/src/main/java/androidx/work/impl/utils/WakeLocks.java
rename to work/work-runtime/src/main/java/androidx/work/impl/utils/WakeLocks.java
diff --git a/work/workmanager/src/main/java/androidx/work/impl/utils/WorkForegroundRunnable.java b/work/work-runtime/src/main/java/androidx/work/impl/utils/WorkForegroundRunnable.java
similarity index 100%
rename from work/workmanager/src/main/java/androidx/work/impl/utils/WorkForegroundRunnable.java
rename to work/work-runtime/src/main/java/androidx/work/impl/utils/WorkForegroundRunnable.java
diff --git a/work/workmanager/src/main/java/androidx/work/impl/utils/WorkForegroundUpdater.java b/work/work-runtime/src/main/java/androidx/work/impl/utils/WorkForegroundUpdater.java
similarity index 100%
rename from work/workmanager/src/main/java/androidx/work/impl/utils/WorkForegroundUpdater.java
rename to work/work-runtime/src/main/java/androidx/work/impl/utils/WorkForegroundUpdater.java
diff --git a/work/workmanager/src/main/java/androidx/work/impl/utils/WorkProgressUpdater.java b/work/work-runtime/src/main/java/androidx/work/impl/utils/WorkProgressUpdater.java
similarity index 100%
rename from work/workmanager/src/main/java/androidx/work/impl/utils/WorkProgressUpdater.java
rename to work/work-runtime/src/main/java/androidx/work/impl/utils/WorkProgressUpdater.java
diff --git a/work/workmanager/src/main/java/androidx/work/impl/utils/WorkTimer.java b/work/work-runtime/src/main/java/androidx/work/impl/utils/WorkTimer.java
similarity index 100%
rename from work/workmanager/src/main/java/androidx/work/impl/utils/WorkTimer.java
rename to work/work-runtime/src/main/java/androidx/work/impl/utils/WorkTimer.java
diff --git a/work/workmanager/src/main/java/androidx/work/impl/utils/futures/AbstractFuture.java b/work/work-runtime/src/main/java/androidx/work/impl/utils/futures/AbstractFuture.java
similarity index 100%
rename from work/workmanager/src/main/java/androidx/work/impl/utils/futures/AbstractFuture.java
rename to work/work-runtime/src/main/java/androidx/work/impl/utils/futures/AbstractFuture.java
diff --git a/work/workmanager/src/main/java/androidx/work/impl/utils/futures/DirectExecutor.java b/work/work-runtime/src/main/java/androidx/work/impl/utils/futures/DirectExecutor.java
similarity index 100%
rename from work/workmanager/src/main/java/androidx/work/impl/utils/futures/DirectExecutor.java
rename to work/work-runtime/src/main/java/androidx/work/impl/utils/futures/DirectExecutor.java
diff --git a/work/workmanager/src/main/java/androidx/work/impl/utils/futures/SettableFuture.java b/work/work-runtime/src/main/java/androidx/work/impl/utils/futures/SettableFuture.java
similarity index 100%
rename from work/workmanager/src/main/java/androidx/work/impl/utils/futures/SettableFuture.java
rename to work/work-runtime/src/main/java/androidx/work/impl/utils/futures/SettableFuture.java
diff --git a/work/workmanager/src/main/java/androidx/work/impl/utils/futures/package-info.java b/work/work-runtime/src/main/java/androidx/work/impl/utils/futures/package-info.java
similarity index 100%
rename from work/workmanager/src/main/java/androidx/work/impl/utils/futures/package-info.java
rename to work/work-runtime/src/main/java/androidx/work/impl/utils/futures/package-info.java
diff --git a/work/workmanager/src/main/java/androidx/work/impl/utils/package-info.java b/work/work-runtime/src/main/java/androidx/work/impl/utils/package-info.java
similarity index 100%
rename from work/workmanager/src/main/java/androidx/work/impl/utils/package-info.java
rename to work/work-runtime/src/main/java/androidx/work/impl/utils/package-info.java
diff --git a/work/workmanager/src/main/java/androidx/work/impl/utils/taskexecutor/TaskExecutor.java b/work/work-runtime/src/main/java/androidx/work/impl/utils/taskexecutor/TaskExecutor.java
similarity index 100%
rename from work/workmanager/src/main/java/androidx/work/impl/utils/taskexecutor/TaskExecutor.java
rename to work/work-runtime/src/main/java/androidx/work/impl/utils/taskexecutor/TaskExecutor.java
diff --git a/work/workmanager/src/main/java/androidx/work/impl/utils/taskexecutor/WorkManagerTaskExecutor.java b/work/work-runtime/src/main/java/androidx/work/impl/utils/taskexecutor/WorkManagerTaskExecutor.java
similarity index 100%
rename from work/workmanager/src/main/java/androidx/work/impl/utils/taskexecutor/WorkManagerTaskExecutor.java
rename to work/work-runtime/src/main/java/androidx/work/impl/utils/taskexecutor/WorkManagerTaskExecutor.java
diff --git a/work/workmanager/src/main/java/androidx/work/impl/utils/taskexecutor/package-info.java b/work/work-runtime/src/main/java/androidx/work/impl/utils/taskexecutor/package-info.java
similarity index 100%
rename from work/workmanager/src/main/java/androidx/work/impl/utils/taskexecutor/package-info.java
rename to work/work-runtime/src/main/java/androidx/work/impl/utils/taskexecutor/package-info.java
diff --git a/work/workmanager/src/main/java/androidx/work/impl/workers/CombineContinuationsWorker.java b/work/work-runtime/src/main/java/androidx/work/impl/workers/CombineContinuationsWorker.java
similarity index 100%
rename from work/workmanager/src/main/java/androidx/work/impl/workers/CombineContinuationsWorker.java
rename to work/work-runtime/src/main/java/androidx/work/impl/workers/CombineContinuationsWorker.java
diff --git a/work/workmanager/src/main/java/androidx/work/impl/workers/ConstraintTrackingWorker.java b/work/work-runtime/src/main/java/androidx/work/impl/workers/ConstraintTrackingWorker.java
similarity index 100%
rename from work/workmanager/src/main/java/androidx/work/impl/workers/ConstraintTrackingWorker.java
rename to work/work-runtime/src/main/java/androidx/work/impl/workers/ConstraintTrackingWorker.java
diff --git a/work/workmanager/src/main/java/androidx/work/impl/workers/DiagnosticsWorker.java b/work/work-runtime/src/main/java/androidx/work/impl/workers/DiagnosticsWorker.java
similarity index 100%
rename from work/workmanager/src/main/java/androidx/work/impl/workers/DiagnosticsWorker.java
rename to work/work-runtime/src/main/java/androidx/work/impl/workers/DiagnosticsWorker.java
diff --git a/work/workmanager/src/main/java/androidx/work/multiprocess/RemoteWorkContinuation.java b/work/work-runtime/src/main/java/androidx/work/multiprocess/RemoteWorkContinuation.java
similarity index 100%
rename from work/workmanager/src/main/java/androidx/work/multiprocess/RemoteWorkContinuation.java
rename to work/work-runtime/src/main/java/androidx/work/multiprocess/RemoteWorkContinuation.java
diff --git a/work/workmanager/src/main/java/androidx/work/multiprocess/RemoteWorkManager.java b/work/work-runtime/src/main/java/androidx/work/multiprocess/RemoteWorkManager.java
similarity index 100%
rename from work/workmanager/src/main/java/androidx/work/multiprocess/RemoteWorkManager.java
rename to work/work-runtime/src/main/java/androidx/work/multiprocess/RemoteWorkManager.java
diff --git a/work/workmanager/src/main/java/androidx/work/package-info.java b/work/work-runtime/src/main/java/androidx/work/package-info.java
similarity index 100%
rename from work/workmanager/src/main/java/androidx/work/package-info.java
rename to work/work-runtime/src/main/java/androidx/work/package-info.java
diff --git a/work/workmanager/src/main/res/values-v23/values.xml b/work/work-runtime/src/main/res/values-v23/values.xml
similarity index 100%
rename from work/workmanager/src/main/res/values-v23/values.xml
rename to work/work-runtime/src/main/res/values-v23/values.xml
diff --git a/work/workmanager/src/main/res/values/values.xml b/work/work-runtime/src/main/res/values/values.xml
similarity index 100%
rename from work/workmanager/src/main/res/values/values.xml
rename to work/work-runtime/src/main/res/values/values.xml
diff --git a/work/workmanager/src/schemas/androidx.work.impl.WorkDatabase/1.json b/work/work-runtime/src/schemas/androidx.work.impl.WorkDatabase/1.json
similarity index 100%
rename from work/workmanager/src/schemas/androidx.work.impl.WorkDatabase/1.json
rename to work/work-runtime/src/schemas/androidx.work.impl.WorkDatabase/1.json
diff --git a/work/workmanager/src/schemas/androidx.work.impl.WorkDatabase/10.json b/work/work-runtime/src/schemas/androidx.work.impl.WorkDatabase/10.json
similarity index 100%
rename from work/workmanager/src/schemas/androidx.work.impl.WorkDatabase/10.json
rename to work/work-runtime/src/schemas/androidx.work.impl.WorkDatabase/10.json
diff --git a/work/workmanager/src/schemas/androidx.work.impl.WorkDatabase/11.json b/work/work-runtime/src/schemas/androidx.work.impl.WorkDatabase/11.json
similarity index 100%
rename from work/workmanager/src/schemas/androidx.work.impl.WorkDatabase/11.json
rename to work/work-runtime/src/schemas/androidx.work.impl.WorkDatabase/11.json
diff --git a/work/workmanager/src/schemas/androidx.work.impl.WorkDatabase/12.json b/work/work-runtime/src/schemas/androidx.work.impl.WorkDatabase/12.json
similarity index 100%
rename from work/workmanager/src/schemas/androidx.work.impl.WorkDatabase/12.json
rename to work/work-runtime/src/schemas/androidx.work.impl.WorkDatabase/12.json
diff --git a/work/workmanager/src/schemas/androidx.work.impl.WorkDatabase/2.json b/work/work-runtime/src/schemas/androidx.work.impl.WorkDatabase/2.json
similarity index 100%
rename from work/workmanager/src/schemas/androidx.work.impl.WorkDatabase/2.json
rename to work/work-runtime/src/schemas/androidx.work.impl.WorkDatabase/2.json
diff --git a/work/workmanager/src/schemas/androidx.work.impl.WorkDatabase/3.json b/work/work-runtime/src/schemas/androidx.work.impl.WorkDatabase/3.json
similarity index 100%
rename from work/workmanager/src/schemas/androidx.work.impl.WorkDatabase/3.json
rename to work/work-runtime/src/schemas/androidx.work.impl.WorkDatabase/3.json
diff --git a/work/workmanager/src/schemas/androidx.work.impl.WorkDatabase/4.json b/work/work-runtime/src/schemas/androidx.work.impl.WorkDatabase/4.json
similarity index 100%
rename from work/workmanager/src/schemas/androidx.work.impl.WorkDatabase/4.json
rename to work/work-runtime/src/schemas/androidx.work.impl.WorkDatabase/4.json
diff --git a/work/workmanager/src/schemas/androidx.work.impl.WorkDatabase/5.json b/work/work-runtime/src/schemas/androidx.work.impl.WorkDatabase/5.json
similarity index 100%
rename from work/workmanager/src/schemas/androidx.work.impl.WorkDatabase/5.json
rename to work/work-runtime/src/schemas/androidx.work.impl.WorkDatabase/5.json
diff --git a/work/workmanager/src/schemas/androidx.work.impl.WorkDatabase/6.json b/work/work-runtime/src/schemas/androidx.work.impl.WorkDatabase/6.json
similarity index 100%
rename from work/workmanager/src/schemas/androidx.work.impl.WorkDatabase/6.json
rename to work/work-runtime/src/schemas/androidx.work.impl.WorkDatabase/6.json
diff --git a/work/workmanager/src/schemas/androidx.work.impl.WorkDatabase/7.json b/work/work-runtime/src/schemas/androidx.work.impl.WorkDatabase/7.json
similarity index 100%
rename from work/workmanager/src/schemas/androidx.work.impl.WorkDatabase/7.json
rename to work/work-runtime/src/schemas/androidx.work.impl.WorkDatabase/7.json
diff --git a/work/workmanager/src/schemas/androidx.work.impl.WorkDatabase/8.json b/work/work-runtime/src/schemas/androidx.work.impl.WorkDatabase/8.json
similarity index 100%
rename from work/workmanager/src/schemas/androidx.work.impl.WorkDatabase/8.json
rename to work/work-runtime/src/schemas/androidx.work.impl.WorkDatabase/8.json
diff --git a/work/workmanager/src/schemas/androidx.work.impl.WorkDatabase/9.json b/work/work-runtime/src/schemas/androidx.work.impl.WorkDatabase/9.json
similarity index 100%
rename from work/workmanager/src/schemas/androidx.work.impl.WorkDatabase/9.json
rename to work/work-runtime/src/schemas/androidx.work.impl.WorkDatabase/9.json
diff --git a/work/workmanager/src/test/java/androidx/work/ArrayCreatingInputMergerTest.java b/work/work-runtime/src/test/java/androidx/work/ArrayCreatingInputMergerTest.java
similarity index 100%
rename from work/workmanager/src/test/java/androidx/work/ArrayCreatingInputMergerTest.java
rename to work/work-runtime/src/test/java/androidx/work/ArrayCreatingInputMergerTest.java
diff --git a/work/workmanager/src/test/java/androidx/work/DataTest.java b/work/work-runtime/src/test/java/androidx/work/DataTest.java
similarity index 100%
rename from work/workmanager/src/test/java/androidx/work/DataTest.java
rename to work/work-runtime/src/test/java/androidx/work/DataTest.java
diff --git a/work/workmanager/src/test/java/androidx/work/OverwritingInputMergerTest.java b/work/work-runtime/src/test/java/androidx/work/OverwritingInputMergerTest.java
similarity index 100%
rename from work/workmanager/src/test/java/androidx/work/OverwritingInputMergerTest.java
rename to work/work-runtime/src/test/java/androidx/work/OverwritingInputMergerTest.java
diff --git a/work/workmanager-rxjava2/api/1.0.0-beta01.txt b/work/work-rxjava2/api/1.0.0-beta01.txt
similarity index 100%
rename from work/workmanager-rxjava2/api/1.0.0-beta01.txt
rename to work/work-rxjava2/api/1.0.0-beta01.txt
diff --git a/work/workmanager-rxjava2/api/1.0.0-beta02.txt b/work/work-rxjava2/api/1.0.0-beta02.txt
similarity index 100%
rename from work/workmanager-rxjava2/api/1.0.0-beta02.txt
rename to work/work-rxjava2/api/1.0.0-beta02.txt
diff --git a/work/workmanager-rxjava2/api/1.0.0-beta03.txt b/work/work-rxjava2/api/1.0.0-beta03.txt
similarity index 100%
rename from work/workmanager-rxjava2/api/1.0.0-beta03.txt
rename to work/work-rxjava2/api/1.0.0-beta03.txt
diff --git a/work/workmanager-rxjava2/api/1.0.0-beta04.txt b/work/work-rxjava2/api/1.0.0-beta04.txt
similarity index 100%
rename from work/workmanager-rxjava2/api/1.0.0-beta04.txt
rename to work/work-rxjava2/api/1.0.0-beta04.txt
diff --git a/work/workmanager-rxjava2/api/1.0.0-rc01.txt b/work/work-rxjava2/api/1.0.0-rc01.txt
similarity index 100%
rename from work/workmanager-rxjava2/api/1.0.0-rc01.txt
rename to work/work-rxjava2/api/1.0.0-rc01.txt
diff --git a/work/workmanager-rxjava2/api/1.0.0-rc02.txt b/work/work-rxjava2/api/1.0.0-rc02.txt
similarity index 100%
rename from work/workmanager-rxjava2/api/1.0.0-rc02.txt
rename to work/work-rxjava2/api/1.0.0-rc02.txt
diff --git a/work/workmanager-rxjava2/api/1.0.0.txt b/work/work-rxjava2/api/1.0.0.txt
similarity index 100%
rename from work/workmanager-rxjava2/api/1.0.0.txt
rename to work/work-rxjava2/api/1.0.0.txt
diff --git a/work/workmanager-rxjava2/api/2.0.0-rc01.txt b/work/work-rxjava2/api/2.0.0-rc01.txt
similarity index 100%
rename from work/workmanager-rxjava2/api/2.0.0-rc01.txt
rename to work/work-rxjava2/api/2.0.0-rc01.txt
diff --git a/work/workmanager-rxjava2/api/2.0.0.txt b/work/work-rxjava2/api/2.0.0.txt
similarity index 100%
rename from work/workmanager-rxjava2/api/2.0.0.txt
rename to work/work-rxjava2/api/2.0.0.txt
diff --git a/work/workmanager-rxjava2/api/2.1.0-beta01.txt b/work/work-rxjava2/api/2.1.0-beta01.txt
similarity index 100%
rename from work/workmanager-rxjava2/api/2.1.0-beta01.txt
rename to work/work-rxjava2/api/2.1.0-beta01.txt
diff --git a/work/workmanager-rxjava2/api/2.1.0-beta02.txt b/work/work-rxjava2/api/2.1.0-beta02.txt
similarity index 100%
rename from work/workmanager-rxjava2/api/2.1.0-beta02.txt
rename to work/work-rxjava2/api/2.1.0-beta02.txt
diff --git a/work/workmanager-rxjava2/api/2.1.0-rc01.txt b/work/work-rxjava2/api/2.1.0-rc01.txt
similarity index 100%
rename from work/workmanager-rxjava2/api/2.1.0-rc01.txt
rename to work/work-rxjava2/api/2.1.0-rc01.txt
diff --git a/work/workmanager-rxjava2/api/2.1.0.txt b/work/work-rxjava2/api/2.1.0.txt
similarity index 100%
rename from work/workmanager-rxjava2/api/2.1.0.txt
rename to work/work-rxjava2/api/2.1.0.txt
diff --git a/work/workmanager-rxjava2/api/2.2.0-beta01.txt b/work/work-rxjava2/api/2.2.0-beta01.txt
similarity index 100%
rename from work/workmanager-rxjava2/api/2.2.0-beta01.txt
rename to work/work-rxjava2/api/2.2.0-beta01.txt
diff --git a/work/workmanager-rxjava2/api/2.3.0-beta01.txt b/work/work-rxjava2/api/2.3.0-beta01.txt
similarity index 100%
rename from work/workmanager-rxjava2/api/2.3.0-beta01.txt
rename to work/work-rxjava2/api/2.3.0-beta01.txt
diff --git a/work/workmanager-rxjava2/api/2.3.0-beta02.txt b/work/work-rxjava2/api/2.3.0-beta02.txt
similarity index 100%
rename from work/workmanager-rxjava2/api/2.3.0-beta02.txt
rename to work/work-rxjava2/api/2.3.0-beta02.txt
diff --git a/work/workmanager-rxjava2/api/2.3.0-rc01.txt b/work/work-rxjava2/api/2.3.0-rc01.txt
similarity index 100%
rename from work/workmanager-rxjava2/api/2.3.0-rc01.txt
rename to work/work-rxjava2/api/2.3.0-rc01.txt
diff --git a/work/workmanager-rxjava2/api/2.4.0-beta01.txt b/work/work-rxjava2/api/2.4.0-beta01.txt
similarity index 100%
rename from work/workmanager-rxjava2/api/2.4.0-beta01.txt
rename to work/work-rxjava2/api/2.4.0-beta01.txt
diff --git a/work/workmanager-rxjava2/api/2.4.0-beta02.txt b/work/work-rxjava2/api/2.4.0-beta02.txt
similarity index 100%
rename from work/workmanager-rxjava2/api/2.4.0-beta02.txt
rename to work/work-rxjava2/api/2.4.0-beta02.txt
diff --git a/work/workmanager-rxjava2/api/2.4.0-rc01.txt b/work/work-rxjava2/api/2.4.0-rc01.txt
similarity index 100%
rename from work/workmanager-rxjava2/api/2.4.0-rc01.txt
rename to work/work-rxjava2/api/2.4.0-rc01.txt
diff --git a/work/workmanager-rxjava2/api/2.5.0-beta01.txt b/work/work-rxjava2/api/2.5.0-beta01.txt
similarity index 100%
rename from work/workmanager-rxjava2/api/2.5.0-beta01.txt
rename to work/work-rxjava2/api/2.5.0-beta01.txt
diff --git a/work/workmanager-rxjava2/api/2.5.0-beta02.txt b/work/work-rxjava2/api/2.5.0-beta02.txt
similarity index 100%
rename from work/workmanager-rxjava2/api/2.5.0-beta02.txt
rename to work/work-rxjava2/api/2.5.0-beta02.txt
diff --git a/work/workmanager-rxjava2/api/2.5.0-beta01.txt b/work/work-rxjava2/api/2.7.0-beta01.txt
similarity index 100%
copy from work/workmanager-rxjava2/api/2.5.0-beta01.txt
copy to work/work-rxjava2/api/2.7.0-beta01.txt
diff --git a/work/workmanager-rxjava2/api/current.txt b/work/work-rxjava2/api/current.txt
similarity index 100%
rename from work/workmanager-rxjava2/api/current.txt
rename to work/work-rxjava2/api/current.txt
diff --git a/work/workmanager-rxjava2/api/public_plus_experimental_2.0.0-rc01.txt b/work/work-rxjava2/api/public_plus_experimental_2.0.0-rc01.txt
similarity index 100%
rename from work/workmanager-rxjava2/api/public_plus_experimental_2.0.0-rc01.txt
rename to work/work-rxjava2/api/public_plus_experimental_2.0.0-rc01.txt
diff --git a/work/workmanager-rxjava2/api/public_plus_experimental_2.0.0.txt b/work/work-rxjava2/api/public_plus_experimental_2.0.0.txt
similarity index 100%
rename from work/workmanager-rxjava2/api/public_plus_experimental_2.0.0.txt
rename to work/work-rxjava2/api/public_plus_experimental_2.0.0.txt
diff --git a/work/workmanager-rxjava2/api/public_plus_experimental_2.1.0-beta01.txt b/work/work-rxjava2/api/public_plus_experimental_2.1.0-beta01.txt
similarity index 100%
rename from work/workmanager-rxjava2/api/public_plus_experimental_2.1.0-beta01.txt
rename to work/work-rxjava2/api/public_plus_experimental_2.1.0-beta01.txt
diff --git a/work/workmanager-rxjava2/api/public_plus_experimental_2.1.0-beta02.txt b/work/work-rxjava2/api/public_plus_experimental_2.1.0-beta02.txt
similarity index 100%
rename from work/workmanager-rxjava2/api/public_plus_experimental_2.1.0-beta02.txt
rename to work/work-rxjava2/api/public_plus_experimental_2.1.0-beta02.txt
diff --git a/work/workmanager-rxjava2/api/public_plus_experimental_2.1.0-rc01.txt b/work/work-rxjava2/api/public_plus_experimental_2.1.0-rc01.txt
similarity index 100%
rename from work/workmanager-rxjava2/api/public_plus_experimental_2.1.0-rc01.txt
rename to work/work-rxjava2/api/public_plus_experimental_2.1.0-rc01.txt
diff --git a/work/workmanager-rxjava2/api/public_plus_experimental_2.1.0.txt b/work/work-rxjava2/api/public_plus_experimental_2.1.0.txt
similarity index 100%
rename from work/workmanager-rxjava2/api/public_plus_experimental_2.1.0.txt
rename to work/work-rxjava2/api/public_plus_experimental_2.1.0.txt
diff --git a/work/workmanager-rxjava2/api/public_plus_experimental_2.2.0-beta01.txt b/work/work-rxjava2/api/public_plus_experimental_2.2.0-beta01.txt
similarity index 100%
rename from work/workmanager-rxjava2/api/public_plus_experimental_2.2.0-beta01.txt
rename to work/work-rxjava2/api/public_plus_experimental_2.2.0-beta01.txt
diff --git a/work/workmanager-rxjava2/api/public_plus_experimental_2.3.0-beta01.txt b/work/work-rxjava2/api/public_plus_experimental_2.3.0-beta01.txt
similarity index 100%
rename from work/workmanager-rxjava2/api/public_plus_experimental_2.3.0-beta01.txt
rename to work/work-rxjava2/api/public_plus_experimental_2.3.0-beta01.txt
diff --git a/work/workmanager-rxjava2/api/public_plus_experimental_2.3.0-beta02.txt b/work/work-rxjava2/api/public_plus_experimental_2.3.0-beta02.txt
similarity index 100%
rename from work/workmanager-rxjava2/api/public_plus_experimental_2.3.0-beta02.txt
rename to work/work-rxjava2/api/public_plus_experimental_2.3.0-beta02.txt
diff --git a/work/workmanager-rxjava2/api/public_plus_experimental_2.3.0-rc01.txt b/work/work-rxjava2/api/public_plus_experimental_2.3.0-rc01.txt
similarity index 100%
rename from work/workmanager-rxjava2/api/public_plus_experimental_2.3.0-rc01.txt
rename to work/work-rxjava2/api/public_plus_experimental_2.3.0-rc01.txt
diff --git a/work/workmanager-rxjava2/api/public_plus_experimental_2.4.0-beta01.txt b/work/work-rxjava2/api/public_plus_experimental_2.4.0-beta01.txt
similarity index 100%
rename from work/workmanager-rxjava2/api/public_plus_experimental_2.4.0-beta01.txt
rename to work/work-rxjava2/api/public_plus_experimental_2.4.0-beta01.txt
diff --git a/work/workmanager-rxjava2/api/public_plus_experimental_2.4.0-beta02.txt b/work/work-rxjava2/api/public_plus_experimental_2.4.0-beta02.txt
similarity index 100%
rename from work/workmanager-rxjava2/api/public_plus_experimental_2.4.0-beta02.txt
rename to work/work-rxjava2/api/public_plus_experimental_2.4.0-beta02.txt
diff --git a/work/workmanager-rxjava2/api/public_plus_experimental_2.4.0-rc01.txt b/work/work-rxjava2/api/public_plus_experimental_2.4.0-rc01.txt
similarity index 100%
rename from work/workmanager-rxjava2/api/public_plus_experimental_2.4.0-rc01.txt
rename to work/work-rxjava2/api/public_plus_experimental_2.4.0-rc01.txt
diff --git a/work/workmanager-rxjava2/api/public_plus_experimental_2.5.0-beta01.txt b/work/work-rxjava2/api/public_plus_experimental_2.5.0-beta01.txt
similarity index 100%
rename from work/workmanager-rxjava2/api/public_plus_experimental_2.5.0-beta01.txt
rename to work/work-rxjava2/api/public_plus_experimental_2.5.0-beta01.txt
diff --git a/work/workmanager-rxjava2/api/public_plus_experimental_2.5.0-beta02.txt b/work/work-rxjava2/api/public_plus_experimental_2.5.0-beta02.txt
similarity index 100%
rename from work/workmanager-rxjava2/api/public_plus_experimental_2.5.0-beta02.txt
rename to work/work-rxjava2/api/public_plus_experimental_2.5.0-beta02.txt
diff --git a/work/workmanager-rxjava2/api/2.5.0-beta01.txt b/work/work-rxjava2/api/public_plus_experimental_2.7.0-beta01.txt
similarity index 100%
copy from work/workmanager-rxjava2/api/2.5.0-beta01.txt
copy to work/work-rxjava2/api/public_plus_experimental_2.7.0-beta01.txt
diff --git a/work/workmanager-rxjava2/api/public_plus_experimental_current.txt b/work/work-rxjava2/api/public_plus_experimental_current.txt
similarity index 100%
rename from work/workmanager-rxjava2/api/public_plus_experimental_current.txt
rename to work/work-rxjava2/api/public_plus_experimental_current.txt
diff --git a/work/workmanager-rxjava2/api/res-1.0.0-beta01.txt b/work/work-rxjava2/api/res-1.0.0-beta01.txt
similarity index 100%
rename from work/workmanager-rxjava2/api/res-1.0.0-beta01.txt
rename to work/work-rxjava2/api/res-1.0.0-beta01.txt
diff --git a/work/workmanager-rxjava2/api/res-1.0.0-beta02.txt b/work/work-rxjava2/api/res-1.0.0-beta02.txt
similarity index 100%
rename from work/workmanager-rxjava2/api/res-1.0.0-beta02.txt
rename to work/work-rxjava2/api/res-1.0.0-beta02.txt
diff --git a/work/workmanager-rxjava2/api/res-1.0.0-beta03.txt b/work/work-rxjava2/api/res-1.0.0-beta03.txt
similarity index 100%
rename from work/workmanager-rxjava2/api/res-1.0.0-beta03.txt
rename to work/work-rxjava2/api/res-1.0.0-beta03.txt
diff --git a/work/workmanager-rxjava2/api/res-1.0.0-beta04.txt b/work/work-rxjava2/api/res-1.0.0-beta04.txt
similarity index 100%
rename from work/workmanager-rxjava2/api/res-1.0.0-beta04.txt
rename to work/work-rxjava2/api/res-1.0.0-beta04.txt
diff --git a/work/workmanager-rxjava2/api/res-1.0.0-rc01.txt b/work/work-rxjava2/api/res-1.0.0-rc01.txt
similarity index 100%
rename from work/workmanager-rxjava2/api/res-1.0.0-rc01.txt
rename to work/work-rxjava2/api/res-1.0.0-rc01.txt
diff --git a/work/workmanager-rxjava2/api/res-1.0.0-rc02.txt b/work/work-rxjava2/api/res-1.0.0-rc02.txt
similarity index 100%
rename from work/workmanager-rxjava2/api/res-1.0.0-rc02.txt
rename to work/work-rxjava2/api/res-1.0.0-rc02.txt
diff --git a/work/workmanager-rxjava2/api/res-1.0.0.txt b/work/work-rxjava2/api/res-1.0.0.txt
similarity index 100%
rename from work/workmanager-rxjava2/api/res-1.0.0.txt
rename to work/work-rxjava2/api/res-1.0.0.txt
diff --git a/work/workmanager-rxjava2/api/res-2.0.0-rc01.txt b/work/work-rxjava2/api/res-2.0.0-rc01.txt
similarity index 100%
rename from work/workmanager-rxjava2/api/res-2.0.0-rc01.txt
rename to work/work-rxjava2/api/res-2.0.0-rc01.txt
diff --git a/work/workmanager-rxjava2/api/res-2.0.0.txt b/work/work-rxjava2/api/res-2.0.0.txt
similarity index 100%
rename from work/workmanager-rxjava2/api/res-2.0.0.txt
rename to work/work-rxjava2/api/res-2.0.0.txt
diff --git a/work/workmanager-rxjava2/api/res-2.1.0-beta01.txt b/work/work-rxjava2/api/res-2.1.0-beta01.txt
similarity index 100%
rename from work/workmanager-rxjava2/api/res-2.1.0-beta01.txt
rename to work/work-rxjava2/api/res-2.1.0-beta01.txt
diff --git a/work/workmanager-rxjava2/api/res-2.1.0-beta02.txt b/work/work-rxjava2/api/res-2.1.0-beta02.txt
similarity index 100%
rename from work/workmanager-rxjava2/api/res-2.1.0-beta02.txt
rename to work/work-rxjava2/api/res-2.1.0-beta02.txt
diff --git a/work/workmanager-rxjava2/api/res-2.1.0-rc01.txt b/work/work-rxjava2/api/res-2.1.0-rc01.txt
similarity index 100%
rename from work/workmanager-rxjava2/api/res-2.1.0-rc01.txt
rename to work/work-rxjava2/api/res-2.1.0-rc01.txt
diff --git a/work/workmanager-rxjava2/api/res-2.1.0.txt b/work/work-rxjava2/api/res-2.1.0.txt
similarity index 100%
rename from work/workmanager-rxjava2/api/res-2.1.0.txt
rename to work/work-rxjava2/api/res-2.1.0.txt
diff --git a/work/workmanager-rxjava2/api/res-2.2.0-beta01.txt b/work/work-rxjava2/api/res-2.2.0-beta01.txt
similarity index 100%
rename from work/workmanager-rxjava2/api/res-2.2.0-beta01.txt
rename to work/work-rxjava2/api/res-2.2.0-beta01.txt
diff --git a/work/workmanager-rxjava2/api/res-2.3.0-beta01.txt b/work/work-rxjava2/api/res-2.3.0-beta01.txt
similarity index 100%
rename from work/workmanager-rxjava2/api/res-2.3.0-beta01.txt
rename to work/work-rxjava2/api/res-2.3.0-beta01.txt
diff --git a/work/workmanager-rxjava2/api/res-2.3.0-beta02.txt b/work/work-rxjava2/api/res-2.3.0-beta02.txt
similarity index 100%
rename from work/workmanager-rxjava2/api/res-2.3.0-beta02.txt
rename to work/work-rxjava2/api/res-2.3.0-beta02.txt
diff --git a/work/workmanager-rxjava2/api/res-2.3.0-rc01.txt b/work/work-rxjava2/api/res-2.3.0-rc01.txt
similarity index 100%
rename from work/workmanager-rxjava2/api/res-2.3.0-rc01.txt
rename to work/work-rxjava2/api/res-2.3.0-rc01.txt
diff --git a/work/workmanager-rxjava2/api/res-2.4.0-beta01.txt b/work/work-rxjava2/api/res-2.4.0-beta01.txt
similarity index 100%
rename from work/workmanager-rxjava2/api/res-2.4.0-beta01.txt
rename to work/work-rxjava2/api/res-2.4.0-beta01.txt
diff --git a/work/workmanager-rxjava2/api/res-2.4.0-beta02.txt b/work/work-rxjava2/api/res-2.4.0-beta02.txt
similarity index 100%
rename from work/workmanager-rxjava2/api/res-2.4.0-beta02.txt
rename to work/work-rxjava2/api/res-2.4.0-beta02.txt
diff --git a/work/workmanager-rxjava2/api/res-2.4.0-rc01.txt b/work/work-rxjava2/api/res-2.4.0-rc01.txt
similarity index 100%
rename from work/workmanager-rxjava2/api/res-2.4.0-rc01.txt
rename to work/work-rxjava2/api/res-2.4.0-rc01.txt
diff --git a/work/workmanager-rxjava2/api/res-2.5.0-beta01.txt b/work/work-rxjava2/api/res-2.5.0-beta01.txt
similarity index 100%
rename from work/workmanager-rxjava2/api/res-2.5.0-beta01.txt
rename to work/work-rxjava2/api/res-2.5.0-beta01.txt
diff --git a/work/workmanager-rxjava2/api/res-2.5.0-beta02.txt b/work/work-rxjava2/api/res-2.5.0-beta02.txt
similarity index 100%
rename from work/workmanager-rxjava2/api/res-2.5.0-beta02.txt
rename to work/work-rxjava2/api/res-2.5.0-beta02.txt
diff --git a/work/workmanager-rxjava2/api/res-1.0.0-beta01.txt b/work/work-rxjava2/api/res-2.7.0-beta01.txt
similarity index 100%
copy from work/workmanager-rxjava2/api/res-1.0.0-beta01.txt
copy to work/work-rxjava2/api/res-2.7.0-beta01.txt
diff --git a/work/workmanager-rxjava2/api/res-current.txt b/work/work-rxjava2/api/res-current.txt
similarity index 100%
rename from work/workmanager-rxjava2/api/res-current.txt
rename to work/work-rxjava2/api/res-current.txt
diff --git a/work/workmanager-rxjava2/api/restricted_1.0.0-beta04.txt b/work/work-rxjava2/api/restricted_1.0.0-beta04.txt
similarity index 100%
rename from work/workmanager-rxjava2/api/restricted_1.0.0-beta04.txt
rename to work/work-rxjava2/api/restricted_1.0.0-beta04.txt
diff --git a/work/workmanager-rxjava2/api/restricted_1.0.0-rc01.txt b/work/work-rxjava2/api/restricted_1.0.0-rc01.txt
similarity index 100%
rename from work/workmanager-rxjava2/api/restricted_1.0.0-rc01.txt
rename to work/work-rxjava2/api/restricted_1.0.0-rc01.txt
diff --git a/work/workmanager-rxjava2/api/restricted_1.0.0-rc02.txt b/work/work-rxjava2/api/restricted_1.0.0-rc02.txt
similarity index 100%
rename from work/workmanager-rxjava2/api/restricted_1.0.0-rc02.txt
rename to work/work-rxjava2/api/restricted_1.0.0-rc02.txt
diff --git a/work/workmanager-rxjava2/api/restricted_1.0.0.txt b/work/work-rxjava2/api/restricted_1.0.0.txt
similarity index 100%
rename from work/workmanager-rxjava2/api/restricted_1.0.0.txt
rename to work/work-rxjava2/api/restricted_1.0.0.txt
diff --git a/work/workmanager-rxjava2/api/restricted_2.0.0-rc01.txt b/work/work-rxjava2/api/restricted_2.0.0-rc01.txt
similarity index 100%
rename from work/workmanager-rxjava2/api/restricted_2.0.0-rc01.txt
rename to work/work-rxjava2/api/restricted_2.0.0-rc01.txt
diff --git a/work/workmanager-rxjava2/api/restricted_2.0.0.txt b/work/work-rxjava2/api/restricted_2.0.0.txt
similarity index 100%
rename from work/workmanager-rxjava2/api/restricted_2.0.0.txt
rename to work/work-rxjava2/api/restricted_2.0.0.txt
diff --git a/work/workmanager-rxjava2/api/restricted_2.1.0-beta01.txt b/work/work-rxjava2/api/restricted_2.1.0-beta01.txt
similarity index 100%
rename from work/workmanager-rxjava2/api/restricted_2.1.0-beta01.txt
rename to work/work-rxjava2/api/restricted_2.1.0-beta01.txt
diff --git a/work/workmanager-rxjava2/api/restricted_2.1.0-beta02.txt b/work/work-rxjava2/api/restricted_2.1.0-beta02.txt
similarity index 100%
rename from work/workmanager-rxjava2/api/restricted_2.1.0-beta02.txt
rename to work/work-rxjava2/api/restricted_2.1.0-beta02.txt
diff --git a/work/workmanager-rxjava2/api/restricted_2.1.0-rc01.txt b/work/work-rxjava2/api/restricted_2.1.0-rc01.txt
similarity index 100%
rename from work/workmanager-rxjava2/api/restricted_2.1.0-rc01.txt
rename to work/work-rxjava2/api/restricted_2.1.0-rc01.txt
diff --git a/work/workmanager-rxjava2/api/restricted_2.1.0.txt b/work/work-rxjava2/api/restricted_2.1.0.txt
similarity index 100%
rename from work/workmanager-rxjava2/api/restricted_2.1.0.txt
rename to work/work-rxjava2/api/restricted_2.1.0.txt
diff --git a/work/workmanager-rxjava2/api/restricted_2.2.0-beta01.txt b/work/work-rxjava2/api/restricted_2.2.0-beta01.txt
similarity index 100%
rename from work/workmanager-rxjava2/api/restricted_2.2.0-beta01.txt
rename to work/work-rxjava2/api/restricted_2.2.0-beta01.txt
diff --git a/work/workmanager-rxjava2/api/restricted_2.3.0-beta01.txt b/work/work-rxjava2/api/restricted_2.3.0-beta01.txt
similarity index 100%
rename from work/workmanager-rxjava2/api/restricted_2.3.0-beta01.txt
rename to work/work-rxjava2/api/restricted_2.3.0-beta01.txt
diff --git a/work/workmanager-rxjava2/api/restricted_2.3.0-beta02.txt b/work/work-rxjava2/api/restricted_2.3.0-beta02.txt
similarity index 100%
rename from work/workmanager-rxjava2/api/restricted_2.3.0-beta02.txt
rename to work/work-rxjava2/api/restricted_2.3.0-beta02.txt
diff --git a/work/workmanager-rxjava2/api/restricted_2.3.0-rc01.txt b/work/work-rxjava2/api/restricted_2.3.0-rc01.txt
similarity index 100%
rename from work/workmanager-rxjava2/api/restricted_2.3.0-rc01.txt
rename to work/work-rxjava2/api/restricted_2.3.0-rc01.txt
diff --git a/work/workmanager-rxjava2/api/restricted_2.4.0-beta01.txt b/work/work-rxjava2/api/restricted_2.4.0-beta01.txt
similarity index 100%
rename from work/workmanager-rxjava2/api/restricted_2.4.0-beta01.txt
rename to work/work-rxjava2/api/restricted_2.4.0-beta01.txt
diff --git a/work/workmanager-rxjava2/api/restricted_2.4.0-beta02.txt b/work/work-rxjava2/api/restricted_2.4.0-beta02.txt
similarity index 100%
rename from work/workmanager-rxjava2/api/restricted_2.4.0-beta02.txt
rename to work/work-rxjava2/api/restricted_2.4.0-beta02.txt
diff --git a/work/workmanager-rxjava2/api/restricted_2.4.0-rc01.txt b/work/work-rxjava2/api/restricted_2.4.0-rc01.txt
similarity index 100%
rename from work/workmanager-rxjava2/api/restricted_2.4.0-rc01.txt
rename to work/work-rxjava2/api/restricted_2.4.0-rc01.txt
diff --git a/work/workmanager-rxjava2/api/restricted_2.5.0-beta01.txt b/work/work-rxjava2/api/restricted_2.5.0-beta01.txt
similarity index 100%
rename from work/workmanager-rxjava2/api/restricted_2.5.0-beta01.txt
rename to work/work-rxjava2/api/restricted_2.5.0-beta01.txt
diff --git a/work/workmanager-rxjava2/api/restricted_2.5.0-beta02.txt b/work/work-rxjava2/api/restricted_2.5.0-beta02.txt
similarity index 100%
rename from work/workmanager-rxjava2/api/restricted_2.5.0-beta02.txt
rename to work/work-rxjava2/api/restricted_2.5.0-beta02.txt
diff --git a/work/workmanager-rxjava2/api/2.5.0-beta01.txt b/work/work-rxjava2/api/restricted_2.7.0-beta01.txt
similarity index 100%
copy from work/workmanager-rxjava2/api/2.5.0-beta01.txt
copy to work/work-rxjava2/api/restricted_2.7.0-beta01.txt
diff --git a/work/workmanager-rxjava2/api/restricted_current.txt b/work/work-rxjava2/api/restricted_current.txt
similarity index 100%
rename from work/workmanager-rxjava2/api/restricted_current.txt
rename to work/work-rxjava2/api/restricted_current.txt
diff --git a/work/workmanager-rxjava2/build.gradle b/work/work-rxjava2/build.gradle
similarity index 100%
rename from work/workmanager-rxjava2/build.gradle
rename to work/work-rxjava2/build.gradle
diff --git a/work/workmanager-rxjava2/src/main/AndroidManifest.xml b/work/work-rxjava2/src/main/AndroidManifest.xml
similarity index 100%
rename from work/workmanager-rxjava2/src/main/AndroidManifest.xml
rename to work/work-rxjava2/src/main/AndroidManifest.xml
diff --git a/work/workmanager-rxjava2/src/main/java/androidx/work/RxWorker.java b/work/work-rxjava2/src/main/java/androidx/work/RxWorker.java
similarity index 100%
rename from work/workmanager-rxjava2/src/main/java/androidx/work/RxWorker.java
rename to work/work-rxjava2/src/main/java/androidx/work/RxWorker.java
diff --git a/work/workmanager-rxjava2/src/test/java/androidx/work/RxWorkerTest.kt b/work/work-rxjava2/src/test/java/androidx/work/RxWorkerTest.kt
similarity index 100%
rename from work/workmanager-rxjava2/src/test/java/androidx/work/RxWorkerTest.kt
rename to work/work-rxjava2/src/test/java/androidx/work/RxWorkerTest.kt
diff --git a/work/workmanager-rxjava2/src/test/java/androidx/work/SetCompletableProgressTest.kt b/work/work-rxjava2/src/test/java/androidx/work/SetCompletableProgressTest.kt
similarity index 100%
rename from work/workmanager-rxjava2/src/test/java/androidx/work/SetCompletableProgressTest.kt
rename to work/work-rxjava2/src/test/java/androidx/work/SetCompletableProgressTest.kt
diff --git a/work/workmanager-rxjava2/src/test/java/androidx/work/TestRxWorker.kt b/work/work-rxjava2/src/test/java/androidx/work/TestRxWorker.kt
similarity index 100%
rename from work/workmanager-rxjava2/src/test/java/androidx/work/TestRxWorker.kt
rename to work/work-rxjava2/src/test/java/androidx/work/TestRxWorker.kt
diff --git a/work/workmanager-rxjava3/api/2.4.0-beta01.txt b/work/work-rxjava3/api/2.4.0-beta01.txt
similarity index 100%
rename from work/workmanager-rxjava3/api/2.4.0-beta01.txt
rename to work/work-rxjava3/api/2.4.0-beta01.txt
diff --git a/work/workmanager-rxjava3/api/2.4.0-beta02.txt b/work/work-rxjava3/api/2.4.0-beta02.txt
similarity index 100%
rename from work/workmanager-rxjava3/api/2.4.0-beta02.txt
rename to work/work-rxjava3/api/2.4.0-beta02.txt
diff --git a/work/workmanager-rxjava3/api/2.4.0-rc01.txt b/work/work-rxjava3/api/2.4.0-rc01.txt
similarity index 100%
rename from work/workmanager-rxjava3/api/2.4.0-rc01.txt
rename to work/work-rxjava3/api/2.4.0-rc01.txt
diff --git a/work/workmanager-rxjava3/api/2.5.0-beta01.txt b/work/work-rxjava3/api/2.5.0-beta01.txt
similarity index 100%
rename from work/workmanager-rxjava3/api/2.5.0-beta01.txt
rename to work/work-rxjava3/api/2.5.0-beta01.txt
diff --git a/work/workmanager-rxjava3/api/2.5.0-beta02.txt b/work/work-rxjava3/api/2.5.0-beta02.txt
similarity index 100%
rename from work/workmanager-rxjava3/api/2.5.0-beta02.txt
rename to work/work-rxjava3/api/2.5.0-beta02.txt
diff --git a/work/workmanager-rxjava3/api/2.5.0-beta01.txt b/work/work-rxjava3/api/2.7.0-beta01.txt
similarity index 100%
copy from work/workmanager-rxjava3/api/2.5.0-beta01.txt
copy to work/work-rxjava3/api/2.7.0-beta01.txt
diff --git a/work/workmanager-rxjava3/api/current.txt b/work/work-rxjava3/api/current.txt
similarity index 100%
rename from work/workmanager-rxjava3/api/current.txt
rename to work/work-rxjava3/api/current.txt
diff --git a/work/workmanager-rxjava3/api/public_plus_experimental_2.4.0-beta01.txt b/work/work-rxjava3/api/public_plus_experimental_2.4.0-beta01.txt
similarity index 100%
rename from work/workmanager-rxjava3/api/public_plus_experimental_2.4.0-beta01.txt
rename to work/work-rxjava3/api/public_plus_experimental_2.4.0-beta01.txt
diff --git a/work/workmanager-rxjava3/api/public_plus_experimental_2.4.0-beta02.txt b/work/work-rxjava3/api/public_plus_experimental_2.4.0-beta02.txt
similarity index 100%
rename from work/workmanager-rxjava3/api/public_plus_experimental_2.4.0-beta02.txt
rename to work/work-rxjava3/api/public_plus_experimental_2.4.0-beta02.txt
diff --git a/work/workmanager-rxjava3/api/public_plus_experimental_2.4.0-rc01.txt b/work/work-rxjava3/api/public_plus_experimental_2.4.0-rc01.txt
similarity index 100%
rename from work/workmanager-rxjava3/api/public_plus_experimental_2.4.0-rc01.txt
rename to work/work-rxjava3/api/public_plus_experimental_2.4.0-rc01.txt
diff --git a/work/workmanager-rxjava3/api/public_plus_experimental_2.5.0-beta01.txt b/work/work-rxjava3/api/public_plus_experimental_2.5.0-beta01.txt
similarity index 100%
rename from work/workmanager-rxjava3/api/public_plus_experimental_2.5.0-beta01.txt
rename to work/work-rxjava3/api/public_plus_experimental_2.5.0-beta01.txt
diff --git a/work/workmanager-rxjava3/api/public_plus_experimental_2.5.0-beta02.txt b/work/work-rxjava3/api/public_plus_experimental_2.5.0-beta02.txt
similarity index 100%
rename from work/workmanager-rxjava3/api/public_plus_experimental_2.5.0-beta02.txt
rename to work/work-rxjava3/api/public_plus_experimental_2.5.0-beta02.txt
diff --git a/work/workmanager-rxjava3/api/2.5.0-beta01.txt b/work/work-rxjava3/api/public_plus_experimental_2.7.0-beta01.txt
similarity index 100%
copy from work/workmanager-rxjava3/api/2.5.0-beta01.txt
copy to work/work-rxjava3/api/public_plus_experimental_2.7.0-beta01.txt
diff --git a/work/workmanager-rxjava3/api/public_plus_experimental_current.txt b/work/work-rxjava3/api/public_plus_experimental_current.txt
similarity index 100%
rename from work/workmanager-rxjava3/api/public_plus_experimental_current.txt
rename to work/work-rxjava3/api/public_plus_experimental_current.txt
diff --git a/work/workmanager-rxjava3/api/res-2.4.0-beta01.txt b/work/work-rxjava3/api/res-2.4.0-beta01.txt
similarity index 100%
rename from work/workmanager-rxjava3/api/res-2.4.0-beta01.txt
rename to work/work-rxjava3/api/res-2.4.0-beta01.txt
diff --git a/work/workmanager-rxjava3/api/res-2.4.0-beta02.txt b/work/work-rxjava3/api/res-2.4.0-beta02.txt
similarity index 100%
rename from work/workmanager-rxjava3/api/res-2.4.0-beta02.txt
rename to work/work-rxjava3/api/res-2.4.0-beta02.txt
diff --git a/work/workmanager-rxjava3/api/res-2.4.0-rc01.txt b/work/work-rxjava3/api/res-2.4.0-rc01.txt
similarity index 100%
rename from work/workmanager-rxjava3/api/res-2.4.0-rc01.txt
rename to work/work-rxjava3/api/res-2.4.0-rc01.txt
diff --git a/work/workmanager-rxjava3/api/res-2.5.0-beta01.txt b/work/work-rxjava3/api/res-2.5.0-beta01.txt
similarity index 100%
rename from work/workmanager-rxjava3/api/res-2.5.0-beta01.txt
rename to work/work-rxjava3/api/res-2.5.0-beta01.txt
diff --git a/work/workmanager-rxjava3/api/res-2.5.0-beta02.txt b/work/work-rxjava3/api/res-2.5.0-beta02.txt
similarity index 100%
rename from work/workmanager-rxjava3/api/res-2.5.0-beta02.txt
rename to work/work-rxjava3/api/res-2.5.0-beta02.txt
diff --git a/work/workmanager-rxjava3/api/res-2.4.0-beta01.txt b/work/work-rxjava3/api/res-2.7.0-beta01.txt
similarity index 100%
copy from work/workmanager-rxjava3/api/res-2.4.0-beta01.txt
copy to work/work-rxjava3/api/res-2.7.0-beta01.txt
diff --git a/work/workmanager-rxjava3/api/res-current.txt b/work/work-rxjava3/api/res-current.txt
similarity index 100%
rename from work/workmanager-rxjava3/api/res-current.txt
rename to work/work-rxjava3/api/res-current.txt
diff --git a/work/workmanager-rxjava3/api/restricted_2.4.0-beta01.txt b/work/work-rxjava3/api/restricted_2.4.0-beta01.txt
similarity index 100%
rename from work/workmanager-rxjava3/api/restricted_2.4.0-beta01.txt
rename to work/work-rxjava3/api/restricted_2.4.0-beta01.txt
diff --git a/work/workmanager-rxjava3/api/restricted_2.4.0-beta02.txt b/work/work-rxjava3/api/restricted_2.4.0-beta02.txt
similarity index 100%
rename from work/workmanager-rxjava3/api/restricted_2.4.0-beta02.txt
rename to work/work-rxjava3/api/restricted_2.4.0-beta02.txt
diff --git a/work/workmanager-rxjava3/api/restricted_2.4.0-rc01.txt b/work/work-rxjava3/api/restricted_2.4.0-rc01.txt
similarity index 100%
rename from work/workmanager-rxjava3/api/restricted_2.4.0-rc01.txt
rename to work/work-rxjava3/api/restricted_2.4.0-rc01.txt
diff --git a/work/workmanager-rxjava3/api/restricted_2.5.0-beta01.txt b/work/work-rxjava3/api/restricted_2.5.0-beta01.txt
similarity index 100%
rename from work/workmanager-rxjava3/api/restricted_2.5.0-beta01.txt
rename to work/work-rxjava3/api/restricted_2.5.0-beta01.txt
diff --git a/work/workmanager-rxjava3/api/restricted_2.5.0-beta02.txt b/work/work-rxjava3/api/restricted_2.5.0-beta02.txt
similarity index 100%
rename from work/workmanager-rxjava3/api/restricted_2.5.0-beta02.txt
rename to work/work-rxjava3/api/restricted_2.5.0-beta02.txt
diff --git a/work/workmanager-rxjava3/api/2.5.0-beta01.txt b/work/work-rxjava3/api/restricted_2.7.0-beta01.txt
similarity index 100%
copy from work/workmanager-rxjava3/api/2.5.0-beta01.txt
copy to work/work-rxjava3/api/restricted_2.7.0-beta01.txt
diff --git a/work/workmanager-rxjava3/api/restricted_current.txt b/work/work-rxjava3/api/restricted_current.txt
similarity index 100%
rename from work/workmanager-rxjava3/api/restricted_current.txt
rename to work/work-rxjava3/api/restricted_current.txt
diff --git a/work/workmanager-rxjava3/build.gradle b/work/work-rxjava3/build.gradle
similarity index 100%
rename from work/workmanager-rxjava3/build.gradle
rename to work/work-rxjava3/build.gradle
diff --git a/work/workmanager-rxjava3/src/main/AndroidManifest.xml b/work/work-rxjava3/src/main/AndroidManifest.xml
similarity index 100%
rename from work/workmanager-rxjava3/src/main/AndroidManifest.xml
rename to work/work-rxjava3/src/main/AndroidManifest.xml
diff --git a/work/workmanager-rxjava3/src/main/java/androidx/work/rxjava3/RxWorker.java b/work/work-rxjava3/src/main/java/androidx/work/rxjava3/RxWorker.java
similarity index 100%
rename from work/workmanager-rxjava3/src/main/java/androidx/work/rxjava3/RxWorker.java
rename to work/work-rxjava3/src/main/java/androidx/work/rxjava3/RxWorker.java
diff --git a/work/workmanager-rxjava3/src/test/java/androidx/work/rxjava3/RxWorkerTest.kt b/work/work-rxjava3/src/test/java/androidx/work/rxjava3/RxWorkerTest.kt
similarity index 100%
rename from work/workmanager-rxjava3/src/test/java/androidx/work/rxjava3/RxWorkerTest.kt
rename to work/work-rxjava3/src/test/java/androidx/work/rxjava3/RxWorkerTest.kt
diff --git a/work/workmanager-rxjava3/src/test/java/androidx/work/rxjava3/SetCompletableProgressTest.kt b/work/work-rxjava3/src/test/java/androidx/work/rxjava3/SetCompletableProgressTest.kt
similarity index 100%
rename from work/workmanager-rxjava3/src/test/java/androidx/work/rxjava3/SetCompletableProgressTest.kt
rename to work/work-rxjava3/src/test/java/androidx/work/rxjava3/SetCompletableProgressTest.kt
diff --git a/work/workmanager-rxjava3/src/test/java/androidx/work/rxjava3/TestRxWorker.kt b/work/work-rxjava3/src/test/java/androidx/work/rxjava3/TestRxWorker.kt
similarity index 100%
rename from work/workmanager-rxjava3/src/test/java/androidx/work/rxjava3/TestRxWorker.kt
rename to work/work-rxjava3/src/test/java/androidx/work/rxjava3/TestRxWorker.kt
diff --git a/work/workmanager-testing/api/1.0.0-beta01.txt b/work/work-testing/api/1.0.0-beta01.txt
similarity index 100%
rename from work/workmanager-testing/api/1.0.0-beta01.txt
rename to work/work-testing/api/1.0.0-beta01.txt
diff --git a/work/workmanager-testing/api/1.0.0-beta02.txt b/work/work-testing/api/1.0.0-beta02.txt
similarity index 100%
rename from work/workmanager-testing/api/1.0.0-beta02.txt
rename to work/work-testing/api/1.0.0-beta02.txt
diff --git a/work/workmanager-testing/api/1.0.0-beta03.txt b/work/work-testing/api/1.0.0-beta03.txt
similarity index 100%
rename from work/workmanager-testing/api/1.0.0-beta03.txt
rename to work/work-testing/api/1.0.0-beta03.txt
diff --git a/work/workmanager-testing/api/1.0.0-beta04.txt b/work/work-testing/api/1.0.0-beta04.txt
similarity index 100%
rename from work/workmanager-testing/api/1.0.0-beta04.txt
rename to work/work-testing/api/1.0.0-beta04.txt
diff --git a/work/workmanager-testing/api/1.0.0-rc01.txt b/work/work-testing/api/1.0.0-rc01.txt
similarity index 100%
rename from work/workmanager-testing/api/1.0.0-rc01.txt
rename to work/work-testing/api/1.0.0-rc01.txt
diff --git a/work/workmanager-testing/api/1.0.0-rc02.txt b/work/work-testing/api/1.0.0-rc02.txt
similarity index 100%
rename from work/workmanager-testing/api/1.0.0-rc02.txt
rename to work/work-testing/api/1.0.0-rc02.txt
diff --git a/work/workmanager-testing/api/1.0.0.txt b/work/work-testing/api/1.0.0.txt
similarity index 100%
rename from work/workmanager-testing/api/1.0.0.txt
rename to work/work-testing/api/1.0.0.txt
diff --git a/work/workmanager-testing/api/2.0.0-rc01.txt b/work/work-testing/api/2.0.0-rc01.txt
similarity index 100%
rename from work/workmanager-testing/api/2.0.0-rc01.txt
rename to work/work-testing/api/2.0.0-rc01.txt
diff --git a/work/workmanager-testing/api/2.0.0.txt b/work/work-testing/api/2.0.0.txt
similarity index 100%
rename from work/workmanager-testing/api/2.0.0.txt
rename to work/work-testing/api/2.0.0.txt
diff --git a/work/workmanager-testing/api/2.1.0-beta01.txt b/work/work-testing/api/2.1.0-beta01.txt
similarity index 100%
rename from work/workmanager-testing/api/2.1.0-beta01.txt
rename to work/work-testing/api/2.1.0-beta01.txt
diff --git a/work/workmanager-testing/api/2.1.0-beta02.txt b/work/work-testing/api/2.1.0-beta02.txt
similarity index 100%
rename from work/workmanager-testing/api/2.1.0-beta02.txt
rename to work/work-testing/api/2.1.0-beta02.txt
diff --git a/work/workmanager-testing/api/2.1.0-rc01.txt b/work/work-testing/api/2.1.0-rc01.txt
similarity index 100%
rename from work/workmanager-testing/api/2.1.0-rc01.txt
rename to work/work-testing/api/2.1.0-rc01.txt
diff --git a/work/workmanager-testing/api/2.1.0.txt b/work/work-testing/api/2.1.0.txt
similarity index 100%
rename from work/workmanager-testing/api/2.1.0.txt
rename to work/work-testing/api/2.1.0.txt
diff --git a/work/workmanager-testing/api/2.2.0-beta01.txt b/work/work-testing/api/2.2.0-beta01.txt
similarity index 100%
rename from work/workmanager-testing/api/2.2.0-beta01.txt
rename to work/work-testing/api/2.2.0-beta01.txt
diff --git a/work/workmanager-testing/api/2.3.0-beta01.txt b/work/work-testing/api/2.3.0-beta01.txt
similarity index 100%
rename from work/workmanager-testing/api/2.3.0-beta01.txt
rename to work/work-testing/api/2.3.0-beta01.txt
diff --git a/work/workmanager-testing/api/2.3.0-beta02.txt b/work/work-testing/api/2.3.0-beta02.txt
similarity index 100%
rename from work/workmanager-testing/api/2.3.0-beta02.txt
rename to work/work-testing/api/2.3.0-beta02.txt
diff --git a/work/workmanager-testing/api/2.3.0-rc01.txt b/work/work-testing/api/2.3.0-rc01.txt
similarity index 100%
rename from work/workmanager-testing/api/2.3.0-rc01.txt
rename to work/work-testing/api/2.3.0-rc01.txt
diff --git a/work/workmanager-testing/api/2.4.0-beta01.txt b/work/work-testing/api/2.4.0-beta01.txt
similarity index 100%
rename from work/workmanager-testing/api/2.4.0-beta01.txt
rename to work/work-testing/api/2.4.0-beta01.txt
diff --git a/work/workmanager-testing/api/2.4.0-beta02.txt b/work/work-testing/api/2.4.0-beta02.txt
similarity index 100%
rename from work/workmanager-testing/api/2.4.0-beta02.txt
rename to work/work-testing/api/2.4.0-beta02.txt
diff --git a/work/workmanager-testing/api/2.4.0-rc01.txt b/work/work-testing/api/2.4.0-rc01.txt
similarity index 100%
rename from work/workmanager-testing/api/2.4.0-rc01.txt
rename to work/work-testing/api/2.4.0-rc01.txt
diff --git a/work/workmanager-testing/api/2.5.0-beta01.txt b/work/work-testing/api/2.5.0-beta01.txt
similarity index 100%
rename from work/workmanager-testing/api/2.5.0-beta01.txt
rename to work/work-testing/api/2.5.0-beta01.txt
diff --git a/work/workmanager-testing/api/2.5.0-beta02.txt b/work/work-testing/api/2.5.0-beta02.txt
similarity index 100%
rename from work/workmanager-testing/api/2.5.0-beta02.txt
rename to work/work-testing/api/2.5.0-beta02.txt
diff --git a/work/workmanager-testing/api/2.5.0-beta01.txt b/work/work-testing/api/2.7.0-beta01.txt
similarity index 100%
copy from work/workmanager-testing/api/2.5.0-beta01.txt
copy to work/work-testing/api/2.7.0-beta01.txt
diff --git a/work/workmanager-testing/api/api_lint.ignore b/work/work-testing/api/api_lint.ignore
similarity index 100%
rename from work/workmanager-testing/api/api_lint.ignore
rename to work/work-testing/api/api_lint.ignore
diff --git a/work/workmanager-testing/api/current.txt b/work/work-testing/api/current.txt
similarity index 100%
rename from work/workmanager-testing/api/current.txt
rename to work/work-testing/api/current.txt
diff --git a/work/workmanager-testing/api/public_plus_experimental_2.0.0-rc01.txt b/work/work-testing/api/public_plus_experimental_2.0.0-rc01.txt
similarity index 100%
rename from work/workmanager-testing/api/public_plus_experimental_2.0.0-rc01.txt
rename to work/work-testing/api/public_plus_experimental_2.0.0-rc01.txt
diff --git a/work/workmanager-testing/api/public_plus_experimental_2.0.0.txt b/work/work-testing/api/public_plus_experimental_2.0.0.txt
similarity index 100%
rename from work/workmanager-testing/api/public_plus_experimental_2.0.0.txt
rename to work/work-testing/api/public_plus_experimental_2.0.0.txt
diff --git a/work/workmanager-testing/api/public_plus_experimental_2.1.0-beta01.txt b/work/work-testing/api/public_plus_experimental_2.1.0-beta01.txt
similarity index 100%
rename from work/workmanager-testing/api/public_plus_experimental_2.1.0-beta01.txt
rename to work/work-testing/api/public_plus_experimental_2.1.0-beta01.txt
diff --git a/work/workmanager-testing/api/public_plus_experimental_2.1.0-beta02.txt b/work/work-testing/api/public_plus_experimental_2.1.0-beta02.txt
similarity index 100%
rename from work/workmanager-testing/api/public_plus_experimental_2.1.0-beta02.txt
rename to work/work-testing/api/public_plus_experimental_2.1.0-beta02.txt
diff --git a/work/workmanager-testing/api/public_plus_experimental_2.1.0-rc01.txt b/work/work-testing/api/public_plus_experimental_2.1.0-rc01.txt
similarity index 100%
rename from work/workmanager-testing/api/public_plus_experimental_2.1.0-rc01.txt
rename to work/work-testing/api/public_plus_experimental_2.1.0-rc01.txt
diff --git a/work/workmanager-testing/api/public_plus_experimental_2.1.0.txt b/work/work-testing/api/public_plus_experimental_2.1.0.txt
similarity index 100%
rename from work/workmanager-testing/api/public_plus_experimental_2.1.0.txt
rename to work/work-testing/api/public_plus_experimental_2.1.0.txt
diff --git a/work/workmanager-testing/api/public_plus_experimental_2.2.0-beta01.txt b/work/work-testing/api/public_plus_experimental_2.2.0-beta01.txt
similarity index 100%
rename from work/workmanager-testing/api/public_plus_experimental_2.2.0-beta01.txt
rename to work/work-testing/api/public_plus_experimental_2.2.0-beta01.txt
diff --git a/work/workmanager-testing/api/public_plus_experimental_2.3.0-beta01.txt b/work/work-testing/api/public_plus_experimental_2.3.0-beta01.txt
similarity index 100%
rename from work/workmanager-testing/api/public_plus_experimental_2.3.0-beta01.txt
rename to work/work-testing/api/public_plus_experimental_2.3.0-beta01.txt
diff --git a/work/workmanager-testing/api/public_plus_experimental_2.3.0-beta02.txt b/work/work-testing/api/public_plus_experimental_2.3.0-beta02.txt
similarity index 100%
rename from work/workmanager-testing/api/public_plus_experimental_2.3.0-beta02.txt
rename to work/work-testing/api/public_plus_experimental_2.3.0-beta02.txt
diff --git a/work/workmanager-testing/api/public_plus_experimental_2.3.0-rc01.txt b/work/work-testing/api/public_plus_experimental_2.3.0-rc01.txt
similarity index 100%
rename from work/workmanager-testing/api/public_plus_experimental_2.3.0-rc01.txt
rename to work/work-testing/api/public_plus_experimental_2.3.0-rc01.txt
diff --git a/work/workmanager-testing/api/public_plus_experimental_2.4.0-beta01.txt b/work/work-testing/api/public_plus_experimental_2.4.0-beta01.txt
similarity index 100%
rename from work/workmanager-testing/api/public_plus_experimental_2.4.0-beta01.txt
rename to work/work-testing/api/public_plus_experimental_2.4.0-beta01.txt
diff --git a/work/workmanager-testing/api/public_plus_experimental_2.4.0-beta02.txt b/work/work-testing/api/public_plus_experimental_2.4.0-beta02.txt
similarity index 100%
rename from work/workmanager-testing/api/public_plus_experimental_2.4.0-beta02.txt
rename to work/work-testing/api/public_plus_experimental_2.4.0-beta02.txt
diff --git a/work/workmanager-testing/api/public_plus_experimental_2.4.0-rc01.txt b/work/work-testing/api/public_plus_experimental_2.4.0-rc01.txt
similarity index 100%
rename from work/workmanager-testing/api/public_plus_experimental_2.4.0-rc01.txt
rename to work/work-testing/api/public_plus_experimental_2.4.0-rc01.txt
diff --git a/work/workmanager-testing/api/public_plus_experimental_2.5.0-beta01.txt b/work/work-testing/api/public_plus_experimental_2.5.0-beta01.txt
similarity index 100%
rename from work/workmanager-testing/api/public_plus_experimental_2.5.0-beta01.txt
rename to work/work-testing/api/public_plus_experimental_2.5.0-beta01.txt
diff --git a/work/workmanager-testing/api/public_plus_experimental_2.5.0-beta02.txt b/work/work-testing/api/public_plus_experimental_2.5.0-beta02.txt
similarity index 100%
rename from work/workmanager-testing/api/public_plus_experimental_2.5.0-beta02.txt
rename to work/work-testing/api/public_plus_experimental_2.5.0-beta02.txt
diff --git a/work/workmanager-testing/api/2.5.0-beta01.txt b/work/work-testing/api/public_plus_experimental_2.7.0-beta01.txt
similarity index 100%
copy from work/workmanager-testing/api/2.5.0-beta01.txt
copy to work/work-testing/api/public_plus_experimental_2.7.0-beta01.txt
diff --git a/work/workmanager-testing/api/public_plus_experimental_current.txt b/work/work-testing/api/public_plus_experimental_current.txt
similarity index 100%
rename from work/workmanager-testing/api/public_plus_experimental_current.txt
rename to work/work-testing/api/public_plus_experimental_current.txt
diff --git a/work/workmanager-testing/api/res-1.0.0-beta01.txt b/work/work-testing/api/res-1.0.0-beta01.txt
similarity index 100%
rename from work/workmanager-testing/api/res-1.0.0-beta01.txt
rename to work/work-testing/api/res-1.0.0-beta01.txt
diff --git a/work/workmanager-testing/api/res-1.0.0-beta02.txt b/work/work-testing/api/res-1.0.0-beta02.txt
similarity index 100%
rename from work/workmanager-testing/api/res-1.0.0-beta02.txt
rename to work/work-testing/api/res-1.0.0-beta02.txt
diff --git a/work/workmanager-testing/api/res-1.0.0-beta03.txt b/work/work-testing/api/res-1.0.0-beta03.txt
similarity index 100%
rename from work/workmanager-testing/api/res-1.0.0-beta03.txt
rename to work/work-testing/api/res-1.0.0-beta03.txt
diff --git a/work/workmanager-testing/api/res-1.0.0-beta04.txt b/work/work-testing/api/res-1.0.0-beta04.txt
similarity index 100%
rename from work/workmanager-testing/api/res-1.0.0-beta04.txt
rename to work/work-testing/api/res-1.0.0-beta04.txt
diff --git a/work/workmanager-testing/api/res-1.0.0-rc01.txt b/work/work-testing/api/res-1.0.0-rc01.txt
similarity index 100%
rename from work/workmanager-testing/api/res-1.0.0-rc01.txt
rename to work/work-testing/api/res-1.0.0-rc01.txt
diff --git a/work/workmanager-testing/api/res-1.0.0-rc02.txt b/work/work-testing/api/res-1.0.0-rc02.txt
similarity index 100%
rename from work/workmanager-testing/api/res-1.0.0-rc02.txt
rename to work/work-testing/api/res-1.0.0-rc02.txt
diff --git a/work/workmanager-testing/api/res-1.0.0.txt b/work/work-testing/api/res-1.0.0.txt
similarity index 100%
rename from work/workmanager-testing/api/res-1.0.0.txt
rename to work/work-testing/api/res-1.0.0.txt
diff --git a/work/workmanager-testing/api/res-2.0.0-rc01.txt b/work/work-testing/api/res-2.0.0-rc01.txt
similarity index 100%
rename from work/workmanager-testing/api/res-2.0.0-rc01.txt
rename to work/work-testing/api/res-2.0.0-rc01.txt
diff --git a/work/workmanager-testing/api/res-2.0.0.txt b/work/work-testing/api/res-2.0.0.txt
similarity index 100%
rename from work/workmanager-testing/api/res-2.0.0.txt
rename to work/work-testing/api/res-2.0.0.txt
diff --git a/work/workmanager-testing/api/res-2.1.0-beta01.txt b/work/work-testing/api/res-2.1.0-beta01.txt
similarity index 100%
rename from work/workmanager-testing/api/res-2.1.0-beta01.txt
rename to work/work-testing/api/res-2.1.0-beta01.txt
diff --git a/work/workmanager-testing/api/res-2.1.0-beta02.txt b/work/work-testing/api/res-2.1.0-beta02.txt
similarity index 100%
rename from work/workmanager-testing/api/res-2.1.0-beta02.txt
rename to work/work-testing/api/res-2.1.0-beta02.txt
diff --git a/work/workmanager-testing/api/res-2.1.0-rc01.txt b/work/work-testing/api/res-2.1.0-rc01.txt
similarity index 100%
rename from work/workmanager-testing/api/res-2.1.0-rc01.txt
rename to work/work-testing/api/res-2.1.0-rc01.txt
diff --git a/work/workmanager-testing/api/res-2.1.0.txt b/work/work-testing/api/res-2.1.0.txt
similarity index 100%
rename from work/workmanager-testing/api/res-2.1.0.txt
rename to work/work-testing/api/res-2.1.0.txt
diff --git a/work/workmanager-testing/api/res-2.2.0-beta01.txt b/work/work-testing/api/res-2.2.0-beta01.txt
similarity index 100%
rename from work/workmanager-testing/api/res-2.2.0-beta01.txt
rename to work/work-testing/api/res-2.2.0-beta01.txt
diff --git a/work/workmanager-testing/api/res-2.3.0-beta01.txt b/work/work-testing/api/res-2.3.0-beta01.txt
similarity index 100%
rename from work/workmanager-testing/api/res-2.3.0-beta01.txt
rename to work/work-testing/api/res-2.3.0-beta01.txt
diff --git a/work/workmanager-testing/api/res-2.3.0-beta02.txt b/work/work-testing/api/res-2.3.0-beta02.txt
similarity index 100%
rename from work/workmanager-testing/api/res-2.3.0-beta02.txt
rename to work/work-testing/api/res-2.3.0-beta02.txt
diff --git a/work/workmanager-testing/api/res-2.3.0-rc01.txt b/work/work-testing/api/res-2.3.0-rc01.txt
similarity index 100%
rename from work/workmanager-testing/api/res-2.3.0-rc01.txt
rename to work/work-testing/api/res-2.3.0-rc01.txt
diff --git a/work/workmanager-testing/api/res-2.4.0-beta01.txt b/work/work-testing/api/res-2.4.0-beta01.txt
similarity index 100%
rename from work/workmanager-testing/api/res-2.4.0-beta01.txt
rename to work/work-testing/api/res-2.4.0-beta01.txt
diff --git a/work/workmanager-testing/api/res-2.4.0-beta02.txt b/work/work-testing/api/res-2.4.0-beta02.txt
similarity index 100%
rename from work/workmanager-testing/api/res-2.4.0-beta02.txt
rename to work/work-testing/api/res-2.4.0-beta02.txt
diff --git a/work/workmanager-testing/api/res-2.4.0-rc01.txt b/work/work-testing/api/res-2.4.0-rc01.txt
similarity index 100%
rename from work/workmanager-testing/api/res-2.4.0-rc01.txt
rename to work/work-testing/api/res-2.4.0-rc01.txt
diff --git a/work/workmanager-testing/api/res-2.5.0-beta01.txt b/work/work-testing/api/res-2.5.0-beta01.txt
similarity index 100%
rename from work/workmanager-testing/api/res-2.5.0-beta01.txt
rename to work/work-testing/api/res-2.5.0-beta01.txt
diff --git a/work/workmanager-testing/api/res-2.5.0-beta02.txt b/work/work-testing/api/res-2.5.0-beta02.txt
similarity index 100%
rename from work/workmanager-testing/api/res-2.5.0-beta02.txt
rename to work/work-testing/api/res-2.5.0-beta02.txt
diff --git a/work/workmanager-testing/api/res-1.0.0-beta01.txt b/work/work-testing/api/res-2.7.0-beta01.txt
similarity index 100%
copy from work/workmanager-testing/api/res-1.0.0-beta01.txt
copy to work/work-testing/api/res-2.7.0-beta01.txt
diff --git a/work/workmanager-testing/api/res-current.txt b/work/work-testing/api/res-current.txt
similarity index 100%
rename from work/workmanager-testing/api/res-current.txt
rename to work/work-testing/api/res-current.txt
diff --git a/work/workmanager-testing/api/restricted_1.0.0-beta04.txt b/work/work-testing/api/restricted_1.0.0-beta04.txt
similarity index 100%
rename from work/workmanager-testing/api/restricted_1.0.0-beta04.txt
rename to work/work-testing/api/restricted_1.0.0-beta04.txt
diff --git a/work/workmanager-testing/api/restricted_1.0.0-rc01.txt b/work/work-testing/api/restricted_1.0.0-rc01.txt
similarity index 100%
rename from work/workmanager-testing/api/restricted_1.0.0-rc01.txt
rename to work/work-testing/api/restricted_1.0.0-rc01.txt
diff --git a/work/workmanager-testing/api/restricted_1.0.0-rc02.txt b/work/work-testing/api/restricted_1.0.0-rc02.txt
similarity index 100%
rename from work/workmanager-testing/api/restricted_1.0.0-rc02.txt
rename to work/work-testing/api/restricted_1.0.0-rc02.txt
diff --git a/work/workmanager-testing/api/restricted_1.0.0.txt b/work/work-testing/api/restricted_1.0.0.txt
similarity index 100%
rename from work/workmanager-testing/api/restricted_1.0.0.txt
rename to work/work-testing/api/restricted_1.0.0.txt
diff --git a/work/workmanager-testing/api/restricted_2.0.0-rc01.txt b/work/work-testing/api/restricted_2.0.0-rc01.txt
similarity index 100%
rename from work/workmanager-testing/api/restricted_2.0.0-rc01.txt
rename to work/work-testing/api/restricted_2.0.0-rc01.txt
diff --git a/work/workmanager-testing/api/restricted_2.0.0.txt b/work/work-testing/api/restricted_2.0.0.txt
similarity index 100%
rename from work/workmanager-testing/api/restricted_2.0.0.txt
rename to work/work-testing/api/restricted_2.0.0.txt
diff --git a/work/workmanager-testing/api/restricted_2.1.0-beta01.txt b/work/work-testing/api/restricted_2.1.0-beta01.txt
similarity index 100%
rename from work/workmanager-testing/api/restricted_2.1.0-beta01.txt
rename to work/work-testing/api/restricted_2.1.0-beta01.txt
diff --git a/work/workmanager-testing/api/restricted_2.1.0-beta02.txt b/work/work-testing/api/restricted_2.1.0-beta02.txt
similarity index 100%
rename from work/workmanager-testing/api/restricted_2.1.0-beta02.txt
rename to work/work-testing/api/restricted_2.1.0-beta02.txt
diff --git a/work/workmanager-testing/api/restricted_2.1.0-rc01.txt b/work/work-testing/api/restricted_2.1.0-rc01.txt
similarity index 100%
rename from work/workmanager-testing/api/restricted_2.1.0-rc01.txt
rename to work/work-testing/api/restricted_2.1.0-rc01.txt
diff --git a/work/workmanager-testing/api/restricted_2.1.0.txt b/work/work-testing/api/restricted_2.1.0.txt
similarity index 100%
rename from work/workmanager-testing/api/restricted_2.1.0.txt
rename to work/work-testing/api/restricted_2.1.0.txt
diff --git a/work/workmanager-testing/api/restricted_2.2.0-beta01.txt b/work/work-testing/api/restricted_2.2.0-beta01.txt
similarity index 100%
rename from work/workmanager-testing/api/restricted_2.2.0-beta01.txt
rename to work/work-testing/api/restricted_2.2.0-beta01.txt
diff --git a/work/workmanager-testing/api/restricted_2.3.0-beta01.txt b/work/work-testing/api/restricted_2.3.0-beta01.txt
similarity index 100%
rename from work/workmanager-testing/api/restricted_2.3.0-beta01.txt
rename to work/work-testing/api/restricted_2.3.0-beta01.txt
diff --git a/work/workmanager-testing/api/restricted_2.3.0-beta02.txt b/work/work-testing/api/restricted_2.3.0-beta02.txt
similarity index 100%
rename from work/workmanager-testing/api/restricted_2.3.0-beta02.txt
rename to work/work-testing/api/restricted_2.3.0-beta02.txt
diff --git a/work/workmanager-testing/api/restricted_2.3.0-rc01.txt b/work/work-testing/api/restricted_2.3.0-rc01.txt
similarity index 100%
rename from work/workmanager-testing/api/restricted_2.3.0-rc01.txt
rename to work/work-testing/api/restricted_2.3.0-rc01.txt
diff --git a/work/workmanager-testing/api/restricted_2.4.0-beta01.txt b/work/work-testing/api/restricted_2.4.0-beta01.txt
similarity index 100%
rename from work/workmanager-testing/api/restricted_2.4.0-beta01.txt
rename to work/work-testing/api/restricted_2.4.0-beta01.txt
diff --git a/work/workmanager-testing/api/restricted_2.4.0-beta02.txt b/work/work-testing/api/restricted_2.4.0-beta02.txt
similarity index 100%
rename from work/workmanager-testing/api/restricted_2.4.0-beta02.txt
rename to work/work-testing/api/restricted_2.4.0-beta02.txt
diff --git a/work/workmanager-testing/api/restricted_2.4.0-rc01.txt b/work/work-testing/api/restricted_2.4.0-rc01.txt
similarity index 100%
rename from work/workmanager-testing/api/restricted_2.4.0-rc01.txt
rename to work/work-testing/api/restricted_2.4.0-rc01.txt
diff --git a/work/workmanager-testing/api/restricted_2.5.0-beta01.txt b/work/work-testing/api/restricted_2.5.0-beta01.txt
similarity index 100%
rename from work/workmanager-testing/api/restricted_2.5.0-beta01.txt
rename to work/work-testing/api/restricted_2.5.0-beta01.txt
diff --git a/work/workmanager-testing/api/restricted_2.5.0-beta02.txt b/work/work-testing/api/restricted_2.5.0-beta02.txt
similarity index 100%
rename from work/workmanager-testing/api/restricted_2.5.0-beta02.txt
rename to work/work-testing/api/restricted_2.5.0-beta02.txt
diff --git a/work/workmanager-testing/api/2.5.0-beta01.txt b/work/work-testing/api/restricted_2.7.0-beta01.txt
similarity index 100%
copy from work/workmanager-testing/api/2.5.0-beta01.txt
copy to work/work-testing/api/restricted_2.7.0-beta01.txt
diff --git a/work/workmanager-testing/api/restricted_current.txt b/work/work-testing/api/restricted_current.txt
similarity index 100%
rename from work/workmanager-testing/api/restricted_current.txt
rename to work/work-testing/api/restricted_current.txt
diff --git a/work/workmanager-testing/build.gradle b/work/work-testing/build.gradle
similarity index 100%
rename from work/workmanager-testing/build.gradle
rename to work/work-testing/build.gradle
diff --git a/work/workmanager-testing/lint-baseline.xml b/work/work-testing/lint-baseline.xml
similarity index 100%
rename from work/workmanager-testing/lint-baseline.xml
rename to work/work-testing/lint-baseline.xml
diff --git a/work/workmanager-testing/src/androidTest/java/androidx/work/testing/TestSchedulerTest.java b/work/work-testing/src/androidTest/java/androidx/work/testing/TestSchedulerTest.java
similarity index 100%
rename from work/workmanager-testing/src/androidTest/java/androidx/work/testing/TestSchedulerTest.java
rename to work/work-testing/src/androidTest/java/androidx/work/testing/TestSchedulerTest.java
diff --git a/work/workmanager-testing/src/androidTest/java/androidx/work/testing/TestWorkerBuilderTest.kt b/work/work-testing/src/androidTest/java/androidx/work/testing/TestWorkerBuilderTest.kt
similarity index 100%
rename from work/workmanager-testing/src/androidTest/java/androidx/work/testing/TestWorkerBuilderTest.kt
rename to work/work-testing/src/androidTest/java/androidx/work/testing/TestWorkerBuilderTest.kt
diff --git a/work/workmanager-testing/src/androidTest/java/androidx/work/testing/WorkManagerInitHelperTest.java b/work/work-testing/src/androidTest/java/androidx/work/testing/WorkManagerInitHelperTest.java
similarity index 100%
rename from work/workmanager-testing/src/androidTest/java/androidx/work/testing/WorkManagerInitHelperTest.java
rename to work/work-testing/src/androidTest/java/androidx/work/testing/WorkManagerInitHelperTest.java
diff --git a/work/workmanager-testing/src/androidTest/java/androidx/work/testing/workers/CountingTestWorker.java b/work/work-testing/src/androidTest/java/androidx/work/testing/workers/CountingTestWorker.java
similarity index 100%
rename from work/workmanager-testing/src/androidTest/java/androidx/work/testing/workers/CountingTestWorker.java
rename to work/work-testing/src/androidTest/java/androidx/work/testing/workers/CountingTestWorker.java
diff --git a/work/workmanager-testing/src/androidTest/java/androidx/work/testing/workers/TestListenableWorker.java b/work/work-testing/src/androidTest/java/androidx/work/testing/workers/TestListenableWorker.java
similarity index 100%
rename from work/workmanager-testing/src/androidTest/java/androidx/work/testing/workers/TestListenableWorker.java
rename to work/work-testing/src/androidTest/java/androidx/work/testing/workers/TestListenableWorker.java
diff --git a/work/workmanager-testing/src/androidTest/java/androidx/work/testing/workers/TestWorker.java b/work/work-testing/src/androidTest/java/androidx/work/testing/workers/TestWorker.java
similarity index 100%
rename from work/workmanager-testing/src/androidTest/java/androidx/work/testing/workers/TestWorker.java
rename to work/work-testing/src/androidTest/java/androidx/work/testing/workers/TestWorker.java
diff --git a/work/workmanager-testing/src/main/AndroidManifest.xml b/work/work-testing/src/main/AndroidManifest.xml
similarity index 100%
rename from work/workmanager-testing/src/main/AndroidManifest.xml
rename to work/work-testing/src/main/AndroidManifest.xml
diff --git a/work/workmanager-testing/src/main/java/androidx/work/testing/InstantWorkTaskExecutor.java b/work/work-testing/src/main/java/androidx/work/testing/InstantWorkTaskExecutor.java
similarity index 100%
rename from work/workmanager-testing/src/main/java/androidx/work/testing/InstantWorkTaskExecutor.java
rename to work/work-testing/src/main/java/androidx/work/testing/InstantWorkTaskExecutor.java
diff --git a/work/workmanager-testing/src/main/java/androidx/work/testing/SynchronousExecutor.java b/work/work-testing/src/main/java/androidx/work/testing/SynchronousExecutor.java
similarity index 100%
rename from work/workmanager-testing/src/main/java/androidx/work/testing/SynchronousExecutor.java
rename to work/work-testing/src/main/java/androidx/work/testing/SynchronousExecutor.java
diff --git a/work/workmanager-testing/src/main/java/androidx/work/testing/TestDriver.java b/work/work-testing/src/main/java/androidx/work/testing/TestDriver.java
similarity index 100%
rename from work/workmanager-testing/src/main/java/androidx/work/testing/TestDriver.java
rename to work/work-testing/src/main/java/androidx/work/testing/TestDriver.java
diff --git a/work/workmanager-testing/src/main/java/androidx/work/testing/TestForegroundUpdater.java b/work/work-testing/src/main/java/androidx/work/testing/TestForegroundUpdater.java
similarity index 100%
rename from work/workmanager-testing/src/main/java/androidx/work/testing/TestForegroundUpdater.java
rename to work/work-testing/src/main/java/androidx/work/testing/TestForegroundUpdater.java
diff --git a/work/workmanager-testing/src/main/java/androidx/work/testing/TestListenableWorkerBuilder.java b/work/work-testing/src/main/java/androidx/work/testing/TestListenableWorkerBuilder.java
similarity index 100%
rename from work/workmanager-testing/src/main/java/androidx/work/testing/TestListenableWorkerBuilder.java
rename to work/work-testing/src/main/java/androidx/work/testing/TestListenableWorkerBuilder.java
diff --git a/work/workmanager-testing/src/main/java/androidx/work/testing/TestListenableWorkerBuilder.kt b/work/work-testing/src/main/java/androidx/work/testing/TestListenableWorkerBuilder.kt
similarity index 100%
rename from work/workmanager-testing/src/main/java/androidx/work/testing/TestListenableWorkerBuilder.kt
rename to work/work-testing/src/main/java/androidx/work/testing/TestListenableWorkerBuilder.kt
diff --git a/work/workmanager-testing/src/main/java/androidx/work/testing/TestProgressUpdater.java b/work/work-testing/src/main/java/androidx/work/testing/TestProgressUpdater.java
similarity index 100%
rename from work/workmanager-testing/src/main/java/androidx/work/testing/TestProgressUpdater.java
rename to work/work-testing/src/main/java/androidx/work/testing/TestProgressUpdater.java
diff --git a/work/workmanager-testing/src/main/java/androidx/work/testing/TestScheduler.java b/work/work-testing/src/main/java/androidx/work/testing/TestScheduler.java
similarity index 100%
rename from work/workmanager-testing/src/main/java/androidx/work/testing/TestScheduler.java
rename to work/work-testing/src/main/java/androidx/work/testing/TestScheduler.java
diff --git a/work/workmanager-testing/src/main/java/androidx/work/testing/TestWorkManagerImpl.java b/work/work-testing/src/main/java/androidx/work/testing/TestWorkManagerImpl.java
similarity index 100%
rename from work/workmanager-testing/src/main/java/androidx/work/testing/TestWorkManagerImpl.java
rename to work/work-testing/src/main/java/androidx/work/testing/TestWorkManagerImpl.java
diff --git a/work/workmanager-testing/src/main/java/androidx/work/testing/TestWorkerBuilder.java b/work/work-testing/src/main/java/androidx/work/testing/TestWorkerBuilder.java
similarity index 100%
rename from work/workmanager-testing/src/main/java/androidx/work/testing/TestWorkerBuilder.java
rename to work/work-testing/src/main/java/androidx/work/testing/TestWorkerBuilder.java
diff --git a/work/workmanager-testing/src/main/java/androidx/work/testing/TestWorkerBuilder.kt b/work/work-testing/src/main/java/androidx/work/testing/TestWorkerBuilder.kt
similarity index 100%
rename from work/workmanager-testing/src/main/java/androidx/work/testing/TestWorkerBuilder.kt
rename to work/work-testing/src/main/java/androidx/work/testing/TestWorkerBuilder.kt
diff --git a/work/workmanager-testing/src/main/java/androidx/work/testing/WorkManagerTestInitHelper.java b/work/work-testing/src/main/java/androidx/work/testing/WorkManagerTestInitHelper.java
similarity index 100%
rename from work/workmanager-testing/src/main/java/androidx/work/testing/WorkManagerTestInitHelper.java
rename to work/work-testing/src/main/java/androidx/work/testing/WorkManagerTestInitHelper.java
diff --git a/work/workmanager-testing/src/main/java/androidx/work/testing/package-info.java b/work/work-testing/src/main/java/androidx/work/testing/package-info.java
similarity index 100%
rename from work/workmanager-testing/src/main/java/androidx/work/testing/package-info.java
rename to work/work-testing/src/main/java/androidx/work/testing/package-info.java
diff --git a/work/workmanager-testing/src/test/java/androidx/work/testing/RobolectricSmokeTest.java b/work/work-testing/src/test/java/androidx/work/testing/RobolectricSmokeTest.java
similarity index 100%
rename from work/workmanager-testing/src/test/java/androidx/work/testing/RobolectricSmokeTest.java
rename to work/work-testing/src/test/java/androidx/work/testing/RobolectricSmokeTest.java
diff --git a/work/workmanager-testing/src/test/java/androidx/work/testing/workers/TestWorker.java b/work/work-testing/src/test/java/androidx/work/testing/workers/TestWorker.java
similarity index 100%
rename from work/workmanager-testing/src/test/java/androidx/work/testing/workers/TestWorker.java
rename to work/work-testing/src/test/java/androidx/work/testing/workers/TestWorker.java
diff --git a/work/workmanager-inspection/lint-baseline.xml b/work/workmanager-inspection/lint-baseline.xml
deleted file mode 100644
index ca920a7..0000000
--- a/work/workmanager-inspection/lint-baseline.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<issues format="6" by="lint 7.1.0-alpha02" type="baseline" client="cli" name="Lint" variant="all" version="7.1.0-alpha02">
-
- <issue
- id="RemoveWorkManagerInitializer"
- message="Remove androidx.work.WorkManagerInitializer from your AndroidManifest.xml when using on-demand initialization.">
- <location
- file="workmanager-inspection"/>
- </issue>
-
-</issues>