Commit Graph

31 Commits

Author SHA1 Message Date
Alexander Dorokhine
46e85a2fad Migrate away from deprecated Truth APIs.
This is a transitional step towards truth 1.0.1, where these APIs have
been completely removed.

Bug: 168765701
Test: m checkbuild
Change-Id: I76f9c37cb699ce6ab8715ffe35d11668ccbceea1
2020-09-24 23:09:41 +00:00
Tsung-Mao Fang
b4fc67ea24 Revert "Revert "Use system-api lib to get badged, shadowed icons(2/n)""
This reverts commit 94b8055f1c.

Reason for revert: Revert this cl and fix broken test cases.

Change-Id: I61a190b4beba8db2fe2faab45e5dd6921dc681ec
Fix: 149112222
Fix: 149090275
Test: Run all Setting robo tests
2020-02-10 15:01:43 +08:00
Bill Peckham
94b8055f1c Revert "Use system-api lib to get badged, shadowed icons(2/n)"
This reverts commit dbecbe6f61.

Reason for revert: b/149112222

Change-Id: I11981b2daacf8b07177fe906d88de05ca40810c1
2020-02-07 21:52:25 +00:00
Tsung-Mao Fang
dbecbe6f61 Use system-api lib to get badged, shadowed icons(2/n)
In order to prevent DoS attack from icon size, we're using
a system lib to help convert any loaded drawable into a flattened
bitmap with an appropriate size.

Test: Open recent app screen and then no crash
Bug: 33646131
Change-Id: Ib7eae56e19cd86667bd63b6061000c6a92deaf3b
2020-02-07 18:45:45 +08:00
James Lemieux
f1dade40d2 Use binary resource support in robolectric
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
2018-12-12 19:53:49 -08:00
tmfang
dce94bb237 Use SettingsLib's LayoutPreference
- 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
2018-11-27 13:12:53 +08:00
tmfang
012b089a91 Allow below divider for all EntityHeader
- Create an method in LayoutPreference let other class can
  set divider status.
- EntityHeaderController will allow to have a below divider
  by default.

Test: visual, robotest
Bug: 116346008
Change-Id: Ic041b8fef8d22ce1b7ea48eedfbe97c708c41ce7
2018-11-20 11:52:29 +08:00
Fan Zhang
1f0879955c Settings icon pack refresh
* ic_add_24dp
* ic_airplane
* ic_arrow_down_24dp
* ic_cellular_off
* ic_data_saver
* ic_device_others
* ic_info_outline_24dp
* ic_search
* ic_night_display
* ic_lock_open
* ic_wifi
* ic_sync
* ic_wallpaper
* ic_phone

Bug: 116360411
Test: visual
Change-Id: I626cbb88043c36d32ab34b90fc83170bca0be12a
2018-09-24 15:40:14 -07:00
Fan Zhang
23f8d59d02 Sort imports
Having consistent import order will reduce chance of merge
conflict between internal and external master

Test: rebuild
Change-Id: I0b1a170967ddcce7f388603fd521f6ed1eeba30b
2018-08-28 22:13:15 +00:00
tmfang
f12e6adcdc Settings Fragment Migration (Fix test cases)
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
2018-07-11 18:24:51 -07:00
tmfang
99cc23d0da Settings Fragment Migration (Change imports)
This commit *only* changes imports and optimize imports.
We don't do anything else.

This patch can't compile pass and run test case.
We will update other patches to fix these problem.

Change list.

1. import android.app.Fragment; ->
   import androidx.fragment.app.Fragment;
2. import android.app.DialogFragment; ->
   import androidx.fragment.app.DialogFragment;
3. import android.app.ListFragment; ->
   import androidx.fragment.app.ListFragment;
4. import android.app.LoaderManager; ->
   import androidx.loader.app.LoaderManager;
5. import android.content.AsyncTaskLoader; ->
   import androidx.loader.content.AsyncTaskLoader;
6. import android.content.Loader; ->
   import androidx.loader.content.Loader;
7. import android.app.FragmentTransaction; ->
   import androidx.fragment.app.FragmentTransaction;
8. import android.app.FragmentManager; ->
   import androidx.fragment.app.FragmentManager;
9. import android.app.LoaderManager.LoaderCallbacks; ->
    import androidx.loader.app.LoaderManager.LoaderCallbacks;

Bug: 110259478
Test: Can't test it.
Change-Id: I0a3f98fff34a3494a839c3c42aeabcec3df2c8b3
2018-07-11 18:23:51 -07:00
Fan Zhang
1d04fa9197 Merge "Don't use cached app icon in app info page." into pi-dev am: 7312f55549
am: 9b8684fd12

Change-Id: I99e6bf942928fe64595c1eba03c3099910fc0545
2018-05-18 16:10:25 -07:00
Fan Zhang
fcbf155b47 Don't use cached app icon in app info page.
The cache in ApplicationsState is causing a lot of damage because AS
object is not smart enough to invalidate the cache in all conditions. So
we end up having bugs like stale app label or icon in weird cases.

This change stops using the cache when loading app icon in entity
headres. This is only a stop gap solution to fix most visible (and most
frequently complained) parts of the page. We still need to address the
cache in ApplicationsState eventually.

