9026 Commits

Author SHA1 Message Date
Les Lee
6ca5c25bf4 wifi data usage: replaced Wi-Fi SSID with a Wi-Fi network key
1. Used SSID to be a wifi network identity can't separate wifi
data usage when there are two different network with same SSID.
Use a new usage key from WifiInfo to replace wifi SSID to solve
this issue.

2. To support to query wifi usage per configured Wifi network.
Adding matchWifiNetworkKeys in NetworkTemplate to support querying
multi networkKeys wifi data usage since each configured Wifi
network configuration might be used to connect different Wifi
network. (Replace mNetworkId with mMatchWifiNetworkKeys)

3. Updated callers who were using NetworkTemplate constructor.

4. Fixed SortedSet null order case. The null subscriberId is a
valid input for matchSubscriberIds.

5. Replaced ArrayUtils with CollectionUtils.

Bug: 197520752
Bug: 126299427
Test: atest -c NetworkTemplateTest
Test: atest -c NetworkStatsServiceTest
Test: atest -c NetworkPolicyManagerServiceTest
Test: atest -c NetworkPolicyTest
Change-Id: Ie20e7fb56597817901be4ce1d2a7afcbc9ded0c6
2022-01-03 15:13:00 +08:00
Junyu Lai
96a19bcaba [MS14] Move isPersistable to NetworkPolicy
Since the NetworkTemplate serialization is done in the platform
code. To decide whether the template is persistable should be
also inside the platform along with the serialization logic.

Test: atest NetworkPolicyTest
Bug: 204830222
Change-Id: I15d17dda77e6a3e1ae11275915e3d2f6e2888639
2021-12-21 10:05:47 +00:00
Junyu Lai
895f993439 Merge "[MS01] Move NetworkTemplate cloud backup functions to NetworkPolicy" am: 40eb40302d
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1878037

Change-Id: I86a23381b25fba2512c2ad1d3ffeb60d12947202
2021-12-10 22:30:19 +00:00
Junyu Lai
650ee7a1d1 [MS01] Move NetworkTemplate cloud backup functions to NetworkPolicy
Since NetworkTemplate will be moved into the mainline module.
It is necessary to remove hidden BackupUtil usage from
NetworkTemplate. Also, it is also a hazard to maintain
compatibility for byte buffer interfaces.

Thus, move out these cloud backup functions to NetworkPolicy
to address these concerns.

Test: atest NetworkPolicyTest NetworkPolicyManagerServiceTest
Bug: 204830222
Change-Id: I3ec55f7e419ea13db535acff2457d8e7aaebdce8
2021-12-10 16:11:09 +00:00
Victor Chang
4bd88f5cd6 Merge changes from topic "icu70" am: da0880a0fe
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1914692

Change-Id: Ibbdc18a918397f831eac512394bd31e9f1038c18
2021-12-09 10:20:52 +00:00
Victor Chang
da0880a0fe Merge changes from topic "icu70"
* changes:
  Update DateIntervalFormatTest due to ICU 70 data change
  Regenerate LocaleDataTables.cpp due to ICU 70 upgrade
2021-12-09 10:03:02 +00:00
Victor Chang
93ae9cd316 Update DateIntervalFormatTest due to ICU 70 data change
Bug: 202948901
Test: atest android.text.format.DateIntervalFormatTest
Change-Id: I1b9a6654a9db8d1fb2ea2bbb426e36934604b4aa
2021-12-08 15:13:49 +00:00
Treehugger Robot
d45c9f3d32 Merge changes from topic "parse_audio_config_for_le_device" am: f0dd744ba6
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1909755

Change-Id: I49471afddbf23731aa6baad9e013c9ae3a9d95cb
2021-12-08 03:54:17 +00:00
Patty
b8fe694317 Parse audio config codec capability for LE devices am: ae425ca614
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1881112

Change-Id: I7cab6bd9cc4bc2fbf6201c88b1f890a88a7c3bd2
2021-12-08 03:54:09 +00:00
Treehugger Robot
f0dd744ba6 Merge changes from topic "parse_audio_config_for_le_device"
* changes:
  Remove unnecessary test case
  Parse audio config codec capability for LE devices
