Réparer l'application pour android < 8
This commit is contained in:
parent
bfb0764d82
commit
8af9c9acbd
|
@ -54,8 +54,6 @@
|
|||
</receiver>
|
||||
|
||||
<receiver android:name=".messages.NornMMSReceiver"
|
||||
android:enabled="true"
|
||||
android:exported="true"
|
||||
android:permission="android.permission.BROADCAST_WAP_PUSH">
|
||||
<intent-filter android:priority="999">
|
||||
<action android:name="android.provider.Telephony.WAP_PUSH_DELIVER" />
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
package xyz.johnny.norntalk
|
||||
|
||||
import android.Manifest
|
||||
import android.annotation.SuppressLint
|
||||
import android.content.Intent
|
||||
import android.content.pm.PackageManager
|
||||
import android.os.AsyncTask
|
||||
import android.os.Build
|
||||
import android.os.Bundle
|
||||
import android.support.v4.app.ActivityCompat
|
||||
import android.support.v4.content.ContextCompat
|
||||
|
@ -60,7 +60,10 @@ class SplashActivity : AppCompatActivity() {
|
|||
val tasks = arrayOf(
|
||||
LoadHelper { Security.random },
|
||||
LoadHelper { Security.curve },
|
||||
LoadHelper { NornNotification.createChannel(this) },
|
||||
LoadHelper { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
NornNotification.createChannel(this)
|
||||
}
|
||||
},
|
||||
LoadHelper { NornDatabase.getNornDatabase(this) },
|
||||
LoadHelper { Security.barcodeEncoder.encodeBitmap("a", BarcodeFormat.QR_CODE, 512, 512).recycle() }
|
||||
)
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
package xyz.johnny.norntalk.messages
|
||||
|
||||
import android.content.BroadcastReceiver
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.util.Log
|
||||
import com.klinker.android.send_message.MmsReceivedReceiver
|
||||
|
||||
/**
|
||||
* Classe recevant les MMS.
|
||||
*/
|
||||
class NornMMSReceiver: MmsReceivedReceiver() {
|
||||
class NornMMSReceiver: BroadcastReceiver() {
|
||||
|
||||
override fun onReceive(context: Context, intent: Intent?) {
|
||||
override fun onReceive(context: Context, intent: Intent) {
|
||||
Log.d(this::class.java.simpleName, "MMS received")
|
||||
}
|
||||
|
||||
|
|
|
@ -9,8 +9,10 @@ import android.content.Context
|
|||
import android.content.Intent
|
||||
import android.os.Build
|
||||
import android.preference.PreferenceManager
|
||||
import android.support.annotation.RequiresApi
|
||||
import android.support.v4.app.NotificationCompat
|
||||
import android.support.v4.app.RemoteInput
|
||||
import android.util.Log
|
||||
import android.util.SparseArray
|
||||
import android.widget.Toast
|
||||
import xyz.johnny.norntalk.ConversationActivity
|
||||
|
@ -49,7 +51,7 @@ class NornNotification private constructor(val conversationId: Int, val context:
|
|||
|
||||
private const val channelId = "messages"
|
||||
|
||||
@TargetApi(Build.VERSION_CODES.O)
|
||||
@RequiresApi(Build.VERSION_CODES.O)
|
||||
fun updateChannel(context: Context) {
|
||||
if (this._channelMessages == null) {
|
||||
createChannel(context)
|
||||
|
@ -63,7 +65,7 @@ class NornNotification private constructor(val conversationId: Int, val context:
|
|||
}
|
||||
}
|
||||
|
||||
@TargetApi(Build.VERSION_CODES.O)
|
||||
@RequiresApi(Build.VERSION_CODES.O)
|
||||
/**
|
||||
* Crée la chaîne de notification sur Android O
|
||||
*
|
||||
|
@ -91,6 +93,7 @@ class NornNotification private constructor(val conversationId: Int, val context:
|
|||
* @param context Contexte courant
|
||||
*/
|
||||
fun getBuilder(context: Context): NotificationCompat.Builder {
|
||||
Log.d(this::class.java.simpleName, "build: %d %d".format(Build.VERSION.SDK_INT, Build.VERSION_CODES.O))
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O)
|
||||
createChannel(context)
|
||||
|
||||
|
|
Loading…
Reference in a new issue