Merge "Import translations. DO NOT MERGE" into jb-mr1-dev
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 112b4b5..a11a948 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -1379,7 +1379,7 @@
         </activity>
 
         <activity android:name="com.android.settings.accounts.AddAccountSettings"
-            android:theme="@android:style/Theme.Holo.Panel"
+            android:theme="@android:style/Theme.Translucent.NoTitleBar"
             android:configChanges="orientation|keyboardHidden|screenSize"
             android:label="@string/header_add_an_account"
             android:taskAffinity="com.android.settings"
diff --git a/res/layout-sw600dp-land/crypt_keeper_password_entry.xml b/res/layout-sw600dp-land/crypt_keeper_password_entry.xml
deleted file mode 100644
index 81222cc..0000000
--- a/res/layout-sw600dp-land/crypt_keeper_password_entry.xml
+++ /dev/null
@@ -1,75 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-**
-** Copyright 2011, The Android Open Source Project
-**
-** Licensed under the Apache License, Version 2.0 (the "License")
-** you may not use this file except in compliance with the License.
-** You may obtain a copy of the License at
-**
-**     http://www.apache.org/licenses/LICENSE-2.0
-**
-** Unless required by applicable law or agreed to in writing, software
-** distributed under the License is distributed on an "AS IS" BASIS,
-** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-** See the License for the specific language governing permissions and
-** limitations under the License.
-*/
--->
-<!-- Layout containing two panes and a keyboard entry. -->
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:orientation="vertical"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent"
->
-
-    <include layout="@layout/crypt_keeper_status" />
-
-    <!-- The right pane contains the encdroid image, a string, and an edit field. -->
-    <RelativeLayout
-        android:layout_width="wrap_content"
-        android:layout_height="0dip"
-        android:layout_weight="1"
-        android:layout_gravity="center_horizontal"
-    >
-        <ImageView android:id="@+id/encroid"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:layout_centerVertical="true"
-            android:src="@drawable/encroid_resignin"
-            android:contentDescription="@null"
-        />
-
-        <TextView android:id="@+id/passwordLabel"
-            android:layout_height="wrap_content"
-            android:layout_width="wrap_content"
-            android:layout_toEndOf="@+id/encroid"
-            android:layout_centerVertical="true"
-            android:paddingEnd="17dip"
-            android:singleLine="true"
-            android:textAppearance="?android:attr/textAppearanceMedium"
-            android:text="@string/crypt_keeper_enter_password"
-        />
-
-        <!-- Password entry field -->
-        <LinearLayout
-            android:layout_height="wrap_content"
-            android:layout_width="320dip"
-            android:layout_toEndOf="@+id/passwordLabel"
-            android:layout_centerVertical="true"
-            android:orientation="horizontal"
-        >
-            <include layout="@layout/crypt_keeper_password_field" />
-        </LinearLayout>
-
-    </RelativeLayout>
-<!-- And this is the keyboard. -->
-    <com.android.internal.widget.PasswordEntryKeyboardView android:id="@+id/keyboard"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:background="#00000000"
-        android:keyBackground="@*android:drawable/btn_keyboard_key_fulltrans"
-        android:visibility="visible"
-    />
-
-</LinearLayout>
diff --git a/res/layout-sw600dp/crypt_keeper_password_entry.xml b/res/layout-sw600dp/crypt_keeper_password_entry.xml
index 731fb22..f0a7cd0 100644
--- a/res/layout-sw600dp/crypt_keeper_password_entry.xml
+++ b/res/layout-sw600dp/crypt_keeper_password_entry.xml
@@ -16,23 +16,25 @@
 ** limitations under the License.
 */
 -->
+
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:orientation="vertical"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
 >
+
     <include layout="@layout/crypt_keeper_status" />
 
     <RelativeLayout
         android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
+        android:layout_height="0dip"
+        android:layout_weight="1"
         android:layout_gravity="center_horizontal"
-        android:layout_marginTop="318dip"
     >
         <ImageView android:id="@+id/encroid"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
-            android:layout_alignParentTop="true"
+            android:layout_centerVertical="true"
             android:src="@drawable/encroid_resignin"
             android:contentDescription="@null"
         />
@@ -41,8 +43,7 @@
             android:layout_height="wrap_content"
             android:layout_width="wrap_content"
             android:layout_toEndOf="@+id/encroid"
-            android:layout_marginTop="37dip"
-            android:paddingStart="17dip"
+            android:layout_centerVertical="true"
             android:paddingEnd="17dip"
             android:singleLine="true"
             android:textAppearance="?android:attr/textAppearanceMedium"
@@ -54,12 +55,11 @@
             android:layout_height="wrap_content"
             android:layout_width="320dip"
             android:layout_toEndOf="@+id/passwordLabel"
