Commit Graph

31 Commits

Author SHA1 Message Date
Raff Tsai
3d2655c100 Log ACTION_CONTEXTUAL_CARD_SHOW in different place
Fixes: 132396134
Test: robolectric
Change-Id: I7d46df15fbc42838da0fa53f4db7e1aa026c3174
2019-05-11 08:28:08 +08:00
Yi-Ling Chuang
ec01bff5c4 Only shows two suggestion cards at once.
Displaying too many cards may overwhelm users, so limit
the number of suggestion cards that should be displayed to two.

Fixes: 126213965
Test: robotests
Change-Id: I17c43746f475b31121c5809e0e8c6cf932efb99d
2019-04-29 18:30:28 +08:00
Raff Tsai
40976d461e Record all contextual card log to MetricsFeatureProvider
Use ContextualCardLogUtils to serialize contextual card event to
string, and records the string using regular MetricFeatureProvider
logging APIs.

Bug: 124701288
Test: Robolectric, integrating test with SettingsIntelligence
Change-Id: Ie139b4f4b8a2b0f0dcc4bb8df9bdec8f5fd824a6
2019-04-09 13:12:02 -07:00
Yanting Yang
aed7ad5a43 Improve notification slice string on home page
Add ContextualNotificationChannelSlice to show more clear sub title on
notification slice.

Fixes: 128641319
Test: visual, robotests
Change-Id: I650102f4cde7d8d397c7a501ba9ee76c401ba9db
2019-03-20 22:25:59 +08:00
Yi-Ling Chuang
620d6aeccb Log latency and timeout occurrence for contextual cards.
Fixes: 124492762
Test: rebuild
Change-Id: I552adf7e6d76e8576a790e83792d067ed5716dc2
2019-03-19 18:31:01 +08:00
Fan Zhang
4cb2727989 Tie ContextualWifiSlice to UI instead of garbage collector
- Introduce a static long in SliceFeatureProvider that updates once
  every "session". A session is when user is in an UI (screen rotation,
  going to subpage, etc does not break the continuation of session).

- Use session token in ContextualWifiSlice to determine when to refresh,
  instead of relying on WeakHashMap from CustomSliceManager.
  WeakHashMap can be cleaned up at any time by gc so it doesn't match
  what we want on the UI.

- Also as a side fix, merged CustomSliceManager into
  SliceFeatureProvider.

Fixes: 123937830
Test: robo
Change-Id: I199bceceb208b99a32f3f08e624787b5a03e73a9
2019-03-14 14:45:59 -07:00
Mill Chen
3c50f4467a Adjust timeout limit of contextual card loading
Add a way to get the timeout limit of contextual card loading from
Settings.Global. If Settings.Global doesn't have the timeout limit, will
use the default timeout limit.

Bug: 124460999
Test: robotests
Change-Id: I2a25570f51013b566914e485d61405f14290d338
2019-03-08 11:49:20 +08:00
Raff Tsai
3881e2986c Do not log Contextual card display when card is dismissed
If the db change comes from dismiss card uri. We don't
need to log card display again.

Fixes: 121196921
Test: Robolectric
Change-Id: I4e222187fafa8325e803fa6ee17ebb0b51fb8cb2
2019-02-27 10:36:03 +08:00
Fan Zhang
7c261409d2 Make Serial number preference a copyable slice.
Fixes: 73769621
Test: robotests
Change-Id: Ic20d8865bc26c1acc7db74e665f92fe388d62f74
2019-02-26 13:14:03 -08:00
Yi-Ling Chuang
362311766f Set the timeout limit of contextual card loading back to 1 second.
After making card pre binding work in paralell, the loading time is now
less than 1 second.

Bug: 124366297
Test: robotests
Change-Id: Ib5daececa73ed9e9cf62a18971c6042d9150aad7
2019-02-22 18:12:07 +08:00
Yi-Ling Chuang
dde76e6d5c Make slices precheck executes in parallel.
Slice binding takes up sometime which may cause latency.
Thus, making it run in parallel instead of sequentially to improve the
performance and avoid hitting the timeout problem.

Bug: 124366297
Fixes: 123668403
Test: robotests, unit tests
Change-Id: I5d9fa4605f59e2acef65aadf6fce85df36d8fff1
2019-02-21 15:24:28 +08:00
Yi-Ling Chuang
daa8ff36cc Use a better way to bind slice for slice precheck.
Calling Slice.bindSlice() directly will cause the exception stating that
slices are not pinned, which sometimes leads to crash. Hence, change the
way we bind slices which handles pinSlice() for us before onBindSlice().

Bug: 120552892
Test: robotests, unit tests
Change-Id: I3e65c6b79876dbee5db6f19387bc6b675f734161
2019-02-21 14:18:01 +08:00
TreeHugger Robot
ccdc98e277 Merge "Increase timeout of contextual card pre-check." 2019-02-12 04:38:35 +00:00
Fan Zhang
07df08950a Don't load anything from contextual card db in legacy mode.
Change-Id: I2fa1ee78bb8878c2cf46fd2f59499c9ed8eb0a09
Fixes: 124246284
Test: robotest
2019-02-11 13:22:02 -08:00
Yi-Ling Chuang
1f595d9659 Increase timeout of contextual card pre-check.
- Also add logs for the binding time of each card.

