Commit Graph

52 Commits

Author SHA1 Message Date
Edgar Wang
66c16d57af Update Search Bar layout in Homepage
Bug: 340513864
Bug: 340773713
Bug: 340799397
Bug: 340759836
Test: visual
Change-Id: I4bd5c3438aa55ca764f61b180a37c10206ee78be
2024-05-20 06:49:12 +00:00
David Liu
9b63fbb772 Fix toolbar keyboard navigation and touch.
- toolbar default has touchscreenBlocksFocus enabled which make toolbar not focusable when touch screen present. Explicitly set touchscreenBlocksFocus to false make the toolbar can be focus when keyboard navigation.
- Remove focusableInTouchMode which breaks normal touch control. Read https://android-developers.googleblog.com/2008/12/touch-mode.html for more details.

Fix: 327025582
Fix: 324420544
Test: manual test with keyboard and touch navigation

Change-Id: I6cad869e3a51926405a6f3ae894daa5416050bf8
2024-03-01 07:13:58 +00:00
Jason Chiu
901880a1d2 Replace getCallingActivity() with getLaunchedFromPackage()
getLaunchedFromPackage() reports who launched this Activity or built
PendingIntent used to launch it, whereas getCallingActivity() reports
who will get result of Activity.

Bug: 316891059
Test: robotest, manual
Change-Id: If97018c2741caef622f0596bbfeaa42ef1788b78
2024-02-01 14:35:59 +08:00
Sunny Shao
076ed573eb Revert^2 "Nullability Annotations replacement"
This reverts commit 19d1d3d15d.

Reason for revert: revert it because this is not the root cause.

bug: 316867690
Change-Id: I0f168dbb64044aa720202af7b1040afd4f028c9c
2024-01-10 07:34:01 +00:00
Sunny Shao
19d1d3d15d Revert "Nullability Annotations replacement"
This reverts commit cf0501e4d7.

Reason for revert: b/317462033, it seems a flaky but revert it first.

Change-Id: Ie1d5e279cca6477fc17d8c27c1ecda8d7a6b2553
2023-12-29 02:28:24 +00:00
sunnyshao
cf0501e4d7 Nullability Annotations replacement
-- Replace the android.annotation.Nullable / android.annotation.NonNull
   with androidx.annotation.Nullable / androidx.annotation.NonNull

Bug: 316867690
Test: build pass
Change-Id: I0c1da55dfb09ece855151c47e0492d6f46538621
2023-12-20 08:50:09 +08:00
Chaohui Wang
8e2ae547d6 Clean up FeatureFactory.getFeature()
Bug: 286764889
Test: m Settings
Change-Id: I7e472e6b0ca6b7a735c1b92742ddf06c545176fc
2023-08-08 08:41:48 +00:00
Justin Ghan
1cc772d30d Support stylus handwriting in settings search bar
Bug: 270708561
Test: make RunSettingsRoboTests ROBOTEST_FILTER=com.android.settings.search
Change-Id: Iec6d6deb68b834654b2bbc11d96227db5319b0f0
2023-03-08 10:20:44 -08:00
Stanley Wang
1712d57a87 Add new api for search pre-index
Add sendPreIndexIntent api.

Bug: 244521263
Test: manually test and review UI
Change-Id: Ibbe88eeb114b453886693ecb92ebd8ee287f9581
2022-09-01 17:33:17 +08:00
Tsung-Mao Fang
0e03b12d60 Fix abnormal behavior on search page
Prior to this cl, if user opens settings app
in single-pane first and navigates to
the search page, then rotate the device,
user observed the search page was still shown
with full screen.

Because we didn't register correct split rule,
it causes the abormal behavior on two-pane mode.
In order to register correct rule,  we also need
to assign correct component name while opening the
search page.