-            android:layout_marginTop="26dip"
             android:layout_centerVertical="true"
             android:orientation="horizontal"
         >
             <include layout="@layout/crypt_keeper_password_field" />
         </LinearLayout>
-    </RelativeLayout>
 
+    </RelativeLayout>
 </LinearLayout>
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 1f94287..f66ca3a 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -3091,20 +3091,9 @@
     <!-- Title for the accessibility preference category of system related preferences. [CHAR LIMIT=25] -->
     <string name="accessibility_system_title">System</string>
     <!-- Title for the accessibility preference screen to enable screen magnification. [CHAR LIMIT=35] -->
-    <string name="accessibility_screen_magnification_title">Screen magnification</string>
+    <string name="accessibility_screen_magnification_title">Magnification gestures</string>
     <!-- Summary for the accessibility preference screen to enable screen magnification. [CHAR LIMIT=none] -->
-    <string name="accessibility_screen_magnification_summary">
-        When screen magnification is on, you can\:\n\n
-
-        Zoom: Triple-tap &amp; hold.\n
-        Zoom &amp; pan: Triple-tap &amp; hold, then drag your finger.\n
-        Toggle zoom in or out: Triple tap &amp; release.\n\n
-
-        While you\'re zoomed in, you can:\n
-
-        Pan: Drag two or more fingers across the screen.\n
-        Adjust zoom level: Pinch or expand using two or more fingers.
-    </string>
+    <string name="accessibility_screen_magnification_summary">When this feature is turned on, you can zoom in and out by triple-tapping the screen.\n\nWhile zoomed in, you can:\n<ul><li>Pan: Drag two or more fingers across the screen.</li>\n<li>Adjust zoom level: Pinch two or more fingers together or spread them apart.</li></ul>\n\nYou can also temporarily magnify what\'s under your finger by triple-tapping and holding. In this magnified state, you can drag your finger to explore different parts of the screen. Lift your finger to return to your previous state.\n\nNote: Triple-tap for magnification works everywhere except the keyboard and navigation bar.</string>
     <!-- Title for the preference to enable the global geture that turns on accessibility. [CHAR LIMIT=35] -->
     <string name="accessibility_global_gesture_preference_title">Accessibility shortcut</string>
     <!-- Summary for the preference to enable the global geture that turns on accessibility (on state). [CHAR LIMIT=60] -->
@@ -3112,7 +3101,7 @@
     <!-- Summary for the preference screen to enable the global geture that turns on accessibility (off state). [CHAR LIMIT=35] -->
     <string name="accessibility_global_gesture_preference_summary_off">Off</string>
     <!--  Description for the preference screen to enable the global geture taht turns on accessibility. [CHAR LIMIT=none] -->
-    <string name="accessibility_global_gesture_preference_description">When this feature is turned on, you can quickly enable accessibility features in two steps:\n\nStep 1: Press and hold the power button until you hear a sound or feel a vibration.\nStep 2: Touch and hold two fingers until you hear audio confirmation.\n\nIf the device has multiple users, using this shortcut on the lock screen temporarily enables accessibility until the device is unlocked or the user is changed.</string>
+    <string name="accessibility_global_gesture_preference_description">When this feature is turned on, you can quickly enable accessibility features in two steps:\n\nStep 1: Press and hold the power button until you hear a sound or feel a vibration.\n\nStep 2: Touch and hold two fingers until you hear audio confirmation.\n\nIf the device has multiple users, using this shortcut on the lock screen temporarily enables accessibility until the device is unlocked.</string>
     <!-- Title for the accessibility preference to enable large text. [CHAR LIMIT=35] -->
     <string name="accessibility_toggle_large_text_preference_title">Large text</string>
     <!-- Title for the accessibility preference to enable screen magnification. [CHAR LIMIT=35] -->
@@ -3776,10 +3765,7 @@
     <string name="background_data_dialog_message">Disabling background data extends battery life and lowers data use. Some apps may still use the background data connection.</string>
     <!-- Title for a checkbox that enables data synchronization in the account and sync screen [CHAR LIMIT=35] -->
     <string name="sync_automatically">Auto-sync app data</string>
-    <!-- Account creation warning in multi-user tablets [CHAR LIMIT=none] -->
-    <string name="add_account_shared_system_warning" product="tablet">Reminder: As with any shared computer, there is some risk that other users may find a way to access your data on this tablet.</string>
-    <!-- Account creation warning in multi-user phones[CHAR LIMIT=none] -->
-    <string name="add_account_shared_system_warning" product="default">Reminder: As with any shared computer, there is some risk that other users may find a way to access your data on this phone.</string>
+
     <!-- Sync status messages on Accounts & Synchronization settings --><skip />
     <!-- Sync status shown when sync is enabled [CHAR LIMIT=25] -->
     <string name="sync_enabled">Sync is ON</string>
