Android 4.2 Jelly Bean

文章来源:http://developer.android.com/about/versions/jelly-bean.html

翻译参考:http://bbs.gfan.com/android-5443598-1-1.html

Welcome to Android 4.2, the latest version ofJelly Bean!

Android 4.2,Jelly Bean的最新版本,欢迎你!

Android 4.2 has performance optimizations, a refreshed system UI, and great new features for users and developers. This document provides a glimpse of what's new for developers.

See the Android 4.2 APIs document for a detailed look at the new developer APIs.

Android 4.2优化了性能,提供了新的系统UI,以及重要的新特性。本文粗略告诉开发人员在Android4.2中哪些是新的。想对新的API进行详细的了解,需要阅读Android 4.2 API文档。

Find out more about the new Jelly Bean features for users at www.android.com.

www.android.com上可以找到更多有关Jelly Bean新特性。

Faster, Smoother, More Responsive

更快,更顺畅,更敏捷


Android 4.2 builds on the performance improvements already included in Jelly Bean —vsync timing, triple buffering, reduced touch latency, and CPU input boost — and adds new optimizations that make Android even faster.

Android 4.2对性能进行了改进:vsync timing(时间垂直同步),triple buffering(三倍缓冲),reduced touch latency(消减触摸延迟),CPU input boost(CPU输入推进)。这些在Jelly Bean早已实现。还有一些别的新优化让安卓运行更快。

Improvements in the hardware-accelerated 2D renderer make common animations such as scrolling and swiping smoother and faster. In particular, drawing is optimized for layers, clipping and certain shapes (rounded rects, circles and ovals).

硬件加速2D渲染的提高使得诸如scrolling和swiping等动画更流畅快速。尤其在绘制上的优化表现在对图层、剪辑和图形的处理。图形包括圆矩形,圆,曲线。

A variety of WebView rendering optimizations make scrolling of web pages smoother and free from jitter and lags.

各种WebView渲染优化使得网页scrolling更流畅以及避免jitter和lags。

Android’s Renderscript Compute is the first computation platform ported to run directly on a mobile device GPU. It automatically takes advantage of GPU computation resources whenever possible, dramatically improving performance for graphics and image processing. Any app using Renderscript on a supported device can benefit immediately from this GPU integration without recompiling.

首个计算平台,Android渲染脚本计算,直接运行在移动设备GPU上。利用GPU计算资源,大大提高了处理图形图像的性能。在支持的设备上,所有采用了渲染脚本技术的app从未重编译的GPU整合中获益。

10-inch tablet running Android 4.2

Refined, refreshed UI

精细全新的UI


Android 4.2 refines the Jelly Bean user experience and brings familiar Android UI patterns such as status bar, system bar, and notifications window to all tablets.

Android4.2精致了Jelly Bean的用户体验,并将诸如状态栏、系统栏、通知窗口等熟悉的android-UI-patterns引进到平板电脑。

All screen sizes now feature the status bar on top, with pull-down access to notifications and a new Quick Settings menu. The familiar system bar appears on the bottom, with buttons easily accessible from either hand. The Application Tray is also available on all screen sizes.

任何大小的屏幕都将状态栏放在屏幕的顶部。下拉状态栏可以切换到通知和快捷设置菜单。熟悉的系统栏出现在屏幕的底部。系统栏上的按钮容易访问。任何大小的屏幕都可以访问application-tray。

One tablet, many users

一个平板电脑,多个用户


Now several users can share a single Android tablet, with each user having convenient access to a dedicated user space. Users can switch to their spaces with a single touch from the lock screen.

现在多个用户可以共享一个安卓平板。每个用户很方便就可以访问专用的用户空间。只需要触摸一下锁屏,用户就可以切换到别的空间。

On a multiuser device, Android gives each user a separate environment, including user-specific emulated SD card storage. Users also have their own homescreens, widgets, accounts, settings, files, and apps, and the system keeps these separate. All users share core system services, but the system ensures that each user's applications and data remain isolated. In effect, each of the multiple users has his or her own Android device.

在多用户设备上,android分配给每个用户独立的环境,包括用户特定的虚拟SD卡存储。每个用户有自己的主屏, widgets, 帐户, 设置, 文件, 应用,系统保证它们之间相互独立。所有用户共享核心系统服务,系统保证隔离每个用户的应用和数据。最终效果是,每个用户拥有自己的android设备。