2021-12-08 03:28:10 +00:00
Etienne Ruffieux
60ee51b45b Merge "Make BluetoothCodecConfig and BluetoothCodecStatus public." am: 720d74c835
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1849460

Change-Id: I3ac378fa125304253ffc8235642c292084af19d1
2021-12-06 15:40:20 +00:00
Patty
745b5edc47 Remove unnecessary test case
Tag: #refactor
Bug: 203535499
Bug: 150670922
Test: atest BluetoothLeAudioCodecConfigTest BluetoothInstrumentationTests
Change-Id: I5f3301c96990becca0f8baa0a5e61502c411e83c
2021-12-06 23:33:03 +08:00
Etienne Ruffieux
7121cd7fa5 Make BluetoothCodecConfig and BluetoothCodecStatus public.
Made BluetoothCodecConfig and BluetoothCodecStatus public,
added Builder to BluetoothCodecConfig, added accessor for
SOURCE_CODEC_TYPE_MAX and changed Arrays returns to List.

Tag: #feature
Bug: 200202780
Bug: 170678351
Test: BluetoothCodecConfigTest & BluetoothCodecStatusTest
NoNonSdkCheck: Only user actually requested the changes
Change-Id: Ic61b7087f53f45781f7e0eecca8b6d983093a22d
2021-12-03 23:08:50 +00:00
Patty
ae425ca614 Parse audio config codec capability for LE devices
1. Rename function getHwOffloadEncodingFormatsSupportedForA2DP
    to getHwOffloadFormatsSupportedForBluetoothMedia
 2. Add audio format for LC3
 3. Add public class BluetoothLeAudioCodecConfig to store the
    codec for LE audio
 4. Add test case for BluetoothLeAudioCodecConfig

Tag: #feature
Bug: 203535499
Bug: 150670922
Test: atest BluetoothLeAudioCodecConfigTest BluetoothInstrumentationTests
Change-Id: I5f64d9078ca2c07e13cffd83b879dd95468ed313
Merged-In: I5f64d9078ca2c07e13cffd83b879dd95468ed313
2021-12-02 21:59:26 +08:00
Xin Li
10d9972786 Merge sc-qpr1-dev-plus-aosp-without-vendor@7810918
Bug: 205056467
Merged-In: I13199bc39e9445929195f3d15579cbffe94e92b0
Change-Id: I35fa3c6c2abf679c51033f1395a08d511ed8739f
2021-11-18 17:00:37 +00:00
Makoto Onuki
2c8647da7e Merge "Making the AM team owner of some tests" 2021-11-12 19:07:53 +00:00
Makoto Onuki
ebbe751713 Making the AM team owner of some tests
Bug: N/A
Test: treehugger
Change-Id: I07452fb368cef58f52b49dfe5df8d566bf0c665a
2021-11-11 11:45:17 -08:00
satayev
73c5df816c Update compat owners.
Bug: N/A
Test: N/A
Change-Id: I548b7310c7b77fbcdf3c6f7d85bde8d0129cf460
2021-11-10 15:35:30 +00:00
Bernardo Rufino
98a4a1b8b9 Merge "Add range-based Parcel.compareData()" 2021-11-01 11:27:05 +00:00
Bernardo Rufino
7e4edf5be1 Add range-based Parcel.compareData()
To be used by lazy value. Now, we also remove getValueParcel() that was
copying the section of the parcel since we don't need that anymore.

Test: atest -d android.os.cts.ParcelTest android.os.cts.BundleTest android.os.BundleTest android.os.ParcelTest
Bug: 195622897
Change-Id: Ic8a0d1b6a268a81df7a1e56fa1e4b307a25210b6
2021-10-28 09:19:34 +01:00
Treehugger Robot
d3dfca9c68 Merge "Remove bytes matcher from base" 2021-10-27 18:26:37 +00:00
Daniel Norman
653a1c1a28 Fix RRO loading from inside APEXes.
APEXes can already contain RRO APKs by using the 'rro' apex Soong
module field. However, these RROs were not being loaded properly by
Zygote or PackageManagerService.

For all RROs inside APEXes, the RRO uses the same overlay config that
is used for other RROs on the APEX's preinstalled partition.

