Commit Graph

20 Commits

Author SHA1 Message Date
Chaohui Wang
63eddc12dd Refactor FeatureFactory
Not use reflection, sets the FeatureFactoryImpl in SettingsApplication
instead.

Bug: 286764889
Test: m Settings
Test: m SettingsSpaUnitTests
Test: m RunSettingsRoboTests
Change-Id: I881bf1009a94222fc89578d14a6792a6e1507be2
2023-06-28 09:09:39 +00:00
Charles Chen
8524048094 Improve Settings launch performance for normal phones
1. Initialize ActivitEmbedding component only if necessary
2. Early return to avoid executing long execution time operations
  ex: initialize ActivityEmbedding component, feature flag operations

Test: manual - launch settings and profile
Test: run
v2/android-crystalball-eng/health/microbench/startup/firstparty/open-settings
on affacted devices
Test: atest SettingsHomepageActivityTest TopLevelWallpaperPreferenceControllerTest DashboardFeatureProviderImplTest TopLevelSettingsTest TopLevelWallpaperPreferenceControllerTest SearchResultTrampolineTest
Test: atest CtsSettingsTestCases
Fixes: 281505190

Change-Id: I0c1a1dc50f26c4ded02de82190dd7aad59c20c01
2023-05-12 12:20:40 +00:00
Charles Chen
9dc35d21b4 Revert^2 Disable Settings large-screen optimization
Disable the optimization that is automatically enabled when
including Window Extensions through Activity Embedding.
The optimization causes to launch an additional trampoline
activity for deep links, even when the screen size is smaller
than required by Activity Embedding rules.

Bug: 267725145
Bug: 279461170
fixes: 280606740

Test: Build, perf metrics
Test: atest LauncherIronwoodIntegrationTests:android.platform.test.scenario.launcher.integration_tests.HomescreenCustomizationTests
Test: atest SettingsMultiPaneDeepLinkTest.java
Test: run v2/aep-ironwood/suite/test-mapping-ironwood-p0-cujs via ABTD
  on cheetah/oriole/panther/raven in udc-dev/master branch


Change-Id: I74c9608fce92fc77c0f1ef2d61aba3af85afba02
2023-05-05 07:46:06 +00:00
Priyanka Advani
77f76267d2 Revert "Disable Settings large-screen optimization"
Revert submission 22926596-disable_large_screen_opt

Reason for revert: b/280606740

Reverted changes: /q/submissionid:22926596-disable_large_screen_opt

Change-Id: Ib918705206dc6b8bcbce21f83494d1108c6b8393
2023-05-03 16:05:25 +00:00
Charles Chen
1815ba7828 Disable Settings large-screen optimization
Disable the optimization that is automatically enabled when
including Window Extensions through Activity Embedding.
The optimization causes to launch an additional trampoline
activity for deep links, even when the screen size is smaller
than required by Activity Embedding rules.

This CL also rename isActivityEmbeddingEnabled to
shouldEnableLargeScreenOptimization because the method
may report false even if the device supports the feature
but Settings app doesn't for performance concern.

Bug: 267725145
Bug: 279461170

Test: Build, perf metrics
Test: atest LauncherIronwoodIntegrationTests:android.platform.test.scenario.launcher.integration_tests.HomescreenCustomizationTests
Test: atest SettingsMultiPaneDeepLinkTest.java
Change-Id: I38e8c62a61a344eb7a5cbfd1cd2c2137357d1a87
2023-05-02 14:16:22 +08:00
Diego Vela
a9394d1796 Update ActivityEmbedding usage.
Update ActivityEmbedding usage.

Bug: 259592300
Test: build.
Change-Id: I8e4aa8daf51cb9c669d06b152cc5a2fc69a06571
2023-02-03 02:34:20 +00:00
Sunny Shao
16f0d13179 Fixed mUserId_shouldDeriveUidFromMainCaller test case fail
- getApplicationContext() return null in some test cases.
- Add null checking to avoid the NPE failed.

Fixes: 263542897
Test: make RunSettingsRoboTests -j ROBOTEST_FILTER=com.android.settings.applications
Change-Id: I374b5bbf8911bd6d4eb992e0fa7b1a67c3d16a91
2022-12-23 15:06:25 +08:00
Treehugger Robot
3b583fc371 Merge "Override onTrimMemory to apply trimMemory in AppIconCacheManager" am: 8ac09942b6 am: a8abd64b73 am: 691ddd7f07
Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/2311766