Fix: 206896763
Test: Rebuilt apk and verify the behavior
Change-Id: I7343467aa716d71da63f2ad0a034dc6c1b7fd415
2021-11-23 16:32:32 +08:00
Jason Chiu
3af73364ba Support highlighting the menu entry for Search results
1. Add a receiver to monitor the search state
2. Shoe/hide the menu highlight in the listener
3. Highlight the menu entry in SearchResultTrampoline
4. Enable/disable the receiver in SettingsInitialize

Bug: 205781792
Test: manual, robotest
Change-Id: Ia04901f504172f4f0c7b4b2ea7eda5f3713f676d
2021-11-11 14:33:26 +08:00
Jason Chiu
e427cc6752 Search experience improvement for large screen
- Support fragment and direct link in SearchResultTrampoline
- Start activity for SI case and start deep link trampoline for others
- Disable menu highlight whenever the search bar is clicked
- Don't overwrite SettingsApplication's homepage activity in
  SliceDeepLinkHomepageActivity
- Scroll to highlighted menu entry after homepage is loaded to prevent
  UI overlapping

Bug: 201724410
Test: manual, robotest build pass
Change-Id: I5115d17d829e85036000da2e80f0e5b0598c733f
2021-11-03 18:44:01 +08:00
Arc Wang
407a725278 Use startActivity for android.settings.APP_SEARCH_SETTINGS
The Activity launched by android.settings.APP_SEARCH_SETTINGS
does not setResult. So it's no meaning to use
startActivityForResult for the Intent.

Bug: 196923591
Test: manual
      Settings -> Search settings -> search an item ->
      click back button twice and back to Settings home.
Change-Id: Ia760a301465bb87814326611a1ec2368887f120a
2021-09-30 01:52:48 +00:00
Tsung-Mao Fang
22b50de9f4 Add click tile event for tracking
- Search bar in homepage.
- Avatar icon in homepage.
- More personal safety in Safety & emergency.

Test: Rebuilt rom
Fix: 190341976
Change-Id: I14297211e4b7424f5fdeb46c360b3913101251d7
2021-06-17 17:50:34 +08:00
Tsung-Mao Fang
902a3469f0 Animate the search bar expansion
Enable the transition between Settings app and Settings Search

Test: Record the transition video and confirm it.
Fix: 175764903
Change-Id: I95125fba17bbf517feee9a10fd828ff8017f7106
2021-01-08 07:48:54 +00:00
Raff Tsai
c898775914 Hide search box if it is called in initial setup wizard
- Search box is hidden if user set intent extra isSetupFlow true

Fixes: 135717823
Test: search box is hidden in the following command
adb shell am start -a android.settings.SETTINGS --ez isSetupFlow true

Change-Id: Ia3d955c9390d6b0eef9391b9b35b6a483eb63d26
2019-10-18 02:08:38 +00:00
tmfang
062d4acf45 Fix crash on AppInfo screen
We start a search page with a request code which is same as
"uninstall" request code. The root cause is we handle same
reuqest code for different event.

We redefine an unique request code for "search" feature.

Fixes: 124775813
Test: Click search and back to App info screen.
Change-Id: I8ab21c30b605bcb65b6d4bd9fceb749a65a49f80
2019-03-18 14:09:52 +08:00
Fan Zhang
beedd3abe5 Add referrer when launching search intent.
Bug: 123294739
Test: robotests
Change-Id: I600abf1d764e828d52f3b8d35ad24cdc94dfba01
2019-01-29 14:10:05 -08:00
Fan Zhang
31b210017b Migrate all MetricsProto enums to SettingsEnums
Bug: 122855168
Test: rebuild
Change-Id: I962d9a71179f86b7cae9dc5e9a00e0aa1557dc76
2019-01-17 14:55:42 -08:00
Fan Zhang
8e14ca0058 Remove obsolete logic in SettingsActivity.
mIsShowingDashboard is always false, it used to be true when we are
displaying homepage, but now homepage is hosted in a entirely different
activity.

so all related logic can now be removed.

Test: robotests

Misc clean up: remove unused colors

