Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 66f85913 authored by Adrian Roos's avatar Adrian Roos
Browse files

API: Clean up redundant and ineffective usages of SystemApi and TestApi

Everything that is marked SystemApi or TestApi, but not @hide is still
part of the public SDK, it is therefore not sound to have that combination.

In the future, specifing such a combination will be considered an error
to prevent inadvertently exposing SystemApi and TestApi as public API.

Bug: 115333477
Change-Id: Ibd5d6a22862fdbc1e20a1cb3925280f5a682edea
Test: METALAVA_PREPEND_ARGS="--error UnhiddenSystemApi" m checkapi
Exempt-From-Owner-Approval: API cleanup
parent a6d82875
Loading
Loading
Loading
Loading
+0 −118

File changed.

Preview size limit exceeded, changes collapsed.

+0 −6
Original line number Diff line number Diff line
@@ -5,7 +5,6 @@ package android {
    field public static final java.lang.String ACTIVITY_EMBEDDING = "android.permission.ACTIVITY_EMBEDDING";
    field public static final java.lang.String BRIGHTNESS_SLIDER_USAGE = "android.permission.BRIGHTNESS_SLIDER_USAGE";
    field public static final java.lang.String CHANGE_APP_IDLE_STATE = "android.permission.CHANGE_APP_IDLE_STATE";
    field public static final java.lang.String CHANGE_CONFIGURATION = "android.permission.CHANGE_CONFIGURATION";
    field public static final java.lang.String CONFIGURE_DISPLAY_BRIGHTNESS = "android.permission.CONFIGURE_DISPLAY_BRIGHTNESS";
    field public static final java.lang.String FORCE_STOP_PACKAGES = "android.permission.FORCE_STOP_PACKAGES";
    field public static final java.lang.String MANAGE_ACTIVITY_STACKS = "android.permission.MANAGE_ACTIVITY_STACKS";
@@ -1672,11 +1671,6 @@ package android.view {
    method public static int getLongPressTooltipHideTimeout();
  }

  public final class ViewTreeObserver {
    method public void registerFrameCommitCallback(java.lang.Runnable);
    method public boolean unregisterFrameCommitCallback(java.lang.Runnable);
  }

  public abstract interface WindowManager implements android.view.ViewManager {
    method public default void setShouldShowIme(int, boolean);
    method public default void setShouldShowSystemDecors(int, boolean);
+0 −17
Original line number Diff line number Diff line
@@ -303,9 +303,7 @@ public class ActivityTaskManager {
     * @param stackId Id of stack to move the top activity to pinned stack.
     * @param bounds Bounds to use for pinned stack.
     * @return True if the top activity of stack was successfully moved to the pinned stack.
     * @hide
     */
    @TestApi
    @RequiresPermission(android.Manifest.permission.MANAGE_ACTIVITY_STACKS)
    public boolean moveTopActivityToPinnedStack(int stackId, Rect bounds) {
        try {
@@ -318,9 +316,7 @@ public class ActivityTaskManager {
    /**
     * Start to enter lock task mode for given task by system(UI).
     * @param taskId Id of task to lock.
     * @hide
     */
    @TestApi
    @RequiresPermission(android.Manifest.permission.MANAGE_ACTIVITY_STACKS)
    public void startSystemLockTaskMode(int taskId) {
        try {
@@ -332,9 +328,7 @@ public class ActivityTaskManager {

    /**
     * Stop lock task mode by system(UI).
     * @hide
     */
    @TestApi
    @RequiresPermission(android.Manifest.permission.MANAGE_ACTIVITY_STACKS)
    public void stopSystemLockTaskMode() {
        try {
@@ -349,9 +343,7 @@ public class ActivityTaskManager {
     * @param taskId Id of the task to move.
     * @param stackId Id of the stack for task moving.
     * @param toTop Whether the given task should shown to top of stack.
     * @hide
     */
    @TestApi
    @RequiresPermission(android.Manifest.permission.MANAGE_ACTIVITY_STACKS)
    public void moveTaskToStack(int taskId, int stackId, boolean toTop) {
        try {
@@ -366,9 +358,7 @@ public class ActivityTaskManager {
     * @param stackId Id of the stack to resize.
     * @param bounds Bounds to resize the stack to or {@code null} for fullscreen.
     * @param animate Whether we should play an animation for resizing stack.
     * @hide
     */
    @TestApi
    @RequiresPermission(android.Manifest.permission.MANAGE_ACTIVITY_STACKS)
    public void resizeStack(int stackId, Rect bounds, boolean animate) {
        try {
@@ -383,9 +373,7 @@ public class ActivityTaskManager {
     * Resize task to given bounds.
     * @param taskId Id of task to resize.
     * @param bounds Bounds to resize task.
     * @hide
     */
    @TestApi
    @RequiresPermission(android.Manifest.permission.MANAGE_ACTIVITY_STACKS)
    public void resizeTask(int taskId, Rect bounds) {
        try {
@@ -399,9 +387,7 @@ public class ActivityTaskManager {
     * Resize docked stack & its task to given stack & task bounds.
     * @param stackBounds Bounds to resize stack.
     * @param taskBounds Bounds to resize task.
     * @hide
     */
    @TestApi
    @RequiresPermission(android.Manifest.permission.MANAGE_ACTIVITY_STACKS)
    public void resizeDockedStack(Rect stackBounds, Rect taskBounds) {
        try {
@@ -413,9 +399,7 @@ public class ActivityTaskManager {

    /**
     * List all activity stacks information.
     * @hide
     */
    @TestApi
    @RequiresPermission(android.Manifest.permission.MANAGE_ACTIVITY_STACKS)
    public String listAllStacks() {
        final List<ActivityManager.StackInfo> stacks;
@@ -438,7 +422,6 @@ public class ActivityTaskManager {
     * Clears launch params for the given package.
     * @param packageNames the names of the packages of which the launch params are to be cleared
     */
    @TestApi
    @RequiresPermission(android.Manifest.permission.MANAGE_ACTIVITY_STACKS)
    public void clearLaunchParamsForPackages(List<String> packageNames) {
        try {
+0 −2
Original line number Diff line number Diff line
@@ -23,7 +23,6 @@ import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.SdkConstant;
import android.annotation.SdkConstant.SdkConstantType;
import android.annotation.SystemApi;
import android.app.Service;
import android.content.BroadcastReceiver;
import android.content.ComponentName;
@@ -755,7 +754,6 @@ public class DeviceAdminReceiver extends BroadcastReceiver {
     * @deprecated Do not use
     */
    @Deprecated
    @SystemApi
    public void onReadyForUserInitialization(Context context, Intent intent) {
    }

+0 −3
Original line number Diff line number Diff line
@@ -689,13 +689,11 @@ public final class SystemUpdatePolicy implements Parcelable {
                mFreezePeriods.stream().map(n -> n.toString()).collect(Collectors.joining(",")));
    }

    @SystemApi
    @Override
    public int describeContents() {
        return 0;
    }

    @SystemApi
    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(mPolicyType);
@@ -712,7 +710,6 @@ public final class SystemUpdatePolicy implements Parcelable {
        }
    }

    @SystemApi
    public static final Parcelable.Creator<SystemUpdatePolicy> CREATOR =
            new Parcelable.Creator<SystemUpdatePolicy>() {

Loading