Change-Id: Ic3b54cb856ddf73f379db99404449aeb5980cc17
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-16 04:47:12 +00:00
Sunny Shao
d21c97e9a7 Add a new field elapsed_time_millis into Settings' atom
- Add a new field elapsed_time_millis to keep the elapsed time
  since setup wizard finished.

Fixes: 260660970
Test: make RunSettingsRoboTests -j ROBOTEST_FILTER=com.android.settings.core
Change-Id: I28d13c4987ae1e4ef12eaff27e26a5121cf8093b
2022-12-14 12:53:54 +08:00
Shen Lin
d0daff5a6d Override onTrimMemory to apply trimMemory in AppIconCacheManager
This CL adapts new trimMemory mechanism when device running moderately
low on memory.

Bug: 259630755
Test: manual
Change-Id: I6501b834ce3327f47e911600ac6fe2f09a80e54e
2022-12-09 09:45:30 +00:00
Zekan Qian
4c1b702c4f Add Context in SpaEnvironment
Bug: 244122804
Test: manual - build Settings
Change-Id: I92b0e69a880d280776ab7f482aad3e06c72c3c03
2022-10-31 09:56:56 +08:00
Zekan Qian
f1311f800e Use new API of SpaEnvironmentFactory.
Test: manual - build Settings
Change-Id: I1cd5d7297687b6373a0044f8a100dd968b91e657
2022-10-17 02:49:11 +00:00
Zekan Qian
430ed29262 Unsupport DebugActivity & EntryProvider in Settings.
Set SpaEnvironment (with Spp only) in SettingsApplication
Remove DebugActivity & EntryProvider from Settings.

Bug: 244122804
Test: manual - build Settings
Change-Id: I18e97c80b4f1d6094bb22cf28e7e84ea325869d7
2022-10-13 12:53:48 +08:00
Arc Wang
be2ea9eb39 Avoid 2-pane deep link before gone through Setup Wizard
To improve security.

Fix: 238391432
Test: manual
      Flash ROM and check 2-pane bebavior
Change-Id: If96c645319d9df45930644fd438cf479462685b0
2022-07-27 11:27:33 +08:00
Yanting Yang
19bdc6ce67 Apply a new icon cache mechanism for memory improvement
- Avoid loading all app icons at once to decrease memory usage.
- Only load visible icons when entering the apps page.
- Reserve icon placeholder to alleviate icon loading flicker.
- Release icon cache when low memory or leaving apps page.

Bug: 187118427
Bug: 209898662
Test: manual check the smoothness and memory usage of apps pages.
Change-Id: Ifc3c2a73cc88d6e42739df4e8208445afa12e0ea
2022-01-27 17:20:58 +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
Tsung-Mao Fang
54b9d60783 Create an interface to access the two pane state
Create an new interface in the embedding provider,
this interface tells if settings app is in two pane or not.

To access the activity in the content provider, we need to store
the activity reference in the app application layer.

Test: See if two pane state is correct.
Bug: 203763572
Change-Id: Iae2245b84af2683d932f1900df9959dad98370d7
2021-10-25 15:43:17 +08:00
Tsung-Mao Fang
4781fc1687 Revert "Revert "Support two pane design in the Settings app.""
This reverts commit 07037dbc3f.

Reason for revert: <Issue already was fixed in ag/15743576 and ag/15743577>

Bug: 197716926
Change-Id: I72b98f8feb513f34e88e735efd578a8e3d9a1963
2021-09-06 02:41:26 +00:00
Tsung-Mao Fang
07037dbc3f Revert "Support two pane design in the Settings app."
This reverts commit a12a0d1eb2.

Reason for revert:  See a build error in git_sc-v2-dev-plus-aosp/aosp_crosshatch-userdebug

Bug: 198722766
Change-Id: Ibf812bf92595f57409e3c6d9cda6a1dfa4a8c72c
2021-09-03 17:12:47 +00:00
Tsung-Mao Fang
a12a0d1eb2 Support two pane design in the Settings app.
1. Only enable this feature when the flag is on and library is supported
in this device.
2. Add a placeholder rule for home menu.
Network page will be shown to the right pane by default.
3. Add a rule for most sub settings pages.

Known issues:
1. Transition animation seems wrong in this cl.
2. App is closed if user taps back key on the second layer page in fold
state.

Test: Run the apk on large screen device and regular phone. No crash
happens
Bug: 197716926

Change-Id: I089717e84c5e92c6e5b02d9770a24376e250fea2
2021-09-02 13:57:42 +00:00