use of android.os.PersistableBundle in project android_packages_apps_Settings by omnirom.
the class RestrictedDashboardFragment method ensurePin.
private void ensurePin() {
if (!mChallengeSucceeded && !mChallengeRequested && mRestrictionsManager.hasRestrictionsProvider()) {
Intent intent = mRestrictionsManager.createLocalApprovalIntent();
if (intent != null) {
mChallengeRequested = true;
mChallengeSucceeded = false;
PersistableBundle request = new PersistableBundle();
request.putString(RestrictionsManager.REQUEST_KEY_MESSAGE, getResources().getString(R.string.restr_pin_enter_admin_pin));
intent.putExtra(RestrictionsManager.EXTRA_REQUEST_BUNDLE, request);
startActivityForResult(intent, REQUEST_PIN_CHALLENGE);
}
}
}
use of android.os.PersistableBundle in project android_packages_apps_Settings by omnirom.
the class SimStatus method updatePreference.
private void updatePreference() {
if (mPhone.getPhoneType() != TelephonyManager.PHONE_TYPE_CDMA) {
mShowLatestAreaInfo = Resources.getSystem().getBoolean(com.android.internal.R.bool.config_showAreaUpdateInfoSettings);
}
PersistableBundle carrierConfig = mCarrierConfigManager.getConfigForSubId(mSir.getSubscriptionId());
mShowICCID = carrierConfig.getBoolean(CarrierConfigManager.KEY_SHOW_ICCID_IN_SIM_STATUS_BOOL);
// If formattedNumber is null or empty, it'll display as "Unknown".
setSummaryText(KEY_PHONE_NUMBER, DeviceInfoUtils.getFormattedPhoneNumber(getContext(), mSir));
setSummaryText(KEY_IMEI, mPhone.getImei());
setSummaryText(KEY_IMEI_SV, mPhone.getDeviceSvn());
if (!mShowICCID) {
removePreferenceFromScreen(KEY_ICCID);
} else {
// Get ICCID, which is SIM serial number
String iccid = mTelephonyManager.getSimSerialNumber(mSir.getSubscriptionId());
setSummaryText(KEY_ICCID, iccid);
}
if (!mShowLatestAreaInfo) {
removePreferenceFromScreen(KEY_LATEST_AREA_INFO);
}
}
use of android.os.PersistableBundle in project android_packages_apps_Settings by crdroidandroid.
the class RestrictedDashboardFragment method ensurePin.
private void ensurePin() {
if (!mChallengeSucceeded && !mChallengeRequested && mRestrictionsManager.hasRestrictionsProvider()) {
Intent intent = mRestrictionsManager.createLocalApprovalIntent();
if (intent != null) {
mChallengeRequested = true;
mChallengeSucceeded = false;
PersistableBundle request = new PersistableBundle();
request.putString(RestrictionsManager.REQUEST_KEY_MESSAGE, getResources().getString(R.string.restr_pin_enter_admin_pin));
intent.putExtra(RestrictionsManager.EXTRA_REQUEST_BUNDLE, request);
startActivityForResult(intent, REQUEST_PIN_CHALLENGE);
}
}
}
use of android.os.PersistableBundle in project android_packages_apps_Settings by crdroidandroid.
the class ConditionManager method saveToXml.
private void saveToXml() {
if (DEBUG)
Log.d(TAG, "Writing to " + mXmlFile.toString());
try {
XmlSerializer serializer = Xml.newSerializer();
FileWriter writer = new FileWriter(mXmlFile);
serializer.setOutput(writer);
serializer.startDocument("UTF-8", true);
serializer.startTag("", TAG_CONDITIONS);
final int N = mConditions.size();
for (int i = 0; i < N; i++) {
PersistableBundle bundle = new PersistableBundle();
if (mConditions.get(i).saveState(bundle)) {
serializer.startTag("", TAG_CONDITION);
final String clz = mConditions.get(i).getClass().getSimpleName();
serializer.attribute("", ATTR_CLASS, clz);
bundle.saveToXml(serializer);
serializer.endTag("", TAG_CONDITION);
}
}
serializer.endTag("", TAG_CONDITIONS);
serializer.flush();
writer.close();
} catch (XmlPullParserException | IOException e) {
Log.w(TAG, "Problem writing " + FILE_NAME, e);
}
}
use of android.os.PersistableBundle in project android_packages_apps_Settings by crdroidandroid.
the class WifiCallingSettings method getCarrierActivityIntent.
/*
* Get the Intent to launch carrier emergency address management activity.
* Return null when no activity found.
*/
private static Intent getCarrierActivityIntent(Context context) {
// Retrive component name from carrirt config
CarrierConfigManager configManager = context.getSystemService(CarrierConfigManager.class);
if (configManager == null)
return null;
PersistableBundle bundle = configManager.getConfig();
if (bundle == null)
return null;
String carrierApp = bundle.getString(CarrierConfigManager.KEY_WFC_EMERGENCY_ADDRESS_CARRIER_APP_STRING);
if (TextUtils.isEmpty(carrierApp))
return null;
ComponentName componentName = ComponentName.unflattenFromString(carrierApp);
if (componentName == null)
return null;
// Build and return intent
Intent intent = new Intent();
intent.setComponent(componentName);
return intent;
}
Aggregations