The resources available to tests are now exactly the merged resources
located in the APK under test.
Bug: 74359828
Test: make -j56 RunSettingsRoboTests
Change-Id: I050db81a92decefea23314b5ec7a62f77ff4bb2b
- Remove LayoutPreference in Settings source code.
- Remove unused style, layout
- Replace old imports to com.android.settingslib.widget.LayoutPreference
- Replace old XML tag to com.android.settingslib.widget.LayoutPreference
Test: robotest, manual test
Bug: 120005054
Change-Id: I9ae1ae14a16f443e11ac5d75b6038c7c5e253844
Having consistent import order will reduce chance of merge
conflict between internal and external master
Test: rebuild
Change-Id: I0b1a170967ddcce7f388603fd521f6ed1eeba30b
1. Remove unused class and resources
2. Update function in AdvancedPowerUsageDetail since
we don't need pass in anomaly anymore
Change-Id: I96fbe5ddaae902b34b756c7aae0338e49afef1f3
Bug: 74529048
Test: 1. manual test in settings page. 2. robo test still pass
Fix all Roboletric test cases.
In this CL, some test cases are broken.
So, We ignored these test cases temporarily.
Test: make RunSettingsRoboTests -j56
Bug: 110259478
Change-Id: I1a3075438a614432a2de4f2d96d8abf9a83ce58c
Because now we use different time format across the settings app.
We need to update all the tests.
Bug: 76113036
Test: RunSettingsRoboTests
Change-Id: Id4f7d55775adfdeb1aa0ae234f35d515ced4f450
This allows Settings to test against the latest framework changes.
Also replaced TestConfig with traditional robolectric.properties.
Bug: 73173204
Bug: 73892008
Test: make -j56 RunSettingsRoboTests
Change-Id: I3135b4fa5f095ba79b282a76f45dd9baa2584bc7
In battery tips, we need synchronized method to get batteryInfo.
This cl move the logic to BatteryUtils, then in battery tips we
could use this method directly.
Bug: 70570352
Test: robotest still pass
Change-Id: Id69349a25395ae472a9b3152c6f04127ee32c4e1
Two issues:
1. UID of settings app == system UID. But isSystemUid failed to recognize
Settings in secondary user is also a system uid.
2. For USER drain type, we should launch the detail page in current
user.
Fix: 64506728
Test: make ROBOTEST_FILTER=AdvancedPowerUsageDetailTest -j40 RunSettingsRoboTests
Test: Switch to seconday user. Go to Settings->Battery, tap owner user
battery entry, observe that detail page is shown.
Test: Stay long enough in Settings app, make sure no
either Settings nor Android Framework battery entry.
Change-Id: I8d66ad55f18fcb3d9567b3bf753f737f5b98c609
Advacned battery page doesn't show background toggle because it
doesn't get uid from battery stats. This cl make it get uid by
package name even though without battery stats.
Bug: 64049162
Test: RunSettingsRoboTests
Change-Id: Ie0f67ce9d080c02763a8382740e0640a66ce6053
The BatteryEntry need a background thread to update the
package name and icon. However in InstalledAppDetails we
don't have this thread and it is unnecessary because we
already has the package name.
This cl:
1. Use the mPackageName from InstalledAppDetails directly in
BatteryEntry
2. Double check the defaultPackageName in AdvancedPowerUsageDetail,
use packageName from sipper if default is null
This cl is cherry picked from oc-dr to fix the test breakage.
Bug: 64127162
Test: RunSettingsRoboTests
Change-Id: I5d21afca17f177817976758c28ed86b3a10e95eb
Add foreground service time to foreground usage time of apps. This will
account for app usage that user is aware of but is not being displayed
on screen, such as playing music while screen is locked.
Change-Id: Ica9fe0819e46b50299eb2eab7f0483ea01441fb0
Fixes: 38313557
Test: RunSettingsRoboTests
This cl make it could have multiple actions for each anomaly type.
This includes:
1. Add field "targetSdkVersion", "bgRestrictionEnabled" in Anomaly
2. Add new action which includes "force stop" and "background check"
3. Add "sdkVersion" and "bgRestrictionEnabled" method in BatteryUtils
4. Update BackgroundCheckAction to check sdkVersion first
5. Update serveral tests and add new test
Bug: 63037765
Test: RunSettingsRoboTests
Change-Id: Iea7a131ee57d501f7737ae4a3ba672d948d05cd8
For now it uses MIN(STATE_TOP_TIME, FOREGROUND_ACTIVITY_TIME) and this
method is used in both display and screen smearing.
Bug: 63080621
Test: RunSettingsRoboTests
Change-Id: I2ca3109697aa66fae67d8b2f4f10c4d08bb99d59
This cl adds a new parameter, mAnomalies, for
AdvancedPowerUsageDetail.
If it is null, fragment will start AnomalyLoader to detect anomaly.
If not null, just display the anomaly.
Bug: 36925180
Test: RunSettingsRoboTests
Change-Id: I572bc5954c1cdb210d18b6dbe1ab9dba25c0a61f
Previously everything lived in an inner class method of
SettingsRobolectricTestRunner. That method has now been turned into
a static method so that it can be called by other runners.
Bug: 62460102
Test: robotests
Change-Id: I6612b1f26404587301c534c8ba60e39d59d6c840
Before this cl, we use the first package name if there is a name
list in BatterySipper.
We should use BatteryEntry.defaultPackageName instead, which could
describle the batterysipper more accurately.
Bug: 62417935
Test: RunSettingsRoboTests
Change-Id: I44fa151c0cf8f14cba305f179c7e94e5bc3ce434
Add prefix:
1. "Used for" for foreground time
2. "Active for" for background time
Bug: 37162357
Test: RunSettingsRoboTests
Change-Id: Ifd4762640bd5ad98ce64ab174f7a7f44dbb1aa27
- Migrated ArgumentMatcher subclasses to lambdas
- Replaced any() with nullable() where tests were failing
Test: cd tests/robotests && mma
Bug: 38456058
Change-Id: Ice8c39b435c45b87f82dbbd9860e68f235314cf8
Before this cl, user could go to "Battery usage" page only if
related app has battery usage. This cl breaks this rule so we
could open "Battery usage" without battery data.
Bug: 38497822
Test: RunSettingsRoboTests
Merged-In: Ic53c33b7dcbac82de58f31cf96e0bd8fa54e53ea
Change-Id: Ic53c33b7dcbac82de58f31cf96e0bd8fa54e53ea
Before this cl, user could go to "Battery usage" page only if
related app has battery usage. This cl breaks this rule so we
could open "Battery usage" without battery data.
Bug: 38497822
Test: RunSettingsRoboTests
Change-Id: Ic53c33b7dcbac82de58f31cf96e0bd8fa54e53ea
- Add a controller to manage add/remove onScrollChangedListener to
recyclerviews.
- When recyclerview on each screen is scrolled to top, set actionbar
elevation to 0, otherwise set it to non-zero.
- When screen is moved to background, detach the listener.
- Use the controller in entity header.
Change-Id: Iecf194d885098c98c392810f62893ae9189f3936
Fix: 37670670
Test: make RunSettingsRoboTests
update layout view IDs, and controller variable names to be more
generic.
Fix: 36734470
Bug: 37669238
Test: make RunSettingsRoboTests
Change-Id: Ib80827ae3eae6d01a600068b4a8a44b239c32511
Previously the app header was not properly configured to be aware
it was rendering an instant app. This change properly sets the value
and adds tests to ensure it is correclty set in the future.
Test: make RunSettingsRoboTests -j30
Bug: 37919863
Change-Id: I0cbe2cb03bcd44208408f68188387e53ae98d8fb
There are some miscalculations in state FOREGROUND_SERVICE and
FOREGROUND, so we move them out of the foreground time for now.
We will fix it after O and may add them back later.
Bug: 37000096
Test: RunSettingsRoboTests
Change-Id: Ic3f2f7fa69e8a213895c601630d1cca94fd32220
Talk back will read "Used for 3m" as "Used for 3 meters", but
it will read "Used for 3h 3m" correctly.
This cl add specific Ttsspan if the time only contains "minute"
Bug: 36379530
Test: Run SettingsRoboTests
Change-Id: I033575938cce24221980dddd9d66be4e18804541
The voice call is belong to DrainType.PHONE, which is not an app.
This cl stop using method in BatteryUtils to calculate the time, since
that method should only be used for DrainType.APP
Bug: 37402819
Test: RunSettingsRoboTests
Change-Id: I3aa7366401e54df87ffe913af0dcb1bcd5abf110
- Update background color of actionbar
- Remove elevation of actionbar so it appears to be the same entity as
app header.
- Add a shadow below app header view. We can't set elevation on app
header unfortunately because that will add shadow all round the view,
but we only want shadow below it.
- Updated app icon size/text size per to match UI spec.
Change-Id: I63d7fa42b859a008fa662aaf19848cd40529c2ff
Fix: 37207527
Fix: 37079248
Test: visual && make RunSettingsRoboTests
This cl add logs to get more data for app usage time.
Also refactor BatteryUtils to singleton pattern because we need
to extract package name from uid.
Bug: 36909166
Test: RunSettingsRoboTests
Change-Id: I6ede354035c46e46cb856b7cf57bd1b7ccbd6d4f
This cl adds AdvancedPowerUsageDetail to show the usage details page.
The AdvancedPowerUsageDetail contains all the needed ui components:
1. App Header
2. Two buttons
3. Usage breakdown preference category
4. Power management preference category
This cl also adds preference controller for two buttons but the
detail implementation will be added in the following cl.
Following cl will also remove previous detail page.
Bug: 35810915
Test: RunSettingsRoboTests
Change-Id: I17f95d1288762094671c0f148fa73367e51f175e