diff options
author | Roman Birg <roman@cyngn.com> | 2016-08-02 10:47:29 -0700 |
---|---|---|
committer | Roman Birg <roman@cyngn.com> | 2016-08-03 17:38:28 -0700 |
commit | d59f3670cf1979008532d8e8fa299f18954141e2 (patch) | |
tree | 466b07513f90c77075862e60d09ba7bf7c65205d /services/core | |
parent | 0d9281412f9d0d39babac814c0c4894e9df1fcbf (diff) | |
download | frameworks_base-d59f3670cf1979008532d8e8fa299f18954141e2.zip frameworks_base-d59f3670cf1979008532d8e8fa299f18954141e2.tar.gz frameworks_base-d59f3670cf1979008532d8e8fa299f18954141e2.tar.bz2 |
framework: don't allow assist activities while not provisioned
Ticket: CYNGNOS-3233
Change-Id: I40dae6b6fd1da497024965469fea0adc78a661c3
Signed-off-by: Roman Birg <roman@cyngn.com>
Diffstat (limited to 'services/core')
-rw-r--r-- | services/core/java/com/android/server/am/ActivityStackSupervisor.java | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/services/core/java/com/android/server/am/ActivityStackSupervisor.java b/services/core/java/com/android/server/am/ActivityStackSupervisor.java index 49b13c5..d54feeb 100644 --- a/services/core/java/com/android/server/am/ActivityStackSupervisor.java +++ b/services/core/java/com/android/server/am/ActivityStackSupervisor.java @@ -957,6 +957,15 @@ public final class ActivityStackSupervisor implements DisplayListener { return ActivityManager.START_CANCELED; } + if (intent.getAction() != null && !isProvisioned()) { + switch (intent.getAction()) { + case Intent.ACTION_PROCESS_TEXT: + case Intent.ACTION_ASSIST: + case Intent.ACTION_VOICE_ASSIST: + Slog.w(TAG, "not starting assist intent while not provisioned"); + return ActivityManager.START_NOT_CURRENT_USER_ACTIVITY; + } + } try { //TODO: This needs to be a flushed out API in the future. boolean isProtected = intent.getComponent() != null @@ -4677,4 +4686,9 @@ public final class ActivityStackSupervisor implements DisplayListener { return onLeanbackOnly; } + + private boolean isProvisioned() { + return Settings.Global.getInt(mService.mContext.getContentResolver(), + Settings.Global.DEVICE_PROVISIONED, 0) == 1; + } } |