我的应用程序在AndroidManifest.xml
中添加了<uses-permission android:name="android.permission.WAKE_LOCK" />
。然而,在Oreo设备上,调用获取锁PowerManager.PARTIAL_WAKE_LOCK
会导致应用程序崩溃。
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.myapplication/com.example.myapplication.MainActivity}: java.lang.SecurityException: Neither user 10094 nor current process has android.permission.WAKE_LOCK.