diff options
author | Winson Chung <winsonc@google.com> | 2015-11-13 18:15:29 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2015-11-13 18:15:29 +0000 |
commit | 1b29fd87a26d6230c55c701d1411b34342614af0 (patch) | |
tree | c45147de4e3d7a9c29b49de3916f9d6f44cdb600 | |
parent | fe482e0bcabb98d983ecb4080b35490b9814c809 (diff) | |
parent | 3e9f2b789414f34b5530107c362295c5a637bac1 (diff) | |
download | frameworks_base-1b29fd87a26d6230c55c701d1411b34342614af0.zip frameworks_base-1b29fd87a26d6230c55c701d1411b34342614af0.tar.gz frameworks_base-1b29fd87a26d6230c55c701d1411b34342614af0.tar.bz2 |
Merge "DO NOT MERGE Ensure that the device is provisioned before showing Recents." into mnc-dev am: dce0f8040d
am: 3e9f2b7894
* commit '3e9f2b789414f34b5530107c362295c5a637bac1':
DO NOT MERGE Ensure that the device is provisioned before showing Recents.
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/recents/Recents.java | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/recents/Recents.java b/packages/SystemUI/src/com/android/systemui/recents/Recents.java index f1550a0..3917bab 100644 --- a/packages/SystemUI/src/com/android/systemui/recents/Recents.java +++ b/packages/SystemUI/src/com/android/systemui/recents/Recents.java @@ -34,6 +34,7 @@ import android.os.AsyncTask; import android.os.Handler; import android.os.SystemClock; import android.os.UserHandle; +import android.provider.Settings; import android.util.MutableBoolean; import android.view.Display; import android.view.LayoutInflater; @@ -280,6 +281,12 @@ public class Recents extends SystemUI @ProxyFromPrimaryToCurrentUser @Override public void showRecents(boolean triggeredFromAltTab, View statusBarView) { + // Ensure the device has been provisioned before allowing the user to interact with + // recents + if (!isDeviceProvisioned()) { + return; + } + if (mSystemServicesProxy.isForegroundUserOwner()) { showRecentsInternal(triggeredFromAltTab); } else { @@ -304,6 +311,12 @@ public class Recents extends SystemUI @ProxyFromPrimaryToCurrentUser @Override public void hideRecents(boolean triggeredFromAltTab, boolean triggeredFromHomeKey) { + // Ensure the device has been provisioned before allowing the user to interact with + // recents + if (!isDeviceProvisioned()) { + return; + } + if (mSystemServicesProxy.isForegroundUserOwner()) { hideRecentsInternal(triggeredFromAltTab, triggeredFromHomeKey); } else { @@ -330,6 +343,12 @@ public class Recents extends SystemUI @ProxyFromPrimaryToCurrentUser @Override public void toggleRecents(Display display, int layoutDirection, View statusBarView) { + // Ensure the device has been provisioned before allowing the user to interact with + // recents + if (!isDeviceProvisioned()) { + return; + } + if (mSystemServicesProxy.isForegroundUserOwner()) { toggleRecentsInternal(); } else { @@ -353,6 +372,12 @@ public class Recents extends SystemUI @ProxyFromPrimaryToCurrentUser @Override public void preloadRecents() { + // Ensure the device has been provisioned before allowing the user to interact with + // recents + if (!isDeviceProvisioned()) { + return; + } + if (mSystemServicesProxy.isForegroundUserOwner()) { preloadRecentsInternal(); } else { @@ -469,6 +494,12 @@ public class Recents extends SystemUI @Override public void showNextAffiliatedTask() { + // Ensure the device has been provisioned before allowing the user to interact with + // recents + if (!isDeviceProvisioned()) { + return; + } + // Keep track of when the affiliated task is triggered MetricsLogger.count(mContext, "overview_affiliated_task_next", 1); showRelativeAffiliatedTask(true); @@ -476,6 +507,12 @@ public class Recents extends SystemUI @Override public void showPrevAffiliatedTask() { + // Ensure the device has been provisioned before allowing the user to interact with + // recents + if (!isDeviceProvisioned()) { + return; + } + // Keep track of when the affiliated task is triggered MetricsLogger.count(mContext, "overview_affiliated_task_prev", 1); showRelativeAffiliatedTask(false); @@ -888,6 +925,14 @@ public class Recents extends SystemUI } /** + * @return whether this device is provisioned. + */ + private boolean isDeviceProvisioned() { + return Settings.Global.getInt(mContext.getContentResolver(), + Settings.Global.DEVICE_PROVISIONED, 0) != 0; + } + + /** * Returns the preloaded load plan and invalidates it. */ public static RecentsTaskLoadPlan consumeInstanceLoadPlan() { |