[Galaxy S II Android Development] DualJoe:
I still have occasional sleep/wakeup issues (soft reboots) and bad battery behavior (after fresh install and apps re-installed). Sometimes after rebooting or crash the battery jumps down from 97% to 12% or something (see screenshot. It shows two jumps). I had a defect charger cable so i'm not sure if the hardware is defect (battery is quite new though). It only affects deepsleep. If USB or charger is connected i can turn the screen off or wake up the device without problems. On a crash/soft reboot always the same errors appear (see logcat below). Looks like 'WifiStateMachine' or something. WiFi works properly though.

I'm on XXMS4 baseband and recently Odin-flashed the 3-part firmware (just the 'CODE_I9100XXLSJ.tar'). Not sure if the bootloader is maybe wrong or something.

Currently i'm clueless. I will try CM/MarkoX stock kernel next. If this problem sounds familiar to someone please let me know.

Logcat:

02-03 22:27:53.280 D/SurfaceFlinger(2830): Set power mode=0, type=0 flinger=0xb80e6550
02-03 22:27:54.262 I//sbin/ext/cortexbrain-tune.sh(20758): *** CALL_STATE: 0 ***
02-03 22:27:54.277 I//sbin/ext/cortexbrain-tune.sh(20760): *** ENABLEMASK: sleep ***: done
02-03 22:27:54.291 I//sbin/ext/cortexbrain-tune.sh(20762): *** CENTRAL_CPU_FREQ: standby_freq ***: done
02-03 22:27:54.305 I//sbin/ext/cortexbrain-tune.sh(20763): *** MALI_TIMEOUT: sleep ***
02-03 22:27:54.369 I//sbin/ext/cortexbrain-tune.sh(20772): *** GESTURE ***: sleep
02-03 22:27:54.380 I//sbin/ext/cortexbrain-tune.sh(20777): *** SWAPPINESS: 20 ***
02-03 22:27:54.414 I//sbin/ext/cortexbrain-tune.sh(20781): *** CPU_GOVERNOR: set sleep GOV ondemand ***: done
02-03 22:27:54.449 I//sbin/ext/cortexbrain-tune.sh(20783): *** CENTRAL_CPU_FREQ: sleep_freq ***: done
02-03 22:27:54.526 I//sbin/ext/cortexbrain-tune.sh(20788): *** CPU_GOV_TWEAKS: sleep ***: enabled
02-03 22:27:54.531 I/WifiHAL (4572): Initialized Wifi HAL Successfully; vendor cmd = 103
02-03 22:27:54.531 D/wifi (4572): Did set static halHandle = 0xb7d5aa28
02-03 22:27:54.531 D/wifi (4572): halHandle = 0xb7d5aa28, mVM = 0xb7b1f318, mCls = 0x201982
02-03 22:27:54.532 E/wifi (4572): getStaticLongField sWifiHalHandle 0xa315e83c
02-03 22:27:54.532 E/wifi (4572): error at line 318: android_net_wifi_getInterfaces null interface array
--------- beginning of crash
02-03 22:27:54.549 E/AndroidRuntime(4572): *** FATAL EXCEPTION IN SYSTEM PROCESS: WifiStateMachine
02-03 22:27:54.549 E/AndroidRuntime(4572): java.lang.Exception: android_net_wifi_getInterfaces null interface array
02-03 22:27:54.549 E/AndroidRuntime(4572):	at com.android.server.wifi.WifiNative.getInterfacesNative(Native Method)
02-03 22:27:54.549 E/AndroidRuntime(4572):	at com.android.server.wifi.WifiNative.getInterfaces(WifiNative.java:1222)
02-03 22:27:54.549 E/AndroidRuntime(4572):	at com.android.server.wifi.WifiNative.startHal(WifiNative.java:1200)
02-03 22:27:54.549 E/AndroidRuntime(4572):	at com.android.server.wifi.WifiNative.getWifiLinkLayerStats(WifiNative.java:1537)
02-03 22:27:54.549 E/AndroidRuntime(4572):	at com.android.server.wifi.WifiStateMachine.getWifiLinkLayerStats(WifiStateMachine.java:1784)
02-03 22:27:54.549 E/AndroidRuntime(4572):	at com.android.server.wifi.WifiStateMachine.handleScreenStateChanged(WifiStateMachine.java:3166)
02-03 22:27:54.549 E/AndroidRuntime(4572):	at com.android.server.wifi.WifiStateMachine.access$2700(WifiStateMachine.java:141)
02-03 22:27:54.549 E/AndroidRuntime(4572):	at com.android.server.wifi.WifiStateMachine$DefaultState.processMessage(WifiStateMachine.java:4925)
02-03 22:27:54.549 E/AndroidRuntime(4572):	at com.android.internal.util.StateMachine$SmHandler.processMsg(StateMachine.java:967)
02-03 22:27:54.549 E/AndroidRuntime(4572):	at com.android.internal.util.StateMachine$SmHandler.handleMessage(StateMachine.java:790)
02-03 22:27:54.549 E/AndroidRuntime(4572):	at android.os.Handler.dispatchMessage(Handler.java:102)
02-03 22:27:54.549 E/AndroidRuntime(4572):	at android.os.Looper.loop(Looper.java:135)
02-03 22:27:54.549 E/AndroidRuntime(4572):	at android.os.HandlerThread.run(HandlerThread.java:61)
02-03 22:27:54.574 I/Process (4572): Sending signal. PID: 4572 SIG: 9
02-03 22:27:54.662 I//sbin/ext/cortexbrain-tune.sh(20798): *** IO_SCHEDULER: sleep - cfq ***: done
02-03 22:27:54.685 I//sbin/ext/cortexbrain-tune.sh(20799): *** BUS_THRESHOLD: sleep ***
02-03 22:27:54.700 I//sbin/ext/cortexbrain-tune.sh(20800): *** NET ***: sleep
02-03 22:27:54.727 I//sbin/ext/cortexbrain-tune.sh(20804): *** BATTERY - LEVEL: 11 - CUR: 0 ***
02-03 22:27:54.758 I//sbin/ext/cortexbrain-tune.sh(20811): *** BATTERY_TWEAKS ***: enabled
02-03 22:27:54.790 I//sbin/ext/cortexbrain-tune.sh(20813): *** IPV6 ***: disabled
02-03 22:27:54.814 I//sbin/ext/cortexbrain-tune.sh(20814): *** TWEAK_HOTPLUG_ECO: sleep ***
02-03 22:27:54.831 I//sbin/ext/cortexbrain-tune.sh(20815): *** SLEEP mode ***
02-03 22:27:54.844 I//sbin/ext/cortexbrain-tune.sh(20816): *** LOGGER ***: sleep
02-03 22:27:54.866 W/Sensors (13340): sensorservice died [0xb7d99bf0]
02-03 22:27:54.867 I/ServiceManager(2609): service 'sensorservice' died
02-03 22:27:54.867 I/ServiceManager(2609): service 'textservices' died
02-03 22:27:54.867 I/ServiceManager(2609): service 'wifiscanner' died
02-03 22:27:54.867 I/ServiceManager(2609): service 'wifip2p' died
02-03 22:27:54.867 I/ServiceManager(2609): service 'rttmanager' died
02-03 22:27:54.867 I/ServiceManager(2609): service 'location' died
02-03 22:27:54.867 I/ServiceManager(2609): service 'wallpaper' died
02-03 22:27:54.867 I/ServiceManager(2609): service 'torch' died
02-03 22:27:54.867 I/ServiceManager(2609): service 'network_score' died
02-03 22:27:54.867 I/ServiceManager(2609): service 'usagestats' died
02-03 22:27:54.867 I/ServiceManager(2609): service 'hardware' died
02-03 22:27:54.867 I/ServiceManager(2609): service 'batterystats' died
02-03 22:27:54.867 I/ServiceManager(2609): service 'appops' died
02-03 22:27:54.867 I/ServiceManager(2609): service 'power' died
02-03 22:27:54.867 I/ServiceManager(2609): service 'display' died
02-03 22:27:54.867 I/ServiceManager(2609): service 'meminfo' died
02-03 22:27:54.867 I/ServiceManager(2609): service 'account' died
02-03 22:27:54.867 I/ServiceManager(2609): service 'search' died
02-03 22:27:54.867 I/ServiceManager(2609): service 'statusbar' died
02-03 22:27:54.867 I/ServiceManager(2609): service 'clipboard' died
02-03 22:27:54.867 I/ServiceManager(2609): service 'telephony.registry' died
02-03 22:27:54.867 I/ServiceManager(2609): service 'procstats' died
02-03 22:27:54.867 I/ServiceManager(2609): service 'content' died
02-03 22:27:54.867 I/ServiceManager(2609): service 'alarm' died
02-03 22:27:54.867 I/ServiceManager(2609): service 'netpolicy' died
02-03 22:27:54.867 I/ServiceManager(2609): service 'package' died
02-03 22:27:54.867 I/ServiceManager(2609): service 'accessibility' died
02-03 22:27:54.867 I/ServiceManager(2609): service 'window' died
02-03 22:27:54.867 I/ServiceManager(2609): service 'dbinfo' died
02-03 22:27:54.867 I/ServiceManager(2609): service 'cmhardware' died
02-03 22:27:54.867 I/ServiceManager(2609): service 'batterymanager' died
02-03 22:27:54.867 I/ServiceManager(2609): service 'mount' died
02-03 22:27:54.867 I/ServiceManager(2609): service 'vibrator' died
02-03 22:27:54.867 I/ServiceManager(2609): service 'user' died
02-03 22:27:54.867 I/ServiceManager(2609): service 'gfxinfo' died
02-03 22:27:54.867 I/ServiceManager(2609): service 'bluetooth_manager' died
02-03 22:27:54.868 I/ServiceManager(2609): service 'network_management' died
02-03 22:27:54.868 I/ServiceManager(2609): service 'processinfo' died
02-03 22:27:54.868 I/ServiceManager(2609): service 'servicediscovery' died
02-03 22:27:54.868 I/ServiceManager(2609): service 'lock_settings' died
02-03 22:27:54.868 I/ServiceManager(2609): service 'netstats' died
02-03 22:27:54.868 I/ServiceManager(2609): service 'entropy' died
02-03 22:27:54.868 I/ServiceManager(2609): service 'consumer_ir' died
02-03 22:27:54.868 I/ServiceManager(2609): service 'input_method' died
02-03 22:27:54.868 I/ServiceManager(2609): service 'cpuinfo' died
02-03 22:27:54.868 I/ServiceManager(2609): service 'webviewupdate' died
02-03 22:27:54.868 I/ServiceManager(2609): service 'device_policy' died
02-03 22:27:54.868 I/ServiceManager(2609): service 'permission' died
02-03 22:27:54.868 I/ServiceManager(2609): service 'input' died
02-03 22:27:54.868 I/ServiceManager(2609): service 'scheduling_policy' died
02-03 22:27:54.868 I/ServiceManager(2609): service 'activity' died
02-03 22:27:54.868 I/ServiceManager(2609): service 'updatelock' died
02-03 22:27:54.868 I/ServiceManager(2609): service 'country_detector' died
02-03 22:27:54.868 I/ServiceManager(2609): service 'wifi' died
02-03 22:27:54.868 I/ServiceManager(2609): service 'diskstats' died
02-03 22:27:54.868 I/ServiceManager(2609): service 'connectivity' died
02-03 22:27:54.868 I/ServiceManager(2609): service 'cmappsuggest' died
02-03 22:27:54.868 I/ServiceManager(2609): service 'serial' died
02-03 22:27:54.868 I/ServiceManager(2609): service 'notification' died
02-03 22:27:54.868 I/ServiceManager(2609): service 'devicestoragemonitor' died
02-03 22:27:54.868 I/ServiceManager(2609): service 'dropbox' died
02-03 22:27:54.868 I/ServiceManager(2609): service 'DockObserver' died
02-03 22:27:54.868 I/ServiceManager(2609): service 'cmtelephonymanager' died
02-03 22:27:54.868 I/ServiceManager(2609): service 'audio' died
02-03 22:27:54.868 I/ServiceManager(2609): service 'uimode' died
02-03 22:27:54.868 I/ServiceManager(2609): service 'jobscheduler' died
02-03 22:27:54.868 I/ServiceManager(2609): service 'samplingprofiler' died
02-03 22:27:54.868 I/ServiceManager(2609): service 'voiceinteraction' died
02-03 22:27:54.868 I/ServiceManager(2609): service 'usb' died
02-03 22:27:54.868 I/ServiceManager(2609): service 'commontime_management' died
02-03 22:27:54.868 I/ServiceManager(2609): service 'media_session' died
02-03 22:27:54.868 I/ServiceManager(2609): service 'dreams' died
02-03 22:27:54.868 I/ServiceManager(2609): service 'restrictions' died
02-03 22:27:54.868 I/ServiceManager(2609): service 'print' died
02-03 22:27:54.868 I/ServiceManager(2609): service 'imms' died
02-03 22:27:54.868 I/ServiceManager(2609): service 'assetatlas' died
02-03 22:27:54.868 I/ServiceManager(2609): service 'edgegestureservice' died
02-03 22:27:54.868 I/ServiceManager(2609): service 'backup' died
02-03 22:27:54.868 I/ServiceManager(2609): service 'launcherapps' died
02-03 22:27:54.868 I/ServiceManager(2609): service 'appwidget' died
02-03 22:27:54.868 I/ServiceManager(2609): service 'media_projection' died
02-03 22:27:54.868 I/ServiceManager(2609): service 'killswitch' died
02-03 22:27:54.868 I/ServiceManager(2609): service 'fingerprint' died
02-03 22:27:54.868 I/ServiceManager(2609): service 'trust' died
02-03 22:27:54.868 I/ServiceManager(2609): service 'themes' died
02-03 22:27:54.869 I/ServiceManager(2609): service 'cmstatusbar' died
02-03 22:27:54.869 I/ServiceManager(2609): service 'profile' died
02-03 22:27:54.869 I/ServiceManager(2609): service 'cmpartnerinterface' died
02-03 22:27:54.869 I/ServiceManager(2609): service 'media_router' died
02-03 22:27:54.869 I/ServiceManager(2609): service 'telecom' died
02-03 22:27:54.869 W/AudioFlinger(2621): power manager service died !!!
02-03 22:27:54.877 W/Sensors (15329): sensorservice died [0xb7d63848]
02-03 22:27:54.885 E/WifiManager(13818): Channel connection lost
02-03 22:27:54.885 E/WifiManager(14480): Channel connection lost
02-03 22:27:54.886 E/WifiManager(13845): Channel connection lost
02-03 22:27:54.892 D/SurfaceFlinger(2830): Set power mode=2, type=0 flinger=0xb80e6550
02-03 22:27:54.897 E/WifiManager(13340): Channel connection lost
02-03 22:27:54.901 E/WifiManager(16164): Channel connection lost
02-03 22:27:54.912 E/installd(2622): eof
02-03 22:27:54.912 E/installd(2622): failed to read size
02-03 22:27:54.912 I/installd(2622): closing connection
02-03 22:27:54.999 I/lowmemorykiller(2608): ActivityManager disconnected
02-03 22:27:54.999 I/lowmemorykiller(2608): Closing Activity Manager data connection
02-03 22:27:55.099 D/libEGL (20822): loaded /system/lib/egl/libEGL_mali.so
02-03 22:27:55.102 D/libEGL (20822): loaded /system/lib/egl/libGLESv1_CM_mali.so
02-03 22:27:55.131 E/FrameworkListener(2829): read() failed (Connection reset by peer)
02-03 22:27:55.162 I/art (2831): Explicit concurrent mark sweep GC freed 708(30KB) AllocSpace objects, 0(0B) LOS objects, 40% free, 4MB/6MB, paused 400us total 30.279ms
02-03 22:27:55.204 I/art (2831): Explicit concurrent mark sweep GC freed 5(160B) AllocSpace objects, 0(0B) LOS objects, 40% free, 4MB/6MB, paused 8.440ms total 40.885ms
02-03 22:27:55.211 D/libEGL (20822): loaded /system/lib/egl/libGLESv2_mali.so
02-03 22:27:55.250 I/art (2831): Explicit concurrent mark sweep GC freed 5(160B) AllocSpace objects, 0(0B) LOS objects, 40% free, 4MB/6MB, paused 393us total 44.928ms
02-03 22:27:55.287 E/ (20822): Device driver API match
02-03 22:27:55.287 E/ (20822): Device driver API version: 23
02-03 22:27:55.287 E/ (20822): User space API version: 23
02-03 22:27:55.287 E/ (20822): mali: REVISION=Linux-r3p2-01rel3 BUILD_DATE=Wed Oct 9 21:05:57 KST 2013
02-03 22:27:55.288 E/cutils-trace(20822): Error opening trace file: Permission denied (13)
02-03 22:27:55.307 E/BootAnimation(20822): couldn't find audio_conf.txt
02-03 22:27:55.313 W/BootAnimation(20822): Audio service is not initiated.
02-03 22:27:55.315 D/BootAnimation(20822): Use save memory method, maybe small fps in actual.
02-03 22:27:55.405 E/Zygote (2831): Exit zygote because system server (150994944) has terminated