IUsageStatsManager.aidl revision 20e682910de540ddfcb7d566eb4856d263e9817e
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 17package android.app.usage; 18 19import android.app.PendingIntent; 20import android.app.usage.UsageEvents; 21import android.content.pm.ParceledListSlice; 22 23import java.util.Map; 24 25/** 26 * System private API for talking with the UsageStatsManagerService. 27 * 28 * {@hide} 29 */ 30interface IUsageStatsManager { 31 ParceledListSlice queryUsageStats(int bucketType, long beginTime, long endTime, 32 String callingPackage); 33 ParceledListSlice queryConfigurationStats(int bucketType, long beginTime, long endTime, 34 String callingPackage); 35 ParceledListSlice queryEventStats(int bucketType, long beginTime, long endTime, 36 String callingPackage); 37 UsageEvents queryEvents(long beginTime, long endTime, String callingPackage); 38 UsageEvents queryEventsForPackage(long beginTime, long endTime, String callingPackage); 39 UsageEvents queryEventsForUser(long beginTime, long endTime, int userId, String callingPackage); 40 UsageEvents queryEventsForPackageForUser(long beginTime, long endTime, int userId, String pkg, String callingPackage); 41 void setAppInactive(String packageName, boolean inactive, int userId); 42 boolean isAppInactive(String packageName, int userId); 43 void whitelistAppTemporarily(String packageName, long duration, int userId); 44 void onCarrierPrivilegedAppsChanged(); 45 void reportChooserSelection(String packageName, int userId, String contentType, 46 in String[] annotations, String action); 47 int getAppStandbyBucket(String packageName, String callingPackage, int userId); 48 void setAppStandbyBucket(String packageName, int bucket, int userId); 49 ParceledListSlice getAppStandbyBuckets(String callingPackage, int userId); 50 void setAppStandbyBuckets(in ParceledListSlice appBuckets, int userId); 51 void registerAppUsageObserver(int observerId, in String[] packages, long timeLimitMs, 52 in PendingIntent callback, String callingPackage); 53 void unregisterAppUsageObserver(int observerId, String callingPackage); 54} 55