urbanairship-core/src/main/java/com/urbanairship/job/JobInfo.java
@WorkerThread
        public Builder generateUniqueId(Context context) {
            synchronized (preferenceLock) {
                if (sharedPreferences == null) {
                    sharedPreferences = context.getSharedPreferences(SHARED_PREFERENCES_FILE, Context.MODE_PRIVATE);
                }

                int id = sharedPreferences.getInt(NEXT_GENERATED_ID_KEY, 0);

                sharedPreferences.edit()
                                 .putInt(NEXT_GENERATED_ID_KEY, (id + 1) % GENERATED_RANGE)
                                 .apply();

                this.jobId = id + GENERATED_ID_OFFSET;
            }
            return this;
        }
/**
         * Generates a unique ID for the job.
         *
         * @param context The application context.
         * @return The job builder.
         */
Generates a unique ID for the job.
@param context The application context.
@return The job builder.
Generates a unique ID for the job . @param context The application context . @return The job builder .
@WorkerThread
        public Builder generateUniqueId(Context context) {
            synchronized (preferenceLock) {
                if (sharedPreferences == null) {
                    sharedPreferences = context.getSharedPreferences(SHARED_PREFERENCES_FILE, Context.MODE_PRIVATE);
                }
                int id = sharedPreferences.getInt(NEXT_GENERATED_ID_KEY, 0);
                sharedPreferences.edit()
                                 .putInt(NEXT_GENERATED_ID_KEY, (id + 1) % GENERATED_RANGE)
                                 .apply();
                this.jobId = id + GENERATED_ID_OFFSET;
            }
            return this;
        }
@ WorkerThread public Builder generateUniqueId ( Context context ) { synchronized ( preferenceLock ) { if ( sharedPreferences == null ) { sharedPreferences = context . getSharedPreferences ( SHARED_PREFERENCES_FILE , Context . MODE_PRIVATE ) ; } int id = sharedPreferences . getInt ( NEXT_GENERATED_ID_KEY , 0 ) ; sharedPreferences . edit ( ) . putInt ( NEXT_GENERATED_ID_KEY , ( id + 1 ) % GENERATED_RANGE ) . apply ( ) ; this . jobId = id + GENERATED_ID_OFFSET ; } return this ; }
Generates a unique ID for the job.
Generates a unique ID for the job .