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

Commit 6cfef54b authored by David Su's avatar David Su
Browse files

AsyncChannel: Migrate Slog to Log to enable Jarjaring

AsyncChannel & AsyncService both use Slog, which is
@hide, so jarjar'ing them would still lead to @hide API
usages.
Migrate to Log, which is public, so that AsyncChannel &
AsyncService can be jarjar'ed.

Bug: 145409537
Test: compiles
Change-Id: Ic0b9e8d66d575925cb1972e20721dd53c85307e6
parent 453dc24e
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -29,7 +29,7 @@ import android.os.Looper;
import android.os.Message;
import android.os.Messenger;
import android.os.RemoteException;
import android.util.Slog;
import android.util.Log;

import java.util.Stack;

@@ -841,7 +841,7 @@ public class AsyncChannel {
                    msg.replyTo = sm.mMessenger;
                    synchronized (sm.mHandler.mLockObject) {
                        if (sm.mHandler.mResultMsg != null) {
                            Slog.wtf(TAG, "mResultMsg should be null here");
                            Log.wtf(TAG, "mResultMsg should be null here");
                            sm.mHandler.mResultMsg = null;
                        }
                        dstMessenger.send(msg);
@@ -851,9 +851,9 @@ public class AsyncChannel {
                    }
                }
            } catch (InterruptedException e) {
                Slog.e(TAG, "error in sendMessageSynchronously", e);
                Log.e(TAG, "error in sendMessageSynchronously", e);
            } catch (RemoteException e) {
                Slog.e(TAG, "error in sendMessageSynchronously", e);
                Log.e(TAG, "error in sendMessageSynchronously", e);
            }
            sm.recycle();
            return resultMsg;
@@ -939,7 +939,7 @@ public class AsyncChannel {
     * @param s
     */
    private static void log(String s) {
        Slog.d(TAG, s);
        Log.d(TAG, s);
    }

    private final class DeathMonitor implements IBinder.DeathRecipient {
+3 −3
Original line number Diff line number Diff line
@@ -22,7 +22,7 @@ import android.os.Handler;
import android.os.IBinder;
import android.os.Message;
import android.os.Messenger;
import android.util.Slog;
import android.util.Log;

/**
 * A service that receives Intents and IBinder transactions
@@ -92,7 +92,7 @@ abstract public class AsyncService extends Service {
     */
    @Override
    public int onStartCommand(Intent intent, int flags, int startId) {
        if (DBG) Slog.d(TAG, "onStartCommand");
        if (DBG) Log.d(TAG, "onStartCommand");

        Message msg = mHandler.obtainMessage();
        msg.what = CMD_ASYNC_SERVICE_ON_START_INTENT;
@@ -111,7 +111,7 @@ abstract public class AsyncService extends Service {
     */
    @Override
    public void onDestroy() {
        if (DBG) Slog.d(TAG, "onDestroy");
        if (DBG) Log.d(TAG, "onDestroy");

        Message msg = mHandler.obtainMessage();
        msg.what = CMD_ASYNC_SERVICE_DESTROY;