SetupWizardActivity: better documentation again
This commit is contained in:
parent
7202151378
commit
14a4ca6cd2
|
@ -28,7 +28,7 @@ public class ShelterDeviceAdminReceiver extends DeviceAdminReceiver {
|
||||||
Intent i = new Intent(context.getApplicationContext(), DummyActivity.class);
|
Intent i = new Intent(context.getApplicationContext(), DummyActivity.class);
|
||||||
i.setAction(DummyActivity.FINALIZE_PROVISION);
|
i.setAction(DummyActivity.FINALIZE_PROVISION);
|
||||||
i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||||
// Delegate starting activity to notification so we won't break on Android 10
|
// Delegate starting activity to notification to work around background limitations
|
||||||
// And also maybe this will fix bugs on stupid custom OSes like MIUI / EMUI
|
// And also maybe this will fix bugs on stupid custom OSes like MIUI / EMUI
|
||||||
Notification notification = Utility.buildNotification(context, true,
|
Notification notification = Utility.buildNotification(context, true,
|
||||||
"shelter-finish-provision",
|
"shelter-finish-provision",
|
||||||
|
|
|
@ -31,7 +31,8 @@ import net.typeblog.shelter.util.Utility;
|
||||||
public class SetupWizardActivity extends AppCompatActivity {
|
public class SetupWizardActivity extends AppCompatActivity {
|
||||||
// RESUME_SETUP should be used when MainActivity detects the provisioning has been
|
// RESUME_SETUP should be used when MainActivity detects the provisioning has been
|
||||||
// finished by the system, but the Shelter inside the profile has never been brought up
|
// finished by the system, but the Shelter inside the profile has never been brought up
|
||||||
// due to the user having not clicked on the notification yet.
|
// due to the user having not clicked on the notification yet (on Android 7 or lower).
|
||||||
|
// TODO: When we remove support for Android 7, get rid of all of these nonsense :)
|
||||||
public static final String ACTION_RESUME_SETUP = "net.typeblog.shelter.RESUME_SETUP";
|
public static final String ACTION_RESUME_SETUP = "net.typeblog.shelter.RESUME_SETUP";
|
||||||
public static final String ACTION_PROFILE_PROVISIONED = "net.typeblog.shelter.PROFILE_PROVISIONED";
|
public static final String ACTION_PROFILE_PROVISIONED = "net.typeblog.shelter.PROFILE_PROVISIONED";
|
||||||
|
|
||||||
|
@ -115,9 +116,11 @@ public class SetupWizardActivity extends AppCompatActivity {
|
||||||
private void setupProfileCb(Boolean result) {
|
private void setupProfileCb(Boolean result) {
|
||||||
if (result) {
|
if (result) {
|
||||||
if (Utility.isWorkProfileAvailable(this)) {
|
if (Utility.isWorkProfileAvailable(this)) {
|
||||||
// The setup could be already finalized at this point
|
// On Oreo and later versions, since we make use of the activity intent
|
||||||
// (post-Oreo, since there is the activity intent ACTION_PROVISIONING_SUCCESSFUL,
|
// ACTION_PROVISIONING_SUCCESSFUL, the provisioning UI will not finish
|
||||||
// the work profile provisioning UI will not finish until that activity finishes.)
|
// until that activity returns. In this case, there is really no need for us
|
||||||
|
// to do anything else here (and this callback may not even be called because
|
||||||
|
// the activity will likely be already finished by this point).
|
||||||
// There is no need for more action
|
// There is no need for more action
|
||||||
finishWithResult(true);
|
finishWithResult(true);
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in a new issue