WifiMigration: Add a method for removing config store

Adding a new method to trigger OEM config store removal after migration
is complete.

Bug: 149418926
Test: Compiles
Change-Id: Ie22ff99931cc5f2ccbc47a55a2ac6e3b2baa41d7
This commit is contained in:
Roshan Pius
2020-02-24 13:14:02 -08:00
parent 807b34a2c6
commit 4c7baf7ba2
2 changed files with 25 additions and 8 deletions

View File

@@ -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 {

View File

@@ -161,16 +161,16 @@ public final class WifiMigration {
* Load data from OEM's config store.
* <p>
* Note:
* <li> 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).
* <li>OEMs need to implement {@link #loadFromConfigStore()} ()} only if their
* existing config store format or file locations differs from the vanilla AOSP implementation.
* </li>
* <li> The wifi mainline module will invoke {@link #loadFromConfigStore()} method on every
* <li>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.
* <li>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.
* </li>
*
* @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.
* <p>
* Note:
* <li>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).
* </li>
* <li> The wifi mainline module will invoke {@link #removeConfigStore()} after it migrates
* all the existing data retrieved from {@link #loadFromConfigStore()}.
* </li>
*/
public static void removeConfigStore() {
// Note: OEMs should remove their custom config store files here!
}
/**
* Container for all the wifi settings data to migrate.
*/