Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ae192e45 authored by Fang Yunong's avatar Fang Yunong Committed by Linux Build Service Account
Browse files

Hotspot: customize hotspot for specific carriers

1. Provide an interface to allow user to configure max clients;
2. Add configuration to broadcast/hide SSID;
3. Display an user-friendly notification when turning on hotspot;

CRs-Fixed: 1039253
Change-Id: I5bf278fbbd969cd001de5617267ad264da78b95e
parent a3fd541b
Loading
Loading
Loading
Loading
+21 −0
Original line number Diff line number Diff line
@@ -2691,4 +2691,25 @@
  <java-symbol type="string" name="operator_config_url" />
  <java-symbol type="string" name="operator_ping_url" />
  <java-symbol type="bool" name="config_zero_balance_operator"/>
  <!-- Symbols/Overlays for carrier hotspot -->
  <java-symbol type="bool" name="config_regional_hotspot_show_maximum_connection_enable" />

  <!-- keypress optimization -->
  <java-symbol type="bool" name="config_enableKeypressOptimization" />
  <java-symbol type="array" name="keypress_param_value" />
  <java-symbol type="bool" name="config_enableDataSwitch" />
  <!-- Symbols/Overlays for Network settings -->
  <java-symbol type="bool" name="config_regional_mcc_mnc_roaming_setting" />
  <!-- Symbols/Overlays for Network settings start -->
  <java-symbol type="bool" name="config_regional_lte_singnal_threshold" />
  <java-symbol type="bool" name="config_regional_umts_singnal_threshold" />

  <java-symbol type="array" name="umts_signal_strength_threshold" />
  <java-symbol type="array" name="lte_signal_strength_threshold" />

  <java-symbol type="bool" name="config_regional_hotspot_show_broadcast_ssid_checkbox" />
  <java-symbol type="bool" name="config_regional_hotspot_show_notification_when_turn_on" />

  <java-symbol type="bool" name="config_showOperatorNameInStatusBar" />
  <java-symbol type="bool" name="config_passpoint_setting_on" />
</resources>
+22 −3
Original line number Diff line number Diff line
@@ -1503,10 +1503,29 @@ public class NetworkManagementService extends INetworkManagementService.Stub
            if (wifiConfig == null) {
                args = new Object[] {"set", wlanIface};
            } else {
                String ssid_mode = "broadcast";
                if (mContext.getResources().getBoolean(
                        com.android.internal.R.bool
                        .config_regional_hotspot_show_broadcast_ssid_checkbox)
                        && wifiConfig.hiddenSSID) {
                    ssid_mode = "hidden";
                }
                if (mContext.getResources().getBoolean(
                        com.android.internal.R.bool
                        .config_regional_hotspot_show_maximum_connection_enable)) {
                    int clientNum = Settings.System.getInt(mContext.getContentResolver(),
                            "WIFI_HOTSPOT_MAX_CLIENT_NUM", 8);
                    if (DBG) Slog.d(TAG, "clientNum: " + clientNum);
                    args = new Object[] {"set", wlanIface, wifiConfig.SSID,
                        "broadcast", Integer.toString(wifiConfig.apChannel),
                            ssid_mode, Integer.toString(wifiConfig.apChannel),
                            getSecurityType(wifiConfig),
                            new SensitiveArg(wifiConfig.preSharedKey), clientNum};
                } else {
                    args = new Object[] {"set", wlanIface, wifiConfig.SSID,
                            ssid_mode, Integer.toString(wifiConfig.apChannel),
                            getSecurityType(wifiConfig), new SensitiveArg(wifiConfig.preSharedKey)};
                }
            }
            executeOrLogWithMessage(SOFT_AP_COMMAND, args, NetdResponseCode.SoftapStatusResult,
                    SOFT_AP_COMMAND_SUCCESS, logMsg);

+5 −0
Original line number Diff line number Diff line
@@ -701,6 +701,11 @@ public class Tethering extends BaseNetworkObserver {
            } else {
                /* We now have a status bar icon for WifiTethering, so drop the notification */
                clearTetheredNotification();
                if (mContext.getResources().getBoolean(
                        com.android.internal.R.bool
                        .config_regional_hotspot_show_notification_when_turn_on)) {
                    showTetheredNotification(com.android.internal.R.drawable.stat_sys_tether_wifi);
                }
            }
        } else if (bluetoothTethered) {
            showTetheredNotification(com.android.internal.R.drawable.stat_sys_tether_bluetooth);