标签:
On your apps that target the M Preview release or higher, make sure to check for and request permissions at runtime. To determine if your app has been granted a permission, call the new Context.checkSelfPermission()
method. To request a permission, call the new Activity.requestPermission()
method. Even if your app is not targeting the M Preview release, you should test your app under the new permissions model.
If a device is unplugged and left stationary with the screen off for a period of time, it goes into Doze mode where it attempts to keep the system in a sleep state.
The following restrictions apply to your apps while in Doze:
AlarmManager
class are disabled, except for alarms that you‘ve set with thesetAlarmClock()
method and AlarmManager.setAndAllowWhileIdle()
.JobScheduler
are not permitted to run.With this preview, the system may determine that apps are idle when they are not in active use.
With this preview, users can adopt external storage devices such as SD cards. Adopting an external storage device encrypts and formats the device to behave like internal storage. This feature allows users to move both apps and private data of those apps between storage devices. When moving apps, the system respects theandroid:installLocation
preference in the manifest.
Context
methods:
ApplicationInfo
fields:
This preview removes support for the Apache HTTP client. If your app is using this client and targets Android 2.3 (API level 9) or higher, use the HttpURLConnection
class instead. This API is more efficient because it reduces network use through transparent compression and response caching, and minimizes power consumption. To continue using the Apache HTTP APIs, you must first declare the following compile-time dependency in yourbuild.gradle
file:
android {
useLibrary ‘org.apache.http.legacy‘
}
Setting the volume directly or muting specific streams via the AudioManager
class is no longer supported. ThesetStreamSolo()
method is deprecated, and you should call the AudioManager.requestAudioFocus()
method instead. Similarly, the setStreamMute()
method is deprecated; instead, call theAudioManager.adjustStreamVolume()
method and pass in the direction value ADJUST_MUTE
orADJUST_UNMUTE
.
When users select text in your app, you can now display text selection actions such as Cut, Copy, and Paste in a floating toolbar
With this preview, the Android Keystore provider no longer supports DSA. ECDSA is still supported.
This preview introduces the following behavior changes to the Wi-Fi and networking APIs.
WifiConfiguration
objects only if you created these objects. You are not permitted to modify or delete WifiConfiguration
objects created by the user or by other apps.enableNetwork()
with the disableAllOthers=true
setting, the device disconnected from other networks such as cellular data. In this preview, the device no longer disconnects from such other networks. If your app’s targetSdkVersion
is “20”
or lower, it is pinned to the selected Wi-Fi network. If your app’s targetSdkVersion
is “21”
or higher, use the multinetwork APIs (such as openConnection()
, bindSocket()
, and the newConnectivityManager.bindProcessToNetwork()
method) to ensure that its network traffic is sent on the selected network.In this preview, the model for accessing shared resources in the camera service has been changed from the previous “first come, first serve” access model to an access model where high-priority processes are favored.
The ART runtime now properly implements access rules for the newInstance()
method. This change fixes a problem where Dalvik was checking access rules incorrectly in previous versions. If your app uses thenewInstance()
method and you want to override access checks, call the setAccessible()
method with the input parameter set to true
. If your app uses the v7 appcompat library or the v7 recyclerview library, you must update your app to use to the latest versions of these libraries. Otherwise, make sure that any custom classes referenced from XML are updated so that their class constructors are accessible.
This preview updates the behavior of the dynamic linker. The dynamic linker now understands the difference between a library’s soname
and its path ( public bug 6670), and search by soname
is now implemented. Apps which previously worked that have bad DT_NEEDED
entries (usually absolute paths on the build machine’s file system) may fail when loaded.
The dlopen(3) RTLD_LOCAL
flag is now correctly implemented. Note that RTLD_LOCAL
is the default, so calls todlopen(3)
that didn’t explicitly use RTLD_LOCAL
will be affected (unless your app explicitly used RTLD_GLOBAL
). With RTLD_LOCAL
, symbols will not be made available to libraries loaded by later calls to dlopen(3)
(as opposed to being referenced by DT_NEEDED
entries).
The platform now performs stricter validation of APKs. An APK is considered corrupt if a file is declared in the manifest but not present in the APK itself. An APK must be re-signed if any of the contents are removed.
Device connections through the USB port are now set to charge-only mode by default. To access the device and its content over a USB connection, users must explicitly grant permission for such interactions. If your app supports user interactions with the device over a USB port, take into consideration that the interaction must be explicitly enabled.
This preview includes the following behavior changes for Android for Work:
setCrossProfileCallerIdDisabled()
to true
hides the work profile contacts in the Google Dialer Call Log. Work contacts can be displayed along with personal contacts to devices over Bluetooth only if you set DevicePolicyManager.setBluetoothContactSharingDisabled()
to false
. By default, it is set to true
.addNetwork()
method) are now removed if that work profile is deleted.Settings.Global.WIFI_DEVICE_OWNER_CONFIGS_LOCKDOWN
is non-zero. The user can still create and modify their own WiFi configurations. Active Device Owners have the privilege of editing/removing any WiFi configurations, including those not created by them.setCameraDisabled()
method affects the camera for the calling user only; calling it from the managed profile doesn’t affect camera apps running on the primary user.setKeyguardDisabledFeatures()
method is now available for Profile Owners, as well as to Device Owners.KEYGUARD_DISABLE_TRUST_AGENTS
and KEYGUARD_DISABLE_FINGERPRINT
, which affect the keyguard settings for the profile’s parent user.KEYGUARD_DISABLE_UNREDACTED_NOTIFICATIONS
, which only affects notifications generated by applications in the managed profile.createAndInitializeUser()
and createUser()
methods have been deprecated.setScreenCaptureDisabled()
method now also blocks the assist structure when an app of the given user is in the foreground.EXTRA_PROVISIONING_DEVICE_ADMIN_PACKAGE_CHECKSUM
now defaults to SHA-256. SHA-1 is still supported for backwards compatibility but will be removed in future.EXTRA_PROVISIONING_DEVICE_ADMIN_SIGNATURE_CHECKSUM
now only accepts SHA-256.EXTRA_PROVISIONING_RESET_PROTECTION_PARAMETERS
is removed so NFC bump provisioning cannot programmatically unlock a factory reset protected device.DevicePolicyManager
permission APIs don‘t affect pre-M apps.android.app.usage.NetworkUsageStats
class has been renamedandroid.app.usage.NetworkStats
.setGlobalSettings()
:
BLUETOOTH_ON
DEVELOPMENT_SETTINGS_ENABLED
MODE_RINGER
NETWORK_PREFERENCE
WIFI_ON
setGlobalSettings()
:
WIFI_DEVICE_OWNER_CONFIGS_LOCKDOWN
标签:
原文地址:http://www.cnblogs.com/WalsonWang/p/4720094.html