Test: rebuild, color-lint
Change-Id: I1e1628c1e9606c2b7dc40ef3c21d4ed1391a8c03
2018-11-29 11:37:00 -08:00
Raff Tsai
a75a724bdd Fix Settings crash when clicking search bar
- When user disable settings suggestion in App Settings, click
search button without leaving settings app. The search button is
still existed.
- Doesn't allow user to disable app in App Settings
- Add check before start search intent

Change-Id: Ifbc4615914678d8df734e14d63bb626403313d1e
Fixes: 118805907
Test: manual
2018-11-15 18:08:40 +08:00
Raff Tsai
35ae9bbaac Read SettingsIntelligence package name from resource
Test: make RunSettingsRoboTests
Change-Id: I2143e1f7657cc0e01e91978e8c212ff079cec7d7
2018-11-13 14:45:01 +08:00
Raff Tsai
2928cd4c72 Fix Settings crash after disabling Settings Suggestion
- Settings Suggestion App is responsible for searching, we can not
prevent user disable it. Hide search feature if user disable it.

Fixes: 118805907
Fixes: 117921464
Test: manual
Change-Id: I61c47c52265a6efd79ef2fa60272bf6513e678b1
2018-11-07 14:11:23 +08:00
Fan Zhang
6b88c9c1b7 Use public API to launch search UI.
Test: manual
Change-Id: I5527dd6de5990aed365b6e78a9492ced00b99565
2018-10-18 16:26:59 -07:00
Fan Zhang
3181e1aceb Change search fab to search bar.
- Remove search fab from layout xml
- Change RelativeLayout to CoordinatorLayout so we can use prebuilt
  scrolling behavior
- Minor update to theme so search bar background works in dark mode for
  the homepage activity.

Change-Id: If7408c12684be65137e04ae3bb4137204c2d77e0
Fixes: 117508596
Test: robotests, visual
2018-10-10 16:29:22 -07:00
Fan Zhang
b5835a729a Log open search action in metrics.
Change-Id: I80ab40d0767a9e6e561690f31bd092b384095b6e
Fixes: 117341899
Test: robotests
2018-10-08 12:22:50 -07:00
Fan Zhang
6acbc9337e Move search resources to settingslib-search
Bug: 113128828
Test: manual
Change-Id: I2c513dd22e84d5f86bd282e10d0b0df19f9ce407
2018-09-28 16:38:23 -07:00
Raff Tsai
43a7b18f21 Modify Settings homepage layout
- Add BottomNavigationView which has two tabs
- Remove BottomSheet in layout files

Change-Id: I493290fa9dee0566c73c5c9d7fbba10b71b4e2b4
Fixes: 113266753
Test: visual
2018-09-05 11:55:16 +08:00
Raff Tsai
4778a9afbd Close searchActivity doesn't go back to previous activity
When requestCode is 0, we will not finish activity.

Change-Id: Ib630951739031b05c83efe189875a4a41c8e51ec
Fixes: 113372155
Test: make RunSettingsRoboTests ROBOTEST_FILTER="com.android.settings.password"
2018-08-29 23:31:42 +08:00
Fan Zhang
7431c91de6 Remove search indexing pipeline from Settings
Index is already handled by SettingsIntelligenec. No longer needed in
Settings.

Change-Id: Id43fb3100dc2759185744441cff8cb9cd2d2da20
Fixes: 69808376
Test: robotests
2018-06-21 09:38:36 -07:00
Tony Mantler
0fcd6cbaa8 Autogenerate SearchIndexableResources subclass
Bug: 77148954
Test: RunSettingsLibRoboTests RunSettingsRoboTests RunSettingsGoogleRoboTests RunArcSettingsRoboTests
Change-Id: I842c42c55014c3310070ef22bd4f0d9a70dfd804
2018-04-03 10:26:55 -07:00
Ben Lin
4d163fcc93 Add capability for OEMs to supply their own SearchIndexableResources.
This moves SearchIndexableResources to be supplied by FeatureFactory
rather than its own singleton, which in effect allows OEMs to supply their
own, in the case where they have their own classes they want to be
indexed (or, remove certain classes that used to be indexed).

