Fix app compat test
Change the app compat test for hidden api logging to use DeviceConfig
api for setting the sampling rate, instead of global settings
Test: cts-tradefed run cts-dev -m CtsStatsdHostTestCases -t \
android.cts.statsd.atom.UidAtomTests#testHiddenApiUsed
Bug: 119217680
Change-Id: I155f91e29ee810a9b9a32c3c62a039f1dc03d327
diff --git a/tests/src/android/cts/statsd/atom/UidAtomTests.java b/tests/src/android/cts/statsd/atom/UidAtomTests.java
index cdb023f..d65af4c 100644
--- a/tests/src/android/cts/statsd/atom/UidAtomTests.java
+++ b/tests/src/android/cts/statsd/atom/UidAtomTests.java
@@ -253,10 +253,10 @@
}
String oldRate = getDevice().executeShellCommand(
- "settings get global hidden_api_access_statslog_sampling_rate").trim();
+ "device_config get app_compat hidden_api_access_statslog_sampling_rate").trim();
getDevice().executeShellCommand(
- "settings put global hidden_api_access_statslog_sampling_rate 65536");
+ "device_config put app_compat hidden_api_access_statslog_sampling_rate 65536");
try {
final int atomTag = Atom.HIDDEN_API_USED_FIELD_NUMBER;
@@ -278,10 +278,11 @@
} finally {
if (!oldRate.equals("null")) {
getDevice().executeShellCommand(
- "settings put global hidden_api_access_statslog_sampling_rate " + oldRate);
+ "device_config put app_compat hidden_api_access_statslog_sampling_rate "
+ + oldRate);
} else {
getDevice().executeShellCommand(
- "settings delete global hidden_api_access_statslog_sampling_rate");
+ "device_config delete hidden_api_access_statslog_sampling_rate");
}
}
}