package com.secspace.sms.util

import android.content.Context
import android.net.Uri
import android.os.Bundle


data object SmsCountUtil {

    //https://developer.honor.com/cn/forum/topicdetail/topicid-3540765949296640
     fun setBadgeNum(mContext : Context,num: Int) {
        try {
            val bunlde = Bundle()
            bunlde.putString("package", "com.secspace.sms") // com.test.badge is your package name
            bunlde.putString("class", "com.secspace.sms.activities.SplashActivity.Orange") // com.test. badge.MainActivity is your apk main activity
            bunlde.putInt("badgenumber", num)
            mContext.contentResolver.call(Uri.parse("content://com.hihonor.android.launcher.settings/badge/"), "change_badge", null, bunlde)
        } catch (e: java.lang.Exception) {
            e.printStackTrace()
        }
    }

}
