mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-21 00:59:49 +01:00
Add an encrypted key-value store.
SignalStore is backed by SQLCipher and is intended to be used instead of TextSecurePreferences moving forward.
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
package org.thoughtcrime.securesms.logging;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import org.thoughtcrime.securesms.keyvalue.SignalStore;
|
||||
|
||||
public class SignalUncaughtExceptionHandler implements Thread.UncaughtExceptionHandler {
|
||||
|
||||
private static final String TAG = SignalUncaughtExceptionHandler.class.getSimpleName();
|
||||
|
||||
private final Thread.UncaughtExceptionHandler originalHandler;
|
||||
|
||||
public SignalUncaughtExceptionHandler(@NonNull Thread.UncaughtExceptionHandler originalHandler) {
|
||||
this.originalHandler = originalHandler;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void uncaughtException(Thread t, Throwable e) {
|
||||
Log.e(TAG, "", e);
|
||||
SignalStore.blockUntilAllWritesFinished();
|
||||
Log.blockUntilAllWritesFinished();
|
||||
originalHandler.uncaughtException(t, e);
|
||||
}
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
package org.thoughtcrime.securesms.logging;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
public class UncaughtExceptionLogger implements Thread.UncaughtExceptionHandler {
|
||||
|
||||
private static final String TAG = UncaughtExceptionLogger.class.getSimpleName();
|
||||
|
||||
private final Thread.UncaughtExceptionHandler originalHandler;
|
||||
|
||||
public UncaughtExceptionLogger(@NonNull Thread.UncaughtExceptionHandler originalHandler) {
|
||||
this.originalHandler = originalHandler;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void uncaughtException(Thread t, Throwable e) {
|
||||
Log.e(TAG, "", e);
|
||||
Log.blockUntilAllWritesFinished();
|
||||
originalHandler.uncaughtException(t, e);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user