WAKE_LOCK
在 AndEngine中给予许可是强制性的吗?如果我尝试删除此WAKE_LOCK
权限,则会收到 SecurityException。
日志错误:
01-28 09:57:48.417: DEBUG/dalvikvm(166): Added shared lib /system/lib/libjni_latinime.so 0x437577d0
01-28 09:59:02.966: ERROR/AndEngine(225): You have to add
01-28 09:59:02.966: ERROR/AndEngine(225): <uses-permission android:name="android.permission.WAKE_LOCK"/>
01-28 09:59:02.966: ERROR/AndEngine(225): to your AndroidManifest.xml !
01-28 09:59:02.966: ERROR/AndEngine(225): java.lang.SecurityException: Neither user 10024 nor current process has android.permission.WAKE_LOCK.
01-28 09:59:02.966: ERROR/AndEngine(225): at android.os.Parcel.readException(Parcel.java:1218)
01-28 09:59:02.966: ERROR/AndEngine(225): at android.os.Parcel.readException(Parcel.java:1206)
01-28 09:59:02.966: ERROR/AndEngine(225): at android.os.IPowerManager$Stub$Proxy.acquireWakeLock(IPowerManager.java:178)
01-28 09:59:02.966: ERROR/AndEngine(225): at android.os.PowerManager$WakeLock.acquire(PowerManager.java:228)
01-28 09:59:02.966: ERROR/AndEngine(225): at org.anddev.andengine.ui.activity.BaseGameActivity.acquireWakeLock(BaseGameActivity.java:200)
01-28 09:59:02.966: ERROR/AndEngine(225): at org.anddev.andengine.ui.activity.BaseGameActivity.doResume(BaseGameActivity.java:166)
01-28 09:59:02.966: ERROR/AndEngine(225): at org.anddev.andengine.ui.activity.BaseGameActivity.onWindowFocusChanged(BaseGameActivity.java:83)
01-28 09:59:02.966: ERROR/AndEngine(225): at com.android.internal.policy.impl.PhoneWindow$DecorView.onWindowFocusChanged(PhoneWindow.java:2027)
01-28 09:59:02.966: ERROR/AndEngine(225): at android.view.View.dispatchWindowFocusChanged(View.java:3694)
01-28 09:59:02.966: ERROR/AndEngine(225): at android.view.ViewGroup.dispatchWindowFocusChanged(ViewGroup.java:655)
01-28 09:59:02.966: ERROR/AndEngine(225): at android.view.ViewRoot.handleMessage(ViewRoot.java:1782)
01-28 09:59:02.966: ERROR/AndEngine(225): at android.os.Handler.dispatchMessage(Handler.java:99)
01-28 09:59:02.966: ERROR/AndEngine(225): at android.os.Looper.loop(Looper.java:123)
01-28 09:59:02.966: ERROR/AndEngine(225): at android.app.ActivityThread.main(ActivityThread.java:4203)
01-28 09:59:02.966: ERROR/AndEngine(225): at java.lang.reflect.Method.invokeNative(Native Method)
01-28 09:59:02.966: ERROR/AndEngine(225): at java.lang.reflect.Method.invoke(Method.java:521)
01-28 09:59:02.966: ERROR/AndEngine(225): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)
01-28 09:59:02.966: ERROR/AndEngine(225): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549)
01-28 09:59:02.966: ERROR/AndEngine(225): at dalvik.system.NativeStart.main(Native Method)