Fix BluetoothUpdateWorkerTest.

Should avoid spying on Android classes due to potential test pollution: https://robolectric.org/best-practices/

Bug: 315399487

Test: atest SettingsRoboTests:com.android.settings.homepage.contextualcards.slices --iterations 20
Change-Id: Ia52baf52bf43d3a3959dc0234fbfc5b4a4575dac
This commit is contained in:
FanWu
2023-12-11 18:06:30 +08:00
committed by Fan Wu
parent 013626ebff
commit e6d648aa40
2 changed files with 11 additions and 16 deletions

View File

@@ -29,6 +29,8 @@ import android.os.SystemClock;
import android.util.ArrayMap;
import android.util.Log;
import androidx.annotation.VisibleForTesting;
import java.io.Closeable;
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
@@ -172,7 +174,8 @@ public abstract class SliceBackgroundWorker<E> implements Closeable {
/**
* Notify that data was updated and attempt to sync changes to the Slice.
*/
protected final void notifySliceChange() {
@VisibleForTesting
public final void notifySliceChange() {
NotifySliceChangeHandler.getInstance().updateSlice(this);
}