Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ private const val PIXEL_WRIST_AUTOLOCK_SETTING_STATE = "wrist_detection_auto_loc

// [START android_wear_auth_wrist_detection]
fun isWristDetectionAutoLockingEnabled(context: Context): Boolean {
// [END android_wear_auth_wrist_detection]
// Use the keyguard manager to check for the presence of a lock mechanism
val keyguardManager = context.getSystemService<KeyguardManager>()
val isSecured = keyguardManager?.isDeviceSecure == true
Expand All @@ -37,3 +36,4 @@ fun isWristDetectionAutoLockingEnabled(context: Context): Boolean {

return isSecured && isWristDetectionOn
}
// [END android_wear_auth_wrist_detection]
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,16 @@ class AuthDataListenerService : WearableListenerService() {
.getString("token")
// Display an interstitial screen to notify the user that they're being signed
// in. Then, store the token and use it in network requests.
// [END android_wear_datalayer_auth_token_sharing_listener]
handleSignInSequence(token)
}
}
}
}

/** placeholder sign in handler. */
fun handleSignInSequence(token: String?) {}
}
// [END android_wear_datalayer_auth_token_sharing_listener]

// [START android_wear_datalayer_ondatachangedlisteneer]
class MainActivity : Activity(), DataClient.OnDataChangedListener {
Expand Down
Loading