Removing API to access app usage as it is no long public

Bug: 117409586
Bug: 124126265
Test: N/A
Change-Id: If3cd71ef7f8932dfc6680557b1e84338cfed3852
This commit is contained in:
Sunny Goyal
2019-03-29 11:38:16 -07:00
parent 9d4dfc2ba0
commit beee197b99
3 changed files with 17 additions and 9 deletions

View File

@@ -11251,7 +11251,6 @@ package android.content.pm {
public class LauncherApps {
method public java.util.List<android.content.pm.LauncherActivityInfo> getActivityList(String, android.os.UserHandle);
method @NonNull public java.util.List<android.content.pm.PackageInstaller.SessionInfo> getAllPackageInstallerSessions();
method @Nullable public android.content.pm.LauncherApps.AppUsageLimit getAppUsageLimit(@NonNull String, @NonNull android.os.UserHandle);
method public android.content.pm.ApplicationInfo getApplicationInfo(@NonNull String, int, @NonNull android.os.UserHandle) throws android.content.pm.PackageManager.NameNotFoundException;
method public android.content.pm.LauncherApps.PinItemRequest getPinItemRequest(android.content.Intent);
method public java.util.List<android.os.UserHandle> getProfiles();
@@ -11282,14 +11281,6 @@ package android.content.pm {
field public static final String EXTRA_PIN_ITEM_REQUEST = "android.content.pm.extra.PIN_ITEM_REQUEST";
}
public static final class LauncherApps.AppUsageLimit implements android.os.Parcelable {
method public int describeContents();
method public long getTotalUsageLimit();
method public long getUsageRemaining();
method public void writeToParcel(android.os.Parcel, int);
field @NonNull public static final android.os.Parcelable.Creator<android.content.pm.LauncherApps.AppUsageLimit> CREATOR;
}
public abstract static class LauncherApps.Callback {
ctor public LauncherApps.Callback();
method public abstract void onPackageAdded(String, android.os.UserHandle);

View File

@@ -1550,6 +1550,18 @@ package android.content.pm {
field @NonNull public static final android.os.Parcelable.Creator<android.content.pm.IntentFilterVerificationInfo> CREATOR;
}
public class LauncherApps {
method @Nullable public android.content.pm.LauncherApps.AppUsageLimit getAppUsageLimit(@NonNull String, @NonNull android.os.UserHandle);
}
public static final class LauncherApps.AppUsageLimit implements android.os.Parcelable {
method public int describeContents();
method public long getTotalUsageLimit();
method public long getUsageRemaining();
method public void writeToParcel(android.os.Parcel, int);
field @NonNull public static final android.os.Parcelable.Creator<android.content.pm.LauncherApps.AppUsageLimit> CREATOR;
}
public class PackageInstaller {
method @RequiresPermission(android.Manifest.permission.INSTALL_PACKAGES) public void setPermissionsResult(int, boolean);
}

View File

@@ -22,6 +22,7 @@ import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.SdkConstant;
import android.annotation.SdkConstant.SdkConstantType;
import android.annotation.SystemApi;
import android.annotation.SystemService;
import android.annotation.TestApi;
import android.annotation.UnsupportedAppUsage;
@@ -782,8 +783,10 @@ public class LauncherApps {
* @return an {@link AppUsageLimit} object describing the app time limit containing
* the given package with the smallest time remaining, or {@code null} if none exist.
* @throws SecurityException when the caller is not the recents app.
* @hide
*/
@Nullable
@SystemApi
public LauncherApps.AppUsageLimit getAppUsageLimit(@NonNull String packageName,
@NonNull UserHandle user) {
try {
@@ -1739,7 +1742,9 @@ public class LauncherApps {
* in this class.
*
* @see #getAppUsageLimit(String, UserHandle)
* @hide
*/
@SystemApi
public static final class AppUsageLimit implements Parcelable {
private final long mTotalUsageLimit;
private final long mUsageRemaining;