diff options
-rw-r--r-- | api/current.txt | 2 | ||||
-rw-r--r-- | api/system-current.txt | 2 | ||||
-rw-r--r-- | cmds/am/src/com/android/commands/am/Am.java | 24 | ||||
-rw-r--r-- | core/java/android/app/usage/IUsageStatsManager.aidl | 4 | ||||
-rw-r--r-- | core/java/android/app/usage/UsageStatsManager.java | 8 | ||||
-rw-r--r-- | services/usage/java/com/android/server/usage/UsageStatsService.java | 6 |
6 files changed, 23 insertions, 23 deletions
diff --git a/api/current.txt b/api/current.txt index 2bbe2f1..abe7b916 100644 --- a/api/current.txt +++ b/api/current.txt @@ -6155,7 +6155,7 @@ package android.app.usage { } public final class UsageStatsManager { - method public boolean isAppIdle(java.lang.String); + method public boolean isAppInactive(java.lang.String); method public java.util.Map<java.lang.String, android.app.usage.UsageStats> queryAndAggregateUsageStats(long, long); method public java.util.List<android.app.usage.ConfigurationStats> queryConfigurations(int, long, long); method public android.app.usage.UsageEvents queryEvents(long, long); diff --git a/api/system-current.txt b/api/system-current.txt index 0cc763b..5ae185d 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -6342,7 +6342,7 @@ package android.app.usage { } public final class UsageStatsManager { - method public boolean isAppIdle(java.lang.String); + method public boolean isAppInactive(java.lang.String); method public java.util.Map<java.lang.String, android.app.usage.UsageStats> queryAndAggregateUsageStats(long, long); method public java.util.List<android.app.usage.ConfigurationStats> queryConfigurations(int, long, long); method public android.app.usage.UsageEvents queryEvents(long, long); diff --git a/cmds/am/src/com/android/commands/am/Am.java b/cmds/am/src/com/android/commands/am/Am.java index 219d35b..808e124 100644 --- a/cmds/am/src/com/android/commands/am/Am.java +++ b/cmds/am/src/com/android/commands/am/Am.java @@ -142,8 +142,8 @@ public class Am extends BaseCommand { " am task resizeable <TASK_ID> [true|false]\n" + " am task resize <TASK_ID> <LEFT,TOP,RIGHT,BOTTOM>\n" + " am get-config\n" + - " am set-idle [--user <USER_ID>] <PACKAGE> true|false\n" + - " am get-idle [--user <USER_ID>] <PACKAGE>\n" + + " am set-inactive [--user <USER_ID>] <PACKAGE> true|false\n" + + " am get-inactive [--user <USER_ID>] <PACKAGE>\n" + "\n" + "am start: start an Activity. Options are:\n" + " -D: enable debugging\n" + @@ -284,9 +284,9 @@ public class Am extends BaseCommand { "am get-config: retrieve the configuration and any recent configurations\n" + " of the device\n" + "\n" + - "am set-idle: sets the idle state of an app\n" + + "am set-inactive: sets the inactive state of an app\n" + "\n" + - "am get-idle: returns the idle state of an app\n" + + "am get-inactive: returns the inactive state of an app\n" + "\n" + "\n" + "<INTENT> specifications include these flags and arguments:\n" + @@ -395,10 +395,10 @@ public class Am extends BaseCommand { runTask(); } else if (op.equals("get-config")) { runGetConfig(); - } else if (op.equals("set-idle")) { - runSetIdle(); - } else if (op.equals("get-idle")) { - runGetIdle(); + } else if (op.equals("set-inactive")) { + runSetInactive(); + } else if (op.equals("get-inactive")) { + runGetInactive(); } else { showError("Error: unknown command '" + op + "'"); } @@ -2030,7 +2030,7 @@ public class Am extends BaseCommand { } } - private void runSetIdle() throws Exception { + private void runSetInactive() throws Exception { int userId = UserHandle.USER_OWNER; String opt; @@ -2047,10 +2047,10 @@ public class Am extends BaseCommand { IUsageStatsManager usm = IUsageStatsManager.Stub.asInterface(ServiceManager.getService( Context.USAGE_STATS_SERVICE)); - usm.setAppIdle(packageName, Boolean.parseBoolean(value), userId); + usm.setAppInactive(packageName, Boolean.parseBoolean(value), userId); } - private void runGetIdle() throws Exception { + private void runGetInactive() throws Exception { int userId = UserHandle.USER_OWNER; String opt; @@ -2066,7 +2066,7 @@ public class Am extends BaseCommand { IUsageStatsManager usm = IUsageStatsManager.Stub.asInterface(ServiceManager.getService( Context.USAGE_STATS_SERVICE)); - boolean isIdle = usm.isAppIdle(packageName, userId); + boolean isIdle = usm.isAppInactive(packageName, userId); System.out.println("Idle=" + isIdle); } diff --git a/core/java/android/app/usage/IUsageStatsManager.aidl b/core/java/android/app/usage/IUsageStatsManager.aidl index 23659e3..254408a 100644 --- a/core/java/android/app/usage/IUsageStatsManager.aidl +++ b/core/java/android/app/usage/IUsageStatsManager.aidl @@ -30,6 +30,6 @@ interface IUsageStatsManager { ParceledListSlice queryConfigurationStats(int bucketType, long beginTime, long endTime, String callingPackage); UsageEvents queryEvents(long beginTime, long endTime, String callingPackage); - void setAppIdle(String packageName, boolean idle, int userId); - boolean isAppIdle(String packageName, int userId); + void setAppInactive(String packageName, boolean inactive, int userId); + boolean isAppInactive(String packageName, int userId); } diff --git a/core/java/android/app/usage/UsageStatsManager.java b/core/java/android/app/usage/UsageStatsManager.java index 8a01d66..c74bbdd 100644 --- a/core/java/android/app/usage/UsageStatsManager.java +++ b/core/java/android/app/usage/UsageStatsManager.java @@ -220,15 +220,15 @@ public final class UsageStatsManager { } /** - * Returns whether the specified app is currently considered idle. This will be true if the + * Returns whether the specified app is currently considered inactive. This will be true if the * app hasn't been used directly or indirectly for a period of time defined by the system. This * could be of the order of several hours or days. * @param packageName The package name of the app to query - * @return whether the app is currently considered idle + * @return whether the app is currently considered inactive */ - public boolean isAppIdle(String packageName) { + public boolean isAppInactive(String packageName) { try { - return mService.isAppIdle(packageName, UserHandle.myUserId()); + return mService.isAppInactive(packageName, UserHandle.myUserId()); } catch (RemoteException e) { // fall through and return default } diff --git a/services/usage/java/com/android/server/usage/UsageStatsService.java b/services/usage/java/com/android/server/usage/UsageStatsService.java index 117cbe4..48b127a 100644 --- a/services/usage/java/com/android/server/usage/UsageStatsService.java +++ b/services/usage/java/com/android/server/usage/UsageStatsService.java @@ -718,10 +718,10 @@ public class UsageStatsService extends SystemService implements } @Override - public boolean isAppIdle(String packageName, int userId) { + public boolean isAppInactive(String packageName, int userId) { try { userId = ActivityManagerNative.getDefault().handleIncomingUser(Binder.getCallingPid(), - Binder.getCallingUid(), userId, false, true, "isAppIdle", null); + Binder.getCallingUid(), userId, false, true, "isAppInactive", null); } catch (RemoteException re) { return false; } @@ -734,7 +734,7 @@ public class UsageStatsService extends SystemService implements } @Override - public void setAppIdle(String packageName, boolean idle, int userId) { + public void setAppInactive(String packageName, boolean idle, int userId) { final int callingUid = Binder.getCallingUid(); try { userId = ActivityManagerNative.getDefault().handleIncomingUser( |