srctree

Robin Linden parent 26b3c3d0 e0178672
Give the ReplyReceiver a better name

It now receives more commands than the notification replies.

inlinesplit
atox/src/main/AndroidManifest.xml added: 12, removed: 12, total 0
@@ -27,7 +27,7 @@
</intent-filter>
</receiver>
 
<receiver android:name=".ReplyReceiver"/>
<receiver android:name=".ActionReceiver"/>
 
<provider
android:name="androidx.core.content.FileProvider"
 
atox/src/main/kotlin/ReplyReceiver.kt added: 12, removed: 12, total 0
@@ -16,7 +16,7 @@ const val KEY_TEXT_REPLY = "text_reply"
const val KEY_CALL = "accept_or_reject_call"
const val KEY_CONTACT_PK = "contact_pk"
 
class ReplyReceiver : BroadcastReceiver() {
class ActionReceiver : BroadcastReceiver() {
@Inject
lateinit var callManager: CallManager
 
 
atox/src/main/kotlin/di/AppComponent.kt added: 12, removed: 12, total 0
@@ -4,9 +4,9 @@ import android.content.Context
import dagger.BindsInstance
import dagger.Component
import javax.inject.Singleton
import ltd.evilcorp.atox.ActionReceiver
import ltd.evilcorp.atox.BootReceiver
import ltd.evilcorp.atox.MainActivity
import ltd.evilcorp.atox.ReplyReceiver
import ltd.evilcorp.atox.ToxService
import ltd.evilcorp.core.di.DaoModule
import ltd.evilcorp.core.di.DatabaseModule
@@ -30,5 +30,5 @@ interface AppComponent {
fun inject(activity: MainActivity)
fun inject(service: ToxService)
fun inject(receiver: BootReceiver)
fun inject(receiver: ReplyReceiver)
fun inject(receiver: ActionReceiver)
}
 
atox/src/main/kotlin/ui/NotificationHelper.kt added: 12, removed: 12, total 0
@@ -24,11 +24,11 @@ import com.squareup.picasso.Picasso
import com.squareup.picasso.Transformation
import javax.inject.Inject
import javax.inject.Singleton
import ltd.evilcorp.atox.ActionReceiver
import ltd.evilcorp.atox.KEY_CALL
import ltd.evilcorp.atox.KEY_CONTACT_PK
import ltd.evilcorp.atox.KEY_TEXT_REPLY
import ltd.evilcorp.atox.R
import ltd.evilcorp.atox.ReplyReceiver
import ltd.evilcorp.atox.ui.chat.CONTACT_PUBLIC_KEY
import ltd.evilcorp.core.vo.Contact
import ltd.evilcorp.core.vo.FriendRequest
@@ -111,7 +111,7 @@ class NotificationHelper @Inject constructor(
PendingIntent.getBroadcast(
context,
contact.publicKey.hashCode(),
Intent(context, ReplyReceiver::class.java).putExtra(KEY_CONTACT_PK, contact.publicKey),
Intent(context, ActionReceiver::class.java).putExtra(KEY_CONTACT_PK, contact.publicKey),
PendingIntent.FLAG_UPDATE_CURRENT
)
)
@@ -225,7 +225,7 @@ class NotificationHelper @Inject constructor(
PendingIntent.getBroadcast(
context,
"${c.publicKey}_accept_call".hashCode(),
Intent(context, ReplyReceiver::class.java)
Intent(context, ActionReceiver::class.java)
.putExtra(KEY_CONTACT_PK, c.publicKey)
.putExtra(KEY_CALL, "accept"),
PendingIntent.FLAG_UPDATE_CURRENT
@@ -242,7 +242,7 @@ class NotificationHelper @Inject constructor(
PendingIntent.getBroadcast(
context,
"${c.publicKey}_reject_call".hashCode(),
Intent(context, ReplyReceiver::class.java)
Intent(context, ActionReceiver::class.java)
.putExtra(KEY_CONTACT_PK, c.publicKey)
.putExtra(KEY_CALL, "reject"),
PendingIntent.FLAG_UPDATE_CURRENT