diff --git a/api/system-current.txt b/api/system-current.txt index 050a7525cde3b..c873e7763f1d7 100755 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -7557,6 +7557,7 @@ package android.net.wifi { public final class WifiMigration { method @Nullable public static android.net.wifi.WifiMigration.ConfigStoreMigrationData loadFromConfigStore(); method @NonNull public static android.net.wifi.WifiMigration.SettingsMigrationData loadFromSettings(@NonNull android.content.Context); + method public static void removeConfigStore(); } public static final class WifiMigration.ConfigStoreMigrationData implements android.os.Parcelable { diff --git a/wifi/java/android/net/wifi/WifiMigration.java b/wifi/java/android/net/wifi/WifiMigration.java index 695f00f643adb..a3482d732a1ba 100755 --- a/wifi/java/android/net/wifi/WifiMigration.java +++ b/wifi/java/android/net/wifi/WifiMigration.java @@ -161,16 +161,16 @@ public final class WifiMigration { * Load data from OEM's config store. *

* Note: - *

  • OEM's need to implement {@link #loadFromConfigStore()} ()} only if their - * existing config store format or file locations differs from the vanilla AOSP implementation ( - * which is what the wifi mainline module understands). + *
  • OEMs need to implement {@link #loadFromConfigStore()} ()} only if their + * existing config store format or file locations differs from the vanilla AOSP implementation. *
  • - *
  • The wifi mainline module will invoke {@link #loadFromConfigStore()} method on every + *
  • The wifi mainline module will invoke {@link #loadFromConfigStore()} method on every * bootup, its the responsibility of the OEM implementation to ensure that this method returns * non-null data only on the first bootup. Once the migration is done, the OEM can safely delete - * their config store files and then return null on any subsequent reboots. The first & only - * relevant invocation of {@link #loadFromConfigStore()} occurs when a previously released - * device upgrades to the wifi mainline module from an OEM implementation of the wifi stack. + * their config store files when {@link #removeConfigStore()} is invoked. + *
  • The first & only relevant invocation of {@link #loadFromConfigStore()} occurs when a + * previously released device upgrades to the wifi mainline module from an OEM implementation + * of the wifi stack. *
  • * * @return Instance of {@link ConfigStoreMigrationData} for migrating data, null if no @@ -178,10 +178,26 @@ public final class WifiMigration { */ @Nullable public static ConfigStoreMigrationData loadFromConfigStore() { - // Note: OEM's should add code to parse data from their config store format here! + // Note: OEMs should add code to parse data from their config store format here! return null; } + /** + * Remove OEM's config store. + *

    + * Note: + *

  • OEMs need to implement {@link #removeConfigStore()} only if their + * existing config store format or file locations differs from the vanilla AOSP implementation ( + * which is what the wifi mainline module understands). + *
  • + *
  • The wifi mainline module will invoke {@link #removeConfigStore()} after it migrates + * all the existing data retrieved from {@link #loadFromConfigStore()}. + *
  • + */ + public static void removeConfigStore() { + // Note: OEMs should remove their custom config store files here! + } + /** * Container for all the wifi settings data to migrate. */