Merge "Fix parameter order of Lnb.addCallback()" into tm-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
4f782d2a2a
@@ -6946,7 +6946,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[]);
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user