summaryrefslogtreecommitdiff
path: root/cmds/requestsync
diff options
context:
space:
mode:
authorMakoto Onuki <omakoto@google.com>2018-05-22 16:02:17 -0700
committerMakoto Onuki <omakoto@google.com>2018-05-23 14:50:05 -0700
commitd5f25d2cd882c89965b6538082556d9469f72288 (patch)
tree35933c6e4705b547df7e96cff84f38139d7d475f /cmds/requestsync
parentfab8e71697c3ab47ad3e53864b22542a9a34fa2f (diff)
Tweak exemption for sync requests made by FG apps
Exemption given to a sync request made by a foreground app (including PROCESS_STATE_IMPORTANT_FOREGROUND). At the schedule time, we promote the sync adapter app for a higher bucket: - If the device is not dozing (so the sync will start right away) promote to ACTIVE for 1 hour. - If the device is dozing (so the sync *won't* start right away), promote to WORKING_SET for 4 hours, so it'll get a higher chance to be started once the device comes out of doze. - When the sync actually starts, we promote the sync adapter app to ACTIVE for 10 minutes, so it can schedule and start more syncs without getting throttled, even when the first operation was canceled and now we're retrying. Test: atest cts/tests/tests/syncmanager/ Test: Manual test with "requestsync -f" and "am set-standby-bucket", while checking "dumpsys usagestats" Test: settings put global app_idle_constants \ exempted_sync_scheduled_nd_duration=1,exempted_sync_scheduled_d_duration=2,exempted_sync_start_duration=3 and check "dumpsys usagestats" and make sure the constants are properly updated. Fixes: 72443754 Change-Id: I233d8e4be85769150830bac798abc04810f4cc7b
Diffstat (limited to 'cmds/requestsync')
-rw-r--r--cmds/requestsync/src/com/android/commands/requestsync/RequestSync.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/cmds/requestsync/src/com/android/commands/requestsync/RequestSync.java b/cmds/requestsync/src/com/android/commands/requestsync/RequestSync.java
index 37b7acfaf5e6..8683ca163fb6 100644
--- a/cmds/requestsync/src/com/android/commands/requestsync/RequestSync.java
+++ b/cmds/requestsync/src/com/android/commands/requestsync/RequestSync.java
@@ -211,10 +211,10 @@ public class RequestSync {
mExtras.putBoolean(key, Boolean.valueOf(value));
} else if (opt.equals("-f") || opt.equals("--foreground")) {
- mExemptionFlag = ContentResolver.SYNC_EXEMPTION_ACTIVE;
+ mExemptionFlag = ContentResolver.SYNC_EXEMPTION_PROMOTE_BUCKET;
} else if (opt.equals("-F") || opt.equals("--top")) {
- mExemptionFlag = ContentResolver.SYNC_EXEMPTION_ACTIVE_WITH_TEMP;
+ mExemptionFlag = ContentResolver.SYNC_EXEMPTION_PROMOTE_BUCKET_WITH_TEMP;
} else {
System.err.println("Error: Unknown option: " + opt);