smartdevicelink / sdl_ios

Get your app connected to the 🚙, make your users feel like a 🌟
www.smartdevicelink.com
BSD 3-Clause "New" or "Revised" License
170 stars 105 forks source link

Battery Drain on Disconnect #1889

Closed kmicha19-ford closed 3 years ago

kmicha19-ford commented 3 years ago

Bug Report

iPhones may experience significant battery drain after disconnecting from Sync 3 or Sync 4 - USB and Bluetooth. This has resulted in one star reviews on the App Store. Apple reports that we are not closing EASessions after disconnect.

Reproduction Steps

Possible combination of events that may produce the problem.

With AppLink enabled:

  1. Close FP App, Connect Phone, Wait for AppLink ready, Disconnect Phone
  2. Close FP App, Connect Phone, Open FP AppLink App, Disconnect Phone
  3. Close FP App, Connect Phone, Open FP AppLink App, Open FP App, Disconnect Phone
  4. Open FP App, Connect Phone, Wait for AppLink ready, Disconnect Phone,
  5. Open FP App, Connect Phone, Open FP AppLink App, Disconnect Phone

With CarPlay enabled:

  1. Close FP App. Connect Phone, Wait for CarPlay screen to appear, Disconnect Phone
  2. Close FP App. Connect Phone, Wait for CarPlay screen to appear, Open some CarPlay Apps, Disconnect Phone
  3. Close FP App. Connect Phone, Wait for CarPlay screen to appear, Open some CarPlay Apps, Open FP App, Disconnect Phone
  4. Open FP App. Connect Phone, Wait for CarPlay screen to appear, Open some CarPlay Apps, Disconnect Phone

Expected Behavior

Disconnecting the phone should not result in an unexpected battery drain

Observed Behavior

Battery may drain nearly empty in a matter of hours. Phones may become noticeably warm Neither closing the app nor rebooting the phone is known to stop the battery drain Users uninstall the app Users write one star reviews

OS & Version Information

iOS Version 14.0 SDL iOS Version: 7.0.0 Testing Against: n/a

joeljfischer commented 3 years ago

Hi @kmicha19-ford, it looks like this is a duplicate of #1799

kmicha19-ford commented 3 years ago

This issue supercedes #1799 which was created back in October and should be closed.

joeljfischer commented 3 years ago

@kshala-ford @thedavidharris are you okay with that? To me it seems like the information contained here should just be a comment on #1799 so that we don't lose the historical context and tracking.

kmicha19-ford commented 3 years ago

Some more info. I started working on the battery drain problem in late November, as fresh set of eyes on the problem. The end result is a refactor of code in the SDL with OEM Integrations repo used by ACVL. This refactor is now in FordPass release 3.14. I created this Battery Drain on Disconnect on the public repo so I can create a PR with this same code changes. The PR comments and code will detail the code changes and an archtectural change from using inheritance to compostion. The code mentioned in 1799 will be gone with this refactor. Closing 1799 is a suggestion but that's all.

kmicha19-ford commented 3 years ago

Closing issue. Will use #1799 instead.