Merge "Support logging chained WorkSources from JobScheduler."
This commit is contained in:
committed by
Android (Google) Code Review
commit
5bc5457ae5
@@ -1,7 +1,10 @@
|
||||
package android.os;
|
||||
|
||||
import android.annotation.Nullable;
|
||||
import android.content.Context;
|
||||
import android.os.WorkSourceProto;
|
||||
import android.provider.Settings;
|
||||
import android.provider.Settings.Global;
|
||||
import android.util.Log;
|
||||
import android.util.proto.ProtoOutputStream;
|
||||
|
||||
@@ -109,6 +112,17 @@ public class WorkSource implements Parcelable {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether system services should create {@code WorkChains} (wherever possible) in the place
|
||||
* of flat UID lists.
|
||||
*
|
||||
* @hide
|
||||
*/
|
||||
public static boolean isChainedBatteryAttributionEnabled(Context context) {
|
||||
return Settings.Global.getInt(context.getContentResolver(),
|
||||
Global.CHAINED_BATTERY_ATTRIBUTION_ENABLED, 0) == 1;
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
public int size() {
|
||||
return mNum;
|
||||
|
||||
@@ -11248,6 +11248,16 @@ public final class Settings {
|
||||
*/
|
||||
public static final String OVERRIDE_SETTINGS_PROVIDER_RESTORE_ANY_VERSION =
|
||||
"override_settings_provider_restore_any_version";
|
||||
/**
|
||||
* Flag to toggle whether system services report attribution chains when they attribute
|
||||
* battery use via a {@code WorkSource}.
|
||||
*
|
||||
* Type: int (0 to disable, 1 to enable)
|
||||
*
|
||||
* @hide
|
||||
*/
|
||||
public static final String CHAINED_BATTERY_ATTRIBUTION_ENABLED =
|
||||
"chained_battery_attribution_enabled";
|
||||
|
||||
/**
|
||||
* Settings to backup. This is here so that it's in the same place as the settings
|
||||
|
||||
Reference in New Issue
Block a user