Change-Id: Iea88ad99d4069d678d09943cfb0b0e5c94eb3326
Fixes: 79881693
Test: robotests
2018-05-18 14:31:48 -07:00
Fan Zhang
cac18e12ac Move app setting link from Entity header to pref controller
Change-Id: I13a27486a9c9b4c4fb358715d678473e63c1b624
Merged-In: I13a27486a9c9b4c4fb358715d678473e63c1b624
Fixes: 79688822
Test: robotest
2018-05-16 19:56:33 +00:00
Fan Zhang
e2346643c7 Move app setting link from Entity header to pref controller
Change-Id: I13a27486a9c9b4c4fb358715d678473e63c1b624
Fixes: 79688822
Test: robotest
2018-05-16 10:51:31 -07:00
Aurimas Liutikas
e0069d332d Migrate Settings to androidx.
Test: make Settings
Bug: 76692459
Change-Id: I941dea40562170649bf056e675cc32e5163c0e39
2018-04-20 12:52:29 -07:00
HJ ChangLiao
f3be34e01b Move device detail edit button from menu to header
Move the edit button on Bluetooth device detail,
From action bar menu to header.
Use EntityHeaderController to add and control,
Rename those method because we use them on
more than one place now.

Change-Id: I3afad6baeab80895c109603e2ab13428582a4dd8
Fixes: 76206922
Test: make RunSettingsRoboTests
2018-04-17 12:33:01 +08:00
Isha Bobra
35e217f91f Show only 1 entry for hearing aid devices without killing the activity.
This CL tries to detect Bluetooth hearing aid devices and tries to
combine the entry of the hearing aids with the same HiSyncIds and
show only 1 entry for each pair in the connected devices list.

This CL also shows 2 battery status in the device details page.

This change shows the combined entry after a user returns to the
settings activity after pressing the back button or somehow
without killing it. It also combines the entries just after pairing.

Test: RunSettingsRoboTests
Bug: 74204427

Change-Id: I47fb0bdd96b1cc972d88a4aef85d0113985d63bb
2018-04-13 22:51:58 +00:00
James Lemieux
22a39c2b93 Use external/robolectric-shadows/run_robotests.mk
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
2018-03-04 03:50:08 -08:00
Fan Zhang
1f6d24a991 Get rid of direct usage of Utils.onBuildStartFragmentIntent
Change-Id: I87eb97d6da4cd4f99be5bcdb1e3e245eb1c7bd1c
Fixes: 73250851
Test: robotests
2018-02-20 09:42:31 -08:00
Beverly
738b400ea0 Zen automatic rule page ui changes
- Can change rule name from header
- Text for turning on/off rule is now "Use rule" instead of on/off

Test: make ROBOTEST_FILTER=EntityHeaderControllerTest RunSettingsRoboTests -j40
Test: manual (Settings > Sound > Do Not Disturb > Turn On Automatically)
Bug: 63077372
Change-Id: Id55b02de0509f168c2470a4f875e84140eb840fa
2018-01-18 18:31:03 -05:00
jeffreyhuang
cbfb099a40 Rename SDK_VERSION_O to SDK_VERSION
Test: make RunSettingsRoboTests -j40
Change-Id: I6715062d8addadda441e32809db1af55f15e3a90
2017-12-05 16:43:54 -08:00
Fan Zhang
dff6dd687e Move away from deprecated FakeFeatureFactory.setupForTest()
Test: rerun
Change-Id: I896ba414315ddb1664c0499264f4992f0554ef98
2017-12-05 10:12:10 -08:00
Fan Zhang
831f6302ee Disable DevelopmentSettingsActivity by default
And if for any reason monkey user is able to enter develop option page,
we show nothing.

And update some test to sdk 26.

Change-Id: I3f985e7fe14bd290db73b8c46dd817591df02015
Fixes: 68707778
Test: robotests
2017-11-22 14:44:23 -08:00
Doris Ling
a7b40995de Set drawable for the entity header app preference button.
In the entity header layout, the action buttons resource is set to null by
default. When we bind the button with the app preference action, we
should also set the drawable to the settings icon as well.

Change-Id: Ic259b4c538f529671ca5a9c67664ef32fbbb25ae
Fixes: 64826061
Test: make RunSettingsRoboTests
2017-09-01 14:52:30 -07:00
Fan Zhang
75bee9bf98 App header cleanup
- Refactor the entity header layout to use LinearLayout and add id to
  content area
- Remove now unused AppHeader class
- Make entire icon+text area clickable and link to app info page
  Refactor the binding logic from bindButton to its own method.
- Remove unused MultiLinePreference

Fix: 62705377
Test: make RunSettingsRoboTests

Change-Id: I6db554695410e71b669f6fdba29d98fedc3364b9
2017-07-06 13:23:38 -07:00
Fan Zhang
a74337c627 Add logging when entity header buttons are clicked
Change-Id: I673e5b4a6c5f8736bbec72e259a82acb3f514828
Fix: 62709062
Test: make RunSettingsRoboTests
2017-06-20 16:53:14 +00:00
Andrew Sapperstein
9f1e911759 Refactor test runner to use static list of resource paths
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
2017-06-09 09:21:26 -07:00
Antony Sargent
ff8e3e7bde Add setIconContentDescription to EntityHeaderController
This lets us set a contentDescription on the icon in entity headers
for accessibility.

Bug: 62068874
Test: make RunSettingsRoboTests
Change-Id: I1af7aad34aa65b616cf4edb8b144f315040a9fdd
2017-05-24 17:21:58 -07:00
Fan Zhang
841d1d5aab Show shadow when entity header starts scrolling.
- 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
2017-05-22 17:16:24 -07:00
Fan Zhang
d7414259d0 Move entity header controller out of application package.
Bug: 37669238
Test: rerun robotests
Change-Id: I54eb30f28fa0a88a6f0b97b53f9f1408320b5ce0
2017-05-18 16:36:32 -07:00