无法为sim卡配置文件android 11添加passpoint配置

1aaf6o9v  于 2021-09-13  发布在  Java
关注(0)|答案(0)|浏览(386)

我在将passpoint配置添加到android 11时遇到以下错误。该代码在android 8上运行良好。

E/WifiNetworkSuggestionsManager: bad wifi suggestion from app: com.stl.hs2supportcheck
E/WifiService: Failed to add network suggestions

我正在使用下面的代码添加passpoint配置

Credential.SimCredential simCredential = new Credential.SimCredential();
    simCredential.setImsi("40405*");
    simCredential.setEapType(23);

    //TODO Missing Some Settings
    Credential c1 = new Credential();
    c1.setRealm(simProfile.getRealm());
    c1.setSimCredential(simCredential);

    //Set HomeSp : frindlyName and FQDN is mandatory
    HomeSp homeSp = new HomeSp();
    homeSp.setFriendlyName("WifiName");
    homeSp.setFqdn("test.com");

    PasspointConfiguration passpointConfiguration = new PasspointConfiguration();
    passpointConfiguration.setCredential(c1);
    passpointConfiguration.setHomeSp(homeSp);

    ArrayList<WifiNetworkSuggestion> suggestionList = new ArrayList<>();
    WifiNetworkSuggestion suggestion =
               new WifiNetworkSuggestion.Builder()
                      .setPasspointConfig(passpointConfiguration)
                      .setIsAppInteractionRequired(true) // Optional (Needs location permission)
                      .build();

            suggestionList.add(suggestion);
            wifiManager.addNetworkSuggestions(suggestionList);  //It returns fail

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题