Commit Graph

614 Commits

Author SHA1 Message Date
Tommy Webb
a4dd79f78d Adapt FinishActivity and outro for 14 QPR3
windowShowWallpaper behaves unexpectedly with transitions as of 14 QPR3.
As a result, the changes of "Revamp outro animation" were causing the
transition into the final page of the wizard to instantaneously have
a transparent wallpaper background, even before the animation finished.
This was jarring and odd, so now we use a regular theme until we are
ready to start our animation, at which point we recreate the activity
with the EdgeToEdgeWallpaperBackground (windowShowWallpaper) theme
before running the animation.

Change-Id: Ib19918d7d2a615aff44a48066b17ec9d2f04bac6
2024-07-31 20:51:30 +00:00
Tommy Webb
1d833219d8 SimMissingActivity is a regular SUW activity
Remove unused subactivity code and change to BaseSetupWizardActivity.

Change-Id: I50492f6d533543ae1ea46965b299a20ee44d0ca0
2024-07-25 19:25:41 +00:00
Tommy Webb
5948809bb4 Rework activity launching and result handling
* Rename or eliminate methods that could be easily confused for AOSP
  methods due to the reuse of AOSP names.
* Separate out the handling of results for subactivites and for the
  next action (intent), each using its own activity launcher and
  callback.
* Add a StartDecoratedActivityForResult contract to ease the launching
  of activities without the caller needing to add SUW-related extras.

Change-Id: Iffaba4c51b2c90c42b8b243874a62cdea9e0c793
2024-07-25 19:25:37 +00:00
Tommy Webb
635998c42d Refactor activity decorations and transitions
Reuse some code, and prevent the need to have to apply transitions
in multiple places.

Change-Id: I5319e49136d6d05de3eb03eff8dae0f3560e509a
2024-07-25 19:25:02 +00:00
Oliver Scott
3ba6626aab Remove unused function disableComponentsForMissingFeatures
Change-Id: Ib4b3099f37ed089809ba5d06dec235512bfe10e3
2024-07-20 11:49:44 +01:00
Oliver Scott
ddd0c8d7ac Check bluetooth status when relevant
Change-Id: Ie67a28cb89bf68ef0d57f36ee2d875cfc44e29cc
2024-07-20 11:49:29 +01:00
Oliver Scott
5584669c2e Check wifi/telephony/ethernet status when relevant
Change-Id: I5d34b0fc5059f2b2eaceaf459180002b525c4249
2024-07-20 11:48:11 +01:00
Tommy Webb
2db34a23d7 Check biometrics availability when relevant
Check the availability of biometrics when we need to know, waiting until
then to decide the presence of ScreenLockActivity, rather than checking
once during initialization and permanently disabling pages of the setup
wizard. Otherwise, a race condition may cause the system to report that
the hardware is unavailable, even though it will be ready when needed.

Reorder pages such that biometrics comes first, allowing screen lock
to act as the fallback.

Issue: calyxos#2544
Change-Id: I654ce25569b983035f1df453623c7a4acd54931d
2024-07-19 17:21:34 -04:00
Oliver Scott
ab9a5ea27b Replace actionId and scriptUri extras with wizardBundle
https://cs.android.com/android/platform/superproject/main/+/main:frameworks/opt/setupwizard/library/test/robotest/src/com/android/setupwizardlib/util/WizardManagerHelperTest.java;l=307;drc=93689222672ea2da9e3948785ab3c8d53d771c84

Change-Id: I084fee70a4fcd4617d788eb6e609e0d00c9ee103
2024-07-19 14:50:22 -04:00
LineageOS Infra
0e299f2129 Automatic translation import
Change-Id: I2347bd4d8e1e1ef040ee9417b6f98589d2f8f5a1
2024-07-01 18:54:41 +00:00
LineageOS Infra
d7dd5b0d0f Automatic translation import
Change-Id: Iea9fb9a5ce56189f03575f3cb0ed7827037b50aa
2024-06-01 22:14:27 +00:00
Oliver Scott
a1a6530ddd Fix restore page back navigation
Issue: calyxos#2284
Change-Id: I72249924d4b0c56b6bcceea1c5a4adbfa5c54fb2
2024-05-18 12:27:11 +03:00
Tommy Webb
ac47a02936 LocaleActivity: Handle unexpected MCC strings
Don't crash if MCC string is empty or not a number.

Issue: calyxos#2269
Change-Id: I5efee6e826600869efe133a8a097d9d24337602c
2024-05-18 12:27:11 +03:00
Oliver Scott
1bbf009729 Keep activities in recents
When exiting, all activities are finished and therefore no longer in recents. For the work profile, we want users to be able to come back to it

Issue: calyxos#2020
Change-Id: Id236c193e5822568dc445ea561fe18a4664e73cc
2024-05-18 12:27:11 +03:00
Oliver Scott
ecaeda6224 Simplify exit code
Change-Id: Ied4a7cb143ef979fd70da81cda6472f85e750739
2024-05-18 12:27:11 +03:00
Oliver Scott
3616338149 Replace hardcoded references to Settings intents
Where required, move hardcoded strings into the files which use them

