Handle the possibly thrown ActivityNotFoundException.Changed the generic catch block into a specific catch block to handle ActivityNotFoundException.
Helps with an issue where qsb widget doesn't work when
running through oobe without network.
Also set the cm setup finished setting for test receiver.
* Launches GMS TOS per documentation
* Filters out redundant location page if GMS present
* Uses setupwizardlib for some helper functions
* Hide notification icons
Android uses Settings.Global.DEVICE_PROVISIONED and
Settings.Secure.USER_SETUP_COMPLETE and the system responds to those
database entries, such as allowing the keyguard to be visible, or maybe
pulling the statusbar down.
Since we still depend on some of Google's setup wizard, it also keys off
the same table rows and it may decide that the device is now provisioned
when we still haven't finished our own setup wizard, so let's add
another key that we have control over to show the real state of OUR
Signed-off-by: Roman Birg <email@example.com>
People generally identify their SIMs by the emitting carrier, not
the network they attach to. In roaming or MVNO scenarios, these
are likely not to be the same, leading to confusion in SIM selection.
If a user goes through the gms flow, logging in, disabling
backup, getting kicked over to restore, and deciding to
set the device up as new, the existing logic would reprompt
since the flow causes the load action to happen again.
Now check for account existance, and skip the setup if true.
If a user logs into Google's SetupWizard with their
gmail account, they need to be prompted with a restoration
picker -- otherwise, if they have a valid restoreToken
and restoreAccount, we can assume that they came from a
Tap & Go scenario and begin restoring as needed.
Since the restore process (or any external setup wizard
process) can take a long time to finish execution, save
the current page and restore it on recreation when necessary.
Since Marshmallow broke the ability to utilize complex
matrix queries against the SettingsProvider because it
is now backed by XML, rewrite the logic for the backup
enabled flag to work within the new constraints.
Some sims such as T-Mobile return incorrect languages for their
PL(Preferred languages). Lookup the locale via the MccTable instead,
and fallback to trusting the sim.