mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-12 02:39:05 +01:00
Compare commits
4 Commits
2048-allow
...
password-a
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6778a2dee8 | ||
|
|
ecb6661b12 | ||
|
|
677a6529f4 | ||
|
|
fb6c982e10 |
@@ -65,7 +65,6 @@ import javax.inject.Inject;
|
||||
import static android.app.Notification.DEFAULT_LIGHTS;
|
||||
import static android.app.Notification.DEFAULT_SOUND;
|
||||
import static android.app.Notification.DEFAULT_VIBRATE;
|
||||
import static android.app.Notification.VISIBILITY_SECRET;
|
||||
import static android.app.NotificationManager.IMPORTANCE_DEFAULT;
|
||||
import static android.app.NotificationManager.IMPORTANCE_LOW;
|
||||
import static android.content.Context.NOTIFICATION_SERVICE;
|
||||
@@ -75,6 +74,7 @@ import static android.os.Build.VERSION.SDK_INT;
|
||||
import static android.support.v4.app.NotificationCompat.CATEGORY_MESSAGE;
|
||||
import static android.support.v4.app.NotificationCompat.CATEGORY_SOCIAL;
|
||||
import static android.support.v4.app.NotificationCompat.PRIORITY_LOW;
|
||||
import static android.support.v4.app.NotificationCompat.VISIBILITY_SECRET;
|
||||
import static java.util.logging.Level.WARNING;
|
||||
import static org.briarproject.bramble.util.LogUtils.logException;
|
||||
import static org.briarproject.briar.android.activity.BriarActivity.GROUP_ID;
|
||||
@@ -623,13 +623,12 @@ class AndroidNotificationManagerImpl implements AndroidNotificationManager,
|
||||
public void showSignInNotification() {
|
||||
if (blockSignInReminder) return;
|
||||
if (SDK_INT >= 26) {
|
||||
String title = appContext
|
||||
.getString(R.string.reminder_notification_channel_title);
|
||||
NotificationChannel channel =
|
||||
new NotificationChannel(REMINDER_CHANNEL_ID, appContext
|
||||
.getString(
|
||||
R.string.reminder_notification_channel_title),
|
||||
new NotificationChannel(REMINDER_CHANNEL_ID, title,
|
||||
IMPORTANCE_LOW);
|
||||
channel.setLockscreenVisibility(
|
||||
NotificationCompat.VISIBILITY_SECRET);
|
||||
channel.setLockscreenVisibility(VISIBILITY_SECRET);
|
||||
notificationManager.createNotificationChannel(channel);
|
||||
}
|
||||
|
||||
|
||||
@@ -61,7 +61,7 @@ public abstract class BriarActivity extends BaseActivity {
|
||||
@Override
|
||||
public void onStart() {
|
||||
super.onStart();
|
||||
if (!briarController.accountSignedIn() && !isFinishing()) {
|
||||
if (!briarController.accountSignedIn()) {
|
||||
Intent i = new Intent(this, PasswordActivity.class);
|
||||
startActivityForResult(i, REQUEST_PASSWORD);
|
||||
} else if (SDK_INT >= 23) {
|
||||
|
||||
@@ -23,8 +23,6 @@ import org.briarproject.briar.api.android.AndroidNotificationManager;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import static android.content.Intent.ACTION_MAIN;
|
||||
import static android.content.Intent.CATEGORY_HOME;
|
||||
import static android.content.Intent.FLAG_ACTIVITY_CLEAR_TASK;
|
||||
import static android.content.Intent.FLAG_ACTIVITY_NEW_TASK;
|
||||
import static android.view.View.INVISIBLE;
|
||||
@@ -56,7 +54,8 @@ public class PasswordActivity extends BaseActivity {
|
||||
overridePendingTransition(R.anim.fade_in, R.anim.fade_out);
|
||||
|
||||
if (!accountManager.accountExists()) {
|
||||
// TODO: Finish instead of deleting account?
|
||||
// This can happen on older devices if the app is relaunched from
|
||||
// recent apps after clearing data
|
||||
deleteAccount();
|
||||
return;
|
||||
}
|
||||
@@ -109,10 +108,8 @@ public class PasswordActivity extends BaseActivity {
|
||||
|
||||
@Override
|
||||
public void onBackPressed() {
|
||||
// Show the home screen rather than another password prompt
|
||||
Intent intent = new Intent(ACTION_MAIN);
|
||||
intent.addCategory(CATEGORY_HOME);
|
||||
startActivity(intent);
|
||||
// Move the whole task to the back, don't show another password prompt
|
||||
moveTaskToBack(true);
|
||||
}
|
||||
|
||||
private void deleteAccount() {
|
||||
|
||||
Reference in New Issue
Block a user