Change-Id: I411d18739459b46095667f85cf5e0a82fd52b0d2
2024-05-18 12:27:11 +03:00
Oliver Scott
12c7da294f Fix improper SIM Missing automatic navigation
* Properly allow the user to go backwards to prior to the SIM Missing
  page, if it had ever appeared and then a SIM became available.
* Ignore the activity result. Wizard remains on SIM Missing page until
  user chooses to leave or returns to wizard with SIM present.

Change-Id: I3edac6cbb03d76c66b04673d6104e98189ce365c
2024-05-18 12:27:11 +03:00
Oliver Scott
8792be5031 Apply proper backward and forward transitions
Currently, we hardcode TRANSITION_FADE_THROUGH because it is the default
as of now and it is also what Settings uses. It appears to match stock's
transition animations, too.

Issue: calyxos#1743
Change-Id: Iffe19e5b4fd552aab6c5a93bc3788a27b5eba00b
2024-05-18 12:27:11 +03:00
Bruno Martins
8b77e3eea4 SuW: Use the same Welcome activity layout for ATV and tablets
This way platlogo and welcome text is centered and looks
better on tablets.

Change-Id: I77c161a6cde289eb91875d8b6fb26c53f9cffb98
2024-05-16 20:01:52 +00:00
LineageOS Infra
c09271bb1b Automatic translation import
Change-Id: I0c765dcbf6db61dfb87d9f64f2bfdbfacf98abc7
2024-05-15 15:50:37 +00:00
LineageOS Infra
62e48dcaa0 Automatic translation import
Change-Id: Ieee700dd804254b9ed7e7178e3bb0c24b51af49a
2024-05-01 16:33:50 +00:00
Aaron Kling
3ed0a33ee7 Don't start wizard flow on atv when gms is present
This matches the behaviour prior to the Lineage suw revamp on 21.
Setupwraith hooks things in a completely different manner to the mobile
gms suw. The Lineage suw should not run at all when atv gms is present,
but the apk still needs to be available should the tvsetup intent hooks
get implemented.

Change-Id: Ic4943e8fd55d30fbd2856dc5eadc5a0ce6282f29
2024-04-27 15:59:13 +01:00
Bruno Martins
5dd3549573 SetupWizardUtils: Check if active Ethernet network reaches the Internet
Extend the current Ethernet connectivity validation to check
if network is active (can receive and send data).

Change-Id: I1017df7740000774acc713a419c8572ee4ea588f
2024-04-27 15:58:48 +01:00
Bruno Martins
2ec7da3228 SetupWizardUtils: Properly test for Ethernet transport presence
NetworkCapabilities#hasCapability tests for the presence of a
capability, not of a transport. Use the proper method to fix the
Ethernet connectivity validation.

Change-Id: I7e1828cca420e9a84080ede51807ab12ec9eedcb
2024-04-27 15:52:33 +01:00
Bruno Martins
5b49c1fa4c BaseSetupWizardActivity: Handle NPE when WiFi service is unavailable
Do not let SetupWizard crash in case the WiFi service is not available,
which can happen in case of devkits without built-in WiFi support.

Change-Id: Iba72e941b5e4995e865c70cb6c2b6be9a721addc
2024-04-27 14:21:05 +01:00
LineageOS Infra
6665ca7958 Automatic translation import
Change-Id: I994ed355617fc673c9872cdff3584a9b0684f57e
2024-04-15 12:55:29 +00:00
Oliver Scott
d9d285909a Fix system locale
System locale update API isn't deprecated. Call was erroneously replaced in https://review.lineageos.org/c/LineageOS/android_packages_apps_SetupWizard/+/379324/12/src/org/lineageos/setupwizard/LocaleActivity.java#b65

Issue: calyxos#2265
Change-Id: Ic4b4e7ce70f0eb9106401da95feabc576954e381
2024-04-09 19:45:23 +00:00
LineageOS Infra
10343a5e1f Automatic translation import
Change-Id: Ifd4ac5636c1a8d87e6ca8d365f64e1fab11d2b1f
2024-03-27 09:21:50 +00:00
Michael Bestas
79e9f1cdbd Fix QPR2 build
Change-Id: I03bdfacf5d8432ac9e4c66723ecacbf5a4464154
2024-03-20 19:06:16 +00:00
Timi Rautamäki
935ba6902d SUW: center welcome text on TV
Change-Id: I4c984d78137b65e29f60769d3c5a368568c7e79c
2024-03-05 15:20:42 -05:00
Aaron Kling
6cb268b222 BluetoothSetupActivity: ignore cancel results
Change-Id: I9e7f62b2a11d8b2af0c075b0151a29c4485e8931
2024-03-05 15:19:43 -05:00
Aaron Kling
a09594c415 WelcomeActivity: do nothing on back press
Devices with a hardware back button, such as atv remotes, can press back
on the welcome screen and trigger a transition to a waiting screen then
back to welcome. This should not be allowed.

