Commit Graph

24 Commits

Author SHA1 Message Date
mxyyiyi
d3ce90347b Update database clear & job refresh mechanism for time zone change intent
- Clear database and reset periodic job
- Take a snapshot of current battery usage stats

Bug: 336423923
Test: atest SettingsRoboTests:com.android.settings.fuelgauge.batteryusage
Change-Id: I4aade9db950b508e2190605371f246904f131da3
2024-05-10 11:22:58 +08:00
mxyyiyi
1df242994a Add new action to log battery optimizaition mode updated by Turbo.
Bug: 338965652
Test: atest SettingsRoboTests:com.android.settings.fuelgauge.BatteryOptimizeUtilsTest
Change-Id: I80a53d327fee4b0442784e9b20617029f0e63f46
2024-05-07 15:02:01 +08:00
Aditya Choudhary
4f5c1ac5bc [DON'T BLOCK] Test ownership migration rules
This CL is created as a best effort to migrate test targets
to the new android ownership model. If you find incorrect or unnecessary
attribution in this CL, please create a separate CL to fix that.

For more details please refer to the link below,
go/new-android-ownership-model

Bug: 304529413
Test: N/A
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:3f65505208d57fa18be353f815c44fdd6f004f4b)
Merged-In: I7fbd55a92f4302a6e03bcff0283737fd9295165d
Change-Id: I7fbd55a92f4302a6e03bcff0283737fd9295165d
2024-02-09 16:54:41 +00:00
mxyyiyi
ad23b53942 Update battery usage data clear mechanism while time change.
- Accept time updated in the last job schedule range:
  [ max (last-full-charge / last-even-hours) , next-even-hours ]

Bug: 308714066
Fix: 308714066
Test: manual
Change-Id: Id92fffddb7666d63fce66fee696a27d957c8b537
2023-11-03 15:25:17 +08:00
ykhung
ef66549e64 Add a mechanism to log battery usage periodic job events
Example history log:
      	Jul 07, 2023, 15:28:51 SCHEDULE_JOB triggerTime=Jul 07, 2023, 16:00:00
      	Jul 07, 2023, 15:32:16 FETCH_USAGE_DATA
      	Jul 07, 2023, 15:32:17 INSERT_USAGE_DATA size=37
      	Jul 07, 2023, 15:43:45 FETCH_USAGE_DATA
      	Jul 07, 2023, 15:43:48 INSERT_USAGE_DATA size=47
      	Jul 07, 2023, 15:43:49 SCHEDULE_JOB triggerTime=Jul 07, 2023, 16:00:00

Bug: 284893240
Test: make test RunSettingsRoboTests ROBOTEST_FILTER=com.android.settings.fuelgauge
Change-Id: I45a1ce0ce9b70f095702727e53d7b7ce8824abdb
2023-07-07 17:47:19 +08:00
ykhung
0cd24adec5 Add allowlist mechanism for battery optimization mode
Add a mechanism to add package name into the allowlist to avoid users
change the battery optimization modes for specific apps in the list

https://screenshot.googleplex.com/8hrHCcTh5bNYXqp

Bug: 281566984
Test: make test RunSettingsRoboTests ROBOTEST_FILTER=com.android.settings.fuelgauge.*
Change-Id: I8efa6a55646d761f5bee3667a59b38ab68c74bc1
2023-05-15 14:28:49 +08:00
ykhung
8f56114489 Record app optimization mode backup into BatteryHistoricalLog
App optimization mode format:
https://screenshot.googleplex.com/di9DDzBfYf7ihfV

App optimization mode backup format:
https://screenshot.googleplex.com/GkVW5HrgGvmv5yh

Bug: 192523697
Test: make SettingsRoboTests
Change-Id: I60a9a76a8ffc89d625ee3f77c138a19181c81c38
2023-05-11 10:48:47 +08:00
Wesley Wang
1f78ebd8aa Refine optimize page log pattern
- Add timestamp and prefix string
 - Chagne Action.MANUAL to LEAVE for better readability
 screenshot: https://screenshot.googleplex.com/ALTvMaPWVEq8y7c.png

Bug: 192523697
Test: make SettingsRoboTests
Change-Id: I69d1beceb98444d823f6ffc3a015cf61a7d7a66d
2023-05-10 10:11:28 +00:00
SongFerngWang
f7685dd715 Add a config to hide the 3G option at preferred network mode UI
Add a config config_display_network_mode_3g_option to hide the 3G
option at preferred network mode UI

Bug: 261615630
Test: build pass. local test pass.
atest EnabledNetworkModePreferenceControllerTest

Change-Id: I4f94971add1d1eddc9f7c7458b8fc8fdcec3935e
2023-02-08 07:48:08 +08:00
Kuan Wang
1e8ca1d7d2 Move fuelgauge_usage_state.proto into fuelgauge folder.
Test: make RunSettingsRoboTests + manual
Bug: 20424125
Change-Id: Id0ed25e06258764ec58263c2e2f7dec7bfd81c0a
2022-12-02 15:00:58 +08:00
Kuan Wang
1493fa2fea Database restructure: use protobuf to save battery information fields.
This patch only updates the existing fields.
There will be 2 following patches to:
1. Expose the new fields (foreground / foreground service / background x
   usage time / power consumption) to UI.
