Re: [MM 0.6] Plumb up the SPN display-rule bits



Hey Dan & Nathan,


> If we did combine both bits into one property, then we'd get the
> following logic:
> 
> enum {
>     DISPLAY_UNRESTRICTED = 0,
>     DISPLAY_REGISTERED = 1,
>     DISPLAY_SPN = 2
> } DisplayName;
> 
> display = DISPLAY_UNRESTRICTED
> if (registered network is well-known) {
>    if (b1 == 1)
>       display = DISPLAY_REGISTERED
> } else {
>    if (b2 == 0)
>       display = DISPLAY_SPN
> }
> 


This logic gets aligned more or less with some piece of code I found
from Android sources:

    /**
     * Returns the SpnDisplayRule based on settings on the SIM and the
     * specified plmn (currently-registered PLMN).  See TS 22.101 AnnexA
     * and TS 51.011 10.3.11 for details.
     *
     * If the SPN is not found on the SIM, the rule is always PLMN_ONLY.
     */
    protected int getDisplayRule(String plmn) {
        int rule;
        if (spn == null || spnDisplayCondition == -1) {
// EF_SPN was not found on the SIM, or not yet loaded.  Just show ONS.
            rule = SPN_RULE_SHOW_PLMN;
        } else if (isOnMatchingPlmn(plmn)) {
// (Checks if plmn is HPLMN or on the spdiNetworks list.)
            rule = SPN_RULE_SHOW_SPN;
            if ((spnDisplayCondition & 0x01) == 0x01)
// ONS required when registered to HPLMN or PLMN in EF_SPDI
                rule |= SPN_RULE_SHOW_PLMN;
            }
        } else {
            rule = SPN_RULE_SHOW_PLMN;
            if ((spnDisplayCondition & 0x02) == 0x00) {
// SPN required if not registered to HPLMN or PLMN in EF_SPDI
                rule |= SPN_RULE_SHOW_SPN;
            }
        }
        return rule;
    }


Regardless of the meaning of the SPDI Networks list, it's probably a
good approach to follow. Nathan, what do you think?

Also, if we do expose these two properties we also need to load and
expose the SPDI network list, or the properties will be useless.

-- 
Aleksander


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]