Merge pull request #794 from SamWhited/issue788

Add option to disable screen security
This commit is contained in:
Moxie Marlinspike 2014-02-27 18:02:05 -08:00
commit a3e900ecbe
4 changed files with 60 additions and 57 deletions

View File

@ -173,7 +173,6 @@
<string name="ImportFragment_no_encrypted_backup_found">No encrypted backup found!</string>
<string name="ImportFragment_restore_complete">Restore complete!</string>
<!-- KeyScanningActivity -->
<string name="KeyScanningActivity_no_scanned_key_found_exclamation">No scanned key found!</string>
@ -385,7 +384,6 @@
<string name="ViewLocalIdentityActivity_cancel">Cancel</string>
<string name="ViewLocalIdentityActivity_continue">Continue</string>
<!-- SmsReceiver -->
<string name="SmsReceiver_currently_unable_to_send_your_sms_message">Currently unable to send your SMS message. It will be sent once service becomes available.</string>
@ -489,7 +487,6 @@
<!-- mms_preferences_activity -->
<string name="mms_preferences_activity__manual_mms_settings_are_required">Manual MMS settings are required for your phone.</string>
<!-- prompt_passphrase_activity -->
<string name="prompt_passphrase_activity__textsecure_passphrase">TEXTSECURE PASSPHRASE</string>
<string name="prompt_passphrase_activity__unlock">Unlock</string>
@ -645,7 +642,9 @@
<string name="preferences__complete_key_exchanges">Complete key exchanges</string>
<string name="preferences__disable_passphrase">Disable passphrase</string>
<string name="preferences__disable_local_encryption_of_messages_and_keys">Disable local encryption of messages and keys</string>
<string name="preferences__screen_security">Screen security</string>
<string name="preferences__automatically_complete_key_exchanges_for_new_sessions_or_for_existing_sessions_with_the_same_identity_key">Automatically complete key exchanges for new sessions or for existing sessions with the same identity key</string>
<string name="preferences__disable_screen_security_to_allow_screen_shots">Disable screen security to allow screen shots</string>
<string name="preferences__forget_passphrase_from_memory_after_some_interval">Forget passphrase from memory after some interval</string>
<string name="preferences__timeout_passphrase">Timeout passphrase</string>
<string name="preferences__pref_timeout_interval_dialogtitle">Select Passphrase Timeout</string>
@ -715,7 +714,6 @@
<string name="preferences__refresh_push_directory">Refresh Push Directory</string>
<string name="preferences__submit_debug_log">Submit debug log</string>
<!-- **************************************** -->
<!-- menus -->
<!-- **************************************** -->

View File

@ -54,7 +54,6 @@
android:entries="@array/pref_led_blink_pattern_entries"
android:entryValues="@array/pref_led_blink_pattern_values" />
<RingtonePreference android:layout="?android:attr/preferenceLayoutChild"
android:dependency="pref_key_enable_notifications"
android:key="pref_key_ringtone"
@ -77,7 +76,6 @@
android:title="@string/preferences__vibrate"
android:summary="@string/preferences__also_vibrate_when_notified" />
</PreferenceCategory>
<PreferenceCategory android:title="Input Settings">
@ -162,7 +160,6 @@
android:dependency="pref_timeout_passphrase"
android:dialogTitle="@string/preferences__pref_timeout_interval_dialogtitle" />
</PreferenceCategory>
<PreferenceCategory android:title="@string/preferences__advanced">
@ -171,6 +168,11 @@
android:title="@string/preferences__complete_key_exchanges"
android:summary="@string/preferences__automatically_complete_key_exchanges_for_new_sessions_or_for_existing_sessions_with_the_same_identity_key" />
<CheckBoxPreference android:defaultValue="true"
android:key="pref_screen_security"
android:title="@string/preferences__screen_security"
android:summary="@string/preferences__disable_screen_security_to_allow_screen_shots" />
<Preference android:key="pref_mms_preferences"
android:title="@string/preferences__advanced_mms_access_point_names"/>

View File

@ -479,7 +479,6 @@ public class ConversationActivity extends PassphraseRequiredSherlockFragmentActi
startActivityForResult(intent, GROUP_EDIT);
}
private void handleDistributionBroadcastEnabled(MenuItem item) {
distributionType = ThreadDatabase.DistributionTypes.BROADCAST;
item.setChecked(true);
@ -756,7 +755,7 @@ public class ConversationActivity extends PassphraseRequiredSherlockFragmentActi
registerForContextMenu(sendButton);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB && TextSecurePreferences.isScreenSecurityEnabled(this)) {
getWindow().setFlags(WindowManager.LayoutParams.FLAG_SECURE, WindowManager.LayoutParams.FLAG_SECURE);
}
@ -813,7 +812,6 @@ public class ConversationActivity extends PassphraseRequiredSherlockFragmentActi
new IntentFilter(GroupDatabase.DATABASE_UPDATE_ACTION));
}
//////// Helper Methods
private void addAttachment(int type) {

View File

@ -29,6 +29,7 @@ public class TextSecurePreferences {
private static final String PASSPHRASE_TIMEOUT_INTERVAL_PREF = "pref_timeout_interval";
private static final String PASSPHRASE_TIMEOUT_PREF = "pref_timeout_passphrase";
private static final String AUTO_KEY_EXCHANGE_PREF = "pref_auto_complete_key_exchange";
private static final String SCREEN_SECURITY_PREF = "pref_screen_security";
private static final String ENTER_SENDS_PREF = "pref_enter_sends";
private static final String ENTER_PRESENT_PREF = "pref_enter_key";
private static final String SMS_DELIVERY_REPORT_PREF = "pref_delivery_report_sms";
@ -134,6 +135,10 @@ public class TextSecurePreferences {
return getBooleanPreference(context, AUTO_KEY_EXCHANGE_PREF, true);
}
public static boolean isScreenSecurityEnabled(Context context) {
return getBooleanPreference(context, SCREEN_SECURITY_PREF, true);
}
public static boolean isUseLocalApnsEnabled(Context context) {
return getBooleanPreference(context, ENABLE_MANUAL_MMS_PREF, false);
}