1 /** 2 * Copyright (c) 2014, The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package android.app.usage; 18 19 import android.app.PendingIntent; 20 import android.app.usage.UsageEvents; 21 import android.content.pm.ParceledListSlice; 22 23 import java.util.Map; 24 25 /** 26 * System private API for talking with the UsageStatsManagerService. 27 * 28 * {@hide} 29 */ 30 interface IUsageStatsManager { queryUsageStats(int bucketType, long beginTime, long endTime, String callingPackage)31 ParceledListSlice queryUsageStats(int bucketType, long beginTime, long endTime, 32 String callingPackage); queryConfigurationStats(int bucketType, long beginTime, long endTime, String callingPackage)33 ParceledListSlice queryConfigurationStats(int bucketType, long beginTime, long endTime, 34 String callingPackage); queryEventStats(int bucketType, long beginTime, long endTime, String callingPackage)35 ParceledListSlice queryEventStats(int bucketType, long beginTime, long endTime, 36 String callingPackage); queryEvents(long beginTime, long endTime, String callingPackage)37 UsageEvents queryEvents(long beginTime, long endTime, String callingPackage); queryEventsForPackage(long beginTime, long endTime, String callingPackage)38 UsageEvents queryEventsForPackage(long beginTime, long endTime, String callingPackage); queryEventsForUser(long beginTime, long endTime, int userId, String callingPackage)39 UsageEvents queryEventsForUser(long beginTime, long endTime, int userId, String callingPackage); queryEventsForPackageForUser(long beginTime, long endTime, int userId, String pkg, String callingPackage)40 UsageEvents queryEventsForPackageForUser(long beginTime, long endTime, int userId, String pkg, String callingPackage); setAppInactive(String packageName, boolean inactive, int userId)41 void setAppInactive(String packageName, boolean inactive, int userId); isAppInactive(String packageName, int userId)42 boolean isAppInactive(String packageName, int userId); whitelistAppTemporarily(String packageName, long duration, int userId)43 void whitelistAppTemporarily(String packageName, long duration, int userId); onCarrierPrivilegedAppsChanged()44 void onCarrierPrivilegedAppsChanged(); reportChooserSelection(String packageName, int userId, String contentType, in String[] annotations, String action)45 void reportChooserSelection(String packageName, int userId, String contentType, 46 in String[] annotations, String action); getAppStandbyBucket(String packageName, String callingPackage, int userId)47 int getAppStandbyBucket(String packageName, String callingPackage, int userId); setAppStandbyBucket(String packageName, int bucket, int userId)48 void setAppStandbyBucket(String packageName, int bucket, int userId); getAppStandbyBuckets(String callingPackage, int userId)49 ParceledListSlice getAppStandbyBuckets(String callingPackage, int userId); setAppStandbyBuckets(in ParceledListSlice appBuckets, int userId)50 void setAppStandbyBuckets(in ParceledListSlice appBuckets, int userId); registerAppUsageObserver(int observerId, in String[] packages, long timeLimitMs, in PendingIntent callback, String callingPackage)51 void registerAppUsageObserver(int observerId, in String[] packages, long timeLimitMs, 52 in PendingIntent callback, String callingPackage); unregisterAppUsageObserver(int observerId, String callingPackage)53 void unregisterAppUsageObserver(int observerId, String callingPackage); 54 } 55