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

Commit b5cf97ff authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "Udpate instrumentation code"

parents 393eb959 216b6d35
Loading
Loading
Loading
Loading
+22 −28
Original line number Diff line number Diff line
@@ -329,7 +329,7 @@ public class AccountManager {
     * @return The account's password, null if none or if the account doesn't exist
     */
    public String getPassword(final Account account) {
        android.util.SeempLog.record(25);
        android.util.SeempLog.record(22);
        if (account == null) throw new IllegalArgumentException("account is null");
        try {
            return mService.getPassword(account);
@@ -358,7 +358,7 @@ public class AccountManager {
     * @return The user data, null if the account or key doesn't exist
     */
    public String getUserData(final Account account, final String key) {
        android.util.SeempLog.record(26);
        android.util.SeempLog.record(23);
        if (account == null) throw new IllegalArgumentException("account is null");
        if (key == null) throw new IllegalArgumentException("key is null");
        try {
@@ -569,7 +569,7 @@ public class AccountManager {
        if (authTokenType == null) throw new IllegalArgumentException("authTokenType is null");
        return new Future2Task<String>(handler, callback) {
            public void doWork() throws RemoteException {
                android.util.SeempLog.record(34);
                android.util.SeempLog.record(31);
                mService.getAuthTokenLabel(mResponse, accountType, authTokenType);
            }

@@ -615,7 +615,7 @@ public class AccountManager {
        if (features == null) throw new IllegalArgumentException("features is null");
        return new Future2Task<Boolean>(handler, callback) {
            public void doWork() throws RemoteException {
                android.util.SeempLog.record(34);
                android.util.SeempLog.record(31);
                mService.hasFeatures(mResponse, account, features, mContext.getOpPackageName());
            }
            public Boolean bundleToResult(Bundle bundle) throws AuthenticatorException {
@@ -668,7 +668,7 @@ public class AccountManager {
        if (type == null) throw new IllegalArgumentException("type is null");
        return new Future2Task<Account[]>(handler, callback) {
            public void doWork() throws RemoteException {
                android.util.SeempLog.record(34);
                android.util.SeempLog.record(31);
                mService.getAccountsByFeatures(mResponse, type, features,
                        mContext.getOpPackageName());
            }
@@ -712,7 +712,7 @@ public class AccountManager {
     *         already exists, the account is null, or another error occurs.
     */
    public boolean addAccountExplicitly(Account account, String password, Bundle userdata) {
        android.util.SeempLog.record(27);
        android.util.SeempLog.record(24);
        if (account == null) throw new IllegalArgumentException("account is null");
        try {
            return mService.addAccountExplicitly(account, password, userdata);
@@ -783,7 +783,7 @@ public class AccountManager {
        return new Future2Task<Account>(handler, callback) {
            @Override
            public void doWork() throws RemoteException {
                android.util.SeempLog.record(34);
                android.util.SeempLog.record(31);
                mService.renameAccount(mResponse, account, newName);
            }
            @Override
@@ -844,12 +844,12 @@ public class AccountManager {
    @Deprecated
    public AccountManagerFuture<Boolean> removeAccount(final Account account,
            AccountManagerCallback<Boolean> callback, Handler handler) {
        android.util.SeempLog.record(28);
        android.util.SeempLog.record(25);
        if (account == null) throw new IllegalArgumentException("account is null");
        return new Future2Task<Boolean>(handler, callback) {
            @Override
            public void doWork() throws RemoteException {
                android.util.SeempLog.record(34);
                android.util.SeempLog.record(31);
                mService.removeAccount(mResponse, account, false);
            }
            @Override
@@ -932,7 +932,7 @@ public class AccountManager {
        return new Future2Task<Boolean>(handler, callback) {
            @Override
            public void doWork() throws RemoteException {
                android.util.SeempLog.record(34);
                android.util.SeempLog.record(31);
                mService.removeAccountAsUser(mResponse, account, false, userHandle.getIdentifier());
            }
            @Override
@@ -1011,7 +1011,6 @@ public class AccountManager {
     * @param authToken The auth token to invalidate, may be null
     */
    public void invalidateAuthToken(final String accountType, final String authToken) {
        android.util.SeempLog.record(117);
        if (accountType == null) throw new IllegalArgumentException("accountType is null");
        try {
            if (authToken != null) {
@@ -1045,7 +1044,6 @@ public class AccountManager {
     * @see #getAuthToken
     */
    public String peekAuthToken(final Account account, final String authTokenType) {
        android.util.SeempLog.record(121);
        if (account == null) throw new IllegalArgumentException("account is null");
        if (authTokenType == null) throw new IllegalArgumentException("authTokenType is null");
        try {
@@ -1077,7 +1075,7 @@ public class AccountManager {
     * @param password The password to set, null to clear the password
     */
    public void setPassword(final Account account, final String password) {
        android.util.SeempLog.record(29);
        android.util.SeempLog.record(26);
        if (account == null) throw new IllegalArgumentException("account is null");
        try {
            mService.setPassword(account, password);
@@ -1107,7 +1105,7 @@ public class AccountManager {
     * @param account The account whose password to clear
     */
    public void clearPassword(final Account account) {
        android.util.SeempLog.record(30);
        android.util.SeempLog.record(27);
        if (account == null) throw new IllegalArgumentException("account is null");
        try {
            mService.clearPassword(account);
@@ -1136,7 +1134,7 @@ public class AccountManager {
     * @param value String value to set, {@code null} to clear this user data key
     */
    public void setUserData(final Account account, final String key, final String value) {
        android.util.SeempLog.record(31);
        android.util.SeempLog.record(28);
        if (account == null) throw new IllegalArgumentException("account is null");
        if (key == null) throw new IllegalArgumentException("key is null");
        try {
@@ -1167,7 +1165,6 @@ public class AccountManager {
     * @param authToken The auth token to add to the cache
     */
    public void setAuthToken(Account account, final String authTokenType, final String authToken) {
        android.util.SeempLog.record(122);
        if (account == null) throw new IllegalArgumentException("account is null");
        if (authTokenType == null) throw new IllegalArgumentException("authTokenType is null");
        try {
@@ -1289,7 +1286,7 @@ public class AccountManager {
        optionsIn.putString(KEY_ANDROID_PACKAGE_NAME, mContext.getPackageName());
        return new AmsTask(activity, handler, callback) {
            public void doWork() throws RemoteException {
                android.util.SeempLog.record(34);
                android.util.SeempLog.record(31);
                mService.getAuthToken(mResponse, account, authTokenType,
                        false /* notifyOnAuthFailure */, true /* expectActivityLaunch */,
                        optionsIn);
@@ -1458,7 +1455,7 @@ public class AccountManager {
        optionsIn.putString(KEY_ANDROID_PACKAGE_NAME, mContext.getPackageName());
        return new AmsTask(null, handler, callback) {
            public void doWork() throws RemoteException {
                android.util.SeempLog.record(34);
                android.util.SeempLog.record(31);
                mService.getAuthToken(mResponse, account, authTokenType,
                        notifyAuthFailure, false /* expectActivityLaunch */, optionsIn);
            }
@@ -1519,7 +1516,7 @@ public class AccountManager {
            final String authTokenType, final String[] requiredFeatures,
            final Bundle addAccountOptions,
            final Activity activity, AccountManagerCallback<Bundle> callback, Handler handler) {
        android.util.SeempLog.record(32);
        android.util.SeempLog.record(29);
        if (accountType == null) throw new IllegalArgumentException("accountType is null");
        final Bundle optionsIn = new Bundle();
        if (addAccountOptions != null) {
@@ -1529,7 +1526,7 @@ public class AccountManager {

        return new AmsTask(activity, handler, callback) {
            public void doWork() throws RemoteException {
                android.util.SeempLog.record(34);
                android.util.SeempLog.record(31);
                mService.addAccount(mResponse, accountType, authTokenType,
                        requiredFeatures, activity != null, optionsIn);
            }
@@ -1554,7 +1551,7 @@ public class AccountManager {

        return new AmsTask(activity, handler, callback) {
            public void doWork() throws RemoteException {
                android.util.SeempLog.record(34);
                android.util.SeempLog.record(31);
                mService.addAccountAsUser(mResponse, accountType, authTokenType,
                        requiredFeatures, activity != null, optionsIn, userHandle.getIdentifier());
            }
@@ -1712,7 +1709,6 @@ public class AccountManager {
            final Activity activity,
            final AccountManagerCallback<Bundle> callback,
            final Handler handler) {
        android.util.SeempLog.record(116);
        return confirmCredentialsAsUser(account, options, activity, callback, handler,
                Process.myUserHandle());
    }
@@ -1731,7 +1727,7 @@ public class AccountManager {
        final int userId = userHandle.getIdentifier();
        return new AmsTask(activity, handler, callback) {
            public void doWork() throws RemoteException {
                android.util.SeempLog.record(34);
                android.util.SeempLog.record(31);
                mService.confirmCredentialsAsUser(mResponse, account, options, activity != null,
                        userId);
            }
@@ -1791,11 +1787,9 @@ public class AccountManager {
            final Bundle options, final Activity activity,
            final AccountManagerCallback<Bundle> callback,
            final Handler handler) {
        android.util.SeempLog.record(118);
        if (account == null) throw new IllegalArgumentException("account is null");
        return new AmsTask(activity, handler, callback) {
            public void doWork() throws RemoteException {
                android.util.SeempLog.record(34);
                mService.updateCredentials(mResponse, account, authTokenType, activity != null,
                        options);
            }
@@ -1846,11 +1840,11 @@ public class AccountManager {
    public AccountManagerFuture<Bundle> editProperties(final String accountType,
            final Activity activity, final AccountManagerCallback<Bundle> callback,
            final Handler handler) {
        android.util.SeempLog.record(33);
        android.util.SeempLog.record(30);
        if (accountType == null) throw new IllegalArgumentException("accountType is null");
        return new AmsTask(activity, handler, callback) {
            public void doWork() throws RemoteException {
                android.util.SeempLog.record(34);
                android.util.SeempLog.record(31);
                mService.editProperties(mResponse, accountType, activity != null);
            }
        }.start();
@@ -2206,7 +2200,7 @@ public class AccountManager {
        private volatile int mNumAccounts = 0;

        public void doWork() throws RemoteException {
            android.util.SeempLog.record(34);
            android.util.SeempLog.record(31);
            getAccountsByTypeAndFeatures(mAccountType, mFeatures,
                    new AccountManagerCallback<Account[]>() {
                        public void run(AccountManagerFuture<Account[]> future) {
+7 −7
Original line number Diff line number Diff line
@@ -374,7 +374,7 @@ public class Instrumentation {
     * @see Context#startActivity
     */
    public Activity startActivitySync(Intent intent) {
        android.util.SeempLog.record_str(406, intent.toString());
        android.util.SeempLog.record_str(376, intent.toString());
        validateNotAppThread();

        synchronized (mSync) {
@@ -1482,7 +1482,7 @@ public class Instrumentation {
    public ActivityResult execStartActivity(
            Context who, IBinder contextThread, IBinder token, Activity target,
            Intent intent, int requestCode, Bundle options) {
        android.util.SeempLog.record_str(407, intent.toString());
        android.util.SeempLog.record_str(377, intent.toString());
        IApplicationThread whoThread = (IApplicationThread) contextThread;
        Uri referrer = target != null ? target.onProvideReferrer() : null;
        if (referrer != null) {
@@ -1543,7 +1543,7 @@ public class Instrumentation {
    public void execStartActivitiesAsUser(Context who, IBinder contextThread,
            IBinder token, Activity target, Intent[] intents, Bundle options,
            int userId) {
        android.util.SeempLog.record_str(408, intents.toString());
        android.util.SeempLog.record_str(378, intents.toString());
        IApplicationThread whoThread = (IApplicationThread) contextThread;
        if (mActivityMonitors != null) {
            synchronized (mSync) {
@@ -1607,7 +1607,7 @@ public class Instrumentation {
    public ActivityResult execStartActivity(
        Context who, IBinder contextThread, IBinder token, String target,
        Intent intent, int requestCode, Bundle options) {
        android.util.SeempLog.record_str(407, intent.toString());
        android.util.SeempLog.record_str(377, intent.toString());
        IApplicationThread whoThread = (IApplicationThread) contextThread;
        if (mActivityMonitors != null) {
            synchronized (mSync) {
@@ -1668,7 +1668,7 @@ public class Instrumentation {
    public ActivityResult execStartActivity(
            Context who, IBinder contextThread, IBinder token, Activity target,
            Intent intent, int requestCode, Bundle options, UserHandle user) {
        android.util.SeempLog.record_str(407, intent.toString());
        android.util.SeempLog.record_str(377, intent.toString());
        IApplicationThread whoThread = (IApplicationThread) contextThread;
        if (mActivityMonitors != null) {
            synchronized (mSync) {
@@ -1708,7 +1708,7 @@ public class Instrumentation {
            Context who, IBinder contextThread, IBinder token, Activity target,
            Intent intent, int requestCode, Bundle options, boolean ignoreTargetSecurity,
            int userId) {
        android.util.SeempLog.record_str(409, intent.toString());
        android.util.SeempLog.record_str(379, intent.toString());
        IApplicationThread whoThread = (IApplicationThread) contextThread;
        if (mActivityMonitors != null) {
            synchronized (mSync) {
@@ -1747,7 +1747,7 @@ public class Instrumentation {
    public void execStartActivityFromAppTask(
            Context who, IBinder contextThread, IAppTask appTask,
            Intent intent, Bundle options) {
        android.util.SeempLog.record_str(410, intent.toString());
        android.util.SeempLog.record_str(380, intent.toString());
        IApplicationThread whoThread = (IApplicationThread) contextThread;
        if (mActivityMonitors != null) {
            synchronized (mSync) {
+10 −10
Original line number Diff line number Diff line
@@ -538,7 +538,7 @@ public final class BluetoothAdapter {
     * @throws IllegalArgumentException if address is invalid
     */
    public BluetoothDevice getRemoteDevice(String address) {
        android.util.SeempLog.record(79);
        android.util.SeempLog.record(62);
        return new BluetoothDevice(address);
    }

@@ -554,7 +554,7 @@ public final class BluetoothAdapter {
     * @throws IllegalArgumentException if address is invalid
     */
    public BluetoothDevice getRemoteDevice(byte[] address) {
        android.util.SeempLog.record(79);
        android.util.SeempLog.record(62);
        if (address == null || address.length != 6) {
            throw new IllegalArgumentException("Bluetooth address must have 6 bytes");
        }
@@ -786,7 +786,7 @@ public final class BluetoothAdapter {
    @RequiresPermission(Manifest.permission.BLUETOOTH)
    @AdapterState
    public int getState() {
        android.util.SeempLog.record(80);
        android.util.SeempLog.record(63);
        try {
            synchronized(mManagerCallback) {
                if (mService != null)
@@ -883,7 +883,7 @@ public final class BluetoothAdapter {
     */
    @RequiresPermission(Manifest.permission.BLUETOOTH_ADMIN)
    public boolean enable() {
        android.util.SeempLog.record(73);
        android.util.SeempLog.record(56);
        int state = STATE_OFF;
        if (isEnabled() == true){
            if (DBG) Log.d(TAG, "enable(): BT is already enabled..!");
@@ -933,7 +933,7 @@ public final class BluetoothAdapter {
     */
    @RequiresPermission(Manifest.permission.BLUETOOTH_ADMIN)
    public boolean disable() {
        android.util.SeempLog.record(74);
        android.util.SeempLog.record(57);
        try {
            return mManagerService.disable(true);
        } catch (RemoteException e) {Log.e(TAG, "", e);}
@@ -951,7 +951,7 @@ public final class BluetoothAdapter {
     * @hide
     */
    public boolean disable(boolean persist) {
        android.util.SeempLog.record(74);
        android.util.SeempLog.record(57);

        try {
            return mManagerService.disable(persist);
@@ -1196,7 +1196,7 @@ public final class BluetoothAdapter {
     */
    @RequiresPermission(Manifest.permission.BLUETOOTH_ADMIN)
    public boolean startDiscovery() {
        android.util.SeempLog.record(75);
        android.util.SeempLog.record(58);
        if (getState() != STATE_ON) return false;
        try {
            synchronized(mManagerCallback) {
@@ -1415,7 +1415,7 @@ public final class BluetoothAdapter {
     */
    @RequiresPermission(Manifest.permission.BLUETOOTH)
    public Set<BluetoothDevice> getBondedDevices() {
        android.util.SeempLog.record(78);
        android.util.SeempLog.record(61);
        if (getState() != STATE_ON) {
            return toDeviceSet(new BluetoothDevice[0]);
        }
@@ -1468,7 +1468,7 @@ public final class BluetoothAdapter {
     */
    @RequiresPermission(Manifest.permission.BLUETOOTH)
    public int getProfileConnectionState(int profile) {
        android.util.SeempLog.record(81);
        android.util.SeempLog.record(64);
        if (getState() != STATE_ON) return BluetoothProfile.STATE_DISCONNECTED;
        try {
            synchronized(mManagerCallback) {
@@ -1591,7 +1591,7 @@ public final class BluetoothAdapter {
    @RequiresPermission(Manifest.permission.BLUETOOTH)
    public BluetoothServerSocket listenUsingInsecureRfcommWithServiceRecord(String name, UUID uuid)
            throws IOException {
        android.util.SeempLog.record(76);
        android.util.SeempLog.record(59);
        return createNewRfcommSocketAndRecord(name, uuid, false, false);
    }

+3 −3
Original line number Diff line number Diff line
@@ -431,7 +431,7 @@ public abstract class ContentResolver {
    public final @Nullable Cursor query(@NonNull Uri uri, @Nullable String[] projection,
            @Nullable String selection, @Nullable String[] selectionArgs,
            @Nullable String sortOrder) {
        android.util.SeempLog.record(16);
        android.util.SeempLog.record_uri(13, uri);
        return query(uri, projection, selection, selectionArgs, sortOrder, null);
    }

@@ -472,7 +472,7 @@ public abstract class ContentResolver {
    public final @Nullable Cursor query(final @NonNull Uri uri, @Nullable String[] projection,
            @Nullable String selection, @Nullable String[] selectionArgs,
            @Nullable String sortOrder, @Nullable CancellationSignal cancellationSignal) {
        android.util.SeempLog.record(16);
        android.util.SeempLog.record_uri(13, uri);
        Preconditions.checkNotNull(uri, "uri");
        IContentProvider unstableProvider = acquireUnstableProvider(uri);
        if (unstableProvider == null) {
@@ -1223,7 +1223,7 @@ public abstract class ContentResolver {
     * @return the URL of the newly created row.
     */
    public final @Nullable Uri insert(@NonNull Uri url, @Nullable ContentValues values) {
        android.util.SeempLog.record(50);
        android.util.SeempLog.record_uri(37, url);
        Preconditions.checkNotNull(url, "url");
        IContentProvider provider = acquireProvider(url);
        if (provider == null) {
+5 −5
Original line number Diff line number Diff line
@@ -789,7 +789,7 @@ public class Camera {
     * @see android.media.MediaActionSound
     */
    public final void setPreviewCallback(PreviewCallback cb) {
        android.util.SeempLog.record(83);
        android.util.SeempLog.record(66);
        mPreviewCallback = cb;
        mOneShot = false;
        mWithBuffer = false;
@@ -816,7 +816,7 @@ public class Camera {
     * @see android.media.MediaActionSound
     */
    public final void setOneShotPreviewCallback(PreviewCallback cb) {
        android.util.SeempLog.record(85);
        android.util.SeempLog.record(68);
        mPreviewCallback = cb;
        mOneShot = true;
        mWithBuffer = false;
@@ -855,7 +855,7 @@ public class Camera {
     * @see android.media.MediaActionSound
     */
    public final void setPreviewCallbackWithBuffer(PreviewCallback cb) {
        android.util.SeempLog.record(84);
        android.util.SeempLog.record(67);
        mPreviewCallback = cb;
        mOneShot = false;
        mWithBuffer = true;
@@ -1418,7 +1418,7 @@ public class Camera {
     */
    public final void takePicture(ShutterCallback shutter, PictureCallback raw,
            PictureCallback jpeg) {
        android.util.SeempLog.record(82);
        android.util.SeempLog.record(65);
        takePicture(shutter, raw, null, jpeg);
    }
    private native final void native_takePicture(int msgType);
@@ -1454,7 +1454,7 @@ public class Camera {
     */
    public final void takePicture(ShutterCallback shutter, PictureCallback raw,
            PictureCallback postview, PictureCallback jpeg) {
        android.util.SeempLog.record(82);
        android.util.SeempLog.record(65);
        mShutterCallback = shutter;
        mRawImageCallback = raw;
        mPostviewCallback = postview;
Loading