summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Winson Chung <winsonc@google.com> 2015-11-13 18:02:38 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2015-11-13 18:02:38 +0000
commitbb4da4efc320caee77f11bb316145b8e5f264e07 (patch)
tree72ac7a4642b74d3e14ddb9686ef8652cb228ff69
parentbf29f10c1e7dd37c3020bc7a792bb7bda451a149 (diff)
parent16a76dadcc23a13223e9c2216dad1fe5cad7d6e1 (diff)
Merge "DO NOT MERGE Ensure that the device is provisioned before showing Recents." into lmp-mr1-dev
-rw-r--r--packages/SystemUI/src/com/android/systemui/recents/AlternateRecentsComponent.java45
1 files changed, 45 insertions, 0 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/recents/AlternateRecentsComponent.java b/packages/SystemUI/src/com/android/systemui/recents/AlternateRecentsComponent.java
index 910a57e730c1..141d97cce9c8 100644
--- a/packages/SystemUI/src/com/android/systemui/recents/AlternateRecentsComponent.java
+++ b/packages/SystemUI/src/com/android/systemui/recents/AlternateRecentsComponent.java
@@ -36,6 +36,7 @@ import android.graphics.Rect;
import android.os.Handler;
import android.os.SystemClock;
import android.os.UserHandle;
+import android.provider.Settings;
import android.util.Pair;
import android.view.LayoutInflater;
import android.view.View;
@@ -239,6 +240,12 @@ public class AlternateRecentsComponent implements ActivityOptions.OnAnimationSta
/** Shows the Recents. */
@ProxyFromPrimaryToCurrentUser
public void onShowRecents(boolean triggeredFromAltTab) {
+ // Ensure the device has been provisioned before allowing the user to interact with
+ // recents
+ if (!isDeviceProvisioned()) {
+ return;
+ }
+
if (mSystemServicesProxy.isForegroundUserOwner()) {
showRecents(triggeredFromAltTab);
} else {
@@ -261,6 +268,12 @@ public class AlternateRecentsComponent implements ActivityOptions.OnAnimationSta
/** Hides the Recents. */
@ProxyFromPrimaryToCurrentUser
public void onHideRecents(boolean triggeredFromAltTab, boolean triggeredFromHomeKey) {
+ // Ensure the device has been provisioned before allowing the user to interact with
+ // recents
+ if (!isDeviceProvisioned()) {
+ return;
+ }
+
if (mSystemServicesProxy.isForegroundUserOwner()) {
hideRecents(triggeredFromAltTab, triggeredFromHomeKey);
} else {
@@ -287,6 +300,12 @@ public class AlternateRecentsComponent implements ActivityOptions.OnAnimationSta
/** Toggles the Recents activity. */
@ProxyFromPrimaryToCurrentUser
public void onToggleRecents() {
+ // Ensure the device has been provisioned before allowing the user to interact with
+ // recents
+ if (!isDeviceProvisioned()) {
+ return;
+ }
+
if (mSystemServicesProxy.isForegroundUserOwner()) {
toggleRecents();
} else {
@@ -308,6 +327,12 @@ public class AlternateRecentsComponent implements ActivityOptions.OnAnimationSta
/** Preloads info for the Recents activity. */
@ProxyFromPrimaryToCurrentUser
public void onPreloadRecents() {
+ // Ensure the device has been provisioned before allowing the user to interact with
+ // recents
+ if (!isDeviceProvisioned()) {
+ return;
+ }
+
if (mSystemServicesProxy.isForegroundUserOwner()) {
preloadRecents();
} else {
@@ -400,10 +425,22 @@ public class AlternateRecentsComponent implements ActivityOptions.OnAnimationSta
}
public void onShowNextAffiliatedTask() {
+ // Ensure the device has been provisioned before allowing the user to interact with
+ // recents
+ if (!isDeviceProvisioned()) {
+ return;
+ }
+
showRelativeAffiliatedTask(true);
}
public void onShowPrevAffiliatedTask() {
+ // Ensure the device has been provisioned before allowing the user to interact with
+ // recents
+ if (!isDeviceProvisioned()) {
+ return;
+ }
+
showRelativeAffiliatedTask(false);
}
@@ -747,6 +784,14 @@ public class AlternateRecentsComponent implements ActivityOptions.OnAnimationSta
return plan;
}
+ /**
+ * @return whether this device is provisioned.
+ */
+ private boolean isDeviceProvisioned() {
+ return Settings.Global.getInt(mContext.getContentResolver(),
+ Settings.Global.DEVICE_PROVISIONED, 0) != 0;
+ }
+
/**** OnAnimationStartedListener Implementation ****/
@Override