Bug: 72179744
Test: All tests pass.

Change-Id: Ia06b2026df7eca4c53b44a5a589c4aaa0b69d96c
2018-01-19 11:49:51 -08:00
Fan Zhang
74706b6ed1 Remove more things from search v1
Test: robotests
Change-Id: Ide54d1cec69ae3a6782a979d3eeb7f3fc44f09b3
2018-01-18 15:43:34 -08:00
Fan Zhang
60e707df87 Specify package name when launching search UI
Test: robotests
Change-Id: Ib8cc2aa1a6d4de82b32cbe3da8473bb61cf0c530
2018-01-17 16:00:04 -08:00
Fan Zhang
85cd77c9f2 Remove search v1
Fixes: 69851037
Test: robotests
Change-Id: I53bc6408116031619053066055cb26cac67b9945
2018-01-16 14:19:51 -08:00
Matthew Fritze
8c96843fe3 Build slice from indexed data in SliceProvider
Connect the SliceIndexing data to the SliceProvider,
such that a query to SliceProvider can build a Slice
via the indexed data from SlicesIndexingManager.

We take the key from the Uri supplied to the SettingSliceProvider
and find a potential matching row in the indexed data. The
matched data is then used to Build a slice for the caller.

Bug: 67996923
Test: robotests
Change-Id: If51bfd1a05c3f3817ae720554f95a98fc7b002e1
2018-01-10 10:58:33 -08:00
Fan Zhang
681a4cdd47 Add search menu to all pages
Change-Id: I0910df3d26fe583deb70d7052bde28b64e7844a7
Fixes: 68814716
Test: robotests
2017-11-30 10:43:18 -08:00
Fan Zhang
06b0d5b564 Send context object to FeatureFlagUtils.
Bug: 36222960
Test: robotests
Change-Id: I9ca2d8c679474e545988f518eaf32acf459abd2c
2017-11-14 09:24:31 -08:00
Fan Zhang
439921345a Allow SettingsIntelligence to access SearchResultTrampoline
Bug: 64938328
Test: robotests
Change-Id: I89b0b8adf1e034f0fc57a3991fb56452a7210219
2017-11-13 16:27:39 -08:00
Fan Zhang
ff4da23a65 Create a feature flag for Search v2.
Also moved all other flags in a common file so we can track them more
easily.

Bug: 68825426
Bug: 64938328
Test: rerun robotests
Change-Id: I3fc805054cb960bedd965b1b907be759df50b95d
2017-11-09 14:57:08 -08:00
Matthew Fritze
fb772248b1 Move search querying into a single API
Settings now collects search results from a single
loader which fetches from an aggregator. This is to
facilitate the separation of search functionalitiy,
where "query" becomes a single synchronous call.
In this case, the aggregator will move to the
unbundled app and would be called on the
other end of the Query call. i.e. the new search
result loader will just call query, and unbundled
search will handle everything else.

An important implication is that the results will
be returned in a ranked order. Thus the ranking and
merging logic has been moved out of the RecyclerView
adapter (which is a good clean-up, anyway).

The SearchResultAggregator starts a Future for each
of the data sources:
- Static Results
- Installed Apps
- Input Devices
- Accessibility Services

We allow up to 500ms to collect the static results,
and then an additional 150ms for each subsequent
loader. In my quick tests, the static results take
about 20-30ms to load. The longest loader is installed
apps which takes roughly 50-60ms seconds (note that
this will be improved with dynamic result caching).

To handle the ranking in DatabaseResultLoader,
we start a Future to collect the dynamic ranking before
we start the SQL queries. When the SQL is done, we
wait the same timeout as before. Then we merge the
results, as before.

For now we have not changed how the Dynamic results
are collected, but eventually they will be a cache
of dynamic results.

