List of usage examples for android.app.admin DevicePolicyManager EXTRA_PROVISIONING_LOCALE
String EXTRA_PROVISIONING_LOCALE
To view the source code for android.app.admin DevicePolicyManager EXTRA_PROVISIONING_LOCALE.
Click Source Link
From source file:com.example.android.nfcprovisioning.ProvisioningValuesLoader.java
private void loadSystemValues(HashMap<String, String> values) { Context context = getContext(); putIfMissing(values, DevicePolicyManager.EXTRA_PROVISIONING_DEVICE_ADMIN_PACKAGE_NAME, "com.example.android.deviceowner"); putIfMissing(values, DevicePolicyManager.EXTRA_PROVISIONING_LOCALE, context.getResources().getConfiguration().locale.toString()); putIfMissing(values, DevicePolicyManager.EXTRA_PROVISIONING_TIME_ZONE, TimeZone.getDefault().getID()); if (!values.containsKey(DevicePolicyManager.EXTRA_PROVISIONING_WIFI_SSID)) { WifiManager wifiManager = (WifiManager) context.getSystemService(Activity.WIFI_SERVICE); WifiInfo info = wifiManager.getConnectionInfo(); values.put(DevicePolicyManager.EXTRA_PROVISIONING_WIFI_SSID, trimSsid(info.getSSID())); }/*from ww w . j av a 2 s .c o m*/ }
From source file:com.example.android.nfcprovisioning.NfcProvisioningFragment.java
@Override public void onTextChanged(int id, String s) { if (mProvisioningValues == null) { return;/*from w w w .j av a 2 s .com*/ } switch (id) { case R.id.package_name: mProvisioningValues.put(DevicePolicyManager.EXTRA_PROVISIONING_DEVICE_ADMIN_PACKAGE_NAME, s); break; case R.id.locale: mProvisioningValues.put(DevicePolicyManager.EXTRA_PROVISIONING_LOCALE, s); break; case R.id.timezone: mProvisioningValues.put(DevicePolicyManager.EXTRA_PROVISIONING_TIME_ZONE, s); break; case R.id.wifi_ssid: mProvisioningValues.put(DevicePolicyManager.EXTRA_PROVISIONING_WIFI_SSID, s); break; case R.id.wifi_security_type: mProvisioningValues.put(DevicePolicyManager.EXTRA_PROVISIONING_WIFI_SECURITY_TYPE, s); break; case R.id.wifi_password: mProvisioningValues.put(DevicePolicyManager.EXTRA_PROVISIONING_WIFI_PASSWORD, s); break; } }
From source file:com.example.android.nfcprovisioning.NfcProvisioningFragment.java
@Override public void onLoadFinished(Loader<Map<String, String>> loader, Map<String, String> values) { if (loader.getId() == LOADER_PROVISIONING_VALUES) { mProvisioningValues = values;// w ww .j ava2 s . c om mEditPackageName.setText(values.get(DevicePolicyManager.EXTRA_PROVISIONING_DEVICE_ADMIN_PACKAGE_NAME)); mEditLocale.setText(values.get(DevicePolicyManager.EXTRA_PROVISIONING_LOCALE)); mEditTimezone.setText(values.get(DevicePolicyManager.EXTRA_PROVISIONING_TIME_ZONE)); mEditWifiSsid.setText(values.get(DevicePolicyManager.EXTRA_PROVISIONING_WIFI_SSID)); mEditWifiSecurityType.setText(values.get(DevicePolicyManager.EXTRA_PROVISIONING_WIFI_SECURITY_TYPE)); mEditWifiPassword.setText(null); } }