library/src/main/java/com/evernote/android/job/JobManager.java
/**
     * Initializes the singleton. It's necessary to call this function before using the {@code JobManager}.
     * Calling it multiple times has not effect.
     *
     * @param context Any {@link Context} to instantiate the singleton object.
     * @return The new or existing singleton object.
     * @throws JobManagerCreateException When the singleton couldn't be created.
     */
Initializes the singleton. It's necessary to call this function before using the  JobManager.
Calling it multiple times has not effect.

@param context Any  Context to instantiate the singleton object.
@return The new or existing singleton object.
@throws JobManagerCreateException When the singleton couldn't be created.
Initializes the singleton . It ' s necessary to call this function before using the JobManager . Calling it multiple times has not effect . @param context Any Context to instantiate the singleton object . @return The new or existing singleton object . @throws JobManagerCreateException When the singleton couldn ' t be created .
public static JobManager create(@NonNull Context context) throws JobManagerCreateException {
        if (instance == null) {
            synchronized (JobManager.class) {
                if (instance == null) {
                    JobPreconditions.checkNotNull(context, "Context cannot be null");
                    if (context.getApplicationContext() != null) {
                        context = context.getApplicationContext();
                    }
                    JobApi api = JobApi.getDefault(context);
                    if (api == JobApi.V_14 && !api.isSupported(context)) {
                        throw new JobManagerCreateException("All APIs are disabled, cannot schedule any job");
                    }
                    instance = new JobManager(context);
                    if (!JobUtil.hasWakeLockPermission(context)) {
                        CAT.w("No wake lock permission");
                    }
                    if (!JobUtil.hasBootPermission(context)) {
                        CAT.w("No boot permission");
                    }
                    sendAddJobCreatorIntent(context);
                }
            }
        }
        return instance;
    }
public static JobManager create ( @ NonNull Context context ) throws JobManagerCreateException { if ( instance == null ) { synchronized ( JobManager . class ) { if ( instance == null ) { JobPreconditions . checkNotNull ( context , "Context cannot be null" ) ; if ( context . getApplicationContext ( ) != null ) { context = context . getApplicationContext ( ) ; } JobApi api = JobApi . getDefault ( context ) ; if ( api == JobApi . V_14 && ! api . isSupported ( context ) ) { throw new JobManagerCreateException ( "All APIs are disabled, cannot schedule any job" ) ; } instance = new JobManager ( context ) ; if ( ! JobUtil . hasWakeLockPermission ( context ) ) { CAT . w ( "No wake lock permission" ) ; } if ( ! JobUtil . hasBootPermission ( context ) ) { CAT . w ( "No boot permission" ) ; } sendAddJobCreatorIntent ( context ) ; } } } return instance ; }
Initializes the singleton.
Initializes the singleton .
// could be null in unit tests