我正在使用Nexus 5和6p，Android 6具有称为"电池优化模式" 或打瞌睡模式（简称）的功能。它允许应用程序不运行，如果它们不用于避免电池消耗。
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?
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" />
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.
This is one reason, there may be more
Google Play Services has location API. And your Android Device Manager (ADM) which you use to track your stolen or misplaced device uses location API. Let's say you forgot your phone leaving for home and on reaching home want to locate your phone by logging into ADM
You can do that successfully only if your ADM (using location API) is not affected by doze, which is the case as cited here Does Doze interfere with Android Device Manager?. If doze affected Play Services, then you won't be able to track your phone at all
Google Play Services is in charge of Google Cloud Messaging (GCM). GCM is the mechanism by which applications can request to exit doze mode, upon receiving high priority messages from GCM. In other words, Google Play Services is partly in control of doze mode, so it cannot be dozed.