mirror of
https://github.com/oxen-io/session-android.git
synced 2024-11-23 18:15:22 +00:00
refactor: move db module init before injection and replace ApplicationContext db component access to static function to get the component
This commit is contained in:
parent
d130ba5432
commit
91b876589a
@ -148,10 +148,10 @@ public class ApplicationContext extends Application implements DefaultLifecycleO
|
||||
|
||||
@Override
|
||||
public void onCreate() {
|
||||
DatabaseModule.init(this);
|
||||
super.onCreate();
|
||||
Log.i(TAG, "onCreate()");
|
||||
startKovenant();
|
||||
DatabaseModule.init(this);
|
||||
initializeSecurityProvider();
|
||||
initializeLogging();
|
||||
initializeCrashHandling();
|
||||
|
@ -44,6 +44,7 @@ import org.thoughtcrime.securesms.components.SearchToolbar;
|
||||
import org.thoughtcrime.securesms.contacts.ContactSelectionListFragment;
|
||||
import org.thoughtcrime.securesms.contacts.ContactSelectionListLoader.DisplayMode;
|
||||
import org.thoughtcrime.securesms.conversation.v2.ConversationActivityV2;
|
||||
import org.thoughtcrime.securesms.dependencies.DatabaseComponent;
|
||||
import org.thoughtcrime.securesms.mms.PartAuthority;
|
||||
import org.thoughtcrime.securesms.providers.BlobProvider;
|
||||
import org.thoughtcrime.securesms.util.MediaUtil;
|
||||
@ -249,7 +250,7 @@ public class ShareActivity extends PassphraseRequiredActionBarActivity
|
||||
@Override
|
||||
public void onContactSelected(String number) {
|
||||
Recipient recipient = Recipient.from(this, Address.fromExternal(this, number), true);
|
||||
long existingThread = ApplicationContext.getInstance(this).getDatabaseComponent().threadDatabase().getThreadIdIfExistsFor(recipient);
|
||||
long existingThread = DatabaseComponent.get(this).threadDatabase().getThreadIdIfExistsFor(recipient);
|
||||
createConversation(existingThread, recipient.getAddress(), DistributionTypes.DEFAULT);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user