For RROs targeting 'android', which are installed by Zygote
using AssetManager:
1. OverlayConfig looks for active APEXes in the apex-info-list file,
   which is already accessible to Zygote.
2. OverlayConfig passes the APEX module names to OverlayConfigParser,
   for each preinstalled-partition.
3. OverlayConfigParser uses OverlayScanner to scan the
   each /apex/<APEX>/overlay directory.

For other RROs:
1. PackageManagerService already parses and provides RROs inside APEXes
   to OverlayConfig.
2. RROs inside APEXes used to have no config rule applied because their
   path prefix (/apex/) did not match any partition rule. Now, their
   preinstalled path is used instead.

Bug: 199200417
Test: Define a static RRO targeting 'android' inside a /vendor APEX.
      Define a static RRO for settings provider inside a /vendor APEX.
      Observe APEXes are enabled by default.
Test: Make a change to an RRO inside a /vendor APEX.
      m <apex>; adb install <apex artifact>; adb reboot;
      Observe change has taken effect.
Change-Id: I2bce9bc704789329b8c6aac6d476f17ff6718e0f
Merged-In: I2bce9bc704789329b8c6aac6d476f17ff6718e0f
2021-10-25 13:04:24 -07:00
Rahul Sabnis
a12c77ab44 Merge "Adding @SystemApi annotation to Bluetooth energy stats." 2021-10-25 16:21:35 +00:00
Etienne Ruffieux
d372361fe3 Adding @SystemApi annotation to Bluetooth energy stats.
Added @SystemApi annotation to BluetoothActivityEnergyInfo
and UidTraffic getters for mainline compatibility. Replaced
raw array by List. Deleted unused constructors.

Tag: #feature
Bug: 200201373
Test: Manual
Change-Id: Id93215f48bf08d31ac269af9e064cf598f50b6d3
2021-10-21 20:39:31 +00:00
Neil Fuller
a0db5578fc Fix error prone warnings
Fix warnings introduced by previous commits and add @RunWith annotation
to new tests for consistency with existing tests.

Bug: 199481251
Test: Treehugger only
Change-Id: Iaec4caa80b15112bce84268adc6d763198f0ff61
2021-10-19 18:45:14 +01:00
Neil Fuller
c9bbe6b59e Fix SntpClient 2036 issue (2/2)
Fix issue with SntpClient after the end of NTP era 0 (2036).

This is the second of two commits. This commit makes the actual fixes
and makes tests pass.

Before this change SntpClient converted to Unix epoch times too eagerly.
NTP 64-bit timestamps are lossy: they only hold the number of seconds /
factions of seconds in the NTP era and the era is not transmitted. The
existing code assumed the era was always era 0, which ends in 2036.

As explained at https://www.eecis.udel.edu/~mills/y2k.html,
the lossiness of the type is not an issue providing that the maths is
implemented carefully: the NTP timestamps are only ever subtracted from
each other, are always assumed to be in the same or adjacent NTP eras,
and are used to calculate offsets that are applied to client Unix epoch
times.

This commit:

+ Switches to use a dedicated Timestamp64 type, avoiding the use
of the Unix epoch.
+ Switches to use a dedicated Duration64 type for holding the
32-bit signed difference between two Timestamp64 instances.
+ Simplifies the readTimeStamp() and writeTimeStamp() methods.
+ Adds missing validation covered by a TODO. The code was randomizing
the lower bits of the client transmit timestamp, but then not checking
the result as it should, presumably because it was difficult to know
what value was sent. Easily fixed with a dedicated type.
+ Stops randomizing the lower bits of various other timestamps
unnecessarily.
+ Fixes some naming to add clarity.

Bug: 199481251
Test: atest core/tests/coretests/src/android/net/sntp/Timestamp64Test.java
Test: atest core/tests/coretests/src/android/net/sntp/Duration64Test.java
Test: atest core/tests/coretests/src/android/net/SntpClientTest.java
Merged-In: I6d3584f318b0ef6ceab42bb88f20c73b0ad006cb
Change-Id: I6d3584f318b0ef6ceab42bb88f20c73b0ad006cb
2021-10-19 18:22:43 +01:00
Neil Fuller
f663ab4276 Fix SntpClient 2036 issue (1/2)
Fix issue with SntpClient after the end of NTP era 0 (2036).

