USB Accessory Device Charging Behavior Changed with iOS18

Hello,

We are experiencing some issues with our USB accessory unexpectedly charging the iOS device it is connected with only when the iOS device supports USB-C and is on iOS 18+

The following is a description of the discrepancy we note between iOS versions:

  • After performing a USB Role switch, our Accessory becomes a typical USB Device and the Apple device becomes the USB host.

with iOS 17: 


  • The Accessory then sends a PowerSourceUpdate message to the iOS 17 device via iAP2 protocol. Apple device has a USB Type C Connector. *

  • We are specifying:

  1. AvailableCurrentForDevice = 0 mA 
  2. DeviceBatteryShouldChargeIfPowerIsPresent = 1.
  • Three observations:
  1. iPad Battery Settings page -  we observe  'Last charged to…' (indicating no charging)
  2. On the Lumify App running (iOS 17), we observe that UIKit.current.batteryState indicated 'Not charging'
  3. Battery icon on top right of the screen indicates 'No Charging'

with iOS 18:

  • The same Accessory sends the same PowerSourceUpdate message to the iOS 18 device via iAP2 protocol using USB Type C Connector.

  • We are specifying the same:

  1. AvailableCurrentForDevice = 0 mA
  2. DeviceBatteryShouldChargeIfPowerIsPresent = 1.
  • We observe:
  1. iPad Battery Settings page -  we observe  'Charging' 
  2. On the Lumify App running (iOS 18), we observe that UIKit.current.batteryState indicated 'Charging'
  3. Battery icon on top right of the screen indicates 'No Charging'

Please could you help us understand why the Battery status is showing as 'Charging' in the Settings page and with the 'UIKit.current.batteryState' even though we have specified 'AvailableCurrentForDevice = 0 mA'?


Since our accessory is heavily reliant on the Battery status / Charging state, is there potentially another way we get an accurate battery charging status that we are missing? Or are there other suggestions outside of what we do currently to ensure our accessory does not place the iOS18 device into a charging state?

So, three points here:

  1. The MFi program has its own support process, which you can find more information on in the "MFi Portal Technical Support" section of the MFi Licensing Handbook on the MFi portal. I have one brief comment (see below), but a more detailed investigation should go through that process.

  2. Regardless of what you find (see below), please file a bug on this and then post that number back here. Something is obviously wrong here and we should correct that.

  3. Has anything actually changed in terms of what's actually happening on the USB bus? If actual bus behavior hasn't changed, then I think this is basically just a bug. Note that the main reason split behavior like this happen:

  1. iPad Battery Settings page - we observe 'Charging'
  2. On the Lumify App running (iOS 18), we observe that UIKit.current.batteryState indicated 'Charging'

Versus:

  1. Battery icon on top right of the screen indicates 'No Charging'

...is that the first two case are pulling from one API and the second case is pulling from a different (typically lower level) API.

In any case, the first thing to sort out here is whether there's been an actually behavior change here (and the battery indicator is wrong) or whether UIKit.current.batteryState is just returning the wrong value.

__
Kevin Elliott
DTS Engineer, CoreOS/Hardware

Thank you Kevin for this detailed response!

I have submitted an MFI DTS ticket now. It has the case ID: (Case-ID: 12584819)

I am additionally going to file a bug as you suggested as well and am just gathering all the needed information for that (mainly getting a good sysdiagnose log to include there). I will update here with the number for this issue once I have it submitted as well.

As far as anything changing in terms of USB bus behavior, It should be untouched since the time of the initial accessory development so I suppose this leans more towards the bug potential.

We have some further info after measuring the current flowing into the iOS device in both cases as well:

Conditions: On Boot up PowerSourceUpdate msg sent by LPM to iPad -> AvailableCurrentForDevice = 0 mA

iOS 17 Ipad Battery Level 31 PowerUpdate message parameters sent by iPad to LPM MaximumCurrentDrawnFromAccessory 0 DeviceBatteryWillChargeIfPowerIsPresent 0 IsExternalChargerConnected 0 BatteryChargingState 1 BatteryChargeLevel 30 Current measured at Connector 420 mA -> 0 mA

iOS 18 Ipad Battery Level 46 PowerUpdate message parameters sent by iPad to LPM MaximumCurrentDrawnFromAccessory 0 DeviceBatteryWillChargeIfPowerIsPresent 0 IsExternalChargerConnected 0 BatteryChargingState 1 BatteryChargeLevel 45 Current measured at Connector 420 mA -> Persists at 420mA

I'll be sure to include this above information in that new bug when it is written as well.

Thank you, Nick

Hello again,

I have filed a bug following that Bug Reporting best practices info. the bug number is FB16918962.

I'll continue to assure we verify the USB portion on our side to assure further that nothing was missed there as well.

Let me know if I can provide anything further to help the investigation.

Best, Nick

Hi @DTS Engineer - Thank you for your help on this issue. We wanted to get an update on any investigation that has happened in the past week. Because we have a growing set of customers currently being affected by this issue and it's getting in the way of their ability to scan patients on devices with iOS 18, we need to give them updates and appreciate any you can provide. Is there anything further or data we can provide to help in the investigation? We are flexible to get on a call if that would help as well. Thank you!

SO, as some late follow up, I can explain what's going on here. Let me start with the easier case:

  1. iPad Battery Settings page - we observe 'Charging'
  2. On the Lumify App running (iOS 18), we observe that UIKit.current.batteryState indicated 'Charging'

Both of these simply mean that the device is drawing some amount of power.

That leads to here:

  1. Battery icon on top right of the screen indicates 'No Charging'

...the complication here is that the the "low" end of the USB charging spec is WELL below what an iPad consumes under normal use. That means it's entirely possible for an iPad battery to be draining (and the iPad to eventually die) even though the device is technical receiving some amount of power.

That's what the "No Charging" here actually means. The iPad may be drawing some amount of power, but it isn't enough power for the battery to actually be accumulating battery life.

Having said that, I'd certainly encourage anyone interested in these issues to file bugs asking us to provide better API support for this area. At the point, the power range available on USB/Thunderbolt has gotten so wide that it might be worth expanding the API to provide a bit more data about what's actually going on.

__
Kevin Elliott
DTS Engineer, CoreOS/Hardware

USB Accessory Device Charging Behavior Changed with iOS18
 
 
Q