diff --git a/src/com/android/settings/AccessibilitySettings.java b/src/com/android/settings/AccessibilitySettings.java
index 266621f..d64a092 100644
--- a/src/com/android/settings/AccessibilitySettings.java
+++ b/src/com/android/settings/AccessibilitySettings.java
@@ -282,7 +282,7 @@
         Bundle extras = mDisplayMagnificationPreferenceScreen.getExtras();
         extras.putString(EXTRA_TITLE, getString(
                 R.string.accessibility_screen_magnification_title));
-        extras.putString(EXTRA_SUMMARY, getString(
+        extras.putCharSequence(EXTRA_SUMMARY, getActivity().getResources().getText(
                 R.string.accessibility_screen_magnification_summary));
         extras.putBoolean(EXTRA_CHECKED, Settings.Secure.getInt(getContentResolver(),
                 Settings.Secure.ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED, 0) == 1);
@@ -1005,7 +1005,7 @@
                 getActivity().getActionBar().setTitle(title);
             }
             // Summary.
-            String summary = arguments.getString(EXTRA_SUMMARY);
+            CharSequence summary = arguments.getCharSequence(EXTRA_SUMMARY);
             mSummaryPreference.setSummary(summary);
         }
     }
diff --git a/src/com/android/settings/AppWidgetPickActivity.java b/src/com/android/settings/AppWidgetPickActivity.java
index 97f816a..953d10c 100644
--- a/src/com/android/settings/AppWidgetPickActivity.java
+++ b/src/com/android/settings/AppWidgetPickActivity.java
@@ -269,7 +269,7 @@
         // If not specified, we don't filter on any specific
         int featuresFilter = AppWidgetProviderInfo.WIDGET_FEATURES_NONE;
         if (intent.getExtras().containsKey(AppWidgetManager.EXTRA_FEATURES_FILTER)) {
-            featuresFilter = intent.getExtras().getInt(AppWidgetManager.EXTRA_CATEGORY_FILTER);
+            featuresFilter = intent.getExtras().getInt(AppWidgetManager.EXTRA_FEATURES_FILTER);
         }
 
         putInstalledAppWidgets(items, categoryFilter, featuresFilter);
diff --git a/src/com/android/settings/LocalePicker.java b/src/com/android/settings/LocalePicker.java
index 1272ddc..0afa4d5 100644
--- a/src/com/android/settings/LocalePicker.java
+++ b/src/com/android/settings/LocalePicker.java
@@ -17,9 +17,7 @@
 package com.android.settings;
 
 import android.app.Dialog;
-import android.content.Context;
 import android.os.Bundle;
-import android.os.UserManager;
 import android.util.Log;
 
 import com.android.settings.SettingsPreferenceFragment.SettingsDialogFragment;
@@ -78,11 +76,12 @@
         mDialogFragment.show(getActivity().getFragmentManager(), Integer.toString(dialogId));
     }
 
