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

Commit 558d9f87 authored by Vania Januar's avatar Vania Januar
Browse files

Add the USB device parameter to usb stylus feature preference provider.

Test: StylusUsbFirmwareControllerTest
Bug: 291922092
Change-Id: Ie43bceb807e18ff56d01f6e99316db6e2820383b
parent 270b7ef1
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -41,7 +41,8 @@ public interface StylusFeatureProvider {
     * the list will contain only the preference showing the current firmware version.
     *
     * @param context The context
     * @param usbDevice The USB device for which to generate preferences.
     */
    @Nullable
    List<Preference> getUsbFirmwareUpdatePreferences(Context context);
    List<Preference> getUsbFirmwareUpdatePreferences(Context context, UsbDevice usbDevice);
}
+1 −1
Original line number Diff line number Diff line
@@ -31,7 +31,7 @@ public class StylusFeatureProviderImpl implements StylusFeatureProvider {
    }

    @Override
    public List<Preference> getUsbFirmwareUpdatePreferences(Context context) {
    public List<Preference> getUsbFirmwareUpdatePreferences(Context context, UsbDevice usbDevice) {
        return null;
    }
}
+1 −1
Original line number Diff line number Diff line
@@ -88,7 +88,7 @@ public class StylusUsbFirmwareController extends BasePreferenceController
            StylusFeatureProvider featureProvider = FeatureFactory.getFactory(
                    mContext).getStylusFeatureProvider();
            List<Preference> preferences =
                    featureProvider.getUsbFirmwareUpdatePreferences(mContext);
                    featureProvider.getUsbFirmwareUpdatePreferences(mContext, mStylusUsbDevice);

            if (preferences != null) {
                mPreference = new PreferenceCategory(mContext);
+1 −1
Original line number Diff line number Diff line
@@ -157,7 +157,7 @@ public class StylusUsbFirmwareControllerTest {
        when(mFeatureFactory.getStylusFeatureProvider()
                .isUsbFirmwareUpdateEnabled(any())).thenReturn(true);
        when(mFeatureFactory.getStylusFeatureProvider()
                .getUsbFirmwareUpdatePreferences(any()))
                .getUsbFirmwareUpdatePreferences(any(), any()))
                .thenReturn(Collections.singletonList(mock(Preference.class)));
    }
}