Users can install and uninstall apps at any time in their own environments. To save storage space, Google Play downloads an APK only if it's not already installed by another user on the device. If the app is already installed, Google Play records the new user's installation in the usual way but doesn't download another copy of the app. Multiple users can run the same copy of an APK because the system creates a new instance for each user, including a user-specific data directory.

用户能够在自己的环境中安装和卸载应用。为了节省存储空间,只有其他用户没有在设备上安装应用时,Google-Play才去下载应用APK。当应用已经安装过,Google-Play只会记录新用户的安装操作,不会去下载应用副本。多个用户能够运行相同的APK,系统会为每个用户创建实例,以及用户特定的数据字典。

For developers, multi-user support is transparent — your apps do not need to do anything special to run normally in a multi-user environment and there are no changes you need to make in your existing or published APKs. The system manages your app in each user space just as it does in a single-user environment.

对于开发者而言,多用户支持是透明的。应用程序不用因为将运行在多用户环境中而去做额外的事情。已经存在或发布的APK不用做任何修改。系统管理应用时,会将每个用户空间当作单用户环境那样来对待。

New ways to engage users

让用户参与进来的新方法


Calendar lock screen widget

You can extend app widgets to run on the lock screen, for instant access to your content.

扩展app-widget,让它们运行在在锁屏上,然后可以访问数据。

Lock screen widgets

In Android 4.2, users can place app widgets directly on their lock screens, for instant access to favorite app content without having to unlock. Users can add as many as five lock screen widgets, choosing from widgets provided by installed apps. The lock screen displays each widget in its own panel, letting users swipe left and right to view different panels and their widgets.

Android4.2中,用户能够直接将app-widget放在锁屏上,在不用解锁的情况下,就可以访问用户喜欢的应用。用户最多能够从已安装的widget中,选择5个添加为锁屏widget。在锁屏上,每个widget显示在自己的panel中,用户swipe-left或swipe-right就可以看到不同的panel以及他们的widget。

Like all app widgets, lock screen widgets can display any kind of contentand they can accept direct user interaction. They can be entirely self-contained, such as a widget that offers controls to play music, or they can let users jump straight to an Activity in your app, after unlocking along the way as needed.

与所有app-widget类似,锁屏widget能够显示任何种类的内容,并与用户进行直接交互。它们能完全self-contained。例如,在必要的解锁之后,控制音乐播放的widget可以直接跳转到应用中的Activity。

For developers, lock screen widgets offer a great new way to engage users. They let you put your content in front of users in a location they’ll see often, and they give you more opportunities to bring users directly into your app.

对开发者来说,锁屏widget提供了一个吸引用户的崭新方式。锁屏widget让应用内容显示在用户最常见的位置。你的应用将会有更多的机会被用户使用。

You can take advantage of this new capability by building a new app widget or by extending an existing home screen widget. If your app already includes home screen widgets, you can extend them to the lock screen with minimal change. To give users an optimal experience, you can update the widget to use the full lock screen area when available and resize when needed on smaller screens. You can also add features to your widgets that might be especially useful or convenient on the lock screen.

为了利用这个新特性,你可以新建一个app-widget或扩展一个已经存在的主屏widget。假如app已经含有主屏widget,那么扩展之并做很小的修改,就能够支持锁屏widget。为了给用户提供最佳体验,可以更新widget。如果允许,那就使用全部锁屏区域。如果在小屏幕上,那就调整大小。在widget中添加特性,能够让widget在锁屏上特别实用或方便。

Daydream

Daydream is an interactive screensaver mode that starts when a user’s device is docked or charging. In this mode, the system launches a daydream — a remote content service provided by an installed app — as the device screensaver. A user can enable Daydream from the Settings app and then choose the daydream to display.

Daydreams combine the best capabilities of live wallpapers and home screen widgets, but they are more powerful. They let you offer the any kind of content in a completely new context, with user interactions such as flipping through photos, playing audio or video, or jumping straight into your app with a single touch.

Because daydreams can start automatically when a device is charging or docked, they also give your app a great way to support new types of user experiences, such as leanback or exhibition mode, demo or kiosk mode, and "attract mode" — all without requiring special hardware.

Daydream screensaver mode

Daydream lets you create powerful interactive screensavers that display any kind of content.

