mirror of
https://github.com/oxen-io/session-android.git
synced 2025-10-24 12:40:24 +00:00
@@ -44,6 +44,7 @@ import org.thoughtcrime.securesms.jobs.DirectoryRefreshJob;
|
||||
import org.thoughtcrime.securesms.jobs.PushDecryptJob;
|
||||
import org.thoughtcrime.securesms.jobs.RefreshAttributesJob;
|
||||
import org.thoughtcrime.securesms.notifications.MessageNotifier;
|
||||
import org.thoughtcrime.securesms.util.TextSecurePreferences;
|
||||
import org.thoughtcrime.securesms.util.Util;
|
||||
import org.thoughtcrime.securesms.util.VersionTracker;
|
||||
|
||||
@@ -70,6 +71,7 @@ public class DatabaseUpgradeActivity extends BaseActivity {
|
||||
public static final int REDPHONE_SUPPORT_VERSION = 157;
|
||||
public static final int NO_MORE_CANONICAL_DB_VERSION = 276;
|
||||
public static final int PROFILES = 289;
|
||||
public static final int SCREENSHOTS = 300;
|
||||
|
||||
private static final SortedSet<Integer> UPGRADE_VERSIONS = new TreeSet<Integer>() {{
|
||||
add(NO_MORE_KEY_EXCHANGE_PREFIX_VERSION);
|
||||
@@ -84,6 +86,7 @@ public class DatabaseUpgradeActivity extends BaseActivity {
|
||||
add(MEDIA_DOWNLOAD_CONTROLS_VERSION);
|
||||
add(REDPHONE_SUPPORT_VERSION);
|
||||
add(NO_MORE_CANONICAL_DB_VERSION);
|
||||
add(SCREENSHOTS);
|
||||
}};
|
||||
|
||||
private MasterSecret masterSecret;
|
||||
@@ -240,6 +243,10 @@ public class DatabaseUpgradeActivity extends BaseActivity {
|
||||
.add(new DirectoryRefreshJob(getApplicationContext()));
|
||||
}
|
||||
|
||||
if (params[0] < SCREENSHOTS) {
|
||||
TextSecurePreferences.setScreenSecurityEnabled(getApplicationContext(), true);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@@ -37,14 +37,17 @@ public class ComposeText extends EmojiEditText {
|
||||
|
||||
public ComposeText(Context context) {
|
||||
super(context);
|
||||
initialize();
|
||||
}
|
||||
|
||||
public ComposeText(Context context, AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
initialize();
|
||||
}
|
||||
|
||||
public ComposeText(Context context, AttributeSet attrs, int defStyleAttr) {
|
||||
super(context, attrs, defStyleAttr);
|
||||
initialize();
|
||||
}
|
||||
|
||||
public String getTextTrimmed(){
|
||||
@@ -107,6 +110,7 @@ public class ComposeText extends EmojiEditText {
|
||||
|
||||
public void setTransport(TransportOption transport) {
|
||||
final boolean useSystemEmoji = TextSecurePreferences.isSystemEmojiPreferred(getContext());
|
||||
final boolean isIncognito = TextSecurePreferences.isIncognitoKeyboardEnabled(getContext());
|
||||
|
||||
int imeOptions = (getImeOptions() & ~EditorInfo.IME_MASK_ACTION) | EditorInfo.IME_ACTION_SEND;
|
||||
int inputType = getInputType();
|
||||
@@ -146,6 +150,11 @@ public class ComposeText extends EmojiEditText {
|
||||
this.mediaListener = mediaListener;
|
||||
}
|
||||
|
||||
private void initialize() {
|
||||
if (TextSecurePreferences.isIncognitoKeyboardEnabled(getContext())) {
|
||||
setImeOptions(getImeOptions() | 16777216);
|
||||
}
|
||||
}
|
||||
|
||||
@RequiresApi(api = Build.VERSION_CODES.HONEYCOMB_MR2)
|
||||
private static class CommitContentListener implements InputConnectionCompat.OnCommitContentListener {
|
||||
|
||||
@@ -113,6 +113,11 @@ public class TextSecurePreferences {
|
||||
private static final String PROFILE_KEY_PREF = "pref_profile_key";
|
||||
private static final String PROFILE_NAME_PREF = "pref_profile_name";
|
||||
public static final String READ_RECEIPTS_PREF = "pref_read_receipts";
|
||||
public static final String INCOGNITO_KEYBORAD_PREF = "pref_incognito_keyboard";
|
||||
|
||||
public static boolean isIncognitoKeyboardEnabled(Context context) {
|
||||
return getBooleanPreference(context, INCOGNITO_KEYBORAD_PREF, false);
|
||||
}
|
||||
|
||||
public static boolean isReadReceiptsEnabled(Context context) {
|
||||
return getBooleanPreference(context, READ_RECEIPTS_PREF, false);
|
||||
@@ -471,8 +476,12 @@ public class TextSecurePreferences {
|
||||
setStringPreference(context, IDENTITY_PREF, identityUri);
|
||||
}
|
||||
|
||||
public static void setScreenSecurityEnabled(Context context, boolean value) {
|
||||
setBooleanPreference(context, SCREEN_SECURITY_PREF, value);
|
||||
}
|
||||
|
||||
public static boolean isScreenSecurityEnabled(Context context) {
|
||||
return getBooleanPreference(context, SCREEN_SECURITY_PREF, true);
|
||||
return getBooleanPreference(context, SCREEN_SECURITY_PREF, false);
|
||||
}
|
||||
|
||||
public static boolean isLegacyUseLocalApnsEnabled(Context context) {
|
||||
|
||||
Reference in New Issue
Block a user