mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-13 03:09:04 +01:00
Compare commits
5 Commits
alpha-1.2.
...
beta-1.2.1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8a534b4503 | ||
|
|
e5b2275c82 | ||
|
|
5159593825 | ||
|
|
6fbc82ee27 | ||
|
|
fb2b4209cf |
@@ -11,8 +11,8 @@ android {
|
|||||||
defaultConfig {
|
defaultConfig {
|
||||||
minSdkVersion 16
|
minSdkVersion 16
|
||||||
targetSdkVersion 29
|
targetSdkVersion 29
|
||||||
versionCode 10215
|
versionCode 10216
|
||||||
versionName "1.2.15"
|
versionName "1.2.16"
|
||||||
consumerProguardFiles 'proguard-rules.txt'
|
consumerProguardFiles 'proguard-rules.txt'
|
||||||
|
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
|
|||||||
@@ -22,8 +22,8 @@ android {
|
|||||||
defaultConfig {
|
defaultConfig {
|
||||||
minSdkVersion 16
|
minSdkVersion 16
|
||||||
targetSdkVersion 29
|
targetSdkVersion 29
|
||||||
versionCode 10215
|
versionCode 10216
|
||||||
versionName "1.2.15"
|
versionName "1.2.16"
|
||||||
applicationId "org.briarproject.briar.android"
|
applicationId "org.briarproject.briar.android"
|
||||||
|
|
||||||
vectorDrawables.useSupportLibrary = true
|
vectorDrawables.useSupportLibrary = true
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ import javax.inject.Inject;
|
|||||||
import androidx.core.app.NotificationCompat;
|
import androidx.core.app.NotificationCompat;
|
||||||
|
|
||||||
import static android.app.NotificationManager.IMPORTANCE_DEFAULT;
|
import static android.app.NotificationManager.IMPORTANCE_DEFAULT;
|
||||||
import static android.app.NotificationManager.IMPORTANCE_NONE;
|
import static android.app.NotificationManager.IMPORTANCE_LOW;
|
||||||
import static android.app.PendingIntent.FLAG_UPDATE_CURRENT;
|
import static android.app.PendingIntent.FLAG_UPDATE_CURRENT;
|
||||||
import static android.content.Intent.ACTION_SHUTDOWN;
|
import static android.content.Intent.ACTION_SHUTDOWN;
|
||||||
import static android.content.Intent.FLAG_ACTIVITY_CLEAR_TASK;
|
import static android.content.Intent.FLAG_ACTIVITY_CLEAR_TASK;
|
||||||
@@ -56,6 +56,7 @@ import static org.briarproject.briar.android.BriarApplication.ENTRY_ACTIVITY;
|
|||||||
import static org.briarproject.briar.api.android.AndroidNotificationManager.FAILURE_CHANNEL_ID;
|
import static org.briarproject.briar.api.android.AndroidNotificationManager.FAILURE_CHANNEL_ID;
|
||||||
import static org.briarproject.briar.api.android.AndroidNotificationManager.FAILURE_NOTIFICATION_ID;
|
import static org.briarproject.briar.api.android.AndroidNotificationManager.FAILURE_NOTIFICATION_ID;
|
||||||
import static org.briarproject.briar.api.android.AndroidNotificationManager.ONGOING_CHANNEL_ID;
|
import static org.briarproject.briar.api.android.AndroidNotificationManager.ONGOING_CHANNEL_ID;
|
||||||
|
import static org.briarproject.briar.api.android.AndroidNotificationManager.ONGOING_CHANNEL_OLD_ID;
|
||||||
import static org.briarproject.briar.api.android.AndroidNotificationManager.ONGOING_NOTIFICATION_ID;
|
import static org.briarproject.briar.api.android.AndroidNotificationManager.ONGOING_NOTIFICATION_ID;
|
||||||
import static org.briarproject.briar.api.android.LockManager.ACTION_LOCK;
|
import static org.briarproject.briar.api.android.LockManager.ACTION_LOCK;
|
||||||
|
|
||||||
@@ -120,11 +121,17 @@ public class BriarService extends Service {
|
|||||||
if (SDK_INT >= 26) {
|
if (SDK_INT >= 26) {
|
||||||
NotificationManager nm = (NotificationManager)
|
NotificationManager nm = (NotificationManager)
|
||||||
requireNonNull(getSystemService(NOTIFICATION_SERVICE));
|
requireNonNull(getSystemService(NOTIFICATION_SERVICE));
|
||||||
|
// Delete the old notification channel, which had
|
||||||
|
// IMPORTANCE_NONE and showed a badge
|
||||||
|
nm.deleteNotificationChannel(ONGOING_CHANNEL_OLD_ID);
|
||||||
|
// Use IMPORTANCE_LOW so the system doesn't show its own
|
||||||
|
// notification on API 26-27
|
||||||
NotificationChannel ongoingChannel = new NotificationChannel(
|
NotificationChannel ongoingChannel = new NotificationChannel(
|
||||||
ONGOING_CHANNEL_ID,
|
ONGOING_CHANNEL_ID,
|
||||||
getString(R.string.ongoing_notification_title),
|
getString(R.string.ongoing_notification_title),
|
||||||
IMPORTANCE_NONE);
|
IMPORTANCE_LOW);
|
||||||
ongoingChannel.setLockscreenVisibility(VISIBILITY_SECRET);
|
ongoingChannel.setLockscreenVisibility(VISIBILITY_SECRET);
|
||||||
|
ongoingChannel.setShowBadge(false);
|
||||||
nm.createNotificationChannel(ongoingChannel);
|
nm.createNotificationChannel(ongoingChannel);
|
||||||
NotificationChannel failureChannel = new NotificationChannel(
|
NotificationChannel failureChannel = new NotificationChannel(
|
||||||
FAILURE_CHANNEL_ID,
|
FAILURE_CHANNEL_ID,
|
||||||
|
|||||||
@@ -197,6 +197,10 @@ public abstract class ThreadListViewModel<I extends ThreadItem>
|
|||||||
*/
|
*/
|
||||||
@UiThread
|
@UiThread
|
||||||
protected void addItem(I item, boolean scrollToItem) {
|
protected void addItem(I item, boolean scrollToItem) {
|
||||||
|
// If items haven't loaded, we need to wait until they have.
|
||||||
|
// Since this was a R/W DB transaction, the load will pick up this item.
|
||||||
|
if (items.getValue() == null) return;
|
||||||
|
|
||||||
messageTree.add(item);
|
messageTree.add(item);
|
||||||
if (scrollToItem) this.scrollToItem.set(item.getId());
|
if (scrollToItem) this.scrollToItem.set(item.getId());
|
||||||
items.setValue(new LiveResult<>(messageTree.depthFirstOrder()));
|
items.setValue(new LiveResult<>(messageTree.depthFirstOrder()));
|
||||||
|
|||||||
@@ -39,7 +39,8 @@ public interface AndroidNotificationManager {
|
|||||||
String BLOG_CHANNEL_ID = "blogs";
|
String BLOG_CHANNEL_ID = "blogs";
|
||||||
// Channels are sorted by channel ID in the Settings app, so use IDs
|
// Channels are sorted by channel ID in the Settings app, so use IDs
|
||||||
// that will sort below the main channels such as contacts
|
// that will sort below the main channels such as contacts
|
||||||
String ONGOING_CHANNEL_ID = "zForegroundService";
|
String ONGOING_CHANNEL_OLD_ID = "zForegroundService";
|
||||||
|
String ONGOING_CHANNEL_ID = "zForegroundService2";
|
||||||
String FAILURE_CHANNEL_ID = "zStartupFailure";
|
String FAILURE_CHANNEL_ID = "zStartupFailure";
|
||||||
String REMINDER_CHANNEL_ID = "zSignInReminder";
|
String REMINDER_CHANNEL_ID = "zSignInReminder";
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user