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

Commit cbf554b7 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "SettingsBackupAgent: notify of apBand conversion" into pi-dev

parents bd624166 d41106c5
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
@@ -3169,6 +3169,21 @@
    <!-- A notification is shown when the user connects to a Wi-Fi network and the system detects that that network has no Internet access. This is the notification's message. -->
    <string name="wifi_no_internet_detailed">Tap for options</string>

    <!-- A notification is shown when the user's softap config has been changed due to underlying
         hardware restrictions. This is the notifications's title.
         [CHAR_LIMIT=NONE] -->
    <string name="wifi_softap_config_change">Changes to your hotspot settings</string>

    <!-- A notification is shown when the user's softap config has been changed due to underlying
         hardware restrictions. This is the notification's summary message.
         [CHAR_LIMIT=NONE] -->
    <string name="wifi_softap_config_change_summary">Your hotspot band has changed.</string>

    <!-- A notification is shown when the user's softap config has been changed due to underlying
         hardware restrictions. This is the notification's full message.
         [CHAR_LIMIT=NONE] -->
    <string name="wifi_softap_config_change_detailed">This device doesn\u2019t support your preference for 5GHz only. Instead, this device will use the 5GHz band when available.</string>

    <!-- A notification might be shown if the device switches to another network type (e.g., mobile data) because it detects that the network it was using (e.g., Wi-Fi) has lost Internet connectivity. This is the notification's title. %1$s is the network type that the device switched to, e.g., cellular data. It is one of the strings in the network_switch_type_name array. -->
    <string name="network_switch_metered">Switched to <xliff:g id="network_type">%1$s</xliff:g></string>

+3 −0
Original line number Diff line number Diff line
@@ -1061,6 +1061,9 @@
  <java-symbol type="string" name="network_switch_type_name_unknown" />
  <java-symbol type="string" name="wifi_no_internet" />
  <java-symbol type="string" name="wifi_no_internet_detailed" />
  <java-symbol type="string" name="wifi_softap_config_change" />
  <java-symbol type="string" name="wifi_softap_config_change_summary" />
  <java-symbol type="string" name="wifi_softap_config_change_detailed" />
  <java-symbol type="string" name="wifi_connect_alert_title" />
  <java-symbol type="string" name="wifi_connect_alert_message" />
  <java-symbol type="string" name="wifi_connect_default_application" />
+12 −0
Original line number Diff line number Diff line
@@ -841,7 +841,19 @@ public class SettingsBackupAgent extends BackupAgentHelper {
            WifiConfiguration config = WifiConfiguration
                    .getWifiConfigFromBackup(new DataInputStream(new ByteArrayInputStream(data)));
            if (DEBUG) Log.d(TAG, "Successfully unMarshaled WifiConfiguration ");
            int originalApBand = config.apBand;
            mWifiManager.setWifiApConfiguration(config);

            // Depending on device hardware, we may need to notify the user of a setting change for
            // the apBand preference
            boolean dualMode = mWifiManager.isDualModeSupported();
            int storedApBand = mWifiManager.getWifiApConfiguration().apBand;
            if (dualMode) {
                if (storedApBand != originalApBand) {
                    Log.d(TAG, "restored ap configuration requires a conversion, notify the user");
                    mWifiManager.notifyUserOfApBandConversion();
                }
            }
        } catch (IOException | BackupUtils.BadVersionException e) {
            Log.e(TAG, "Failed to unMarshal SoftAPConfiguration " + e.getMessage());
        }
+4 −0
Original line number Diff line number Diff line
@@ -212,6 +212,10 @@ message SystemMessage {
    // Package: android
    NOTE_AUTO_SAVER_SUGGESTION = 49;

    // Notify the user that their softap config preference has changed.
    // Package: android
    NOTE_SOFTAP_CONFIG_CHANGED = 50;

    // ADD_NEW_IDS_ABOVE_THIS_LINE
    // Legacy IDs with arbitrary values appear below
    // Legacy IDs existed as stable non-conflicting constants prior to the O release
+2 −0
Original line number Diff line number Diff line
@@ -147,6 +147,8 @@ interface IWifiManager

    boolean setWifiApConfiguration(in WifiConfiguration wifiConfig, String packageName);

    void notifyUserOfApBandConversion(String packageName);

    Messenger getWifiServiceMessenger(String packageName);

    void enableTdls(String remoteIPAddress, boolean enable);
Loading