-    public Dialog onCreateDialog(int dialogId) {
+    public Dialog onCreateDialog(final int dialogId) {
         return Utils.buildGlobalChangeWarningDialog(getActivity(),
                 R.string.global_locale_change_title,
                 new Runnable() {
                     public void run() {
+                        removeDialog(dialogId);
                         getActivity().onBackPressed();
                         LocalePicker.updateLocale(mTargetLocale);
                     }
diff --git a/src/com/android/settings/accounts/AddAccountSettings.java b/src/com/android/settings/accounts/AddAccountSettings.java
index dffb1ee..e0fe629 100644
--- a/src/com/android/settings/accounts/AddAccountSettings.java
+++ b/src/com/android/settings/accounts/AddAccountSettings.java
@@ -22,25 +22,18 @@
 import android.accounts.AuthenticatorException;
 import android.accounts.OperationCanceledException;
 import android.app.Activity;
-import android.app.AlertDialog;
-import android.app.Dialog;
 import android.app.PendingIntent;
-import android.content.DialogInterface;
-import android.content.DialogInterface.OnClickListener;
-import android.content.DialogInterface.OnDismissListener;
 import android.content.Intent;
 import android.os.Bundle;
 import android.util.Log;
 
 import com.android.settings.Utils;
-import com.android.settings.R;
 
 import java.io.IOException;
 
 /**
  * Entry point Actiivty for account setup. Works as follows
- * 0) If it is a multi-user system with multiple users, it shows a warning dialog first.
- *    If the user accepts this warning, it moves on to step 1.
+ *
  * 1) When the other Activities launch this Activity, it launches {@link ChooseAccountActivity}
  *    without showing anything.
  * 2) After receiving an account type from ChooseAccountActivity, this Activity launches the
@@ -65,7 +58,6 @@
      * application.
      */
     private static final String KEY_CALLER_IDENTITY = "pendingIntent";
-    private static final String KEY_SHOWED_WARNING = "showedWarning";
 
     private static final String TAG = "AccountSettings";
 
@@ -76,8 +68,6 @@
 
     private static final int CHOOSE_ACCOUNT_REQUEST = 1;
 
-    private static final int DLG_MULTIUSER_WARNING = 1;
-
     private PendingIntent mPendingIntent;
 
     private AccountManagerCallback<Bundle> mCallback = new AccountManagerCallback<Bundle>() {
@@ -105,57 +95,21 @@
     };
 
     private boolean mAddAccountCalled = false;
-    private boolean mShowedMultiuserWarning;
 
     @Override
     public void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
 
         if (savedInstanceState != null) {
-            mShowedMultiuserWarning = savedInstanceState.getBoolean(KEY_SHOWED_WARNING);
             mAddAccountCalled = savedInstanceState.getBoolean(KEY_ADD_CALLED);
             if (Log.isLoggable(TAG, Log.VERBOSE)) Log.v(TAG, "restored");
         }
 
-        if (!Utils.hasMultipleUsers(this)) {
-            mShowedMultiuserWarning = true;
+        if (mAddAccountCalled) {
+            // We already called add account - maybe the callback was lost.
+            finish();
+            return;
         }
-
-        // Show the multiuser warning dialog first. If that was already shown and accepted,
-        // then show the account type chooser.
-        if (!mShowedMultiuserWarning) {
-            showMultiuserWarning();
-        } else {
-            if (mAddAccountCalled) {
-                // We already called add account - maybe the callback was lost.
-                finish();
-                return;
-            }
-            showChooseAccount();
-        }
-    }
-
-    private void showMultiuserWarning() {
-        showDialog(DLG_MULTIUSER_WARNING);
-    }
-
-    public Dialog onCreateDialog(int dlgId) {
-        AlertDialog.Builder builder = new AlertDialog.Builder(this);
-        builder.setMessage(R.string.add_account_shared_system_warning);
-        builder.setPositiveButton(android.R.string.ok, mDialogClickListener);
-        builder.setNegativeButton(android.R.string.cancel, mDialogClickListener);
-        builder.setOnDismissListener(new OnDismissListener() {
-            public void onDismiss(DialogInterface di) {
-                if (!mShowedMultiuserWarning) {
-                    setResult(RESULT_CANCELED);
-                    finish();
-                }
-            }
-        });
-        return builder.create();
-    }
-
-    private void showChooseAccount() {
         final String[] authorities =
                 getIntent().getStringArrayExtra(AccountPreferenceBase.AUTHORITIES_FILTER_KEY);
         final String[] accountTypes =
@@ -188,7 +142,6 @@
     protected void onSaveInstanceState(Bundle outState) {
         super.onSaveInstanceState(outState);
         outState.putBoolean(KEY_ADD_CALLED, mAddAccountCalled);
-        outState.putBoolean(KEY_SHOWED_WARNING, mShowedMultiuserWarning);
         if (Log.isLoggable(TAG, Log.VERBOSE)) Log.v(TAG, "saved");
     }
 
@@ -207,17 +160,4 @@
                 null /* handler */);
         mAddAccountCalled  = true;
     }
-
-    private OnClickListener mDialogClickListener = new OnClickListener() {
-        @Override
-        public void onClick(DialogInterface dialog, int which) {
-            if (which == Dialog.BUTTON_POSITIVE) {
-                mShowedMultiuserWarning = true;
-                showChooseAccount();
-            } else if (which == Dialog.BUTTON_NEGATIVE) {
-                setResult(RESULT_CANCELED);
-                finish();
-            }
-        }
-    };
 }
diff --git a/src/com/android/settings/applications/InstalledAppDetails.java b/src/com/android/settings/applications/InstalledAppDetails.java
index 7690b7e..1cdb4dc 100644
--- a/src/com/android/settings/applications/InstalledAppDetails.java
+++ b/src/com/android/settings/applications/InstalledAppDetails.java
@@ -464,7 +464,7 @@
             showIt = false;
         } else if ((mAppEntry.info.flags & ApplicationInfo.FLAG_SYSTEM) != 0) {
             showIt = false;
-        } else if (mDpm.packageHasActiveAdmins(mPackageInfo.packageName)) {
+        } else if (mPackageInfo == null || mDpm.packageHasActiveAdmins(mPackageInfo.packageName)) {
             showIt = false;
         } else if (UserHandle.myUserId() != 0) {
             showIt = false;