Daydreams are similar to Activities and can do anything that Activity can do — from rendering a UI hierarchy (without using RemoteViews) to drawing directly using Canvas, OpenGL, SurfaceTexture, and more. They can play video and audio and they can even accept direct user interaction. However, daydreams are not Activities, so they don’t affect the backstack or appear in Recents and they cannot be launched directly from your app.

Implementing a daydream is straightforward and you can take advantage of UI components and resources that you’ve already created for other parts of your app. You can provide multiple daydreams in your app and you can offer distinct content and display settings for each.

External display support

扩展显示支持


Android 4.2 introduces platform support for external displays that goes far beyond mirroring — apps can now target unique content to any one or multiple displays that are attached to an Android device. Apps can build on this to deliver new kinds of interaction and entertainment experiences to users.

Android4.2引进平台支持扩展显示。扩展显示远远超出镜像。应用可以输出独特的内容到任何一个或多个安卓设备的显示器上。应用能传递给用户新种类的交互和娱乐体验。

Display manager

显示管理

Apps interact with displays through a new display manager system service. Your app can enumerate the displays and check the capabilities of each, including size, density, display name, ID, support for secure video, and more. Your app can also receive callbacks when displays are added or removed or when their capabilities change, to better manage your content on external displays.

应用通过“显示管理系统服务”来和显示器交互。应用能列举出显示器,检查每个显示器的参数,包括:尺寸、密度、显示名称,ID,对安全视频的支持,其他。当显示器接入或拔除,或参数改变时,应用能够收到回调通知,由此可以更好地管理扩展显示的内容。

Presentation window

显示窗口

To make it easy to show content on an external display, the framework provides a new UI object called a Presentation — a type of dialog that represents a window for your app’s content on a specific external display. Your app just gives the display to use, a theme for the window, and any unique content to show. The Presentation handles inflating resources and rendering your content according to the characteristics of the targeted display.

为了容易显示内容到扩展显示器上,framework提供了一个叫做Presentation的UI对象。它是一种对话框,在扩展显示器上表现为应用内容的一个窗口。应用只需一个显示器,一个窗口主题,以及独特的内容。Presentation处理inflate资源,根据目标显示器渲染内容。

You can take full control of two or more independent displays using Presentation.

Presentation能够用来完全控制两个或多个不同的显示器。

A Presentation gives your app full control over the remote display window and its content and lets you manage it based on user input events such as key presses, gestures, motion events, and more. You can use all of the normal tools to create a UI and render content in the Presentation, from building an arbitrary view hierarchy to using SurfaceView or SurfaceTexture to draw directly into the window for streamed content or camera previews.

Presentation提供完全控制远程显示窗口,并且让用户通过key-press事件,gesture事件,motion事件等来管理。

Preferred display selection

首选显示选择

When multiple external displays are available, you can create as many Presentations as you need, with each one showing unique content on a specific display. In many cases, you might only want to show your content on a single external display — but always on the that’s best for Presentation content. For this, the system can help your app choose the best display to use.

当多个扩展显示器可用时,你可以创建任意多个Presentation,每个Presentation显示独特内容到特定的显示器上。在很多场合,只需显示内容在single扩展显示器上,即最适合显示此内容的显示器。这个时候,系统能够帮助应用选择最佳显示器。

To find the best display to use, your app can query the display manager for the system’s preferred Presentation displayand receive callbacks when that display changes. Alternatively, you can use the media router service, extended in Android 4.2, to receive notifications when a system video route changes. Your app can display content by default in the main Activity until a preferred Presentation display is attached, at which time it can automatically switch to Presentation content on the preferred display. Your apps can also use media router’s MediaRouteActionProvider and MediaRouteButton to offer standard display-selection UI.

为了找出最佳显示器,应用查询display-manager,找出系统首选Presentation显示器。当显示器发生改变时,应用收到回调。作为选择,当视频路由改变时,可以使用media路由服务,Android4.2的扩展,来接收通知。应用默认显示内容在主Activity中。当首选Presentation显示器被接入时,应用能自动切换,在首选显示器Presentation内容。应用还可以使用media路由MediaRouteActionProvider和MediaRouteButton来提供标准display-selection-UI。

Protected content

内容保护

For apps that handle protected or encrypted content, the display API now reports the secure video capabilities of attached displays. Your app query a display to find out if it offers a secure video output or provides protected graphics buffers and then choose the appropriate content stream or decoding to make the content viewable. For additional security on SurfaceView objects, your app can set a secure flag to indicate that the contents should never appear in screenshots or on a non-secure display output, even when mirrored.

