diff options
| author | Eric Sandness <sandness@google.com> | 2020-03-13 17:55:51 +0000 |
|---|---|---|
| committer | Eric Sandness <sandness@google.com> | 2020-03-17 09:26:42 +0000 |
| commit | e89d0e1ba5cce0aa30575248c445c07ed4f923f3 (patch) | |
| tree | d0f4f0aa9d2166118cfd958fd49fe3d33de8b914 /core/java | |
| parent | 3cfc4d0450d3da619e57d57aadf70d396f4b7fe2 (diff) | |
Don't Show Work Profile Toast During Setup
Before device setup is complete, we shouldn't ever show the "using this
app outside your work profile" toast. This toast is confusing in the
context of Setup Wizard.
Fixes: 150451876
Test: atest com.android.internal.app.IntentForwarderActivityTest
Test: Manually verified no toast during setup
Test: Manually verified toast appears after setup
Change-Id: I661cc18c625609726388f3705c7b893517e23323
Diffstat (limited to 'core/java')
| -rw-r--r-- | core/java/com/android/internal/app/IntentForwarderActivity.java | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/core/java/com/android/internal/app/IntentForwarderActivity.java b/core/java/com/android/internal/app/IntentForwarderActivity.java index 7a0afa2036f6..9bdfa4ad4e43 100644 --- a/core/java/com/android/internal/app/IntentForwarderActivity.java +++ b/core/java/com/android/internal/app/IntentForwarderActivity.java @@ -38,6 +38,7 @@ import android.os.Bundle; import android.os.RemoteException; import android.os.UserHandle; import android.os.UserManager; +import android.provider.Settings; import android.util.Slog; import android.widget.Toast; @@ -153,6 +154,9 @@ public class IntentForwarderActivity extends Activity { } private boolean shouldShowDisclosure(@Nullable ResolveInfo ri, Intent intent) { + if (!isDeviceProvisioned()) { + return false; + } if (ri == null || ri.activityInfo == null) { return true; } @@ -163,6 +167,11 @@ public class IntentForwarderActivity extends Activity { return !isTargetResolverOrChooserActivity(ri.activityInfo); } + private boolean isDeviceProvisioned() { + return Settings.Global.getInt(getContentResolver(), + Settings.Global.DEVICE_PROVISIONED, /* def= */ 0) != 0; + } + private boolean isTextMessageIntent(Intent intent) { return (Intent.ACTION_SENDTO.equals(intent.getAction()) || isViewActionIntent(intent)) && ALLOWED_TEXT_MESSAGE_SCHEMES.contains(intent.getScheme()); |
