diff --git a/Android.mk b/Android.mk index 3d52f44f3f93ff43413962cc4165cf8a3235d448..1db4365c552f8215e29950e2e8af8d5e14c9178c 100644 --- a/Android.mk +++ b/Android.mk @@ -264,8 +264,9 @@ LOCAL_SRC_FILES += \ telephony/java/com/android/internal/telephony/IPhoneStateListener.aidl \ telephony/java/com/android/internal/telephony/IPhoneSubInfo.aidl \ telephony/java/com/android/internal/telephony/ITelephony.aidl \ - telephony/java/com/android/internal/telephony/ISms.aidl \ + telephony/java/com/android/internal/telephony/ITelephonyListener.aidl \ telephony/java/com/android/internal/telephony/ITelephonyRegistry.aidl \ + telephony/java/com/android/internal/telephony/ISms.aidl \ telephony/java/com/android/internal/telephony/IWapPushManager.aidl \ wifi/java/android/net/wifi/IWifiManager.aidl \ wifi/java/android/net/wifi/p2p/IWifiP2pManager.aidl \ @@ -542,8 +543,7 @@ framework_docs_LOCAL_ADDITIONAL_JAVA_DIR:= \ framework_docs_LOCAL_ADDITIONAL_DEPENDENCIES := \ frameworks/base/docs/knowntags.txt -sample_dir := development/samples/browseable -new_sample_dir := developers/samples/android +samples_dir := development/samples/browseable # Whitelist of valid groups, used for default TOC grouping. Each sample must # belong to one (and only one) group. Assign samples to groups by setting @@ -553,166 +553,13 @@ sample_groups := -samplegroup Background \ -samplegroup Content \ -samplegroup Input \ -samplegroup Media \ + -samplegroup RenderScript \ -samplegroup Security \ + -samplegroup Sensors \ -samplegroup Testing \ -samplegroup UI \ -samplegroup Views -# the list here should match the list of samples included in the sdk samples package -# (see development/build/sdk.atree) -# remove htmlified samples for now -- samples are still available through the SDK -web_docs_sample_code_flags := \ - -hdf android.hasSamples 1 \ - -samplecode $(sample_dir)/BasicAccessibility \ - samples/BasicAccessibility "" \ - -samplecode $(sample_dir)/HorizontalPaging \ - samples/HorizontalPaging "" \ - -samplecode $(sample_dir)/ShareActionProvider \ - samples/ShareActionProvider "" \ - -samplecode $(sample_dir)/Styled \ - samples/Styled "" \ - -samplecode $(sample_dir)/BasicAndroidKeyStore \ - samples/BasicAndroidKeyStore "" \ - -samplecode $(sample_dir)/Basic \ - samples/Basic "" \ - -samplecode $(sample_dir)/ImmersiveMode \ - samples/ImmersiveMode "" \ - -samplecode $(sample_dir)/repeatingAlarm \ - samples/repeatingAlarm "" \ - -samplecode $(sample_dir)/TextLinkify \ - samples/TextLinkify "" \ - -samplecode $(sample_dir)/BasicMediaRouter \ - samples/BasicMediaRouter "" \ - -samplecode $(sample_dir)/BasicMultitouch \ - samples/BasicMultitouch "" \ - -samplecode $(sample_dir)/TextSwitcher \ - samples/TextSwitcher "" \ - -samplecode $(sample_dir)/ActivityInstrumentation \ - samples/ActivityInstrumentation "" \ - -samplecode $(sample_dir)/BorderlessButtons \ - samples/BorderlessButtons "" \ - -samplecode $(sample_dir)/BasicNotifications \ - samples/BasicNotifications "" \ - -samplecode $(sample_dir)/AdvancedImmersiveMode \ - samples/AdvancedImmersiveMode "" \ - -samplecode $(sample_dir)/BluetoothLeGatt \ - samples/BluetoothLeGatt "" \ - -samplecode $(sample_dir)/NetworkConnect \ - samples/NetworkConnect "" \ - -samplecode $(sample_dir)/BasicNetworking \ - samples/BasicNetworking "" \ - -samplecode $(sample_dir)/BasicMediaDecoder \ - samples/BasicMediaDecoder "" \ - -samplecode $(sample_dir)/BasicImmersiveMode \ - samples/BasicImmersiveMode "" \ - -samplecode $(sample_dir)/CustomChoiceList \ - samples/CustomChoiceList "" \ - -samplecode $(sample_dir)/BasicContactables \ - samples/BasicContactables "" \ - -samplecode $(sample_dir)/BasicGestureDetect \ - samples/BasicGestureDetect "" \ - -samplecode $(sample_dir)/DoneBar \ - samples/DoneBar "" \ - -samplecode $(sample_dir)/ListPopupMenu \ - samples/ListPopupMenu "" \ - -samplecode $(sample_dir)/AppRestrictions \ - samples/AppRestrictions "" \ - -samplecode $(sample_dir)/CustomNotifications \ - samples/CustomNotifications "" \ - -samplecode $(sample_dir)/BasicSyncAdapter \ - samples/BasicSyncAdapter "" \ - -samplecode $(sample_dir)/StorageClient \ - samples/StorageClient "" \ - -samplecode $(sample_dir)/StorageProvider \ - samples/StorageProvider "" -# -samplecode $(sample_dir)/AndroidBeamDemo \ -# samples/AndroidBeamDemo "Android Beam Demo" \ -# -samplecode $(sample_dir)/ApiDemos \ -# samples/ApiDemos "API Demos" \ -# -samplecode $(sample_dir)/Support4Demos \ -# samples/Support4Demos "API 4+ Support Demos" \ -# -samplecode $(sample_dir)/Support13Demos \ -# samples/Support13Demos "API 13+ Support Demos" \ -# -samplecode $(sample_dir)/BackupRestore \ -# samples/BackupRestore "Backup and Restore" \ -# -samplecode $(sample_dir)/BluetoothChat \ -# samples/BluetoothChat "Bluetooth Chat" \ -# -samplecode $(sample_dir)/BusinessCard \ -# samples/BusinessCard "Business Card" \ -# -samplecode $(sample_dir)/ContactManager \ -# samples/ContactManager "Contact Manager" \ -# -samplecode $(sample_dir)/CubeLiveWallpaper \ -# samples/CubeLiveWallpaper "Cube Live Wallpaper" \ -# -samplecode $(sample_dir)/Home \ -# samples/Home "Home" \ -# -samplecode $(sample_dir)/HoneycombGallery \ -# samples/HoneycombGallery "Honeycomb Gallery" \ -# -samplecode $(sample_dir)/JetBoy \ -# samples/JetBoy "JetBoy" \ -# -samplecode $(sample_dir)/KeyChainDemo \ -# samples/KeyChainDemo "KeyChain Demo" \ -# -samplecode $(sample_dir)/LunarLander \ -# samples/LunarLander "Lunar Lander" \ -# -samplecode $(sample_dir)/training/ads-and-ux \ -# samples/training/ads-and-ux "Mobile Advertisement Integration" \ -# -samplecode $(sample_dir)/MultiResolution \ -# samples/MultiResolution "Multiple Resolutions" \ -# -samplecode $(sample_dir)/training/multiscreen/newsreader \ -# samples/newsreader "News Reader" \ -# -samplecode $(sample_dir)/NotePad \ -# samples/NotePad "Note Pad" \ -# -samplecode $(sample_dir)/SpellChecker/SampleSpellCheckerService \ -# samples/SpellChecker/SampleSpellCheckerService "Spell Checker Service" \ -# -samplecode $(sample_dir)/SpellChecker/HelloSpellChecker \ -# samples/SpellChecker/HelloSpellChecker "Spell Checker Client" \ -# -samplecode $(sample_dir)/SampleSyncAdapter \ -# samples/SampleSyncAdapter "Sample Sync Adapter" \ -# -samplecode $(sample_dir)/RandomMusicPlayer \ -# samples/RandomMusicPlayer "Random Music Player" \ -# -samplecode $(sample_dir)/RenderScript \ -# samples/RenderScript "RenderScript" \ -# -samplecode $(sample_dir)/SearchableDictionary \ -# samples/SearchableDictionary "Searchable Dictionary v2" \ -# -samplecode $(sample_dir)/SipDemo \ -# samples/SipDemo "SIP Demo" \ -# -samplecode $(sample_dir)/Snake \ -# samples/Snake "Snake" \ -# -samplecode $(sample_dir)/SoftKeyboard \ -# samples/SoftKeyboard "Soft Keyboard" \ -# -samplecode $(sample_dir)/Spinner \ -# samples/Spinner "Spinner" \ -# -samplecode $(sample_dir)/SpinnerTest \ -# samples/SpinnerTest "SpinnerTest" \ -# -samplecode $(sample_dir)/StackWidget \ -# samples/StackWidget "StackView Widget" \ -# -samplecode $(sample_dir)/TicTacToeLib \ -# samples/TicTacToeLib "TicTacToeLib" \ -# -samplecode $(sample_dir)/TicTacToeMain \ -# samples/TicTacToeMain "TicTacToeMain" \ -# -samplecode $(sample_dir)/ToyVpn \ -# samples/ToyVpn "Toy VPN Client" \ -# -samplecode $(sample_dir)/USB \ -# samples/USB "USB" \ -# -samplecode $(sample_dir)/WeatherListWidget \ -# samples/WeatherListWidget "Weather List Widget" \ -# -samplecode $(sample_dir)/WiFiDirectDemo \ -# samples/WiFiDirectDemo "Wi-Fi Direct Demo" \ -# -samplecode $(sample_dir)/Wiktionary \ -# samples/Wiktionary "Wiktionary" \ -# -samplecode $(sample_dir)/WiktionarySimple \ -# samples/WiktionarySimple "Wiktionary (Simplified)" \ -# -samplecode $(sample_dir)/VoiceRecognitionService \ -# samples/VoiceRecognitionService "Voice Recognition Service" \ -# -samplecode $(sample_dir)/VoicemailProviderDemo \ -# samples/VoicemailProviderDemo "Voicemail Provider Demo" \ -# -samplecode $(sample_dir)/XmlAdapters \ -# samples/XmlAdapters "XML Adapters" \ -# -samplecode $(sample_dir)/TtsEngine \ -# samples/TtsEngine "Text To Speech Engine" \ -# -samplecode $(sample_dir)/training/device-management-policy \ -# samples/training/device-management-policy "Device Management Policy" - - ## SDK version identifiers used in the published docs # major[.minor] version for current SDK. (full releases only) framework_docs_SDK_VERSION:=4.4 @@ -722,7 +569,7 @@ framework_docs_SDK_REL_ID:=1 framework_docs_LOCAL_DROIDDOC_OPTIONS += \ -hdf sdk.version $(framework_docs_SDK_VERSION) \ -hdf sdk.rel.id $(framework_docs_SDK_REL_ID) \ - -hdf sdk.preview 0 \ + -hdf sdk.preview 0 # ==== the api stubs and current.xml =========================== include $(CLEAR_VARS) @@ -755,6 +602,32 @@ $(full_target): $(framework_built) $(gen) $(INTERNAL_PLATFORM_API_FILE): $(full_target) $(call dist-for-goals,sdk,$(INTERNAL_PLATFORM_API_FILE)) +# ==== the private api stubs =================================== +include $(CLEAR_VARS) + +LOCAL_SRC_FILES:=$(framework_docs_LOCAL_API_CHECK_SRC_FILES) +LOCAL_INTERMEDIATE_SOURCES:=$(framework_docs_LOCAL_INTERMEDIATE_SOURCES) +LOCAL_JAVA_LIBRARIES:=$(framework_docs_LOCAL_API_CHECK_JAVA_LIBRARIES) +LOCAL_MODULE_CLASS:=$(framework_docs_LOCAL_MODULE_CLASS) +LOCAL_DROIDDOC_SOURCE_PATH:=$(framework_docs_LOCAL_DROIDDOC_SOURCE_PATH) +LOCAL_DROIDDOC_HTML_DIR:=$(framework_docs_LOCAL_DROIDDOC_HTML_DIR) +LOCAL_ADDITIONAL_JAVA_DIR:=$(framework_docs_LOCAL_API_CHECK_ADDITIONAL_JAVA_DIR) +LOCAL_ADDITIONAL_DEPENDENCIES:=$(framework_docs_LOCAL_ADDITIONAL_DEPENDENCIES) + +LOCAL_MODULE := private-api-stubs + +LOCAL_DROIDDOC_OPTIONS:=\ + $(framework_docs_LOCAL_DROIDDOC_OPTIONS) \ + -stubs $(TARGET_OUT_COMMON_INTERMEDIATES)/JAVA_LIBRARIES/android_private_stubs_current_intermediates/src \ + -showAnnotation android.annotation.PrivateApi \ + -nodocs + +LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR:=build/tools/droiddoc/templates-sdk + +LOCAL_UNINSTALLABLE_MODULE := true + +include $(BUILD_DROIDDOC) + # ==== check javadoc comments but don't generate docs ======== include $(CLEAR_VARS) @@ -808,8 +681,6 @@ LOCAL_DROIDDOC_OPTIONS:=\ -todo $(OUT_DOCS)/$(LOCAL_MODULE)-docs-todo.html \ -sdkvalues $(OUT_DOCS) \ -hdf android.whichdoc offline -# $(web_docs_sample_code_flags) - LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR:=build/tools/droiddoc/templates-sdk @@ -836,7 +707,7 @@ LOCAL_DROIDDOC_SOURCE_PATH:=$(framework_docs_LOCAL_DROIDDOC_SOURCE_PATH) LOCAL_DROIDDOC_HTML_DIR:=$(framework_docs_LOCAL_DROIDDOC_HTML_DIR) LOCAL_ADDITIONAL_JAVA_DIR:=$(framework_docs_LOCAL_ADDITIONAL_JAVA_DIR) LOCAL_ADDITIONAL_DEPENDENCIES:=$(framework_docs_LOCAL_ADDITIONAL_DEPENDENCIES) -LOCAL_ADDITIONAL_HTML_DIR:=docs/html-intl /intl/ +LOCAL_ADDITIONAL_HTML_DIR:=docs/html-intl / LOCAL_MODULE := online-sdk @@ -845,7 +716,8 @@ LOCAL_DROIDDOC_OPTIONS:= \ -toroot / \ -hdf android.whichdoc online \ $(sample_groups) \ - $(web_docs_sample_code_flags) + -hdf android.hasSamples true \ + -samplesdir $(samples_dir) LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR:=build/tools/droiddoc/templates-sdk @@ -863,7 +735,7 @@ LOCAL_DROIDDOC_HTML_DIR:=$(framework_docs_LOCAL_DROIDDOC_HTML_DIR) LOCAL_ADDITIONAL_JAVA_DIR:=$(framework_docs_LOCAL_ADDITIONAL_JAVA_DIR) LOCAL_ADDITIONAL_DEPENDENCIES:=$(framework_docs_LOCAL_ADDITIONAL_DEPENDENCIES) # specify a second html input dir and an output path relative to OUT_DIR) -LOCAL_ADDITIONAL_HTML_DIR:=docs/html-intl / +LOCAL_ADDITIONAL_HTML_DIR:=docs/html-intl/intl / LOCAL_MODULE := ds @@ -873,7 +745,6 @@ LOCAL_DROIDDOC_OPTIONS:= \ -toroot / \ -hdf android.whichdoc online \ -hdf devsite true -# $(web_docs_sample_code_flags) LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR:=build/tools/droiddoc/templates-sdk diff --git a/cmds/bmgr/src/com/android/commands/bmgr/Bmgr.java b/cmds/bmgr/src/com/android/commands/bmgr/Bmgr.java index 2666b4172a08fde0e70d94cc3ef3df0700b50ac7..db3d8bbc9cfc7e24161df274650d81b1e4c80c89 100644 --- a/cmds/bmgr/src/com/android/commands/bmgr/Bmgr.java +++ b/cmds/bmgr/src/com/android/commands/bmgr/Bmgr.java @@ -187,6 +187,12 @@ public final class Bmgr { } private void doWipe() { + String transport = nextArg(); + if (transport == null) { + showUsage(); + return; + } + String pkg = nextArg(); if (pkg == null) { showUsage(); @@ -194,8 +200,8 @@ public final class Bmgr { } try { - mBmgr.clearBackupData(pkg); - System.out.println("Wiped backup data for " + pkg); + mBmgr.clearBackupData(transport, pkg); + System.out.println("Wiped backup data for " + pkg + " on " + transport); } catch (RemoteException e) { System.err.println(e.toString()); System.err.println(BMGR_NOT_RUNNING_ERR); @@ -446,7 +452,7 @@ public final class Bmgr { System.err.println(" bmgr restore TOKEN PACKAGE..."); System.err.println(" bmgr restore PACKAGE"); System.err.println(" bmgr run"); - System.err.println(" bmgr wipe PACKAGE"); + System.err.println(" bmgr wipe TRANSPORT PACKAGE"); System.err.println(""); System.err.println("The 'backup' command schedules a backup pass for the named package."); System.err.println("Note that the backup pass will effectively be a no-op if the package"); @@ -462,8 +468,8 @@ public final class Bmgr { System.err.println(""); System.err.println("The 'list transports' command reports the names of the backup transports"); System.err.println("currently available on the device. These names can be passed as arguments"); - System.err.println("to the 'transport' command. The currently selected transport is indicated"); - System.err.println("with a '*' character."); + System.err.println("to the 'transport' and 'wipe' commands. The currently selected transport"); + System.err.println("is indicated with a '*' character."); System.err.println(""); System.err.println("The 'list sets' command reports the token and name of each restore set"); System.err.println("available to the device via the current transport."); @@ -491,7 +497,8 @@ public final class Bmgr { System.err.println("data changes."); System.err.println(""); System.err.println("The 'wipe' command causes all backed-up data for the given package to be"); - System.err.println("erased from the current transport's storage. The next backup operation"); + System.err.println("erased from the given transport's storage. The next backup operation"); System.err.println("that the given application performs will rewrite its entire data set."); + System.err.println("Transport names to use here are those reported by 'list transports'."); } } diff --git a/core/java/android/annotation/PrivateApi.java b/core/java/android/annotation/PrivateApi.java new file mode 100644 index 0000000000000000000000000000000000000000..985eafec5d3371d807ddc6072759ecd1850e2483 --- /dev/null +++ b/core/java/android/annotation/PrivateApi.java @@ -0,0 +1,31 @@ +/* + * Copyright (C) 2008 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. + */ + +package android.annotation; + +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; + +/** + * Indicates an API is exposed for use by bundled applications. + *
+ * These APIs are not guaranteed to remain consistent release-to-release, + * and are not for use by apps linking against the SDK. + * @hide + */ +@Retention(RetentionPolicy.SOURCE) +public @interface PrivateApi { +} diff --git a/core/java/android/app/ActivityThread.java b/core/java/android/app/ActivityThread.java index b103e712600c3cdb34b174a1bb9d086fe751771f..9a3478efc166062e1fb0240a5e69b99655b8e6b3 100644 --- a/core/java/android/app/ActivityThread.java +++ b/core/java/android/app/ActivityThread.java @@ -157,7 +157,7 @@ public final class ActivityThread { private static final int LOG_ON_PAUSE_CALLED = 30021; private static final int LOG_ON_RESUME_CALLED = 30022; - static ContextImpl mSystemContext = null; + private ContextImpl mSystemContext; static IPackageManager sPackageManager; @@ -1700,7 +1700,7 @@ public final class ActivityThread { ? mBoundApplication.processName : null) + ")"); packageInfo = - new LoadedApk(this, aInfo, compatInfo, this, baseLoader, + new LoadedApk(this, aInfo, compatInfo, baseLoader, securityViolation, includeCode && (aInfo.flags&ApplicationInfo.FLAG_HAS_CODE) != 0); if (includeCode) { @@ -1753,26 +1753,15 @@ public final class ActivityThread { public ContextImpl getSystemContext() { synchronized (this) { if (mSystemContext == null) { - ContextImpl context = - ContextImpl.createSystemContext(this); - LoadedApk info = new LoadedApk(this, "android", context, null, - CompatibilityInfo.DEFAULT_COMPATIBILITY_INFO); - context.init(info, null, this); - context.getResources().updateConfiguration(mResourcesManager.getConfiguration(), - mResourcesManager.getDisplayMetricsLocked(Display.DEFAULT_DISPLAY)); - mSystemContext = context; - //Slog.i(TAG, "Created system resources " + context.getResources() - // + ": " + context.getResources().getConfiguration()); + mSystemContext = ContextImpl.createSystemContext(this); } + return mSystemContext; } - return mSystemContext; } public void installSystemApplicationInfo(ApplicationInfo info) { synchronized (this) { - ContextImpl context = getSystemContext(); - context.init(new LoadedApk(this, "android", context, info, - CompatibilityInfo.DEFAULT_COMPATIBILITY_INFO), null, this); + getSystemContext().installSystemApplicationInfo(info); // give ourselves a default profiler mProfiler = new Profiler(); @@ -2258,8 +2247,7 @@ public final class ActivityThread { private Context createBaseContextForActivity(ActivityClientRecord r, final Activity activity) { - ContextImpl appContext = new ContextImpl(); - appContext.init(r.packageInfo, r.token, this); + ContextImpl appContext = ContextImpl.createActivityContext(this, r.packageInfo, r.token); appContext.setOuterContext(activity); // For debugging purposes, if the activity's package name contains the value of @@ -2544,8 +2532,7 @@ public final class ActivityThread { agent = (BackupAgent) cl.loadClass(classname).newInstance(); // set up the agent's context - ContextImpl context = new ContextImpl(); - context.init(packageInfo, null, this); + ContextImpl context = ContextImpl.createAppContext(this, packageInfo); context.setOuterContext(agent); agent.attach(context); @@ -2617,11 +2604,10 @@ public final class ActivityThread { try { if (localLOGV) Slog.v(TAG, "Creating service " + data.info.name); - ContextImpl context = new ContextImpl(); - context.init(packageInfo, null, this); + ContextImpl context = ContextImpl.createAppContext(this, packageInfo); + context.setOuterContext(service); Application app = packageInfo.makeApplication(false, mInstrumentation); - context.setOuterContext(service); service.attach(context, this, data.info.name, data.token, app, ActivityManagerNative.getDefault()); service.onCreate(); @@ -4217,8 +4203,7 @@ public final class ActivityThread { } updateDefaultDensity(); - final ContextImpl appContext = new ContextImpl(); - appContext.init(data.info, null, this); + final ContextImpl appContext = ContextImpl.createAppContext(this, data.info); if (!Process.isIsolated()) { final File cacheDir = appContext.getCacheDir(); @@ -4334,8 +4319,7 @@ public final class ActivityThread { instrApp.nativeLibraryDir = ii.nativeLibraryDir; LoadedApk pi = getPackageInfo(instrApp, data.compatInfo, appContext.getClassLoader(), false, true); - ContextImpl instrContext = new ContextImpl(); - instrContext.init(pi, null, this); + ContextImpl instrContext = ContextImpl.createAppContext(this, pi); try { java.lang.ClassLoader cl = instrContext.getClassLoader(); @@ -4950,8 +4934,8 @@ public final class ActivityThread { UserHandle.myUserId()); try { mInstrumentation = new Instrumentation(); - ContextImpl context = new ContextImpl(); - context.init(getSystemContext().mPackageInfo, null, this); + ContextImpl context = ContextImpl.createAppContext( + this, getSystemContext().mPackageInfo); Application app = Instrumentation.newApplication(Application.class, context); mAllApplications.add(app); mInitialApplication = app; diff --git a/core/java/android/app/AppOpsManager.java b/core/java/android/app/AppOpsManager.java index aece46298364d7cd7713046c56d8d2118f4f60ec..079cf7a210c9104efe0ec0f389cc3b0fd9706529 100644 --- a/core/java/android/app/AppOpsManager.java +++ b/core/java/android/app/AppOpsManager.java @@ -36,7 +36,7 @@ import android.os.RemoteException; * API for interacting with "application operation" tracking. * *
This API is not generally intended for third party application developers; most - * features are only available to system applicatins. Obtain an instance of it through + * features are only available to system applications. Obtain an instance of it through * {@link Context#getSystemService(String) Context.getSystemService} with * {@link Context#APP_OPS_SERVICE Context.APP_OPS_SERVICE}.
*/ @@ -878,7 +878,7 @@ public class AppOpsManager { } /** - * Like {@link #checkOp but instead of throwing a {@link SecurityException} it + * Like {@link #checkOp} but instead of throwing a {@link SecurityException} it * returns {@link #MODE_ERRORED}. */ public int checkOpNoThrow(String op, int uid, String packageName) { diff --git a/core/java/android/app/ContextImpl.java b/core/java/android/app/ContextImpl.java index 8d127c6e381a8501f889a53f81f0864fbe20a09b..df50989c290e39c471bf5bd303eb2fb3783c4591 100644 --- a/core/java/android/app/ContextImpl.java +++ b/core/java/android/app/ContextImpl.java @@ -183,22 +183,31 @@ class ContextImpl extends Context { */ private static ArrayMapIf set, after * {@link #send()} is called on it, it will be automatically * canceled for you and any future attempt to send through it will fail. */ public static final int FLAG_ONE_SHOT = 1<<30; /** - * Flag for use with {@link #getActivity}, {@link #getBroadcast}, and - * {@link #getService}: if the described PendingIntent does not already - * exist, then simply return null instead of creating it. + * Flag indicating that if the described PendingIntent already + * exists, then simply return null instead of creating it. + * For use with {@link #getActivity}, {@link #getBroadcast}, and + * {@link #getService}. */ public static final int FLAG_NO_CREATE = 1<<29; /** - * Flag for use with {@link #getActivity}, {@link #getBroadcast}, and - * {@link #getService}: if the described PendingIntent already exists, - * the current one is canceled before generating a new one. You can use + * Flag indicating that if the described PendingIntent already exists, + * the current one should be canceled before generating a new one. + * For use with {@link #getActivity}, {@link #getBroadcast}, and + * {@link #getService}.
You can use * this to retrieve a new PendingIntent when you are only changing the * extra data in the Intent; by canceling the previous pending intent, * this ensures that only entities given the new data will be able to @@ -112,10 +114,10 @@ public final class PendingIntent implements Parcelable { */ public static final int FLAG_CANCEL_CURRENT = 1<<28; /** - * Flag for use with {@link #getActivity}, {@link #getBroadcast}, and - * {@link #getService}: if the described PendingIntent already exists, - * then keep it but its replace its extra data with what is in this new - * Intent. This can be used if you are creating intents where only the + * Flag indicating that if the described PendingIntent already exists, + * then keep it but replace its extra data with what is in this new + * Intent. For use with {@link #getActivity}, {@link #getBroadcast}, and + * {@link #getService}.
This can be used if you are creating intents where only the * extras change, and don't care that any entities that received your * previous PendingIntent will be able to launch it with your new * extras even if they are not explicitly given to it. @@ -203,7 +205,7 @@ public final class PendingIntent implements Parcelable { *
For security reasons, the {@link android.content.Intent} * you supply here should almost always be an explicit intent, * that is specify an explicit component to be delivered to through - * {@link Intent#setClass(android.content.Context, Class)} Intent.setClass
+ * {@link Intent#setClass(android.content.Context, Class) Intent.setClass} * * @param context The Context in which this PendingIntent should start * the activity. @@ -234,7 +236,7 @@ public final class PendingIntent implements Parcelable { *For security reasons, the {@link android.content.Intent} * you supply here should almost always be an explicit intent, * that is specify an explicit component to be delivered to through - * {@link Intent#setClass(android.content.Context, Class)} Intent.setClass
+ * {@link Intent#setClass(android.content.Context, Class) Intent.setClass} * * @param context The Context in which this PendingIntent should start * the activity. @@ -326,7 +328,7 @@ public final class PendingIntent implements Parcelable { *For security reasons, the {@link android.content.Intent} objects * you supply here should almost always be explicit intents, * that is specify an explicit component to be delivered to through - * {@link Intent#setClass(android.content.Context, Class)} Intent.setClass
+ * {@link Intent#setClass(android.content.Context, Class) Intent.setClass} * * @param context The Context in which this PendingIntent should start * the activity. @@ -376,7 +378,7 @@ public final class PendingIntent implements Parcelable { *For security reasons, the {@link android.content.Intent} objects * you supply here should almost always be explicit intents, * that is specify an explicit component to be delivered to through - * {@link Intent#setClass(android.content.Context, Class)} Intent.setClass
+ * {@link Intent#setClass(android.content.Context, Class) Intent.setClass} * * @param context The Context in which this PendingIntent should start * the activity. @@ -446,7 +448,7 @@ public final class PendingIntent implements Parcelable { *For security reasons, the {@link android.content.Intent} * you supply here should almost always be an explicit intent, * that is specify an explicit component to be delivered to through - * {@link Intent#setClass(android.content.Context, Class)} Intent.setClass
+ * {@link Intent#setClass(android.content.Context, Class) Intent.setClass} * * @param context The Context in which this PendingIntent should perform * the broadcast. @@ -500,7 +502,7 @@ public final class PendingIntent implements Parcelable { *For security reasons, the {@link android.content.Intent} * you supply here should almost always be an explicit intent, * that is specify an explicit component to be delivered to through - * {@link Intent#setClass(android.content.Context, Class)} Intent.setClass
+ * {@link Intent#setClass(android.content.Context, Class) Intent.setClass} * * @param context The Context in which this PendingIntent should start * the service. diff --git a/core/java/android/app/WallpaperManager.java b/core/java/android/app/WallpaperManager.java index ced72f80a0295a17d2d7bd780d7feb53ea845dc1..f291e8298bc1f844510da9189c46719ddb37eb42 100644 --- a/core/java/android/app/WallpaperManager.java +++ b/core/java/android/app/WallpaperManager.java @@ -45,9 +45,7 @@ import android.os.Message; import android.os.ParcelFileDescriptor; import android.os.RemoteException; import android.os.ServiceManager; -import android.util.DisplayMetrics; import android.util.Log; -import android.view.WindowManager; import android.view.WindowManagerGlobal; import java.io.BufferedInputStream; @@ -294,9 +292,8 @@ public class WallpaperManager { try { BitmapFactory.Options options = new BitmapFactory.Options(); - Bitmap bm = BitmapFactory.decodeFileDescriptor( + return BitmapFactory.decodeFileDescriptor( fd.getFileDescriptor(), null, options); - return generateBitmap(context, bm, width, height); } catch (OutOfMemoryError e) { Log.w(TAG, "Can't decode file", e); } finally { @@ -323,8 +320,7 @@ public class WallpaperManager { try { BitmapFactory.Options options = new BitmapFactory.Options(); - Bitmap bm = BitmapFactory.decodeStream(is, null, options); - return generateBitmap(context, bm, width, height); + return BitmapFactory.decodeStream(is, null, options); } catch (OutOfMemoryError e) { Log.w(TAG, "Can't decode stream", e); } finally { @@ -1029,62 +1025,4 @@ public class WallpaperManager { public void clear() throws IOException { setResource(com.android.internal.R.drawable.default_wallpaper); } - - static Bitmap generateBitmap(Context context, Bitmap bm, int width, int height) { - if (bm == null) { - return null; - } - - WindowManager wm = (WindowManager)context.getSystemService(Context.WINDOW_SERVICE); - DisplayMetrics metrics = new DisplayMetrics(); - wm.getDefaultDisplay().getMetrics(metrics); - bm.setDensity(metrics.noncompatDensityDpi); - - if (width <= 0 || height <= 0 - || (bm.getWidth() == width && bm.getHeight() == height)) { - return bm; - } - - // This is the final bitmap we want to return. - try { - Bitmap newbm = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888); - newbm.setDensity(metrics.noncompatDensityDpi); - - Canvas c = new Canvas(newbm); - Rect targetRect = new Rect(); - targetRect.right = bm.getWidth(); - targetRect.bottom = bm.getHeight(); - - int deltaw = width - targetRect.right; - int deltah = height - targetRect.bottom; - - if (deltaw > 0 || deltah > 0) { - // We need to scale up so it covers the entire area. - float scale; - if (deltaw > deltah) { - scale = width / (float)targetRect.right; - } else { - scale = height / (float)targetRect.bottom; - } - targetRect.right = (int)(targetRect.right*scale); - targetRect.bottom = (int)(targetRect.bottom*scale); - deltaw = width - targetRect.right; - deltah = height - targetRect.bottom; - } - - targetRect.offset(deltaw/2, deltah/2); - - Paint paint = new Paint(); - paint.setFilterBitmap(true); - paint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SRC)); - c.drawBitmap(bm, null, targetRect, paint); - - bm.recycle(); - c.setBitmap(null); - return newbm; - } catch (OutOfMemoryError e) { - Log.w(TAG, "Can't generate default bitmap", e); - return bm; - } - } } diff --git a/core/java/android/app/backup/IBackupManager.aidl b/core/java/android/app/backup/IBackupManager.aidl index bb4f5f160bbeb42c820051ec0e432f71aef2853f..12ee3b624f63f29a28512d3d2d8772c42680234a 100644 --- a/core/java/android/app/backup/IBackupManager.aidl +++ b/core/java/android/app/backup/IBackupManager.aidl @@ -43,14 +43,14 @@ interface IBackupManager { void dataChanged(String packageName); /** - * Erase all backed-up data for the given package from the storage + * Erase all backed-up data for the given package from the given storage * destination. * * Any application can invoke this method for its own package, but * only callers who hold the android.permission.BACKUP permission * may invoke it for arbitrary packages. */ - void clearBackupData(String packageName); + void clearBackupData(String transportName, String packageName); /** * Notifies the Backup Manager Service that an agent has become available. This diff --git a/core/java/android/bluetooth/BluetoothAdapter.java b/core/java/android/bluetooth/BluetoothAdapter.java index e2bc80aad66d0afea95856c304062827efbcf3e3..75b007c75ce38f284a2b27ac4b04821a3ff9a502 100644 --- a/core/java/android/bluetooth/BluetoothAdapter.java +++ b/core/java/android/bluetooth/BluetoothAdapter.java @@ -20,21 +20,23 @@ import android.annotation.SdkConstant; import android.annotation.SdkConstant.SdkConstantType; import android.content.Context; import android.os.Binder; +import android.os.Handler; import android.os.IBinder; +import android.os.Looper; import android.os.Message; import android.os.ParcelUuid; import android.os.RemoteException; import android.os.ServiceManager; import android.util.Log; import android.util.Pair; + import java.io.IOException; import java.lang.ref.WeakReference; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; -import java.util.HashSet; import java.util.HashMap; -import java.util.LinkedList; +import java.util.HashSet; import java.util.Locale; import java.util.Map; import java.util.Random; @@ -213,6 +215,22 @@ public final class BluetoothAdapter { public static final String ACTION_SCAN_MODE_CHANGED = "android.bluetooth.adapter.action.SCAN_MODE_CHANGED"; + /** + * Broadcast Action: Indicate BLE Advertising is started. + * @hide + */ + @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) + public static final String ACTION_BLUETOOTH_ADVERTISING_STARTED = + "android.bluetooth.adapter.action.ADVERTISING_STARTED"; + + /** + * Broadcast Action: Indicated BLE Advertising is stopped. + * @hide + */ + @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) + public static final String ACTION_BLUETOOTH_ADVERTISING_STOPPED = + "android.bluetooth.adapter.action.ADVERTISING_STOPPED"; + /** * Used as an int extra field in {@link #ACTION_SCAN_MODE_CHANGED} * intents to request the current scan mode. Possible values are: @@ -251,7 +269,6 @@ public final class BluetoothAdapter { */ public static final int SCAN_MODE_CONNECTABLE_DISCOVERABLE = 23; - /** * Broadcast Action: The local Bluetooth adapter has started the remote * device discovery process. @@ -350,9 +367,27 @@ public final class BluetoothAdapter { /** The profile is in disconnecting state */ public static final int STATE_DISCONNECTING = 3; + /** States for Bluetooth LE advertising */ + /** @hide */ + public static final int STATE_ADVERTISE_STARTING = 0; + /** @hide */ + public static final int STATE_ADVERTISE_STARTED = 1; + /** @hide */ + public static final int STATE_ADVERTISE_STOPPING = 2; + /** @hide */ + public static final int STATE_ADVERTISE_STOPPED = 3; + /** + * Force stopping advertising without callback in case the advertising app dies. + * @hide + */ + public static final int STATE_ADVERTISE_FORCE_STOPPING = 4; + /** @hide */ public static final String BLUETOOTH_MANAGER_SERVICE = "bluetooth_manager"; + /** @hide */ + public static final int ADVERTISE_CALLBACK_SUCCESS = 0; + private static final int ADDRESS_LENGTH = 17; /** @@ -365,6 +400,10 @@ public final class BluetoothAdapter { private IBluetooth mService; private final MapRequires {@link android.Manifest.permission#BLUETOOTH_PRIVILEGED} + * + * @param callback - {@link AdvertiseCallback} + * @return true if BLE advertising succeeds, false otherwise. + * @hide + */ + public boolean startAdvertising(final AdvertiseCallback callback) { + if (getState() != STATE_ON) return false; + try { + IBluetoothGatt iGatt = mManagerService.getBluetoothGatt(); + if (iGatt == null) { + // BLE is not supported. + return false; + } + // Restart/reset advertising packets if advertising is in progress. + if (isAdvertising()) { + // Invalid advertising callback. + if (mAdvertisingGattCallback == null || mAdvertisingGattCallback.mLeHandle == -1) { + Log.e(TAG, "failed to restart advertising, invalid callback"); + return false; + } + iGatt.startAdvertising(mAdvertisingGattCallback.mLeHandle); + // Run the callback from main thread. + mHandler.post(new Runnable() { + @Override + public void run() { + // callback with status success. + callback.onAdvertiseStart(ADVERTISE_CALLBACK_SUCCESS); + } + }); + return true; + } + UUID uuid = UUID.randomUUID(); + GattCallbackWrapper wrapper = + new GattCallbackWrapper(this, null, null, callback); + iGatt.registerClient(new ParcelUuid(uuid), wrapper); + if (!wrapper.advertiseStarted()) { + return false; + } + synchronized (mLock) { + mAdvertisingGattCallback = wrapper; + } + return true; + } catch (RemoteException e) { + Log.e(TAG, "", e); + return false; + } + } + + /** + * Stop BLE advertising. + * + * @param callback - {@link AdvertiseCallback} + * @return true if BLE advertising stops, false otherwise. + * @hide + */ + public boolean stopAdvertising(AdvertiseCallback callback) { + try { + IBluetoothGatt iGatt = mManagerService.getBluetoothGatt(); + if (iGatt == null) { + // BLE is not supported + return false; + } + if (mAdvertisingGattCallback == null) { + // no callback. + return false; + } + // Make sure same callback is used for start and stop advertising. + if (callback != mAdvertisingGattCallback.mAdvertiseCallback) { + Log.e(TAG, "must use the same callback for star/stop advertising"); + return false; + } + mAdvertisingGattCallback.stopAdvertising(); + return true; + } catch (RemoteException e) { + Log.e(TAG, "", e); + return false; + } + } + /** * Return true if Bluetooth is currently enabled and ready for use. *
Equivalent to: @@ -848,6 +1011,23 @@ public final class BluetoothAdapter { return false; } + /** + * Returns whether BLE is currently advertising. + *
Requires {@link android.Manifest.permission#BLUETOOTH_PRIVILEGED}.
+ *
+ * @hide
+ */
+ public boolean isAdvertising() {
+ if (getState() != STATE_ON) return false;
+ try {
+ IBluetoothGatt iGatt = mManagerService.getBluetoothGatt();
+ return iGatt.isAdvertising();
+ } catch (RemoteException e) {
+ Log.e(TAG, "", e);
+ }
+ return false;
+ }
+
/**
* Return the set of {@link BluetoothDevice} objects that are bonded
* (paired) to the local adapter.
@@ -1272,6 +1452,8 @@ public final class BluetoothAdapter {
if (VDBG) Log.d(TAG, "onBluetoothServiceDown: " + mService);
synchronized (mManagerCallback) {
mService = null;
+ // Reset bluetooth adv scan data when Gatt service is down.
+ mBluetoothAdvScanData = null;
for (IBluetoothManagerCallback cb : mProxyServiceStateCallbacks ){
try {
if (cb != null) {
@@ -1547,7 +1729,9 @@ public final class BluetoothAdapter {
private static final int LE_CALLBACK_REG_TIMEOUT = 2000;
private static final int LE_CALLBACK_REG_WAIT_COUNT = 5;
+ private final AdvertiseCallback mAdvertiseCallback;
private final LeScanCallback mLeScanCb;
+
// mLeHandle 0: not registered
// -1: scan stopped
// >0: registered and scan started
@@ -1561,16 +1745,34 @@ public final class BluetoothAdapter {
mLeScanCb = leScanCb;
mScanFilter = uuid;
mLeHandle = 0;
+ mAdvertiseCallback = null;
+ }
+
+ public GattCallbackWrapper(BluetoothAdapter bluetoothAdapter, LeScanCallback leScanCb,
+ UUID[] uuid, AdvertiseCallback callback) {
+ mBluetoothAdapter = new WeakReference Requires {@link android.Manifest.permission#BLUETOOTH} permission.
- *
- * @param start Start or stop advertising
- */
- /*package*/ void listen(boolean start) {
- if (mContext == null || !mContext.getResources().
- getBoolean(com.android.internal.R.bool.config_bluetooth_le_peripheral_mode_supported)) {
- throw new UnsupportedOperationException("BluetoothGatt#listen is blocked");
- }
- if (DBG) Log.d(TAG, "listen() - start: " + start);
- if (mService == null || mClientIf == 0) return;
-
- try {
- mService.clientListen(mClientIf, start);
- } catch (RemoteException e) {
- Log.e(TAG,"",e);
- }
- }
-
- /**
- * Sets the advertising data contained in the adv. response packet.
- *
- * Requires {@link android.Manifest.permission#BLUETOOTH} permission.
- *
- * @param advData true to set adv. data, false to set scan response
- * @param includeName Inlucde the name in the adv. response
- * @param includeTxPower Include TX power value
- * @param minInterval Minimum desired scan interval (optional)
- * @param maxInterval Maximum desired scan interval (optional)
- * @param appearance The appearance flags for the device (optional)
- * @param manufacturerData Manufacturer specific data including company ID (optional)
- */
- /*package*/ void setAdvData(boolean advData, boolean includeName, boolean includeTxPower,
- Integer minInterval, Integer maxInterval,
- Integer appearance, Byte[] manufacturerData) {
- if (mContext == null || !mContext.getResources().
- getBoolean(com.android.internal.R.bool.config_bluetooth_le_peripheral_mode_supported)) {
- throw new UnsupportedOperationException("BluetoothGatt#setAdvData is blocked");
- }
- if (DBG) Log.d(TAG, "setAdvData()");
- if (mService == null || mClientIf == 0) return;
-
- byte[] data = new byte[0];
- if (manufacturerData != null) {
- data = new byte[manufacturerData.length];
- for(int i = 0; i != manufacturerData.length; ++i) {
- data[i] = manufacturerData[i];
- }
- }
-
- try {
- mService.setAdvData(mClientIf, !advData,
- includeName, includeTxPower,
- minInterval != null ? minInterval : 0,
- maxInterval != null ? maxInterval : 0,
- appearance != null ? appearance : 0, data);
- } catch (RemoteException e) {
- Log.e(TAG,"",e);
- }
- }
-
/**
* Disconnects an established connection, or cancels a connection attempt
* currently in progress.
diff --git a/core/java/android/bluetooth/BluetoothGattServer.java b/core/java/android/bluetooth/BluetoothGattServer.java
index 58ee54fdb1004525a7e8ac63b273707849c97c7b..153215cb525697e601b2eb5509c3f32729edb344 100644
--- a/core/java/android/bluetooth/BluetoothGattServer.java
+++ b/core/java/android/bluetooth/BluetoothGattServer.java
@@ -537,7 +537,7 @@ public final class BluetoothGattServer implements BluetoothProfile {
try {
mService.beginServiceDeclaration(mServerIf, service.getType(),
service.getInstanceId(), service.getHandles(),
- new ParcelUuid(service.getUuid()));
+ new ParcelUuid(service.getUuid()), service.isAdvertisePreferred());
List Requires {@link android.Manifest.permission#BLUETOOTH} permission.
@@ -263,4 +266,20 @@ public class BluetoothGattService {
}
return null;
}
+
+ /**
+ * Returns whether the uuid of the service should be advertised.
+ * @hide
+ */
+ public boolean isAdvertisePreferred() {
+ return mAdvertisePreferred;
+ }
+
+ /**
+ * Set whether the service uuid should be advertised.
+ * @hide
+ */
+ public void setAdvertisePreferred(boolean advertisePreferred) {
+ this.mAdvertisePreferred = advertisePreferred;
+ }
}
diff --git a/core/java/android/bluetooth/BluetoothUuid.java b/core/java/android/bluetooth/BluetoothUuid.java
index abdf949ebcfd01ff3fbbf07ead153882dff26525..4b28516e15a2ef7c03a4c720d2ca14c622372707 100644
--- a/core/java/android/bluetooth/BluetoothUuid.java
+++ b/core/java/android/bluetooth/BluetoothUuid.java
@@ -73,6 +73,9 @@ public final class BluetoothUuid {
public static final ParcelUuid MAS =
ParcelUuid.fromString("00001132-0000-1000-8000-00805F9B34FB");
+ public static final ParcelUuid BASE_UUID =
+ ParcelUuid.fromString("00000000-0000-1000-8000-00805F9B34FB");
+
public static final ParcelUuid[] RESERVED_UUIDS = {
AudioSink, AudioSource, AdvAudioDist, HSP, Handsfree, AvrcpController, AvrcpTarget,
@@ -211,4 +214,17 @@ public final class BluetoothUuid {
long value = (uuid.getMostSignificantBits() & 0x0000FFFF00000000L) >>> 32;
return (int)value;
}
+
+ /**
+ * Check whether the given parcelUuid can be converted to 16 bit bluetooth uuid.
+ * @param parcelUuid
+ * @return true if the parcelUuid can be converted to 16 bit uuid, false otherwise.
+ */
+ public static boolean isShortUuid(ParcelUuid parcelUuid) {
+ UUID uuid = parcelUuid.getUuid();
+ if (uuid.getLeastSignificantBits() != BASE_UUID.getUuid().getLeastSignificantBits()) {
+ return false;
+ }
+ return ((uuid.getMostSignificantBits() & 0xFFFF0000FFFFFFFFL) == 0x1000L);
+ }
}
diff --git a/core/java/android/bluetooth/IBluetoothGatt.aidl b/core/java/android/bluetooth/IBluetoothGatt.aidl
index df393dbb2899b372e227cbc9407288be2eb55459..784cdcc5318cc306ce37824eed664476cecf1f6b 100644
--- a/core/java/android/bluetooth/IBluetoothGatt.aidl
+++ b/core/java/android/bluetooth/IBluetoothGatt.aidl
@@ -37,10 +37,15 @@ interface IBluetoothGatt {
void unregisterClient(in int clientIf);
void clientConnect(in int clientIf, in String address, in boolean isDirect);
void clientDisconnect(in int clientIf, in String address);
- void clientListen(in int clientIf, in boolean start);
- void setAdvData(in int clientIf, in boolean setScanRsp, in boolean inclName,
- in boolean inclTxPower, in int minInterval, in int maxInterval,
- in int appearance, in byte[] manufacturerData);
+ void startAdvertising(in int appIf);
+ void stopAdvertising();
+ boolean setAdvServiceData(in byte[] serviceData);
+ byte[] getAdvServiceData();
+ boolean setAdvManufacturerCodeAndData(int manufactureCode, in byte[] manufacturerData);
+ byte[] getAdvManufacturerData();
+ List
+ * The exact format is defined in Bluetooth 4.0 specification, Volume 3, Part C, Section 11
+ * @hide
+ */
+public final class BluetoothAdvScanData {
+
+ /**
+ * Available data types of {@link BluetoothAdvScanData}.
+ */
+ public static final int AD = 0; // Advertising Data
+ public static final int SCAN_RESPONSE = 1; // Scan Response
+ public static final int EIR = 2; // Extended Inquiry Response
+
+ private static final String TAG = "BluetoothAdvScanData";
+
+ /**
+ * Data type of BluetoothAdvScanData.
+ */
+ private final int mDataType;
+ /**
+ * Bluetooth Gatt Service.
+ */
+ private IBluetoothGatt mBluetoothGatt;
+
+ /**
+ * @param mBluetoothGatt
+ * @param dataType
+ */
+ public BluetoothAdvScanData(IBluetoothGatt mBluetoothGatt, int dataType) {
+ this.mBluetoothGatt = mBluetoothGatt;
+ this.mDataType = dataType;
+ }
+
+ /**
+ * @return advertising data type.
+ */
+ public int getDataType() {
+ return mDataType;
+ }
+
+ /**
+ * Set manufactureCode and manufactureData.
+ * Returns true if manufacturer data is set, false if there is no enough room to set
+ * manufacturer data or the data is already set.
+ * @param manufacturerCode - unique identifier for the manufacturer
+ * @param manufacturerData - data associated with the specific manufacturer.
+ */
+ public boolean setManufacturerData(int manufacturerCode, byte[] manufacturerData) {
+ if (mDataType != AD) return false;
+ try {
+ return mBluetoothGatt.setAdvManufacturerCodeAndData(manufacturerCode, manufacturerData);
+ } catch (RemoteException e) {
+ Log.e(TAG, "Unable to set manufacturer id and data.", e);
+ return false;
+ }
+ }
+
+ /**
+ * Set service data. Note the service data can only be set when the data type is {@code AD};
+ * @param serviceData
+ */
+ public boolean setServiceData(byte[] serviceData) {
+
+ if (mDataType != AD) return false;
+ if (serviceData == null) return false;
+ try {
+ return mBluetoothGatt.setAdvServiceData(serviceData);
+ } catch (RemoteException e) {
+ Log.e(TAG, "Unable to set service data.", e);
+ return false;
+ }
+ }
+
+ /**
+ * Returns an immutable list of service uuids that will be advertised.
+ */
+ public List
The Bluetooth APIs let applications:
diff --git a/core/java/android/content/ClipDescription.java b/core/java/android/content/ClipDescription.java index 5cb6e77415e80ee7567fe012f6829e58bc73a981..be35f087a5e56e5d8bb31019cc03d2351fe75242 100644 --- a/core/java/android/content/ClipDescription.java +++ b/core/java/android/content/ClipDescription.java @@ -87,7 +87,7 @@ public class ClipDescription implements Parcelable { /** * Helper to compare two MIME types, where one may be a pattern. * @param concreteType A fully-specified MIME type. - * @param desiredType A desired MIME type that may be a pattern such as *\/*. + * @param desiredType A desired MIME type that may be a pattern such as */*. * @return Returns true if the two MIME types match. */ public static boolean compareMimeTypes(String concreteType, String desiredType) { diff --git a/core/java/android/content/ContentProvider.java b/core/java/android/content/ContentProvider.java index 44831fc8f41fa69a33598fa0c81e40f18cfd2f4d..02c850bc47c4f06e8754fc2093c1e2aed65f3601 100644 --- a/core/java/android/content/ContentProvider.java +++ b/core/java/android/content/ContentProvider.java @@ -1328,7 +1328,7 @@ public abstract class ContentProvider implements ComponentCallbacks2 { * * @param uri The data in the content provider being queried. * @param mimeTypeFilter The type of data the client desires. May be - * a pattern, such as *\/* to retrieve all possible data types. + * a pattern, such as */* to retrieve all possible data types. * @return Returns {@code null} if there are no possible data streams for the * given mimeTypeFilter. Otherwise returns an array of all available * concrete MIME types. @@ -1366,7 +1366,7 @@ public abstract class ContentProvider implements ComponentCallbacks2 { * * @param uri The data in the content provider being queried. * @param mimeTypeFilter The type of data the client desires. May be - * a pattern, such as *\/*, if the caller does not have specific type + * a pattern, such as */*, if the caller does not have specific type * requirements; in this case the content provider will pick its best * type matching the pattern. * @param opts Additional options from the client. The definitions of @@ -1427,7 +1427,7 @@ public abstract class ContentProvider implements ComponentCallbacks2 { * * @param uri The data in the content provider being queried. * @param mimeTypeFilter The type of data the client desires. May be - * a pattern, such as *\/*, if the caller does not have specific type + * a pattern, such as */*, if the caller does not have specific type * requirements; in this case the content provider will pick its best * type matching the pattern. * @param opts Additional options from the client. The definitions of diff --git a/core/java/android/content/ContentResolver.java b/core/java/android/content/ContentResolver.java index 4e6cc925ee5d5fbffc7ca0618a75241507eb3142..2bf4d7d3dd7ae2a391099a90368ec5f15f8e33ee 100644 --- a/core/java/android/content/ContentResolver.java +++ b/core/java/android/content/ContentResolver.java @@ -344,7 +344,7 @@ public abstract class ContentResolver { * @param url A Uri identifying content (either a list or specific type), * using the content:// scheme. * @param mimeTypeFilter The desired MIME type. This may be a pattern, - * such as *\/*, to query for all available MIME types that match the + * such as */*, to query for all available MIME types that match the * pattern. * @return Returns an array of MIME type strings for all available * data streams that match the given mimeTypeFilter. If there are none, @@ -815,7 +815,7 @@ public abstract class ContentResolver { * *
Note that if this function is called for read-only input (mode is "r") * on a content: URI, it will instead call {@link #openTypedAssetFileDescriptor} - * for you with a MIME type of "*\/*". This allows such callers to benefit + * for you with a MIME type of "*/*". This allows such callers to benefit * from any built-in data conversion that a provider implements. * * @param uri The desired URI to open. @@ -868,7 +868,7 @@ public abstract class ContentResolver { * *
Note that if this function is called for read-only input (mode is "r")
* on a content: URI, it will instead call {@link #openTypedAssetFileDescriptor}
- * for you with a MIME type of "*\/*". This allows such callers to benefit
+ * for you with a MIME type of "*/*". This allows such callers to benefit
* from any built-in data conversion that a provider implements.
*
* @param uri The desired URI to open.
@@ -993,7 +993,7 @@ public abstract class ContentResolver {
*
* @param uri The desired URI to open.
* @param mimeType The desired MIME type of the returned data. This can
- * be a pattern such as *\/*, which will allow the content provider to
+ * be a pattern such as */*, which will allow the content provider to
* select a type, though there is no way for you to determine what type
* it is returning.
* @param opts Additional provider-dependent options.
@@ -1026,7 +1026,7 @@ public abstract class ContentResolver {
*
* @param uri The desired URI to open.
* @param mimeType The desired MIME type of the returned data. This can
- * be a pattern such as *\/*, which will allow the content provider to
+ * be a pattern such as */*, which will allow the content provider to
* select a type, though there is no way for you to determine what type
* it is returning.
* @param opts Additional provider-dependent options.
@@ -1535,7 +1535,7 @@ public abstract class ContentResolver {
* for a whole class of content.
* @param notifyForDescendents If One example is {@link #setPreviewFpsRange(int, int)} , since it
+ * conflicts with {@link #setPreviewFrameRate(int)} whichever key is set later
+ * is the one that will take precedence.
+ *
+ * Calls to this method nest and must be matched by an equal number of calls to
+ * {@link #stopWifiDisplayScan()}.
+ *
+ * Requires {@link android.Manifest.permission#CONFIGURE_WIFI_DISPLAY}.
+ *
* Requires {@link android.Manifest.permission#CONFIGURE_WIFI_DISPLAY}.
*
- * If your process exits, any vibration you started with will stop.
+ * If your process exits, any vibration you started will stop.
*
+ * Note: On platform version 19 (Kitkat) specifying
+ * only PrintAttributes#COLOR_MODE_MONOCHROME leads to a print spooler
+ * crash. Hence, you should declare either both color modes or
+ * PrintAttributes#COLOR_MODE_COLOR.
+ * true
changes to URIs beginning with uri
* will also cause notifications to be sent. If false
only changes to the exact URI
- * specified by uri will cause notifications to be sent. If true, than any URI values
+ * specified by uri will cause notifications to be sent. If true
, any URI values
* at or below the specified URI will also trigger a match.
* @param observer The object that receives callbacks when changes occur.
* @see #unregisterContentObserver
diff --git a/core/java/android/content/Intent.java b/core/java/android/content/Intent.java
index 2e2d4b81777a9e3c15b8b625a5a9f29c40f70e9e..a50b65051fd6bb1b6930aab05542713a11c227be 100644
--- a/core/java/android/content/Intent.java
+++ b/core/java/android/content/Intent.java
@@ -844,7 +844,7 @@ public class Intent implements Parcelable, Cloneable {
* {@link #FLAG_GRANT_WRITE_URI_PERMISSION}, then these flags will also be
* set in the returned chooser intent, with its ClipData set appropriately:
* either a direct reflection of {@link #getClipData()} if that is non-null,
- * or a new ClipData build from {@link #getData()}.
+ * or a new ClipData built from {@link #getData()}.
*
* @param target The Intent that the user will be selecting an activity
* to perform.
@@ -4424,7 +4424,7 @@ public class Intent implements Parcelable, Cloneable {
* Return the {@link ClipData} associated with this Intent. If there is
* none, returns null. See {@link #setClipData} for more information.
*
- * @see #setClipData;
+ * @see #setClipData
*/
public ClipData getClipData() {
return mClipData;
@@ -5440,7 +5440,7 @@ public class Intent implements Parcelable, Cloneable {
* directly used by Intent. Applications should generally rely on the
* MIME type of the Intent itself, not what it may find in the ClipData.
* A common practice is to construct a ClipData for use with an Intent
- * with a MIME type of "*\/*".
+ * with a MIME type of "*/*".
*
* @param clip The new clip to set. May be null to clear the current clip.
*/
@@ -7162,8 +7162,8 @@ public class Intent implements Parcelable, Cloneable {
*
* @param type MIME data type to normalize
* @return normalized MIME data type, or null if the input was null
- * @see {@link #setType}
- * @see {@link #setTypeAndNormalize}
+ * @see #setType
+ * @see #setTypeAndNormalize
*/
public static String normalizeMimeType(String type) {
if (type == null) {
diff --git a/core/java/android/hardware/Camera.java b/core/java/android/hardware/Camera.java
index 111062d630b14283638158e81d022c6219ec6e08..eae4a46d35e8f231887e05e13c7f7a2d6ca8a7a9 100644
--- a/core/java/android/hardware/Camera.java
+++ b/core/java/android/hardware/Camera.java
@@ -45,6 +45,7 @@ import java.io.IOException;
import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.HashMap;
+import java.util.LinkedHashMap;
import java.util.List;
import java.util.concurrent.locks.ReentrantLock;
@@ -2150,10 +2151,20 @@ public class Camera {
private static final String PIXEL_FORMAT_JPEG = "jpeg";
private static final String PIXEL_FORMAT_BAYER_RGGB = "bayer-rggb";
- private HashMaptrue
on success. false
if the input
* parameters are incorrect, for instance if X and Y define the same
diff --git a/core/java/android/hardware/display/DisplayManager.java b/core/java/android/hardware/display/DisplayManager.java
index d5208d97bd41d952ae0194b9445e75c42945e88d..093e0e9270ff64a2b1277722b98fc3c04f55c25c 100644
--- a/core/java/android/hardware/display/DisplayManager.java
+++ b/core/java/android/hardware/display/DisplayManager.java
@@ -297,16 +297,31 @@ public final class DisplayManager {
}
/**
- * Initiates a fresh scan of availble Wifi displays.
+ * Starts scanning for available Wifi displays.
* The results are sent as a {@link #ACTION_WIFI_DISPLAY_STATUS_CHANGED} broadcast.
*
* Time time = new Time();
* time.set(4, 10, 2007); // set the date to Nov 4, 2007, 12am
- * time.normalize(); // this sets isDst = 1
+ * time.normalize(false); // this sets isDst = 1
* time.monthDay += 1; // changes the date to Nov 5, 2007, 12am
* millis = time.toMillis(false); // millis is Nov 4, 2007, 11pm
* millis = time.toMillis(true); // millis is Nov 5, 2007, 12am
diff --git a/core/java/android/util/LongSparseArray.java b/core/java/android/util/LongSparseArray.java
index d6e116f21e3feeed8fd53e0ec353c567183ec9ad..dab853a7fe2776a61dc902dbb0b7b6002c96b9ff 100644
--- a/core/java/android/util/LongSparseArray.java
+++ b/core/java/android/util/LongSparseArray.java
@@ -44,7 +44,7 @@ import com.android.internal.util.ArrayUtils;
* {@link #keyAt(int)} and {@link #valueAt(int)}. Iterating over the keys using
*
keyAt(int)
with ascending values of the index will return the
* keys in ascending order, or the values corresponding to the keys in ascending
- * order in the case of valueAt(int)
.
valueAt(int)
.
*/
public class LongSparseArraykeyAt(int)
with ascending values of the index will return the
* keys in ascending order, or the values corresponding to the keys in ascending
- * order in the case of valueAt(int).
+ * order in the case of valueAt(int)
.
*
* @hide
*/
diff --git a/core/java/android/util/SparseArray.java b/core/java/android/util/SparseArray.java
index 6e168a8b4ccd7d5b612a03658eac4cdccde740d8..46d9d451c6fa58aa1f1375db4754efbef2bfe8cd 100644
--- a/core/java/android/util/SparseArray.java
+++ b/core/java/android/util/SparseArray.java
@@ -44,7 +44,7 @@ import com.android.internal.util.ArrayUtils;
* {@link #keyAt(int)} and {@link #valueAt(int)}. Iterating over the keys using
* keyAt(int)
with ascending values of the index will return the
* keys in ascending order, or the values corresponding to the keys in ascending
- * order in the case of valueAt(int).
+ * order in the case of valueAt(int)
.
*/
public class SparseArray implements Cloneable {
private static final Object DELETED = new Object();
diff --git a/core/java/android/util/SparseBooleanArray.java b/core/java/android/util/SparseBooleanArray.java
index 68487e391710142699ce0bc0cdd622afe43e5a27..905dcb018b9695a88ef73e143808bf8f30f9f7d6 100644
--- a/core/java/android/util/SparseBooleanArray.java
+++ b/core/java/android/util/SparseBooleanArray.java
@@ -38,7 +38,7 @@ import com.android.internal.util.ArrayUtils;
* {@link #keyAt(int)} and {@link #valueAt(int)}. Iterating over the keys using
* keyAt(int)
with ascending values of the index will return the
* keys in ascending order, or the values corresponding to the keys in ascending
- * order in the case of valueAt(int).
+ * order in the case of valueAt(int)
.
*/
public class SparseBooleanArray implements Cloneable {
/**
diff --git a/core/java/android/util/SparseIntArray.java b/core/java/android/util/SparseIntArray.java
index 0835cb02e032d30bbc7a0df10cf09191ed54263b..4f5ca078d1e498c14021d2e6c20499377c867266 100644
--- a/core/java/android/util/SparseIntArray.java
+++ b/core/java/android/util/SparseIntArray.java
@@ -37,7 +37,7 @@ import com.android.internal.util.ArrayUtils;
* {@link #keyAt(int)} and {@link #valueAt(int)}. Iterating over the keys using
* keyAt(int)
with ascending values of the index will return the
* keys in ascending order, or the values corresponding to the keys in ascending
- * order in the case of valueAt(int).
+ * order in the case of valueAt(int)
.
*/
public class SparseIntArray implements Cloneable {
private int[] mKeys;
diff --git a/core/java/android/util/SparseLongArray.java b/core/java/android/util/SparseLongArray.java
index 62c1c0d9b6fa0f84a6f45c02879759626c6a9320..39fc8a37cc3022a02d8f670e2a8221a76435da58 100644
--- a/core/java/android/util/SparseLongArray.java
+++ b/core/java/android/util/SparseLongArray.java
@@ -37,7 +37,7 @@ import com.android.internal.util.ArrayUtils;
* {@link #keyAt(int)} and {@link #valueAt(int)}. Iterating over the keys using
* keyAt(int)
with ascending values of the index will return the
* keys in ascending order, or the values corresponding to the keys in ascending
- * order in the case of valueAt(int).
+ * order in the case of valueAt(int)
.
*/
public class SparseLongArray implements Cloneable {
private int[] mKeys;
diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java
index bdf4141f059923ac36ac88f9995b5ba0110c2851..ef60755531162c85a68f76b8a8c3328d0009dcd7 100644
--- a/core/java/android/view/View.java
+++ b/core/java/android/view/View.java
@@ -6543,7 +6543,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
* @attr ref android.R.styleable#View_filterTouchesWhenObscured
*/
public void setFilterTouchesWhenObscured(boolean enabled) {
- setFlags(enabled ? 0 : FILTER_TOUCHES_WHEN_OBSCURED,
+ setFlags(enabled ? FILTER_TOUCHES_WHEN_OBSCURED : 0,
FILTER_TOUCHES_WHEN_OBSCURED);
}
diff --git a/core/java/android/view/ViewConfiguration.java b/core/java/android/view/ViewConfiguration.java
index c3f064fdfd4ae8bfa4742b7f91e2f2dcbeff2dd9..e67659c2485e0532e80d1a5deff581cfdb2f510d 100644
--- a/core/java/android/view/ViewConfiguration.java
+++ b/core/java/android/view/ViewConfiguration.java
@@ -212,6 +212,14 @@ public class ViewConfiguration {
*/
private static final int OVERFLING_DISTANCE = 6;
+ /**
+ * Configuration values for overriding {@link #hasPermanentMenuKey()} behavior.
+ * These constants must match the definition in res/values/config.xml.
+ */
+ private static final int HAS_PERMANENT_MENU_KEY_AUTODETECT = 0;
+ private static final int HAS_PERMANENT_MENU_KEY_TRUE = 1;
+ private static final int HAS_PERMANENT_MENU_KEY_FALSE = 2;
+
private final int mEdgeSlop;
private final int mFadingEdgeLength;
private final int mMinimumFlingVelocity;
@@ -296,12 +304,31 @@ public class ViewConfiguration {
mOverflingDistance = (int) (sizeAndDensity * OVERFLING_DISTANCE + 0.5f);
if (!sHasPermanentMenuKeySet) {
- IWindowManager wm = WindowManagerGlobal.getWindowManagerService();
- try {
- sHasPermanentMenuKey = !wm.hasNavigationBar();
- sHasPermanentMenuKeySet = true;
- } catch (RemoteException ex) {
- sHasPermanentMenuKey = false;
+ final int configVal = res.getInteger(
+ com.android.internal.R.integer.config_overrideHasPermanentMenuKey);
+
+ switch (configVal) {
+ default:
+ case HAS_PERMANENT_MENU_KEY_AUTODETECT: {
+ IWindowManager wm = WindowManagerGlobal.getWindowManagerService();
+ try {
+ sHasPermanentMenuKey = !wm.hasNavigationBar();
+ sHasPermanentMenuKeySet = true;
+ } catch (RemoteException ex) {
+ sHasPermanentMenuKey = false;
+ }
+ }
+ break;
+
+ case HAS_PERMANENT_MENU_KEY_TRUE:
+ sHasPermanentMenuKey = true;
+ sHasPermanentMenuKeySet = true;
+ break;
+
+ case HAS_PERMANENT_MENU_KEY_FALSE:
+ sHasPermanentMenuKey = false;
+ sHasPermanentMenuKeySet = true;
+ break;
}
}
diff --git a/core/java/android/view/ViewRootImpl.java b/core/java/android/view/ViewRootImpl.java
index 3fd2aa9de924af3113ac87f827fc58856b702108..5b2a4527aa90d6525d86380a0c552b7c1491156c 100644
--- a/core/java/android/view/ViewRootImpl.java
+++ b/core/java/android/view/ViewRootImpl.java
@@ -232,8 +232,6 @@ public final class ViewRootImpl implements ViewParent,
InputStage mFirstInputStage;
InputStage mFirstPostImeInputStage;
- boolean mFlipControllerFallbackKeys;
-
boolean mWindowAttributesChanged = false;
int mWindowAttributesChangesFlag = 0;
@@ -370,8 +368,6 @@ public final class ViewRootImpl implements ViewParent,
mNoncompatDensity = context.getResources().getDisplayMetrics().noncompatDensityDpi;
mFallbackEventHandler = PolicyManager.makeNewFallbackEventHandler(context);
mChoreographer = Choreographer.getInstance();
- mFlipControllerFallbackKeys =
- context.getResources().getBoolean(R.bool.flip_controller_fallback_keys);
PowerManager powerManager = (PowerManager) context.getSystemService(Context.POWER_SERVICE);
mAttachInfo.mScreenOn = powerManager.isScreenOn();
@@ -2912,11 +2908,8 @@ public final class ViewRootImpl implements ViewParent,
mView.dispatchConfigurationChanged(config);
}
}
-
- mFlipControllerFallbackKeys =
- mContext.getResources().getBoolean(R.bool.flip_controller_fallback_keys);
}
-
+
/**
* Return true if child is an ancestor of parent, (or equal to the parent).
*/
@@ -3985,7 +3978,6 @@ public final class ViewRootImpl implements ViewParent,
private final SyntheticJoystickHandler mJoystick = new SyntheticJoystickHandler();
private final SyntheticTouchNavigationHandler mTouchNavigation =
new SyntheticTouchNavigationHandler();
- private final SyntheticKeyHandler mKeys = new SyntheticKeyHandler();
public SyntheticInputStage() {
super(null);
@@ -4008,12 +4000,7 @@ public final class ViewRootImpl implements ViewParent,
mTouchNavigation.process(event);
return FINISH_HANDLED;
}
- } else if (q.mEvent instanceof KeyEvent) {
- if (mKeys.process((KeyEvent) q.mEvent)) {
- return FINISH_HANDLED;
- }
}
-
return FORWARD;
}
@@ -4843,63 +4830,6 @@ public final class ViewRootImpl implements ViewParent,
};
}
- final class SyntheticKeyHandler {
-
- public boolean process(KeyEvent event) {
- // In some locales (like Japan) controllers use B for confirm and A for back, rather
- // than vice versa, so we need to special case this here since the input system itself
- // is not locale-aware.
- int keyCode;
- switch(event.getKeyCode()) {
- case KeyEvent.KEYCODE_BUTTON_A:
- case KeyEvent.KEYCODE_BUTTON_C:
- case KeyEvent.KEYCODE_BUTTON_X:
- case KeyEvent.KEYCODE_BUTTON_Z:
- keyCode = mFlipControllerFallbackKeys ?
- KeyEvent.KEYCODE_BACK : KeyEvent.KEYCODE_DPAD_CENTER;
- break;
- case KeyEvent.KEYCODE_BUTTON_B:
- case KeyEvent.KEYCODE_BUTTON_Y:
- keyCode = mFlipControllerFallbackKeys ?
- KeyEvent.KEYCODE_DPAD_CENTER : KeyEvent.KEYCODE_BACK;
- break;
- case KeyEvent.KEYCODE_BUTTON_THUMBL:
- case KeyEvent.KEYCODE_BUTTON_THUMBR:
- case KeyEvent.KEYCODE_BUTTON_START:
- case KeyEvent.KEYCODE_BUTTON_1:
- case KeyEvent.KEYCODE_BUTTON_2:
- case KeyEvent.KEYCODE_BUTTON_3:
- case KeyEvent.KEYCODE_BUTTON_4:
- case KeyEvent.KEYCODE_BUTTON_5:
- case KeyEvent.KEYCODE_BUTTON_6:
- case KeyEvent.KEYCODE_BUTTON_7:
- case KeyEvent.KEYCODE_BUTTON_8:
- case KeyEvent.KEYCODE_BUTTON_9:
- case KeyEvent.KEYCODE_BUTTON_10:
- case KeyEvent.KEYCODE_BUTTON_11:
- case KeyEvent.KEYCODE_BUTTON_12:
- case KeyEvent.KEYCODE_BUTTON_13:
- case KeyEvent.KEYCODE_BUTTON_14:
- case KeyEvent.KEYCODE_BUTTON_15:
- case KeyEvent.KEYCODE_BUTTON_16:
- keyCode = KeyEvent.KEYCODE_DPAD_CENTER;
- break;
- case KeyEvent.KEYCODE_BUTTON_SELECT:
- case KeyEvent.KEYCODE_BUTTON_MODE:
- keyCode = KeyEvent.KEYCODE_MENU;
- default:
- return false;
- }
-
- enqueueInputEvent(new KeyEvent(event.getDownTime(), event.getEventTime(),
- event.getAction(), keyCode, event.getRepeatCount(), event.getMetaState(),
- event.getDeviceId(), event.getScanCode(),
- event.getFlags() | KeyEvent.FLAG_FALLBACK, event.getSource()));
- return true;
- }
-
- }
-
/**
* Returns true if the key is used for keyboard navigation.
* @param keyEvent The key event.
diff --git a/core/java/android/view/VolumePanel.java b/core/java/android/view/VolumePanel.java
index f0e6677d016b7eb9afc0dbad09d4cbc7b6d7a96a..52f9c0b480cad4adcf222414abcc50fcd7bf1e6f 100644
--- a/core/java/android/view/VolumePanel.java
+++ b/core/java/android/view/VolumePanel.java
@@ -311,7 +311,6 @@ public class VolumePanel extends Handler implements OnSeekBarChangeListener, Vie
lp.type = LayoutParams.TYPE_VOLUME_OVERLAY;
lp.width = LayoutParams.WRAP_CONTENT;
lp.height = LayoutParams.WRAP_CONTENT;
- lp.privateFlags |= LayoutParams.PRIVATE_FLAG_FORCE_SHOW_NAV_BAR;
window.setAttributes(lp);
window.addFlags(LayoutParams.FLAG_NOT_FOCUSABLE | LayoutParams.FLAG_NOT_TOUCH_MODAL
| LayoutParams.FLAG_WATCH_OUTSIDE_TOUCH);
diff --git a/core/java/android/view/WindowManager.java b/core/java/android/view/WindowManager.java
index 0ce4da5c4dc5c184039cc8368e4595211bf126dd..53a4c0d0df511dd86280ec46b4d1bb8c5c691b1c 100644
--- a/core/java/android/view/WindowManager.java
+++ b/core/java/android/view/WindowManager.java
@@ -1062,13 +1062,6 @@ public interface WindowManager extends ViewManager {
* {@hide} */
public static final int PRIVATE_FLAG_SHOW_FOR_ALL_USERS = 0x00000010;
- /**
- * Special flag for the volume overlay: force the window manager out of "hide nav bar"
- * mode while the window is on screen.
- *
- * {@hide} */
- public static final int PRIVATE_FLAG_FORCE_SHOW_NAV_BAR = 0x00000020;
-
/**
* Never animate position changes of the window.
*
diff --git a/core/java/android/webkit/WebView.java b/core/java/android/webkit/WebView.java
index 5bc39f1584084bfc45b5b470c226c7f9cf636e2c..d53bb74c81ab76a68889d6a08a54c22c1c42fc76 100644
--- a/core/java/android/webkit/WebView.java
+++ b/core/java/android/webkit/WebView.java
@@ -685,6 +685,15 @@ public class WebView extends AbsoluteLayout
getFactory().getStatics().setPlatformNotificationsEnabled(false);
}
+ /**
+ * Used only by internal tests to free up memory.
+ *
+ * @hide
+ */
+ public static void freeMemoryForTests() {
+ getFactory().getStatics().freeMemoryForTests();
+ }
+
/**
* Informs WebView of the network state. This is used to set
* the JavaScript property window.navigator.isOnline and
diff --git a/core/java/android/webkit/WebViewFactoryProvider.java b/core/java/android/webkit/WebViewFactoryProvider.java
index 9d9d88292c1adcb775d9e2c2a3d1066377b2e0d8..e391aafd546587b38f6409edd23033990fe786a0 100644
--- a/core/java/android/webkit/WebViewFactoryProvider.java
+++ b/core/java/android/webkit/WebViewFactoryProvider.java
@@ -49,6 +49,11 @@ public interface WebViewFactoryProvider {
*/
String getDefaultUserAgent(Context context);
+ /**
+ * Used for tests only.
+ */
+ void freeMemoryForTests();
+
/**
* Implements the API method:
* {@link android.webkit.WebView#setWebContentsDebuggingEnabled(boolean) }
diff --git a/core/java/android/widget/AbsListView.java b/core/java/android/widget/AbsListView.java
index 092f4749e0404ab741392db73a8bd3ce3bc118f3..25a43a6a2969c0528d2e7badac80b1d27c9420a6 100644
--- a/core/java/android/widget/AbsListView.java
+++ b/core/java/android/widget/AbsListView.java
@@ -723,7 +723,7 @@ public abstract class AbsListView extends AdapterView implements Te
*
* @param view The view whose scroll state is being reported
*
- * @param scrollState The current scroll state. One of {@link #SCROLL_STATE_IDLE},
+ * @param scrollState The current scroll state. One of
* {@link #SCROLL_STATE_TOUCH_SCROLL} or {@link #SCROLL_STATE_IDLE}.
*/
public void onScrollStateChanged(AbsListView view, int scrollState);
@@ -2076,22 +2076,23 @@ public abstract class AbsListView extends AdapterView implements Te
protected void onLayout(boolean changed, int l, int t, int r, int b) {
super.onLayout(changed, l, t, r, b);
mInLayout = true;
+ final int childCount = getChildCount();
if (changed) {
- int childCount = getChildCount();
for (int i = 0; i < childCount; i++) {
getChildAt(i).forceLayout();
}
mRecycler.markChildrenDirty();
}
- if (mFastScroller != null && (mItemCount != mOldItemCount || mDataChanged)) {
- mFastScroller.onItemCountChanged(mItemCount);
- }
-
layoutChildren();
mInLayout = false;
mOverscrollMax = (b - t) / OVERSCROLL_LIMIT_DIVISOR;
+
+ // TODO: Move somewhere sane. This doesn't belong in onLayout().
+ if (mFastScroller != null) {
+ mFastScroller.onItemCountChanged(getChildCount(), mItemCount);
+ }
}
/**
@@ -2228,26 +2229,34 @@ public abstract class AbsListView extends AdapterView implements Te
Trace.traceBegin(Trace.TRACE_TAG_VIEW, "obtainView");
isScrap[0] = false;
- View scrapView;
- scrapView = mRecycler.getTransientStateView(position);
- if (scrapView == null) {
- scrapView = mRecycler.getScrapView(position);
- }
+ // Check whether we have a transient state view. Attempt to re-bind the
+ // data and discard the view if we fail.
+ final View transientView = mRecycler.getTransientStateView(position);
+ if (transientView != null) {
+ final LayoutParams params = (LayoutParams) transientView.getLayoutParams();
- View child;
- if (scrapView != null) {
- child = mAdapter.getView(position, scrapView, this);
+ // If the view type hasn't changed, attempt to re-bind the data.
+ if (params.viewType == mAdapter.getItemViewType(position)) {
+ final View updatedView = mAdapter.getView(position, transientView, this);
- if (child.getImportantForAccessibility() == IMPORTANT_FOR_ACCESSIBILITY_AUTO) {
- child.setImportantForAccessibility(IMPORTANT_FOR_ACCESSIBILITY_YES);
+ // If we failed to re-bind the data, scrap the obtained view.
+ if (updatedView != transientView) {
+ mRecycler.addScrapView(updatedView, position);
+ }
}
+ // Scrap view implies temporary detachment.
+ isScrap[0] = true;
+ return transientView;
+ }
+
+ final View scrapView = mRecycler.getScrapView(position);
+ final View child = mAdapter.getView(position, scrapView, this);
+ if (scrapView != null) {
if (child != scrapView) {
+ // Failed to re-bind the data, return scrap to the heap.
mRecycler.addScrapView(scrapView, position);
- if (mCacheColorHint != 0) {
- child.setDrawingCacheBackgroundColor(mCacheColorHint);
- }
} else {
isScrap[0] = true;
@@ -2259,16 +2268,14 @@ public abstract class AbsListView extends AdapterView implements Te
child.dispatchFinishTemporaryDetach();
}
- } else {
- child = mAdapter.getView(position, null, this);
+ }
- if (child.getImportantForAccessibility() == IMPORTANT_FOR_ACCESSIBILITY_AUTO) {
- child.setImportantForAccessibility(IMPORTANT_FOR_ACCESSIBILITY_YES);
- }
+ if (mCacheColorHint != 0) {
+ child.setDrawingCacheBackgroundColor(mCacheColorHint);
+ }
- if (mCacheColorHint != 0) {
- child.setDrawingCacheBackgroundColor(mCacheColorHint);
- }
+ if (child.getImportantForAccessibility() == IMPORTANT_FOR_ACCESSIBILITY_AUTO) {
+ child.setImportantForAccessibility(IMPORTANT_FOR_ACCESSIBILITY_YES);
}
if (mAdapterHasStableIds) {
@@ -6562,12 +6569,8 @@ public abstract class AbsListView extends AdapterView implements Te
}
}
}
- if (mTransientStateViews != null) {
- mTransientStateViews.clear();
- }
- if (mTransientStateViewsById != null) {
- mTransientStateViewsById.clear();
- }
+
+ clearTransientStateViews();
}
/**
@@ -6634,14 +6637,26 @@ public abstract class AbsListView extends AdapterView implements Te
}
/**
- * Dump any currently saved views with transient state.
+ * Dumps and fully detaches any currently saved views with transient
+ * state.
*/
void clearTransientStateViews() {
- if (mTransientStateViews != null) {
- mTransientStateViews.clear();
+ final SparseArray viewsByPos = mTransientStateViews;
+ if (viewsByPos != null) {
+ final int N = viewsByPos.size();
+ for (int i = 0; i < N; i++) {
+ removeDetachedView(viewsByPos.valueAt(i), false);
+ }
+ viewsByPos.clear();
}
- if (mTransientStateViewsById != null) {
- mTransientStateViewsById.clear();
+
+ final LongSparseArray viewsById = mTransientStateViewsById;
+ if (viewsById != null) {
+ final int N = viewsById.size();
+ for (int i = 0; i < N; i++) {
+ removeDetachedView(viewsById.valueAt(i), false);
+ }
+ viewsById.clear();
}
}
@@ -6766,44 +6781,48 @@ public abstract class AbsListView extends AdapterView implements Te
if (victim != null) {
final AbsListView.LayoutParams lp
= (AbsListView.LayoutParams) victim.getLayoutParams();
- int whichScrap = lp.viewType;
+ final int whichScrap = lp.viewType;
activeViews[i] = null;
- final boolean scrapHasTransientState = victim.hasTransientState();
- if (!shouldRecycleViewType(whichScrap) || scrapHasTransientState) {
- // Do not move views that should be ignored
- if (whichScrap != ITEM_VIEW_TYPE_HEADER_OR_FOOTER &&
- scrapHasTransientState) {
+ if (victim.hasTransientState()) {
+ // Store views with transient state for later use.
+ victim.dispatchStartTemporaryDetach();
+
+ if (mAdapter != null && mAdapterHasStableIds) {
+ if (mTransientStateViewsById == null) {
+ mTransientStateViewsById = new LongSparseArray();
+ }
+ long id = mAdapter.getItemId(mFirstActivePosition + i);
+ mTransientStateViewsById.put(id, victim);
+ } else if (!mDataChanged) {
+ if (mTransientStateViews == null) {
+ mTransientStateViews = new SparseArray();
+ }
+ mTransientStateViews.put(mFirstActivePosition + i, victim);
+ } else if (whichScrap != ITEM_VIEW_TYPE_HEADER_OR_FOOTER) {
+ // The data has changed, we can't keep this view.
removeDetachedView(victim, false);
}
- if (scrapHasTransientState) {
- if (mAdapter != null && mAdapterHasStableIds) {
- if (mTransientStateViewsById == null) {
- mTransientStateViewsById = new LongSparseArray();
- }
- long id = mAdapter.getItemId(mFirstActivePosition + i);
- mTransientStateViewsById.put(id, victim);
- } else {
- if (mTransientStateViews == null) {
- mTransientStateViews = new SparseArray();
- }
- mTransientStateViews.put(mFirstActivePosition + i, victim);
- }
+ } else if (!shouldRecycleViewType(whichScrap)) {
+ // Discard non-recyclable views except headers/footers.
+ if (whichScrap != ITEM_VIEW_TYPE_HEADER_OR_FOOTER) {
+ removeDetachedView(victim, false);
+ }
+ } else {
+ // Store everything else on the appropriate scrap heap.
+ if (multipleScraps) {
+ scrapViews = mScrapViews[whichScrap];
}
- continue;
- }
- if (multipleScraps) {
- scrapViews = mScrapViews[whichScrap];
- }
- victim.dispatchStartTemporaryDetach();
- lp.scrappedFromPosition = mFirstActivePosition + i;
- scrapViews.add(victim);
+ victim.dispatchStartTemporaryDetach();
+ lp.scrappedFromPosition = mFirstActivePosition + i;
+ scrapViews.add(victim);
- victim.setAccessibilityDelegate(null);
- if (hasListener) {
- mRecyclerListener.onMovedToScrapHeap(victim);
+ victim.setAccessibilityDelegate(null);
+ if (hasListener) {
+ mRecyclerListener.onMovedToScrapHeap(victim);
+ }
}
}
}
@@ -6812,8 +6831,10 @@ public abstract class AbsListView extends AdapterView implements Te
}
/**
- * Makes sure that the size of mScrapViews does not exceed the size of mActiveViews.
- * (This can happen if an adapter does not recycle its views).
+ * Makes sure that the size of mScrapViews does not exceed the size of
+ * mActiveViews, which can happen if an adapter does not recycle its
+ * views. Removes cached transient state views that no longer have
+ * transient state.
*/
private void pruneScrapViews() {
final int maxViews = mActiveViews.length;
@@ -6829,20 +6850,25 @@ public abstract class AbsListView extends AdapterView implements Te
}
}
- if (mTransientStateViews != null) {
- for (int i = 0; i < mTransientStateViews.size(); i++) {
- final View v = mTransientStateViews.valueAt(i);
+ final SparseArray transViewsByPos = mTransientStateViews;
+ if (transViewsByPos != null) {
+ for (int i = 0; i < transViewsByPos.size(); i++) {
+ final View v = transViewsByPos.valueAt(i);
if (!v.hasTransientState()) {
- mTransientStateViews.removeAt(i);
+ removeDetachedView(v, false);
+ transViewsByPos.removeAt(i);
i--;
}
}
}
- if (mTransientStateViewsById != null) {
- for (int i = 0; i < mTransientStateViewsById.size(); i++) {
- final View v = mTransientStateViewsById.valueAt(i);
+
+ final LongSparseArray transViewsById = mTransientStateViewsById;
+ if (transViewsById != null) {
+ for (int i = 0; i < transViewsById.size(); i++) {
+ final View v = transViewsById.valueAt(i);
if (!v.hasTransientState()) {
- mTransientStateViewsById.removeAt(i);
+ removeDetachedView(v, false);
+ transViewsById.removeAt(i);
i--;
}
}
diff --git a/core/java/android/widget/CalendarView.java b/core/java/android/widget/CalendarView.java
index 0957ab4670e613484377b95f2a579edaa69b48c5..e90b4608a88836b065b09b44455a799998934cb8 100644
--- a/core/java/android/widget/CalendarView.java
+++ b/core/java/android/widget/CalendarView.java
@@ -1210,35 +1210,38 @@ public class CalendarView extends FrameLayout {
child = (WeekView) view.getChildAt(offset);
}
- // Find out which month we're moving into
- int month;
- if (mIsScrollingUp) {
- month = child.getMonthOfFirstWeekDay();
- } else {
- month = child.getMonthOfLastWeekDay();
- }
-
- // And how it relates to our current highlighted month
- int monthDiff;
- if (mCurrentMonthDisplayed == 11 && month == 0) {
- monthDiff = 1;
- } else if (mCurrentMonthDisplayed == 0 && month == 11) {
- monthDiff = -1;
- } else {
- monthDiff = month - mCurrentMonthDisplayed;
- }
-
- // Only switch months if we're scrolling away from the currently
- // selected month
- if ((!mIsScrollingUp && monthDiff > 0) || (mIsScrollingUp && monthDiff < 0)) {
- Calendar firstDay = child.getFirstDay();
+ if (child != null) {
+ // Find out which month we're moving into
+ int month;
if (mIsScrollingUp) {
- firstDay.add(Calendar.DAY_OF_MONTH, -DAYS_PER_WEEK);
+ month = child.getMonthOfFirstWeekDay();
} else {
- firstDay.add(Calendar.DAY_OF_MONTH, DAYS_PER_WEEK);
+ month = child.getMonthOfLastWeekDay();
+ }
+
+ // And how it relates to our current highlighted month
+ int monthDiff;
+ if (mCurrentMonthDisplayed == 11 && month == 0) {
+ monthDiff = 1;
+ } else if (mCurrentMonthDisplayed == 0 && month == 11) {
+ monthDiff = -1;
+ } else {
+ monthDiff = month - mCurrentMonthDisplayed;
+ }
+
+ // Only switch months if we're scrolling away from the currently
+ // selected month
+ if ((!mIsScrollingUp && monthDiff > 0) || (mIsScrollingUp && monthDiff < 0)) {
+ Calendar firstDay = child.getFirstDay();
+ if (mIsScrollingUp) {
+ firstDay.add(Calendar.DAY_OF_MONTH, -DAYS_PER_WEEK);
+ } else {
+ firstDay.add(Calendar.DAY_OF_MONTH, DAYS_PER_WEEK);
+ }
+ setMonthDisplayed(firstDay);
}
- setMonthDisplayed(firstDay);
}
+
mPreviousScrollPosition = currScroll;
mPreviousScrollState = mCurrentScrollState;
}
diff --git a/core/java/android/widget/FastScroller.java b/core/java/android/widget/FastScroller.java
index 01ac8fdba6d0ee3a0cd64a58e3a0e424e26c3dd5..4379bf62336ff87718a1d64b3878aba80cb5d8da 100644
--- a/core/java/android/widget/FastScroller.java
+++ b/core/java/android/widget/FastScroller.java
@@ -224,6 +224,8 @@ class FastScroller {
mHasPendingDrag = false;
}
};
+ private int mOldItemCount;
+ private int mOldChildCount;
/**
* Used to delay hiding fast scroll decorations.
@@ -248,6 +250,8 @@ class FastScroller {
public FastScroller(AbsListView listView) {
mList = listView;
mOverlay = listView.getOverlay();
+ mOldItemCount = listView.getCount();
+ mOldChildCount = listView.getChildCount();
final Context context = listView.getContext();
mScaledTouchSlop = ViewConfiguration.get(context).getScaledTouchSlop();
@@ -258,6 +262,7 @@ class FastScroller {
final ImageView trackImage = new ImageView(context);
mTrackImage = trackImage;
+ updateLongList(mOldChildCount, mOldItemCount);
int width = 0;
// Add track to overlay if it has an image.
@@ -445,20 +450,23 @@ class FastScroller {
updateLayout();
}
- public void onItemCountChanged(int totalItemCount) {
- final int visibleItemCount = mList.getChildCount();
- final boolean hasMoreItems = totalItemCount - visibleItemCount > 0;
- if (hasMoreItems && mState != STATE_DRAGGING) {
- final int firstVisibleItem = mList.getFirstVisiblePosition();
- setThumbPos(getPosFromItemCount(firstVisibleItem, visibleItemCount, totalItemCount));
- }
+ public void onItemCountChanged(int childCount, int itemCount) {
+ if (mOldItemCount != itemCount || mOldChildCount != childCount) {
+ mOldItemCount = itemCount;
+ mOldChildCount = childCount;
- updateLongList(visibleItemCount, totalItemCount);
+ final boolean hasMoreItems = itemCount - childCount > 0;
+ if (hasMoreItems && mState != STATE_DRAGGING) {
+ final int firstVisibleItem = mList.getFirstVisiblePosition();
+ setThumbPos(getPosFromItemCount(firstVisibleItem, childCount, itemCount));
+ }
+
+ updateLongList(childCount, itemCount);
+ }
}
- private void updateLongList(int visibleItemCount, int totalItemCount) {
- final boolean longList = visibleItemCount > 0
- && totalItemCount / visibleItemCount >= MIN_PAGES;
+ private void updateLongList(int childCount, int itemCount) {
+ final boolean longList = childCount > 0 && itemCount / childCount >= MIN_PAGES;
if (mLongList != longList) {
mLongList = longList;
diff --git a/core/java/android/widget/ImageView.java b/core/java/android/widget/ImageView.java
index 7daf798194fb87bc28c4f9b2d42a8cefd90e1bee..f05179bb5883af172fc266ae5f2d5a09531fe319 100644
--- a/core/java/android/widget/ImageView.java
+++ b/core/java/android/widget/ImageView.java
@@ -563,7 +563,7 @@ public class ImageView extends View {
}
/** Return the view's optional matrix. This is applied to the
- view's drawable when it is drawn. If there is not matrix,
+ view's drawable when it is drawn. If there is no matrix,
this method will return an identity matrix.
Do not change this matrix in place but make a copy.
If you want a different matrix applied to the drawable,
diff --git a/core/java/android/widget/PopupWindow.java b/core/java/android/widget/PopupWindow.java
index 5663959bdfe34ee4d947d7d718d3dbfc111a2669..be20d2d836f8b17e057fff1e8eaa80bf7a2bba28 100644
--- a/core/java/android/widget/PopupWindow.java
+++ b/core/java/android/widget/PopupWindow.java
@@ -1330,7 +1330,7 @@ public class PopupWindow {
/**
* Updates the state of the popup window, if it is currently being displayed,
- * from the currently set state. This include:
+ * from the currently set state. This includes:
* {@link #setClippingEnabled(boolean)}, {@link #setFocusable(boolean)},
* {@link #setIgnoreCheekPress()}, {@link #setInputMethodMode(int)},
* {@link #setTouchable(boolean)}, and {@link #setAnimationStyle(int)}.
diff --git a/core/java/android/widget/ProgressBar.java b/core/java/android/widget/ProgressBar.java
index 5392a96715bf3590f986439b13663a592a3b52ab..6a369a60a3242612a706e36388088b374e81841f 100644
--- a/core/java/android/widget/ProgressBar.java
+++ b/core/java/android/widget/ProgressBar.java
@@ -308,6 +308,11 @@ public class ProgressBar extends View {
mMirrorForRtl = a.getBoolean(R.styleable.ProgressBar_mirrorForRtl, mMirrorForRtl);
a.recycle();
+
+ // If not explicitly specified this view is important for accessibility.
+ if (getImportantForAccessibility() == View.IMPORTANT_FOR_ACCESSIBILITY_AUTO) {
+ setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_YES);
+ }
}
/**
diff --git a/core/java/android/widget/ShareActionProvider.java b/core/java/android/widget/ShareActionProvider.java
index 62afd2eef1e1b03ab52eef14036cc8a3fa6d5c67..bdaaa0164ceb554bf17609ea81e3b521777e1151 100644
--- a/core/java/android/widget/ShareActionProvider.java
+++ b/core/java/android/widget/ShareActionProvider.java
@@ -266,7 +266,7 @@ public class ShareActionProvider extends ActionProvider {
* Intent shareIntent = new Intent(Intent.ACTION_SEND);
* shareIntent.setType("image/*");
* Uri uri = Uri.fromFile(new File(getFilesDir(), "foo.jpg"));
- * shareIntent.putExtra(Intent.EXTRA_STREAM, uri.toString());
+ * shareIntent.putExtra(Intent.EXTRA_STREAM, uri));
*
* @param shareIntent The share intent.
*
diff --git a/core/java/android/widget/SpellChecker.java b/core/java/android/widget/SpellChecker.java
index b204dfd0c032b3ac4c773302d402da53bec786a4..1cda631a498a952e87c9a60c76f7734d0decbef1 100644
--- a/core/java/android/widget/SpellChecker.java
+++ b/core/java/android/widget/SpellChecker.java
@@ -731,10 +731,14 @@ public class SpellChecker implements SpellCheckerSessionListener {
}
}
- if (scheduleOtherSpellCheck) {
+ if (scheduleOtherSpellCheck && wordStart <= end) {
// Update range span: start new spell check from last wordStart
setRangeSpan(editable, wordStart, end);
} else {
+ if (DBG && scheduleOtherSpellCheck) {
+ Log.w(TAG, "Trying to schedule spellcheck for invalid region, from "
+ + wordStart + " to " + end);
+ }
removeRangeSpan(editable);
}
diff --git a/core/java/android/widget/TextView.java b/core/java/android/widget/TextView.java
index 3f35875f314eb2228d8d6621089b5986fd4e4012..5ece0160b841c7e42f8c08651dfd01af2f274970 100644
--- a/core/java/android/widget/TextView.java
+++ b/core/java/android/widget/TextView.java
@@ -8667,6 +8667,10 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
super.onRtlPropertiesChanged(layoutDirection);
mTextDir = getTextDirectionHeuristic();
+
+ if (mLayout != null) {
+ checkForRelayout();
+ }
}
TextDirectionHeuristic getTextDirectionHeuristic() {
diff --git a/core/java/com/android/internal/app/ProcessStats.java b/core/java/com/android/internal/app/ProcessStats.java
index a87992aeb341c92188271660792d892de0c84cd7..a13a1cbce2901b210ac9f00444ffe6f78e5bda46 100644
--- a/core/java/com/android/internal/app/ProcessStats.java
+++ b/core/java/com/android/internal/app/ProcessStats.java
@@ -1004,7 +1004,7 @@ public final class ProcessStats implements Parcelable {
for (int iproc=pkgState.mProcesses.size()-1; iproc>=0; iproc--) {
ProcessState ps = pkgState.mProcesses.valueAt(iproc);
if (ps.isInUse() || ps.mCommonProcess.isInUse()) {
- pkgState.mProcesses.valueAt(iproc).resetSafely(now);
+ ps.resetSafely(now);
} else {
pkgState.mProcesses.valueAt(iproc).makeDead();
pkgState.mProcesses.removeAt(iproc);
@@ -1013,7 +1013,7 @@ public final class ProcessStats implements Parcelable {
for (int isvc=pkgState.mServices.size()-1; isvc>=0; isvc--) {
ServiceState ss = pkgState.mServices.valueAt(isvc);
if (ss.isInUse()) {
- pkgState.mServices.valueAt(isvc).resetSafely(now);
+ ss.resetSafely(now);
} else {
pkgState.mServices.removeAt(isvc);
}
@@ -3014,7 +3014,7 @@ public final class ProcessStats implements Parcelable {
}
public boolean isInUse() {
- return mOwner != null;
+ return mOwner != null || mRestarting;
}
void add(ServiceState other) {
diff --git a/core/java/com/android/internal/content/PackageMonitor.java b/core/java/com/android/internal/content/PackageMonitor.java
index ab871fb80a59da39f36e68ba4abb8a7377eb11bc..942995b51a83e8d6f767c57d9b2bc601e0679ebb 100644
--- a/core/java/com/android/internal/content/PackageMonitor.java
+++ b/core/java/com/android/internal/content/PackageMonitor.java
@@ -372,23 +372,25 @@ public abstract class PackageMonitor extends android.content.BroadcastReceiver {
} else if (Intent.ACTION_EXTERNAL_APPLICATIONS_AVAILABLE.equals(action)) {
String[] pkgList = intent.getStringArrayExtra(Intent.EXTRA_CHANGED_PACKAGE_LIST);
mAppearingPackages = pkgList;
- mChangeType = PACKAGE_TEMPORARY_CHANGE;
+ mChangeType = intent.getBooleanExtra(Intent.EXTRA_REPLACING, false)
+ ? PACKAGE_UPDATING : PACKAGE_TEMPORARY_CHANGE;
mSomePackagesChanged = true;
if (pkgList != null) {
onPackagesAvailable(pkgList);
for (int i=0; i parent, View view, int position, long id) {
- mMenu.performItemAction(mAdapter.getItem(position), 0);
+ mMenu.performItemAction(mAdapter.getItem(position), this, 0);
}
@Override
diff --git a/core/java/com/android/internal/view/menu/MenuBuilder.java b/core/java/com/android/internal/view/menu/MenuBuilder.java
index aff697ad580c6a12931400dc0e3e30d0b92d94e7..195a00d9eca7efe60a7b185b167371dcc4bf3da9 100644
--- a/core/java/com/android/internal/view/menu/MenuBuilder.java
+++ b/core/java/com/android/internal/view/menu/MenuBuilder.java
@@ -247,11 +247,17 @@ public class MenuBuilder implements Menu {
startDispatchingItemsChanged();
}
- private boolean dispatchSubMenuSelected(SubMenuBuilder subMenu) {
+ private boolean dispatchSubMenuSelected(SubMenuBuilder subMenu,
+ MenuPresenter preferredPresenter) {
if (mPresenters.isEmpty()) return false;
boolean result = false;
+ // Try the preferred presenter first.
+ if (preferredPresenter != null) {
+ result = preferredPresenter.onSubMenuSelected(subMenu);
+ }
+
for (WeakReference ref : mPresenters) {
final MenuPresenter presenter = ref.get();
if (presenter == null) {
@@ -865,6 +871,10 @@ public class MenuBuilder implements Menu {
}
public boolean performItemAction(MenuItem item, int flags) {
+ return performItemAction(item, null, flags);
+ }
+
+ public boolean performItemAction(MenuItem item, MenuPresenter preferredPresenter, int flags) {
MenuItemImpl itemImpl = (MenuItemImpl) item;
if (itemImpl == null || !itemImpl.isEnabled()) {
@@ -889,7 +899,7 @@ public class MenuBuilder implements Menu {
if (providerHasSubMenu) {
provider.onPrepareSubMenu(subMenu);
}
- invoked |= dispatchSubMenuSelected(subMenu);
+ invoked |= dispatchSubMenuSelected(subMenu, preferredPresenter);
if (!invoked) close(true);
} else {
if ((flags & FLAG_PERFORM_NO_CLOSE) == 0) {
diff --git a/core/jni/android/graphics/Bitmap.cpp b/core/jni/android/graphics/Bitmap.cpp
index 7143a8abb056bf58bf967abf7251767476a8aa58..d97a945bbef88224dba536d384c99f495c155cb7 100644
--- a/core/jni/android/graphics/Bitmap.cpp
+++ b/core/jni/android/graphics/Bitmap.cpp
@@ -227,7 +227,7 @@ static void ToColor_SI8_Alpha(SkColor dst[], const void* src, int width,
do {
*dst++ = SkUnPreMultiply::PMColorToColor(colors[*s++]);
} while (--width != 0);
- ctable->unlockColors(false);
+ ctable->unlockColors();
}
static void ToColor_SI8_Raw(SkColor dst[], const void* src, int width,
@@ -240,7 +240,7 @@ static void ToColor_SI8_Raw(SkColor dst[], const void* src, int width,
*dst++ = SkColorSetARGB(SkGetPackedA32(c), SkGetPackedR32(c),
SkGetPackedG32(c), SkGetPackedB32(c));
} while (--width != 0);
- ctable->unlockColors(false);
+ ctable->unlockColors();
}
static void ToColor_SI8_Opaque(SkColor dst[], const void* src, int width,
@@ -253,7 +253,7 @@ static void ToColor_SI8_Opaque(SkColor dst[], const void* src, int width,
*dst++ = SkColorSetRGB(SkGetPackedR32(c), SkGetPackedG32(c),
SkGetPackedB32(c));
} while (--width != 0);
- ctable->unlockColors(false);
+ ctable->unlockColors();
}
// can return NULL
@@ -456,10 +456,16 @@ static jboolean Bitmap_hasAlpha(JNIEnv* env, jobject, jlong bitmapHandle) {
return !bitmap->isOpaque() ? JNI_TRUE : JNI_FALSE;
}
-static void Bitmap_setHasAlpha(JNIEnv* env, jobject, jlong bitmapHandle,
- jboolean hasAlpha) {
+static void Bitmap_setAlphaAndPremultiplied(JNIEnv* env, jobject, jlong bitmapHandle,
+ jboolean hasAlpha, jboolean isPremul) {
SkBitmap* bitmap = reinterpret_cast(bitmapHandle);
- bitmap->setIsOpaque(!hasAlpha);
+ if (!hasAlpha) {
+ bitmap->setAlphaType(kOpaque_SkAlphaType);
+ } else if (isPremul) {
+ bitmap->setAlphaType(kPremul_SkAlphaType);
+ } else {
+ bitmap->setAlphaType(kUnpremul_SkAlphaType);
+ }
}
static jboolean Bitmap_hasMipMap(JNIEnv* env, jobject, jlong bitmapHandle) {
@@ -561,14 +567,14 @@ static jboolean Bitmap_writeToParcel(JNIEnv* env, jobject,
p->writeInt32(bitmap->rowBytes());
p->writeInt32(density);
- if (bitmap->getConfig() == SkBitmap::kIndex8_Config) {
+ if (bitmap->config() == SkBitmap::kIndex8_Config) {
SkColorTable* ctable = bitmap->getColorTable();
if (ctable != NULL) {
int count = ctable->count();
p->writeInt32(count);
memcpy(p->writeInplace(count * sizeof(SkPMColor)),
ctable->lockColors(), count * sizeof(SkPMColor));
- ctable->unlockColors(false);
+ ctable->unlockColors();
} else {
p->writeInt32(0); // indicate no ctable
}
@@ -800,7 +806,7 @@ static JNINativeMethod gBitmapMethods[] = {
{ "nativeRowBytes", "(J)I", (void*)Bitmap_rowBytes },
{ "nativeConfig", "(J)I", (void*)Bitmap_config },
{ "nativeHasAlpha", "(J)Z", (void*)Bitmap_hasAlpha },
- { "nativeSetHasAlpha", "(JZ)V", (void*)Bitmap_setHasAlpha },
+ { "nativeSetAlphaAndPremultiplied", "(JZZ)V", (void*)Bitmap_setAlphaAndPremultiplied},
{ "nativeHasMipMap", "(J)Z", (void*)Bitmap_hasMipMap },
{ "nativeSetHasMipMap", "(JZ)V", (void*)Bitmap_setHasMipMap },
{ "nativeCreateFromParcel",
diff --git a/core/jni/android/graphics/BitmapFactory.cpp b/core/jni/android/graphics/BitmapFactory.cpp
index 44bf7f802c9d76a4e7a45a1b9f0bb11b1c3ce76e..2b9a5c4a049c2ab82efbd92ef04c3c6d0b785484 100644
--- a/core/jni/android/graphics/BitmapFactory.cpp
+++ b/core/jni/android/graphics/BitmapFactory.cpp
@@ -21,6 +21,7 @@
#include
#include
#include
+#include
#include
#include
@@ -126,12 +127,18 @@ static void scaleNinePatchChunk(android::Res_png_9patch* chunk, float scale) {
static SkPixelRef* installPixelRef(SkBitmap* bitmap, SkStreamRewindable* stream,
int sampleSize, bool ditherImage) {
+ SkImageInfo bitmapInfo;
+ if (!bitmap->asImageInfo(&bitmapInfo)) {
+ ALOGW("bitmap has unknown configuration so no memory has been allocated");
+ return NULL;
+ }
+
SkImageRef* pr;
// only use ashmem for large images, since mmaps come at a price
if (bitmap->getSize() >= 32 * 1024) {
- pr = new SkImageRef_ashmem(stream, bitmap->config(), sampleSize);
+ pr = new SkImageRef_ashmem(bitmapInfo, stream, sampleSize);
} else {
- pr = new SkImageRef_GlobalPool(stream, bitmap->config(), sampleSize);
+ pr = new SkImageRef_GlobalPool(bitmapInfo, stream, sampleSize);
}
pr->setDitherImage(ditherImage);
bitmap->setPixelRef(pr)->unref();
@@ -159,7 +166,7 @@ public:
virtual bool allocPixelRef(SkBitmap* bitmap, SkColorTable* ctable) {
// accounts for scale in final allocation, using eventual size and config
const int bytesPerPixel = SkBitmap::ComputeBytesPerPixel(
- configForScaledOutput(bitmap->getConfig()));
+ configForScaledOutput(bitmap->config()));
const int requestedSize = bytesPerPixel *
int(bitmap->width() * mScale + 0.5f) *
int(bitmap->height() * mScale + 0.5f);
@@ -193,8 +200,15 @@ public:
return false;
}
+ SkImageInfo bitmapInfo;
+ if (!bitmap->asImageInfo(&bitmapInfo)) {
+ ALOGW("unable to reuse a bitmap as the target has an unknown bitmap configuration");
+ return false;
+ }
+
// Create a new pixelref with the new ctable that wraps the previous pixelref
- SkPixelRef* pr = new AndroidPixelRef(*static_cast(mPixelRef), ctable);
+ SkPixelRef* pr = new AndroidPixelRef(*static_cast(mPixelRef),
+ bitmapInfo, bitmap->rowBytes(), ctable);
bitmap->setPixelRef(pr)->unref();
// since we're already allocated, we lockPixels right away
@@ -403,8 +417,11 @@ static jobject doDecode(JNIEnv* env, SkStreamRewindable* stream, jobject padding
// TODO: avoid copying when scaled size equals decodingBitmap size
SkBitmap::Config config = configForScaledOutput(decodingBitmap.config());
- outputBitmap->setConfig(config, scaledWidth, scaledHeight);
- outputBitmap->setIsOpaque(decodingBitmap.isOpaque());
+ // FIXME: If the alphaType is kUnpremul and the image has alpha, the
+ // colors may not be correct, since Skia does not yet support drawing
+ // to/from unpremultiplied bitmaps.
+ outputBitmap->setConfig(config, scaledWidth, scaledHeight, 0,
+ decodingBitmap.alphaType());
if (!outputBitmap->allocPixels(outputAllocator, NULL)) {
return nullObjectReturn("allocation failed for scaled bitmap");
}
@@ -416,7 +433,7 @@ static jobject doDecode(JNIEnv* env, SkStreamRewindable* stream, jobject padding
}
SkPaint paint;
- paint.setFilterBitmap(true);
+ paint.setFilterLevel(SkPaint::kLow_FilterLevel);
SkCanvas canvas(*outputBitmap);
canvas.scale(sx, sy);
@@ -472,6 +489,12 @@ static jobject doDecode(JNIEnv* env, SkStreamRewindable* stream, jobject padding
bitmapCreateFlags, ninePatchChunk, layoutBounds, -1);
}
+// Need to buffer enough input to be able to rewind as much as might be read by a decoder
+// trying to determine the stream's format. Currently the most is 64, read by
+// SkImageDecoder_libwebp.
+// FIXME: Get this number from SkImageDecoder
+#define BYTES_TO_BUFFER 64
+
static jobject nativeDecodeStream(JNIEnv* env, jobject clazz, jobject is, jbyteArray storage,
jobject padding, jobject options) {
@@ -479,11 +502,8 @@ static jobject nativeDecodeStream(JNIEnv* env, jobject clazz, jobject is, jbyteA
SkAutoTUnref stream(CreateJavaInputStreamAdaptor(env, is, storage));
if (stream.get()) {
- // Need to buffer enough input to be able to rewind as much as might be read by a decoder
- // trying to determine the stream's format. Currently the most is 64, read by
- // SkImageDecoder_libwebp.
- // FIXME: Get this number from SkImageDecoder
- SkAutoTUnref bufferedStream(SkFrontBufferedStream::Create(stream, 64));
+ SkAutoTUnref bufferedStream(
+ SkFrontBufferedStream::Create(stream, BYTES_TO_BUFFER));
SkASSERT(bufferedStream.get() != NULL);
// for now we don't allow purgeable with java inputstreams
bitmap = doDecode(env, bufferedStream, padding, options, false, false);
@@ -504,27 +524,48 @@ static jobject nativeDecodeFileDescriptor(JNIEnv* env, jobject clazz, jobject fi
return nullObjectReturn("fstat return -1");
}
- bool isPurgeable = optionsPurgeable(env, bitmapFactoryOptions);
- bool isShareable = optionsShareable(env, bitmapFactoryOptions);
- bool weOwnTheFD = false;
- if (isPurgeable && isShareable) {
- int newFD = ::dup(descriptor);
- if (-1 != newFD) {
- weOwnTheFD = true;
- descriptor = newFD;
- }
+ // Restore the descriptor's offset on exiting this function.
+ AutoFDSeek autoRestore(descriptor);
+
+ FILE* file = fdopen(descriptor, "r");
+ if (file == NULL) {
+ return nullObjectReturn("Could not open file");
}
- SkAutoTUnref data(SkData::NewFromFD(descriptor));
- if (data.get() == NULL) {
- return nullObjectReturn("NewFromFD failed in nativeDecodeFileDescriptor");
+ SkAutoTUnref fileStream(new SkFILEStream(file,
+ SkFILEStream::kCallerRetains_Ownership));
+
+ SkAutoTUnref stream;
+
+ // Retain the old behavior of allowing purgeable if both purgeable and
+ // shareable are set to true.
+ bool isPurgeable = optionsPurgeable(env, bitmapFactoryOptions)
+ && optionsShareable(env, bitmapFactoryOptions);
+ if (isPurgeable) {
+ // Copy the stream, so the image can be decoded multiple times without
+ // continuing to modify the original file descriptor.
+ // Copy beginning from the current position.
+ const size_t fileSize = fileStream->getLength() - fileStream->getPosition();
+ void* buffer = sk_malloc_flags(fileSize, 0);
+ if (buffer == NULL) {
+ return nullObjectReturn("Could not make a copy for ashmem");
+ }
+
+ SkAutoTUnref data(SkData::NewFromMalloc(buffer, fileSize));
+
+ if (fileStream->read(buffer, fileSize) != fileSize) {
+ return nullObjectReturn("Could not read the file.");
+ }
+
+ stream.reset(new SkMemoryStream(data));
+ } else {
+ // Use a buffered stream. Although an SkFILEStream can be rewound, this
+ // ensures that SkImageDecoder::Factory never rewinds beyond the
+ // current position of the file descriptor.
+ stream.reset(SkFrontBufferedStream::Create(fileStream, BYTES_TO_BUFFER));
}
- SkAutoTUnref stream(new SkMemoryStream(data));
- /* Allow purgeable iff we own the FD, i.e., in the puregeable and
- shareable case.
- */
- return doDecode(env, stream, padding, bitmapFactoryOptions, weOwnTheFD);
+ return doDecode(env, stream, padding, bitmapFactoryOptions, isPurgeable);
}
static jobject nativeDecodeAsset(JNIEnv* env, jobject clazz, jlong native_asset,
@@ -543,7 +584,9 @@ static jobject nativeDecodeAsset(JNIEnv* env, jobject clazz, jlong native_asset,
} else {
// since we know we'll be done with the asset when we return, we can
// just use a simple wrapper
- stream = new AssetStreamAdaptor(asset);
+ stream = new AssetStreamAdaptor(asset,
+ AssetStreamAdaptor::kNo_OwnAsset,
+ AssetStreamAdaptor::kNo_HasMemoryBase);
}
SkAutoUnref aur(stream);
return doDecode(env, stream, padding, options, forcePurgeable, forcePurgeable);
diff --git a/core/jni/android/graphics/BitmapRegionDecoder.cpp b/core/jni/android/graphics/BitmapRegionDecoder.cpp
index e7d2422eeb9b61aabbabffe684f3e31760757927..0d67b071a5abee1b9df982ad45d1c09c0eb80536 100644
--- a/core/jni/android/graphics/BitmapRegionDecoder.cpp
+++ b/core/jni/android/graphics/BitmapRegionDecoder.cpp
@@ -29,7 +29,6 @@
#include "CreateJavaOutputStreamAdaptor.h"
#include "Utils.h"
#include "JNIHelp.h"
-#include "SkTScopedPtr.h"
#include
#include "android_util_Binder.h"
@@ -76,7 +75,7 @@ private:
int fHeight;
};
-static jobject createBitmapRegionDecoder(JNIEnv* env, SkStream* stream) {
+static jobject createBitmapRegionDecoder(JNIEnv* env, SkStreamRewindable* stream) {
SkImageDecoder* decoder = SkImageDecoder::Factory(stream);
int width, height;
if (NULL == decoder) {
@@ -108,7 +107,7 @@ static jobject nativeNewInstanceFromByteArray(JNIEnv* env, jobject, jbyteArray b
For now we just always copy the array's data if isShareable.
*/
AutoJavaByteArray ar(env, byteArray);
- SkStream* stream = new SkMemoryStream(ar.ptr() + offset, length, true);
+ SkStreamRewindable* stream = new SkMemoryStream(ar.ptr() + offset, length, true);
jobject brd = createBitmapRegionDecoder(env, stream);
SkSafeUnref(stream); // the decoder now holds a reference
@@ -216,7 +215,7 @@ static jobject nativeDecodeRegion(JNIEnv* env, jobject, jlong brdHandle,
region.fRight = start_x + width;
region.fBottom = start_y + height;
SkBitmap* bitmap = NULL;
- SkTScopedPtr adb;
+ SkAutoTDelete adb;
if (tileBitmap != NULL) {
// Re-use bitmap.
@@ -247,7 +246,7 @@ static jobject nativeDecodeRegion(JNIEnv* env, jobject, jlong brdHandle,
}
// detach bitmap from its autodeleter, since we want to own it now
- adb.release();
+ adb.detach();
JavaPixelAllocator* allocator = (JavaPixelAllocator*) decoder->getAllocator();
jbyteArray buff = allocator->getStorageObjAndReset();
diff --git a/core/jni/android/graphics/Canvas.cpp b/core/jni/android/graphics/Canvas.cpp
index 11089da274ae66d0e81cf0487c83085eae193ffe..f6ab39c43fd3a6d218cb1e2842ab95e1ae42a52c 100644
--- a/core/jni/android/graphics/Canvas.cpp
+++ b/core/jni/android/graphics/Canvas.cpp
@@ -549,7 +549,7 @@ public:
if (paint) {
filteredPaint = *paint;
}
- filteredPaint.setFilterBitmap(true);
+ filteredPaint.setFilterLevel(SkPaint::kLow_FilterLevel);
canvas->drawBitmap(*bitmap, left_, top_, &filteredPaint);
} else {
canvas->drawBitmap(*bitmap, left_, top_, paint);
@@ -564,7 +564,7 @@ public:
if (paint) {
filteredPaint = *paint;
}
- filteredPaint.setFilterBitmap(true);
+ filteredPaint.setFilterLevel(SkPaint::kLow_FilterLevel);
canvas->drawBitmap(*bitmap, 0, 0, &filteredPaint);
@@ -587,7 +587,7 @@ public:
if (paint) {
filteredPaint = *paint;
}
- filteredPaint.setFilterBitmap(true);
+ filteredPaint.setFilterLevel(SkPaint::kLow_FilterLevel);
canvas->drawBitmapRect(*bitmap, srcPtr, dst, &filteredPaint);
} else {
canvas->drawBitmapRect(*bitmap, srcPtr, dst, paint);
diff --git a/core/jni/android/graphics/Graphics.cpp b/core/jni/android/graphics/Graphics.cpp
index 2f4fd2934c82fe155ad5ba4018fc94aaee90ccb4..5d951ca17c38cc5ecd60fcaed0016f82a349d1d6 100644
--- a/core/jni/android/graphics/Graphics.cpp
+++ b/core/jni/android/graphics/Graphics.cpp
@@ -357,6 +357,18 @@ SkRegion* GraphicsJNI::getNativeRegion(JNIEnv* env, jobject region)
///////////////////////////////////////////////////////////////////////////////////////////
+// Assert that bitmap's SkAlphaType is consistent with isPremultiplied.
+static void assert_premultiplied(const SkBitmap& bitmap, bool isPremultiplied) {
+ // kOpaque_SkAlphaType and kIgnore_SkAlphaType mean that isPremultiplied is
+ // irrelevant. This just tests to ensure that the SkAlphaType is not
+ // opposite of isPremultiplied.
+ if (isPremultiplied) {
+ SkASSERT(bitmap.alphaType() != kUnpremul_SkAlphaType);
+ } else {
+ SkASSERT(bitmap.alphaType() != kPremul_SkAlphaType);
+ }
+}
+
jobject GraphicsJNI::createBitmap(JNIEnv* env, SkBitmap* bitmap, jbyteArray buffer,
int bitmapCreateFlags, jbyteArray ninepatch, jintArray layoutbounds, int density)
{
@@ -365,6 +377,10 @@ jobject GraphicsJNI::createBitmap(JNIEnv* env, SkBitmap* bitmap, jbyteArray buff
bool isMutable = bitmapCreateFlags & kBitmapCreateFlag_Mutable;
bool isPremultiplied = bitmapCreateFlags & kBitmapCreateFlag_Premultiplied;
+ // The caller needs to have already set the alpha type properly, so the
+ // native SkBitmap stays in sync with the Java Bitmap.
+ assert_premultiplied(*bitmap, isPremultiplied);
+
jobject obj = env->NewObject(gBitmap_class, gBitmap_constructorMethodID,
reinterpret_cast(bitmap), buffer,
bitmap->width(), bitmap->height(), density, isMutable, isPremultiplied,
@@ -382,6 +398,10 @@ jobject GraphicsJNI::createBitmap(JNIEnv* env, SkBitmap* bitmap, int bitmapCreat
void GraphicsJNI::reinitBitmap(JNIEnv* env, jobject javaBitmap, SkBitmap* bitmap,
bool isPremultiplied)
{
+ // The caller needs to have already set the alpha type properly, so the
+ // native SkBitmap stays in sync with the Java Bitmap.
+ assert_premultiplied(*bitmap, isPremultiplied);
+
env->CallVoidMethod(javaBitmap, gBitmap_reinitMethodID,
bitmap->width(), bitmap->height(), isPremultiplied);
}
@@ -424,8 +444,9 @@ static JNIEnv* vm2env(JavaVM* vm)
///////////////////////////////////////////////////////////////////////////////
-AndroidPixelRef::AndroidPixelRef(JNIEnv* env, void* storage, size_t size, jbyteArray storageObj,
- SkColorTable* ctable) : SkMallocPixelRef(storage, size, ctable, (storageObj == NULL)),
+AndroidPixelRef::AndroidPixelRef(JNIEnv* env, const SkImageInfo& info, void* storage,
+ size_t rowBytes, jbyteArray storageObj, SkColorTable* ctable) :
+ SkMallocPixelRef(info, storage, rowBytes, ctable, (storageObj == NULL)),
fWrappedPixelRef(NULL) {
SkASSERT(storage);
SkASSERT(env);
@@ -440,13 +461,13 @@ AndroidPixelRef::AndroidPixelRef(JNIEnv* env, void* storage, size_t size, jbyteA
// If storageObj is NULL, the memory was NOT allocated on the Java heap
fOnJavaHeap = (storageObj != NULL);
-
}
-AndroidPixelRef::AndroidPixelRef(AndroidPixelRef& wrappedPixelRef, SkColorTable* ctable) :
- SkMallocPixelRef(wrappedPixelRef.getAddr(), wrappedPixelRef.getSize(), ctable, false),
+AndroidPixelRef::AndroidPixelRef(AndroidPixelRef& wrappedPixelRef, const SkImageInfo& info,
+ size_t rowBytes, SkColorTable* ctable) :
+ SkMallocPixelRef(info, wrappedPixelRef.getAddr(), rowBytes, ctable, false),
fWrappedPixelRef(wrappedPixelRef.fWrappedPixelRef ?
- wrappedPixelRef.fWrappedPixelRef : &wrappedPixelRef)
+ wrappedPixelRef.fWrappedPixelRef : &wrappedPixelRef)
{
SkASSERT(fWrappedPixelRef);
SkSafeRef(fWrappedPixelRef);
@@ -548,6 +569,14 @@ jbyteArray GraphicsJNI::allocateJavaPixelRef(JNIEnv* env, SkBitmap* bitmap,
"bitmap size exceeds 32bits");
return NULL;
}
+
+ SkImageInfo bitmapInfo;
+ if (!bitmap->asImageInfo(&bitmapInfo)) {
+ jniThrowException(env, "java/lang/IllegalArgumentException",
+ "unknown bitmap configuration");
+ return NULL;
+ }
+
size_t size = size64.get32();
jbyteArray arrayObj = (jbyteArray) env->CallObjectMethod(gVMRuntime,
gVMRuntime_newNonMovableArray,
@@ -561,7 +590,8 @@ jbyteArray GraphicsJNI::allocateJavaPixelRef(JNIEnv* env, SkBitmap* bitmap,
return NULL;
}
SkASSERT(addr);
- SkPixelRef* pr = new AndroidPixelRef(env, (void*) addr, size, arrayObj, ctable);
+ SkPixelRef* pr = new AndroidPixelRef(env, bitmapInfo, (void*) addr,
+ bitmap->rowBytes(), arrayObj, ctable);
bitmap->setPixelRef(pr)->unref();
// since we're already allocated, we lockPixels right away
// HeapAllocator behaves this way too
diff --git a/core/jni/android/graphics/GraphicsJNI.h b/core/jni/android/graphics/GraphicsJNI.h
index f4590b956d78a7c7e4715307464ff00ab761441f..cb154aaf28e58b6ef9e40b9d277b1b6fba604b48 100644
--- a/core/jni/android/graphics/GraphicsJNI.h
+++ b/core/jni/android/graphics/GraphicsJNI.h
@@ -57,6 +57,7 @@ public:
/** Create a java Bitmap object given the native bitmap (required) and optional
storage array (may be null).
+ bitmap's SkAlphaType must already be in sync with bitmapCreateFlags.
*/
static jobject createBitmap(JNIEnv* env, SkBitmap* bitmap, jbyteArray buffer,
int bitmapCreateFlags, jbyteArray ninepatch, jintArray layoutbounds, int density = -1);
@@ -64,6 +65,9 @@ public:
static jobject createBitmap(JNIEnv* env, SkBitmap* bitmap, int bitmapCreateFlags,
jbyteArray ninepatch, int density = -1);
+ /** Reinitialize a bitmap. bitmap must already have its SkAlphaType set in
+ sync with isPremultiplied
+ */
static void reinitBitmap(JNIEnv* env, jobject javaBitmap, SkBitmap* bitmap,
bool isPremultiplied);
@@ -88,15 +92,16 @@ public:
class AndroidPixelRef : public SkMallocPixelRef {
public:
- AndroidPixelRef(JNIEnv* env, void* storage, size_t size, jbyteArray storageObj,
- SkColorTable* ctable);
+ AndroidPixelRef(JNIEnv* env, const SkImageInfo& info, void* storage, size_t rowBytes,
+ jbyteArray storageObj, SkColorTable* ctable);
/**
* Creates an AndroidPixelRef that wraps (and refs) another to reuse/share
* the same storage and java byte array refcounting, yet have a different
* color table.
*/
- AndroidPixelRef(AndroidPixelRef& wrappedPixelRef, SkColorTable* ctable);
+ AndroidPixelRef(AndroidPixelRef& wrappedPixelRef, const SkImageInfo& info,
+ size_t rowBytes, SkColorTable* ctable);
virtual ~AndroidPixelRef();
diff --git a/core/jni/android/graphics/Movie.cpp b/core/jni/android/graphics/Movie.cpp
index 0040b6f15d7ad011da87a24589643cecc9b6bcea..461f7232b3b1b8a720a99c6102c83441c5b0a96f 100644
--- a/core/jni/android/graphics/Movie.cpp
+++ b/core/jni/android/graphics/Movie.cpp
@@ -85,7 +85,9 @@ static void movie_draw(JNIEnv* env, jobject movie, jobject canvas,
static jobject movie_decodeAsset(JNIEnv* env, jobject clazz, jlong native_asset) {
android::Asset* asset = reinterpret_cast(native_asset);
if (asset == NULL) return NULL;
- SkAutoTUnref stream (new android::AssetStreamAdaptor(asset));
+ SkAutoTUnref stream (new android::AssetStreamAdaptor(asset,
+ android::AssetStreamAdaptor::kNo_OwnAsset,
+ android::AssetStreamAdaptor::kNo_HasMemoryBase));
SkMovie* moov = SkMovie::DecodeStream(stream.get());
return create_jmovie(env, moov);
}
diff --git a/core/jni/android/graphics/NinePatchPeeker.cpp b/core/jni/android/graphics/NinePatchPeeker.cpp
index 51392abef84c2680ece31705bf0f4177729a2de7..5daa1ad6e2ef82dc8e257ada4f1b724d2430a3ab 100644
--- a/core/jni/android/graphics/NinePatchPeeker.cpp
+++ b/core/jni/android/graphics/NinePatchPeeker.cpp
@@ -40,15 +40,14 @@ bool NinePatchPeeker::peek(const char tag[], const void* data, size_t length) {
// now update our host to force index or 32bit config
// 'cause we don't want 565 predithered, since as a 9patch, we know
// we will be stretched, and therefore we want to dither afterwards.
- static const SkBitmap::Config gNo565Pref[] = {
- SkBitmap::kIndex8_Config,
- SkBitmap::kIndex8_Config,
- SkBitmap::kARGB_8888_Config,
- SkBitmap::kARGB_8888_Config,
- SkBitmap::kARGB_8888_Config,
- SkBitmap::kARGB_8888_Config,
- };
- fHost->setPrefConfigTable(gNo565Pref);
+ SkImageDecoder::PrefConfigTable table;
+ table.fPrefFor_8Index_NoAlpha_src = SkBitmap::kIndex8_Config;
+ table.fPrefFor_8Index_YesAlpha_src = SkBitmap::kIndex8_Config;
+ table.fPrefFor_8Gray_src = SkBitmap::kARGB_8888_Config;
+ table.fPrefFor_8bpc_NoAlpha_src = SkBitmap::kARGB_8888_Config;
+ table.fPrefFor_8bpc_YesAlpha_src = SkBitmap::kARGB_8888_Config;
+
+ fHost->setPrefConfigTable(table);
} else if (strcmp("npLb", tag) == 0 && length == sizeof(int) * 4) {
fLayoutBounds = new int[4];
memcpy(fLayoutBounds, data, sizeof(int) * 4);
diff --git a/core/jni/android/graphics/Paint.cpp b/core/jni/android/graphics/Paint.cpp
index 25234813a8373bc880e27506efc5bcd94de2d916..dc97c2281c85920d386c60483f64855bb0b20811 100644
--- a/core/jni/android/graphics/Paint.cpp
+++ b/core/jni/android/graphics/Paint.cpp
@@ -155,7 +155,8 @@ public:
static void setFilterBitmap(JNIEnv* env, jobject paint, jboolean filterBitmap) {
NPE_CHECK_RETURN_VOID(env, paint);
- GraphicsJNI::getNativePaint(env, paint)->setFilterBitmap(filterBitmap);
+ GraphicsJNI::getNativePaint(env, paint)->setFilterLevel(
+ filterBitmap ? SkPaint::kLow_FilterLevel : SkPaint::kNone_FilterLevel);
}
static void setDither(JNIEnv* env, jobject paint, jboolean dither) {
@@ -609,7 +610,7 @@ public:
return 0;
}
}
- jfloat advancesArray[count];
+ jfloat* advancesArray = new jfloat[count];
jfloat totalAdvance = 0;
TextLayout::getTextRunAdvances(paint, text, start, count, contextCount, flags,
@@ -618,6 +619,7 @@ public:
if (advances != NULL) {
env->SetFloatArrayRegion(advances, advancesIndex, count, advancesArray);
}
+ delete [] advancesArray;
return totalAdvance;
}
diff --git a/core/jni/android/graphics/Region.cpp b/core/jni/android/graphics/Region.cpp
index bcf127399fcb0ceae3de5c552711c65eba773f4e..912968a9da3f975aea5856226b87d75c1bb63f49 100644
--- a/core/jni/android/graphics/Region.cpp
+++ b/core/jni/android/graphics/Region.cpp
@@ -214,7 +214,7 @@ static jlong Region_createFromParcel(JNIEnv* env, jobject clazz, jobject parcel)
SkRegion* region = new SkRegion;
size_t size = p->readInt32();
- region->readFromMemory(p->readInplace(size));
+ region->readFromMemory(p->readInplace(size), size);
return reinterpret_cast(region);
}
diff --git a/core/jni/android/graphics/TextLayoutCache.cpp b/core/jni/android/graphics/TextLayoutCache.cpp
index e2c78b1ba412d392ccddd40aea673e8bdf8038af..5db083a1296ade196e43de2b504fd639f5d61b31 100644
--- a/core/jni/android/graphics/TextLayoutCache.cpp
+++ b/core/jni/android/graphics/TextLayoutCache.cpp
@@ -20,6 +20,7 @@
#include "TextLayoutCache.h"
#include "TextLayout.h"
+#include "SkGlyphCache.h"
#include "SkTypeface_android.h"
#include "HarfBuzzNGFaceSkia.h"
#include
@@ -757,8 +758,8 @@ void TextLayoutShaper::computeRunValues(const SkPaint* paint, const UChar* conte
outPos->add(ypos);
totalAdvance += xAdvance;
- // TODO: consider using glyph cache
- const SkGlyph& metrics = mShapingPaint.getGlyphMetrics(glyphId, NULL);
+ SkAutoGlyphCache autoCache(mShapingPaint, NULL, NULL);
+ const SkGlyph& metrics = autoCache.getCache()->getGlyphIDMetrics(glyphId);
outBounds->join(xpos + metrics.fLeft, ypos + metrics.fTop,
xpos + metrics.fLeft + metrics.fWidth, ypos + metrics.fTop + metrics.fHeight);
diff --git a/core/jni/android/graphics/Typeface.cpp b/core/jni/android/graphics/Typeface.cpp
index d096c2a2c17911413973c3fee3ead6ef1be5df8c..81646250f4ebf955a07254ecd168df71136d19f8 100644
--- a/core/jni/android/graphics/Typeface.cpp
+++ b/core/jni/android/graphics/Typeface.cpp
@@ -4,6 +4,7 @@
#include "GraphicsJNI.h"
#include "SkStream.h"
#include "SkTypeface.h"
+#include "Utils.h"
#include
#include
@@ -77,65 +78,6 @@ static jint Typeface_getStyle(JNIEnv* env, jobject obj, jlong faceHandle) {
return static_cast(face->style());
}
-class AssetStream : public SkStream {
-public:
- AssetStream(Asset* asset, bool hasMemoryBase) : fAsset(asset)
- {
- fMemoryBase = hasMemoryBase ? fAsset->getBuffer(false) : NULL;
- }
-
- virtual ~AssetStream()
- {
- delete fAsset;
- }
-
- virtual const void* getMemoryBase()
- {
- return fMemoryBase;
- }
-
- virtual bool rewind()
- {
- off64_t pos = fAsset->seek(0, SEEK_SET);
- return pos != (off64_t)-1;
- }
-
- virtual size_t read(void* buffer, size_t size)
- {
- ssize_t amount;
-
- if (NULL == buffer)
- {
- if (0 == size) // caller is asking us for our total length
- return fAsset->getLength();
-
- // asset->seek returns new total offset
- // we want to return amount that was skipped
-
- off64_t oldOffset = fAsset->seek(0, SEEK_CUR);
- if (-1 == oldOffset)
- return 0;
- off64_t newOffset = fAsset->seek(size, SEEK_CUR);
- if (-1 == newOffset)
- return 0;
-
- amount = newOffset - oldOffset;
- }
- else
- {
- amount = fAsset->read(buffer, size);
- }
-
- if (amount < 0)
- amount = 0;
- return amount;
- }
-
-private:
- Asset* fAsset;
- const void* fMemoryBase;
-};
-
static jlong Typeface_createFromAsset(JNIEnv* env, jobject,
jobject jassetMgr,
jstring jpath) {
@@ -154,7 +96,9 @@ static jlong Typeface_createFromAsset(JNIEnv* env, jobject,
return NULL;
}
- SkStream* stream = new AssetStream(asset, true);
+ SkStream* stream = new AssetStreamAdaptor(asset,
+ AssetStreamAdaptor::kYes_OwnAsset,
+ AssetStreamAdaptor::kYes_HasMemoryBase);
SkTypeface* face = SkTypeface::CreateFromStream(stream);
// SkTypeFace::CreateFromStream calls ref() on the stream, so we
// need to unref it here or it won't be freed later on
diff --git a/core/jni/android/graphics/Utils.cpp b/core/jni/android/graphics/Utils.cpp
index b7d1f3ab220fd240c90ef91c35795bd15a87e1fc..eb416cbe7ad2c4b114829976dd01b1e69cd215ab 100644
--- a/core/jni/android/graphics/Utils.cpp
+++ b/core/jni/android/graphics/Utils.cpp
@@ -19,6 +19,21 @@
using namespace android;
+AssetStreamAdaptor::AssetStreamAdaptor(Asset* asset, OwnAsset ownAsset,
+ HasMemoryBase hasMemoryBase)
+ : fAsset(asset)
+ , fMemoryBase(kYes_HasMemoryBase == hasMemoryBase ?
+ asset->getBuffer(false) : NULL)
+ , fOwnAsset(ownAsset)
+{
+}
+
+AssetStreamAdaptor::~AssetStreamAdaptor() {
+ if (kYes_OwnAsset == fOwnAsset) {
+ delete fAsset;
+ }
+}
+
bool AssetStreamAdaptor::rewind() {
off64_t pos = fAsset->seek(0, SEEK_SET);
if (pos == (off64_t)-1) {
diff --git a/core/jni/android/graphics/Utils.h b/core/jni/android/graphics/Utils.h
index a1ac72a0b92bf4392a99e03351a62176f23ef3e2..b90593cdc4b092e8b67470d4adecd58813aa2ecb 100644
--- a/core/jni/android/graphics/Utils.h
+++ b/core/jni/android/graphics/Utils.h
@@ -28,16 +28,36 @@ namespace android {
class AssetStreamAdaptor : public SkStreamRewindable {
public:
- AssetStreamAdaptor(Asset* a) : fAsset(a) {}
+ // Enum passed to constructor. If set to kYes_OwnAsset,
+ // the passed in Asset will be deleted upon destruction.
+ enum OwnAsset {
+ kYes_OwnAsset,
+ kNo_OwnAsset,
+ };
+
+ // Enum passed to constructor. If set to kYes_HasMemoryBase,
+ // getMemoryBase will return the Asset's buffer.
+ enum HasMemoryBase {
+ kYes_HasMemoryBase,
+ kNo_HasMemoryBase,
+ };
+
+ AssetStreamAdaptor(Asset*, OwnAsset, HasMemoryBase);
+ ~AssetStreamAdaptor();
+
virtual bool rewind();
virtual size_t read(void* buffer, size_t size);
virtual bool hasLength() const { return true; }
virtual size_t getLength() const;
virtual bool isAtEnd() const;
+ virtual const void* getMemoryBase() { return fMemoryBase; }
+
virtual SkStreamRewindable* duplicate() const;
private:
- Asset* fAsset;
+ Asset* fAsset;
+ const void* const fMemoryBase;
+ const OwnAsset fOwnAsset;
};
/**
diff --git a/core/jni/android/opengl/util.cpp b/core/jni/android/opengl/util.cpp
index 48367ffb464fce8169cae96963339ebd8fa3ff70..a17f328439e0278d204f64f6ca334e50efe42744 100644
--- a/core/jni/android/opengl/util.cpp
+++ b/core/jni/android/opengl/util.cpp
@@ -632,7 +632,7 @@ static jint util_getInternalFormat(JNIEnv *env, jclass clazz,
SkBitmap const * nativeBitmap =
(SkBitmap const *)env->GetLongField(jbitmap, nativeBitmapID);
const SkBitmap& bitmap(*nativeBitmap);
- SkBitmap::Config config = bitmap.getConfig();
+ SkBitmap::Config config = bitmap.config();
return getInternalFormat(config);
}
@@ -642,7 +642,7 @@ static jint util_getType(JNIEnv *env, jclass clazz,
SkBitmap const * nativeBitmap =
(SkBitmap const *)env->GetLongField(jbitmap, nativeBitmapID);
const SkBitmap& bitmap(*nativeBitmap);
- SkBitmap::Config config = bitmap.getConfig();
+ SkBitmap::Config config = bitmap.config();
return getType(config);
}
@@ -653,7 +653,7 @@ static jint util_texImage2D(JNIEnv *env, jclass clazz,
SkBitmap const * nativeBitmap =
(SkBitmap const *)env->GetLongField(jbitmap, nativeBitmapID);
const SkBitmap& bitmap(*nativeBitmap);
- SkBitmap::Config config = bitmap.getConfig();
+ SkBitmap::Config config = bitmap.config();
if (internalformat < 0) {
internalformat = getInternalFormat(config);
}
@@ -681,7 +681,7 @@ static jint util_texImage2D(JNIEnv *env, jclass clazz,
SkColorTable* ctable = bitmap.getColorTable();
memcpy(data, ctable->lockColors(), ctable->count() * sizeof(SkPMColor));
memcpy(pixels, p, size);
- ctable->unlockColors(false);
+ ctable->unlockColors();
glCompressedTexImage2D(target, level, internalformat, w, h, border, imageSize, data);
free(data);
} else {
@@ -702,7 +702,7 @@ static jint util_texSubImage2D(JNIEnv *env, jclass clazz,
SkBitmap const * nativeBitmap =
(SkBitmap const *)env->GetLongField(jbitmap, nativeBitmapID);
const SkBitmap& bitmap(*nativeBitmap);
- SkBitmap::Config config = bitmap.getConfig();
+ SkBitmap::Config config = bitmap.config();
if (format < 0) {
format = getInternalFormat(config);
if (format == GL_PALETTE8_RGBA8_OES)
diff --git a/core/jni/android_view_Surface.cpp b/core/jni/android_view_Surface.cpp
index c2d4ec0c5b1ba4176df85b733829a23eec157e7b..ab6c1e0c3d9a000e8ef241b8fae728b867c72a0e 100644
--- a/core/jni/android_view_Surface.cpp
+++ b/core/jni/android_view_Surface.cpp
@@ -39,6 +39,7 @@
#include
#include
+#include
#include
#include
@@ -179,7 +180,8 @@ static jboolean nativeIsConsumerRunningBehind(JNIEnv* env, jclass clazz, jlong n
static inline SkBitmap::Config convertPixelFormat(PixelFormat format) {
/* note: if PIXEL_FORMAT_RGBX_8888 means that all alpha bytes are 0xFF, then
we can map to SkBitmap::kARGB_8888_Config, and optionally call
- bitmap.setIsOpaque(true) on the resulting SkBitmap (as an accelerator)
+ bitmap.setAlphaType(kOpaque_SkAlphaType) on the resulting SkBitmap
+ (as an accelerator)
*/
switch (format) {
case PIXEL_FORMAT_RGBX_8888: return SkBitmap::kARGB_8888_Config;
@@ -235,7 +237,7 @@ static jlong nativeLockCanvas(JNIEnv* env, jclass clazz,
ssize_t bpr = outBuffer.stride * bytesPerPixel(outBuffer.format);
bitmap.setConfig(convertPixelFormat(outBuffer.format), outBuffer.width, outBuffer.height, bpr);
if (outBuffer.format == PIXEL_FORMAT_RGBX_8888) {
- bitmap.setIsOpaque(true);
+ bitmap.setAlphaType(kOpaque_SkAlphaType);
}
if (outBuffer.width > 0 && outBuffer.height > 0) {
bitmap.setPixels(outBuffer.bits);
diff --git a/core/jni/android_view_SurfaceControl.cpp b/core/jni/android_view_SurfaceControl.cpp
index bd530954c283b6df6eb2c2604c1df0d148d57e12..ed84a6443e203651ec43221d4a7d295724de56d1 100644
--- a/core/jni/android_view_SurfaceControl.cpp
+++ b/core/jni/android_view_SurfaceControl.cpp
@@ -61,51 +61,21 @@ static struct {
class ScreenshotPixelRef : public SkPixelRef {
public:
- ScreenshotPixelRef(SkColorTable* ctable) {
- fCTable = ctable;
- SkSafeRef(ctable);
+ ScreenshotPixelRef(const SkImageInfo& info, ScreenshotClient* screenshot) :
+ SkPixelRef(info),
+ mScreenshot(screenshot) {
setImmutable();
}
virtual ~ScreenshotPixelRef() {
- SkSafeUnref(fCTable);
- }
-
- status_t update(const sp& display, int width, int height,
- int minLayer, int maxLayer, bool allLayers) {
- status_t res = (width > 0 && height > 0)
- ? (allLayers
- ? mScreenshot.update(display, width, height)
- : mScreenshot.update(display, width, height, minLayer, maxLayer))
- : mScreenshot.update(display);
- if (res != NO_ERROR) {
- return res;
- }
-
- return NO_ERROR;
- }
-
- uint32_t getWidth() const {
- return mScreenshot.getWidth();
- }
-
- uint32_t getHeight() const {
- return mScreenshot.getHeight();
- }
-
- uint32_t getStride() const {
- return mScreenshot.getStride();
- }
-
- uint32_t getFormat() const {
- return mScreenshot.getFormat();
+ delete mScreenshot;
}
protected:
// overrides from SkPixelRef
virtual void* onLockPixels(SkColorTable** ct) {
- *ct = fCTable;
- return (void*)mScreenshot.getPixels();
+ *ct = NULL;
+ return (void*)mScreenshot->getPixels();
}
virtual void onUnlockPixels() {
@@ -113,8 +83,7 @@ protected:
SK_DECLARE_UNFLATTENABLE_OBJECT()
private:
- ScreenshotClient mScreenshot;
- SkColorTable* fCTable;
+ ScreenshotClient* mScreenshot;
typedef SkPixelRef INHERITED;
};
@@ -147,19 +116,6 @@ static void nativeDestroy(JNIEnv* env, jclass clazz, jlong nativeObject) {
ctrl->decStrong((void *)nativeCreate);
}
-static inline SkBitmap::Config convertPixelFormat(PixelFormat format) {
- /* note: if PIXEL_FORMAT_RGBX_8888 means that all alpha bytes are 0xFF, then
- we can map to SkBitmap::kARGB_8888_Config, and optionally call
- bitmap.setIsOpaque(true) on the resulting SkBitmap (as an accelerator)
- */
- switch (format) {
- case PIXEL_FORMAT_RGBX_8888: return SkBitmap::kARGB_8888_Config;
- case PIXEL_FORMAT_RGBA_8888: return SkBitmap::kARGB_8888_Config;
- case PIXEL_FORMAT_RGB_565: return SkBitmap::kRGB_565_Config;
- default: return SkBitmap::kNo_Config;
- }
-}
-
static jobject nativeScreenshotBitmap(JNIEnv* env, jclass clazz, jobject displayTokenObj,
jint width, jint height, jint minLayer, jint maxLayer, bool allLayers) {
sp displayToken = ibinderForJavaObject(env, displayTokenObj);
@@ -167,26 +123,50 @@ static jobject nativeScreenshotBitmap(JNIEnv* env, jclass clazz, jobject display
return NULL;
}
- ScreenshotPixelRef* pixels = new ScreenshotPixelRef(NULL);
- if (pixels->update(displayToken, width, height,
- minLayer, maxLayer, allLayers) != NO_ERROR) {
- delete pixels;
+ ScreenshotClient* screenshot = new ScreenshotClient();
+ status_t res = (width > 0 && height > 0)
+ ? (allLayers
+ ? screenshot->update(displayToken, width, height)
+ : screenshot->update(displayToken, width, height, minLayer, maxLayer))
+ : screenshot->update(displayToken);
+ if (res != NO_ERROR) {
+ delete screenshot;
return NULL;
}
- uint32_t w = pixels->getWidth();
- uint32_t h = pixels->getHeight();
- uint32_t s = pixels->getStride();
- uint32_t f = pixels->getFormat();
- ssize_t bpr = s * android::bytesPerPixel(f);
+ SkImageInfo screenshotInfo;
+ screenshotInfo.fWidth = screenshot->getWidth();
+ screenshotInfo.fHeight = screenshot->getHeight();
- SkBitmap* bitmap = new SkBitmap();
- bitmap->setConfig(convertPixelFormat(f), w, h, bpr);
- if (f == PIXEL_FORMAT_RGBX_8888) {
- bitmap->setIsOpaque(true);
+ switch (screenshot->getFormat()) {
+ case PIXEL_FORMAT_RGBX_8888: {
+ screenshotInfo.fColorType = kRGBA_8888_SkColorType;
+ screenshotInfo.fAlphaType = kIgnore_SkAlphaType;
+ break;
+ }
+ case PIXEL_FORMAT_RGBA_8888: {
+ screenshotInfo.fColorType = kRGBA_8888_SkColorType;
+ screenshotInfo.fAlphaType = kPremul_SkAlphaType;
+ break;
+ }
+ case PIXEL_FORMAT_RGB_565: {
+ screenshotInfo.fColorType = kRGB_565_SkColorType;
+ screenshotInfo.fAlphaType = kIgnore_SkAlphaType;
+ break;
+ }
+ default: {
+ delete screenshot;
+ return NULL;
+ }
}
- if (w > 0 && h > 0) {
+ // takes ownership of ScreenshotClient
+ ScreenshotPixelRef* pixels = new ScreenshotPixelRef(screenshotInfo, screenshot);
+ ssize_t rowBytes = screenshot->getStride() * android::bytesPerPixel(screenshot->getFormat());
+
+ SkBitmap* bitmap = new SkBitmap();
+ bitmap->setConfig(screenshotInfo, rowBytes);
+ if (screenshotInfo.fWidth > 0 && screenshotInfo.fHeight > 0) {
bitmap->setPixelRef(pixels)->unref();
bitmap->lockPixels();
} else {
diff --git a/core/jni/android_view_TextureView.cpp b/core/jni/android_view_TextureView.cpp
index 54f9278792c7fae3fe41b8f1db9982eeb798eaa4..77ede33ca150c3ed2aa94991e0cbe60c28bcd9c4 100644
--- a/core/jni/android_view_TextureView.cpp
+++ b/core/jni/android_view_TextureView.cpp
@@ -27,6 +27,7 @@
#include
#include
+#include
namespace android {
@@ -162,7 +163,7 @@ static jboolean android_view_TextureView_lockCanvas(JNIEnv* env, jobject,
bitmap.setConfig(convertPixelFormat(buffer.format), buffer.width, buffer.height, bytesCount);
if (buffer.format == WINDOW_FORMAT_RGBX_8888) {
- bitmap.setIsOpaque(true);
+ bitmap.setAlphaType(kOpaque_SkAlphaType);
}
if (buffer.width > 0 && buffer.height > 0) {
diff --git a/core/res/AndroidManifest.xml b/core/res/AndroidManifest.xml
index 83559288a812efbafaa71f84732755bf27b49751..8ec2d64185ecfaa0fb2cb8d6d22eb25af23a6ba5 100644
--- a/core/res/AndroidManifest.xml
+++ b/core/res/AndroidManifest.xml
@@ -1056,8 +1056,9 @@
android:permissionGroupFlags="personalInfo"
android:priority="370" />
-
+
+ android:protectionLevel="signature" />
@@ -1534,7 +1535,7 @@
@hide -->
diff --git a/core/res/res/drawable-hdpi/ic_media_route_disabled_holo_dark.png b/core/res/res/drawable-hdpi/ic_media_route_disabled_holo_dark.png
index 458a2a66ce788990b018c0e204aa08d457dbdf55..e215b96f9301254a50f32daceee1eb7ff026f572 100644
Binary files a/core/res/res/drawable-hdpi/ic_media_route_disabled_holo_dark.png and b/core/res/res/drawable-hdpi/ic_media_route_disabled_holo_dark.png differ
diff --git a/core/res/res/drawable-hdpi/ic_media_route_disabled_holo_light.png b/core/res/res/drawable-hdpi/ic_media_route_disabled_holo_light.png
index 03b0d2ac71381da5b9a0268b2c080b7a038e3143..a014e918441b77a6c8d00af5bcd05aa1cfba66d4 100644
Binary files a/core/res/res/drawable-hdpi/ic_media_route_disabled_holo_light.png and b/core/res/res/drawable-hdpi/ic_media_route_disabled_holo_light.png differ
diff --git a/core/res/res/drawable-hdpi/ic_media_route_off_holo_dark.png b/core/res/res/drawable-hdpi/ic_media_route_off_holo_dark.png
index c91faa929c5532cc4d9a4de7040ca9233e3b326e..bb8bec19518535ee061bea34e0caf71792f5acb1 100644
Binary files a/core/res/res/drawable-hdpi/ic_media_route_off_holo_dark.png and b/core/res/res/drawable-hdpi/ic_media_route_off_holo_dark.png differ
diff --git a/core/res/res/drawable-hdpi/ic_media_route_off_holo_light.png b/core/res/res/drawable-hdpi/ic_media_route_off_holo_light.png
index 14c9183fb5b2110b7c2d00d8846130fa17f658fd..aa1737edf1562f723bab1b26f9f77fa11fbc2641 100644
Binary files a/core/res/res/drawable-hdpi/ic_media_route_off_holo_light.png and b/core/res/res/drawable-hdpi/ic_media_route_off_holo_light.png differ
diff --git a/core/res/res/drawable-hdpi/ic_media_route_on_0_holo_dark.png b/core/res/res/drawable-hdpi/ic_media_route_on_0_holo_dark.png
index b388d8686ac9c04c1489150c4372f8bf6099901f..2c1434bbd09f5b3b5f2aa5b942b3e37a837db4a9 100644
Binary files a/core/res/res/drawable-hdpi/ic_media_route_on_0_holo_dark.png and b/core/res/res/drawable-hdpi/ic_media_route_on_0_holo_dark.png differ
diff --git a/core/res/res/drawable-hdpi/ic_media_route_on_0_holo_light.png b/core/res/res/drawable-hdpi/ic_media_route_on_0_holo_light.png
index 76c132380dde16d1cd0d99c5e2f4d258d1438562..dbdce3ef2f5011112d92a982fc8bde9eef533fa0 100644
Binary files a/core/res/res/drawable-hdpi/ic_media_route_on_0_holo_light.png and b/core/res/res/drawable-hdpi/ic_media_route_on_0_holo_light.png differ
diff --git a/core/res/res/drawable-hdpi/ic_media_route_on_1_holo_dark.png b/core/res/res/drawable-hdpi/ic_media_route_on_1_holo_dark.png
index fd39f9d6aa17adf32801b97267a19ccf1a8a0031..110186495da93974c93aae1c1a10386cd93e1186 100644
Binary files a/core/res/res/drawable-hdpi/ic_media_route_on_1_holo_dark.png and b/core/res/res/drawable-hdpi/ic_media_route_on_1_holo_dark.png differ
diff --git a/core/res/res/drawable-hdpi/ic_media_route_on_1_holo_light.png b/core/res/res/drawable-hdpi/ic_media_route_on_1_holo_light.png
index c74727aabe219db3db2e2153f548370b5aa47b0a..e8e90697e55fbf0517c1f232c94c1385b0831757 100644
Binary files a/core/res/res/drawable-hdpi/ic_media_route_on_1_holo_light.png and b/core/res/res/drawable-hdpi/ic_media_route_on_1_holo_light.png differ
diff --git a/core/res/res/drawable-hdpi/ic_media_route_on_2_holo_dark.png b/core/res/res/drawable-hdpi/ic_media_route_on_2_holo_dark.png
index 826c9aefed7a0e9e159a133077e71681860a3b9b..8595158bed2c33f35ebc622f4d5ab1a9d4558504 100644
Binary files a/core/res/res/drawable-hdpi/ic_media_route_on_2_holo_dark.png and b/core/res/res/drawable-hdpi/ic_media_route_on_2_holo_dark.png differ
diff --git a/core/res/res/drawable-hdpi/ic_media_route_on_2_holo_light.png b/core/res/res/drawable-hdpi/ic_media_route_on_2_holo_light.png
index d0baec3fbaa9ddd74bb9d93a641aad811cfd7c31..14844d403a2679ae813eefbce6c75d4afc7cc0aa 100644
Binary files a/core/res/res/drawable-hdpi/ic_media_route_on_2_holo_light.png and b/core/res/res/drawable-hdpi/ic_media_route_on_2_holo_light.png differ
diff --git a/core/res/res/drawable-hdpi/ic_media_route_on_holo_dark.png b/core/res/res/drawable-hdpi/ic_media_route_on_holo_dark.png
index c60ff599decaf8fee27d3e752568ce323f6a6383..1565a29b8f477aed025a9a481facad6cabc048e7 100644
Binary files a/core/res/res/drawable-hdpi/ic_media_route_on_holo_dark.png and b/core/res/res/drawable-hdpi/ic_media_route_on_holo_dark.png differ
diff --git a/core/res/res/drawable-hdpi/ic_media_route_on_holo_light.png b/core/res/res/drawable-hdpi/ic_media_route_on_holo_light.png
index 75552ccf0ab86eec457884b9395d00a53adad952..9b8fe879d55d8d788b10acdc10ed1dc398adf11b 100644
Binary files a/core/res/res/drawable-hdpi/ic_media_route_on_holo_light.png and b/core/res/res/drawable-hdpi/ic_media_route_on_holo_light.png differ
diff --git a/core/res/res/drawable-hdpi/ic_notification_cast_0.png b/core/res/res/drawable-hdpi/ic_notification_cast_0.png
index a35f28177f0a5afd3be9ee342ef3a36a2efa279b..74f7dc0c1f489b75358c05dffba89fae54f499cc 100644
Binary files a/core/res/res/drawable-hdpi/ic_notification_cast_0.png and b/core/res/res/drawable-hdpi/ic_notification_cast_0.png differ
diff --git a/core/res/res/drawable-hdpi/ic_notification_cast_1.png b/core/res/res/drawable-hdpi/ic_notification_cast_1.png
index 9f6e2adef029e019e248c91c3652ba58e2189545..c6d267d8c021e3422cb11e052fb65223b3a8e326 100644
Binary files a/core/res/res/drawable-hdpi/ic_notification_cast_1.png and b/core/res/res/drawable-hdpi/ic_notification_cast_1.png differ
diff --git a/core/res/res/drawable-hdpi/ic_notification_cast_2.png b/core/res/res/drawable-hdpi/ic_notification_cast_2.png
index 737137a81340f11a16eae55abd00388a75d45df4..699b299ffb8b121f3450d695a7d652321afaa62f 100644
Binary files a/core/res/res/drawable-hdpi/ic_notification_cast_2.png and b/core/res/res/drawable-hdpi/ic_notification_cast_2.png differ
diff --git a/core/res/res/drawable-hdpi/ic_notification_cast_on.png b/core/res/res/drawable-hdpi/ic_notification_cast_on.png
index ff2753ab68f5c2868d54f7df0204f023bcdb383a..3eaf13a8520c454571aafde802b5c94f2d034a7e 100644
Binary files a/core/res/res/drawable-hdpi/ic_notification_cast_on.png and b/core/res/res/drawable-hdpi/ic_notification_cast_on.png differ
diff --git a/core/res/res/drawable-mdpi/ic_media_route_disabled_holo_dark.png b/core/res/res/drawable-mdpi/ic_media_route_disabled_holo_dark.png
index fa22d8244cf9fbea605f05183fa3c079ffb8d429..52e3a5a132367c49b0f29a87a1f52448c84ef9f5 100644
Binary files a/core/res/res/drawable-mdpi/ic_media_route_disabled_holo_dark.png and b/core/res/res/drawable-mdpi/ic_media_route_disabled_holo_dark.png differ
diff --git a/core/res/res/drawable-mdpi/ic_media_route_disabled_holo_light.png b/core/res/res/drawable-mdpi/ic_media_route_disabled_holo_light.png
index a686cd1cf2aa02b733e3cb34ed7f919f0f268c96..319c57e8f343f22b12799ab91937eac20ca6eb80 100644
Binary files a/core/res/res/drawable-mdpi/ic_media_route_disabled_holo_light.png and b/core/res/res/drawable-mdpi/ic_media_route_disabled_holo_light.png differ
diff --git a/core/res/res/drawable-mdpi/ic_media_route_off_holo_dark.png b/core/res/res/drawable-mdpi/ic_media_route_off_holo_dark.png
index 9d92648511ae15ae49d8ac65dc5470181b5f56f1..f98c0a85b53bb1102c2635556c136cc65e051bed 100644
Binary files a/core/res/res/drawable-mdpi/ic_media_route_off_holo_dark.png and b/core/res/res/drawable-mdpi/ic_media_route_off_holo_dark.png differ
diff --git a/core/res/res/drawable-mdpi/ic_media_route_off_holo_light.png b/core/res/res/drawable-mdpi/ic_media_route_off_holo_light.png
index 3e27fc8f2eb8281e1c70886a956f88319b8eb9d9..b74cdb5b1a93fc5adaf09bb4297cb7e13ebee15b 100644
Binary files a/core/res/res/drawable-mdpi/ic_media_route_off_holo_light.png and b/core/res/res/drawable-mdpi/ic_media_route_off_holo_light.png differ
diff --git a/core/res/res/drawable-mdpi/ic_media_route_on_0_holo_dark.png b/core/res/res/drawable-mdpi/ic_media_route_on_0_holo_dark.png
index 72b9e78956ec41cc22ade0fd54b2b6b9df6b8ca0..a6a4bd012e531dd568d34494315c3785760ebe25 100644
Binary files a/core/res/res/drawable-mdpi/ic_media_route_on_0_holo_dark.png and b/core/res/res/drawable-mdpi/ic_media_route_on_0_holo_dark.png differ
diff --git a/core/res/res/drawable-mdpi/ic_media_route_on_0_holo_light.png b/core/res/res/drawable-mdpi/ic_media_route_on_0_holo_light.png
index bd462a2b2ccc59601cd9fa451252fa0f6dc961dc..106fd3a97f94d0c255a126a1a093c32467f9f264 100644
Binary files a/core/res/res/drawable-mdpi/ic_media_route_on_0_holo_light.png and b/core/res/res/drawable-mdpi/ic_media_route_on_0_holo_light.png differ
diff --git a/core/res/res/drawable-mdpi/ic_media_route_on_1_holo_dark.png b/core/res/res/drawable-mdpi/ic_media_route_on_1_holo_dark.png
index 0a2cc89d535ad154e2335b2fab353d015ce63473..2c141ab8e692d84c608550dbe98b9c9ea26d1c9b 100644
Binary files a/core/res/res/drawable-mdpi/ic_media_route_on_1_holo_dark.png and b/core/res/res/drawable-mdpi/ic_media_route_on_1_holo_dark.png differ
diff --git a/core/res/res/drawable-mdpi/ic_media_route_on_1_holo_light.png b/core/res/res/drawable-mdpi/ic_media_route_on_1_holo_light.png
index d162503202acce3c9b7a25f2fd1360be4851df59..0b62d0b509ff5ed6c8ea06ac189f3479e44a1535 100644
Binary files a/core/res/res/drawable-mdpi/ic_media_route_on_1_holo_light.png and b/core/res/res/drawable-mdpi/ic_media_route_on_1_holo_light.png differ
diff --git a/core/res/res/drawable-mdpi/ic_media_route_on_2_holo_dark.png b/core/res/res/drawable-mdpi/ic_media_route_on_2_holo_dark.png
index 997e32b680b901d58453191e50c9ac7b68d3c93e..23442b06336b463c925d661e441f0dd9a48b5ea3 100644
Binary files a/core/res/res/drawable-mdpi/ic_media_route_on_2_holo_dark.png and b/core/res/res/drawable-mdpi/ic_media_route_on_2_holo_dark.png differ
diff --git a/core/res/res/drawable-mdpi/ic_media_route_on_2_holo_light.png b/core/res/res/drawable-mdpi/ic_media_route_on_2_holo_light.png
index d314967d38a1d6ce8f981a5411ee0f560daad962..42b329fad28e2dade39fb539e372d8d85bb3c108 100644
Binary files a/core/res/res/drawable-mdpi/ic_media_route_on_2_holo_light.png and b/core/res/res/drawable-mdpi/ic_media_route_on_2_holo_light.png differ
diff --git a/core/res/res/drawable-mdpi/ic_media_route_on_holo_dark.png b/core/res/res/drawable-mdpi/ic_media_route_on_holo_dark.png
index f15d7a9d77607beccd5a4fbef63bd9bde67ce75f..58ff50685aca12318b32ca89faca8e5fe28a6362 100644
Binary files a/core/res/res/drawable-mdpi/ic_media_route_on_holo_dark.png and b/core/res/res/drawable-mdpi/ic_media_route_on_holo_dark.png differ
diff --git a/core/res/res/drawable-mdpi/ic_media_route_on_holo_light.png b/core/res/res/drawable-mdpi/ic_media_route_on_holo_light.png
index 26d46f8b7b98074753717bbdeed4159d13cdbc35..25257f8b848dd86193da58141d8dff43037faa64 100644
Binary files a/core/res/res/drawable-mdpi/ic_media_route_on_holo_light.png and b/core/res/res/drawable-mdpi/ic_media_route_on_holo_light.png differ
diff --git a/core/res/res/drawable-mdpi/ic_notification_cast_0.png b/core/res/res/drawable-mdpi/ic_notification_cast_0.png
index d9cedbdeb3e5b1b434548b40cdbd5548cb4d956f..a51a3cbefd2f1aeecefb03ef292993a6ef34d2df 100644
Binary files a/core/res/res/drawable-mdpi/ic_notification_cast_0.png and b/core/res/res/drawable-mdpi/ic_notification_cast_0.png differ
diff --git a/core/res/res/drawable-mdpi/ic_notification_cast_1.png b/core/res/res/drawable-mdpi/ic_notification_cast_1.png
index 414c67f17002b29e85815fab49921e4406994af5..e0813678a9f542e4a03774e44cedfaf0b28b4b29 100644
Binary files a/core/res/res/drawable-mdpi/ic_notification_cast_1.png and b/core/res/res/drawable-mdpi/ic_notification_cast_1.png differ
diff --git a/core/res/res/drawable-mdpi/ic_notification_cast_2.png b/core/res/res/drawable-mdpi/ic_notification_cast_2.png
index 280a8880e5223411e91d83c9ebc8dfa7bca14f1b..a7f4de43f20315550c8e2e84c856ce4918ffc642 100644
Binary files a/core/res/res/drawable-mdpi/ic_notification_cast_2.png and b/core/res/res/drawable-mdpi/ic_notification_cast_2.png differ
diff --git a/core/res/res/drawable-mdpi/ic_notification_cast_on.png b/core/res/res/drawable-mdpi/ic_notification_cast_on.png
index ab5f1d78608f3b4dc5e57867008539beae0fdbd9..42de8c4d5c10a9765a36a12dd9bd15c6bfd61749 100644
Binary files a/core/res/res/drawable-mdpi/ic_notification_cast_on.png and b/core/res/res/drawable-mdpi/ic_notification_cast_on.png differ
diff --git a/core/res/res/drawable-xhdpi/cab_background_top_holo_dark.9.png b/core/res/res/drawable-xhdpi/cab_background_top_holo_dark.9.png
index 6b3157985ea56214f20902e7854f630cf0513ad7..7b6d48b6e41fc08e9c37f6f10e099ec8f503e830 100644
Binary files a/core/res/res/drawable-xhdpi/cab_background_top_holo_dark.9.png and b/core/res/res/drawable-xhdpi/cab_background_top_holo_dark.9.png differ
diff --git a/core/res/res/drawable-xhdpi/cab_background_top_holo_light.9.png b/core/res/res/drawable-xhdpi/cab_background_top_holo_light.9.png
index df0121bb353f5b30b732b715a758ea6fcb3d5220..bafe8781c2b84df996d2b57c4af43be7a4680970 100644
Binary files a/core/res/res/drawable-xhdpi/cab_background_top_holo_light.9.png and b/core/res/res/drawable-xhdpi/cab_background_top_holo_light.9.png differ
diff --git a/core/res/res/drawable-xhdpi/ic_media_route_disabled_holo_dark.png b/core/res/res/drawable-xhdpi/ic_media_route_disabled_holo_dark.png
index 045eee0549d877202d31f9bafe958f6710613853..4119cffb3932b0e86c97752d30f826978b9b0b37 100644
Binary files a/core/res/res/drawable-xhdpi/ic_media_route_disabled_holo_dark.png and b/core/res/res/drawable-xhdpi/ic_media_route_disabled_holo_dark.png differ
diff --git a/core/res/res/drawable-xhdpi/ic_media_route_disabled_holo_light.png b/core/res/res/drawable-xhdpi/ic_media_route_disabled_holo_light.png
index 6e14e296336ab6d6e2fa46a66e159dc8891ec702..b629a5726b3b4ddc5b08c9969a430afb834f5497 100644
Binary files a/core/res/res/drawable-xhdpi/ic_media_route_disabled_holo_light.png and b/core/res/res/drawable-xhdpi/ic_media_route_disabled_holo_light.png differ
diff --git a/core/res/res/drawable-xhdpi/ic_media_route_off_holo_dark.png b/core/res/res/drawable-xhdpi/ic_media_route_off_holo_dark.png
index 121bbf6a46a0b5d7212a40a6e53460f59389c290..fe81128d5443dd57aadab3019957026e7cfe072b 100644
Binary files a/core/res/res/drawable-xhdpi/ic_media_route_off_holo_dark.png and b/core/res/res/drawable-xhdpi/ic_media_route_off_holo_dark.png differ
diff --git a/core/res/res/drawable-xhdpi/ic_media_route_off_holo_light.png b/core/res/res/drawable-xhdpi/ic_media_route_off_holo_light.png
index 468a0c36c07f1d92fc3a4209efca53754fe737a1..9b59eaf73976dd0f031d98061edf0bc55f78a0de 100644
Binary files a/core/res/res/drawable-xhdpi/ic_media_route_off_holo_light.png and b/core/res/res/drawable-xhdpi/ic_media_route_off_holo_light.png differ
diff --git a/core/res/res/drawable-xhdpi/ic_media_route_on_0_holo_dark.png b/core/res/res/drawable-xhdpi/ic_media_route_on_0_holo_dark.png
index 414a322e8b4904147d6bb304ec18dff599ca1645..1a513c1cd75e3bb814cd7e5a959badba0c06f27a 100644
Binary files a/core/res/res/drawable-xhdpi/ic_media_route_on_0_holo_dark.png and b/core/res/res/drawable-xhdpi/ic_media_route_on_0_holo_dark.png differ
diff --git a/core/res/res/drawable-xhdpi/ic_media_route_on_0_holo_light.png b/core/res/res/drawable-xhdpi/ic_media_route_on_0_holo_light.png
index 6088a48e4113244500576d43b38462460053b440..ff788032ea7b29eb884121c3392cb9e12587715b 100644
Binary files a/core/res/res/drawable-xhdpi/ic_media_route_on_0_holo_light.png and b/core/res/res/drawable-xhdpi/ic_media_route_on_0_holo_light.png differ
diff --git a/core/res/res/drawable-xhdpi/ic_media_route_on_1_holo_dark.png b/core/res/res/drawable-xhdpi/ic_media_route_on_1_holo_dark.png
index 363d7d4681ce4b2d16bf862172e5ba6b7d22be6f..4c4b624b9bdbfb32445ea743b18c2d778fb6e04a 100644
Binary files a/core/res/res/drawable-xhdpi/ic_media_route_on_1_holo_dark.png and b/core/res/res/drawable-xhdpi/ic_media_route_on_1_holo_dark.png differ
diff --git a/core/res/res/drawable-xhdpi/ic_media_route_on_1_holo_light.png b/core/res/res/drawable-xhdpi/ic_media_route_on_1_holo_light.png
index edf731e8fd4220581a6d12d16ed8ce8a5f485b0e..60f8c4dede13da2d6d995441fa4dd9e3c7d86a75 100644
Binary files a/core/res/res/drawable-xhdpi/ic_media_route_on_1_holo_light.png and b/core/res/res/drawable-xhdpi/ic_media_route_on_1_holo_light.png differ
diff --git a/core/res/res/drawable-xhdpi/ic_media_route_on_2_holo_dark.png b/core/res/res/drawable-xhdpi/ic_media_route_on_2_holo_dark.png
index 85cba7b80fc90e29e01c8551b20318e3ec7a8712..cdb2f30f0bcfaa23f817299888e638b2eaf28115 100644
Binary files a/core/res/res/drawable-xhdpi/ic_media_route_on_2_holo_dark.png and b/core/res/res/drawable-xhdpi/ic_media_route_on_2_holo_dark.png differ
diff --git a/core/res/res/drawable-xhdpi/ic_media_route_on_2_holo_light.png b/core/res/res/drawable-xhdpi/ic_media_route_on_2_holo_light.png
index e65ac319044bdbfd6d7f4aeee0a38985b9528660..97a10a37a29fd346635ae461eeb2245dc0f73b73 100644
Binary files a/core/res/res/drawable-xhdpi/ic_media_route_on_2_holo_light.png and b/core/res/res/drawable-xhdpi/ic_media_route_on_2_holo_light.png differ
diff --git a/core/res/res/drawable-xhdpi/ic_media_route_on_holo_dark.png b/core/res/res/drawable-xhdpi/ic_media_route_on_holo_dark.png
index d8e3e3aeae38888f6f8a8ae599e46c5fbb722e2f..a19a083706da90a7458ae4a12a0081cf96d53861 100644
Binary files a/core/res/res/drawable-xhdpi/ic_media_route_on_holo_dark.png and b/core/res/res/drawable-xhdpi/ic_media_route_on_holo_dark.png differ
diff --git a/core/res/res/drawable-xhdpi/ic_media_route_on_holo_light.png b/core/res/res/drawable-xhdpi/ic_media_route_on_holo_light.png
index 562dc9a4f2cf40fa7e3b0c3628d0f66a2eedce7e..db30613771caad583c918c600f87d5d04cf5b762 100644
Binary files a/core/res/res/drawable-xhdpi/ic_media_route_on_holo_light.png and b/core/res/res/drawable-xhdpi/ic_media_route_on_holo_light.png differ
diff --git a/core/res/res/drawable-xhdpi/ic_notification_cast_0.png b/core/res/res/drawable-xhdpi/ic_notification_cast_0.png
index 5fb23a06df3512f4c1e1eead5d7d242632027d42..818c1cdd7a261115b36031ef7a7e36162c010cb3 100644
Binary files a/core/res/res/drawable-xhdpi/ic_notification_cast_0.png and b/core/res/res/drawable-xhdpi/ic_notification_cast_0.png differ
diff --git a/core/res/res/drawable-xhdpi/ic_notification_cast_1.png b/core/res/res/drawable-xhdpi/ic_notification_cast_1.png
index f01d17db0821ff88c1e50d3c5cffccd23c3be2ee..2a56e3131789828d6ef8911a539a39b1d651f47f 100644
Binary files a/core/res/res/drawable-xhdpi/ic_notification_cast_1.png and b/core/res/res/drawable-xhdpi/ic_notification_cast_1.png differ
diff --git a/core/res/res/drawable-xhdpi/ic_notification_cast_2.png b/core/res/res/drawable-xhdpi/ic_notification_cast_2.png
index 4f4ba7f98bcd5aa1a92e3a1ad15f8f4a846fe94d..3515a76825e2c925ae0c3be1c60d69296a784a57 100644
Binary files a/core/res/res/drawable-xhdpi/ic_notification_cast_2.png and b/core/res/res/drawable-xhdpi/ic_notification_cast_2.png differ
diff --git a/core/res/res/drawable-xhdpi/ic_notification_cast_on.png b/core/res/res/drawable-xhdpi/ic_notification_cast_on.png
index 38f15ddc416d02474901fa908de4f105eaa387a8..142065b4f5756b28a8f4690903420dd1f04e8e18 100644
Binary files a/core/res/res/drawable-xhdpi/ic_notification_cast_on.png and b/core/res/res/drawable-xhdpi/ic_notification_cast_on.png differ
diff --git a/core/res/res/drawable-xxhdpi/cab_background_top_holo_dark.9.png b/core/res/res/drawable-xxhdpi/cab_background_top_holo_dark.9.png
index 418f322ce0f4fe236a65b335533110d5b33ea279..cbb4f4cf63da91433e17bcce6b258e5137cd686f 100644
Binary files a/core/res/res/drawable-xxhdpi/cab_background_top_holo_dark.9.png and b/core/res/res/drawable-xxhdpi/cab_background_top_holo_dark.9.png differ
diff --git a/core/res/res/drawable-xxhdpi/cab_background_top_holo_light.9.png b/core/res/res/drawable-xxhdpi/cab_background_top_holo_light.9.png
index a5a59d4e61bafd6983b6c1f6879bd71c3d07e1cf..6d467f7ee6d55bfd8f8fe0345c4b289ca9a70576 100644
Binary files a/core/res/res/drawable-xxhdpi/cab_background_top_holo_light.9.png and b/core/res/res/drawable-xxhdpi/cab_background_top_holo_light.9.png differ
diff --git a/core/res/res/drawable-xxhdpi/ic_media_route_disabled_holo_dark.png b/core/res/res/drawable-xxhdpi/ic_media_route_disabled_holo_dark.png
index 178774ca179a17547bab9a1bada938da3d460dd1..6fad4a641e817bd0a0230ce306aa648e43cf9896 100644
Binary files a/core/res/res/drawable-xxhdpi/ic_media_route_disabled_holo_dark.png and b/core/res/res/drawable-xxhdpi/ic_media_route_disabled_holo_dark.png differ
diff --git a/core/res/res/drawable-xxhdpi/ic_media_route_disabled_holo_light.png b/core/res/res/drawable-xxhdpi/ic_media_route_disabled_holo_light.png
index 2dc2092f0418914b2f3d149e800257532c6cce15..865617c0fd0ee282f4ac5836140c76843d44049a 100644
Binary files a/core/res/res/drawable-xxhdpi/ic_media_route_disabled_holo_light.png and b/core/res/res/drawable-xxhdpi/ic_media_route_disabled_holo_light.png differ
diff --git a/core/res/res/drawable-xxhdpi/ic_media_route_off_holo_dark.png b/core/res/res/drawable-xxhdpi/ic_media_route_off_holo_dark.png
index 592ee8cdf3261d3e27f25e796658514f380b0bf0..44d98d56d2b54998a2ec3056c971fda540179ebf 100644
Binary files a/core/res/res/drawable-xxhdpi/ic_media_route_off_holo_dark.png and b/core/res/res/drawable-xxhdpi/ic_media_route_off_holo_dark.png differ
diff --git a/core/res/res/drawable-xxhdpi/ic_media_route_off_holo_light.png b/core/res/res/drawable-xxhdpi/ic_media_route_off_holo_light.png
index f0549e24188de13a686d28235670143edc960838..b5b29b020900dcee828dbabe545cdfaa915b2aeb 100644
Binary files a/core/res/res/drawable-xxhdpi/ic_media_route_off_holo_light.png and b/core/res/res/drawable-xxhdpi/ic_media_route_off_holo_light.png differ
diff --git a/core/res/res/drawable-xxhdpi/ic_media_route_on_0_holo_dark.png b/core/res/res/drawable-xxhdpi/ic_media_route_on_0_holo_dark.png
index 91268f5bdc81c5b99b6604255b50ea8f1f5a1f5c..c807b50ad076fa991e47af41121638841c8809c0 100644
Binary files a/core/res/res/drawable-xxhdpi/ic_media_route_on_0_holo_dark.png and b/core/res/res/drawable-xxhdpi/ic_media_route_on_0_holo_dark.png differ
diff --git a/core/res/res/drawable-xxhdpi/ic_media_route_on_0_holo_light.png b/core/res/res/drawable-xxhdpi/ic_media_route_on_0_holo_light.png
index 9d5436f8669914f8cc789daf8dc26da9b69d0051..3fc7188f31b40e0e2dfc9ed0bdd1b570ab6f221f 100644
Binary files a/core/res/res/drawable-xxhdpi/ic_media_route_on_0_holo_light.png and b/core/res/res/drawable-xxhdpi/ic_media_route_on_0_holo_light.png differ
diff --git a/core/res/res/drawable-xxhdpi/ic_media_route_on_1_holo_dark.png b/core/res/res/drawable-xxhdpi/ic_media_route_on_1_holo_dark.png
index 8e77483bce59a4943576d49e150f2ff2a1c219a8..d54f44acb84ba2a83eb3456513d27b577b93a4c9 100644
Binary files a/core/res/res/drawable-xxhdpi/ic_media_route_on_1_holo_dark.png and b/core/res/res/drawable-xxhdpi/ic_media_route_on_1_holo_dark.png differ
diff --git a/core/res/res/drawable-xxhdpi/ic_media_route_on_1_holo_light.png b/core/res/res/drawable-xxhdpi/ic_media_route_on_1_holo_light.png
index f396d22170f58d148e0148f940c74b87d467f51a..092fe8cc0dc500bd1df19111baea26adb1751281 100644
Binary files a/core/res/res/drawable-xxhdpi/ic_media_route_on_1_holo_light.png and b/core/res/res/drawable-xxhdpi/ic_media_route_on_1_holo_light.png differ
diff --git a/core/res/res/drawable-xxhdpi/ic_media_route_on_2_holo_dark.png b/core/res/res/drawable-xxhdpi/ic_media_route_on_2_holo_dark.png
index 260bab4f3959b48f8cc09322bdddf11e50ba056a..17c1d9945b1271ded0c6d9cc461ef6524046902c 100644
Binary files a/core/res/res/drawable-xxhdpi/ic_media_route_on_2_holo_dark.png and b/core/res/res/drawable-xxhdpi/ic_media_route_on_2_holo_dark.png differ
diff --git a/core/res/res/drawable-xxhdpi/ic_media_route_on_2_holo_light.png b/core/res/res/drawable-xxhdpi/ic_media_route_on_2_holo_light.png
index 2c9fb1da498a8e78caa99c3b77a9eb1303f94b9b..4fd5808648411de96cb2410eed8a8b51c55b06fa 100644
Binary files a/core/res/res/drawable-xxhdpi/ic_media_route_on_2_holo_light.png and b/core/res/res/drawable-xxhdpi/ic_media_route_on_2_holo_light.png differ
diff --git a/core/res/res/drawable-xxhdpi/ic_media_route_on_holo_dark.png b/core/res/res/drawable-xxhdpi/ic_media_route_on_holo_dark.png
index bdbd59c1264492a7bc401579797ecc7be5ac87c0..906401e6f03f53286347e6505764fddfea541dec 100644
Binary files a/core/res/res/drawable-xxhdpi/ic_media_route_on_holo_dark.png and b/core/res/res/drawable-xxhdpi/ic_media_route_on_holo_dark.png differ
diff --git a/core/res/res/drawable-xxhdpi/ic_media_route_on_holo_light.png b/core/res/res/drawable-xxhdpi/ic_media_route_on_holo_light.png
index f5c33dd210e5535ae5b31cc7edc6ea7cadc9c612..d29e563004083370e568440a3d4d9f62318222d5 100644
Binary files a/core/res/res/drawable-xxhdpi/ic_media_route_on_holo_light.png and b/core/res/res/drawable-xxhdpi/ic_media_route_on_holo_light.png differ
diff --git a/core/res/res/drawable-xxhdpi/ic_notification_cast_0.png b/core/res/res/drawable-xxhdpi/ic_notification_cast_0.png
index f5b16ed10e0e3e917e30fc04f031768613f4dd18..7ef0d3d0e3905158703e69da3b194e4e1af41de4 100644
Binary files a/core/res/res/drawable-xxhdpi/ic_notification_cast_0.png and b/core/res/res/drawable-xxhdpi/ic_notification_cast_0.png differ
diff --git a/core/res/res/drawable-xxhdpi/ic_notification_cast_1.png b/core/res/res/drawable-xxhdpi/ic_notification_cast_1.png
index 22efeec677f7c3502e494ee612eb962c2bb4493f..ed04beb7e48b18baa853ad483b269fd57be7b737 100644
Binary files a/core/res/res/drawable-xxhdpi/ic_notification_cast_1.png and b/core/res/res/drawable-xxhdpi/ic_notification_cast_1.png differ
diff --git a/core/res/res/drawable-xxhdpi/ic_notification_cast_2.png b/core/res/res/drawable-xxhdpi/ic_notification_cast_2.png
index e24cd970da16916deac9cdb4ac98250ff0902a7d..d62d27dd7a4c65941a8847f1813c76a96dcd461c 100644
Binary files a/core/res/res/drawable-xxhdpi/ic_notification_cast_2.png and b/core/res/res/drawable-xxhdpi/ic_notification_cast_2.png differ
diff --git a/core/res/res/drawable-xxhdpi/ic_notification_cast_on.png b/core/res/res/drawable-xxhdpi/ic_notification_cast_on.png
index da1a627be5bf158ac193c3295292434a6c4a6a89..d5626024b0a5656b14baddd7b885fde189d97a87 100644
Binary files a/core/res/res/drawable-xxhdpi/ic_notification_cast_on.png and b/core/res/res/drawable-xxhdpi/ic_notification_cast_on.png differ
diff --git a/core/res/res/values-ja/bools.xml b/core/res/res/values-ja/bools.xml
deleted file mode 100644
index 59cf744532eb5497e374a783f3dfe4d8148c6ea2..0000000000000000000000000000000000000000
--- a/core/res/res/values-ja/bools.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-
-
-
-
- true
-
-
diff --git a/core/res/res/values/bools.xml b/core/res/res/values/bools.xml
index 10a5d851fac30ff0cc70399bd870b1649eb0914b..18e4f2f9b3a82be1c4d98ca7852e031bd0ea69ea 100644
--- a/core/res/res/values/bools.xml
+++ b/core/res/res/values/bools.xml
@@ -26,5 +26,4 @@
true
true
true
- false
diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml
index b34c792f5de0046b2da665a259587c33ea9572a6..a3b81327b738ab43a51d7f78e71efd28a0237309 100644
--- a/core/res/res/values/config.xml
+++ b/core/res/res/values/config.xml
@@ -352,6 +352,10 @@
false
+
+ WS
+
false
@@ -1304,4 +1308,12 @@
- 333
- 353
+
+
+ 0
diff --git a/core/res/res/values/strings.xml b/core/res/res/values/strings.xml
index 012fb8372b8e4820374a4ddf3a54bdbec4ea4155..538003f198cd86489c8e6cec2ac648a605b1264e 100644
--- a/core/res/res/values/strings.xml
+++ b/core/res/res/values/strings.xml
@@ -625,9 +625,9 @@
reroute outgoing calls
- Allows the app to process
- outgoing calls and change the number to be dialed. This permission allows
- the app to monitor, redirect, or prevent outgoing calls.
+ Allows the app to see the
+ number being dialed during an outgoing call with the option to redirect
+ the call to a different number or abort the call altogether.
receive text messages (SMS)
@@ -932,13 +932,13 @@
Allows the app to retrieve
collected application operation statistics. Not for use by normal apps.
-
+
modify app ops statistics
Allows the app to modify
collected application operation statistics. Not for use by normal apps.
-
+
control system backup and restore
@@ -2255,6 +2255,10 @@
Other
+
+ No application found to view this contact.
+
Type PIN code
diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml
index 6d90973c44f24557532a9fd2c5f7cf5885aca760..120027629a64776ee25f52a35bd9f0e5524f32e9 100644
--- a/core/res/res/values/symbols.xml
+++ b/core/res/res/values/symbols.xml
@@ -288,7 +288,6 @@
-
@@ -319,6 +318,7 @@
+
@@ -478,6 +478,7 @@
+
@@ -690,6 +691,7 @@
+
diff --git a/core/tests/ConnectivityManagerTest/src/com/android/connectivitymanagertest/NetworkState.java b/core/tests/ConnectivityManagerTest/src/com/android/connectivitymanagertest/NetworkState.java
index 5a4a2d0ba8d3ea86cb54544f2ef9f988fada00ea..9d97ac58011e12bf34c9dd6fceee03c9719e69df 100644
--- a/core/tests/ConnectivityManagerTest/src/com/android/connectivitymanagertest/NetworkState.java
+++ b/core/tests/ConnectivityManagerTest/src/com/android/connectivitymanagertest/NetworkState.java
@@ -101,9 +101,10 @@ public class NetworkState {
}
/*
- * Transition from CONNECTED -> DISCONNECTED:
- * CONNECTED->DISCONNECTING->DISCONNECTED
- * return false if any state transition is not valid and save a message in mReason
+ * Verifies state transition from CONNECTED->...-> DISCONNECTED.
+ *
+ * returns false if initial state or target state is not correct, or if there is
+ * any transition from DISCONNECTING/DISCONNECTED -> CONNECTED.
*/
public boolean transitToDisconnection () {
mReason = "states: " + printStates();
@@ -120,13 +121,13 @@ public class NetworkState {
for (int i = 1; i < mStateDepository.size() - 1; i++) {
State preState = mStateDepository.get(i-1);
State curState = mStateDepository.get(i);
- if ((preState == State.CONNECTED) && ((curState == State.DISCONNECTING) ||
+ if (preState == curState) {
+ continue;
+ } else if ((preState == State.CONNECTED) && ((curState == State.DISCONNECTING) ||
(curState == State.DISCONNECTED))) {
continue;
} else if ((preState == State.DISCONNECTING) && (curState == State.DISCONNECTED)) {
continue;
- } else if ((preState == State.DISCONNECTED) && (curState == State.DISCONNECTED)) {
- continue;
} else {
mReason += " Transition state from " + preState.toString() + " to " +
curState.toString() + " is not valid.";
@@ -136,7 +137,12 @@ public class NetworkState {
return true;
}
- // DISCONNECTED->CONNECTING->CONNECTED
+ /*
+ * Verifies state transition from DISCONNECTED->...-> CONNECTED.
+ *
+ * returns false if initial state or target state is not correct, or if there is
+ * any transition from CONNECED -> DISCONNECTED.
+ */
public boolean transitToConnection() {
mReason = "states: " + printStates();
if (mStateDepository.get(0) != State.DISCONNECTED) {
@@ -152,14 +158,15 @@ public class NetworkState {
for (int i = 1; i < mStateDepository.size(); i++) {
State preState = mStateDepository.get(i-1);
State curState = mStateDepository.get(i);
- if ((preState == State.DISCONNECTED) && ((curState == State.CONNECTING) ||
- (curState == State.CONNECTED) || (curState == State.DISCONNECTED))) {
+ if (preState == curState) {
continue;
- } else if ((preState == State.CONNECTING) && (curState == State.CONNECTED)) {
- continue;
- } else if ((preState == State.CONNECTED) && (curState == State.CONNECTED)) {
+ }
+ if ((preState == State.DISCONNECTED) && ((curState == State.CONNECTING) ||
+ (curState == State.CONNECTED))) {
continue;
- } else {
+ } else if ((preState == State.CONNECTING) && (curState == State.CONNECTED)) {
+ continue;
+ } else {
mReason += " Transition state from " + preState.toString() + " to " +
curState.toString() + " is not valid.";
return false;
diff --git a/data/keyboards/AVRCP.kl b/data/keyboards/AVRCP.kl
index 4c91ece3b5ef68df63b2b0f3b77dbe3a23d28fba..736b43c80c4d19221ed57226dc159bbb5b11d654 100644
--- a/data/keyboards/AVRCP.kl
+++ b/data/keyboards/AVRCP.kl
@@ -14,8 +14,8 @@
# Key layout used for Bluetooth AVRCP support.
-key 200 MEDIA_PLAY_PAUSE WAKE
-key 201 MEDIA_PLAY_PAUSE WAKE
+key 200 MEDIA_PLAY WAKE
+key 201 MEDIA_PAUSE WAKE
key 166 MEDIA_STOP WAKE
key 163 MEDIA_NEXT WAKE
key 165 MEDIA_PREVIOUS WAKE
diff --git a/data/keyboards/Generic.kcm b/data/keyboards/Generic.kcm
index 695a74f838101ea980c60f8c480e961aa58c632f..01d22ee69178022fc9c86de6809ac6b2aaf41b5b 100644
--- a/data/keyboards/Generic.kcm
+++ b/data/keyboards/Generic.kcm
@@ -477,4 +477,128 @@ key ESCAPE {
ctrl: fallback MENU
}
-### Gamepad buttons are handled by the view root ###
+### Gamepad buttons ###
+
+key BUTTON_A {
+ base: fallback DPAD_CENTER
+}
+
+key BUTTON_B {
+ base: fallback BACK
+}
+
+key BUTTON_C {
+ base: fallback DPAD_CENTER
+}
+
+key BUTTON_X {
+ base: fallback DPAD_CENTER
+}
+
+key BUTTON_Y {
+ base: fallback BACK
+}
+
+key BUTTON_Z {
+ base: fallback DPAD_CENTER
+}
+
+key BUTTON_L1 {
+ base: none
+}
+
+key BUTTON_R1 {
+ base: none
+}
+
+key BUTTON_L2 {
+ base: none
+}
+
+key BUTTON_R2 {
+ base: none
+}
+
+key BUTTON_THUMBL {
+ base: fallback DPAD_CENTER
+}
+
+key BUTTON_THUMBR {
+ base: fallback DPAD_CENTER
+}
+
+key BUTTON_START {
+ base: fallback DPAD_CENTER
+}
+
+key BUTTON_SELECT {
+ base: fallback MENU
+}
+
+key BUTTON_MODE {
+ base: fallback MENU
+}
+
+key BUTTON_1 {
+ base: fallback DPAD_CENTER
+}
+
+key BUTTON_2 {
+ base: fallback DPAD_CENTER
+}
+
+key BUTTON_3 {
+ base: fallback DPAD_CENTER
+}
+
+key BUTTON_4 {
+ base: fallback DPAD_CENTER
+}
+
+key BUTTON_5 {
+ base: fallback DPAD_CENTER
+}
+
+key BUTTON_6 {
+ base: fallback DPAD_CENTER
+}
+
+key BUTTON_7 {
+ base: fallback DPAD_CENTER
+}
+
+key BUTTON_8 {
+ base: fallback DPAD_CENTER
+}
+
+key BUTTON_9 {
+ base: fallback DPAD_CENTER
+}
+
+key BUTTON_10 {
+ base: fallback DPAD_CENTER
+}
+
+key BUTTON_11 {
+ base: fallback DPAD_CENTER
+}
+
+key BUTTON_12 {
+ base: fallback DPAD_CENTER
+}
+
+key BUTTON_13 {
+ base: fallback DPAD_CENTER
+}
+
+key BUTTON_14 {
+ base: fallback DPAD_CENTER
+}
+
+key BUTTON_15 {
+ base: fallback DPAD_CENTER
+}
+
+key BUTTON_16 {
+ base: fallback DPAD_CENTER
+}
diff --git a/docs/downloads/training/BitmapFun.zip b/docs/downloads/training/BitmapFun.zip
deleted file mode 100644
index d3dd02a5e08fba92dfe870b051f9cf965c147290..0000000000000000000000000000000000000000
Binary files a/docs/downloads/training/BitmapFun.zip and /dev/null differ
diff --git a/docs/downloads/training/ControllerSample.zip b/docs/downloads/training/ControllerSample.zip
new file mode 100644
index 0000000000000000000000000000000000000000..b09686195150e990ffc4206f1be5ac7ed6482cca
Binary files /dev/null and b/docs/downloads/training/ControllerSample.zip differ
diff --git a/docs/downloads/training/GoogleAuth.zip b/docs/downloads/training/GoogleAuth.zip
new file mode 100644
index 0000000000000000000000000000000000000000..18e9bf07207c9fdcb6dc7e2ea918b8f70015dc22
Binary files /dev/null and b/docs/downloads/training/GoogleAuth.zip differ
diff --git a/docs/html-intl/es/training/monitoring-device-state/battery-monitoring.jd b/docs/html-intl/intl/es/training/monitoring-device-state/battery-monitoring.jd
similarity index 100%
rename from docs/html-intl/es/training/monitoring-device-state/battery-monitoring.jd
rename to docs/html-intl/intl/es/training/monitoring-device-state/battery-monitoring.jd
diff --git a/docs/html-intl/es/training/monitoring-device-state/connectivity-monitoring.jd b/docs/html-intl/intl/es/training/monitoring-device-state/connectivity-monitoring.jd
similarity index 100%
rename from docs/html-intl/es/training/monitoring-device-state/connectivity-monitoring.jd
rename to docs/html-intl/intl/es/training/monitoring-device-state/connectivity-monitoring.jd
diff --git a/docs/html-intl/es/training/monitoring-device-state/docking-monitoring.jd b/docs/html-intl/intl/es/training/monitoring-device-state/docking-monitoring.jd
similarity index 100%
rename from docs/html-intl/es/training/monitoring-device-state/docking-monitoring.jd
rename to docs/html-intl/intl/es/training/monitoring-device-state/docking-monitoring.jd
diff --git a/docs/html-intl/es/training/monitoring-device-state/index.jd b/docs/html-intl/intl/es/training/monitoring-device-state/index.jd
similarity index 100%
rename from docs/html-intl/es/training/monitoring-device-state/index.jd
rename to docs/html-intl/intl/es/training/monitoring-device-state/index.jd
diff --git a/docs/html-intl/es/training/monitoring-device-state/manifest-receivers.jd b/docs/html-intl/intl/es/training/monitoring-device-state/manifest-receivers.jd
similarity index 100%
rename from docs/html-intl/es/training/monitoring-device-state/manifest-receivers.jd
rename to docs/html-intl/intl/es/training/monitoring-device-state/manifest-receivers.jd
diff --git a/docs/html-intl/es/training/multiscreen/adaptui.jd b/docs/html-intl/intl/es/training/multiscreen/adaptui.jd
similarity index 100%
rename from docs/html-intl/es/training/multiscreen/adaptui.jd
rename to docs/html-intl/intl/es/training/multiscreen/adaptui.jd
diff --git a/docs/html-intl/es/training/multiscreen/index.jd b/docs/html-intl/intl/es/training/multiscreen/index.jd
similarity index 100%
rename from docs/html-intl/es/training/multiscreen/index.jd
rename to docs/html-intl/intl/es/training/multiscreen/index.jd
diff --git a/docs/html-intl/es/training/multiscreen/screendensities.jd b/docs/html-intl/intl/es/training/multiscreen/screendensities.jd
similarity index 100%
rename from docs/html-intl/es/training/multiscreen/screendensities.jd
rename to docs/html-intl/intl/es/training/multiscreen/screendensities.jd
diff --git a/docs/html-intl/es/training/multiscreen/screensizes.jd b/docs/html-intl/intl/es/training/multiscreen/screensizes.jd
similarity index 100%
rename from docs/html-intl/es/training/multiscreen/screensizes.jd
rename to docs/html-intl/intl/es/training/multiscreen/screensizes.jd
diff --git a/docs/html-intl/ja/guide/publishing/app-signing.jd b/docs/html-intl/intl/ja/guide/publishing/app-signing.jd
similarity index 100%
rename from docs/html-intl/ja/guide/publishing/app-signing.jd
rename to docs/html-intl/intl/ja/guide/publishing/app-signing.jd
diff --git a/docs/html-intl/ja/guide/publishing/preparing.jd b/docs/html-intl/intl/ja/guide/publishing/preparing.jd
similarity index 100%
rename from docs/html-intl/ja/guide/publishing/preparing.jd
rename to docs/html-intl/intl/ja/guide/publishing/preparing.jd
diff --git a/docs/html-intl/ja/guide/publishing/versioning.jd b/docs/html-intl/intl/ja/guide/publishing/versioning.jd
similarity index 100%
rename from docs/html-intl/ja/guide/publishing/versioning.jd
rename to docs/html-intl/intl/ja/guide/publishing/versioning.jd
diff --git a/docs/html-intl/ja/guide/topics/fundamentals.jd b/docs/html-intl/intl/ja/guide/topics/fundamentals.jd
similarity index 100%
rename from docs/html-intl/ja/guide/topics/fundamentals.jd
rename to docs/html-intl/intl/ja/guide/topics/fundamentals.jd
diff --git a/docs/html-intl/ja/training/monitoring-device-state/battery-monitoring.jd b/docs/html-intl/intl/ja/training/monitoring-device-state/battery-monitoring.jd
similarity index 100%
rename from docs/html-intl/ja/training/monitoring-device-state/battery-monitoring.jd
rename to docs/html-intl/intl/ja/training/monitoring-device-state/battery-monitoring.jd
diff --git a/docs/html-intl/ja/training/monitoring-device-state/connectivity-monitoring.jd b/docs/html-intl/intl/ja/training/monitoring-device-state/connectivity-monitoring.jd
similarity index 100%
rename from docs/html-intl/ja/training/monitoring-device-state/connectivity-monitoring.jd
rename to docs/html-intl/intl/ja/training/monitoring-device-state/connectivity-monitoring.jd
diff --git a/docs/html-intl/ja/training/monitoring-device-state/docking-monitoring.jd b/docs/html-intl/intl/ja/training/monitoring-device-state/docking-monitoring.jd
similarity index 100%
rename from docs/html-intl/ja/training/monitoring-device-state/docking-monitoring.jd
rename to docs/html-intl/intl/ja/training/monitoring-device-state/docking-monitoring.jd
diff --git a/docs/html-intl/ja/training/monitoring-device-state/index.jd b/docs/html-intl/intl/ja/training/monitoring-device-state/index.jd
similarity index 100%
rename from docs/html-intl/ja/training/monitoring-device-state/index.jd
rename to docs/html-intl/intl/ja/training/monitoring-device-state/index.jd
diff --git a/docs/html-intl/ja/training/monitoring-device-state/manifest-receivers.jd b/docs/html-intl/intl/ja/training/monitoring-device-state/manifest-receivers.jd
similarity index 100%
rename from docs/html-intl/ja/training/monitoring-device-state/manifest-receivers.jd
rename to docs/html-intl/intl/ja/training/monitoring-device-state/manifest-receivers.jd
diff --git a/docs/html-intl/ja/training/multiscreen/adaptui.jd b/docs/html-intl/intl/ja/training/multiscreen/adaptui.jd
similarity index 100%
rename from docs/html-intl/ja/training/multiscreen/adaptui.jd
rename to docs/html-intl/intl/ja/training/multiscreen/adaptui.jd
diff --git a/docs/html-intl/ja/training/multiscreen/index.jd b/docs/html-intl/intl/ja/training/multiscreen/index.jd
similarity index 100%
rename from docs/html-intl/ja/training/multiscreen/index.jd
rename to docs/html-intl/intl/ja/training/multiscreen/index.jd
diff --git a/docs/html-intl/ja/training/multiscreen/screendensities.jd b/docs/html-intl/intl/ja/training/multiscreen/screendensities.jd
similarity index 100%
rename from docs/html-intl/ja/training/multiscreen/screendensities.jd
rename to docs/html-intl/intl/ja/training/multiscreen/screendensities.jd
diff --git a/docs/html-intl/ja/training/multiscreen/screensizes.jd b/docs/html-intl/intl/ja/training/multiscreen/screensizes.jd
similarity index 100%
rename from docs/html-intl/ja/training/multiscreen/screensizes.jd
rename to docs/html-intl/intl/ja/training/multiscreen/screensizes.jd
diff --git a/docs/html-intl/ko/training/monitoring-device-state/battery-monitoring.jd b/docs/html-intl/intl/ko/training/monitoring-device-state/battery-monitoring.jd
similarity index 100%
rename from docs/html-intl/ko/training/monitoring-device-state/battery-monitoring.jd
rename to docs/html-intl/intl/ko/training/monitoring-device-state/battery-monitoring.jd
diff --git a/docs/html-intl/ko/training/monitoring-device-state/connectivity-monitoring.jd b/docs/html-intl/intl/ko/training/monitoring-device-state/connectivity-monitoring.jd
similarity index 100%
rename from docs/html-intl/ko/training/monitoring-device-state/connectivity-monitoring.jd
rename to docs/html-intl/intl/ko/training/monitoring-device-state/connectivity-monitoring.jd
diff --git a/docs/html-intl/ko/training/monitoring-device-state/docking-monitoring.jd b/docs/html-intl/intl/ko/training/monitoring-device-state/docking-monitoring.jd
similarity index 100%
rename from docs/html-intl/ko/training/monitoring-device-state/docking-monitoring.jd
rename to docs/html-intl/intl/ko/training/monitoring-device-state/docking-monitoring.jd
diff --git a/docs/html-intl/ko/training/monitoring-device-state/index.jd b/docs/html-intl/intl/ko/training/monitoring-device-state/index.jd
similarity index 100%
rename from docs/html-intl/ko/training/monitoring-device-state/index.jd
rename to docs/html-intl/intl/ko/training/monitoring-device-state/index.jd
diff --git a/docs/html-intl/ko/training/monitoring-device-state/manifest-receivers.jd b/docs/html-intl/intl/ko/training/monitoring-device-state/manifest-receivers.jd
similarity index 100%
rename from docs/html-intl/ko/training/monitoring-device-state/manifest-receivers.jd
rename to docs/html-intl/intl/ko/training/monitoring-device-state/manifest-receivers.jd
diff --git a/docs/html-intl/ko/training/multiscreen/adaptui.jd b/docs/html-intl/intl/ko/training/multiscreen/adaptui.jd
similarity index 100%
rename from docs/html-intl/ko/training/multiscreen/adaptui.jd
rename to docs/html-intl/intl/ko/training/multiscreen/adaptui.jd
diff --git a/docs/html-intl/ko/training/multiscreen/index.jd b/docs/html-intl/intl/ko/training/multiscreen/index.jd
similarity index 100%
rename from docs/html-intl/ko/training/multiscreen/index.jd
rename to docs/html-intl/intl/ko/training/multiscreen/index.jd
diff --git a/docs/html-intl/ko/training/multiscreen/screendensities.jd b/docs/html-intl/intl/ko/training/multiscreen/screendensities.jd
similarity index 100%
rename from docs/html-intl/ko/training/multiscreen/screendensities.jd
rename to docs/html-intl/intl/ko/training/multiscreen/screendensities.jd
diff --git a/docs/html-intl/ko/training/multiscreen/screensizes.jd b/docs/html-intl/intl/ko/training/multiscreen/screensizes.jd
similarity index 100%
rename from docs/html-intl/ko/training/multiscreen/screensizes.jd
rename to docs/html-intl/intl/ko/training/multiscreen/screensizes.jd
diff --git a/docs/html-intl/ru/training/monitoring-device-state/battery-monitoring.jd b/docs/html-intl/intl/ru/training/monitoring-device-state/battery-monitoring.jd
similarity index 100%
rename from docs/html-intl/ru/training/monitoring-device-state/battery-monitoring.jd
rename to docs/html-intl/intl/ru/training/monitoring-device-state/battery-monitoring.jd
diff --git a/docs/html-intl/ru/training/monitoring-device-state/connectivity-monitoring.jd b/docs/html-intl/intl/ru/training/monitoring-device-state/connectivity-monitoring.jd
similarity index 100%
rename from docs/html-intl/ru/training/monitoring-device-state/connectivity-monitoring.jd
rename to docs/html-intl/intl/ru/training/monitoring-device-state/connectivity-monitoring.jd
diff --git a/docs/html-intl/ru/training/monitoring-device-state/docking-monitoring.jd b/docs/html-intl/intl/ru/training/monitoring-device-state/docking-monitoring.jd
similarity index 100%
rename from docs/html-intl/ru/training/monitoring-device-state/docking-monitoring.jd
rename to docs/html-intl/intl/ru/training/monitoring-device-state/docking-monitoring.jd
diff --git a/docs/html-intl/ru/training/monitoring-device-state/index.jd b/docs/html-intl/intl/ru/training/monitoring-device-state/index.jd
similarity index 100%
rename from docs/html-intl/ru/training/monitoring-device-state/index.jd
rename to docs/html-intl/intl/ru/training/monitoring-device-state/index.jd
diff --git a/docs/html-intl/ru/training/monitoring-device-state/manifest-receivers.jd b/docs/html-intl/intl/ru/training/monitoring-device-state/manifest-receivers.jd
similarity index 100%
rename from docs/html-intl/ru/training/monitoring-device-state/manifest-receivers.jd
rename to docs/html-intl/intl/ru/training/monitoring-device-state/manifest-receivers.jd
diff --git a/docs/html-intl/ru/training/multiscreen/adaptui.jd b/docs/html-intl/intl/ru/training/multiscreen/adaptui.jd
similarity index 100%
rename from docs/html-intl/ru/training/multiscreen/adaptui.jd
rename to docs/html-intl/intl/ru/training/multiscreen/adaptui.jd
diff --git a/docs/html-intl/ru/training/multiscreen/index.jd b/docs/html-intl/intl/ru/training/multiscreen/index.jd
similarity index 100%
rename from docs/html-intl/ru/training/multiscreen/index.jd
rename to docs/html-intl/intl/ru/training/multiscreen/index.jd
diff --git a/docs/html-intl/ru/training/multiscreen/screendensities.jd b/docs/html-intl/intl/ru/training/multiscreen/screendensities.jd
similarity index 100%
rename from docs/html-intl/ru/training/multiscreen/screendensities.jd
rename to docs/html-intl/intl/ru/training/multiscreen/screendensities.jd
diff --git a/docs/html-intl/ru/training/multiscreen/screensizes.jd b/docs/html-intl/intl/ru/training/multiscreen/screensizes.jd
similarity index 100%
rename from docs/html-intl/ru/training/multiscreen/screensizes.jd
rename to docs/html-intl/intl/ru/training/multiscreen/screensizes.jd
diff --git a/docs/html-intl/zh-cn/training/monitoring-device-state/battery-monitoring.jd b/docs/html-intl/intl/zh-cn/training/monitoring-device-state/battery-monitoring.jd
similarity index 100%
rename from docs/html-intl/zh-cn/training/monitoring-device-state/battery-monitoring.jd
rename to docs/html-intl/intl/zh-cn/training/monitoring-device-state/battery-monitoring.jd
diff --git a/docs/html-intl/zh-cn/training/monitoring-device-state/connectivity-monitoring.jd b/docs/html-intl/intl/zh-cn/training/monitoring-device-state/connectivity-monitoring.jd
similarity index 100%
rename from docs/html-intl/zh-cn/training/monitoring-device-state/connectivity-monitoring.jd
rename to docs/html-intl/intl/zh-cn/training/monitoring-device-state/connectivity-monitoring.jd
diff --git a/docs/html-intl/zh-cn/training/monitoring-device-state/docking-monitoring.jd b/docs/html-intl/intl/zh-cn/training/monitoring-device-state/docking-monitoring.jd
similarity index 100%
rename from docs/html-intl/zh-cn/training/monitoring-device-state/docking-monitoring.jd
rename to docs/html-intl/intl/zh-cn/training/monitoring-device-state/docking-monitoring.jd
diff --git a/docs/html-intl/zh-cn/training/monitoring-device-state/index.jd b/docs/html-intl/intl/zh-cn/training/monitoring-device-state/index.jd
similarity index 100%
rename from docs/html-intl/zh-cn/training/monitoring-device-state/index.jd
rename to docs/html-intl/intl/zh-cn/training/monitoring-device-state/index.jd
diff --git a/docs/html-intl/zh-cn/training/monitoring-device-state/manifest-receivers.jd b/docs/html-intl/intl/zh-cn/training/monitoring-device-state/manifest-receivers.jd
similarity index 100%
rename from docs/html-intl/zh-cn/training/monitoring-device-state/manifest-receivers.jd
rename to docs/html-intl/intl/zh-cn/training/monitoring-device-state/manifest-receivers.jd
diff --git a/docs/html-intl/zh-cn/training/multiscreen/adaptui.jd b/docs/html-intl/intl/zh-cn/training/multiscreen/adaptui.jd
similarity index 100%
rename from docs/html-intl/zh-cn/training/multiscreen/adaptui.jd
rename to docs/html-intl/intl/zh-cn/training/multiscreen/adaptui.jd
diff --git a/docs/html-intl/zh-cn/training/multiscreen/index.jd b/docs/html-intl/intl/zh-cn/training/multiscreen/index.jd
similarity index 100%
rename from docs/html-intl/zh-cn/training/multiscreen/index.jd
rename to docs/html-intl/intl/zh-cn/training/multiscreen/index.jd
diff --git a/docs/html-intl/zh-cn/training/multiscreen/screendensities.jd b/docs/html-intl/intl/zh-cn/training/multiscreen/screendensities.jd
similarity index 100%
rename from docs/html-intl/zh-cn/training/multiscreen/screendensities.jd
rename to docs/html-intl/intl/zh-cn/training/multiscreen/screendensities.jd
diff --git a/docs/html-intl/zh-cn/training/multiscreen/screensizes.jd b/docs/html-intl/intl/zh-cn/training/multiscreen/screensizes.jd
similarity index 100%
rename from docs/html-intl/zh-cn/training/multiscreen/screensizes.jd
rename to docs/html-intl/intl/zh-cn/training/multiscreen/screensizes.jd
diff --git a/docs/html/_redirects.yaml b/docs/html/_redirects.yaml
index 5f0779c1f3f759011a0817e5071f6708b21b7246..fc60e1ff01506c78f2dd6521ae41d0d43953b1c9 100644
--- a/docs/html/_redirects.yaml
+++ b/docs/html/_redirects.yaml
@@ -313,6 +313,9 @@ redirects:
# -------------------- MISC ----------------------
+- from: /shareables/training/BitmapFun.zip
+ to: /downloads/samples/DisplayingBitmaps.zip
+
- from: /shareables/...
to: http://commondatastorage.googleapis.com/androiddevelopers/shareables/...
diff --git a/docs/html/about/dashboards/index.jd b/docs/html/about/dashboards/index.jd
index bb34495992ec33bf197d27a1eaf737d7a5a5fcdb..6d29c69cd12539d96dcdde9afd6774aea0e8c26c 100644
--- a/docs/html/about/dashboards/index.jd
+++ b/docs/html/about/dashboards/index.jd
@@ -61,7 +61,7 @@ Platform Versions.
-Data collected during a 7-day period ending on November 1, 2013.
+Data collected during a 7-day period ending on March 3, 2014.
Any versions with less than 0.1% distribution are not shown.
@@ -92,7 +92,7 @@ Screens.
-Data collected during a 7-day period ending on November 1, 2013
+Data collected during a 7-day period ending on March 3, 2014.
Any screen configurations with less than 0.1% distribution are not shown.
@@ -111,7 +111,7 @@ support for any lower version (for example, support for version 2.0 also implies
+src="//chart.googleapis.com/chart?chl=GL%201.1%20only%7CGL%202.0%7CGL%203.0&chf=bg%2Cs%2C00000000&chd=t%3A0.1%2C93.5%2C6.4&chco=c4df9b%2C6fad0c&chs=400x250&cht=p" />
To declare which version of OpenGL ES your application requires, you should use the {@code
android:glEsVersion} attribute of the
2.0
- 98.3%
+91.1%
3.0
- 1.6%
+8.8%
-Data collected during a 7-day period ending on November 1, 2013
+Data collected during a 7-day period ending on March 3, 2014
@@ -161,17 +161,17 @@ uses.
var VERSION_DATA =
[
{
- "chart": "//chart.googleapis.com/chart?chl=Froyo%7CGingerbread%7CHoneycomb%7CIce%20Cream%20Sandwich%7CJelly%20Bean&chco=c4df9b%2C6fad0c&chd=t%3A1.7%2C26.3%2C0.1%2C19.8%2C52.1&chf=bg%2Cs%2C00000000&chs=500x250&cht=p",
+ "chart": "//chart.googleapis.com/chart?chl=Froyo%7CGingerbread%7CHoneycomb%7CIce%20Cream%20Sandwich%7CJelly%20Bean%7CKitKat&chd=t%3A1.2%2C19.0%2C0.1%2C15.2%2C62.0%2C2.5&chf=bg%2Cs%2C00000000&chco=c4df9b%2C6fad0c&chs=500x250&cht=p",
"data": [
{
"api": 8,
"name": "Froyo",
- "perc": "1.7"
+ "perc": "1.2"
},
{
"api": 10,
"name": "Gingerbread",
- "perc": "26.3"
+ "perc": "19.0"
},
{
"api": 13,
@@ -181,22 +181,27 @@ var VERSION_DATA =
{
"api": 15,
"name": "Ice Cream Sandwich",
- "perc": "19.8"
+ "perc": "15.2"
},
{
"api": 16,
"name": "Jelly Bean",
- "perc": "37.3"
+ "perc": "35.3"
},
{
"api": 17,
"name": "Jelly Bean",
- "perc": "12.5"
+ "perc": "17.1"
},
{
"api": 18,
"name": "Jelly Bean",
- "perc": "2.3"
+ "perc": "9.6"
+ },
+ {
+ "api": 19,
+ "name": "KitKat",
+ "perc": "2.5"
}
]
}
@@ -211,30 +216,31 @@ var SCREEN_DATA =
{
"data": {
"Large": {
- "hdpi": "0.5",
- "ldpi": "0.6",
- "mdpi": "3.6",
- "tvdpi": "1.2",
- "xhdpi": "0.5"
+ "hdpi": "0.6",
+ "ldpi": "0.7",
+ "mdpi": "4.3",
+ "tvdpi": "1.5",
+ "xhdpi": "0.6"
},
"Normal": {
- "hdpi": "33.4",
- "ldpi": "0.1",
- "mdpi": "15.1",
- "xhdpi": "22.2",
- "xxhdpi": "8.8"
+ "hdpi": "33.7",
+ "ldpi": "0.2",
+ "mdpi": "13.6",
+ "xhdpi": "19.9",
+ "xxhdpi": "11.9"
},
"Small": {
- "ldpi": "9.2"
+ "ldpi": "8.1"
},
"Xlarge": {
"hdpi": "0.3",
- "mdpi": "4.4",
- "xhdpi": "0.1"
+ "ldpi": "0.1",
+ "mdpi": "4.3",
+ "xhdpi": "0.2"
}
},
- "densitychart": "//chart.googleapis.com/chart?chl=ldpi%7Cmdpi%7Ctvdpi%7Chdpi%7Cxhdpi%7Cxxhdpi&chco=c4df9b%2C6fad0c&chd=t%3A9.9%2C23.1%2C1.2%2C34.2%2C22.8%2C8.8&chf=bg%2Cs%2C00000000&chs=400x250&cht=p",
- "layoutchart": "//chart.googleapis.com/chart?chl=Xlarge%7CLarge%7CNormal%7CSmall&chco=c4df9b%2C6fad0c&chd=t%3A4.8%2C6.4%2C79.6%2C9.2&chf=bg%2Cs%2C00000000&chs=400x250&cht=p"
+ "densitychart": "//chart.googleapis.com/chart?chl=ldpi%7Cmdpi%7Ctvdpi%7Chdpi%7Cxhdpi%7Cxxhdpi&chd=t%3A9.1%2C22.2%2C1.5%2C34.6%2C20.7%2C11.9&chf=bg%2Cs%2C00000000&chco=c4df9b%2C6fad0c&chs=400x250&cht=p",
+ "layoutchart": "//chart.googleapis.com/chart?chl=Xlarge%7CLarge%7CNormal%7CSmall&chd=t%3A4.9%2C7.7%2C79.3%2C8.1&chf=bg%2Cs%2C00000000&chco=c4df9b%2C6fad0c&chs=400x250&cht=p"
}
];
@@ -301,6 +307,11 @@ var VERSION_NAMES =
"api":18,
"link":"4.3",
"codename":"Jelly Bean"
+ },
+ {
+ "api":19,
+ "link":"4.4",
+ "codename":"KitKat"
}
];
diff --git a/docs/html/about/versions/android-4.4.jd b/docs/html/about/versions/android-4.4.jd
index 42f257c01f3a90dcf6076b19a67ca3acad4df189..3de2acca7049e3682a1a70e4012473a95509575d 100644
--- a/docs/html/about/versions/android-4.4.jd
+++ b/docs/html/about/versions/android-4.4.jd
@@ -244,7 +244,7 @@ href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#target">{@code targe
If you want to emulate an NFC card that is using these protocols in your app, create a service component based on the {@link android.nfc.cardemulation.HostApduService} class. Whereas if your app instead uses a secure element for card emulation, you need to create a service based on the {@link android.nfc.cardemulation.OffHostApduService} class, which will not directly be involved in the transactions but is necessary to register the AIDs that should be handled by the secure element.
-For more information, read the NFC Card Emulation guide.
+For more information, read the NFC Card Emulation guide.
NFC reader mode
diff --git a/docs/html/about/versions/jelly-bean.jd b/docs/html/about/versions/jelly-bean.jd
index c6702b075bf3b6adf42cc3d521c1dcd66847d683..25f88e3eb2b56c50b9d30bf25297dc2170f46588 100644
--- a/docs/html/about/versions/jelly-bean.jd
+++ b/docs/html/about/versions/jelly-bean.jd
@@ -578,9 +578,10 @@ graphs, with colors indicating time spent creating drawing commands
graph for each visible Activity, including the navigation bar and notification
bar.
-A green line highlights the 60ms threshold for rendering
+
A green line highlights the 16ms threshold for rendering
operations, so you can assess the your app’s effective framerate relative
-to a 60 fps goal. If you see operations that cross the green line, you
+to a 60 fps goal (because 1/60th of a second equals roughly 16ms).
+If you see operations that cross the green line, you
can analyze them further using Systrace and other tools.
On devices running Android 4.2 and higher,
diff --git a/docs/html/about/versions/kitkat.jd b/docs/html/about/versions/kitkat.jd
index 5e442ec61b37cce532a58ec90a72e31eae78e659..4237c9868a091e96643e0d8772ece27d44c7f695 100644
--- a/docs/html/about/versions/kitkat.jd
+++ b/docs/html/about/versions/kitkat.jd
@@ -54,8 +54,8 @@ window.onhashchange = function () {
-
-
+
+
diff --git a/docs/html/channels/io2013.jd b/docs/html/channels/io2013.jd
index 977eb2f2aed34ede98634f4964cb3c02373db812..2efda28d2b8c676f5ae8e9e96bb2f3d058b37703 100644
--- a/docs/html/channels/io2013.jd
+++ b/docs/html/channels/io2013.jd
@@ -1,3 +1,4 @@
+excludeFromSuggestions=true
fullpage=true
page.title=Google I/O 13
@jd:body
diff --git a/docs/html/community/index.html b/docs/html/community/index.html
new file mode 100644
index 0000000000000000000000000000000000000000..eeb1c5144c5033bd73e134511f448dc43f44757b
--- /dev/null
+++ b/docs/html/community/index.html
@@ -0,0 +1,317 @@
+
+
+
+
+
+
+
+
+Android Developers Community
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Community Outreach
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Android is working with communities to
+
+- Create a cooperative relationship between highly impactful communities and high performing developers
+- Strengthen relationships between Android and coding communities so that developers have a motivation to interact with those communities
+- Reward communities for attracting developers by providing them with resources and direct access to the Android team
+Our IMPACT is measured by good apps and a thriving community
+
+News
+Our current theme is on the Android 4.4 KitKat and Updated Developer Tools release, with new ways to create beautiful apps, printing and storage frameworks, low-power sensors, new media capabilities and RenderScript in the NDK.
+
+
+
+
+
+
+Android 4.4 Platform Highlights
+Android KitKat brings all of Android's most innovative, most beautiful, and most useful features to more devices everywhere.
+
+Android 4.4 APIs
+Android 4.4 (KITKAT) is a new release for the Android platform that offers new features for users and app developers. This document provides an introduction to the most notable new APIs.
+
+New Nexus 5
+Nexus 5 helps you capture the everyday and the epic in fresh new ways. It's the slimmest and fastest Nexus phone ever made, powered by Android 4.4, KitKat.
+
+
+
+Community Spotlight
+
+
+Android Community Groups
+July 2013
+GDG Armenia held ecaHack Yerevan, an Android hackathon featuring "Angry Designers vs Android Developers", where the designers had a look into developers apps and gave them some advices regarding to design. The hackathon was sponsored by Alcatel One Touch and each member of the winner team got one Alcatel One Touch Idol. Check out the photos.
+September 2013
+GDG Blrdroid held a meetup on performance optimisation.
+GDG Dublin held their meetup with a talk on AdMob for Android and iOS, entitled “Admob for Android and iOS developers”.
+GDG Mbale’s Hassan Nsubuga has been managing a university course session since September. They are now through with the basics and have a firm foundation, so this month they will be doing a lot of advanced stuff including exploring the latest API enhancements with KitKat.
+GDG Warsaw held an Android Barcamp focused on App Quality. The discussion was moderated by GDG organisers, but the talks were given by the community members, including some top Android companies and developers in Poland.
+October 2013
+GDG Berlin Android held their DevFest.
+GDG Blrdroid held their meetup in collaboration with GDG Bangalore, where they talked about a wider range of things from incorporating user feedback to effectively using the cell radio. David McLaughlin from the Developer Relations team also visited during the meetup and delivered the keynote. They also hit a milestone with its 4th anniversary on the 9th of October and crossed 4300 members in the past few days so its been a memorable couple of months for them.
+GDG Cape Town held an Android Workshop where they gave away lots of branded KitKats.
+GDG Dublin held its DevFest, which featured a codeLab on Android titled “Codelab: Intro to Android Development.”
+GDG Dutch Android User Group held their DevFest. They had a bunch of Android sessions, mostly by local speakers. In addition to the Android sessions, they also ran a workshop on writing custom views.
+Hugo Visser from the Dutch Android User Group spoke at DroidCon UK barcamp, where he delivered a talk on Cupboard, a simple and lightweight persistence framework, specifically for Android.
+GDG GAUG held the Google Devfest 2013, where they had two tracks and more than 200 delegates attending. They also had a Hackathon and they hit the 1000 member mark this month, which makes them the second largest android community in India after GDG Blrdroid.
+GDG Miage held their DevFest where they gave a talk about Intents and Services. The also held a startup Weekend Bootcamp where they talked about Activites and Layouts. They will also hold an Android Workshop in December.
+GDG Uruguay had their DevFest, where they held an Android workshop for beginners as an Android vs iOS comparison, a session on best practices using YouTube APIs in Android, and What's new in Google for developers (with a special section about Android). You can see pictures on the G+ page.
+
+November 2013
+Abidjandroid/GDG Côte d'Ivoire held an Android Launch Party featuring the KitKat release.
+The Dutch Android User Group had a very interactive presentation on Android Code Puzzlers and Tips & tricks, where they rewarded participation by giving out books, tshirts, jelly beans and kitkats. The presentation was at the Dutch JFall conference, organized by the NLJUG. It's a large yearly Java conference and the DAUG had the only Android session there.
+The GDG Berlin Android meetup this month featured the KitKat release.
+The GDG Blrdroid meetup was another focused on KitKat.
+At the GDG Cairo DevFest there was a "What's new in Android SDK" session on day 1, and an Android workshop on day 2. Kitkat also provided interest in the sessions and the snacks bar. The KitKat presentation, the track organization, and everything related to it were all organized by women.
+GDG Cape Town held an Android Workshop.
+GDG Udine organized a talk after the release of KitKat for a school in Pordenone.
+Hugo Visser from Droidcon Netherlands organized an Android hackathon themed "Location, Location, Location".
+Paris Android User Group welcomed Romain Guy and Chet Haase to their meetup this month. They’ll be meeting up with other GDG leads and UG managers meet at Devoxx next Thursday.
+GDG Warsaw had over 250 attendees at their DevFest, which featured session tracks on Android and Web and a whole day of Code Labs in Android, AngularJS and Arduino.
+December 2013
+GDG GAUG are planning a codelab and hackathon.
+Peter Svensson spoke at DroidCon Stockholm
+The unstoppable Max Bonbhel from the African GDG Android is hosting AAC 2014 and Android GDG Barcamp events in December. Also, in order to encourage African Java developers to move to the Android platform, he created the Africa Android Training (AAT) program. The training material targets developers with different levels of experience in Java development. More than 60 developers have been taking part in the weekly sessions. The next 10 sessions will start Saturday, November 9, 2013. 260 GDG and Java User Group members have already registered from 12 Countries.
+
+
+
+
+Android Community Experts
+
+October 2013
+Eyal Lezmy presented two sessions. “Play Store bashing, learn from the biggest fails” looked at several applications, mainly developed by huge companies, and analyzed why they failed to satisfy the users or the Android guidelines. “Android, the life of your app” tells a story, living the life of a user, identify the frustrations he can encounter and present ways to avoid it, as a developer.
+Mario Viviani presented and recorded the next Android App Clinic - Italia. This episode was regarding the Cards UI and SMS app support in Android 4.4. They experimented with a short form of the video (10 minutes instead of 20) and in less than day it got almost 400+ views -- which is great considering it's in Italian! The previous episode reached 1300 views all-time and was the most successful video of GDL Italia in Q2.
+Matthias Käppler contributed the first Android specific component to the RxJava project, and spoke about RxJava and reactive programming on Android at DroidCon UK. He has also open sourced Memento, an Android annotation processor to replace the deprecated onRetainNonConfigurationInstance.
+Wojtek Kaliciński’s talk, "Android - is it time for a break yet?" highlights not only what's new in Android 4.4 KitKat, but also how to take your app to the next level by making sure you provide the best app experience possible to all 4.0+ users.
+
+
+
+
+New Content
+
+Android 4.4 What's New
+KitKat has been optimized to run on a much broader range of devices, with special focus on the millions of entry-level devices that have as little as 512MB RAM. To help, we've created new APIs, better tools, and better documentation to let you create apps that perform well on all devices.
+Check out this video summary of some of the most significant developer features in the latest Android release, including new ways to make your apps beautiful, NFC Host Card Emulation, a printing framework, the storage access framework, low-power step detector and step counter sensors, and more!
+Video
+Presentation
+Be sure to get the full Android 4.4 API Overview, and take a look at our related DevBytes videos
+
+WebView in Android 4.4
+Android 4.4 (API level 19) introduces a new version of WebView that is based on Chromium. This change upgrades WebView performance and standards support for HTML5, CSS3, and JavaScript to match the latest web browsers. Any apps using WebView will inherit these upgrades when running on Android 4.4 and higher.
+API Guide
+
+
+Android 4.4 Immersive Mode
+With Android 4.4 KitKat, your apps can now truly go full-screen with a new Immersive Mode. Immersive Mode lets your apps hide the system's status and navigation bars while capturing all touch events—ideal for rich interactive content such as books and games. This video demonstrates how to use the new API, in addition to recapping earlier full-screen APIs on Android.
+Video
+Presentation
+Sample
+
+
+
+
Android 4.4 Storage Access Framework - Provider
+Get up to speed on the new document storage API in Android 4.4 KitKat. This video gets you up and running with your own DocumentProvider by stepping you through the making of a simple cloud storage app.
+Video
+Presentation
+Training
+Sample, Box Application
+
+
+
+
+
+Android 4.4 Storage Access Framework - Client
+Get up to speed on the new storage access framework in Android 4.4 KitKat. This video teaches you how to quickly create, edit, save and delete documents provided by other apps as a client of the storage access framework.
+Video
+Presentation
+Sample
+
+
+Android 4.4 Closed Captioning
+Displaying closed captions in your app's videos can be quick and simple in Android 4.4 KitKat,. Learn how to attach timed text tracks to VideoView and allow users to customize how captions are displayed.
+Video
+Presentation
+
+
+
+
+
+
+
+
Android 4.4 Transitions
+In this episode, we introduce the new Transitions API in Android 4.4 Kitkat. This API provides a simple way for developers to provide animated segues to different scenes of their application, helping users to understand the application flow with very little code. The general approach is to tell the system that you'd like to run a transition animation, then make the necessary changes to your UI. The system figures out the differences and animates the changes.
+Video
+Presentation
+
+Android 4.4: SMS APIs
+Android 4.4 KitKat introduces the new SMS APIs as well as the new concept of a default SMS app. This video discusses these new APIs and how your app should use them to send and receive SMS and MMS messages.
+Video
+Presentation
+See also -
+Android Developer Blog post on Android 4.4 KitKat SMS APIs
+Android Protip on using booleans in your AndroidManifest.xml
+
+
+Android 4.4 Printing API
+In this video, we introduce the new Printing API in Android 4.4 KitKat. This API provides a simple way for developers to print to cloud-connected printers using Google Cloud Print. It's really easy to print bitmaps, and HTML (that you generate on the device, or just web content).
+Video
+Presentation
+Training
+Some pro-tips:
+
+ - For Webview/HTML printing, printing from javascript is not supported yet (window.print() for example). Also we are planning to address the limitations around WebView/HTML printing in future releases (eg: headers/footers, and specifying print ranges).
+- We encourage developers to open Android Open Source bugs for features that they feel important as a feedback.
+
+
+App Indexing
+In this episode we discuss the new App Indexing feature that we recently announced for Google Search for Android.
+Currently, when you do a google search on the web, you get results that are links to websites. With App Indexing, you will be able to point Google Search users on Android directly to content within your app!
+If you’re an Android app developer who has a web presence and you want more control over how your content is accessed from search, via your website or Android app, App Indexing is a great feature for you to explore.
+Also, enabling your website and app for indexing is a way to increase engagement with your app by making the content more discoverable, and more accessible to users directly from the search results page.
+For information on App Indexing, please visit http://g.co/appindexing
+Video
+Presentation
+
+
+
+
+Social
+
+
+G+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/html/design/building-blocks/buttons.jd b/docs/html/design/building-blocks/buttons.jd
index 1f7e25d35b0dda48935a8983684e392f64083d0a..8a65b825584f8e5c49bab8fa744b81a29f00d7ac 100644
--- a/docs/html/design/building-blocks/buttons.jd
+++ b/docs/html/design/building-blocks/buttons.jd
@@ -9,7 +9,7 @@ page.tags="button","input"
-A button consists of text and/or an image that clearly communicates what action
+
A button consists of text and/or an image that clearly communicates what action
will occur when the user touches it. A button can have an image, text, or both.
diff --git a/docs/html/design/building-blocks/dialogs.jd b/docs/html/design/building-blocks/dialogs.jd
index f4bb87e9303c4100f1fd0a4aa65a746764a62674..7cd032cdc29e3d1d2ca476635400444399e8734c 100644
--- a/docs/html/design/building-blocks/dialogs.jd
+++ b/docs/html/design/building-blocks/dialogs.jd
@@ -9,7 +9,7 @@ page.tags="dialog","alert","popup","toast"
-Dialogs prompt the user for decisions or additional information required by the app to continue a
+
Dialogs prompt the user for decisions or additional information required by the app to continue a
task. Such requests can range from simple Cancel/OK decisions to more complex layouts asking the
user to adjust settings or enter text.
diff --git a/docs/html/design/building-blocks/grid-lists.jd b/docs/html/design/building-blocks/grid-lists.jd
index 1a09ef551082aa294cbd3ac922aab5dc4a3e0ca7..6c9d2278b783c349b3d1a14da416dc746bb49442 100644
--- a/docs/html/design/building-blocks/grid-lists.jd
+++ b/docs/html/design/building-blocks/grid-lists.jd
@@ -11,7 +11,7 @@ page.tags="gridview","layout","listview"
-Grid lists are an alternative to standard list views. They are best suited for showing data sets
+
Grid lists are an alternative to standard list views. They are best suited for showing data sets
that represent themselves through images. In contrast to simple lists, grid lists may scroll either
vertically or horizontally.
diff --git a/docs/html/design/building-blocks/index.jd b/docs/html/design/building-blocks/index.jd
index e554775679156cf0fcf73eb2b1ee3262232a5edb..7fb0e553be37b62199bfdc0b7adf3ded168d006b 100644
--- a/docs/html/design/building-blocks/index.jd
+++ b/docs/html/design/building-blocks/index.jd
@@ -18,7 +18,8 @@ footer.hide=1
- Your inventory of ready-to-use elements for creating outstanding apps.
+ Your inventory of ready-to-use elements for creating
+ outstanding apps.
Tabs
diff --git a/docs/html/design/building-blocks/lists.jd b/docs/html/design/building-blocks/lists.jd
index 5514824b056b35f7e049a19b98037f528eb4f554..0bbd08bb50048ad0a6cb66f879e617569637b992 100644
--- a/docs/html/design/building-blocks/lists.jd
+++ b/docs/html/design/building-blocks/lists.jd
@@ -9,7 +9,7 @@ page.tags="listview","layout"
-Lists present multiple line items in a vertical arrangement. They can be used for data selection as
+
Lists present multiple line items in a vertical arrangement. They can be used for data selection as
well as drilldown navigation.
diff --git a/docs/html/design/building-blocks/pickers.jd b/docs/html/design/building-blocks/pickers.jd
index 6dd72ba06c22ca4f751fd0c60be423ba4127cf7d..9473d1106429aa239c8e2ba7026c7a661f375ecd 100644
--- a/docs/html/design/building-blocks/pickers.jd
+++ b/docs/html/design/building-blocks/pickers.jd
@@ -9,7 +9,7 @@ page.tags="datepicker","timepicker"
-Pickers provide a simple way to select a single value from a set. In addition to touching the
+
Pickers provide a simple way to select a single value from a set. In addition to touching the
up/down arrow buttons, it's possible to set the desired value from the keyboard or via a swipe
gesture.
diff --git a/docs/html/design/building-blocks/spinners.jd b/docs/html/design/building-blocks/spinners.jd
index c00b639b39fb7f565a5d2524778b9220e64440c0..cdc933b6d6094f8b02307a41538514bb1a63064e 100644
--- a/docs/html/design/building-blocks/spinners.jd
+++ b/docs/html/design/building-blocks/spinners.jd
@@ -9,7 +9,7 @@ page.tags="spinner","dropdown"
-Spinners provide a quick way to select one value from a set. In the default state, a spinner shows
+
Spinners provide a quick way to select one value from a set. In the default state, a spinner shows
its currently selected value. Touching the spinner displays a dropdown menu with all other available
values, from which the user can select a new one.
diff --git a/docs/html/design/building-blocks/switches.jd b/docs/html/design/building-blocks/switches.jd
index 74cab5ae21012cfd3c4786b508124bb2b8cf4c52..dff6c73d5841f4ecd20a938b982b819d92a65329 100644
--- a/docs/html/design/building-blocks/switches.jd
+++ b/docs/html/design/building-blocks/switches.jd
@@ -16,7 +16,7 @@ buttons, and on/off switches.
-Checkboxes allow the user to select multiple options from a set. Avoid using a single checkbox to
+
Checkboxes allow the user to select multiple options from a set. Avoid using a single checkbox to
turn an option off or on. Instead, use an on/off switch.
diff --git a/docs/html/design/building-blocks/tabs.jd b/docs/html/design/building-blocks/tabs.jd
index 5a5da5d8ad9706885eaeab79a24e197a49ee9f25..2186b181bc22b058c3143c0566cf4035bbce4074 100644
--- a/docs/html/design/building-blocks/tabs.jd
+++ b/docs/html/design/building-blocks/tabs.jd
@@ -11,7 +11,7 @@ page.tags="tabs","actionbar","navigation","viewpager"
-Tabs in the action bar make it easy to explore and switch between different views or functional
+
Tabs in the action bar make it easy to explore and switch between different views or functional
aspects of your app, or to browse categorized data sets.
For details on using gestures to move between tabs, see the Swipe Views pattern.
diff --git a/docs/html/design/building-blocks/text-fields.jd b/docs/html/design/building-blocks/text-fields.jd
index 383531b1adadf63e7cd605e5240af48da8bfe7cf..3840ca2808e27971c40949b08c46efa153e01ee2 100644
--- a/docs/html/design/building-blocks/text-fields.jd
+++ b/docs/html/design/building-blocks/text-fields.jd
@@ -9,7 +9,7 @@ page.tags="text","edittext","input"
-Text fields allow the user to type text into your app. They can be either single line or multi-line.
+
Text fields allow the user to type text into your app. They can be either single line or multi-line.
Touching a text field places the cursor and automatically displays the keyboard. In addition to
typing, text fields allow for a variety of other activities, such as text selection (cut, copy,
paste) and data lookup via auto-completion.
diff --git a/docs/html/design/get-started/creative-vision.jd b/docs/html/design/get-started/creative-vision.jd
index c57b185c701b94ea4f3cd43e4d78cafeafc48014..1ce305a5a64d0406832235266350778885e515c9 100644
--- a/docs/html/design/get-started/creative-vision.jd
+++ b/docs/html/design/get-started/creative-vision.jd
@@ -5,7 +5,12 @@ page.title=Creative Vision
-We focused the design of Android around three overarching goals, which apply to our core apps as well as the system at large. As you design apps to work with Android, consider these goals:
+
+ We focused the design of Android around three overarching goals, which apply
+ to our core apps as well as the system at large. As you design apps to work
+ with Android, consider these goals: Enchant me, Simplify my
+ life, and Make me amazing
+
diff --git a/docs/html/design/index.jd b/docs/html/design/index.jd
index 8f73d9ce0e8530d26f8dfe5ee2dc68220953d417..9ba32dd5236b69451aa1a03261eb18a8c2f3cedf 100644
--- a/docs/html/design/index.jd
+++ b/docs/html/design/index.jd
@@ -22,7 +22,8 @@ footer.hide=1
- Welcome to Android Design, your place for learning how to design exceptional Android apps.
+ Welcome to Android Design, your place for
+ learning how to design exceptional Android apps.
Want to know what Android 4.4 KitKat has for designers? See New in Android.
Creative Vision
diff --git a/docs/html/design/media/progress_download.png b/docs/html/design/media/progress_download.png
index 5c9e556569ecc5c55f80b3ad559bf1138ef45490..576509539502e85b3f7670d54934b013e6e9cec6 100644
Binary files a/docs/html/design/media/progress_download.png and b/docs/html/design/media/progress_download.png differ
diff --git a/docs/html/design/patterns/accessibility.jd b/docs/html/design/patterns/accessibility.jd
index 532900ecd80c54b07563e8c573200456dbd7a88e..aaa6f163ca2af130032a1db2fd33c97d3198637e 100644
--- a/docs/html/design/patterns/accessibility.jd
+++ b/docs/html/design/patterns/accessibility.jd
@@ -1,5 +1,6 @@
page.title=Accessibility
page.tags="accessibility","navigation","input"
+page.metaDescription=Design an app that's universally accessible to people with visual impairment, color deficiency, hearing loss, and limited dexterity.
@jd:body
diff --git a/docs/html/design/patterns/actionbar.jd b/docs/html/design/patterns/actionbar.jd
index b6e3a16563d269f1f770f167593445e67282fa50..a1adbd33b4a63c169e9fe5c355646c3121c32d0d 100644
--- a/docs/html/design/patterns/actionbar.jd
+++ b/docs/html/design/patterns/actionbar.jd
@@ -1,5 +1,6 @@
page.title=Action Bar
page.tags="actionbar","navigation"
+page.metaDescription=The Action bar is an essential design element for all apps. Learn about what the action bar can do and how to use it in your apps.
@jd:body
diff --git a/docs/html/design/patterns/compatibility.jd b/docs/html/design/patterns/compatibility.jd
index 5ca6d8b9e7929d6605f3eb9f4506be471e2e80ca..dfc52c0270fb2f75de884adebae6a7f4bc16cbbc 100644
--- a/docs/html/design/patterns/compatibility.jd
+++ b/docs/html/design/patterns/compatibility.jd
@@ -1,5 +1,6 @@
page.title=Backwards Compatibility
page.tags="support"
+page.metaDescription=Notes on how Android 4.x adapts UI designed for older hardware and OS versions.
@jd:body
diff --git a/docs/html/design/patterns/help.jd b/docs/html/design/patterns/help.jd
index ad5742d78757fd1fa8ac7393c69c6b3e25a2ed52..e47bc5a71bad023aeaa2deeaa6b02382de892fb2 100644
--- a/docs/html/design/patterns/help.jd
+++ b/docs/html/design/patterns/help.jd
@@ -6,7 +6,7 @@ page.tags="settings","preferences"
Some of your users will run into questions or problems along the way. They'll be looking for answers within your app, and if they don't find them quickly, they may leave and never come back.
-This page covers design patterns for making help accessible in your app and tips for creating help content for users who are eager for assistance.
+This page covers design patterns for making help accessible in your app and tips for creating help content for users who are eager for assistance.
Designing Help into Your App
diff --git a/docs/html/design/patterns/index.jd b/docs/html/design/patterns/index.jd
index 4416de1daa5badab80e57a572001a374b97d0367..e091a29ca5e8effa64403355fc3f25cd1e181a0a 100644
--- a/docs/html/design/patterns/index.jd
+++ b/docs/html/design/patterns/index.jd
@@ -18,7 +18,8 @@ footer.hide=1
- Design apps that behave in a consistent, predictable fashion.
+ Design apps that behave in a consistent, predictable
+ fashion.
New in Android
diff --git a/docs/html/design/patterns/multi-pane-layouts.jd b/docs/html/design/patterns/multi-pane-layouts.jd
index 06c81897a6b559bd627a2543e8737b954f226c16..6071ef3ccd9db24e4b160b4f268694e25afcc909 100644
--- a/docs/html/design/patterns/multi-pane-layouts.jd
+++ b/docs/html/design/patterns/multi-pane-layouts.jd
@@ -1,8 +1,8 @@
page.title=Multi-pane Layouts
page.tags="tablet","navigation","layout","fragment"
+page.metaDescription=Android devices come in many different screen sizes and types. Multi-pane layouts help you provide a balanced and aesthetically pleasing layout across the range of Android devices.
@jd:body
-
Developer Docs
@@ -10,9 +10,11 @@ page.tags="tablet","navigation","layout","fragment"
-When writing an app for Android, keep in mind that Android devices come in many different screen
-sizes and types. Make sure that your app consistently provides a balanced and aesthetically pleasing
-layout by adjusting its content to varying screen sizes and orientations.
+When writing an app for Android, keep in mind that Android devices
+come in many different screen sizes and types. Make sure that your app consistently provides a
+balanced and aesthetically pleasing layout by adjusting its content to varying screen sizes and
+orientations.
+
Panels are a great way for your app to achieve this. They allow you to combine multiple views into
one compound view when a lot of horizontal screen real estate is available and by splitting them up
when less space is available.
diff --git a/docs/html/design/patterns/navigation.jd b/docs/html/design/patterns/navigation.jd
index 6f2215a28b1d0a74993eb04bdb4d06c37ac05184..3e60f66fd8f87d113d48488b5663f9091467aee4 100644
--- a/docs/html/design/patterns/navigation.jd
+++ b/docs/html/design/patterns/navigation.jd
@@ -9,7 +9,7 @@ page.tags="navigation","activity","task","up navigation","back navigation"
-Consistent navigation is an essential component of the overall user experience. Few things frustrate
+
Consistent navigation is an essential component of the overall user experience. Few things frustrate
users more than basic navigation that behaves in inconsistent and unexpected ways. Android 3.0
introduced significant changes to the global navigation behavior. Thoughtfully following the
guidelines for Back and Up will make your app's navigation predictable and reliable for your users.
diff --git a/docs/html/design/patterns/notifications.jd b/docs/html/design/patterns/notifications.jd
index 80f1b0e201128a897057d1c5b8db66b1d7c0b1b1..41f9190271067dfe8adb2547cce0ee4838dc580d 100644
--- a/docs/html/design/patterns/notifications.jd
+++ b/docs/html/design/patterns/notifications.jd
@@ -8,7 +8,7 @@ page.title=Notifications
-The notification system allows your app to keep the user informed about events, such as new chat messages or a calendar event. Think of notifications as a news channel that alerts the user to important events as they happen or a log that chronicles events while the user is not paying attention.
+The notification system allows your app to keep the user informed about events, such as new chat messages or a calendar event. Think of notifications as a news channel that alerts the user to important events as they happen or a log that chronicles events while the user is not paying attention.
New in Jelly Bean
In Jelly Bean, notifications received their most important structural and functional update since the beginning of Android.
diff --git a/docs/html/design/patterns/selection.jd b/docs/html/design/patterns/selection.jd
index 973ffde9152d1940e4efcd616c043824a3c62cb6..d0ad8372fbda8fd0b2545f53cb563ff69358847b 100644
--- a/docs/html/design/patterns/selection.jd
+++ b/docs/html/design/patterns/selection.jd
@@ -35,9 +35,9 @@ the contextual action bar (CAB).
-Using the contextual action bar (CAB)
-The selection CAB is a temporary action bar that overlays your app's current action bar while data
-is selected. It appears after the user long presses on a selectable data item.
+Using the contextual action bar
+The contextual action bar (CAB) is a temporary action bar that overlays your app's current action bar while data
+is selected. It appears after the user long-presses on a selectable data item.
diff --git a/docs/html/design/patterns/settings.jd b/docs/html/design/patterns/settings.jd
index fa3e538c2c5c138540799674a8d7d451a2cc3082..7e0485f37a5cba958377ec72263c0199b559dc23 100644
--- a/docs/html/design/patterns/settings.jd
+++ b/docs/html/design/patterns/settings.jd
@@ -9,7 +9,7 @@ page.tags="preferences","sharedpreferences"
-Settings is a place in your app where users indicate their preferences for how your app should
+
Settings is a place in your app where users indicate their preferences for how your app should
behave. This benefits users because:
diff --git a/docs/html/design/patterns/swipe-views.jd b/docs/html/design/patterns/swipe-views.jd
index 4c9fb880ec713652a12a6148792a1a08a3d78acb..46d6ffb8c3afa3c1d0d53d5ffc19aaf86e24da9d 100644
--- a/docs/html/design/patterns/swipe-views.jd
+++ b/docs/html/design/patterns/swipe-views.jd
@@ -9,7 +9,7 @@ page.tags="viewpager","navigation","tabs"
-Efficient navigation is one of the cornerstones of a well-designed app. While apps are generally
+
Efficient navigation is one of the cornerstones of a well-designed app. While apps are generally
built in a hierarchical fashion, there are instances where horizontal navigation can flatten
vertical hierarchies and make access to related data items faster and more enjoyable. Swipe views
allow the user to efficiently move from item to item using a simple gesture and thereby make
diff --git a/docs/html/design/patterns/widgets.jd b/docs/html/design/patterns/widgets.jd
index 87ebbb9d47b30731e8d2e79ce27c952a116a548b..d08f178dda99747be897f85d0e3bf6253c3325a2 100644
--- a/docs/html/design/patterns/widgets.jd
+++ b/docs/html/design/patterns/widgets.jd
@@ -9,7 +9,7 @@ page.tags="appwidget","home"
-
Widgets are an essential aspect of home screen customization. You can imagine them as "at-a-glance" views of an app's most important data and functionality that is accessible right from the user's home screen. Users can move widgets across their home screen panels, and, if supported, resize them to tailor the amount of information within a widget to their preference.
+Widgets are an essential aspect of home screen customization. You can imagine them as "at-a-glance" views of an app's most important data and functionality that is accessible right from the user's home screen. Users can move widgets across their home screen panels, and, if supported, resize them to tailor the amount of information within a widget to their preference.
Widget types
As you begin planning your widget, think about what kind of widget you're trying to build. Widgets typically fall into one of the following categories:
diff --git a/docs/html/design/style/iconography.jd b/docs/html/design/style/iconography.jd
index fe4a3f9bcd226afc1cc4587c40835c12610054c4..4559f00a77b5ad1212dc82f93ae9a8b0c793f784 100644
--- a/docs/html/design/style/iconography.jd
+++ b/docs/html/design/style/iconography.jd
@@ -1,5 +1,7 @@
page.title=Iconography
page.tags="icons"
+meta.tags="icons, googleplay, listing, branding"
+page.titleFriendly=Guidelines for creating your app's icons
@jd:body
@@ -8,7 +10,7 @@ page.tags="icons"
An icon is a graphic that takes up a small portion of screen real estate and provides a quick,
intuitive representation of an action, a status, or an app.
-When you design icons for your app, it's important to keep in mind that your
+
When you design icons for your app, it's important to keep in mind that your
app may be installed on a variety of devices that offer a range of
pixel densities, as mentioned in
Devices
diff --git a/docs/html/design/style/index.jd b/docs/html/design/style/index.jd
index 74d085b759b05077488140d0bcbaaf9d641863ec..f88fdb8e6b74a8a690a67198fcdaccd528fe1d34 100644
--- a/docs/html/design/style/index.jd
+++ b/docs/html/design/style/index.jd
@@ -18,7 +18,8 @@ footer.hide=1
- Build visually compelling apps that look great on any device.
+ Build visually compelling apps that look great on any
+ device.
Devices and Displays
diff --git a/docs/html/develop/index.jd b/docs/html/develop/index.jd
index 61a98b7ad8a827a95f2772bdf1b9b1383a892137..3f88b9d57bbd12638a73c128a264063758eee104 100644
--- a/docs/html/develop/index.jd
+++ b/docs/html/develop/index.jd
@@ -3,6 +3,7 @@ page.title=Develop
header.hide=1
carousel=1
tabbedList=1
+excludeFromSuggestions=true
@jd:body