Commit Graph

35 Commits

Author SHA1 Message Date
Treehugger Robot
a339d8ea9a [RESTRICT AUTOMERGE] Merge "Replace getCallingActivity() with getLaunchedFromPackage()" into sc-v2-dev am: 324e36b19d
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/27546875

Bug: 333364513
Fix: 345375093
Change-Id: Ifdebf7a60f3695f83d8fa04e05f4dbd6e177f62b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-06-07 02:49:14 +00:00
Jason Chiu
8bdbb580da 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
Merged-In: If97018c2741caef622f0596bbfeaa42ef1788b78
(cherry picked from commit ddc11bc03a)
2024-05-28 02:40:04 +00:00
Amith Yamasani
1b27c91a7b Use Uri.toString() instead of Uri.toSafeString()
Uri.toSafeString strips out paths and shouldn't be used
for situations other than logging.

Bug: 232694281
Test: PtsPowerTestCases
Change-Id: Iec835b738c3e928e922bd6a14573106f2ce4f526
2022-05-30 23:22:25 -07:00
Tsung-Mao Fang
8b0e4018e1 Fix search test
The broken test is because the activityInfo has no package name.
Set a random package name to fix it.

Test: run robo test
Fix: 214945263
Change-Id: I5ae5a0021f1473e6eadbad5f6e1f22840a44d592
2022-01-20 09:57:34 +00:00
Tsung-Mao Fang
297fcb4031 Ignore broken tests
Test: Run tests
Bug: 214943221
Bug: 214944418
Bug: 214944992
Bug: 214944423
Bug: 214945263
Bug: 214945259
Change-Id: I958c003a15866a03b7d0c24210ae2c99f4ee2c47
2022-01-17 22:01:50 +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
Fan Zhang
beedd3abe5 Add referrer when launching search intent.
Bug: 123294739
Test: robotests
Change-Id: I600abf1d764e828d52f3b8d35ad24cdc94dfba01
2019-01-29 14:10:05 -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
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
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
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
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
74706b6ed1 Remove more things from search v1
Test: robotests
Change-Id: Ide54d1cec69ae3a6782a979d3eeb7f3fc44f09b3
2018-01-18 15:43:34 -08:00
Fan Zhang
85cd77c9f2 Remove search v1
Fixes: 69851037
Test: robotests
Change-Id: I53bc6408116031619053066055cb26cac67b9945
2018-01-16 14:19:51 -08: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
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
Fan Zhang
fbcf4e6e14 Trim search query when initializing installed app searcher.
Change-Id: I502185d4b497b2edac32e4a8368be76d13b68259
Fix: 62885439
Test: make RunSettingsRoboTests
2017-06-27 19:48:54 +00: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
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
Matthew Fritze
2078bc2358 Remove search2 package and put everything into search
Change-Id: Ie8651c79ef023f154cd7120a88a20f3481abce2b
Fixes: 38502743
Test: make RunSettingsRoboTests
2017-05-23 13:57:28 -07:00
Matthew Fritze
be0989cc61 Prevent race conditions after dropping database
Manual merge from: ag/2155898

Bug: 37501479
Test: make RunSettingsRoboTests
Change-Id: I02f8423c0ffc27abbb8ceb61a8c47d2f0796d0bb
2017-05-05 15:30:39 -07:00
Matthew Fritze
5c83cfa278 Remove Index.java from old Search and its dependents
Test: make RunSettingsRoboTests
Bug: 35763944, 36192909
Change-Id:  If216e1eeb4c29e7372720c6228fa4e99ea2a9904
2017-03-17 14:26:05 -07:00
Fan Zhang
a96b11f65d Build a sitemap manager to keep track of breadcrumbs
- Have a new db to track parent-child page relation at index time.
- Make a registry class to track (in IA) which page host what type of
  sub pages.
- Make a manager class that queries the db as well as IA to compute
  breadcrumbs

Fix: 32936784
Test: RunSettingsRoboTest

Change-Id: I5f1583fae772c3d477d2ad186e111b79cc3e41aa
2017-01-23 20:41:39 -08:00
Matthew Fritze
9955db6360 SearchFeatureProvider's context field is removed
SearchFeatureProvider was holding on to a context and
outlived the SettingsActivity, thus leaking the activity.
The context was passed into most methods, and thus it
makes more sense to pass it in to every method.

Bug: 33677967
Test: Run MakeSettingsRoboTests
Change-Id: Ia82f30e7e0b83587b4baeef28e81da6b8e4303fe
2016-12-20 11:39:10 -08:00
Matthew Fritze
18fcb08308 First step in refactoring Index.java
Handles the following refators:
 - Indexing code into: DatabaseIndexingManager
 - Indexing utility methods into: DatabaseIndexingUtil
 - XML Parsiing utility methods into XMLParserUtil

Bug: 33451851
Test: make RunSettingsRoboTests
Change-Id: I4264ad3806d1bd3a66d879c16ad6c8315ecb832b
2016-12-09 20:51:32 +00:00
Fan Zhang
6e88635e97 Add search provider for dashboard fragments in new IA.
Bug: 33252252
Test: make RunSettingsRoboTests
Change-Id: I8ea3a144f2bee3d979b909aba29a3360e25fd04b
2016-12-05 15:27:18 -08:00
Matthew Fritze
0ed37c3513 Fork Search code to independantly develop and test search.
This is the start of the new search in Settings. It is a nearly complete
replacement of the old search code in a more modular and flexible
architecture. It is expanding the datasources that it queries, including
the same Settings database, which will now include more first party apps
and be extended to support inline results where the user can change
settings directly from the search view. Search will also fan out to
query new sources (local or remote), and is built in a way
such that adding additional sources is roughly the same amount of work
had they been added in the initial writing of this code.

Query interpretation will now be source-dependant, allowing for future
upgrades to fuzzy search where it is applicable.

Change-Id: Ib0bac1fe92bf8a662d33abf9a99bb6ee2090ec8f
Fixes: 32115225, 32378927
Test: make RunSettingsRoboTests
2016-11-17 14:34:29 -08:00