Merge "Public volumes belong to a single user." into nyc-mr1-dev
diff --git a/cmds/am/src/com/android/commands/am/Am.java b/cmds/am/src/com/android/commands/am/Am.java
index d6c0058..c460b04 100644
--- a/cmds/am/src/com/android/commands/am/Am.java
+++ b/cmds/am/src/com/android/commands/am/Am.java
@@ -48,7 +48,9 @@
import android.content.pm.ParceledListSlice;
import android.content.pm.ResolveInfo;
import android.content.pm.UserInfo;
+import android.content.res.AssetManager;
import android.content.res.Configuration;
+import android.content.res.Resources;
import android.graphics.Rect;
import android.os.Binder;
import android.os.Build;
@@ -64,6 +66,7 @@
import android.text.TextUtils;
import android.util.AndroidException;
import android.util.ArrayMap;
+import android.util.DisplayMetrics;
import android.view.IWindowManager;
import com.android.internal.os.BaseCommand;
@@ -361,6 +364,8 @@
"am send-trim-memory: send a memory trim event to a <PROCESS>.\n" +
"\n" +
"am get-current-user: returns id of the current foreground user.\n" +
+ "\n" +
+ "am supports-multiwindow: returns true if the device supports multiwindow.\n" +
"\n"
);
Intent.printIntentArgsHelp(pw, "");
@@ -458,6 +463,8 @@
runSendTrimMemory();
} else if (op.equals("get-current-user")) {
runGetCurrentUser();
+ } else if (op.equals("supports-multiwindow")) {
+ runSupportsMultiwindow();
} else {
showError("Error: unknown command '" + op + "'");
}
@@ -2534,6 +2541,21 @@
System.out.println(currentUser.id);
}
+ private void runSupportsMultiwindow() throws Exception {
+ // system resources does not contain all the device configuration, construct it manually.
+ Configuration config = mAm.getConfiguration();
+ if (config == null) {
+ throw new AndroidException("Activity manager has no configuration");
+ }
+
+ final DisplayMetrics metrics = new DisplayMetrics();
+ metrics.setToDefaults();
+
+ Resources res = new Resources(AssetManager.getSystem(), metrics, config);
+
+ System.out.println(res.getBoolean(com.android.internal.R.bool.config_supportsMultiWindow));
+ }
+
/**
* Open the given file for sending into the system process. This verifies
* with SELinux that the system will have access to the file.
diff --git a/core/java/android/view/inputmethod/InputConnection.java b/core/java/android/view/inputmethod/InputConnection.java
index 8023201..71c1d62 100644
--- a/core/java/android/view/inputmethod/InputConnection.java
+++ b/core/java/android/view/inputmethod/InputConnection.java
@@ -860,32 +860,35 @@
android.content.Intent.FLAG_GRANT_READ_URI_PERMISSION; // 0x00000001
/**
- * Called by the input method to commit a content such as PNG image to the editor.
+ * Called by the input method to commit content such as a PNG image to the editor.
*
- * <p>In order to avoid variety of compatibility issues, this focuses on a simple use case,
- * where we expect editors and IMEs work cooperatively as follows:</p>
+ * <p>In order to avoid a variety of compatibility issues, this focuses on a simple use case,
+ * where editors and IMEs are expected to work cooperatively as follows:</p>
* <ul>
- * <li>Editor must keep {@link EditorInfo#contentMimeTypes} to be {@code null} if it does
+ * <li>Editor must keep {@link EditorInfo#contentMimeTypes} equal to {@code null} if it does
* not support this method at all.</li>
* <li>Editor can ignore this request when the MIME type specified in
- * {@code inputContentInfo} does not match to any of {@link EditorInfo#contentMimeTypes}.
+ * {@code inputContentInfo} does not match any of {@link EditorInfo#contentMimeTypes}.
* </li>
- * <li>Editor can ignore the cursor position when inserting the provided context.</li>
+ * <li>Editor can ignore the cursor position when inserting the provided content.</li>
* <li>Editor can return {@code true} asynchronously, even before it starts loading the
* content.</li>
- * <li>Editor should provide a way to delete the content inserted by this method, or revert
- * the effect caused by this method.</li>
+ * <li>Editor should provide a way to delete the content inserted by this method or to
+ * revert the effect caused by this method.</li>
* <li>IME should not call this method when there is any composing text, in case calling
- * this method causes focus change.</li>
+ * this method causes a focus change.</li>
* <li>IME should grant a permission for the editor to read the content. See
* {@link EditorInfo#packageName} about how to obtain the package name of the editor.</li>
* </ul>
*
* @param inputContentInfo Content to be inserted.
- * @param flags {@code 0} or {@link #INPUT_CONTENT_GRANT_READ_URI_PERMISSION}.
+ * @param flags {@link #INPUT_CONTENT_GRANT_READ_URI_PERMISSION} if the content provider
+ * allows {@link android.R.styleable#AndroidManifestProvider_grantUriPermissions
+ * grantUriPermissions} or {@code 0} if the application does not need to call
+ * {@link InputContentInfo#requestPermission()}.
* @param opts optional bundle data. This can be {@code null}.
- * @return {@code true} if this request is accepted by the application, no matter if the request
- * is already handled or still being handled in background.
+ * @return {@code true} if this request is accepted by the application, whether the request
+ * is already handled or still being handled in background, {@code false} otherwise.
*/
public boolean commitContent(@NonNull InputContentInfo inputContentInfo, int flags,
@Nullable Bundle opts);
diff --git a/docs/html/guide/topics/resources/providing-resources.jd b/docs/html/guide/topics/resources/providing-resources.jd
index 80a989a..99aeb43 100644
--- a/docs/html/guide/topics/resources/providing-resources.jd
+++ b/docs/html/guide/topics/resources/providing-resources.jd
@@ -905,20 +905,25 @@
<h4>Drawable</h4>
-<p>To create an alias to an existing drawable, use the {@code <bitmap>} element.
-For example:</p>
+<p>
+ To create an alias to an existing drawable, use the {@code <drawable>}
+ element. For example:
+</p>
<pre>
<?xml version="1.0" encoding="utf-8"?>
-<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
- android:src="@drawable/icon_ca" />
+<resources>
+ <drawable name="icon">@drawable/icon_ca</drawable>
+</resources>
</pre>
-<p>If you save this file as {@code icon.xml} (in an alternative resource directory, such as
-{@code res/drawable-en-rCA/}), it is compiled into a resource that you
-can reference as {@code R.drawable.icon}, but is actually an alias for the {@code
-R.drawable.icon_ca} resource (which is saved in {@code res/drawable/}).</p>
-
+<p>
+ If you save this file as {@code drawables.xml} (in an alternative resource
+ directory, such as {@code res/values-en-rCA/}), it is compiled into a
+ resource that you can reference as {@code R.drawable.icon}, but is actually
+ an alias for the {@code R.drawable.icon_ca} resource (which is saved in
+ {@code res/drawable/}).
+</p>
<h4>Layout</h4>
diff --git a/packages/SettingsLib/res/values-fr-rCA/strings.xml b/packages/SettingsLib/res/values-fr-rCA/strings.xml
index 2538443..732d515 100644
--- a/packages/SettingsLib/res/values-fr-rCA/strings.xml
+++ b/packages/SettingsLib/res/values-fr-rCA/strings.xml
@@ -91,7 +91,7 @@
<string name="tether_settings_title_wifi" msgid="3277144155960302049">"Point d\'accès Wi-Fi mobile"</string>
<string name="tether_settings_title_bluetooth" msgid="355855408317564420">"Via Bluetooth"</string>
<string name="tether_settings_title_usb_bluetooth" msgid="5355828977109785001">"Partage de connexion"</string>
- <string name="tether_settings_title_all" msgid="8356136101061143841">"Partage de connexion et point d\'accès mobile"</string>
+ <string name="tether_settings_title_all" msgid="8356136101061143841">"Partage de connexion"</string>
<string name="managed_user_title" msgid="8109605045406748842">"Toutes les applis profess."</string>
<string name="user_guest" msgid="8475274842845401871">"Invité"</string>
<string name="unknown" msgid="1592123443519355854">"Inconnu"</string>
diff --git a/packages/SettingsLib/res/values-nl/strings.xml b/packages/SettingsLib/res/values-nl/strings.xml
index feb78df..2c22ee9 100644
--- a/packages/SettingsLib/res/values-nl/strings.xml
+++ b/packages/SettingsLib/res/values-nl/strings.xml
@@ -132,10 +132,10 @@
<item msgid="8903157781070679765">"Normaal"</item>
<item msgid="164347302621392996">"Snel"</item>
<item msgid="5794028588101562009">"Sneller"</item>
- <item msgid="7163942783888652942">"Zeer snel"</item>
- <item msgid="7831712693748700507">"Vlug"</item>
- <item msgid="5194774745031751806">"Zeer vlug"</item>
- <item msgid="9085102246155045744">"Snelst"</item>
+ <item msgid="7163942783888652942">"Nog sneller"</item>
+ <item msgid="7831712693748700507">"Heel erg snel"</item>
+ <item msgid="5194774745031751806">"Snelst"</item>
+ <item msgid="9085102246155045744">"Allerallersnelst"</item>
</string-array>
<string name="choose_profile" msgid="8229363046053568878">"Profiel kiezen"</string>
<string name="category_personal" msgid="1299663247844969448">"Persoonlijk"</string>
diff --git a/services/core/java/com/android/server/pm/ShortcutPackage.java b/services/core/java/com/android/server/pm/ShortcutPackage.java
index d558b07..38d69ed 100644
--- a/services/core/java/com/android/server/pm/ShortcutPackage.java
+++ b/services/core/java/com/android/server/pm/ShortcutPackage.java
@@ -635,7 +635,11 @@
return false; // Shouldn't happen.
}
- if (!isNewApp && !forceRescan) {
+ // Always scan the settings app, since its version code is the same for DR and MR1.
+ // TODO Fix it properly: b/32554059
+ final boolean isSettings = "com.android.settings".equals(getPackageName());
+
+ if (!isNewApp && !forceRescan && !isSettings) {
// Return if the package hasn't changed, ie:
// - version code hasn't change
// - lastUpdateTime hasn't change
@@ -652,6 +656,11 @@
return false;
}
}
+ if (isSettings) {
+ if (ShortcutService.DEBUG) {
+ Slog.d(TAG, "Always scan settings.");
+ }
+ }
} finally {
s.logDurationStat(Stats.PACKAGE_UPDATE_CHECK, start);
}