2024-10-16 20:16:05 -04:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
2024-10-16 20:07:02 -04:00
|
|
|
From: Yiling Chuang <emilychuang@google.com>
|
|
|
|
Date: Mon, 8 Jul 2024 03:09:50 +0000
|
|
|
|
Subject: [PATCH] RESTRICT AUTOMERGE FRP bypass defense in App battery usage
|
|
|
|
page
|
|
|
|
|
|
|
|
Before the setup flow completion, don't allow the app info page in App battery usage to be launched.
|
|
|
|
|
|
|
|
Bug: 327748846
|
|
|
|
Test: atest SettingsRoboTests + manual test
|
|
|
|
- factory reset + launch app battery usage app info via ADB during Setup -> verify app closes
|
|
|
|
Flag : EXEMPT bugfix
|
|
|
|
|
|
|
|
(cherry picked from commit 419a6a907902a12a0f565c808fa70092004d6686)
|
|
|
|
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:62b0014ed6e69b0abc48a5c18b740f95bc5dc429)
|
|
|
|
Merged-In: I486820ca2afecc02729a56a3c531fb931c1907d0
|
|
|
|
Change-Id: I486820ca2afecc02729a56a3c531fb931c1907d0
|
|
|
|
---
|
|
|
|
.../android/settings/fuelgauge/AdvancedPowerUsageDetail.java | 5 +++++
|
2024-10-16 20:16:05 -04:00
|
|
|
.../settings/fuelgauge/AdvancedPowerUsageDetailTest.java | 5 +++++
|
|
|
|
2 files changed, 10 insertions(+)
|
2024-10-16 20:07:02 -04:00
|
|
|
|
|
|
|
diff --git a/src/com/android/settings/fuelgauge/AdvancedPowerUsageDetail.java b/src/com/android/settings/fuelgauge/AdvancedPowerUsageDetail.java
|
|
|
|
index 683395e773c..d2a34c64886 100644
|
|
|
|
--- a/src/com/android/settings/fuelgauge/AdvancedPowerUsageDetail.java
|
|
|
|
+++ b/src/com/android/settings/fuelgauge/AdvancedPowerUsageDetail.java
|
2024-10-16 20:16:05 -04:00
|
|
|
@@ -234,6 +234,11 @@ public class AdvancedPowerUsageDetail extends DashboardFragment implements
|
2024-10-16 20:07:02 -04:00
|
|
|
initPreference();
|
|
|
|
}
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
+ protected boolean shouldSkipForInitialSUW() {
|
|
|
|
+ return true;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
@VisibleForTesting
|
|
|
|
void initAnomalyInfo() {
|
|
|
|
mAnomalies = getArguments().getParcelableArrayList(EXTRA_ANOMALY_LIST);
|
|
|
|
diff --git a/tests/robotests/src/com/android/settings/fuelgauge/AdvancedPowerUsageDetailTest.java b/tests/robotests/src/com/android/settings/fuelgauge/AdvancedPowerUsageDetailTest.java
|
2024-10-16 20:16:05 -04:00
|
|
|
index 0be63899785..485cfd672bf 100644
|
2024-10-16 20:07:02 -04:00
|
|
|
--- a/tests/robotests/src/com/android/settings/fuelgauge/AdvancedPowerUsageDetailTest.java
|
|
|
|
+++ b/tests/robotests/src/com/android/settings/fuelgauge/AdvancedPowerUsageDetailTest.java
|
2024-10-16 20:16:05 -04:00
|
|
|
@@ -435,4 +435,9 @@ public class AdvancedPowerUsageDetailTest {
|
2024-10-16 20:07:02 -04:00
|
|
|
|
|
|
|
verify(mAnomalySummaryPreferenceController).updateAnomalySummaryPreference(mAnomalies);
|
2024-10-16 20:16:05 -04:00
|
|
|
}
|
2024-10-16 20:07:02 -04:00
|
|
|
+
|
2024-10-16 20:16:05 -04:00
|
|
|
+ @Test
|
2024-10-16 20:07:02 -04:00
|
|
|
+ public void shouldSkipForInitialSUW_returnTrue() {
|
|
|
|
+ assertThat(mFragment.shouldSkipForInitialSUW()).isTrue();
|
2024-10-16 20:16:05 -04:00
|
|
|
+ }
|
2024-10-16 20:07:02 -04:00
|
|
|
}
|