Bug: 33577327
Bug: 67360547
Test: robotests
Change-Id: I91fb03f9fd059672a970f48bea21c8d655007fa3
2017-10-30 14:20:49 -07:00
Fan Zhang
25f29bf126 Only allow Settings app launch search result page
Bug: 68199963
Test: robotest
Change-Id: I0018e9c60b0dd46fc2420a563a93b706bf252dc4
2017-10-24 16:27:47 -07:00
Soroosh Mariooryad
98fc9b139c Extending SearchFeatureProvider API to provide timeout
Bug: 38197948
Test: RunSettingsRoboTests

Change-Id: I5b04085ba93061dafe8977b42ebe5092bc9a9d09
2017-08-22 10:38:32 -07:00
Fan Zhang
e3535d9998 Delete DynamicindexableContentMonitor & all refs to it
Convert input device search into a search query loader

And remove old logic from DynamicIndexableContentMonitor

Change-Id: If652b1ea7c8add9185bbd025055e14925d3a8eec
Bug: 64310452
Bug: 63831980
Test: robotests
2017-08-09 17:27:02 -07:00
Fan Zhang
5035f8c559 Move a11y indexing from DynamicContentMonitor to loader
This is necessary to kill DynamicContentMonitor later

- Removed all logic related to indexing accesiblitysetting from the
  monitor class and AccessibilitySetting page itself
- Created a loader to search against A11yServices at runtime

I noticed adding a loader in SearchResultsAdapter is rather manual. It's
something we should consider refactor in the future.

Bug: 64310452
Test: robotests
Change-Id: Iff31aff65ce000991229433f294e2ec69af99da2
2017-08-03 10:10:59 -07:00
Fan Zhang
465d79776f Improve search indexing time.
- Some import clean up.
- Add timing log to track indexing time breakdown.
- Remove isAvailable() from UserDictionaryPreferenceController.

Bug: 36391685
Test: rebuild
Change-Id: If154c5dafba5d21cb1020497c44fbf67f03ad820
2017-07-18 14:53:49 -07:00
Soroosh Mariooryad
892d65fd1e Adding warmup call API for Settings search ranking.
- This allows the ranking implementations to prepare for predictions and
avoids latency on the first prediction call.

Bug: 38197948
Bug: 37312700

Test: RunSettingsRoboTests

Change-Id: I1878b14765ad7cede5648fa1c7f29c419c2e5535
2017-07-07 17:53:58 -07:00
Matthew Fritze
98a9e42c93 Add synchronous indexing api to SearchFeatureProvider
- Opens the database indexing to be synchronous for the
external settings api.
- Adds logging to track synchronous and async indexing
times.

Bug: 62826872
Test: make RunSettingsRoboTests
Change-Id: I28b69f3952946c0ae5dd7ea7da66f7a5fd485637
2017-06-28 11:31:27 -07:00
Andrew Sapperstein
a2dd9978d4 Remove logic for adding a search icon to action bar.
No longer used given that we don't show the search icon on any page.
The main settings page now has the search bar.

Change-Id: I9535028298739467e7fa9c75d1a2fb2b2fa3251b
Fixes: 62230804
Bug: 37477506
Test: robotests
2017-06-25 13:51:08 -07:00
Soroosh Mariooryad
733bbf7c34 Updating the search ranking API and some improvements:
- Ranking API is modified to run the ranking asynchronous to the main thread.
Therefore, it can now run in parallel to loading the results from DB
which decreases the overall latency.
- Ranking API now supports reporting failure from the ranker
implementation side.
- Settings that are not ranked by the ranker algorithm are now ranked at
the end of the list. This is added for dynamic settings (e.g., apps).
- Failure handling mechanism is added for cases that ranker catches an
exception or it takes a long time to respond.

Bug: 37312700
Fixes: 36866337
Fixes: 36867476
Fixes: 36866736
Fixes: 36866838

Test: RunSettingsRoboTests

Change-Id: I3a2a97e3a07a8d4afbb090061d92172a27588ee7
2017-06-02 12:09:20 -07:00