Make less calls within loop

This commit is contained in:
Moez Bhatti
2015-11-05 20:36:50 -05:00
parent 3dad335eda
commit d894942f3b
@@ -1432,6 +1432,11 @@ public class MessageListFragment extends QKContentFragment implements ActivityLa
// QKSMS battery drain of 2015
long time = System.currentTimeMillis();
while (!mOpened) {
try {
Thread.sleep(100);
} catch (InterruptedException e) {
e.printStackTrace();
}
if (System.currentTimeMillis() - time > 10000) {
Log.w(TAG, "Task running for over 10 seconds, something is wrong");
cancel(true);