Fix NPE in flashlight button of energy widget
In somewhat unreproducible cases, pushing the flashlight button caused a NullPointerException when trying to access the (not yet initialized) mContext member variable in toggleState(). As I could not reproduce this reliably, and found no clear reason for the variable to be uninitialized sometimes, but as there seems no need to remember the context in a member variable anyway, I removed it and refactored the methods to use a method parameter instead. Change-Id: Id2b194f9f5785bcbbeb4bcd3d603510e0d0f71ce
Loading
Please register or sign in to comment