Object ProcessUtils

  • All Implemented Interfaces:

    
    public class ProcessUtils
    
                        

    Identifies whether the SDK is running in the host app's main process.

    Host apps can run components in extra processes (android:process=":name"), and Android calls Application.onCreate() in each of them. Publishers that start their ad stack there end up initialising the SDK in more than one process.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      final Boolean isMainProcess(Context context) Returns true in the app's main process, false in a secondary process, or null when it cannot be determined (below API 28, where Application.getProcessName() is unavailable).
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • Method Detail

      • isMainProcess

         final Boolean isMainProcess(Context context)

        Returns true in the app's main process, false in a secondary process, or null when it cannot be determined (below API 28, where Application.getProcessName() is unavailable).

        The main process name is applicationInfo.processName, which also covers apps that rename it via <application android:process>.