1616
1717package com.example.wear.snippets.alwayson
1818
19- import android.app.Notification
2019import android.app.NotificationChannel
2120import android.app.NotificationManager
2221import android.app.PendingIntent
@@ -30,7 +29,6 @@ import androidx.lifecycle.LifecycleService
3029import androidx.wear.ongoing.OngoingActivity
3130import androidx.wear.ongoing.Status
3231import com.example.wear.R
33- import java.util.concurrent.TimeUnit
3432
3533class AlwaysOnService : LifecycleService () {
3634
@@ -94,7 +92,7 @@ class AlwaysOnService : LifecycleService() {
9492 }
9593
9694 // Creates an ongoing activity that demonstrates how to link the touch intent to the always-on activity.
97- private fun createNotification1 (): Unit {
95+ private fun createNotification1 () {
9896 // [START android_wear_ongoing_activity_create_notification]
9997 val activityIntent =
10098 Intent (this , AlwaysOnActivity ::class .java).apply {
@@ -146,7 +144,7 @@ class AlwaysOnService : LifecycleService() {
146144 }
147145
148146 // Creates an ongoing activity with a static status text
149- private fun createNotification2 (): Unit {
147+ private fun createNotification2 () {
150148
151149 // [START android_wear_ongoing_activity_notification_builder]
152150 // Create a PendingIntent to pass to the notification builder
@@ -193,7 +191,7 @@ class AlwaysOnService : LifecycleService() {
193191 }
194192
195193 // Creates an ongoing activity that demonstrates dynamic status text (a timer)
196- private fun createNotification3 (): Unit {
194+ private fun createNotification3 () {
197195 val activityIntent =
198196 Intent (this , AlwaysOnActivity ::class .java).apply {
199197 flags = Intent .FLAG_ACTIVITY_SINGLE_TOP
@@ -250,7 +248,5 @@ class AlwaysOnService : LifecycleService() {
250248
251249 ongoingActivity.apply (applicationContext)
252250 startForeground(NOTIFICATION_ID , notificationBuilder.build())
253-
254251 }
255-
256252}
0 commit comments