OSDN Git Service

Don't show clings in guest user
authorAmith Yamasani <yamasani@google.com>
Wed, 25 Jun 2014 10:44:02 +0000 (16:14 +0530)
committerAmith Yamasani <yamasani@google.com>
Wed, 2 Jul 2014 02:27:54 +0000 (02:27 +0000)
If the SKIP_FIRST_USE_HINTS setting is ON, don't show clings. This
is used for Guest users.

Bug: 15873403
Change-Id: Icae713788c3ed26d55e8e713da7ec7d0d2b25fce

src/com/android/launcher3/LauncherClings.java

index 1176aa5..00586bd 100644 (file)
@@ -29,6 +29,7 @@ import android.content.pm.PackageManager;
 import android.graphics.Rect;
 import android.os.Bundle;
 import android.os.UserManager;
+import android.provider.Settings;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.view.ViewGroup;
@@ -48,6 +49,9 @@ class LauncherClings {
     private static final int SHOW_CLING_DURATION = 250;
     private static final int DISMISS_CLING_DURATION = 200;
 
+    // New Secure Setting in L
+    private static final String SKIP_FIRST_USE_HINTS = "skip_first_use_hints";
+
     private Launcher mLauncher;
     private LayoutInflater mInflater;
     private HideFromAccessibilityHelper mHideFromAccessibilityHelper
@@ -107,6 +111,10 @@ class LauncherClings {
                 return false;
             }
         }
+        if (Settings.Secure.getInt(mLauncher.getContentResolver(), SKIP_FIRST_USE_HINTS, 0)
+                == 1) {
+            return false;
+        }
         return true;
     }