对处理保护内容/加密内容的应用来说,display-API会报告已接入显示器的安全视频性能。应用查询显示器是否提供了安全视频输出或图像缓存保护,然后选择合适的内容stream或解码保证内容可见。对于SurfaceView的额外安全来说,应用可以设置安全flag来指示,内容永远不再以screenshot方式出现或者非安全显示输出。

Wireless display

无线显示

Starting in Android 4.2, users on supported devices can connect to an external display over Wi-Fi, using Miracast, a peer-to-peer wireless display standard created by the Wi-Fi Alliance. When a wireless display is connected, users can stream any type of content to the big screen, including photos, games, maps, and more.

从Android4.2开始,用户可以经由Miracast,通过wifi来连接扩展显示器。Miracast是wifi联盟定义的对等无线显示标准。当无线显示连接,用户可以将任何类型的内容,包括图片,游戏,地图等,stream到大屏幕上。

Apps can take advantage of wireless displays in the same way as they do other external displays and no extra work is needed. The system manages the network connection and streams your Presentation or other app content to the wireless display as needed.

应用利用无线显示,像操作其他扩展显示器一样,无需额外的工作。系统管理着网络连接,并将Presentation或其他应用内容stream到无线设备上。

Native RTL support

本地RTL(Right-to-Left)支持


RTL layout mirroring

Developers can now mirror their layouts for RTL languages.

开发者可以mirror布局来满足RTL语言。

Android 4.2 introduces full native support for RTL (right-to-left) layouts, including layout mirroring. With native RTL support, you can deliver the same great app experience to all of your users, whether their language uses a script that reads right-to-left or one that reads left-to-right.

Android4.2引进完全本地支持RTL布局,包括layout-mirroring。借助于本地RTL支持,可以发布应用给所有使用RLT语言或者LTR语言的用户。

When the user switches the system language to a right-to-left script, the system now provides automatic mirroring of app UI layouts and all view widgets, in addition to bidi mirroring of text elements for both reading and character input.

当用户切换系统语言到RTL脚本时,系统bidi-mirror文本元素,还自动mirror应用的UI布局和所有view-widget。

Your app can take advantage of RTL layout mirroring in your app with minimal effort. If you want the app to be mirrored, you simply declare a new attribute in your app manifest and change all "left/right" layout properties to new "start/end" equivalents. The system then handles the mirroring and display of your UI as appropriate.

利用RTL-layout-mirror技术可以达到最小的工作量。如果系统应用进行mirror操作,只需在应用manifest中声明一个新属性,并且将所有布局文件中的left/right改成start/end,然后系统就会处理mirror和适当显示。

For precise control over your app UI, Android 4.2 includes new APIs that let you manage layout direction, text direction, text alignment, gravity, and locale direction in View components. You can even create custom versions of layout, drawables, and other resources for display when a right-to-left script is in use.

对精确控制应用UI来说,Android4.2包括new-API来管理layout-direction, text-direction, text-alignment, gravity以及locale-direction。当RTL脚本运用时,你可以创建layout, drawables, 和其他需要显示的资源的定制版本。

To help you debug and optimize your custom right-to-left layouts, the HierarchyViewer tool now lets you see start/end properties, layout direction, text direction, and text alignment for all the Views in the hierarchy.

对debug或optimize定制RTL布局来说,HierarchyViewer工具允许查看hierarchy中所有view的start/end属性, layout-direction, text-direction, text-alignment。

Enhancements for international languages

国际语言增强


Android 4.2 includes a variety of font and character optimizations for international users:

对于国际用户,Android4.2包括各种字体字符优化:

  • For Korean users, a new font choice is available — Nanum (나눔글꼴) Gothic, a unicode font designed especially for the Korean-language script.
  • 对于韩国用户,新字体Nanum-Gothic可供选择。它是unicode字体专门为韩语设计。
  • Improved support for Japanese vertical text displayed in WebViews.
  • 日语在网页上的垂直文本的支持有提高。
  • Improved font kerning and positioning for Indic, Thai, Arabic, and Hebrew default fonts.
  • 印度语,泰语,阿拉伯语,希伯来语等的字距调整和定位有提高。

The default Android keyboard also includes an updated set of dictionaries:

