Merge "Add @UnsupportedAppUsage annotations for max-p." am: 8893f158c6

am: da4d6567c2

Change-Id: Iff80c388dec2c6f8184b739be6fb38b8ec8a1a49
This commit is contained in:
Artur Satayev
2019-11-08 09:49:03 -08:00
committed by android-build-merger
20 changed files with 81 additions and 49 deletions

View File

@@ -30,6 +30,7 @@ interface IUiModeManager {
/**
* Disables the car mode.
*/
@UnsupportedAppUsage(maxTargetSdk = 28)
void disableCarMode(int flags);
/**

View File

@@ -52,6 +52,7 @@ interface IConnectivityManager
@UnsupportedAppUsage
NetworkInfo getActiveNetworkInfo();
NetworkInfo getActiveNetworkInfoForUid(int uid, boolean ignoreBlocked);
@UnsupportedAppUsage(maxTargetSdk = 28)
NetworkInfo getNetworkInfo(int networkType);
NetworkInfo getNetworkInfoForUid(in Network network, int uid, boolean ignoreBlocked);
@UnsupportedAppUsage
@@ -112,6 +113,7 @@ interface IConnectivityManager
int setUsbTethering(boolean enable, String callerPkg);
@UnsupportedAppUsage(maxTargetSdk = 28)
void reportInetCondition(int networkType, int percentage);
void reportNetworkConnectivity(in Network network, boolean hasConnectivity);

View File

@@ -66,6 +66,10 @@ import java.util.Map;
public abstract class BatteryStats implements Parcelable {
private static final String TAG = "BatteryStats";
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P)
public BatteryStats() {
}
private static final boolean LOCAL_LOGV = false;
/** Fetching RPM stats is too slow to do each time screen changes, so disable it. */
protected static final boolean SCREEN_OFF_RPM_STATS_ENABLED = false;
@@ -407,6 +411,10 @@ public abstract class BatteryStats implements Parcelable {
*/
public static abstract class Counter {
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P)
public Counter() {
}
/**
* Returns the count associated with this Counter for the
* selected type of statistics.
@@ -516,6 +524,10 @@ public abstract class BatteryStats implements Parcelable {
*/
public static abstract class Timer {
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P)
public Timer() {
}
/**
* Returns the count associated with this Timer for the
* selected type of statistics.
@@ -671,6 +683,11 @@ public abstract class BatteryStats implements Parcelable {
* The statistics associated with a particular wake lock.
*/
public static abstract class Wakelock {
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P)
public Wakelock(){
}
@UnsupportedAppUsage
public abstract Timer getWakeTime(int type);
}
@@ -948,6 +965,11 @@ public abstract class BatteryStats implements Parcelable {
public abstract void getDeferredJobsLineLocked(StringBuilder sb, int which);
public static abstract class Sensor {
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P)
public Sensor() {
}
/*
* FIXME: it's not correct to use this magic value because it
* could clash with a sensor handle (which are defined by
@@ -978,6 +1000,10 @@ public abstract class BatteryStats implements Parcelable {
*/
public static abstract class Proc {
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P)
public Proc() {
}
public static class ExcessivePower {
public static final int TYPE_WAKE = 1;
public static final int TYPE_CPU = 2;
@@ -1053,6 +1079,10 @@ public abstract class BatteryStats implements Parcelable {
*/
public static abstract class Pkg {
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P)
public Pkg() {
}
/**
* Returns information about all wakeup alarms that have been triggered for this
* package. The mapping keys are tag names for the alarms, the counter contains
@@ -1555,6 +1585,7 @@ public abstract class BatteryStats implements Parcelable {
}
public final static class HistoryItem implements Parcelable {
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P)
public HistoryItem next;
// The time of this event in milliseconds, as per SystemClock.elapsedRealtime().
@@ -1877,6 +1908,7 @@ public abstract class BatteryStats implements Parcelable {
numReadInts += (src.dataPosition()-start)/4;
}
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P)
public void clear() {
time = 0;
cmd = CMD_NULL;
@@ -1897,12 +1929,14 @@ public abstract class BatteryStats implements Parcelable {
eventTag = null;
}
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P)
public void setTo(HistoryItem o) {
time = o.time;
cmd = o.cmd;
setToCommon(o);
}
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P)
public void setTo(long time, byte cmd, HistoryItem o) {
this.time = time;
this.cmd = cmd;
@@ -1958,6 +1992,7 @@ public abstract class BatteryStats implements Parcelable {
&& currentTime == o.currentTime;
}
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P)
public boolean same(HistoryItem o) {
if (!sameNonEvent(o) || eventCode != o.eventCode) {
return false;
@@ -2340,6 +2375,7 @@ public abstract class BatteryStats implements Parcelable {
*
* {@hide}
*/
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P)
public abstract long getMobileRadioActiveTime(long elapsedRealtimeUs, int which);
/**
@@ -2700,6 +2736,7 @@ public abstract class BatteryStats implements Parcelable {
public static final int NETWORK_WIFI_BG_TX_DATA = 9;
public static final int NUM_NETWORK_ACTIVITY_TYPES = NETWORK_WIFI_BG_TX_DATA + 1;
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P)
public abstract long getNetworkActivityBytes(int type, int which);
public abstract long getNetworkActivityPackets(int type, int which);

View File

@@ -18,13 +18,19 @@ package android.os;
import android.os.ICancellationSignal;
import dalvik.annotation.compat.UnsupportedAppUsage;
/**
* Provides the ability to cancel an operation in progress.
*/
public final class CancellationSignal {
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P)
private boolean mIsCanceled;
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P)
private OnCancelListener mOnCancelListener;
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P)
private ICancellationSignal mRemote;
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P)
private boolean mCancelInProgress;
/**
@@ -152,6 +158,7 @@ public final class CancellationSignal {
}
}
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P)
private void waitForCancelFinishedLocked() {
while (mCancelInProgress) {
try {

View File

@@ -47,6 +47,7 @@ interface IPowerManager
void wakeUp(long time, int reason, String details, String opPackageName);
@UnsupportedAppUsage
void goToSleep(long time, int reason, int flags);
@UnsupportedAppUsage(maxTargetSdk = 28)
void nap(long time);
@UnsupportedAppUsage
boolean isInteractive();

View File

@@ -3148,6 +3148,7 @@ public final class Parcel {
// Cache of previously looked up CREATOR.createFromParcel() methods for
// particular classes. Keys are the names of the classes, values are
// Method objects.
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P)
private static final HashMap<ClassLoader,HashMap<String,Parcelable.Creator<?>>>
mCreators = new HashMap<>();

View File

@@ -824,6 +824,7 @@ public final class PowerManager {
final Context mContext;
@UnsupportedAppUsage
final IPowerManager mService;
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P)
final Handler mHandler;
IThermalService mThermalService;

View File

@@ -1003,6 +1003,7 @@ public class Process {
* your own log, or the Android Illuminati will find you some night and
* beat you up.
*/
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P)
public static final native void sendSignalQuiet(int pid, int signal);
/** @hide */

