Loading packages/SettingsProvider/Android.bp +1 −1 Original line number Diff line number Diff line Loading @@ -30,7 +30,7 @@ android_test { "src/com/android/providers/settings/SettingsBackupAgent.java", "src/com/android/providers/settings/SettingsState.java", "src/com/android/providers/settings/SettingsHelper.java", "src/com/android/providers/settings/WifiSoftApBandChangedNotifier.java", "src/com/android/providers/settings/WifiSoftApConfigChangedNotifier.java", ], static_libs: [ "androidx.test.rules", Loading packages/SettingsProvider/src/com/android/providers/settings/SettingsBackupAgent.java +6 −10 Original line number Diff line number Diff line Loading @@ -968,18 +968,14 @@ public class SettingsBackupAgent extends BackupAgentHelper { } private void restoreSoftApConfiguration(byte[] data) { SoftApConfiguration config = mWifiManager.restoreSoftApBackupData(data); if (config != null) { int originalApBand = config.getBand(); SoftApConfiguration configInCloud = mWifiManager.restoreSoftApBackupData(data); if (configInCloud != null) { if (DEBUG) Log.d(TAG, "Successfully unMarshaled SoftApConfiguration "); // 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.getSoftApConfiguration().getBand(); if (dualMode && storedApBand != originalApBand) { // Depending on device hardware, we may need to notify the user of a setting change SoftApConfiguration storedConfig = mWifiManager.getSoftApConfiguration(); if (!storedConfig.equals(configInCloud)) { Log.d(TAG, "restored ap configuration requires a conversion, notify the user"); WifiSoftApBandChangedNotifier.notifyUserOfApBandConversion(this); WifiSoftApConfigChangedNotifier.notifyUserOfConfigConversion(this); } } } Loading packages/SettingsProvider/src/com/android/providers/settings/WifiSoftApBandChangedNotifier.java→packages/SettingsProvider/src/com/android/providers/settings/WifiSoftApConfigChangedNotifier.java +5 −5 Original line number Diff line number Diff line Loading @@ -27,17 +27,17 @@ import com.android.internal.messages.nano.SystemMessageProto; import com.android.internal.notification.SystemNotificationChannels; /** * Helper class for sending notifications when the user's Soft AP Band was changed upon restore. * Helper class for sending notifications when the user's Soft AP config was changed upon restore. */ public class WifiSoftApBandChangedNotifier { private WifiSoftApBandChangedNotifier() {} public class WifiSoftApConfigChangedNotifier { private WifiSoftApConfigChangedNotifier() {} /** * Send a notification informing the user that their' Soft AP Band was changed upon restore. * Send a notification informing the user that their' Soft AP Config was changed upon restore. * When the user taps on the notification, they are taken to the Wifi Tethering page in * Settings. */ public static void notifyUserOfApBandConversion(Context context) { public static void notifyUserOfConfigConversion(Context context) { NotificationManager notificationManager = context.getSystemService(NotificationManager.class); Loading Loading
packages/SettingsProvider/Android.bp +1 −1 Original line number Diff line number Diff line Loading @@ -30,7 +30,7 @@ android_test { "src/com/android/providers/settings/SettingsBackupAgent.java", "src/com/android/providers/settings/SettingsState.java", "src/com/android/providers/settings/SettingsHelper.java", "src/com/android/providers/settings/WifiSoftApBandChangedNotifier.java", "src/com/android/providers/settings/WifiSoftApConfigChangedNotifier.java", ], static_libs: [ "androidx.test.rules", Loading
packages/SettingsProvider/src/com/android/providers/settings/SettingsBackupAgent.java +6 −10 Original line number Diff line number Diff line Loading @@ -968,18 +968,14 @@ public class SettingsBackupAgent extends BackupAgentHelper { } private void restoreSoftApConfiguration(byte[] data) { SoftApConfiguration config = mWifiManager.restoreSoftApBackupData(data); if (config != null) { int originalApBand = config.getBand(); SoftApConfiguration configInCloud = mWifiManager.restoreSoftApBackupData(data); if (configInCloud != null) { if (DEBUG) Log.d(TAG, "Successfully unMarshaled SoftApConfiguration "); // 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.getSoftApConfiguration().getBand(); if (dualMode && storedApBand != originalApBand) { // Depending on device hardware, we may need to notify the user of a setting change SoftApConfiguration storedConfig = mWifiManager.getSoftApConfiguration(); if (!storedConfig.equals(configInCloud)) { Log.d(TAG, "restored ap configuration requires a conversion, notify the user"); WifiSoftApBandChangedNotifier.notifyUserOfApBandConversion(this); WifiSoftApConfigChangedNotifier.notifyUserOfConfigConversion(this); } } } Loading
packages/SettingsProvider/src/com/android/providers/settings/WifiSoftApBandChangedNotifier.java→packages/SettingsProvider/src/com/android/providers/settings/WifiSoftApConfigChangedNotifier.java +5 −5 Original line number Diff line number Diff line Loading @@ -27,17 +27,17 @@ import com.android.internal.messages.nano.SystemMessageProto; import com.android.internal.notification.SystemNotificationChannels; /** * Helper class for sending notifications when the user's Soft AP Band was changed upon restore. * Helper class for sending notifications when the user's Soft AP config was changed upon restore. */ public class WifiSoftApBandChangedNotifier { private WifiSoftApBandChangedNotifier() {} public class WifiSoftApConfigChangedNotifier { private WifiSoftApConfigChangedNotifier() {} /** * Send a notification informing the user that their' Soft AP Band was changed upon restore. * Send a notification informing the user that their' Soft AP Config was changed upon restore. * When the user taps on the notification, they are taken to the Wifi Tethering page in * Settings. */ public static void notifyUserOfApBandConversion(Context context) { public static void notifyUserOfConfigConversion(Context context) { NotificationManager notificationManager = context.getSystemService(NotificationManager.class); Loading