Commit Graph

10 Commits

Author SHA1 Message Date
tom hsu
bf7865b27e [Settings] Fix crash when user enter bluetooth page quickly.
- When SliceManager try to pinSlice, process may not have the permssion
   yet, so in Androix lib it use try/catch to avoid Security exception.
   However, if SliceManger quickly unpinSlice after pinSlice, process
   may still not get the permission yet, then due to no security
   exception, it cause the settings crash.

Bug: 283065718
Test: atest passed
Test: Manual test passed
Change-Id: I2293fca73e65dfaa34237abe57e0c6a3fe0f62bb
2023-06-07 09:37:21 +00:00
tom hsu
5e2862f2e3 [Settings] Avoid to unregister wrong observer
Bug: 262345047
Test: atest passed.
Change-Id: If324e8f35c15053b48320f86ff22759a6a68a62f
2023-05-12 01:10:19 +08:00
hughchen
1605b0364c Fix Connected devices page UI not update after paired
This CL before, onChanged(null) will cause PreferenceGroup
didn't update UI in ConnectedDeviceDashboardFragment.

This CL remove onChanged(null) and set unvisible of SliceView
in the constructor.

Bug: 142220754
Test: make -j42 RunSettingsRoboTests
Change-Id: Ib20db373430589c5c5efbe8a4c866b7fae4f3399
2019-10-16 14:12:33 +08:00
Raff Tsai
40d9986fd7 Fix IllegalStateException in recyclerview
- Fixed by updating UI in mainthread

Fixes: 142241908
Fixes: 142220754
Test: manual test if it crashes again
Change-Id: Ia83b66d3e60201bc524dbfab69bdeaa5201d38c2
2019-10-15 09:52:34 +00:00
Raff Tsai
590042b3ba Hide sliceView if Slice is null
Fixes: 142035673
Test: robolectric, visual
Change-Id: I2b5b34d068ba4590f65a284d4f62a1cc77f9666f
2019-10-03 17:23:35 +08:00
Lei Yu
798b80e5ad Update SliceView when slice is null
When it is null, we should also update SliceView, so SliceView can
update to be "invisible"

Fixes: 133790296
Test: RunSettingsRoboTests
Change-Id: I239405cce8bcadacbd374ccbb24d0fcbadc04880
2019-05-29 13:11:57 -07:00
jackqdyulei
511b5fe9f2 Update SlicePreferenceController
Make sure setSliceUri is invoked even when it is null, where we create
SliceLiveData.

Then in lifecycle, if LiveData is not null, we will register observer.

Bug: 120803703
Test: Manual

Change-Id: I56caf2abf04c4a251ebafa5deb599d44b1c7fe92
2019-01-22 10:43:24 -08:00
jackqdyulei
35209f6e6c Update height of SliceView
So it can display 6 items at most, not 4 items

Bug: 120803703
Test: Manual
Change-Id: Id34398903d0f81bebee3e02c024d21ad2e68578f
2019-01-11 10:55:59 -08:00
jackqdyulei
22904a05b7 Add UiBlocker for DashboardFragment
If DashboardFragment detects blocker controllers, it won't display
until:
1. All blocking controllers finish bg works.
2. Timeout

This CL adds UiBlockerController to control this behavior and
BlockingSlicePreferenceController as an example.

Bug: 120803703
Test: atest SettingsUnitTests
Change-Id: I66fc194776d46ee49b3ec7685f3167834e673ba2
2019-01-10 14:25:43 -08:00
jackqdyulei
cf6374e427 Build infra to inject slice to PreferenceFragment
Reuse the PreferenceController and LayoutPreference however create
specific one for slice:
1. SlicePreference: container to inject slice view
2. SlicePreferenceController: handle updates for slice

Also add styles for it with default layout.

Bug: 120803703
Test: RunSettingsRoboTests

Change-Id: I6ab083ad57117e6198dcba37702a25213da78719
2018-12-18 14:38:25 -08:00