mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-12 10:49:06 +01:00
Compare commits
4 Commits
integratio
...
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_LIGHTS;
|
||||||
import static android.app.Notification.DEFAULT_SOUND;
|
import static android.app.Notification.DEFAULT_SOUND;
|
||||||
import static android.app.Notification.DEFAULT_VIBRATE;
|
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_DEFAULT;
|
||||||
import static android.app.NotificationManager.IMPORTANCE_LOW;
|
import static android.app.NotificationManager.IMPORTANCE_LOW;
|
||||||
import static android.content.Context.NOTIFICATION_SERVICE;
|
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_MESSAGE;
|
||||||
import static android.support.v4.app.NotificationCompat.CATEGORY_SOCIAL;
|
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.PRIORITY_LOW;
|
||||||
|
import static android.support.v4.app.NotificationCompat.VISIBILITY_SECRET;
|
||||||
import static java.util.logging.Level.WARNING;
|
import static java.util.logging.Level.WARNING;
|
||||||
import static org.briarproject.bramble.util.LogUtils.logException;
|
import static org.briarproject.bramble.util.LogUtils.logException;
|
||||||
import static org.briarproject.briar.android.activity.BriarActivity.GROUP_ID;
|
import static org.briarproject.briar.android.activity.BriarActivity.GROUP_ID;
|
||||||
@@ -623,13 +623,12 @@ class AndroidNotificationManagerImpl implements AndroidNotificationManager,
|
|||||||
public void showSignInNotification() {
|
public void showSignInNotification() {
|
||||||
if (blockSignInReminder) return;
|
if (blockSignInReminder) return;
|
||||||
if (SDK_INT >= 26) {
|
if (SDK_INT >= 26) {
|
||||||
|
String title = appContext
|
||||||
|
.getString(R.string.reminder_notification_channel_title);
|
||||||
NotificationChannel channel =
|
NotificationChannel channel =
|
||||||
new NotificationChannel(REMINDER_CHANNEL_ID, appContext
|
new NotificationChannel(REMINDER_CHANNEL_ID, title,
|
||||||
.getString(
|
|
||||||
R.string.reminder_notification_channel_title),
|
|
||||||
IMPORTANCE_LOW);
|
IMPORTANCE_LOW);
|
||||||
channel.setLockscreenVisibility(
|
channel.setLockscreenVisibility(VISIBILITY_SECRET);
|
||||||
NotificationCompat.VISIBILITY_SECRET);
|
|
||||||
notificationManager.createNotificationChannel(channel);
|
notificationManager.createNotificationChannel(channel);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ public abstract class BriarActivity extends BaseActivity {
|
|||||||
@Override
|
@Override
|
||||||
public void onStart() {
|
public void onStart() {
|
||||||
super.onStart();
|
super.onStart();
|
||||||
if (!briarController.accountSignedIn() && !isFinishing()) {
|
if (!briarController.accountSignedIn()) {
|
||||||
Intent i = new Intent(this, PasswordActivity.class);
|
Intent i = new Intent(this, PasswordActivity.class);
|
||||||
startActivityForResult(i, REQUEST_PASSWORD);
|
startActivityForResult(i, REQUEST_PASSWORD);
|
||||||
} else if (SDK_INT >= 23) {
|
} else if (SDK_INT >= 23) {
|
||||||
|
|||||||
@@ -23,8 +23,6 @@ import org.briarproject.briar.api.android.AndroidNotificationManager;
|
|||||||
|
|
||||||
import javax.inject.Inject;
|
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_CLEAR_TASK;
|
||||||
import static android.content.Intent.FLAG_ACTIVITY_NEW_TASK;
|
import static android.content.Intent.FLAG_ACTIVITY_NEW_TASK;
|
||||||
import static android.view.View.INVISIBLE;
|
import static android.view.View.INVISIBLE;
|
||||||
@@ -56,7 +54,8 @@ public class PasswordActivity extends BaseActivity {
|
|||||||
overridePendingTransition(R.anim.fade_in, R.anim.fade_out);
|
overridePendingTransition(R.anim.fade_in, R.anim.fade_out);
|
||||||
|
|
||||||
if (!accountManager.accountExists()) {
|
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();
|
deleteAccount();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -109,10 +108,8 @@ public class PasswordActivity extends BaseActivity {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onBackPressed() {
|
public void onBackPressed() {
|
||||||
// Show the home screen rather than another password prompt
|
// Move the whole task to the back, don't show another password prompt
|
||||||
Intent intent = new Intent(ACTION_MAIN);
|
moveTaskToBack(true);
|
||||||
intent.addCategory(CATEGORY_HOME);
|
|
||||||
startActivity(intent);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void deleteAccount() {
|
private void deleteAccount() {
|
||||||
|
|||||||
Reference in New Issue
Block a user