Fix TimedEventManager crash in a sane way.

Follow up on acb48752c.

Just have the subclass call that method to guarantee that everything is
initialized.
This commit is contained in:
Greyson Parrelli 2019-07-24 11:22:19 -04:00
parent 4e859a84ce
commit eddff07eb8
2 changed files with 2 additions and 4 deletions

View File

@ -32,6 +32,8 @@ public class RevealableMessageManager extends TimedEventManager<RevealExpiration
this.mmsDatabase = DatabaseFactory.getMmsDatabase(application);
this.attachmentDatabase = DatabaseFactory.getAttachmentDatabase(application);
scheduleIfNecessary();
}
@WorkerThread

View File

@ -29,10 +29,6 @@ public abstract class TimedEventManager<E> {
this.application = application;
this.handler = new Handler(handlerThread.getLooper());
// XXX Have to delay it because some devices will run the resulting handler#post synchronously,
// triggering a method call to an uninitialized child class.
handler.postDelayed(this::scheduleIfNecessary, 5);
}
/**