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

Commit aad476af authored by George Chan's avatar George Chan
Browse files

Updated StrongAuthTracker to use internal API with it's own disable reason.

Change-Id: I720c535b04f003118cfeec5c83c1e832b02adb4a
Test: atest UsbServiceTest
Flag: android.hardware.usb.flags.enable_usb_data_signal_staking_internal
Bug: 369382558
parent 477d06b6
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -34,9 +34,11 @@ import java.lang.annotation.RetentionPolicy;
public abstract class UsbManagerInternal {

  public static final int OS_USB_DISABLE_REASON_AAPM = 0;
  public static final int OS_USB_DISABLE_REASON_LOCKDOWN_MODE = 1;

  @Retention(RetentionPolicy.SOURCE)
  @IntDef(value = {OS_USB_DISABLE_REASON_AAPM})
  @IntDef(value = {OS_USB_DISABLE_REASON_AAPM,
    OS_USB_DISABLE_REASON_LOCKDOWN_MODE})
  public @interface OsUsbDisableReason {
  }

+5 −2
Original line number Diff line number Diff line
@@ -1527,8 +1527,11 @@ public class UsbService extends IUsbManager.Stub {
            }
            mLockdownModeStatus = lockDownTriggeredByUser;
            for (UsbPort port: mPortManager.getPorts()) {
                enableUsbData(port.getId(), !lockDownTriggeredByUser, STRONG_AUTH_OPERATION_ID,
                        new IUsbOperationInternal.Default());
                enableUsbDataInternal(port.getId(), !lockDownTriggeredByUser,
                    STRONG_AUTH_OPERATION_ID,
                    new IUsbOperationInternal.Default(),
                    UsbManagerInternal.OS_USB_DISABLE_REASON_LOCKDOWN_MODE,
                    true);
            }
        }
    }