Search in sources :

Example 96 with PersistableBundle

use of android.os.PersistableBundle in project android_packages_apps_Settings by DirtyUnicorns.

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);
    }
}
Also used : PersistableBundle(android.os.PersistableBundle)

Example 97 with PersistableBundle

use of android.os.PersistableBundle in project android_packages_apps_Settings by DirtyUnicorns.

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);
        }
    }
}
Also used : PersistableBundle(android.os.PersistableBundle) Intent(android.content.Intent)

Example 98 with PersistableBundle

use of android.os.PersistableBundle in project android_packages_apps_Settings by DirtyUnicorns.

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;
}
Also used : CarrierConfigManager(android.telephony.CarrierConfigManager) PersistableBundle(android.os.PersistableBundle) ComponentName(android.content.ComponentName) Intent(android.content.Intent)

Example 99 with PersistableBundle

use of android.os.PersistableBundle in project MiMangaNu by raulhaag.

the class MainActivity method onSaveInstanceState.

@Override
public void onSaveInstanceState(Bundle outState, PersistableBundle outPersistentState) {
    Bundle bundle = new Bundle();
    super.onSaveInstanceState(bundle, outPersistentState);
}
Also used : Bundle(android.os.Bundle) PersistableBundle(android.os.PersistableBundle)

Example 100 with PersistableBundle

use of android.os.PersistableBundle in project platform_packages_apps_Settings by BlissRoms.

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);
    }
}
Also used : PersistableBundle(android.os.PersistableBundle)

Aggregations

PersistableBundle (android.os.PersistableBundle)321 CarrierConfigManager (android.telephony.CarrierConfigManager)87 ComponentName (android.content.ComponentName)67 Intent (android.content.Intent)63 ShortcutInfo (android.content.pm.ShortcutInfo)48 Test (org.junit.Test)35 Bundle (android.os.Bundle)28 XmlPullParserException (org.xmlpull.v1.XmlPullParserException)25 IOException (java.io.IOException)21 Icon (android.graphics.drawable.Icon)17 JobInfo (android.app.job.JobInfo)15 IntentFilter (android.content.IntentFilter)15 Account (android.accounts.Account)14 Activity (android.app.Activity)12 TelephonyManager (android.telephony.TelephonyManager)12 SmallTest (android.test.suitebuilder.annotation.SmallTest)12 XmlPullParser (org.xmlpull.v1.XmlPullParser)12 Before (org.junit.Before)11 PendingIntent (android.app.PendingIntent)9 PackageManager (android.content.pm.PackageManager)9