message related enhancements
This commit is contained in:
@@ -319,14 +319,13 @@ class BaresipService: Service() {
|
||||
|
||||
@Keep
|
||||
fun messageEvent(uap: String, peer: String, msg: ByteArray) {
|
||||
Log.d(LOG_TAG, "message event $uap/$peer")
|
||||
var s = "Decoding of message failed!"
|
||||
try {
|
||||
s = String(msg, StandardCharsets.UTF_8)
|
||||
Log.d(LOG_TAG, "UTF-8 $s")
|
||||
} catch (e: Exception) {
|
||||
Log.e(LOG_TAG, "UTF-8 decode failed")
|
||||
}
|
||||
Log.d(LOG_TAG, "Message event $uap/$peer/$s")
|
||||
val timeStamp = System.currentTimeMillis().toString()
|
||||
if (!Utils.isVisible()) {
|
||||
val cnb = NotificationCompat.Builder(this, HIGH_CHANNEL_ID)
|
||||
@@ -383,6 +382,15 @@ class BaresipService: Service() {
|
||||
LocalBroadcastManager.getInstance(this).sendBroadcast(intent)
|
||||
}
|
||||
|
||||
@Keep
|
||||
fun messageResponse(responseCode: Int, time: String) {
|
||||
Log.d(LOG_TAG, "Message response $responseCode at $time")
|
||||
val intent = Intent("message response")
|
||||
intent.putExtra("response code", responseCode)
|
||||
intent.putExtra("time", time)
|
||||
LocalBroadcastManager.getInstance(this).sendBroadcast(intent)
|
||||
}
|
||||
|
||||
private fun updateStatusNotification() {
|
||||
val contentView = RemoteViews(getPackageName(), R.layout.status_notification)
|
||||
for (i: Int in 0 .. 5) {
|
||||
|
||||
Reference in New Issue
Block a user