mirror of
https://github.com/oxen-io/session-android.git
synced 2025-10-27 00:08:38 +00:00
Reword the very confusing screen security setting
This commit is contained in:
committed by
Moxie Marlinspike
parent
d51adab76b
commit
bd889d8fa9
@@ -217,8 +217,8 @@ public class ApplicationPreferencesActivity extends PassphraseRequiredSherlockPr
|
||||
pushSmsCategory.removePreference(defaultPreference);
|
||||
}
|
||||
|
||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR1 &&
|
||||
advancedCategory != null &&
|
||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.ICE_CREAM_SANDWICH &&
|
||||
advancedCategory != null &&
|
||||
screenSecurityPreference != null)
|
||||
{
|
||||
advancedCategory.removePreference(screenSecurityPreference);
|
||||
|
||||
@@ -690,6 +690,14 @@ public class ConversationActivity extends PassphraseRequiredSherlockFragmentActi
|
||||
drawables.recycle();
|
||||
|
||||
calculateCharactersRemaining();
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
|
||||
if (TextSecurePreferences.isScreenSecurityEnabled(this)) {
|
||||
getWindow().addFlags(WindowManager.LayoutParams.FLAG_SECURE);
|
||||
} else {
|
||||
getWindow().clearFlags(WindowManager.LayoutParams.FLAG_SECURE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void initializeMmsEnabledCheck() {
|
||||
@@ -753,10 +761,6 @@ public class ConversationActivity extends PassphraseRequiredSherlockFragmentActi
|
||||
});
|
||||
|
||||
registerForContextMenu(sendButton);
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB && TextSecurePreferences.isScreenSecurityEnabled(this)) {
|
||||
getWindow().setFlags(WindowManager.LayoutParams.FLAG_SECURE, WindowManager.LayoutParams.FLAG_SECURE);
|
||||
}
|
||||
}
|
||||
|
||||
private void initializeReceivers() {
|
||||
|
||||
@@ -86,6 +86,7 @@ public class ConversationListActivity extends PassphraseRequiredSherlockFragment
|
||||
dynamicLanguage.onResume(this);
|
||||
|
||||
initializeDefaultMessengerCheck();
|
||||
initializeSecurity();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -279,11 +280,6 @@ public class ConversationListActivity extends PassphraseRequiredSherlockFragment
|
||||
}
|
||||
|
||||
private void initializeResources() {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB && TextSecurePreferences.isScreenSecurityEnabled(this)) {
|
||||
getWindow().setFlags(WindowManager.LayoutParams.FLAG_SECURE,
|
||||
WindowManager.LayoutParams.FLAG_SECURE);
|
||||
}
|
||||
|
||||
this.drawerLayout = (DrawerLayout)findViewById(R.id.drawer_layout);
|
||||
this.drawerList = (ListView)findViewById(R.id.left_drawer);
|
||||
this.masterSecret = getIntent().getParcelableExtra("master_secret");
|
||||
@@ -303,6 +299,16 @@ public class ConversationListActivity extends PassphraseRequiredSherlockFragment
|
||||
}
|
||||
}
|
||||
|
||||
private void initializeSecurity() {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
|
||||
if (TextSecurePreferences.isScreenSecurityEnabled(this)) {
|
||||
getWindow().addFlags(WindowManager.LayoutParams.FLAG_SECURE);
|
||||
} else {
|
||||
getWindow().clearFlags(WindowManager.LayoutParams.FLAG_SECURE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class DrawerToggle extends ActionBarDrawerToggle {
|
||||
|
||||
public DrawerToggle(Activity activity, DrawerLayout drawerLayout,
|
||||
|
||||
@@ -72,6 +72,7 @@ public class ShareActivity extends PassphraseRequiredSherlockFragmentActivity
|
||||
dynamicTheme.onResume(this);
|
||||
dynamicLanguage.onResume(this);
|
||||
getSupportActionBar().setTitle(R.string.ShareActivity_share_with);
|
||||
initializeSecurity();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -132,11 +133,6 @@ public class ShareActivity extends PassphraseRequiredSherlockFragmentActivity
|
||||
}
|
||||
|
||||
private void initializeResources() {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB && TextSecurePreferences.isScreenSecurityEnabled(this)) {
|
||||
getWindow().setFlags(WindowManager.LayoutParams.FLAG_SECURE,
|
||||
WindowManager.LayoutParams.FLAG_SECURE);
|
||||
}
|
||||
|
||||
this.masterSecret = getIntent().getParcelableExtra(MASTER_SECRET_EXTRA);
|
||||
|
||||
this.fragment = (ShareFragment)this.getSupportFragmentManager()
|
||||
@@ -145,6 +141,16 @@ public class ShareActivity extends PassphraseRequiredSherlockFragmentActivity
|
||||
this.fragment.setMasterSecret(masterSecret);
|
||||
}
|
||||
|
||||
private void initializeSecurity() {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
|
||||
if (TextSecurePreferences.isScreenSecurityEnabled(this)) {
|
||||
getWindow().addFlags(WindowManager.LayoutParams.FLAG_SECURE);
|
||||
} else {
|
||||
getWindow().clearFlags(WindowManager.LayoutParams.FLAG_SECURE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private Intent getBaseShareIntent(final Class<?> target) {
|
||||
final Intent intent = new Intent(this, target);
|
||||
final Intent originalIntent = getIntent();
|
||||
|
||||
Reference in New Issue
Block a user