Android m new features behavior changes

Source: Internet
Author: User
Tags deprecated

1. Runtime Permissions

On your apps this target the M Preview release or higher, make sure to check for and request permissions at runtime. To determine if your app have 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.

2, Power-saving optimizations

If a device is unplugged and stationary with the screens off for a period of time, it goes into Doze /c1> mode where it attempts to keep the system in a sleep state.

The following restrictions apply to your apps while in Doze:

    • Network access is disabled, unless your apps receives a high priority Google Cloud Messaging tickle.
    • Wake locks is ignored.
    • Alarms scheduled AlarmManager with the class is disabled, except for Alarms so you ' ve set with the setAlarmClock() method and  AlarmManager.setAndAllowWhileIdle().
    • WiFi scans is not performed.
    • Syncs and jobs for your sync adapters and is not JobScheduler permitted to run.
3. APP Standby

With this preview, the system could determine that apps is idle when they is not in active use.  

4, adoptable Storage Devices

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 the preference in the android:installLocation manifest.

    • ContextMethods
      • getFilesDir()
      • getCacheDir()
      • getCodeCacheDir()
      • getDatabasePath()
      • getDir()
      • getNoBackupFilesDir()
      • getFileStreamPath()
      • getPackageCodePath()
      • getPackageResourcePath()
    • ApplicationInfoFields
      • dataDir
      • sourceDir
      • nativeLibraryDir
      • publicSourceDir
      • splitSourceDirs
      • splitPublicSourceDirs
5. Apache HTTP Client Removal

This preview removes support for the Apache HTTP client. The If your app is using the-client and targets Android 2.3 (API Level 9) or higher with the HttpURLConnection class instead. This API was more efficient because it reduces network use through transparent compression and response caching, and Minimi Zes power consumption. To continue using the Apache HTTP APIs, you must first declare the following compile-time dependency in your build.gradle file :

{
' Org.apache.http.legacy '
}
6, Audiomanager changes

Setting the volume directly or muting specific streams via The  Audiom Anager  class is no longer supported. The Setstreamsolo ()  method is deprecated, and you should call The  audiomanager.requestaudiofocus ()  method instead. Similarly, The  setstreammute ()  method is deprecated; instead, call the Audiomanager.adjuststreamvolume ()  method and pass in the direction Value  adjust_mute  or adjust_unmute .

7. Text Selection

When the users select text in your app, you can now display text selection actions such as Cut, Copy , and Paste in a floating toolbar

8. Android Keystore Changes

With this preview, the Android Keystore provider no longer supports DSA. ECDSA is still supported.

9. Wi-Fi and Networking changes

This preview introduces the following behavior changes to the Wi-Fi and networking APIs.

  • Your apps can now, the state of WifiConfiguration objects only if you created these objects. You aren't permitted to modify or delete WifiConfiguration objects created by the user or by other apps.
  • Previously, if an app forced the device to connect to a specific Wi-Fi network by usingenableNetwork()With thedisableAllOthers=truesetting, the device disconnected from other networks such as cellular data. In this preview, the device no longer disconnects from such and other networks. If your app ' s targetSdkVersion “20” is or lower, it's pinned to the selected Wi-Fi network. If your app's targetSdkVersion “21” or higher, use the Multinetwork APIs (such as openConnection() , bindSocket() , and The new ConnectivityManager.bindProcessToNetwork() method) to ensure the IT network traffic is sent on the selected network.
10. Camera Service Changes

In this preview, the model for accessing GKFX resources in the camera service have been changed from the previous "first Come, first serve "access model to an access model where high-priority processes is favored.  

11. Runtime

The ART runtime now properly implements access rules for thenewInstance() method. This change fixes a problem where Dalvik is checking access rules incorrectly in previous versions. If your app uses the newinstance ()  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 the latest versions of these libraries. Otherwise, make sure this any custom classes referenced from XML is updated so that their class constructors is Accessib Le.