This commit is 1/2. It makes some refactoring changes, lint fixes, adds
tests and introduces types that will be used in 2/2. Some of the added
tests fail and demonstrate the issue being fixed with the current
implementation.

-----

Failures that demonstrate the bug:

android.net.SntpClientTest#testRequestTime_era1ClientEra1Server

STACKTRACE:
junit.framework.AssertionFailedError: expected=5, actual=-4294967295995, allowedSlop=1
	at junit.framework.Assert.fail(Assert.java:50)
	at junit.framework.Assert.assertTrue(Assert.java:20)
	at android.net.SntpClientTest.assertNearlyEquals(SntpClientTest.java:502)
	at android.net.SntpClientTest.checkRequestTimeCalcs(SntpClientTest.java:215)
	at android.net.SntpClientTest.testRequestTime_era1ClientEra1Server(SntpClientTest.java:201)

android.net.SntpClientTest#testRequestTime_era0ClientEra1Server: FAILED (145ms)

STACKTRACE:
junit.framework.AssertionFailedError: expected=1139293696005, actual=-3155673599995, allowedSlop=1
	at junit.framework.Assert.fail(Assert.java:50)
	at junit.framework.Assert.assertTrue(Assert.java:20)
	at android.net.SntpClientTest.assertNearlyEquals(SntpClientTest.java:502)
	at android.net.SntpClientTest.checkRequestTimeCalcs(SntpClientTest.java:215)
	at android.net.SntpClientTest.testRequestTime_era0ClientEra1Server(SntpClientTest.java:174)

android.net.SntpClientTest#testNonMatchingOriginateTime: FAILED (116ms)

STACKTRACE:
junit.framework.AssertionFailedError
	at junit.framework.Assert.fail(Assert.java:48)
	at junit.framework.Assert.assertTrue(Assert.java:20)
	at junit.framework.Assert.assertFalse(Assert.java:34)
	at junit.framework.Assert.assertFalse(Assert.java:41)
	at android.net.SntpClientTest.testNonMatchingOriginateTime(SntpClientTest.java:384)

------

This commit:

+ Introduces a dedicated Timestamp64 type + test for holding NTP
timestamps.
+ Introduces a dedicated Duration64 type + test for holding the
32-bit signed difference between two Timestamp64 instances.
+ Fixes some naming to add clarity / addresses lint issues.
+ Adjusts tests

Tests are NOT expected to pass with just this commit. See 2/2.

Bug: 199481251
Test: atest core/tests/coretests/src/android/net/sntp/Timestamp64Test.java
Test: atest core/tests/coretests/src/android/net/sntp/Duration64Test.java
Test: atest core/tests/coretests/src/android/net/SntpClientTest.java
Merged-In: Ifdaada39298b05c48a3207fe6c0fad71c8a0a252
Change-Id: Ifdaada39298b05c48a3207fe6c0fad71c8a0a252
2021-10-19 18:22:16 +01:00
Treehugger Robot
fdc344e6b6 Merge "Removed Bluetooh ScanFilter hidden API usage." 2021-10-19 14:41:30 +00:00
Neil Fuller
3725e9c638 Attempt 2 for adding OWNERS for SNTP code
Commit e5ad1297165888eb5eef24c1985e64b18b8fb88b combined with pending
reviews demonstrated the OWNERS syntax has quirks and it is not working
as intended.

Documentation used:
https://android-review.googlesource.com/plugins/code-owners/Documentation/backend-find-owners.html#syntax

