From c66e221598ed2c0cb8f5bee2dbfd64e65dc0cb44 Mon Sep 17 00:00:00 2001 From: Moxie Marlinspike Date: Tue, 20 Nov 2012 18:49:56 -0800 Subject: [PATCH] Signal that we don't want screenshots of unlocked activities. --- src/org/thoughtcrime/securesms/ConversationActivity.java | 6 ++++++ .../thoughtcrime/securesms/ConversationListActivity.java | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/src/org/thoughtcrime/securesms/ConversationActivity.java b/src/org/thoughtcrime/securesms/ConversationActivity.java index 0c9fa76d0e..f7906e99cc 100644 --- a/src/org/thoughtcrime/securesms/ConversationActivity.java +++ b/src/org/thoughtcrime/securesms/ConversationActivity.java @@ -24,6 +24,7 @@ import android.content.DialogInterface; import android.content.Intent; import android.content.IntentFilter; import android.net.Uri; +import android.os.Build; import android.os.Bundle; import android.preference.PreferenceManager; import android.telephony.PhoneNumberUtils; @@ -35,6 +36,7 @@ import android.view.KeyEvent; import android.view.View; import android.view.View.OnClickListener; import android.view.View.OnKeyListener; +import android.view.WindowManager; import android.view.inputmethod.EditorInfo; import android.widget.Button; import android.widget.EditText; @@ -435,6 +437,10 @@ public class ConversationActivity extends SherlockFragmentActivity registerForContextMenu(sendButton); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) { + getWindow().setFlags(WindowManager.LayoutParams.FLAG_SECURE, WindowManager.LayoutParams.FLAG_SECURE); + } + if (getIntent().getStringExtra("forwarded_message") != null) composeText.setText(getString(R.string.ConversationActivity_forward_message_prefix)+": " + getIntent().getStringExtra("forwarded_message")); } diff --git a/src/org/thoughtcrime/securesms/ConversationListActivity.java b/src/org/thoughtcrime/securesms/ConversationListActivity.java index 507e1d8085..39d4eeb6e2 100644 --- a/src/org/thoughtcrime/securesms/ConversationListActivity.java +++ b/src/org/thoughtcrime/securesms/ConversationListActivity.java @@ -9,11 +9,13 @@ import android.content.IntentFilter; import android.content.ServiceConnection; import android.content.SharedPreferences; import android.database.ContentObserver; +import android.os.Build; import android.os.Bundle; import android.os.IBinder; import android.os.Parcelable; import android.provider.ContactsContract; import android.util.Log; +import android.view.WindowManager; import com.actionbarsherlock.app.SherlockFragmentActivity; import com.actionbarsherlock.view.Menu; @@ -299,6 +301,10 @@ public class ConversationListActivity extends SherlockFragmentActivity } private void initializeResources() { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) { + getWindow().setFlags(WindowManager.LayoutParams.FLAG_SECURE, WindowManager.LayoutParams.FLAG_SECURE); + } + this.fragment = (ConversationListFragment)this.getSupportFragmentManager() .findFragmentById(R.id.fragment_content); }