This preview updates the behavior of the dynamic linker. The dynamic linker now understands the difference between a library's and its soname path (public bug 6670), and search by are now soname implemented. Apps which previously worked that has bad DT_NEEDED entries (usually absolute paths on the build machine ' s file syste m) may fail when loaded.

Thedlopen(3) RTLD_LOCALFlag is now correctly implemented. Note that RTLD_LOCAL is the default and so calls to that dlopen(3) didn ' t explicitly use'll be RTLD_LOCAL affected (unless your App explicitly used RTLD_GLOBAL ). RTLD_LOCAL with, symbols is not being made available to libraries loaded by later calls to dlopen(3) (as opposed to Being referenced by DT_NEEDED entries).

12. APK Validation

The platform now performs stricter validation of APKs. An apk is considered corrupt if a file was declared in the manifest and not present in the APK itself. An APK must is re-signed if any of the contents is removed.

13. USB Connection

Device connections through the USB port is 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.

14. Android for work changes

This preview includes the following behavior changes for Android:

  • work contacts in personal contexts.  the Google Dialer call Log now displays work contacts when the user views past C Alls. Setting  setcrossprofilecalleriddisabled ()  to  true  hides The work profiles contacts in the Google Dialer call Log. Work contacts can is displayed along with personal contacts to devices over Bluetooth only if you set  devicepolicymanager.setbluetoothcontactsharingdisabled ()  to  false . By default, it is set To  true .
  • WiFi configuration removal: WiFi configurations added by a profiles Owner (for example, through calls to the addNetwork() method) is now removed if T Hat work profiles is deleted.
  • WiFi configuration lockdown: Any WiFi configuration created to an active Device Owner can no longer is modified or deleted by the user if is Non-zero. The user can still create and modify their own WiFi configurations. Active Device Owners has the privilege of editing/removing any WiFi configurations, including those isn't created by them.< /c8>
  • Download work Policy controllers via Google account addition: When a Google account this requires management via a work Policy Controller (WPC) app was added to a device outside of A managed context, the Add account flow now prompts the user to the install the appropriate WPC. This behavior also applies-accounts added via Settings > Accounts and in the initial device setup W Izard.
  • changes to specific Devicepolicymanager API behaviors:
    • Calling the 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.
    • In addition, the method was now setKeyguardDisabledFeatures() available for Profiles Owners, as well as to Device Owners.
    • A profile Owner can set these Keyguard restrictions:
      • KEYGUARD_DISABLE_TRUST_AGENTS KEYGUARD_DISABLE_FINGERPRINT and, 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.
    • The and createAndInitializeUser() createUser() methods have been deprecated.
    • The setScreenCaptureDisabled() method now also blocks the assist structure when a app of the given user is in the foreground.
    • EXTRA_PROVISIONING_DEVICE_ADMIN_PACKAGE_CHECKSUMNow defaults to SHA-256. SHA-1 is still supported for backwards compatibility but would be removed in the future. EXTRA_PROVISIONING_DEVICE_ADMIN_SIGNATURE_CHECKSUM Now only accepts SHA-256.
    • Device initializer APIs which existed in the MNC preview is now removed. They won't appear in the final M release.
    • EXTRA_PROVISIONING_RESET_PROTECTION_PARAMETERSis removed so NFC bump provisioning cannot programmatically unlock a factory reset protected device.
    • Android for work APIs is optimized for M runtime permissions, including work profiles, assist layer, and others. New DevicePolicyManager permission APIs don ' t affect pre-m apps.
  • changesto other APIs:
    • The Data usage:the android.app.usage.NetworkUsageStats class has been renamed android.app.usage.NetworkStats .
  • changes to Global settings:
    • These settings can no longer be set via setGlobalSettings() :
      • BLUETOOTH_ON
      • DEVELOPMENT_SETTINGS_ENABLED
      • MODE_RINGER
      • NETWORK_PREFERENCE
      • WIFI_ON
    • These global settings can now is set via setGlobalSettings() :
      • WIFI_DEVICE_OWNER_CONFIGS_LOCKDOWN

Android m new features behavior changes

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.