默认的Android键盘包括了一个更新的字典集:

  • Improved dictionaries for French (with bigram support), English, and Russian
  • 法语,英语,俄语有了改良的字典。
  • New dictionaries for Danish, Greek, Finnish, Lithuanian, Latvian, Polish, Slovenian, Serbian, Swedish, Turkish
  • 丹麦,希腊,芬兰,立陶宛,拉脱维亚,波兰,斯洛文尼亚,塞尔维亚,瑞典,土耳其语有了新字典。

New ways to create beautiful UI

创建漂亮UI的新方法


Nested Fragments

嵌套Fragments

For more control over your UI components and to make them more modular, Android 4.2 lets you nest Fragments inside of Fragments. For any Fragment, a new Fragment manager lets you insert other Fragments as child nodes in the View hierarchy.

为了更好控制UI组件并使其更模块化,Android4.2允许在Fragment中内嵌Fragment。内嵌的Fragment在view-hierarchy中称为子节点。

You can use nested Fragments in a variety of ways, but they are especially useful for implementing dynamic and reusable UI components inside of a UI component that is itself dynamic and reusable. For example, if you use ViewPager to create fragments that swipe left and right, you can now insert fragments into each Fragment of the view pager.

可以使用各种方法来嵌套Fragment,但是尤其有用的是,在UI组件内部实现动态可重用的UI组件。例如,使用ViewPager控件创建一个支持左右滑动的Fragment,这时你可以在每个Fragment中再内嵌Fragment。

To let you take advantage of nested Fragments more broadly in your app, this capability is added to the latest version of the Android Support Library.

为了在应用中更广泛地利用嵌套Fragment,这个功能点已经加入到Android支持库的最新版本当中。

Accessibility


The system now helps accessibility services distinguish between touch exploration and accessibility gestures while in touch-exploration mode. When a user touches the screen, the system notifies the service that a generic touch interaction has started. It then tracks the speed of the touch interaction and determines whether it is a touch exploration (slow) or accessibility gesture (fast) and notifies the service. When the touch interaction ends, the system notifies the service.

当处于touch-exploration模式下,系统帮助accessibility-service在touch-exploration和accessibility-gestures之间识别。当用户触屏屏幕时,系统通知service一个通用的触摸交互已经开始。它然后跟踪触屏交互的速度,辨别是touch-exploration还是accessibiligy-gesture,并且通知service。当触摸交互结束,系统通知service。

The system provides a new global accessibility option that lets an accessibility service open the Quick Settings menu based on an action by the user. Also added in Android 4.2 is a new accessibility feedback type for Braille devices.

系统提供崭新的全局accessibility选项,允许accessibiligy服务依据用户的一个动作打开Quick-Setting菜单。在Android4.2中,它是针对于braille-devices的崭新的accessibility-feedback类型。

To give accessibility services insight into the meaning of Views for accessibility purposes, the framework provides new APIs for associating a View as the label for another View. The label for each View is available to accessibility services through AccessibilityNodeInfo.

为了深入了解accessbility,Framework提供new-API,将一个view作为另一个view的标签。通过AccessibilityNodeInfo,accessibility服务可以获取每个view的标签。

Improved Camera with HDR

相机HDR支持(High Dynamic Range)


Android 4.2 introduces a new camera hardware interface and pipeline for improved performance. On supported devices, apps can use a new HDR camera scene mode to capture an image using high dynamic range imaging techniques.

Android4.2引进新相机硬件接口和管道以改进性能。在支持的设备上,应用使用新HDR相机场景模式,使用高动态范围图像技术来扑捉图像。

Additionally, the framework now provides an API to let apps check whether the camera shutter sound can be disabled. Apps can then let the user disable the sound or choose an alternative sound in place of the standard shutter sound, which is recommended.

另外,Fragment提供API,允许应用check是否可以禁用相机shutter声音。应用准许用户禁用声音,或者其他声音来替换标准的shutter声音。

PS:HDR技术压制强光部分不至于过曝光,弱光部分层次有一定提升。

Renderscript Computation

渲染脚本计算


In Android 4.2, Renderscript Compute introduces new scripting features, new optimizations, and direct GPU integration for the highest performance in computation operations.

在Android4.2中,渲染脚本计算引进新脚本特性,新优化处理,直接整合了GPU以在计算操作中达到高性能。

Filterscript

Filterscript is a subset of Renderscript that is focused on optimized image processing across a broad range of device chipsets. Developers can write their image processing operations in Filterscript using the standard Renderscript runtime API, but within stricter constraints that ensure wider compatibility and improved optimization across CPUs, GPUs, and DSPs.

