packages/apps/Settings
Revisión | 0449828636aecce9d5b5e3d9be835540e6784d7a (tree) |
---|---|
Tiempo | 2016-09-07 14:55:35 |
Autor | Chih-Wei Huang <cwhuang@linu...> |
Commiter | Chih-Wei Huang |
Merge tag 'android-6.0.1_r66' into marshmallow-x86
Android 6.0.1 release 66
@@ -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; |
@@ -1322,6 +1323,10 @@ public class SettingsActivity extends Activity | ||
1322 | 1323 | } |
1323 | 1324 | |
1324 | 1325 | private void addExternalTiles(List<DashboardCategory> target) { |
1326 | + if (Global.getInt(getContentResolver(), Global.DEVICE_PROVISIONED, 0) == 0) { | |
1327 | + // Don't add external tiles until device is set up. | |
1328 | + return; | |
1329 | + } | |
1325 | 1330 | Map<Pair<String, String>, DashboardTile> addedCache = |
1326 | 1331 | new ArrayMap<Pair<String, String>, DashboardTile>(); |
1327 | 1332 | 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 |