Merge "Fixed potential string conversion issues"
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 5a3c017..d6aacd8 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -153,6 +153,9 @@
     <uses-permission android:name="android.permission.ACCESS_TELEPHONY_SIMINFO_DB"/>
     <uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
 
+    <!-- Needed to block unwanted malicious pop up overlays -->
+    <uses-permission android:name="android.permission.HIDE_NON_SYSTEM_OVERLAY_WINDOWS"/>
+
     <permission android:name="com.android.phone.permission.ACCESS_LAST_KNOWN_CELL_ID"
                 android:label="Access last known cell identity."
                 android:protectionLevel="signature"/>
diff --git a/src/com/android/phone/SubscriptionInfoHelper.java b/src/com/android/phone/SubscriptionInfoHelper.java
index 14faebc..f964f82 100644
--- a/src/com/android/phone/SubscriptionInfoHelper.java
+++ b/src/com/android/phone/SubscriptionInfoHelper.java
@@ -55,8 +55,8 @@
      */
     public SubscriptionInfoHelper(Context context, Intent intent) {
         mContext = context;
-        PhoneAccountHandle phoneAccountHandle =
-                intent.getParcelableExtra(TelephonyManager.EXTRA_PHONE_ACCOUNT_HANDLE);
+        PhoneAccountHandle phoneAccountHandle = intent.getParcelableExtra(
+                TelephonyManager.EXTRA_PHONE_ACCOUNT_HANDLE, PhoneAccountHandle.class);
         if (phoneAccountHandle != null) {
             mSubId = PhoneUtils.getSubIdForPhoneAccountHandle(phoneAccountHandle);
         }
diff --git a/src/com/android/phone/settings/AccessibilitySettingsActivity.java b/src/com/android/phone/settings/AccessibilitySettingsActivity.java
index 99b1478..7cc18f6 100644
--- a/src/com/android/phone/settings/AccessibilitySettingsActivity.java
+++ b/src/com/android/phone/settings/AccessibilitySettingsActivity.java
@@ -20,17 +20,21 @@
 import android.os.Bundle;
 import android.preference.PreferenceActivity;
 import android.view.MenuItem;
+import android.view.WindowManager;
 
 import com.android.phone.R;
 
 public class AccessibilitySettingsActivity extends PreferenceActivity {
 
-   @Override
+    @Override
     protected void onCreate(Bundle icicle) {
         super.onCreate(icicle);
+        getWindow().addSystemFlags(
+                android.view.WindowManager.LayoutParams
+                        .SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS);
         final ActionBar actionBar = getActionBar();
         if (actionBar != null) {
-          actionBar.setTitle(R.string.accessibility_settings_activity_title);
+            actionBar.setTitle(R.string.accessibility_settings_activity_title);
         }
         getFragmentManager().beginTransaction().replace(
                 android.R.id.content, new AccessibilitySettingsFragment()).commit();
diff --git a/src/com/android/phone/settings/PhoneAccountSettingsActivity.java b/src/com/android/phone/settings/PhoneAccountSettingsActivity.java
index 56f5594..e15be39 100644
--- a/src/com/android/phone/settings/PhoneAccountSettingsActivity.java
+++ b/src/com/android/phone/settings/PhoneAccountSettingsActivity.java
@@ -20,6 +20,7 @@
 import android.os.Bundle;
 import android.preference.PreferenceActivity;
 import android.view.MenuItem;
+import android.view.WindowManager;
 
 import com.android.phone.R;
 
@@ -28,6 +29,9 @@
     @Override
     protected void onCreate(Bundle icicle) {
         super.onCreate(icicle);
+        getWindow().addSystemFlags(
+                android.view.WindowManager.LayoutParams
+                        .SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS);
         final ActionBar actionBar = getActionBar();
         if (actionBar != null) {
             actionBar.setTitle(R.string.phone_accounts);
diff --git a/src/com/android/phone/settings/PickSmsSubscriptionActivity.java b/src/com/android/phone/settings/PickSmsSubscriptionActivity.java
index cfbce28..97dada0 100644
--- a/src/com/android/phone/settings/PickSmsSubscriptionActivity.java
+++ b/src/com/android/phone/settings/PickSmsSubscriptionActivity.java
@@ -22,6 +22,7 @@
 import android.os.Bundle;
 import android.os.RemoteException;
 import android.telephony.SubscriptionManager;
+import android.view.WindowManager;
 import android.util.Log;
 
 import com.android.internal.telephony.IIntegerConsumer;
@@ -91,6 +92,9 @@
     @Override
     protected void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
+        getWindow().addSystemFlags(
+                android.view.WindowManager.LayoutParams
+                        .SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS);
         mPreviouslyStopped = false;
     }
 
diff --git a/src/com/android/phone/settings/VoicemailSettingsActivity.java b/src/com/android/phone/settings/VoicemailSettingsActivity.java
index 2bd5306..02bf4b2 100644
--- a/src/com/android/phone/settings/VoicemailSettingsActivity.java
+++ b/src/com/android/phone/settings/VoicemailSettingsActivity.java
@@ -39,6 +39,7 @@
 import android.text.TextUtils;
 import android.util.Log;
 import android.view.MenuItem;
+import android.view.WindowManager;
 import android.widget.ListAdapter;
 import android.widget.Toast;
 
@@ -211,6 +212,9 @@
     @Override
     protected void onCreate(Bundle icicle) {
         super.onCreate(icicle);
+        getWindow().addSystemFlags(
+                android.view.WindowManager.LayoutParams
+                        .SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS);
         // Make sure we are running as the primary user only
         UserManager userManager = getApplicationContext().getSystemService(UserManager.class);
         if (!userManager.isPrimaryUser()) {