Filter脚本是Render脚本的一个子集,关注于通过广范围设备芯片集来优化图像处理过程。开发者使用标准的渲染脚本运行时API,将图像处理操作写入Filter脚本。严格限制条件下,确保功能,以及通过CPU, GPU, DSP来提高优化。

Filterscript is ideal for hardware-accelerating simple image-processing and computation operations such as those that might be written for OpenGL ES fragment shaders. Because it places a relaxed set of constraints on hardware, your operations are optimized and accelerated on more types of device chipsets. Any app targeting API level 17 or higher can make use of Filterscript.

Filter脚本理想应用于,硬件加速简单的图像处理和计算操作。例如,写入OpenGL-ES-Fragment图形。因为它将一套轻松的限制放入硬件,操作会在更多种类设备芯片集上优化和加速。level-17及大于17的API能用上Filter脚本。

Script intrinsics

脚本内联函数

In Android 4.2, Renderscript adds support for a set of script intrinsics — pre-implemented filtering primitives that are accelerated to reduce the amount of code that you need to write and to ensure that your app gets the maximum performance gain possible.

在Android4.2中,Render脚本支持一套脚本内联函数。它们预实现加速的filtering-primitives,消减了需要编写code的总量,确保应用获取最大性能。

Intrinsics are available for blends, blur, color matrix, 3x3 and 5x5 convolve, per-channel lookup table, and converting an Android YUV buffer to RGB.

内联函数可用于混合,模糊,彩色矩阵,3x3和5x5 convolve, per-channel lookup table, 将安卓YUV缓存转换为RGB。

Script groups

脚本组

You can now create groups of Renderscript scripts and execute them all with a single call as though they were part of a single script. This allows Renderscript to optimize execution of the scripts in ways that it could not do if the scripts were executed individually.

创建几组渲染脚本,一起执行。这个允许渲染脚本优化脚本的执行。如果脚本单独执行,那就达不到这个效果。

Renderscipt optimizations chart

Renderscript image-processing benchmarks run on different Android platform versions (Android 4.0, 4.1, and 4.2) in CPU only on a Galaxy Nexus device.

Renderscript image-processing benchmarks comparing operations run with GPU + CPU to those run in CPU only on the same Nexus 10 device.

If you have a directed acyclic graph of Renderscript operations to run, you can use a builder class to create a script group defining the operations. At execution time, Renderscript optimizes the run order and the connections between these operations for best performance.

Ongoing optimization improvements

When you use Renderscript for computation operations, you apps benefit from ongoing performance and optimization improvements in the Renderscript engine itself, without any impact on your app code or any need for recompilation.

As optimization improves, your operations execute faster and on more chipsets, without any work on your part. The chart at right highlights the performance gain delivered by ongoing Renderscript optimization improvements across successive versions of the Android platform.

GPU Compute

Renderscript Compute is the first computation platform ported to run directly on a mobile device GPU. It now automatically takes advantage of GPU computation resources whenver possible to improve performance. With GPU integration, even the most complex computations for graphics or image processing can execute with dramatically improved performance.

Any app using Renderscript on a supported device can benefit immediately from this GPU integration, without recompiling. The Nexus 10 tablet is the first device to support this integration.

New built-in developer options


The Android 4.2 system includes a variety of new developer options that make it easier to create great looking apps that perform well. The new options expose features for debugging and profiling your app from any device or emulator.

On devices running Android 4.2, developer options are hidden by default, helping to create a better experience for users. You can reveal the developer options at any time by tapping 7 times on Settings > About phone > Build number on any compatible Android device.

New developer options give you more ways to profile and debug on a device.

New developer options in Android 4.2 include:

  • Take bug report — immediately takes a screen shot and dumps device state information to local file storage, then attaches them to a new outgoing email message.
  • Power menu bug reports — Adds a new option to the device power menu and quick settings to take a bug report (see above).
  • Verify apps over usb — Allows you to disable app checks for sideloading apps over USB, while still checking apps from other sources like the browser. This can speed up the development process while keeping the security feature enabled.
  • Show hardware layers updates — Flashes hardware layers green when they update.
  • Show GPU overdraw — Highlights GPU overdraw areas.
  • Force 4x MSAA — Enables 4x MSAA in Open GL ES 2.0 apps.
  • Simulate secondary displays — Creates one or more non-secure overlay windows on the current screen for use as a simulated remote display. You can control the simulated display’s size and density.
  • Enable OpenGL traces — Lets you trace OpenGL execution using Logcat, Systrace, or callstack on glGetError.

