Check custom component names before aggregating BatteryUsageStats snapshots

If the lists of custom power components do not match, a crash will occur.
Instead of causing a crash, simply skip incompatible snapshots.

Bug: 196040329
Bug: 200511361
Test: atest FrameworksCoreTests:com.android.internal.os.BatteryUsageStatsProviderTest

Change-Id: I87ba605371a5f3119dcff33f6109e94ee46ab57d
(cherry picked from commit a1ea9ecd56fce8bb84fc673650b6be7282ea0e99)
5 files changed