mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-12 02:39:05 +01:00
Compare commits
5 Commits
beta-1.4.1
...
lock-down-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5e7b4b762e | ||
|
|
2397b7f5a2 | ||
|
|
5ec80adfe8 | ||
|
|
a56935bc3d | ||
|
|
edd76266a9 |
@@ -179,6 +179,13 @@ class LifecycleManagerImpl implements LifecycleManager, MigrationListener {
|
||||
LOG.info("Stopping services");
|
||||
state = STOPPING;
|
||||
eventBus.broadcast(new LifecycleEvent(STOPPING));
|
||||
LOG.info("Sleeping a bit to simulate slowness");
|
||||
try {
|
||||
Thread.sleep(5000);
|
||||
} catch (InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
LOG.info("Done simulating slowness");
|
||||
for (Service s : services) {
|
||||
long start = now();
|
||||
s.stopService();
|
||||
|
||||
@@ -117,22 +117,9 @@
|
||||
|
||||
<activity
|
||||
android:name="org.briarproject.briar.android.navdrawer.NavDrawerActivity"
|
||||
android:exported="false"
|
||||
android:launchMode="singleTask"
|
||||
android:theme="@style/BriarTheme.NoActionBar">
|
||||
<intent-filter android:label="@string/add_contact_remotely_title_case">
|
||||
<action android:name="android.intent.action.VIEW" />
|
||||
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<category android:name="android.intent.category.BROWSABLE" />
|
||||
|
||||
<data android:scheme="briar" />
|
||||
</intent-filter>
|
||||
<intent-filter android:label="@string/add_contact_remotely_title_case">
|
||||
<action android:name="android.intent.action.SEND" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<data android:mimeType="text/plain" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
android:theme="@style/BriarTheme.NoActionBar" />
|
||||
|
||||
<activity
|
||||
android:name="org.briarproject.briar.android.conversation.ConversationActivity"
|
||||
@@ -440,8 +427,27 @@
|
||||
<activity
|
||||
android:name=".android.contact.add.remote.AddContactActivity"
|
||||
android:label="@string/add_contact_remotely_title_case"
|
||||
android:parentActivityName="org.briarproject.briar.android.navdrawer.NavDrawerActivity"
|
||||
android:theme="@style/BriarTheme"
|
||||
android:windowSoftInputMode="adjustResize|stateHidden" />
|
||||
android:windowSoftInputMode="adjustResize|stateHidden">
|
||||
<meta-data
|
||||
android:name="android.support.PARENT_ACTIVITY"
|
||||
android:value="org.briarproject.briar.android.navdrawer.NavDrawerActivity" />
|
||||
|
||||
<intent-filter android:label="@string/add_contact_remotely_title_case">
|
||||
<action android:name="android.intent.action.VIEW" />
|
||||
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<category android:name="android.intent.category.BROWSABLE" />
|
||||
|
||||
<data android:scheme="briar" />
|
||||
</intent-filter>
|
||||
<intent-filter android:label="@string/add_contact_remotely_title_case">
|
||||
<action android:name="android.intent.action.SEND" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<data android:mimeType="text/plain" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
<activity
|
||||
android:name=".android.contact.add.remote.PendingContactListActivity"
|
||||
|
||||
@@ -11,6 +11,7 @@ import org.briarproject.briar.R;
|
||||
import org.briarproject.briar.android.activity.ActivityComponent;
|
||||
import org.briarproject.briar.android.activity.BriarActivity;
|
||||
import org.briarproject.briar.android.fragment.BaseFragment.BaseFragmentListener;
|
||||
import org.briarproject.briar.android.navdrawer.NavDrawerActivity;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import javax.inject.Inject;
|
||||
@@ -102,4 +103,11 @@ public class AddContactActivity extends BriarActivity implements
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBackPressed() {
|
||||
Intent i = new Intent(this, NavDrawerActivity.class);
|
||||
startActivity(i);
|
||||
finish();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@ import static org.briarproject.bramble.api.contact.HandshakeLinkConstants.LINK_R
|
||||
|
||||
class IntentRouter {
|
||||
|
||||
// TODO
|
||||
static void handleExternalIntent(Context ctx, Intent i) {
|
||||
String action = i.getAction();
|
||||
// add remote contact with clicked briar:// link
|
||||
|
||||
@@ -101,8 +101,6 @@ public class NavDrawerActivity extends BriarActivity implements
|
||||
Uri.parse("briar-content://org.briarproject.briar/blog");
|
||||
public static Uri CONTACT_ADDED_URI =
|
||||
Uri.parse("briar-content://org.briarproject.briar/contact/added");
|
||||
public static Uri SIGN_OUT_URI =
|
||||
Uri.parse("briar-content://org.briarproject.briar/sign-out");
|
||||
|
||||
private final List<Transport> transports = new ArrayList<>(3);
|
||||
private final MutableLiveData<ImageView> torIcon = new MutableLiveData<>();
|
||||
@@ -236,8 +234,6 @@ public class NavDrawerActivity extends BriarActivity implements
|
||||
startFragment(ForumListFragment.newInstance(), R.id.nav_btn_forums);
|
||||
} else if (BLOG_URI.equals(uri)) {
|
||||
startFragment(FeedFragment.newInstance(), R.id.nav_btn_blogs);
|
||||
} else if (SIGN_OUT_URI.equals(uri)) {
|
||||
signOut(false, false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -46,11 +46,16 @@ public class SettingsActivity extends BriarActivity {
|
||||
|
||||
setContentView(R.layout.activity_settings);
|
||||
|
||||
if (featureFlags.shouldEnableProfilePictures()) {
|
||||
ViewModelProvider provider =
|
||||
new ViewModelProvider(this, viewModelFactory);
|
||||
settingsViewModel = provider.get(SettingsViewModel.class);
|
||||
ViewModelProvider provider =
|
||||
new ViewModelProvider(this, viewModelFactory);
|
||||
settingsViewModel = provider.get(SettingsViewModel.class);
|
||||
|
||||
settingsViewModel.getLanguageChange().observeEvent(this, b -> {
|
||||
signOut(false, false);
|
||||
finishAffinity();
|
||||
});
|
||||
|
||||
if (featureFlags.shouldEnableProfilePictures()) {
|
||||
TextView textViewUserName = findViewById(R.id.username);
|
||||
CircleImageView imageViewAvatar =
|
||||
findViewById(R.id.avatarImage);
|
||||
|
||||
@@ -45,6 +45,7 @@ import androidx.annotation.Nullable;
|
||||
import androidx.annotation.StringRes;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.core.text.TextUtilsCompat;
|
||||
import androidx.lifecycle.ViewModelProvider;
|
||||
import androidx.preference.ListPreference;
|
||||
import androidx.preference.Preference;
|
||||
import androidx.preference.Preference.OnPreferenceChangeListener;
|
||||
@@ -54,7 +55,6 @@ import androidx.preference.SwitchPreference;
|
||||
|
||||
import static android.app.Activity.RESULT_OK;
|
||||
import static android.content.Intent.FLAG_ACTIVITY_CLEAR_TASK;
|
||||
import static android.content.Intent.FLAG_ACTIVITY_CLEAR_TOP;
|
||||
import static android.content.Intent.FLAG_ACTIVITY_NEW_TASK;
|
||||
import static android.media.RingtoneManager.ACTION_RINGTONE_PICKER;
|
||||
import static android.media.RingtoneManager.EXTRA_RINGTONE_DEFAULT_URI;
|
||||
@@ -89,7 +89,6 @@ import static org.briarproject.bramble.util.LogUtils.now;
|
||||
import static org.briarproject.briar.android.BriarApplication.ENTRY_ACTIVITY;
|
||||
import static org.briarproject.briar.android.TestingConstants.IS_DEBUG_BUILD;
|
||||
import static org.briarproject.briar.android.activity.RequestCodes.REQUEST_RINGTONE;
|
||||
import static org.briarproject.briar.android.navdrawer.NavDrawerActivity.SIGN_OUT_URI;
|
||||
import static org.briarproject.briar.android.util.UiUtils.getCountryDisplayName;
|
||||
import static org.briarproject.briar.android.util.UiUtils.hasScreenLock;
|
||||
import static org.briarproject.briar.android.util.UiUtils.triggerFeedback;
|
||||
@@ -165,12 +164,19 @@ public class SettingsFragment extends PreferenceFragmentCompat
|
||||
LocationUtils locationUtils;
|
||||
@Inject
|
||||
CircumventionProvider circumventionProvider;
|
||||
@Inject
|
||||
ViewModelProvider.Factory viewModelFactory;
|
||||
|
||||
private SettingsViewModel viewModel;
|
||||
|
||||
@Override
|
||||
public void onAttach(Context context) {
|
||||
super.onAttach(context);
|
||||
listener = (SettingsActivity) context;
|
||||
listener.getActivityComponent().inject(this);
|
||||
|
||||
viewModel = new ViewModelProvider(requireActivity(), viewModelFactory)
|
||||
.get(SettingsViewModel.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -638,11 +644,7 @@ public class SettingsFragment extends PreferenceFragmentCompat
|
||||
builder.setPositiveButton(R.string.sign_out_button,
|
||||
(dialogInterface, i) -> {
|
||||
language.setValue(newValue);
|
||||
Intent intent = new Intent(getContext(), ENTRY_ACTIVITY);
|
||||
intent.setFlags(FLAG_ACTIVITY_CLEAR_TOP);
|
||||
intent.setData(SIGN_OUT_URI);
|
||||
requireActivity().startActivity(intent);
|
||||
requireActivity().finish();
|
||||
viewModel.languageChanged();
|
||||
});
|
||||
builder.setNegativeButton(R.string.cancel, null);
|
||||
builder.setCancelable(false);
|
||||
|
||||
@@ -56,6 +56,9 @@ class SettingsViewModel extends AndroidViewModel {
|
||||
private final MutableLiveEvent<Boolean> setAvatarFailed =
|
||||
new MutableLiveEvent<>();
|
||||
|
||||
private final MutableLiveEvent<Boolean> languageChanged =
|
||||
new MutableLiveEvent<>();
|
||||
|
||||
@Inject
|
||||
SettingsViewModel(Application application,
|
||||
IdentityManager identityManager,
|
||||
@@ -83,6 +86,10 @@ class SettingsViewModel extends AndroidViewModel {
|
||||
return setAvatarFailed;
|
||||
}
|
||||
|
||||
LiveEvent<Boolean> getLanguageChange() {
|
||||
return languageChanged;
|
||||
}
|
||||
|
||||
private void loadOwnIdentityInfo() {
|
||||
dbExecutor.execute(() -> {
|
||||
try {
|
||||
@@ -131,4 +138,8 @@ class SettingsViewModel extends AndroidViewModel {
|
||||
});
|
||||
}
|
||||
|
||||
void languageChanged() {
|
||||
languageChanged.setEvent(true);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user