Change-Id: I2273d0d74fb1ef018074d4facc8e3793e7470f6f
2024-03-05 15:14:58 -05:00
razorloves
112f926f77 fixup! Remove unused colors
Change-Id: Id28f03acaa50663748617d94bc1c390424348e60
2024-03-01 21:48:40 -06:00
Chirayu Desai
2b605d17bb welcome: Use a separate string for work profile start
* Intentionally not touching this for secondary users
  so that it doesn't look different from the main user.
* We don't explicitly support that, but let's also not
  go out of our way to break something like this.

Change-Id: I374b45feb7d6dd17e5d03d0f7fbaf6d9e22f1d55
2024-03-02 03:39:05 +02:00
Michael Bestas
db86c22c41 Remove unused View
Change-Id: I2625cd9a3d59afded84621f0ceea4984d755eb5a
2024-03-02 03:39:05 +02:00
Michael Bestas
b69c30c4ed Remove unused colors
Change-Id: I91f16a43c935d8c6d52e6d3ff665145df1466a88
2024-03-02 03:39:05 +02:00
Michael Bestas
f3d2943c38 Remove unused import
Change-Id: I7660d5e51aa8a063ba118caa57d7d6898e5211f4
2024-03-02 03:39:04 +02:00
Tom Pratt
ab27e602cb Don't disable mobile data, AOSP has props for this
Mobile data during and after setupwizard can be controlled with:

ro.com.android.mobiledata
ro.com.android.prov_mobiledata

Change-Id: Ia4ef25f55ab32e8c13f9683b5db73438a29a192b
2024-02-28 17:05:26 +02:00
Michael Bestas
95cf350cc0 SetupWizard: Update backup page description
Seedvault backups can be restored from any OS that includes Seedvault,
they are not restricted to LineageOS.

Change-Id: Ie3d896d0377c8d2fe47558ae6a2bb54a0864498c
2024-02-26 00:25:44 +02:00
Michael Bestas
ee0104638c Match U setupdesign dark theme
Change-Id: Ifac33e5fc792e4a19cee645dbc355f56fcfada89
2024-02-26 00:25:44 +02:00
Michael Bestas
965cd0c223 Specify theme when launching external activities
Change-Id: Ia2db8a1b3753bdc3d9bd646be68e98367c2aed39
2024-02-26 00:25:44 +02:00
Michael Bestas
ec05005cfe SetupWizard: Make it REUSE compliant
* Ignored all the strings.xml since they are auto-synced

Change-Id: I5d9e7aa5ae7b0079f792450f7e6dbf83216ebac4
2024-02-26 00:25:43 +02:00
Oliver Scott
1db317b962 Remove old tests
Change-Id: I4344408d7e72093606e0cf90ada4f6bc02831a6b
2024-02-26 00:25:43 +02:00
Oliver Scott
feadacc46b Cleanup exit code
Change-Id: I5fe6165d87afa63887025c3635eafae9f968c062
2024-02-26 00:22:27 +02:00
Oliver Scott
fd0fdb8a49 Fix various java warnings
Change-Id: I4c4381e1755831df2c4f41279800fd6af173e4ed
2024-02-26 00:22:03 +02:00
Oliver Scott
7664461e5f Reformat code
Run automated code reformatting in Android Studio and manually fix
unwanted/broken style changes

Change-Id: Iaf14a08a275f9b11e1ae17f69201ab61a9c6ade1
2024-02-26 00:22:02 +02:00
Michael Bestas
f609cd21c8 SetupWizard: Remove unused resources
Change-Id: I42513b52e97c4f6fdf7ead2d2fa0f3bc6147755c
2024-02-26 00:19:23 +02:00
Jake Florence
9e8aa8c9ff SetupWizard: skip missing subactivities
when a subactivity is missing the setup wizard crashes and puts the user back to the previous page

this patch allows the user to continue as if they skipped

Change-Id: Icb4937b1751d9612c32cb3012f9fc05de2640891
2024-02-26 00:19:23 +02:00
Tommy Webb
ed1a968160 Revamp outro animation
Use the wallpaper as part of the window background rather than trying
to replicate it with WallpaperManager. This allows us to perform a
circular hide to whatever the wallpaper currently looks like exactly,
rather than needing to obtain the wallpaper Bitmap or Drawable and
guess. Display the Finish activity edge-to-edge. Fade out rather
than slide out.

Change-Id: I1154043178a04ca0ced7e8365e338dc10f3377cb
2024-02-26 00:19:23 +02:00
Tommy Webb
63bbec0258 Only finish Setup Wizard Activity when fully done
Wait for the ACTION_FINISHED broadcast before finishing the Activity.
This prevents the Setup Wizard from being re-launched when it is still
set as the default home screen, which it continues to be until the
exit worker changes as part of its finishSetupWizard call.

Skip SetupWizardExitActivity during the normal finish process, moving
common exit operations to SetupWizardUtils.

Change-Id: I1c59553e7dcaf934fb81dce9bf901ec0f2bb7b59
2024-02-26 00:19:22 +02:00