Why Google play services not included in Doze mode


Question

I'm using Nexus 5 and 6P, Android 6 having a feature called "Battery optimization mode" or Doze mode (in short). It is allowing apps not to run, if they aren't used to avoid battery consumption.



Google play services consumes more battery, RAM and CPU. But it is not included in Doze mode.



I've sent multiple feedback from my devices about this issue, but Google is not hearing at all.



Anyone please help me clarify, Why Google play services not included in Doze mode?


Answer

Google Play services is excluded because Google wants it so. It has to remained excluded from Doze or any power saving mode because apps depending upon Google Cloud Messaging (GCM) may fail to serve the user appropriately, hence, ruining the user's experience with Android big time. A GCM Android Client requires Play Store and Play services installed in Android device.



Anyhow, here's the brief reason: in the file /system/etc/sysconfig/google.xml, other than the usage policy of the file it is noted:




<!-- These are configurations that must exist on all GMS devices. -->
<config>
<!-- These are the standard packages that are white-listed to always have internet
access while in power save mode, even if they aren't in the foreground.
-->

<!-- GmsCore must always have network access for GCM and other things. -->
<allow-in-power-save package="com.google.android.gms" />

<!-- Play Store likewise must have network access to support other applications. -->
<allow-in-power-save-except-idle package="com.android.vending" />


where,




  • com.google.android.gms : package name of Google Play services

  • com.android.vending: package name of Google Play Store



I cannot precisely speak of what counts as other things. My educated guess is the APIs made available through Play Services. Refer to Table 1. here to see the list of those APIs.



Note: it is beyond the scope of this answer or the question itself why Google decided to keep Play Services and Store always excluded from power saving features of Android instead of finding and implementing a hybrid path.


Topics


2D Engines   3D Engines   9-Patch   Action Bars   Activities   ADB   Advertisements   Analytics   Animations   ANR   AOP   API   APK   APT   Architecture   Audio   Autocomplete   Background Processing   Backward Compatibility   Badges   Bar Codes   Benchmarking   Bitmaps   Bluetooth   Blur Effects   Bread Crumbs   BRMS   Browser Extensions   Build Systems   Bundles   Buttons   Caching   Camera   Canvas   Cards   Carousels   Changelog   Checkboxes   Cloud Storages   Color Analysis   Color Pickers   Colors   Comet/Push   Compass Sensors   Conferences   Content Providers   Continuous Integration   Crash Reports   Credit Cards   Credits   CSV   Curl/Flip   Data Binding   Data Generators   Data Structures   Database   Database Browsers   Date &   Debugging   Decompilers   Deep Links   Dependency Injections   Design   Design Patterns   Dex   Dialogs   Distributed Computing   Distribution Platforms   Download Managers   Drawables   Emoji   Emulators   EPUB   Equalizers &   Event Buses   Exception Handling   Face Recognition   Feedback &   File System   File/Directory   Fingerprint   Floating Action   Fonts   Forms   Fragments   FRP   FSM   Functional Programming   Gamepads   Games   Geocaching   Gestures   GIF   Glow Pad   Gradle Plugins   Graphics   Grid Views   Highlighting   HTML   HTTP Mocking   Icons   IDE   IDE Plugins   Image Croppers   Image Loaders   Image Pickers   Image Processing   Image Views   Instrumentation   Intents   Job Schedulers   JSON   Keyboard   Kotlin   Layouts   Library Demos   List View   List Views   Localization   Location   Lock Patterns   Logcat   Logging   Mails   Maps   Markdown   Mathematics   Maven Plugins   MBaaS   Media   Menus   Messaging   MIME   Mobile Web   Native Image   Navigation   NDK   Networking   NFC   NoSQL   Number Pickers   OAuth   Object Mocking   OCR Engines   OpenGL   ORM   Other Pickers   Parallax List   Parcelables   Particle Systems   Password Inputs   PDF   Permissions   Physics Engines   Platforms   Plugin Frameworks   Preferences   Progress Indicators   ProGuard   Properties   Protocol Buffer   Pull To   Purchases   Push/Pull   QR Codes   Quick Return   Radio Buttons   Range Bars   Ratings   Recycler Views   Resources   REST   Ripple Effects   RSS   Screenshots   Scripting   Scroll Views   SDK   Search Inputs   Security   Sensors   Services   Showcase Views   Signatures   Sliding Panels   Snackbars   SOAP   Social Networks   Spannable   Spinners   Splash Screens   SSH   Static Analysis   Status Bars   Styling   SVG   System   Tags   Task Managers   TDD &   Template Engines   Testing   Testing Tools   Text Formatting   Text Views   Text Watchers   Text-to   Toasts   Toolkits For   Tools   Tooltips   Trainings   TV   Twitter   Updaters   USB   User Stories   Utils   Validation   Video   View Adapters   View Pagers   Views   Watch Face   Wearable Data   Wearables   Weather   Web Tools   Web Views   WebRTC   WebSockets   Wheel Widgets   Wi-Fi   Widgets   Windows   Wizards   XML   XMPP   YAML   ZIP Codes