Interface XposedModuleInterface.HotReloadingParam

Enclosing interface:
XposedModuleInterface

@SinceApi(102) public static interface XposedModuleInterface.HotReloadingParam
Wraps information about the hot reloading event.
  • Method Summary

    Modifier and Type
    Method
    Description
    Gets the data passed from the module app when triggering hot reload through the service.
    void
    Sets the data to be passed to the new code after hot reloading.
  • Method Details

    • getExtras

      @Nullable Bundle getExtras()
      Gets the data passed from the module app when triggering hot reload through the service. This can be null if the app passes null or the hot reload is triggered by app updating. The bundle should contain only values that can be unmarshalled without the module's class loader, such as primitive values, strings, arrays, and framework Bundle instances.
    • setSavedInstanceState

      void setSavedInstanceState(@Nullable Object outState)
      Sets the data to be passed to the new code after hot reloading. This can be retrieved in XposedModuleInterface.onHotReloaded(HotReloadedParam). The saved state must not contain objects created under the old module classloader because retaining them in the new generation can keep the old generation strongly reachable after hot reload. Use classloader-neutral values to transfer state.

      Implementations should reject old-module-classloader objects when they are detected. This check is a diagnostic aid, not a complete object graph verifier; passing an undetected old-module object is still a module lifecycle bug.

      Parameters:
      outState - The data to be passed to the new code after hot reloading
      Throws:
      IllegalArgumentException - if outState contains an object detected as being created under the old module classloader