List of usage examples for android.app.admin DevicePolicyManager EXTRA_PROVISIONING_TIME_ZONE
String EXTRA_PROVISIONING_TIME_ZONE
To view the source code for android.app.admin DevicePolicyManager EXTRA_PROVISIONING_TIME_ZONE.
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())); }// www . j a v 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 ww w.ja v a2 s . c o m } 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 w w . j a v a 2 s. co m 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); } }