Commit Graph

11 Commits

Author SHA1 Message Date
Jun Lan
cca804e1ed Format battery java code
After this CL, we can follow Guideline:go/hc-mainline-dev#format-code to keep java format consistent.

Test: manual
Bug: 304439460
Change-Id: I5bb77f81b0bd9be618e34942eaaee8296bc42796
2023-11-06 13:55:48 +08:00
ykhung
42d5979f69 [Security] Verify the permission first before querying installed apps
Verify the target app "REQUEST_IGNORE_BATTERY_OPTIMIZATIONS" permission first before querying installed apps information to avoid the exposed the installed apps information and improve the performance by applying the early return flow.

Bug: 227753723
Test: make RunSettingsRoboTests
Change-Id: Ib5826b8082f4bf14f93d5ff4d2d332dc395bf9a8
2022-04-13 03:27:06 +00:00
YUKAI HUNG
d24f289548 Merge "[Security] resolve overlay attack on RequestIgnoreBatteryOptimizations" into sc-v2-dev 2021-09-24 02:28:41 +00:00
ykhung
a8a2075fd0 [Security] resolve overlay attack on RequestIgnoreBatteryOptimizations
we should put the addSystemFlags() after onCreate() method rather than the original onStart() method (refer the proposed solution in b/199167909)

Bug: 199167909
Test: make SettingsRoboTests
Change-Id: Ic7361443bfa2e1a6d8d962708c794fa0122a691c
2021-09-24 02:27:40 +00:00
ykhung
aa9091916d [Security] resolve CRLF attack on RequestIgnoreBatteryOptimizations
1. refer the proposed solution in the b/198783395
2. similar concept is applied in the https://source.corp.google.com/sc-dev/packages/modules/Permission/PermissionController/src/com/android/permissioncontroller/permission/model/legacy/PermissionGroups.java;l=118

Bug: 198783395
Test: make SettingsRoboTests
Change-Id: I838825e31b98e62d2683995e59dbf4388f5684fc
2021-09-23 15:54:53 +00:00
ykhung
518d6df4f4 [Security] resolve RequestIgnoreBatteryOptimizations info disclosure
after discussed with kdeus@ we will remove the setResult() from the
dialog action to avoid the caller apps can distinguish the users
interaction behavior, and declared REQUEST_IGNORE_BATTERY_OPTIMIZATIONS
in other applications.

Bug: 195963373
Test: make SettingsRoboTests
Change-Id: Ia2e47c493c206e96b0bc1d9f08735c0f9474c233
2021-08-17 12:06:59 +08:00
Varun Shah
90321d45fb Hide non-system overlay windows in RequestIgnoreBatteryOptimizations.
Add SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS to
SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS.

Bug: 182165099
Test: manual (test PoC)
Change-Id: Iddf697c1e8945f49c6222605c67f8f98e9c418a9
2021-03-17 10:38:56 -07:00
Kweku Adams
eb4786ed70 Migrate to PowerWhitelistManager.
In preparation for DeviceIdle mainlining, we have to define stable APIs
for other modules and the rest of the system to use. This migrates to
the stable PowerWhitelistManager API.

Bug: 142420609
Bug: 144864180
Test: Android builds
Change-Id: Ic1006c03f3b73c2855fd127ee2cd7fff676caf3e
2020-05-15 10:42:40 -07:00
Fan Zhang
be59441258 Update string for battery optimization dialog
Change-Id: Iea95bec173ac6cdabc10c32ae51604f190f6f42f
Fix: 36569198
Test: builds
2017-03-23 15:48:15 -07:00
Jason Monk
39b467482d Depend on support lib preferences
Bug: 24576551
Change-Id: Ic6190bacd3f7582c9bbc8de972da4612bd92421e
2015-10-13 10:12:20 -04:00
Dianne Hackborn
be4df036e1 Fix issue #23037899: Support for Battery Optimization permission + Dialog
New pretty dialog.

Change-Id: I6094b83139beffc407b01049a0d9d1f85a95df07
2015-08-10 17:07:14 -07:00