Merge cherrypicks of [4562103, 4560827, 4563998, 4563999, 4564000, 4564001, 4564351, 4564352, 4564333, 4564033, 4560455, 4564034, 4560674, 4560675, 4563620, 4561607, 4561062, 4561063] into pi-release

Change-Id: Id607056868f1610847e868fee7522281a0611ce0
diff --git a/tests/tests/app.usage/src/android/app/usage/cts/UsageStatsTest.java b/tests/tests/app.usage/src/android/app/usage/cts/UsageStatsTest.java
index a793150..a045488 100644
--- a/tests/tests/app.usage/src/android/app/usage/cts/UsageStatsTest.java
+++ b/tests/tests/app.usage/src/android/app/usage/cts/UsageStatsTest.java
@@ -274,6 +274,13 @@
     }
 
     @Test
+    public void testGetAppStandbyBucket() throws Exception {
+        // App should be at least active, since it's running instrumentation tests
+        assertLessThanOrEqual(UsageStatsManager.STANDBY_BUCKET_ACTIVE,
+                mUsageStatsManager.getAppStandbyBucket());
+    }
+
+    @Test
     public void testQueryEventsForSelf() throws Exception {
         setAppOpsMode("ignore"); // To ensure permission is not required
         // Time drifts of 2s are expected inside usage stats