First, the enhanced version of the low power consumption mode
Conditions: 1 unplugged power, 2 screen off, (N and 6.0 is the difference between n when the phone is not stationary can also enter low-power consumption mode)
Action process and mode: 1 charge status; 2 screen off for a certain time; Enter a low power limit: Shut down the network and postpone the CPU operation.
3 on the basis of the rest for a certain time: into the full low power consumption mode: Scanning Powermanager.wakelock, Alarmmanger, GPS, WiFi low power consumption settings.
Apps that are restricted during this period will perform their deferred job work at the window period after the interval.
Second, the background optimization
N removed three implicit broadcasts due to power consumption issues
1.connectivity_action
A single network switchover will cause most of the apps registered with the listener to wake up and process at the same time.
2.action_new_picture
3.acitong_new_video
A single photo recording will also cause all applications that register the listener to wake up.
How to modify:
1 foreground applications can use Broadcastreciver to monitor Connectivity_change on the main thread. Unable to receive connectivity_action.
2 cannot receive 2 32 broadcasts, in a timely version prior to n
Alternative scenarios:
Jobscheduler.
Iii. Change of permissions
The owner of the 1 file cannot relax the read and write permissions of its files.
Mode_world_readable/mode_world_writeable will throw SecurityException. (native file API can be used to modify, but Google strongly opposes)
2 Delivery Package domain File://URI may not be accessible. Sharing private files is recommended using Fileprovider.
3 The old version of setting the download location to a public location is still able to access its path using Column_location_filename, but strongly opposes it. Access to Downloadmanager exposed files should use Contentresolver.openfiledescriptor ().
Iv. sharing files between applications
n prohibits the application from exposing File://URI. To reach shared files between apps, use Fileprovider, send Content://uri, and grant temporary access.
Five, accessibility improvement
Does not have much effect on the code.
Six, Screen zoom
The system can set the screen density.
When device density changes:
1. Under 23 (including) The background process is automatically terminated (as with the system processing Oom), the foreground process will receive configurationchanged (as if the screen orientation has changed).
2. N-oriented will receive configurationchanged
This function basically does not need to change to be able to support, but should note:
1. Your app can run fully on a device with a width of SW320DP.
2. Note Your density-related cache resources, it is recommended to save the metadata of these resources to determine whether you need to refresh the data
3. Avoid using XP units as much as possible
7,890 visual settings in Settings, ndk,android for work, note retention
No use, no summary.
Xi. Other matters needing attention:
1 running applications for low-level API development on devices with N, the system still terminates the background process when density changes, and should be guaranteed to handle this situation properly, or the user recovering the app from the most recent usage record will cause a crash. Use the DDMS to terminate the process to simulate this condition for testing.
2.N or more applications can handle the density change normally, can change setting>display>font size and then resume the application in the recent record to test.
3. Fixed part of the main thread network request not exception bug
4.debug.startmethodtracing () output to a specific directory in the package name directory of the shared storage space, not required write_external_storage
5.Binder storage sending big data will trigger RuntimeException
6.View when the runnable task is not published in the window, the task is queued to be executed after attaching to the window.
On 7.N, delete_packages application calls Packageinstaller.uninstall () to return status_pending_user_action.
Android 7.0 Changes