2. Get the full charge cycle start time from Database and remove the
   SharedPreference.

Test: make RunSettingsRoboTests + manual
Bug: 253553141
Change-Id: Iee02dc7e671f97899cb1495323acfa0173e31df2
2022-11-17 06:06:54 +00:00
Wesley Wang
d90026d184 Add BatteryHistoricalLogUtil class
- Impl optimize mode log mechanism to record optimize setup flow
 - Log optimize action with MANUAL, APPLY, RESET and RESTORE
 - Use proto file to serialize logs
 sample result: https://screenshot.googleplex.com/5KPrHVGb4pMvS7V.png

Bug: 241735485
Test: make SettingsRoboTests
Change-Id: I879663de4cf45d0cfb9cd7eee957eeb65addfbe1
2022-11-04 18:09:11 +08:00
Bonian Chen
93ca7288cf [Settings] Code refactor - NetworkModePreference
Code refactor for improving readibility.

Bug: 223461708
Test: unit test EnabledNetworkModePreferenceControllerTest
Change-Id: I3b3157cbc76f104d63062fda495a7391ecc18ada
2022-03-19 10:46:06 +08:00
Bob Badour
a73a67240c [LSC] Add LOCAL_LICENSE_KINDS to packages/apps/Settings
Added SPDX-license-identifier-Apache-2.0 to:
  Android.bp
  protos/Android.bp
  tests/anomaly-tester/Android.bp
  tests/componenttests/Android.bp
  tests/legacy_unit/InstrumentedEntitlementApp/Android.bp
  tests/perftests/Android.bp
  tests/robotests/Android.bp
  tests/uitests/Android.bp
  tests/unit/Android.bp

Bug: 68860345
Bug: 151177513
Bug: 151953481

Test: m all

Exempt-From-Owner-Approval: janitorial work
Change-Id: I58a85aced69923fa9a8e5a2b89ecfdd33de5e05c
2021-02-25 15:05:14 -08:00
Bob Badour
18e9723489 Revert "[LSC] Add LOCAL_LICENSE_KINDS to packages/apps/Settings"
This reverts commit 0e73d05c74.

Change-Id: I627be6c5355eda9602b1cb201806fce4548fc951
2021-02-25 11:52:32 -08:00
Bob Badour
0e73d05c74 [LSC] Add LOCAL_LICENSE_KINDS to packages/apps/Settings
Added SPDX-license-identifier-Apache-2.0 to:
  Android.bp
  protos/Android.bp
  tests/anomaly-tester/Android.bp
  tests/perftests/Android.bp
  tests/robotests/Android.bp
  tests/uitests/Android.bp
  tests/unit/Android.bp

Bug: 68860345
Bug: 151177513
Bug: 151953481

Test: m all

Exempt-From-Owner-Approval: janitorial work

Change-Id: I81f11a66b5977cb5096e262819084706af5fa54c
Merged-in: I81f11a66b5977cb5096e262819084706af5fa54c
2021-02-21 08:50:16 -08:00
Jason Chiu
ca9ece1a0c Card showing mechanism change in homepage
- update contextual card proto interface to fit the new SettingsIntelligence
- show sticky cards at the tail of the card area

Bug: 149274976
Test: robotest
Change-Id: Icca167825c1c037ec12d8836d82c5fdff4331a8e
2020-02-14 17:44:11 +08:00
Raff Tsai
02e45574a3 Add SettingsIntelligenceLogwriter
Bug: 124701288
Test: robolectric, manual
Change-Id: Iea446ae600d22ed62c5ee45afd1cd27a89b5de34
2019-03-27 07:14:20 +08:00
Yanting Yang
4bd94b9053 Remove deprecated EXCLUSIVE field from proto
Fixes: 123560880
Test: robotests
Change-Id: I6ff184dc5998d1e8eadfbfa16c8c7a85ebd75d98
2019-02-18 16:25:23 +08:00
Yanting Yang
13818eb2f5 Deprecate EXCLUSIVE category from contextual_card_list.proto
Bug: 120485678
Test: visual, robotests
Change-Id: Ic287aeeed0743787d3e577c7086e9847b5c33157
2019-01-30 18:52:33 +08:00
Yanting Yang
2784da75a2 Improve UX of Deferred Setup
Change-Id: I3d0735ef1196b04abaef454529664a8daea53967
Bug: 120485678
Test: visual, robotests
2019-01-29 07:43:46 +00:00
Raff Tsai
56d304ea0b Modify proto
Add a field about contextual card score

Change-Id: I52b660801e317112673ada2f449709239a8b3c12
Bug: 79698338
Test: Robolectric
2018-12-05 08:15:17 +08:00
Fan Zhang
9a28c433f2 Update proto for contextual_card_list.
Bug: 118842350
Test: rebuild
Change-Id: I838738f56c8793a8e4d6adf43bc812777edbcd88
2018-11-06 15:48:03 -08:00
Fan Zhang
8985efe3b0 Add contextual card proto libraries.
Test: rebuild
Change-Id: Ifd105a91be4ce3b3ae35766e069d4b4663e54b0f
2018-10-10 10:14:07 -07:00