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

Commit 8b447969 authored by Kensuke Miyagi's avatar Kensuke Miyagi Committed by Automerger Merge Worker
Browse files

Merge "Fix parameter order of Lnb.addCallback()" into tm-dev am: 4f782d2a

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17085423

Change-Id: Ia7097d0d9d79f6452b0e051c8c56a9328d50142f
parents 8e43739f 4f782d2a
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -6952,7 +6952,7 @@ package android.media.tv.tuner {
  }
  public class Lnb implements java.lang.AutoCloseable {
    method public void addCallback(@NonNull android.media.tv.tuner.LnbCallback, @NonNull java.util.concurrent.Executor);
    method public void addCallback(@NonNull java.util.concurrent.Executor, @NonNull android.media.tv.tuner.LnbCallback);
    method public void close();
    method public boolean removeCallback(@NonNull android.media.tv.tuner.LnbCallback);
    method public int sendDiseqcMessage(@NonNull byte[]);
+5 −5
Original line number Diff line number Diff line
@@ -167,10 +167,10 @@ public class Lnb implements AutoCloseable {

    private Lnb() {}

    void setCallbackAndOwner(Executor executor, @Nullable LnbCallback callback, Tuner tuner) {
    void setCallbackAndOwner(Tuner tuner, Executor executor, @Nullable LnbCallback callback) {
        synchronized (mCallbackLock) {
            if (callback != null && executor != null) {
                addCallback(callback, executor);
                addCallback(executor, callback);
            }
        }
        setOwner(tuner);
@@ -179,12 +179,12 @@ public class Lnb implements AutoCloseable {
    /**
     * Adds LnbCallback
     *
     * @param callback the callback to receive notifications from LNB.
     * @param executor the executor on which callback will be invoked. Cannot be null.
     * @param callback the callback to receive notifications from LNB.
     */
    public void addCallback(@NonNull  LnbCallback callback, @NonNull Executor executor) {
        Objects.requireNonNull(callback, "callback must not be null");
    public void addCallback(@NonNull Executor executor, @NonNull LnbCallback callback) {
        Objects.requireNonNull(executor, "executor must not be null");
        Objects.requireNonNull(callback, "callback must not be null");
        synchronized (mCallbackLock) {
            mCallbackMap.put(callback, executor);
        }
+5 −3
Original line number Diff line number Diff line
@@ -62,7 +62,9 @@ import android.os.Looper;
import android.os.Message;
import android.os.Process;
import android.util.Log;

import com.android.internal.util.FrameworkStatsLog;

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.ref.WeakReference;
@@ -2147,12 +2149,12 @@ public class Tuner implements AutoCloseable {
            Objects.requireNonNull(executor, "executor must not be null");
            Objects.requireNonNull(cb, "LnbCallback must not be null");
            if (mLnb != null) {
                mLnb.setCallbackAndOwner(executor, cb, this);
                mLnb.setCallbackAndOwner(this, executor, cb);
                return mLnb;
            }
            if (checkResource(TunerResourceManager.TUNER_RESOURCE_TYPE_LNB, mLnbLock)
                    && mLnb != null) {
                mLnb.setCallbackAndOwner(executor, cb, this);
                mLnb.setCallbackAndOwner(this, executor, cb);
                setLnb(mLnb);
                return mLnb;
            }
@@ -2186,7 +2188,7 @@ public class Tuner implements AutoCloseable {
                    mLnbHandle = null;
                }
                mLnb = newLnb;
                mLnb.setCallbackAndOwner(executor, cb, this);
                mLnb.setCallbackAndOwner(this, executor, cb);
                setLnb(mLnb);
            }
            return mLnb;