xuexixuexi
xuexixuexi
  • 发布:2024-03-29 19:53
  • 更新:2024-03-29 19:53
  • 阅读:120

安卓代码转native.js

分类:uni-app
private fun isXiaomiBgStartPermissionAllowed(context: Context): Boolean {  
        val ops = context.getSystemService(Context.APP_OPS_SERVICE) as AppOpsManager  
        try {  
            val op = 10021  
            val method: Method = ops.javaClass.getMethod("checkOpNoThrow", Int::class.javaPrimitiveType, Int::class.javaPrimitiveType, String::class.java)  
            val result = method.invoke(ops, op, android.os.Process.myUid(), context.packageName) as Int  
            return result == AppOpsManager.MODE_ALLOWED  
        } catch (e: Exception) {  
            e.printStackTrace()  
        }  
        return false  
    }

这段安卓代码如何转成 native.js ?

请大神帮帮忙看看。

2024-03-29 19:53 负责人:无 分享
已邀请:

要回复问题请先登录注册