diff --git a/.github/workflows/AlwaysOnKotlin.yml b/.github/workflows/AlwaysOnKotlin.yml
deleted file mode 100644
index b4858f918..000000000
--- a/.github/workflows/AlwaysOnKotlin.yml
+++ /dev/null
@@ -1,131 +0,0 @@
-name: AlwaysOnKotlin
-
-on:
- push:
- branches:
- - main
- paths:
- - 'AlwaysOnKotlin/**'
- - '.github/workflows/AlwaysOnKotlin.yml'
- pull_request:
- paths:
- - 'AlwaysOnKotlin/**'
- - '.github/workflows/AlwaysOnKotlin.yml'
-
-env:
- SAMPLE_PATH: AlwaysOnKotlin
-
-jobs:
- build:
- runs-on: ubuntu-latest
- timeout-minutes: 30
-
- steps:
- - name: Checkout
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4
-
- - name: Set up JDK 17
- uses: actions/setup-java@v4
- with:
- distribution: 'zulu'
- java-version: '17'
-
- - name: Setup Gradle
- uses: gradle/gradle-build-action@v3
- with:
- build-root-directory: ${{ env.SAMPLE_PATH }}
-
- - name: Build project
- uses: gradle/gradle-build-action@v3
- with:
- arguments: check --stacktrace
- build-root-directory: ${{ env.SAMPLE_PATH }}
-
- - name: Upload compose build outputs (APKs)
- uses: actions/upload-artifact@v4
- with:
- name: build-outputs
- path: ${{ env.SAMPLE_PATH }}/compose/build/outputs
-
- - name: Upload compose build reports
- uses: actions/upload-artifact@v4
- with:
- name: build-reports
- path: ${{ env.SAMPLE_PATH }}/compose/build/reports
-
- android-test:
- runs-on: ubuntu-latest
- timeout-minutes: 30
- strategy:
- fail-fast: false
- matrix:
- device:
- - 28
- - 30
- - 33
-
- steps:
- - name: Checkout
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4
-
- - name: Bump to AGP 8.4 alpha
- run: |
- sed -i 's/android-gradle-plugin = .*/android-gradle-plugin = "8.4.0-alpha04"/' ${{ env.SAMPLE_PATH }}/gradle/libs.versions.toml
- sed -r -i 's/\/\/(\s+id "com.google.firebase.testlab")/\1/' ${{ env.SAMPLE_PATH }}/compose/build.gradle
-
- - name: Enable KVM group perms
- run: |
- echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
- sudo udevadm control --reload-rules
- sudo udevadm trigger --name-match=kvm
-
- - name: Set up JDK 17
- uses: actions/setup-java@v4
- with:
- distribution: 'zulu'
- java-version: '17'
-
- - name: Install Emulator
- run: yes | "$ANDROID_HOME"/cmdline-tools/latest/bin/sdkmanager --install "emulator"
-
- - name: Accept licenses
- run: |
- mkdir -p /usr/local/lib/android/sdk/licenses
- echo 84831b9409646a918e30573bab4c9c91346d8abd > /usr/local/lib/android/sdk/licenses/android-sdk-preview-license
-
- - name: Run instrumentation tests
- uses: gradle/gradle-build-action@v3
- with:
- arguments: roundApi${{ matrix.device }}Check
- build-root-directory: ${{ env.SAMPLE_PATH }}
-
- - name: Upload compose test reports
- uses: actions/upload-artifact@v4
- with:
- name: test-reports${{ matrix.device }}
- path: ${{ env.SAMPLE_PATH }}/compose/build/reports
-
- apk:
- runs-on: ubuntu-latest
-
- steps:
- - name: Checkout
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4
-
- - name: Set up JDK 17
- uses: actions/setup-java@v4
- with:
- distribution: 'zulu'
- java-version: 17
-
- - name: Build project
- uses: gradle/gradle-build-action@v3
- with:
- arguments: compose:assembleRelease
- build-root-directory: ${{ env.SAMPLE_PATH }}
-
- - name: Upload APK
- uses: actions/upload-artifact@v4
- with:
- name: App
- path: ${{ env.SAMPLE_PATH }}/compose/build/outputs/apk/release/compose-release.apk
diff --git a/AlwaysOnKotlin/.editorconfig b/AlwaysOnKotlin/.editorconfig
deleted file mode 100644
index 910914b3d..000000000
--- a/AlwaysOnKotlin/.editorconfig
+++ /dev/null
@@ -1,22 +0,0 @@
-# https://editorconfig.org
-root = true
-
-[*]
-indent_style = space
-indent_size = 2
-end_of_line = lf
-charset = utf-8
-trim_trailing_whitespace = true
-insert_final_newline = true
-max_line_length = 100
-
-[*.{java,kt,kts,xml}]
-indent_size = 4
-
-[*.{kt,kts}]
-ij_kotlin_imports_layout=*
-ij_kotlin_allow_trailing_comma=false
-ij_kotlin_allow_trailing_comma_on_call_site=false
-
-[*.md]
-trim_trailing_whitespace = false
diff --git a/AlwaysOnKotlin/.google/packaging.yaml b/AlwaysOnKotlin/.google/packaging.yaml
deleted file mode 100644
index 716c90a63..000000000
--- a/AlwaysOnKotlin/.google/packaging.yaml
+++ /dev/null
@@ -1,29 +0,0 @@
-# Copyright 2019 Google LLC
-#
-# 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
-#
-# https://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.
-#
-# GOOGLE SAMPLE PACKAGING DATA
-#
-# This file is used by Google as part of our samples packaging process.
-# End users may safely ignore this file. It has no relevance to other systems.
----
-status: PUBLISHED
-technologies: [Android]
-categories: [Wearable]
-languages: [Java]
-solutions: [Mobile]
-github: android/wear-os
-level: INTERMEDIATE
-apiRefs:
- - android:android.support.wearable.activity.WearableActivity
-license: apache2
diff --git a/AlwaysOnKotlin/README.md b/AlwaysOnKotlin/README.md
deleted file mode 100644
index ab9f74788..000000000
--- a/AlwaysOnKotlin/README.md
+++ /dev/null
@@ -1,75 +0,0 @@
-
-Android AlwaysOn Kotlin Sample
-=======================
-
-A basic sample showing how to support [Ambient Mode][5] for native Wear apps.
-
-Introduction
-------------
-
-The [AmbientModeSupport][1] class offers a set of methods which allow your native app to stay on the screen when the Wear device enters ambient mode.
-
-This example implements the [AmbientCallbackProvider][2] interface and provides behavior for `onEnterAmbient`, `onUpdateAmbient`, and `onExitAmbient` to allow the native Wear app to support ambient mode.
-
-All [Ambient Mode Principles and Best Practices](#ambient-mode-best-practices) are adhered to. Crucially, the conservation of battery life is prioritized, as the app will sleep while in ambient mode for 10 seconds between any updates, allowing the processor to sleep.
-
-This implementation leverages an `AlarmManger` instance to manually invoke `onUpdateAmbient` every 10 seconds instead of the 60 second default invocation interval. Implementations should strive to avoid this behavior and rely on the default interval to save as much battery life as possible.
-
-As always, your app should adhere to the [performance guidelines][4] outlined in the Watch Face documentation, and follow the [design guidelines for Watch Faces][3].
-
-[1]: https://developer.android.com/reference/androidx/wear/ambient/AmbientModeSupport
-[2]: https://developer.android.com/reference/androidx/wear/ambient/AmbientModeSupport.AmbientCallbackProvider
-[3]: https://developer.android.com/training/wearables/watch-faces/designing.html#DesignGuidelines
-[4]: https://developer.android.com/training/wearables/watch-faces/performance.html
-[5]: https://developer.android.com/training/wearables/views/always-on
-
-> ### **Warning!**
->
-> **Most apps should not use the always on/ambient mode APIs**, as they drain battery life and are redundant with the OS's always on behavior.
->
-> By default, Wear OS will go into *system ambient mode* if the user hasn't interacted with the watch after the user-defined screen timeout duration (15 seconds by default). When the user interacts with the watch in ambient mode, the system will awaken in the same state it in was before ambient mode.
-
-
-Ambient Mode Principles & Best Practices
--------------
-
-#### Principles
-
-* Prioritize the conservation of battery life
-* Let the processor sleep as much as possible
-
-#### Implementation Best Practices
-
-* Keep most pixels black
-* Avoid large blocks of white pixels
-* Use only black and white color schemes
-* Disabling anti-aliasing
-
-Prerequisites
---------------
-
-- Android SDK 30
-- Requires AC to be configured off `adb emu power ac off`
-
-
-Getting Started
----------------
-
-This sample uses the Gradle build system. To build this project, use the
-`gradlew build` command or use "Import Project" in Android Studio.
-
-Screenshots
--------------
-
-
-
-Support
--------
-
-**Stack Overflow:** https://stackoverflow.com/questions/tagged/wear-os
-
-**Error Reporting:** If you've found an error in this sample, please file an issue:
-https://github.com/android/wear-os-samples
-
-**Submitting Patches:** Patches are encouraged, and may be submitted by forking this project and
-submitting a pull request through GitHub. Please see CONTRIBUTING.md for more details.
diff --git a/AlwaysOnKotlin/build.gradle b/AlwaysOnKotlin/build.gradle
deleted file mode 100644
index b04575bb7..000000000
--- a/AlwaysOnKotlin/build.gradle
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * 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.
- */
-
-buildscript {
- dependencies {
- classpath libs.kotlin.gradle.plugin
- }
-}
-
-plugins {
- alias(libs.plugins.com.diffplug.spotless) apply(false)
- alias(libs.plugins.com.android.application) apply(false)
- alias(libs.plugins.firebase.testlab) apply (false)
-}
-
-subprojects {
- apply plugin: "com.diffplug.spotless"
-
- spotless {
- kotlin {
- target "**/*.kt"
- targetExclude("$buildDir/**/*.kt")
- targetExclude("bin/**/*.kt")
-
- ktlint(libs.versions.ktlint.get())
- licenseHeaderFile rootProject.file("../spotless/copyright.kt")
- }
- }
-}
diff --git a/AlwaysOnKotlin/compose/build.gradle b/AlwaysOnKotlin/compose/build.gradle
deleted file mode 100644
index 0dbbf24d6..000000000
--- a/AlwaysOnKotlin/compose/build.gradle
+++ /dev/null
@@ -1,157 +0,0 @@
-import com.android.build.api.dsl.ManagedVirtualDevice
-
-/*
- * 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.
- */
-
-plugins {
- id 'com.android.application'
- id 'org.jetbrains.kotlin.android'
-// id "com.google.firebase.testlab"
-}
-
-android {
- compileSdk 34
-
- namespace "com.example.android.wearable.wear.alwayson"
-
- defaultConfig {
- versionCode 1
- versionName "1.0"
- minSdk 26
- //noinspection ExpiredTargetSdkVersion
- targetSdk 33
-
- testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
- }
-
- lint {
- disable 'GradleDependency'
- }
-
- lintOptions {
- warningsAsErrors true
- }
-
- buildTypes {
- release {
- minifyEnabled true
- shrinkResources true
- signingConfig signingConfigs.debug
- proguardFiles getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro"
- }
- }
-
- compileOptions {
- sourceCompatibility JavaVersion.VERSION_17
- targetCompatibility JavaVersion.VERSION_17
- coreLibraryDesugaringEnabled true
- }
-
- kotlinOptions {
- jvmTarget = JavaVersion.VERSION_17.majorVersion
- allWarningsAsErrors = true
- freeCompilerArgs += "-opt-in=kotlin.RequiresOptIn"
- }
-
- buildFeatures {
- compose true
- }
-
- composeOptions {
- kotlinCompilerExtensionVersion libs.versions.compose.compiler.get()
- }
-
- // Workaround for https://github.com/Kotlin/kotlinx.coroutines/issues/2023
- packagingOptions {
- // for JNA and JNA-platform
- exclude "META-INF/AL2.0"
- exclude "META-INF/LGPL2.1"
- }
-
- testOptions {
- if (pluginManager.hasPlugin("com.google.firebase.testlab")) {
- firebaseTestLab {
- managedDevices {
- pixelWatch {
- device = "r11"
- apiLevel = 30
- }
- }
- }
- }
- devices {
- squareApi30(ManagedVirtualDevice) {
- device = "Wear OS Square"
- apiLevel = 30
- systemImageSource = "android-wear"
- }
- roundApi28(ManagedVirtualDevice) {
- device = "Wear OS Large Round"
- apiLevel = 28
- systemImageSource = "android-wear"
- }
- roundApi30(ManagedVirtualDevice) {
- device = "Wear OS Large Round"
- apiLevel = 30
- systemImageSource = "android-wear"
- }
- roundApi33(ManagedVirtualDevice) {
- device = "Wear OS Large Round"
- apiLevel = 33
- systemImageSource = "android-wear"
- }
- }
- }
-}
-
-dependencies {
- def composeBom = platform(libs.androidx.compose.bom)
-
- implementation composeBom
- implementation libs.kotlinx.coroutines.android
- implementation libs.androidx.activity.compose
- implementation libs.compose.ui
- implementation libs.compose.ui.tooling
- implementation libs.androidx.core.ktx
- implementation libs.androidx.lifecycle.runtime.ktx
- implementation libs.androidx.wear
- implementation libs.wear.compose.foundation
- implementation libs.wear.compose.material
- implementation libs.androidx.window
- implementation libs.compose.ui.test.manifest
-
- implementation(libs.horologist.compose.layout)
- implementation(libs.androidx.compose.ui.tooling)
-
- // Release mode doesn't work without that dependency
- compileOnly libs.wearable
-
- coreLibraryDesugaring libs.desugar.jdk.libs
-
- androidTestImplementation composeBom
- androidTestImplementation libs.kotlinx.coroutines.test
- androidTestImplementation libs.test.core.ktx
- androidTestImplementation libs.test.ext.junit.ktx
- androidTestImplementation libs.test.runner
- androidTestImplementation libs.test.uiautomator
- androidTestImplementation libs.compose.ui.test.junit4
-
- testImplementation libs.kotlinx.coroutines.test
- testImplementation libs.test.core.ktx
- testImplementation libs.test.ext.junit.ktx
- testImplementation libs.test.runner
- testImplementation libs.compose.ui.test.junit4
-}
diff --git a/AlwaysOnKotlin/compose/proguard-rules.pro b/AlwaysOnKotlin/compose/proguard-rules.pro
deleted file mode 100644
index e7f7a95b8..000000000
--- a/AlwaysOnKotlin/compose/proguard-rules.pro
+++ /dev/null
@@ -1,35 +0,0 @@
-# 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
-#
-# https://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.
-#
-# Add project specific ProGuard rules here.
-# You can control the set of applied configuration files using the
-# proguardFiles setting in build.gradle.
-#
-# For more details, see
-# http://developer.android.com/guide/developing/tools/proguard.html
-
-# If your project uses WebView with JS, uncomment the following
-# and specify the fully qualified class name to the JavaScript interface
-# class:
-#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
-# public *;
-#}
-
-# Uncomment this to preserve the line number information for
-# debugging stack traces.
-#-keepattributes SourceFile,LineNumberTable
-
-# If you keep the line number information, uncomment this to
-# hide the original source file name.
-#-renamesourcefileattribute SourceFile
diff --git a/AlwaysOnKotlin/compose/src/androidTest/java/com/example/android/wearable/wear/alwayson/AlwaysOnAppTests.kt b/AlwaysOnKotlin/compose/src/androidTest/java/com/example/android/wearable/wear/alwayson/AlwaysOnAppTests.kt
deleted file mode 100644
index e1cda25a0..000000000
--- a/AlwaysOnKotlin/compose/src/androidTest/java/com/example/android/wearable/wear/alwayson/AlwaysOnAppTests.kt
+++ /dev/null
@@ -1,295 +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
- *
- * https://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("This test is disabled as failing on 30")
-
-package com.example.android.wearable.wear.alwayson
-
-import android.app.Application
-import android.app.PendingIntent
-import android.content.Intent
-import android.view.KeyEvent
-import androidx.compose.ui.test.assertTextEquals
-import androidx.compose.ui.test.junit4.createEmptyComposeRule
-import androidx.compose.ui.test.onNodeWithTag
-import androidx.lifecycle.Lifecycle
-import androidx.test.core.app.ActivityScenario
-import androidx.test.core.app.ApplicationProvider
-import androidx.test.core.app.launchActivity
-import androidx.test.ext.junit.runners.AndroidJUnit4
-import androidx.test.platform.app.InstrumentationRegistry
-import androidx.test.uiautomator.UiDevice
-import java.time.Clock
-import java.time.Duration
-import java.time.Instant
-import java.time.ZoneId
-import kotlinx.coroutines.ExperimentalCoroutinesApi
-import kotlinx.coroutines.test.StandardTestDispatcher
-import kotlinx.coroutines.test.TestCoroutineScheduler
-import kotlinx.coroutines.test.TestScope
-import kotlinx.coroutines.test.runTest
-import org.junit.After
-import org.junit.Before
-import org.junit.Ignore
-import org.junit.Rule
-import org.junit.Test
-import org.junit.runner.RunWith
-
-@Ignore("Tests failing on 30")
-@RunWith(AndroidJUnit4::class)
-@OptIn(ExperimentalCoroutinesApi::class)
-class AlwaysOnAppTests {
- private val context = ApplicationProvider.getApplicationContext()
-
- private val testScope = TestScope()
-
- /**
- * A timestamp in the relatively far, far future (year 2200).
- *
- * This ensures the real alarm manager won't actually trigger.
- */
- private var instant = YEAR_2200_INSTANT
-
- @get:Rule
- val composeTestRule = createEmptyComposeRule()
-
- private lateinit var scenario: ActivityScenario
-
- private lateinit var uiDevice: UiDevice
-
- @Before
- fun setup() {
- uiDevice = UiDevice.getInstance(InstrumentationRegistry.getInstrumentation())
-
- // Ensure we are starting in active mode
- pressKeyCodeWithWait(KeyEvent.KEYCODE_WAKEUP)
-
- // Override the active dispatcher with a test one that we can control the time for
- activeDispatcher = StandardTestDispatcher(testScope.testScheduler)
-
- // Override the clock to always delegate to a fixed clock for the current instant
- val delegateClock = { Clock.fixed(instant, ZoneId.of("UTC")) }
- clock = object : Clock() {
- override fun getZone(): ZoneId = delegateClock().zone
- override fun withZone(zone: ZoneId?): Clock = delegateClock().withZone(zone)
- override fun instant(): Instant = delegateClock().instant()
- }
- scenario = launchActivity()
- }
-
- @After
- fun teardown() {
- scenario.close()
- }
-
- @Test
- fun initialTextIsCorrect(): Unit = testScope.runTest {
- scenario.moveToState(Lifecycle.State.RESUMED)
-
- composeTestRule.onNodeWithTag("time").assertTextEquals(ZERO_SEC_DISPLAY)
- composeTestRule.onNodeWithTag("timestamp")
- .assertTextEquals(
- context.getString(
- R.string.timestamp_label,
- YEAR_2200_INSTANT.toEpochMilli()
- )
- )
- composeTestRule.onNodeWithTag("mode")
- .assertTextEquals(context.getString(R.string.mode_active_label))
- composeTestRule.onNodeWithTag("drawCount")
- .assertTextEquals(context.getString(R.string.draw_count_label, 1))
-
- scenario.moveToState(Lifecycle.State.STARTED)
- }
-
- @Test
- fun textIsCorrectAfterFiveSeconds(): Unit = testScope.runTest {
- scenario.moveToState(Lifecycle.State.RESUMED)
- composeTestRule.waitForIdle()
-
- // Advance 5 seconds, one at a time
- repeat(5) {
- advanceTime(Duration.ofSeconds(1))
- }
-
- composeTestRule.onNodeWithTag("time").assertTextEquals(FIVE_SEC_DISPLAY)
- composeTestRule.onNodeWithTag("timestamp")
- .assertTextEquals(
- context.getString(
- R.string.timestamp_label,
- YEAR_2200_INSTANT.plusSeconds(5).toEpochMilli()
- )
- )
- composeTestRule.onNodeWithTag("mode")
- .assertTextEquals(context.getString(R.string.mode_active_label))
- composeTestRule.onNodeWithTag("drawCount")
- .assertTextEquals(context.getString(R.string.draw_count_label, 6))
-
- scenario.moveToState(Lifecycle.State.STARTED)
- }
-
- @Test
- fun textIsCorrectAfterGoingIntoAmbientMode(): Unit = testScope.runTest {
- scenario.moveToState(Lifecycle.State.RESUMED)
- composeTestRule.waitForIdle()
-
- // Advance 5 seconds, one at a time
- repeat(5) {
- advanceTime(Duration.ofSeconds(1))
- }
-
- pressKeyCodeWithWait(KeyEvent.KEYCODE_SLEEP)
- composeTestRule.waitForIdle()
-
- composeTestRule.onNodeWithTag("time").assertTextEquals(FIVE_SEC_DISPLAY)
- composeTestRule.onNodeWithTag("timestamp")
- .assertTextEquals(
- context.getString(
- R.string.timestamp_label,
- YEAR_2200_INSTANT.plusSeconds(5).toEpochMilli()
- )
- )
- composeTestRule.onNodeWithTag("mode")
- .assertTextEquals(context.getString(R.string.mode_ambient_label))
- composeTestRule.onNodeWithTag("drawCount")
- .assertTextEquals(context.getString(R.string.draw_count_label, 7))
-
- scenario.moveToState(Lifecycle.State.STARTED)
- }
-
- @Test
- fun textIsCorrectAfterGoingIntoAmbientModeAndReceivingIntent(): Unit = testScope.runTest {
- scenario.moveToState(Lifecycle.State.RESUMED)
- composeTestRule.waitForIdle()
-
- // Advance 5 seconds, one at a time
- repeat(5) {
- advanceTime(Duration.ofSeconds(1))
- }
-
- advanceTime(Duration.ofMillis(500))
-
- pressKeyCodeWithWait(KeyEvent.KEYCODE_SLEEP)
- composeTestRule.waitForIdle()
-
- // Simulate a sent broadcast
- advanceTime(Duration.ofSeconds(5))
- scenario.onActivity {
- PendingIntent.getBroadcast(
- it,
- 0,
- Intent(AMBIENT_UPDATE_ACTION),
- PendingIntent.FLAG_UPDATE_CURRENT
- ).send()
- }
-
- Thread.sleep(1000) // Ugly sleep, without it sometimes the broadcast won't be received
- composeTestRule.waitForIdle()
-
- composeTestRule.onNodeWithTag("time").assertTextEquals(TEN_SEC_DISPLAY)
- composeTestRule.onNodeWithTag("timestamp")
- .assertTextEquals(
- context.getString(
- R.string.timestamp_label,
- YEAR_2200_INSTANT.plusSeconds(10).plusMillis(500).toEpochMilli()
- )
- )
- composeTestRule.onNodeWithTag("mode")
- .assertTextEquals(context.getString(R.string.mode_ambient_label))
- composeTestRule.onNodeWithTag("drawCount")
- .assertTextEquals(context.getString(R.string.draw_count_label, 8))
-
- scenario.moveToState(Lifecycle.State.STARTED)
- }
-
- @Test
- fun textIsCorrectAfterReturningToActiveMode(): Unit = testScope.runTest {
- scenario.moveToState(Lifecycle.State.RESUMED)
- composeTestRule.waitForIdle()
-
- // Advance 5 seconds, one at a time
- repeat(5) {
- advanceTime(Duration.ofSeconds(1))
- }
-
- advanceTime(Duration.ofMillis(500))
-
- // Enter ambient mode
- pressKeyCodeWithWait(KeyEvent.KEYCODE_SLEEP)
- composeTestRule.waitForIdle()
-
- // Simulate a sent broadcast
- advanceTime(Duration.ofSeconds(5))
- scenario.onActivity {
- PendingIntent.getBroadcast(
- it,
- 0,
- Intent(AMBIENT_UPDATE_ACTION),
- PendingIntent.FLAG_UPDATE_CURRENT
- ).send()
- }
-
- Thread.sleep(1000) // Ugly sleep, without it sometimes the broadcast won't be received
- composeTestRule.waitForIdle()
-
- advanceTime(Duration.ofSeconds(2))
-
- // Exit ambient mode
- pressKeyCodeWithWait(KeyEvent.KEYCODE_WAKEUP)
- composeTestRule.waitForIdle()
-
- composeTestRule.onNodeWithTag("time").assertTextEquals(TWELVE_SEC_DISPLAY)
- composeTestRule.onNodeWithTag("timestamp")
- .assertTextEquals(
- context.getString(
- R.string.timestamp_label,
- YEAR_2200_INSTANT.plusSeconds(12).plusMillis(500).toEpochMilli()
- )
- )
- composeTestRule.onNodeWithTag("mode")
- .assertTextEquals(context.getString(R.string.mode_active_label))
- composeTestRule.onNodeWithTag("drawCount")
- .assertTextEquals(context.getString(R.string.draw_count_label, 9))
-
- scenario.moveToState(Lifecycle.State.STARTED)
- }
-
- /**
- * Advances the simulated time by the given [duration], updating the [TestCoroutineScheduler]
- * and running any updates due to those changes.
- */
- private fun advanceTime(duration: Duration) {
- instant += duration
- testScope.testScheduler.advanceTimeBy(duration.toMillis())
- testScope.testScheduler.runCurrent()
- composeTestRule.waitForIdle()
- }
-
- /**
- * Presses the given key with an ugly sleep, without it sometimes ambient mode won't be entered
- * or exited.
- */
- private fun pressKeyCodeWithWait(keyCode: Int) {
- uiDevice.pressKeyCode(keyCode)
- Thread.sleep(1000)
- }
-}
-
-private val YEAR_2200_INSTANT = Instant.ofEpochMilli(7258118400000L)
-
-private const val ZERO_SEC_DISPLAY = "00:00:00"
-private const val FIVE_SEC_DISPLAY = "00:00:05"
-private const val TEN_SEC_DISPLAY = "00:00:10"
-private const val TWELVE_SEC_DISPLAY = "00:00:12"
diff --git a/AlwaysOnKotlin/compose/src/main/AndroidManifest.xml b/AlwaysOnKotlin/compose/src/main/AndroidManifest.xml
deleted file mode 100644
index d183e0e23..000000000
--- a/AlwaysOnKotlin/compose/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,52 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/AlwaysOnKotlin/compose/src/main/java/com/example/android/wearable/wear/alwayson/AlwaysOnApp.kt b/AlwaysOnKotlin/compose/src/main/java/com/example/android/wearable/wear/alwayson/AlwaysOnApp.kt
deleted file mode 100644
index e922be4ed..000000000
--- a/AlwaysOnKotlin/compose/src/main/java/com/example/android/wearable/wear/alwayson/AlwaysOnApp.kt
+++ /dev/null
@@ -1,268 +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
- *
- * https://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 com.example.android.wearable.wear.alwayson
-
-import android.app.AlarmManager
-import android.app.PendingIntent
-import android.content.BroadcastReceiver
-import android.content.Context
-import android.content.Intent
-import android.content.IntentFilter
-import android.util.Log
-import androidx.compose.runtime.Composable
-import androidx.compose.runtime.DisposableEffect
-import androidx.compose.runtime.LaunchedEffect
-import androidx.compose.runtime.getValue
-import androidx.compose.runtime.mutableIntStateOf
-import androidx.compose.runtime.mutableLongStateOf
-import androidx.compose.runtime.mutableStateOf
-import androidx.compose.runtime.produceState
-import androidx.compose.runtime.remember
-import androidx.compose.runtime.rememberUpdatedState
-import androidx.compose.runtime.setValue
-import androidx.compose.ui.platform.LocalContext
-import androidx.compose.ui.platform.LocalLifecycleOwner
-import androidx.core.content.ContextCompat.RECEIVER_NOT_EXPORTED
-import androidx.core.content.ContextCompat.registerReceiver
-import androidx.core.content.getSystemService
-import androidx.lifecycle.Lifecycle
-import androidx.lifecycle.repeatOnLifecycle
-import androidx.wear.compose.material.MaterialTheme
-import com.google.android.horologist.compose.ambient.AmbientState
-import com.google.android.horologist.compose.ambient.AmbientStateUpdate
-import java.time.Clock
-import java.time.Duration
-import java.time.Instant
-import java.time.LocalTime
-import kotlinx.coroutines.CoroutineDispatcher
-import kotlinx.coroutines.awaitCancellation
-import kotlinx.coroutines.delay
-import kotlinx.coroutines.withContext
-
-/**
- * Duration between updates while in active mode.
- */
-val ACTIVE_INTERVAL: Duration = Duration.ofSeconds(1)
-
-/**
- * Duration between updates while in ambient mode.
- */
-val AMBIENT_INTERVAL: Duration = Duration.ofSeconds(10)
-
-const val AMBIENT_UPDATE_ACTION = "com.example.android.wearable.wear.alwayson.action.AMBIENT_UPDATE"
-
-const val TAG = "AlwaysOnApp"
-
-/**
- * Create a PendingIntent which we'll give to the AlarmManager to send ambient mode updates
- * on an interval which we've define.
- */
-private val ambientUpdateIntent = Intent(AMBIENT_UPDATE_ACTION)
-
-@Composable
-fun AlwaysOnApp(
- clock: Clock,
- activeDispatcher: CoroutineDispatcher,
- ambientStateUpdate: AmbientStateUpdate
-) {
- val ambientUpdateAlarmManager = rememberAlarmManager()
-
- val context = LocalContext.current
-
- /**
- * Retrieves a PendingIntent that will perform a broadcast. You could also use getActivity()
- * to retrieve a PendingIntent that will start a new activity, but be aware that actually
- * triggers onNewIntent() which causes lifecycle changes (onPause() and onResume()) which
- * might trigger code to be re-executed more often than you want.
- *
- * If you do end up using getActivity(), also make sure you have set activity launchMode to
- * singleInstance in the manifest.
- *
- * Otherwise, it is easy for the AlarmManager launch Intent to open a new activity
- * every time the Alarm is triggered rather than reusing this Activity.
- */
- val ambientUpdatePendingIntent = remember(context) {
- PendingIntent.getBroadcast(
- context,
- 0,
- ambientUpdateIntent,
- PendingIntent.FLAG_IMMUTABLE or PendingIntent.FLAG_UPDATE_CURRENT
- )
- }
-
- /**
- * A ping used to set up a loopback side-effect loop, to continuously update the time.
- */
- var updateDataTrigger by remember { mutableLongStateOf(0L) }
-
- /**
- * The current instant to display
- */
- var currentInstant by remember { mutableStateOf(Instant.now(clock)) }
-
- /**
- * The current time to display
- */
- var currentTime by remember { mutableStateOf(LocalTime.now(clock)) }
-
- /**
- * The number of times the current time and instant have been updated
- */
- var drawCount by remember { mutableIntStateOf(0) }
-
- fun updateData() {
- updateDataTrigger++
- currentInstant = Instant.now(clock)
- currentTime = LocalTime.now(clock)
- drawCount++
- }
-
- val lifecycleOwner = LocalLifecycleOwner.current
-
- /**
- * Construct a boolean indicating if we are resumed.
- */
- val isResumed by produceState(initialValue = false) {
- lifecycleOwner.repeatOnLifecycle(Lifecycle.State.RESUMED) {
- value = true
- try {
- awaitCancellation()
- } finally {
- value = false
- }
- }
- }
-
- if (isResumed) {
- when (ambientStateUpdate.ambientState) {
- is AmbientState.Ambient -> {
- // When we are resumed and ambient, setup the broadcast receiver
- SystemBroadcastReceiver(systemAction = AMBIENT_UPDATE_ACTION) {
- updateData()
- }
- DisposableEffect(ambientUpdateAlarmManager, ambientUpdatePendingIntent) {
- onDispose {
- // Upon leaving resumption or ambient, cancel any ongoing pending intents
- ambientUpdateAlarmManager.cancel(ambientUpdatePendingIntent)
- }
- }
- }
-
- AmbientState.Interactive -> Unit
- }
-
- // Whenever we change ambient state (and initially) update the data.
- LaunchedEffect(ambientStateUpdate.ambientState) {
- updateData()
- }
-
- // Then, setup a ping to refresh data again: either via the alarm manager, or simply
- // after a delay
- LaunchedEffect(updateDataTrigger, ambientStateUpdate.ambientState) {
- when (ambientStateUpdate.ambientState) {
- is AmbientState.Ambient -> {
- val triggerTime = currentInstant.getNextInstantWithInterval(
- AMBIENT_INTERVAL
- )
- try {
- ambientUpdateAlarmManager.setExact(
- AlarmManager.RTC_WAKEUP,
- triggerTime.toEpochMilli(),
- ambientUpdatePendingIntent
- )
- } catch (_: SecurityException) {
- Log.d(
- TAG,
- arrayOf(
- "SecurityException when calling setExact(),",
- "screen will not be refreshed"
- ).joinToString(" ")
- )
- }
- }
-
- AmbientState.Interactive -> {
- val delay = currentInstant.getDelayToNextInstantWithInterval(
- ACTIVE_INTERVAL
- )
- withContext(activeDispatcher) {
- // Delay on the active dispatcher for testability
- delay(delay.toMillis())
- }
- updateData()
- }
- }
- }
- }
-
- MaterialTheme {
- AlwaysOnScreen(
- ambientStateUpdate = ambientStateUpdate,
- drawCount = drawCount,
- currentInstant = currentInstant,
- currentTime = currentTime
- )
- }
-}
-
-/**
- * Returns the delay from this [Instant] to the next one that is aligned with the given [interval].
- */
-private fun Instant.getDelayToNextInstantWithInterval(interval: Duration): Duration =
- Duration.ofMillis(interval.toMillis() - toEpochMilli() % interval.toMillis())
-
-/**
- * Returns the next [Instant] that is aligned with the given [interval].
- */
-private fun Instant.getNextInstantWithInterval(interval: Duration): Instant =
- plus(getDelayToNextInstantWithInterval(interval))
-
-@Composable
-fun rememberAlarmManager(): AlarmManager {
- val context = LocalContext.current
- return remember(context) {
- context.getSystemService()!!
- }
-}
-
-@Composable
-fun SystemBroadcastReceiver(
- systemAction: String,
- onSystemEvent: (intent: Intent?) -> Unit
-) {
- // Grab the current context in this part of the UI tree
- val context = LocalContext.current
-
- // Safely use the latest onSystemEvent lambda passed to the function
- val currentOnSystemEvent by rememberUpdatedState(onSystemEvent)
-
- // If either context or systemAction changes, unregister and register again
- DisposableEffect(context, systemAction) {
- val intentFilter = IntentFilter(systemAction)
- val broadcast = object : BroadcastReceiver() {
- override fun onReceive(context: Context?, intent: Intent?) {
- currentOnSystemEvent(intent)
- }
- }
-
- registerReceiver(context, broadcast, intentFilter, RECEIVER_NOT_EXPORTED)
-
- // When the effect leaves the Composition, remove the callback
- onDispose {
- context.unregisterReceiver(broadcast)
- }
- }
-}
diff --git a/AlwaysOnKotlin/compose/src/main/java/com/example/android/wearable/wear/alwayson/AlwaysOnScreen.kt b/AlwaysOnKotlin/compose/src/main/java/com/example/android/wearable/wear/alwayson/AlwaysOnScreen.kt
deleted file mode 100644
index e9b0acd9c..000000000
--- a/AlwaysOnKotlin/compose/src/main/java/com/example/android/wearable/wear/alwayson/AlwaysOnScreen.kt
+++ /dev/null
@@ -1,218 +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
- *
- * https://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 com.example.android.wearable.wear.alwayson
-
-import androidx.compose.foundation.layout.Arrangement
-import androidx.compose.foundation.layout.Column
-import androidx.compose.foundation.layout.padding
-import androidx.compose.foundation.rememberScrollState
-import androidx.compose.foundation.verticalScroll
-import androidx.compose.runtime.Composable
-import androidx.compose.runtime.remember
-import androidx.compose.ui.Alignment
-import androidx.compose.ui.Modifier
-import androidx.compose.ui.composed
-import androidx.compose.ui.draw.drawWithContent
-import androidx.compose.ui.geometry.toRect
-import androidx.compose.ui.graphics.Color
-import androidx.compose.ui.graphics.ColorFilter
-import androidx.compose.ui.graphics.ColorMatrix
-import androidx.compose.ui.graphics.Paint
-import androidx.compose.ui.graphics.drawscope.drawIntoCanvas
-import androidx.compose.ui.graphics.graphicsLayer
-import androidx.compose.ui.graphics.withSaveLayer
-import androidx.compose.ui.platform.LocalDensity
-import androidx.compose.ui.platform.testTag
-import androidx.compose.ui.res.stringResource
-import androidx.compose.ui.text.style.TextAlign
-import androidx.wear.ambient.AmbientLifecycleObserver
-import androidx.wear.compose.material.MaterialTheme
-import androidx.wear.compose.material.Text
-import androidx.wear.compose.ui.tooling.preview.WearPreviewSmallRound
-import com.google.android.horologist.compose.ambient.AmbientState
-import com.google.android.horologist.compose.ambient.AmbientStateUpdate
-import com.google.android.horologist.compose.layout.fillMaxRectangle
-import java.time.Instant
-import java.time.LocalTime
-import java.time.format.DateTimeFormatter
-import java.util.Locale
-import kotlin.random.Random
-
-/**
- * Number of pixels to offset the content rendered in the display to prevent screen burn-in.
- */
-const val BURN_IN_OFFSET_PX = 10
-
-@Composable
-fun AlwaysOnScreen(
- ambientStateUpdate: AmbientStateUpdate,
- drawCount: Int,
- currentInstant: Instant,
- currentTime: LocalTime
-) {
- val dateFormat = remember { DateTimeFormatter.ofPattern("HH:mm:ss", Locale.US) }
-
- Column(
- verticalArrangement = Arrangement.Center,
- horizontalAlignment = Alignment.CenterHorizontally,
- modifier = Modifier
- .verticalScroll(rememberScrollState())
- .fillMaxRectangle()
- .padding(with(LocalDensity.current) { BURN_IN_OFFSET_PX.toDp() })
- .ambientMode(ambientStateUpdate)
- ) {
- Text(
- modifier = Modifier.testTag("time"),
- text = dateFormat.format(currentTime),
- style = MaterialTheme.typography.title1,
- textAlign = TextAlign.Center
- )
- Text(
- modifier = Modifier.testTag("timestamp"),
- text = stringResource(id = R.string.timestamp_label, currentInstant.toEpochMilli()),
- style = MaterialTheme.typography.body2,
- textAlign = TextAlign.Center
- )
- Text(
- modifier = Modifier.testTag("mode"),
- text = stringResource(
- id = when (ambientStateUpdate.ambientState) {
- AmbientState.Interactive -> R.string.mode_active_label
- is AmbientState.Ambient -> R.string.mode_ambient_label
- }
- ),
- style = MaterialTheme.typography.body2,
- color = Color.Green,
- textAlign = TextAlign.Center
- )
- Text(
- modifier = Modifier.testTag("rate"),
- text = stringResource(
- id = R.string.update_rate_label,
- when (ambientStateUpdate.ambientState) {
- AmbientState.Interactive -> ACTIVE_INTERVAL.seconds
- is AmbientState.Ambient -> AMBIENT_INTERVAL.seconds
- }
- ),
- style = MaterialTheme.typography.body2,
- color = Color.Green,
- textAlign = TextAlign.Center
- )
- Text(
- modifier = Modifier.testTag("drawCount"),
- text = stringResource(id = R.string.draw_count_label, drawCount),
- style = MaterialTheme.typography.body2,
- color = Color.Green,
- textAlign = TextAlign.Center
- )
- }
-}
-
-/**
- * If the screen requires burn-in protection, items must be shifted around periodically
- * in ambient mode. To ensure that content isn't shifted off the screen, avoid placing
- * content within 10 pixels of the edge of the screen.
- *
- * Activities should also avoid solid white areas to prevent pixel burn-in. Both of
- * these requirements only apply in ambient mode, and only when
- * [AmbientState.Ambient.doBurnInProtection] is set to true.
- */
-private fun Modifier.ambientMode(
- ambientStateUpdate: AmbientStateUpdate
-): Modifier = composed {
- val translationX = rememberBurnInTranslation(ambientStateUpdate)
- val translationY = rememberBurnInTranslation(ambientStateUpdate)
-
- this
- .graphicsLayer {
- this.translationX = translationX
- this.translationY = translationY
- }.ambientGray(ambientStateUpdate.ambientState)
-}
-
-@Composable
-private fun rememberBurnInTranslation(
- ambientStateUpdate: AmbientStateUpdate
-): Float =
- remember(ambientStateUpdate) {
- when (val state = ambientStateUpdate.ambientState) {
- AmbientState.Interactive -> 0f
- is AmbientState.Ambient -> if (state.ambientDetails?.burnInProtectionRequired == true) {
- Random.nextInt(-BURN_IN_OFFSET_PX, BURN_IN_OFFSET_PX + 1).toFloat()
- } else {
- 0f
- }
- }
- }
-
-private val grayscale = Paint().apply {
- colorFilter = ColorFilter.colorMatrix(
- ColorMatrix().apply {
- setToSaturation(0f)
- }
- )
- isAntiAlias = false
-}
-
-internal fun Modifier.ambientGray(ambientState: AmbientState): Modifier =
- if (ambientState is AmbientState.Ambient) {
- graphicsLayer {
- scaleX = 0.9f
- scaleY = 0.9f
- }.drawWithContent {
- drawIntoCanvas {
- it.withSaveLayer(size.toRect(), grayscale) {
- drawContent()
- }
- }
- }
- } else {
- this
- }
-
-@WearPreviewSmallRound
-@Composable
-fun AlwaysOnScreenInteractivePreview() {
- MaterialTheme {
- AlwaysOnScreen(
- ambientStateUpdate = AmbientStateUpdate(AmbientState.Interactive),
- drawCount = 4,
- currentInstant = Instant.now(),
- currentTime = LocalTime.now()
- )
- }
-}
-
-@WearPreviewSmallRound
-@Composable
-fun AlwaysOnScreenAmbientPreview() {
- MaterialTheme {
- AlwaysOnScreen(
- ambientStateUpdate = AmbientStateUpdate(
- AmbientState.Ambient(
- AmbientLifecycleObserver.AmbientDetails(
- burnInProtectionRequired = true,
- deviceHasLowBitAmbient = true
- )
- ),
- changeTimeMillis = System.currentTimeMillis()
- ),
- drawCount = 4,
- currentInstant = Instant.now(),
- currentTime = LocalTime.now()
- )
- }
-}
diff --git a/AlwaysOnKotlin/compose/src/main/java/com/example/android/wearable/wear/alwayson/MainActivity.kt b/AlwaysOnKotlin/compose/src/main/java/com/example/android/wearable/wear/alwayson/MainActivity.kt
deleted file mode 100644
index c7e563f79..000000000
--- a/AlwaysOnKotlin/compose/src/main/java/com/example/android/wearable/wear/alwayson/MainActivity.kt
+++ /dev/null
@@ -1,92 +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
- *
- * https://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 com.example.android.wearable.wear.alwayson
-
-import android.os.Bundle
-import androidx.activity.ComponentActivity
-import androidx.activity.compose.setContent
-import androidx.annotation.VisibleForTesting
-import com.google.android.horologist.compose.ambient.AmbientAware
-import java.time.Clock
-import kotlinx.coroutines.CoroutineDispatcher
-import kotlinx.coroutines.Dispatchers
-
-/**
- * The [Clock] driving the time information. Overridable only for testing.
- */
-@VisibleForTesting(otherwise = VisibleForTesting.PRIVATE)
-internal var clock: Clock = Clock.systemDefaultZone()
-
-/**
- * The dispatcher used for delaying in active mode. Overridable only for testing.
- */
-@VisibleForTesting(otherwise = VisibleForTesting.PRIVATE)
-internal var activeDispatcher: CoroutineDispatcher = Dispatchers.Main.immediate
-
-/**
- * IMPORTANT NOTE: Most apps shouldn't use always on ambient mode, as it drains battery life. Unless
- * required, it's much better to allow the system to take over after the user stops interacting
- * with your app.
- *
- * Demonstrates support for *Ambient Mode* by attaching ambient mode support to the activity,
- * and listening for ambient mode updates (onEnterAmbient, onUpdateAmbient, and onExitAmbient) via a
- * named AmbientCallback subclass.
- *
- * Also demonstrates how to update the display more frequently than every 60 seconds, which is
- * the default frequency, using an AlarmManager. The Alarm code is only necessary for the custom
- * refresh frequency; it can be ignored for basic ambient mode support where you can simply rely on
- * calls to onUpdateAmbient() by the system.
- *
- * There are two modes: *ambient* and *active*. To trigger future display updates, we
- * use coroutines for active mode and an Alarm for ambient mode.
- *
- * Why not use just one or the other? Coroutines are generally less battery intensive and can be
- * triggered every second. However, they can not wake up the processor (common in ambient mode).
- *
- * Alarms can wake up the processor (what we need for ambient mode), but they are less efficient
- * compared to coroutines when it comes to quick update frequencies.
- *
- * Therefore, we use coroutines for active mode (can trigger every second and are better on the
- * battery), and we use an Alarm for ambient mode (only need to update once every 10 seconds and
- * they can wake up a sleeping processor).
- *
- * The activity waits 10 seconds between doing any processing (getting data, updating display
- * etc.) while in ambient mode to conserving battery life (processor allowed to sleep). If your app
- * can wait 60 seconds for display updates, you can disregard the Alarm code and simply use
- * onUpdateAmbient() to save even more battery life.
- *
- * As always, you will still want to apply the performance guidelines outlined in the Watch Faces
- * documentation to your app.
- *
- * Finally, in ambient mode, this activity follows the same best practices outlined in the Watch
- * Faces API documentation: keeping most pixels black, avoiding large blocks of white pixels, using
- * only black and white, disabling anti-aliasing, etc.
- */
-class MainActivity : ComponentActivity() {
- public override fun onCreate(savedInstanceState: Bundle?) {
- super.onCreate(savedInstanceState)
-
- setContent {
- AmbientAware {
- AlwaysOnApp(
- ambientStateUpdate = it,
- clock = clock,
- activeDispatcher = activeDispatcher
- )
- }
- }
- }
-}
diff --git a/AlwaysOnKotlin/compose/src/main/res/mipmap-hdpi/ic_launcher.png b/AlwaysOnKotlin/compose/src/main/res/mipmap-hdpi/ic_launcher.png
deleted file mode 100644
index cde69bccc..000000000
Binary files a/AlwaysOnKotlin/compose/src/main/res/mipmap-hdpi/ic_launcher.png and /dev/null differ
diff --git a/AlwaysOnKotlin/compose/src/main/res/mipmap-mdpi/ic_launcher.png b/AlwaysOnKotlin/compose/src/main/res/mipmap-mdpi/ic_launcher.png
deleted file mode 100644
index c133a0cbd..000000000
Binary files a/AlwaysOnKotlin/compose/src/main/res/mipmap-mdpi/ic_launcher.png and /dev/null differ
diff --git a/AlwaysOnKotlin/compose/src/main/res/mipmap-xhdpi/ic_launcher.png b/AlwaysOnKotlin/compose/src/main/res/mipmap-xhdpi/ic_launcher.png
deleted file mode 100644
index bfa42f0e7..000000000
Binary files a/AlwaysOnKotlin/compose/src/main/res/mipmap-xhdpi/ic_launcher.png and /dev/null differ
diff --git a/AlwaysOnKotlin/compose/src/main/res/mipmap-xxhdpi/ic_launcher.png b/AlwaysOnKotlin/compose/src/main/res/mipmap-xxhdpi/ic_launcher.png
deleted file mode 100644
index 324e72cdd..000000000
Binary files a/AlwaysOnKotlin/compose/src/main/res/mipmap-xxhdpi/ic_launcher.png and /dev/null differ
diff --git a/AlwaysOnKotlin/compose/src/main/res/values/strings.xml b/AlwaysOnKotlin/compose/src/main/res/values/strings.xml
deleted file mode 100644
index 13b74f7e1..000000000
--- a/AlwaysOnKotlin/compose/src/main/res/values/strings.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
- Always On Example
- Timestamp: %1$d
- Active Mode (Coroutines)
- Ambient Mode (Alarm)
- Update rate: %1$d sec
- Draw count: %1$d
-
diff --git a/AlwaysOnKotlin/compose/src/test/java/com/example/android/wearable/wear/alwayson/AlwaysOnUnitTests.kt b/AlwaysOnKotlin/compose/src/test/java/com/example/android/wearable/wear/alwayson/AlwaysOnUnitTests.kt
deleted file mode 100644
index 87793fc93..000000000
--- a/AlwaysOnKotlin/compose/src/test/java/com/example/android/wearable/wear/alwayson/AlwaysOnUnitTests.kt
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * Copyright 2024 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
- *
- * https://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 com.example.android.wearable.wear.alwayson
-
-import org.junit.Test
-
-class AlwaysOnUnitTests {
-
- @Test
- fun emptyTest() {
- }
-}
diff --git a/AlwaysOnKotlin/gradle.properties b/AlwaysOnKotlin/gradle.properties
deleted file mode 100644
index e6c7538b3..000000000
--- a/AlwaysOnKotlin/gradle.properties
+++ /dev/null
@@ -1,8 +0,0 @@
-org.gradle.jvmargs=-Xmx2048m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
-android.enableJetifier=true
-android.useAndroidX=true
-android.sdk.channel=3
-android.experimental.testOptions.managedDevices.customDevice=true
-android.experimental.testOptions.managedDevices.maxConcurrentDevices=1
-android.experimental.testOptions.managedDevices.setupTimeoutMinutes=180
-android.testoptions.manageddevices.emulator.gpu=swiftshader_indirect
diff --git a/AlwaysOnKotlin/gradle/libs.versions.toml b/AlwaysOnKotlin/gradle/libs.versions.toml
deleted file mode 100644
index 07e6556c2..000000000
--- a/AlwaysOnKotlin/gradle/libs.versions.toml
+++ /dev/null
@@ -1,51 +0,0 @@
-[versions]
-android-gradle-plugin = "8.4.0"
-androidx-activity = "1.9.0"
-androidx-compose-bom = "2024.05.00"
-androidx-lifecycle = "2.7.0"
-androidx-wear-compose = "1.3.1"
-compose-compiler = "1.5.12"
-compose-ui-tooling = "1.3.1"
-horologist-compose-layout = "0.5.27"
-ktlint = "0.50.0"
-org-jetbrains-kotlin = "1.9.23"
-org-jetbrains-kotlinx = "1.8.0"
-wearable = "2.9.0"
-
-[libraries]
-androidx-activity-compose = { module = "androidx.activity:activity-compose", version.ref = "androidx-activity" }
-androidx-activity-ktx = { module = "androidx.activity:activity-ktx", version.ref = "androidx-activity" }
-androidx-compose-ui-tooling = { module = "androidx.wear.compose:compose-ui-tooling", version.ref = "compose-ui-tooling" }
-androidx-core-ktx = "androidx.core:core-ktx:1.13.1"
-androidx-compose-bom = { group = "androidx.compose", name = "compose-bom", version.ref = "androidx-compose-bom" }
-androidx-lifecycle-runtime-ktx = { module = "androidx.lifecycle:lifecycle-runtime-ktx", version.ref = "androidx-lifecycle" }
-androidx-wear = "androidx.wear:wear:1.3.0"
-androidx-window = "androidx.window:window:1.2.0"
-com-google-truth = "com.google.truth:truth:1.4.2"
-compose-compiler = { module = "androidx.compose.compiler:compiler", version.ref = "compose-compiler" }
-compose-ui = { module = "androidx.compose.ui:ui" }
-compose-ui-test-junit4 = { module = "androidx.compose.ui:ui-test-junit4" }
-compose-ui-test-manifest = { module = "androidx.compose.ui:ui-test-manifest" }
-compose-ui-tooling = { module = "androidx.compose.ui:ui-tooling" }
-horologist-compose-layout = { module = "com.google.android.horologist:horologist-compose-layout", version.ref = "horologist-compose-layout" }
-kotlin-gradle-plugin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "org-jetbrains-kotlin" }
-kotlinx-coroutines-android = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-android", version.ref = "org-jetbrains-kotlinx" }
-kotlinx-coroutines-test = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-test", version.ref = "org-jetbrains-kotlinx" }
-test-core = "androidx.test:core:1.5.0"
-test-core-ktx = "androidx.test:core-ktx:1.5.0"
-test-espresso-core = "androidx.test.espresso:espresso-core:3.5.1"
-test-ext-junit = "androidx.test.ext:junit:1.1.5"
-test-ext-junit-ktx = "androidx.test.ext:junit-ktx:1.1.5"
-test-ext-truth = "androidx.test.ext:truth:1.5.0"
-test-rules = "androidx.test:rules:1.5.0"
-test-runner = "androidx.test:runner:1.5.2"
-test-uiautomator = "androidx.test.uiautomator:uiautomator:2.3.0"
-wear-compose-foundation = { module = "androidx.wear.compose:compose-foundation", version.ref = "androidx-wear-compose" }
-wear-compose-material = { module = "androidx.wear.compose:compose-material", version.ref = "androidx-wear-compose" }
-wearable = { module = "com.google.android.wearable:wearable", version.ref = "wearable" }
-desugar-jdk-libs = "com.android.tools:desugar_jdk_libs:2.0.4"
-
-[plugins]
-com-android-application = { id = "com.android.application", version.ref = "android-gradle-plugin" }
-com-diffplug-spotless = "com.diffplug.spotless:6.25.0"
-firebase-testlab = "com.google.firebase.testlab:0.0.1-alpha06"
diff --git a/AlwaysOnKotlin/gradle/wrapper/gradle-wrapper.jar b/AlwaysOnKotlin/gradle/wrapper/gradle-wrapper.jar
deleted file mode 100644
index e6441136f..000000000
Binary files a/AlwaysOnKotlin/gradle/wrapper/gradle-wrapper.jar and /dev/null differ
diff --git a/AlwaysOnKotlin/gradle/wrapper/gradle-wrapper.properties b/AlwaysOnKotlin/gradle/wrapper/gradle-wrapper.properties
deleted file mode 100644
index e7646dead..000000000
--- a/AlwaysOnKotlin/gradle/wrapper/gradle-wrapper.properties
+++ /dev/null
@@ -1,7 +0,0 @@
-distributionBase=GRADLE_USER_HOME
-distributionPath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip
-networkTimeout=10000
-validateDistributionUrl=true
-zipStoreBase=GRADLE_USER_HOME
-zipStorePath=wrapper/dists
diff --git a/AlwaysOnKotlin/gradlew b/AlwaysOnKotlin/gradlew
deleted file mode 100755
index 1aa94a426..000000000
--- a/AlwaysOnKotlin/gradlew
+++ /dev/null
@@ -1,249 +0,0 @@
-#!/bin/sh
-
-#
-# Copyright © 2015-2021 the original authors.
-#
-# 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
-#
-# https://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.
-#
-
-##############################################################################
-#
-# Gradle start up script for POSIX generated by Gradle.
-#
-# Important for running:
-#
-# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
-# noncompliant, but you have some other compliant shell such as ksh or
-# bash, then to run this script, type that shell name before the whole
-# command line, like:
-#
-# ksh Gradle
-#
-# Busybox and similar reduced shells will NOT work, because this script
-# requires all of these POSIX shell features:
-# * functions;
-# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
-# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
-# * compound commands having a testable exit status, especially «case»;
-# * various built-in commands including «command», «set», and «ulimit».
-#
-# Important for patching:
-#
-# (2) This script targets any POSIX shell, so it avoids extensions provided
-# by Bash, Ksh, etc; in particular arrays are avoided.
-#
-# The "traditional" practice of packing multiple parameters into a
-# space-separated string is a well documented source of bugs and security
-# problems, so this is (mostly) avoided, by progressively accumulating
-# options in "$@", and eventually passing that to Java.
-#
-# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
-# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
-# see the in-line comments for details.
-#
-# There are tweaks for specific operating systems such as AIX, CygWin,
-# Darwin, MinGW, and NonStop.
-#
-# (3) This script is generated from the Groovy template
-# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
-# within the Gradle project.
-#
-# You can find Gradle at https://github.com/gradle/gradle/.
-#
-##############################################################################
-
-# Attempt to set APP_HOME
-
-# Resolve links: $0 may be a link
-app_path=$0
-
-# Need this for daisy-chained symlinks.
-while
- APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
- [ -h "$app_path" ]
-do
- ls=$( ls -ld "$app_path" )
- link=${ls#*' -> '}
- case $link in #(
- /*) app_path=$link ;; #(
- *) app_path=$APP_HOME$link ;;
- esac
-done
-
-# This is normally unused
-# shellcheck disable=SC2034
-APP_BASE_NAME=${0##*/}
-# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
-APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
-
-# Use the maximum available, or set MAX_FD != -1 to use that value.
-MAX_FD=maximum
-
-warn () {
- echo "$*"
-} >&2
-
-die () {
- echo
- echo "$*"
- echo
- exit 1
-} >&2
-
-# OS specific support (must be 'true' or 'false').
-cygwin=false
-msys=false
-darwin=false
-nonstop=false
-case "$( uname )" in #(
- CYGWIN* ) cygwin=true ;; #(
- Darwin* ) darwin=true ;; #(
- MSYS* | MINGW* ) msys=true ;; #(
- NONSTOP* ) nonstop=true ;;
-esac
-
-CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
-
-
-# Determine the Java command to use to start the JVM.
-if [ -n "$JAVA_HOME" ] ; then
- if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
- # IBM's JDK on AIX uses strange locations for the executables
- JAVACMD=$JAVA_HOME/jre/sh/java
- else
- JAVACMD=$JAVA_HOME/bin/java
- fi
- if [ ! -x "$JAVACMD" ] ; then
- die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
-
-Please set the JAVA_HOME variable in your environment to match the
-location of your Java installation."
- fi
-else
- JAVACMD=java
- if ! command -v java >/dev/null 2>&1
- then
- die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
-
-Please set the JAVA_HOME variable in your environment to match the
-location of your Java installation."
- fi
-fi
-
-# Increase the maximum file descriptors if we can.
-if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
- case $MAX_FD in #(
- max*)
- # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
- # shellcheck disable=SC2039,SC3045
- MAX_FD=$( ulimit -H -n ) ||
- warn "Could not query maximum file descriptor limit"
- esac
- case $MAX_FD in #(
- '' | soft) :;; #(
- *)
- # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
- # shellcheck disable=SC2039,SC3045
- ulimit -n "$MAX_FD" ||
- warn "Could not set maximum file descriptor limit to $MAX_FD"
- esac
-fi
-
-# Collect all arguments for the java command, stacking in reverse order:
-# * args from the command line
-# * the main class name
-# * -classpath
-# * -D...appname settings
-# * --module-path (only if needed)
-# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
-
-# For Cygwin or MSYS, switch paths to Windows format before running java
-if "$cygwin" || "$msys" ; then
- APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
- CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
-
- JAVACMD=$( cygpath --unix "$JAVACMD" )
-
- # Now convert the arguments - kludge to limit ourselves to /bin/sh
- for arg do
- if
- case $arg in #(
- -*) false ;; # don't mess with options #(
- /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
- [ -e "$t" ] ;; #(
- *) false ;;
- esac
- then
- arg=$( cygpath --path --ignore --mixed "$arg" )
- fi
- # Roll the args list around exactly as many times as the number of
- # args, so each arg winds up back in the position where it started, but
- # possibly modified.
- #
- # NB: a `for` loop captures its iteration list before it begins, so
- # changing the positional parameters here affects neither the number of
- # iterations, nor the values presented in `arg`.
- shift # remove old arg
- set -- "$@" "$arg" # push replacement arg
- done
-fi
-
-
-# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
-DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
-
-# Collect all arguments for the java command:
-# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
-# and any embedded shellness will be escaped.
-# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
-# treated as '${Hostname}' itself on the command line.
-
-set -- \
- "-Dorg.gradle.appname=$APP_BASE_NAME" \
- -classpath "$CLASSPATH" \
- org.gradle.wrapper.GradleWrapperMain \
- "$@"
-
-# Stop when "xargs" is not available.
-if ! command -v xargs >/dev/null 2>&1
-then
- die "xargs is not available"
-fi
-
-# Use "xargs" to parse quoted args.
-#
-# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
-#
-# In Bash we could simply go:
-#
-# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
-# set -- "${ARGS[@]}" "$@"
-#
-# but POSIX shell has neither arrays nor command substitution, so instead we
-# post-process each arg (as a line of input to sed) to backslash-escape any
-# character that might be a shell metacharacter, then use eval to reverse
-# that process (while maintaining the separation between arguments), and wrap
-# the whole thing up as a single "set" statement.
-#
-# This will of course break if any of these variables contains a newline or
-# an unmatched quote.
-#
-
-eval "set -- $(
- printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
- xargs -n1 |
- sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
- tr '\n' ' '
- )" '"$@"'
-
-exec "$JAVACMD" "$@"
diff --git a/AlwaysOnKotlin/gradlew.bat b/AlwaysOnKotlin/gradlew.bat
deleted file mode 100644
index 7101f8e46..000000000
--- a/AlwaysOnKotlin/gradlew.bat
+++ /dev/null
@@ -1,92 +0,0 @@
-@rem
-@rem Copyright 2015 the original author or authors.
-@rem
-@rem Licensed under the Apache License, Version 2.0 (the "License");
-@rem you may not use this file except in compliance with the License.
-@rem You may obtain a copy of the License at
-@rem
-@rem https://www.apache.org/licenses/LICENSE-2.0
-@rem
-@rem Unless required by applicable law or agreed to in writing, software
-@rem distributed under the License is distributed on an "AS IS" BASIS,
-@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-@rem See the License for the specific language governing permissions and
-@rem limitations under the License.
-@rem
-
-@if "%DEBUG%"=="" @echo off
-@rem ##########################################################################
-@rem
-@rem Gradle startup script for Windows
-@rem
-@rem ##########################################################################
-
-@rem Set local scope for the variables with windows NT shell
-if "%OS%"=="Windows_NT" setlocal
-
-set DIRNAME=%~dp0
-if "%DIRNAME%"=="" set DIRNAME=.
-@rem This is normally unused
-set APP_BASE_NAME=%~n0
-set APP_HOME=%DIRNAME%
-
-@rem Resolve any "." and ".." in APP_HOME to make it shorter.
-for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
-
-@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
-set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
-
-@rem Find java.exe
-if defined JAVA_HOME goto findJavaFromJavaHome
-
-set JAVA_EXE=java.exe
-%JAVA_EXE% -version >NUL 2>&1
-if %ERRORLEVEL% equ 0 goto execute
-
-echo. 1>&2
-echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
-echo. 1>&2
-echo Please set the JAVA_HOME variable in your environment to match the 1>&2
-echo location of your Java installation. 1>&2
-
-goto fail
-
-:findJavaFromJavaHome
-set JAVA_HOME=%JAVA_HOME:"=%
-set JAVA_EXE=%JAVA_HOME%/bin/java.exe
-
-if exist "%JAVA_EXE%" goto execute
-
-echo. 1>&2
-echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
-echo. 1>&2
-echo Please set the JAVA_HOME variable in your environment to match the 1>&2
-echo location of your Java installation. 1>&2
-
-goto fail
-
-:execute
-@rem Setup the command line
-
-set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
-
-
-@rem Execute Gradle
-"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
-
-:end
-@rem End local scope for the variables with windows NT shell
-if %ERRORLEVEL% equ 0 goto mainEnd
-
-:fail
-rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
-rem the _cmd.exe /c_ return code!
-set EXIT_CODE=%ERRORLEVEL%
-if %EXIT_CODE% equ 0 set EXIT_CODE=1
-if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
-exit /b %EXIT_CODE%
-
-:mainEnd
-if "%OS%"=="Windows_NT" endlocal
-
-:omega
diff --git a/AlwaysOnKotlin/lint.xml b/AlwaysOnKotlin/lint.xml
deleted file mode 100644
index 332a3dfdd..000000000
--- a/AlwaysOnKotlin/lint.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
diff --git a/AlwaysOnKotlin/screenshots/1-main-active.png b/AlwaysOnKotlin/screenshots/1-main-active.png
deleted file mode 100644
index 75aa2702b..000000000
Binary files a/AlwaysOnKotlin/screenshots/1-main-active.png and /dev/null differ
diff --git a/AlwaysOnKotlin/screenshots/2-main-ambient.png b/AlwaysOnKotlin/screenshots/2-main-ambient.png
deleted file mode 100644
index fbdeedb71..000000000
Binary files a/AlwaysOnKotlin/screenshots/2-main-ambient.png and /dev/null differ
diff --git a/AlwaysOnKotlin/screenshots/3-main-active-round.png b/AlwaysOnKotlin/screenshots/3-main-active-round.png
deleted file mode 100644
index 7b226e03d..000000000
Binary files a/AlwaysOnKotlin/screenshots/3-main-active-round.png and /dev/null differ
diff --git a/AlwaysOnKotlin/screenshots/4-main-ambient-round.png b/AlwaysOnKotlin/screenshots/4-main-ambient-round.png
deleted file mode 100644
index be04c4db4..000000000
Binary files a/AlwaysOnKotlin/screenshots/4-main-ambient-round.png and /dev/null differ
diff --git a/AlwaysOnKotlin/settings.gradle b/AlwaysOnKotlin/settings.gradle
deleted file mode 100644
index 0d4465d5e..000000000
--- a/AlwaysOnKotlin/settings.gradle
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * 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.
- */
-
-pluginManagement {
- repositories {
- gradlePluginPortal()
- google()
- mavenCentral()
- }
-}
-
-// https://docs.gradle.org/7.4/userguide/declaring_dependencies.html#sec:type-safe-project-accessors
-enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS")
-
-dependencyResolutionManagement {
- repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
- repositories {
- google()
- mavenCentral()
- }
-}
-
-
-
-include ":compose"
diff --git a/README.md b/README.md
index bd10e0bc2..97c99b1c9 100644
--- a/README.md
+++ b/README.md
@@ -9,8 +9,6 @@ Read below for a description of each sample.
Samples
----------
-* **[AlwaysOnKotlin](AlwaysOnKotlin)** (Compose/Kotlin) - Demonstrates keeping the app visible in ambient mode. Note: While this is valuable for some specific use cases, most use cases won't need this, because when the watch goes into ambient mode (and shows watch face), if the user interacts with the watch again within several minutes, it will bring the app back up when it transitions out of ambient mode. [Guide](https://developer.android.com/training/wearables/apps/always-on)
-
* **[ComposeStarter](ComposeStarter)** (Compose/Kotlin) - Demonstrates simple Compose for Wear OS app devs can use as a starting point for their own Compose app.
* **[DataLayer](DataLayer)** (Compose/Kotlin) - Demonstrates communicating via the data layer between the watch and the phone. [Guide](https://developer.android.com/training/wearables/data-layer)