Bug: 123043695
Test: robotest
Change-Id: Iba666f60bccb27658e43af992ce80be98e5ff7ea
2019-01-31 13:29:41 +08:00
Yanting Yang
aa29da44d8 Add Notification Channel slice to Contextual Settings Homepage
Bug: 119831690
Test: visual, robotests
Change-Id: Ia8d020dcdab181497d4ae4bf968ea641b6908622
2019-01-19 17:09:25 +08:00
Mill Chen
030aadad10 Build a way to decide card width
Slice cards in contextual homepage are shown as half card or full card.
We will use Category field of ContextualCard to decide card width.

In this CL, also fixed the problem of not showing full card after a
consecutive suggestion card dismissal.

Bug: 119655434
Bug: 121315057
Test: visual, robotest
Change-Id: I3243b9db21b8f288cab88238b20d7d50a2a20d46
2019-01-03 16:36:40 +08:00
TreeHugger Robot
9f7927f6d5 Merge "Hide wifi card sometimes." 2018-12-19 17:42:58 +00:00
Raff Tsai
f7a6d94863 Add sliceUri in broadcast intent
Bug: 119748954
Test: robolectric
Change-Id: I24eb8d5a274be60ba3395d05d2b306e185e7dcab
2018-12-19 02:29:52 +08:00
Fan Zhang
0db4ead2b3 Hide wifi card sometimes.
When there is a connected wifi, we now hide the wifi slice card.

However, if we initially shows this card but later wifi is connected
while the card is visible, we keep showing this card to avoid janky
animation. The card will be gone if user nagivates to a different UI and
comes back.

- Create a new slice ContextualWifiSlice for homepage use case, all
  special logic for homepage are added here.
- Change reference for WIFI_SLICE to CONTEXTUAL_WIFI_SLICE where make
  sense.

Change-Id: Ibd87f88058f357aabef0f7d68a5bf48350d75b06
Fixes: 121040746
Test: robotests
2018-12-18 10:18:08 -08:00
Fan Zhang
e824c7e005 Merge changes I6e73bcf9,I257ba108
* changes:
  Add a timeout waiting for contextual card loader.
  Set setting back to default when turning off dev option
2018-12-13 04:03:28 +00:00
Jason Chiu
c0c5511862 Add vertical and horizontal dividers for large cards of homepage
- Add a new field in ContextualCard to store whether this card is a large one
- Set dividers for large cards in renderer

Fixes: 119528161
Fixes: 119641839
Test: make RunSettingsRoboTests -j ROBOTEST_FILTER=com.android.settings.homepage
Change-Id: I5cb95214789f44ccfd8d9ce2177ca2b84835b7a4
2018-12-13 03:40:05 +00:00
Fan Zhang
ad12b76a98 Add a timeout waiting for contextual card loader.
- Intially setting it to 1 second.
- Also changed card appear animation from drop in to fade in. It looks
  less janky if we don't animate any size change.
- And some random code cleanup

Change-Id: I6e73bcf98fd9aa1d76ae002b94ab5b068dfecf1e
Fixes: 120916829
Test: robotests
2018-12-12 16:28:24 -08:00
Yanting Yang
09b130529c Rename ConnectedDeviceSlice to BluetoothDevicesSlice
Bug: 120029006
Test: robotests
Change-Id: I7e39f52a87ebd017bf0635cd5a76945b39eee6fc
2018-12-10 18:33:51 +08:00
Raff Tsai
e58e0c6e0e Log contextual card is visible and homepage is displayed event
Bug: 79698338
Test: Robolectric
Change-Id: I89ac5ed2765729d8571e84d3a050f0aa07385caa
2018-12-07 09:00:05 +08:00
Fan Zhang
53f75f0df9 Move all custom slice uris to a registry class.
Change-Id: I192320f95ac81d14c8891ce2531d603912e59f56
Fixes: 119776308
Test: robotests
2018-11-29 16:41:21 -08:00
Yanting Yang
e11c1d0382 Stop showing battery card in homepage
In previous design, we add default card feature for "me Card". But "me
Card" is being built by another team. We have removed related cards from
default card feature in ag/5394464 but battery card. Now, remove it.

Fixes: 119819851
Test: robotests
Change-Id: I445546024c80c227abce649008ec648340577e99
2018-11-27 19:08:23 +08:00
Emily Chuang
1e24cb02dc Add contextual card dismissal implementation
When users clcik on the remove button in dismissal view, the card should
be marked as dismissed in the database, and the UI should be refreshed.

Bug: 113783548, 119594116
Test: robotests
Change-Id: I980600c4c0753ad5abc52ae63bac7196a4b818f1
2018-11-20 12:53:19 +08:00
Emily Chuang
0b6a3000e0 Restrict the number of contextual cards shown in suggestion area.
In order to make static IA visible in the homepage, we have to limit the
number of cards.

Bug: 118691898
Test: robotest
Change-Id: Iefb8b7e874ec1334e93be2d196b7cb72624b17b0
2018-11-12 14:17:47 +08:00
Fan Zhang
13b60bb15a Stop showing account based cards in homepage.
Removed data usage/device info/emergency/storage cards

Bug: 118691898
Test: robotests
Change-Id: I9f1ef3f022be9ca37e3359a6820a716d4ebade0f
2018-10-30 13:37:02 -07:00
Fan Zhang
5e6e6a14f2 Move all contextual card related classes.
... from homepage to contextualcards.

Test: rebuild
Change-Id: Id7889566ce1e7257eb699d963ae996906fdb58ff
2018-10-26 10:02:04 -07:00