packages/apps/Settings
Revisão | 2169505c9a9300ca564a39d218b80dcfefc76c2a (tree) |
---|---|
Hora | 2016-07-22 09:35:48 |
Autor | Jason Monk <jmonk@goog...> |
Commiter | gitbuildkicker |
Pre-setup restrictions DO NOT MERGE
Bug: 29194585
Change-Id: I74ab8aaab62d62cc4dbbdf3164429a503f3a572b
@@ -24,6 +24,7 @@ import android.content.pm.PackageInfo; | ||
24 | 24 | import android.content.pm.PackageManager.NameNotFoundException; |
25 | 25 | import android.content.res.Resources.Theme; |
26 | 26 | import android.net.Uri; |
27 | +import android.provider.Settings.Global; | |
27 | 28 | import android.text.TextUtils; |
28 | 29 | import android.util.Log; |
29 | 30 | import android.util.TypedValue; |
@@ -90,6 +91,9 @@ public class HelpUtils { | ||
90 | 91 | */ |
91 | 92 | public static boolean prepareHelpMenuItem(final Activity activity, MenuItem helpMenuItem, |
92 | 93 | String helpUriString, String backupContext) { |
94 | + if (Global.getInt(activity.getContentResolver(), Global.DEVICE_PROVISIONED, 0) == 0) { | |
95 | + return false; | |
96 | + } | |
93 | 97 | if (TextUtils.isEmpty(helpUriString)) { |
94 | 98 | // The help url string is empty or null, so set the help menu item to be invisible. |
95 | 99 | helpMenuItem.setVisible(false); |
@@ -123,6 +127,9 @@ public class HelpUtils { | ||
123 | 127 | |
124 | 128 | public static Intent getHelpIntent(Context context, String helpUriString, |
125 | 129 | String backupContext) { |
130 | + if (Global.getInt(context.getContentResolver(), Global.DEVICE_PROVISIONED, 0) == 0) { | |
131 | + return null; | |
132 | + } | |
126 | 133 | // Try to handle as Intent Uri, otherwise just treat as Uri. |
127 | 134 | try { |
128 | 135 | Intent intent = Intent.parseUri(helpUriString, |
@@ -46,6 +46,7 @@ import android.preference.Preference; | ||
46 | 46 | import android.preference.PreferenceFragment; |
47 | 47 | import android.preference.PreferenceManager; |
48 | 48 | import android.preference.PreferenceScreen; |
49 | +import android.provider.Settings.Global; | |
49 | 50 | import android.text.TextUtils; |
50 | 51 | import android.transition.TransitionManager; |
51 | 52 | import android.util.ArrayMap; |
@@ -1316,6 +1317,10 @@ public class SettingsActivity extends Activity | ||
1316 | 1317 | } |
1317 | 1318 | |
1318 | 1319 | private void addExternalTiles(List<DashboardCategory> target) { |
1320 | + if (Global.getInt(getContentResolver(), Global.DEVICE_PROVISIONED, 0) == 0) { | |
1321 | + // Don't add external tiles until device is set up. | |
1322 | + return; | |
1323 | + } | |
1319 | 1324 | Map<Pair<String, String>, DashboardTile> addedCache = |
1320 | 1325 | new ArrayMap<Pair<String, String>, DashboardTile>(); |
1321 | 1326 | UserManager userManager = UserManager.get(this); |
@@ -45,6 +45,7 @@ import android.preference.Preference.OnPreferenceClickListener; | ||
45 | 45 | import android.preference.PreferenceGroup; |
46 | 46 | import android.preference.PreferenceScreen; |
47 | 47 | import android.provider.Settings; |
48 | +import android.provider.Settings.Global; | |
48 | 49 | import android.provider.Settings.Secure; |
49 | 50 | import android.util.Log; |
50 | 51 | import android.util.SparseArray; |
@@ -229,6 +230,11 @@ public class UserSettings extends SettingsPreferenceFragment | ||
229 | 230 | filter.addAction(Intent.ACTION_USER_INFO_CHANGED); |
230 | 231 | context.registerReceiverAsUser(mUserChangeReceiver, UserHandle.ALL, filter, null, |
231 | 232 | mHandler); |
233 | + | |
234 | + if (Global.getInt(getContext().getContentResolver(), Global.DEVICE_PROVISIONED, 0) == 0) { | |
235 | + getActivity().finish(); | |
236 | + return; | |
237 | + } | |
232 | 238 | } |
233 | 239 | |
234 | 240 | @Override |