Skip to content
Open
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
4 changes: 4 additions & 0 deletions firebase-sessions/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@
<!--<uses-sdk android:minSdkVersion="21"/>-->

<application>
<service
android:name="com.google.firebase.sessions.SessionLifecycleService"
android:enabled="false"
android:exported="false" />
<service
android:exported="false"
android:name="com.google.firebase.components.ComponentDiscoveryService">
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package com.google.firebase.sessions

import android.app.Service
import android.content.Intent
import android.os.IBinder
import android.util.Log

internal class SessionLifecycleService : Service() {

override fun onBind(p0: Intent?): IBinder? {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The parameter p0 in the onBind method is unused. According to Kotlin coding conventions, it's idiomatic to name unused parameters with an underscore (_) to improve code clarity and explicitly mark them as unused.1

Suggested change
override fun onBind(p0: Intent?): IBinder? {
override fun onBind(_: Intent?): IBinder? {

Style Guide References

Footnotes

  1. The official Kotlin style guide suggests using an underscore for lambda parameters that are not used. This practice is widely extended to any unused function or method parameter to signal that it is intentionally ignored.

Log.d(TAG, "Service bound no-op")
return null
}

internal companion object {
const val TAG = "SessionLifecycleService"

}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This file is missing a newline at the end. It's a widely-accepted convention to end files with a single newline character. This prevents issues with certain tools and version control systems, and ensures file content is handled consistently.1

Suggested change
}
}

Style Guide References

Footnotes

  1. Many style guides and POSIX standards recommend that all text files end with a newline character. This ensures proper handling by various command-line tools and prevents unexpected behavior during file processing or concatenation.