2

I have my Galaxy S4 connected with my PC and ran the "Building My First App" tutorial from http://developer.android.com/ . There were no problems, but I noticed many messages about the LightSensor in the LogCat view in Eclipse, like these:

09-17 17:41:24.781: E/LightSensor(736): Light old sensor_state 0, new sensor_state : 128 en : 1
09-17 17:41:25.152: E/LightSensor(736): Light old sensor_state 128, new sensor_state : 0 en : 0

I found several occurrences of the string "Light old sensor_state 0..." on the web. So others get this type of messages, too (where a phone was mentioned it seemed also to be a Galaxy S4). But the posts/questions/answers were always about something else. It looks as if everybody ignores this kind of messages as noise.

I played around a bit and noticed this: As long as the phone is active those messages do not appear. But when I switch it off, the messages appear about every 10s. Does anybody know what they mean?

2

They're nothing to do with your app, and they're not really errors. As you might have guessed, they're just reporting changes in the light sensor state. (That's the sensor that controls the screen brightness.)

Samsung ROMs are particularly known for having very 'noisy' log output, owing to Samsung being a little slapdash about software integration. In contrast, Nexus devices tend to have very clean logs, because Google engineers are aggressive about disabling logging when code is committed. You can filter the log messages in Eclipse (or when you use adb logcat on the command-line).

  • Are you sure? Then why does the phone report the changes only while it is switched off? And why are the changes reported as errors? Also a change from 0 to 128 and back to 0 every 10 seconds seems strange to me, too. It is not as if I switched on and off the light in the room every 10s.... – holgero Sep 17 '13 at 16:27
  • Only someone with access to Samsung's source code would know why it behaves as it does. – Dan Hulme Sep 17 '13 at 17:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.