mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-21 17:29:32 +01:00
Rewrite the AppDependencies system.
This commit is contained in:
committed by
Cody Henthorne
parent
a0131bf39b
commit
b6a4e1f145
@@ -8,7 +8,7 @@ import com.google.android.material.dialog.MaterialAlertDialogBuilder;
|
||||
import org.signal.core.util.ThreadUtil;
|
||||
import org.thoughtcrime.securesms.PassphraseRequiredActivity;
|
||||
import org.thoughtcrime.securesms.R;
|
||||
import org.thoughtcrime.securesms.dependencies.ApplicationDependencies;
|
||||
import org.thoughtcrime.securesms.dependencies.AppDependencies;
|
||||
import org.thoughtcrime.securesms.util.DynamicNoActionBarTheme;
|
||||
import org.thoughtcrime.securesms.util.DynamicTheme;
|
||||
import org.thoughtcrime.securesms.util.PlayStoreUtil;
|
||||
@@ -54,7 +54,7 @@ public class ClientDeprecatedActivity extends PassphraseRequiredActivity {
|
||||
.setTitle(R.string.ClientDeprecatedActivity_warning)
|
||||
.setMessage(R.string.ClientDeprecatedActivity_your_version_of_signal_has_expired_you_can_view_your_message_history)
|
||||
.setPositiveButton(R.string.ClientDeprecatedActivity_dont_update, (dialog, which) -> {
|
||||
ApplicationDependencies.getMegaphoneRepository().markFinished(Megaphones.Event.CLIENT_DEPRECATED, () -> {
|
||||
AppDependencies.getMegaphoneRepository().markFinished(Megaphones.Event.CLIENT_DEPRECATED, () -> {
|
||||
ThreadUtil.runOnMain(this::finish);
|
||||
});
|
||||
})
|
||||
|
||||
@@ -23,7 +23,7 @@ import org.thoughtcrime.securesms.components.settings.app.AppSettingsActivity;
|
||||
import org.thoughtcrime.securesms.database.SignalDatabase;
|
||||
import org.thoughtcrime.securesms.database.model.MegaphoneRecord;
|
||||
import org.thoughtcrime.securesms.database.model.RemoteMegaphoneRecord;
|
||||
import org.thoughtcrime.securesms.dependencies.ApplicationDependencies;
|
||||
import org.thoughtcrime.securesms.dependencies.AppDependencies;
|
||||
import org.thoughtcrime.securesms.jobmanager.impl.NetworkConstraint;
|
||||
import org.thoughtcrime.securesms.keyvalue.PhoneNumberPrivacyValues.PhoneNumberDiscoverabilityMode;
|
||||
import org.thoughtcrime.securesms.keyvalue.SignalStore;
|
||||
@@ -198,7 +198,7 @@ public final class Megaphones {
|
||||
return new Megaphone.Builder(Event.PINS_FOR_ALL, Megaphone.Style.FULLSCREEN)
|
||||
.enableSnooze(null)
|
||||
.setOnVisibleListener((megaphone, listener) -> {
|
||||
if (new NetworkConstraint.Factory(ApplicationDependencies.getApplication()).create().isMet()) {
|
||||
if (new NetworkConstraint.Factory(AppDependencies.getApplication()).create().isMet()) {
|
||||
listener.onMegaphoneNavigationRequested(SvrMigrationActivity.createIntent(), SvrMigrationActivity.REQUEST_NEW_PIN);
|
||||
}
|
||||
})
|
||||
@@ -209,7 +209,7 @@ public final class Megaphones {
|
||||
.setTitle(R.string.KbsMegaphone__create_a_pin)
|
||||
.setBody(R.string.KbsMegaphone__pins_keep_information_thats_stored_with_signal_encrytped)
|
||||
.setActionButton(R.string.KbsMegaphone__create_pin, (megaphone, listener) -> {
|
||||
Intent intent = CreateSvrPinActivity.getIntentForPinCreate(ApplicationDependencies.getApplication());
|
||||
Intent intent = CreateSvrPinActivity.getIntentForPinCreate(AppDependencies.getApplication());
|
||||
|
||||
listener.onMegaphoneNavigationRequested(intent, CreateSvrPinActivity.REQUEST_NEW_PIN);
|
||||
})
|
||||
@@ -418,7 +418,7 @@ public final class Megaphones {
|
||||
}
|
||||
|
||||
private static boolean shouldShowTurnOffCircumventionMegaphone() {
|
||||
return ApplicationDependencies.getSignalServiceNetworkAccess().isCensored() &&
|
||||
return AppDependencies.getSignalServiceNetworkAccess().isCensored() &&
|
||||
SignalStore.misc().isServiceReachableWithoutCircumvention();
|
||||
}
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ import org.thoughtcrime.securesms.database.RemoteMegaphoneTable
|
||||
import org.thoughtcrime.securesms.database.SignalDatabase
|
||||
import org.thoughtcrime.securesms.database.model.RemoteMegaphoneRecord
|
||||
import org.thoughtcrime.securesms.database.model.RemoteMegaphoneRecord.ActionId
|
||||
import org.thoughtcrime.securesms.dependencies.ApplicationDependencies
|
||||
import org.thoughtcrime.securesms.dependencies.AppDependencies
|
||||
import org.thoughtcrime.securesms.megaphone.RemoteMegaphoneRepository.Action
|
||||
import org.thoughtcrime.securesms.providers.BlobProvider
|
||||
import org.thoughtcrime.securesms.recipients.Recipient
|
||||
@@ -37,7 +37,7 @@ object RemoteMegaphoneRepository {
|
||||
private val TAG = Log.tag(RemoteMegaphoneRepository::class.java)
|
||||
|
||||
private val db: RemoteMegaphoneTable = SignalDatabase.remoteMegaphones
|
||||
private val context: Application = ApplicationDependencies.getApplication()
|
||||
private val context: Application = AppDependencies.application
|
||||
|
||||
private val snooze: Action = Action { _, controller, remote ->
|
||||
controller.onMegaphoneSnooze(Megaphones.Event.REMOTE_MEGAPHONE)
|
||||
|
||||
Reference in New Issue
Block a user