New Platform Technologies


Android 4.2 includes a variety of new and enhanced platform technologies to support innovative communications use-cases across a broad range of hardware devices. In most cases, the new platform technologies and enhancements do not directly affect your apps, so you can benefit from them without any modification.

Security enhancements

Every Android release includes dozens of security enhancements to protect users. Here are some of the enhancements in Android 4.2:

  • Application verification — Users can choose to enable “Verify Apps" and have applications screened by an application verifier, prior to installation. App verification can alert the user if they try to install an app that might be harmful; if an application is especially bad, it can block installation.
  • More control of premium SMS — Android will provide a notification if an application attempts to send SMS to a short code that uses premium services which might cause additional charges. The user can choose whether to allow the application to send the message or block it.
  • Always-on VPN — VPN can be configured so that applications will not have access to the network until a VPN connection is established. This prevents applications from sending data across other networks.
  • Certificate Pinning — The libcore SSL implementation now supports certificate pinning. Pinned domains will receive a certificate validation failure if the certificate does not chain to a set of expected certificates. This protects against possible compromise of Certificate Authorities.
  • Improved display of Android permissions — Permissions have been organized into groups that are more easily understood by users. During review of the permissions, the user can click on the permission to see more detailed information about the permission.
  • installd hardening — The installd daemon does not run as the root user, reducing potential attack surface for root privilege escalation.
  • init script hardening — init scripts now apply O_NOFOLLOW semantics to prevent symlink related attacks.
  • FORTIFY_SOURCE — Android now implements FORTIFY_SOURCE. This is used by system libraries and applications to prevent memory corruption.
  • ContentProvider default configuration — Applications which target API level 17 will have “export” set to “false” by default for each ContentProvider, reducing default attack surface for applications.
  • Cryptography — Modified the default implementations of SecureRandom and Cipher.RSA to use OpenSSL. Added SSLSocket support for TLSv1.1 and TLSv1.2 using OpenSSL 1.0.1
  • Security Fixes — Upgraded open source libraries with security fixes include WebKit, libpng, OpenSSL, and LibXML. Android 4.2 also includes fixes for Android-specific vulnerabilities. Information about these vulnerabilities has been provided to Open Handset Alliance members and fixes are available in Android Open Source Project. To improve security, some devices with earlier versions of Android may also include these fixes.
New Bluetooth stack

Android 4.2 introduces a new Bluetooth stack optimized for use with Android devices. The new Bluetooth stack developed in collaboration between Google and Broadcom replaces the stack based on BlueZ and provides improved compatibility and reliability.

Low-latency audio

Android 4.2 improves support for low-latency audio playback, starting from the improvements made in Android 4.1 release for audio output latency using OpenSL ES, Soundpool and tone generator APIs. These improvements depend on hardware support — devices that offer these low-latency audio features can advertise their support to apps through a hardware feature constant. New AudioManager APIs are provided to query the native audio sample rate and buffer size, for use on devices which claim this feature.

New camera hardware interface

Android 4.2 introduces a new implementation of the camera stack. The camera subsystem includes the implementations for components in the camera pipeline such as burst mode capture with processing controls.

New NFC hardware interface and controller interface

Android 4.2 introduces support for controllers based on the NCI standard from the NFC-Forum. NCI provides a standard communication protocol between an NFC Controller (NFCC) and a device Host, and the new NFC stack developed in collaboration between Google and Broadcom supports it.

Dalvik runtime optimizations

The Dalvik runtime includes enhancements for performance and security across a wider range of architectures:

  • x86 JIT support from Intel and MIPS JIT support from MIPS
  • Optimized garbage-collection parameters for devices with > 512MB
  • Default implementations of SecureRandom and Cipher.RSA now use OpenSSL
  • SSLSocket support for TLSv1.1 and TLSv1.2 via OpenSSL 1.0.1
  • New intrinsic support for StrictMath methods abs, min, max, and sqrt
  • BouncyCastle updated to 1.47
  • zlib updated to 1.27
  • dlmalloc updated to 2.8.6

posted on 2013-06-14 19:01  勤修  阅读(935)  评论(0)    收藏  举报

导航