Support blink scan
Allow scan again if callback and executor are same as before. bug: 173239634 Test: atest -c TunerTest Change-Id: Iec5ba453b3d3d40c0d96fda5c7288b79898d9aea
This commit is contained in:
@@ -740,10 +740,14 @@ public class Tuner implements AutoCloseable {
|
|||||||
@Result
|
@Result
|
||||||
public int scan(@NonNull FrontendSettings settings, @ScanType int scanType,
|
public int scan(@NonNull FrontendSettings settings, @ScanType int scanType,
|
||||||
@NonNull @CallbackExecutor Executor executor, @NonNull ScanCallback scanCallback) {
|
@NonNull @CallbackExecutor Executor executor, @NonNull ScanCallback scanCallback) {
|
||||||
if (mScanCallback != null || mScanCallbackExecutor != null) {
|
/**
|
||||||
|
* Scan can be called again for blink scan if scanCallback and executor are same as before.
|
||||||
|
*/
|
||||||
|
if (((mScanCallback != null) && (mScanCallback != scanCallback))
|
||||||
|
|| ((mScanCallbackExecutor != null) && (mScanCallbackExecutor != executor))) {
|
||||||
throw new IllegalStateException(
|
throw new IllegalStateException(
|
||||||
"Scan already in progress. stopScan must be called before a new scan can be "
|
"Different Scan session already in progress. stopScan must be called "
|
||||||
+ "started.");
|
+ "before a new scan session can be " + "started.");
|
||||||
}
|
}
|
||||||
mFrontendType = settings.getType();
|
mFrontendType = settings.getType();
|
||||||
if (mFrontendType == FrontendSettings.TYPE_DTMB) {
|
if (mFrontendType == FrontendSettings.TYPE_DTMB) {
|
||||||
|
|||||||
Reference in New Issue
Block a user