mirror of
https://github.com/oxen-io/session-android.git
synced 2025-01-03 13:47:45 +00:00
fix: use the context compat register receiver to fix Android 14 crash (#1338)
This commit is contained in:
parent
cb1b5b0f78
commit
6f22eb659b
@ -9,13 +9,14 @@ import android.os.Bundle;
|
||||
import androidx.annotation.IdRes;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
||||
import org.session.libsession.utilities.TextSecurePreferences;
|
||||
import org.session.libsignal.utilities.Log;
|
||||
import org.thoughtcrime.securesms.home.HomeActivity;
|
||||
import org.thoughtcrime.securesms.onboarding.LandingActivity;
|
||||
import org.thoughtcrime.securesms.service.KeyCachingService;
|
||||
import org.session.libsession.utilities.TextSecurePreferences;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
@ -168,7 +169,13 @@ public abstract class PassphraseRequiredActionBarActivity extends BaseActionBarA
|
||||
};
|
||||
|
||||
IntentFilter filter = new IntentFilter(KeyCachingService.CLEAR_KEY_EVENT);
|
||||
registerReceiver(clearKeyReceiver, filter, KeyCachingService.KEY_PERMISSION, null);
|
||||
ContextCompat.registerReceiver(
|
||||
this,
|
||||
clearKeyReceiver, filter,
|
||||
KeyCachingService.KEY_PERMISSION,
|
||||
null,
|
||||
ContextCompat.RECEIVER_NOT_EXPORTED
|
||||
);
|
||||
}
|
||||
|
||||
private void removeClearKeyReceiver(Context context) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user