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

Commit 6115769c 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
Merged-In: Ibd5d6a22862fdbc1e20a1cb3925280f5a682edea
Test: METALAVA_PREPEND_ARGS="--error UnhiddenSystemApi" m checkapi
Exempt-From-Owner-Approval: API cleanup
parent e3a13309
Loading
Loading
Loading
Loading
+0 −121

File changed.

Preview size limit exceeded, changes collapsed.

+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
@@ -691,13 +691,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);
@@ -714,7 +712,6 @@ public final class SystemUpdatePolicy implements Parcelable {
        }
    }

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

+0 −2
Original line number Diff line number Diff line
@@ -119,7 +119,6 @@ public final class SQLiteDebug {
    /**
     * contains statistics about a database
     */
    @TestApi
    public static class DbStats {
        /** name of the database */
        public String dbName;
@@ -151,7 +150,6 @@ public final class SQLiteDebug {
     * return all pager and database stats for the current process.
     * @return {@link PagerStats}
     */
    @TestApi
    public static PagerStats getDatabaseInfo() {
        PagerStats stats = new PagerStats();
        nativeGetPagerStats(stats);
+0 −2
Original line number Diff line number Diff line
@@ -274,7 +274,6 @@ public class TrafficStats {
     * Changes only take effect during subsequent calls to
     * {@link #tagSocket(Socket)}.
     */
    @SystemApi
    @SuppressLint("Doclava125")
    public static void setThreadStatsUid(int uid) {
        NetworkManagementSocketTagger.setThreadSocketStatsUid(uid);
@@ -313,7 +312,6 @@ public class TrafficStats {
     *
     * @see #setThreadStatsUid(int)
     */
    @SystemApi
    @SuppressLint("Doclava125")
    public static void clearThreadStatsUid() {
        NetworkManagementSocketTagger.setThreadSocketStatsUid(-1);
Loading