View File

@@ -114,6 +114,7 @@ public class Registrant
}
}
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P)
public Handler
getHandler()
{

View File

@@ -70,6 +70,7 @@ public class RegistrantList
return registrants.size();
}
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P)
public synchronized Object
get(int index)
{

View File

@@ -21,6 +21,8 @@ import android.annotation.Nullable;
import android.annotation.SystemApi;
import android.annotation.TestApi;
import dalvik.annotation.compat.UnsupportedAppUsage;
/**
* @hide
*/
@@ -33,6 +35,7 @@ public final class RemoteCallback implements Parcelable {
}
private final OnResultListener mListener;
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P)
private final Handler mHandler;
private final IRemoteCallback mCallback;

View File

@@ -95,12 +95,17 @@ public class SystemProperties {
@UnsupportedAppUsage
private static native String native_get(String key);
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P)
private static native String native_get(String key, String def);
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P)
private static native int native_get_int(String key, int def);
@UnsupportedAppUsage
private static native long native_get_long(String key, long def);
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P)
private static native boolean native_get_boolean(String key, boolean def);
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P)
private static native void native_set(String key, String def);
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P)
private static native void native_add_change_callback();
private static native void native_report_sysprop_change();

View File

@@ -354,6 +354,7 @@ public final class UserHandle implements Parcelable {
* components -- user, app, isolated, etc.
* @hide
*/
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P)
public static void formatUid(PrintWriter pw, int uid) {
if (uid < Process.FIRST_APPLICATION_UID) {
pw.print(uid);

View File

@@ -40,14 +40,17 @@ public class WorkSource implements Parcelable {
* The WorkSource object itself is not thread safe, but we need to
* hold sTmpWorkSource lock while working with these statics.
*/
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P)
static final WorkSource sTmpWorkSource = new WorkSource(0);
/**
* For returning newbie work from a modification operation.
*/
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P)
static WorkSource sNewbWork;
/**
* For returning gone work form a modification operation.
*/
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P)
static WorkSource sGoneWork;
/**
@@ -620,6 +623,7 @@ public class WorkSource implements Parcelable {
return changed;
}
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P)
private boolean updateLocked(WorkSource other, boolean set, boolean returnNewbs) {
if (mNames == null && other.mNames == null) {
return updateUidsLocked(other, set, returnNewbs);

View File

@@ -36,6 +36,7 @@ oneway interface ICarrierMessagingService {
* @param subId SMS subscription ID of the SIM
* @param callback the callback to notify upon completion
*/
@UnsupportedAppUsage(maxTargetSdk = 28)
void filterSms(
in MessagePdu pdu, String format, int destPort, int subId,
in ICarrierMessagingCallback callback);

View File

@@ -151,6 +151,7 @@ interface IWindowManager
float getCurrentAnimatorScale();
// For testing
@UnsupportedAppUsage(maxTargetSdk = 28)
void setInTouchMode(boolean showFocus);
// For StrictMode flashing a red border on violations from the UI
@@ -158,6 +159,7 @@ interface IWindowManager
// Manager uses that to determine whether or not the red border should
// actually be shown. (it will be ignored that pid doesn't have windows
// on screen)
@UnsupportedAppUsage(maxTargetSdk = 28)
void showStrictModeViolation(boolean on);
// Proxy to set the system property for whether the flashing