|
|
|
@ -802,7 +802,7 @@ public class MicroPhotoService extends Service {
|
|
|
|
|
mWakeLocks.remove(name);
|
|
|
|
|
|
|
|
|
|
if (mWakeLocks.isEmpty()) {
|
|
|
|
|
mHander.postDelayed(delayedSleep, 2000);
|
|
|
|
|
// mHander.postDelayed(delayedSleep, 2000);
|
|
|
|
|
}
|
|
|
|
|
} catch (Exception ex) {
|
|
|
|
|
ex.printStackTrace();
|
|
|
|
@ -811,12 +811,23 @@ public class MicroPhotoService extends Service {
|
|
|
|
|
if (wl != null) {
|
|
|
|
|
Log.i(TAG, "Release wakelock:" + name);
|
|
|
|
|
try {
|
|
|
|
|
wl.setReferenceCounted(false);
|
|
|
|
|
wl.release();
|
|
|
|
|
final PowerManager.WakeLock finalWl = wl;
|
|
|
|
|
wl = null;
|
|
|
|
|
mHander.postDelayed(new Runnable() {
|
|
|
|
|
@Override
|
|
|
|
|
public void run() {
|
|
|
|
|
try {
|
|
|
|
|
finalWl.setReferenceCounted(false);
|
|
|
|
|
finalWl.release();
|
|
|
|
|
} catch (Exception ex) {
|
|
|
|
|
ex.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}, 200);
|
|
|
|
|
|
|
|
|
|
} catch (Exception ex) {
|
|
|
|
|
ex.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|
wl = null;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|