The syntax guide recommends that patterns like sub-dir/* aren't used as
they can cause problems when renaming directories; better to have OWNERS
in the sub-dir. The pattern sntp/* didn't appear to be working (perhaps
because of spaces).

Test: None
Bug: 199481251
Change-Id: I193744eaaad529b9680d3ccf905b86d68f62f7ff
2021-10-14 13:28:57 +01:00
Neil Fuller
e26bbeb94a Adjust OWNERS to reflect new ownership
This changes owners files based on latest org changes and changes
links to improve maintainability.

Changes:
+ It removes a specific owner from most to reduce future maintenance.
+ It adds indirection so android/app references the associated service
code, tests reference the OWNERS of the code under test.
+ services/core/java/com/android/server/timezonedetector/OWNERS is the
single list of time / time zone detector maintainers.
+ Code associated with time zone rules moved to libcore/ ownership
+ It adds one new file for an upcoming commit.
+ Added documentation around API purpose to API OWNERS files, since
there are multiple similar-looking package names with different purposes
/ clients.

Test: None
Bug: 189810551
Change-Id: I948d4b8eff59f3cd5ff63018949e49679795a5c0
2021-10-13 13:57:42 +01:00
Michael Wright
313839a2d9 Update haptics OWNERS
Change-Id: I265d27cdb721616bf56c3b34c9d239b3e962e98c
2021-10-12 14:29:03 +00:00
William Escande
7e44ac5f8b Remove bytes matcher from base
Bytes matcher has been moved to frameworks/libs/modules-utils in this
CL: aosp/1821533

Bug: 200202780
Tag: #refactor
Test: atest cts/tests/tests/bluetooth/src/android/bluetooth/cts/ScanRecordTest.java frameworks/base/core/tests/bluetoothtests/src/android/bluetooth/le/ScanRecordTest.java
Change-Id: I4d374217100635a49918f8e88f2cb5327e758e9f
2021-10-11 11:47:56 +02:00
Etienne Ruffieux
9aeb446826 Removed Bluetooh ScanFilter hidden API usage.
Replaced hidden API usage in Companion by public
methods.

Tag: #feature
Bug: 200202917
Test: atest CompanionTests
Change-Id: Ifc7cdcbf40e23d1c8870e4dcd44772dcae55120a
2021-10-07 14:55:27 +00:00
Bernardo Rufino
8e6a8db691 Merge "Change defusing for lazy bundles" am: fdd1771a4a am: 3f3c3a02c2 am: 104767cc75
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1842142

Change-Id: I0e82653ac77ce4940a0690c12e74478be197f5ee
2021-10-06 09:21:01 +00:00
Bernardo Rufino
3f3c3a02c2 Merge "Change defusing for lazy bundles" am: fdd1771a4a
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1842142

Change-Id: Ia156038712d6a25acfea8aaa6ac1d257afa95345
2021-10-06 08:57:27 +00:00
Bernardo Rufino
0c5074ede7 Change defusing for lazy bundles
With lazy bundle, exceptions thrown by deserialization of custom items
moved from being thrown in initializeFromParcelLocked() (when the bundle
is first touched) to being thrown in getValueAt() (whenever the item is
retrieved), which means they were escaping the defuse logic that caught
those exceptions. So, now also catching these exceptions in
getValueAt(), however, here we can be much less drastic, instead of
erasing the bundle, we can simply remove the bad element.

This also means we don't need to log wtf in initializeFromParcelLocked()
if sShouldDefuse = true but the bundle is not marked as defusable, since
touching the bundle doesn't carry the same consequences as before
go/lazy-bundle. So, I moved that log to unparcel(itemwise = true), ie.
whenever the entire bundle is deserialized on purpose.

Now, 2 types of defusing can happen:
1. If the (custom) item we're retrieving caused the exception, we'll
   remove the item and return null.
2. If the exception was raised during partial deserialization, that is,
   during the read of the map and its basic types (while skipping custom
   types), the map will be left empty. I believe only manually written
   parcels would cause this type of exception and if an exception is
   raised here it will also be raised in the final destination too,
   afaict. Because of this, we can now touch app-provided bundles
   without fear of clobbering the data on its way to the final
   destination.

Following conversation on previous CL, narrowed exception raised in case
of unknown type to be BadParcelableException.

Test: atest -d android.os.cts.ParcelTest android.os.cts.BundleTest android.os.BundleTest android.os.ParcelTest
Bug: 195622897
Change-Id: I4746140f63482a9ea475aac25897a447737393e4
2021-10-05 11:40:13 +01:00
Bernardo Rufino
18e5be7b98 Merge "Log.wtf in mismatch + tests" am: 1cdbc7cbd1 am: d60218eb45 am: 5d32036b41
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1837194

Change-Id: If1fa51158bfa1dd5fa901d907aea72a6c8379ddc
2021-09-30 11:04:34 +00:00
Bernardo Rufino
d60218eb45 Merge "Log.wtf in mismatch + tests" am: 1cdbc7cbd1
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1837194

Change-Id: I185410ce82ca057b6767d5ca0ff0368f046a1dff
2021-09-30 10:31:03 +00:00
TreeHugger Robot
8d0620b80f Merge "Remove frameworks/base/apex/appsearch and associated tests" into stage-aosp-master am: 8efe26afd6 am: f26b06a489
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15941404

Change-Id: I0bedde68a50948dc07e76c3de8ab115bd1e06561
2021-09-30 04:49:29 +00:00
Baligh Uddin
d4f12c6ea6 Remove frameworks/base/apex/appsearch and associated tests
BUG: 192108282
Test: TH
Merged-In: I38469ad5df100e90aba81bbdc82078b568301f09
Change-Id: Ib7e97c6ee7dff1c5d0aad2c21635e74510d523a6
2021-09-29 23:40:11 +00:00
Bernardo Rufino
95ace87925 Log.wtf in mismatch + tests
Log mismatches as wtf to be able track those. Also added unit tests
around kindofEquals() and r/w mismatches.

Test: atest -d android.os.cts.ParcelTest android.os.cts.BundleTest android.os.BundleTest android.os.ParcelTest
Bug: 195622897
Change-Id: I361dd144b23975eedc8b19ed65457a1c5405936e
2021-09-29 13:51:43 +01:00
Colin Cross
259a1806df Merge "Convert DownloadManagerTestApp to Android.bp" am: 46d22e3c87 am: abb70e433a am: a162e9bc39
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1829055

Change-Id: I26f9b49136dde4e0514d04c8115d4bd5fd6ee22a
2021-09-20 21:11:44 +00:00
Colin Cross
8a37a5ceaa Merge "Convert MultiDexLegacy* tests to Android.bp and d8 --main-dex-rules" am: 58210e2960 am: 35f4acb9bd am: 1decb029b4
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1829054

Change-Id: I3b7149b233d923008674bd06ddf5a3fa8673331f
2021-09-20 21:11:28 +00:00
TreeHugger Robot
4ff921f559 Merge "Check custom component names before aggregating BatteryUsageStats snapshots" into sc-qpr1-dev am: 0ef5152b17
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15872124

Change-Id: Ib40da10e9db2ee290e1c65681e25862b0c6b7e35
2021-09-20 20:51:11 +00:00
Colin Cross
abb70e433a Merge "Convert DownloadManagerTestApp to Android.bp" am: 46d22e3c87
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1829055

Change-Id: Ief2fc9ff1f69ae768f3d4b54242a2f95deea6344
2021-09-20 20:38:38 +00:00
Colin Cross
35f4acb9bd Merge "Convert MultiDexLegacy* tests to Android.bp and d8 --main-dex-rules" am: 58210e2960
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1829054

Change-Id: I11dfd1a08745f9d45861ec296416bad0aa4e20d9
2021-09-20 20:37:50 +00:00
Colin Cross
6f4e26df2b Convert DownloadManagerTestApp to Android.bp
See build/soong/README.md for more information.

Test: mma
Change-Id: I2d3fefc4467cde83d8a93217935b908230bcbade
2021-09-20 20:22:35 +00:00
Colin Cross
5f4f5562e0 Convert MultiDexLegacy* tests to Android.bp and d8 --main-dex-rules
The mainDexClasses script is obsolete, pass the rule to d8 with
--main-dex-rules instead.

Test: mma
Change-Id: Ia88660550c3e57749b8ccb154e97c31aaf2fcf3a
2021-09-20 20:22:25 +00:00
Dmitri Plotnikov
0c561475c3 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)
2021-09-20 18:35:09 +00:00
Dmitri Plotnikov
e4cc934175 Drop per-app measured energy when an OTA changes the set of energy components am: 50348e3120
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15857253

Change-Id: I509be3ae6643864524529c06a61229c11b0ae008
2021-09-18 03:53:48 +00:00