--[[----------------------------------------------------------------------------

ADOBE CONFIDENTIAL
------------------
Copyright 2014 Adobe Systems Incorporated
All Rights Reserved.

NOTICE: All information contained herein is, and remain the property of
Adobe Systems Incorporated and its suppliers, if any. The intellectual and
technical concepts contained herein are proprietary to Adobe Systems
Incorporated and its suppliers and may be covered by U.S. and Foreign
Patents, patents in process, and are protected by trade secret or copyright
law.  Dissemination of this information or reproduction of this material is
strictly forbidden unless prior written permission is obtained from
Adobe Systems Incorporated.

----------------------------------------------------------------------------]]--

--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
-- IMPORTANT!! [pkamin 2014-12-18]: LrmWFCapabilities must be the first require()
-- as we set the Capability filters in there which need to be respected by the
-- rest of the WF when it starts up
--------------------------------------------------------------------------------

local LrmWFCapabilities = require 'LrmWFCapabilities'
local WFConfiguration = require "WFConfiguration"
local WFPlatformInfo = require "WFPlatformInfo"

local runUntilDone = require 'WFRxRunUntilDone'

LrmWFCapabilities.installFilters()

--------------------------------------------------------------------------------

local LrmApp = {}

--==============================================================================

LrmApp.initMessageProcessor = function( ... )
	
	local pollingInterval = WFConfiguration.Stamina.EMPPollingInterval
	
	if pollingInterval then
	
		require 'WFPerformanceReport'.sendPerfData( pollingInterval )
			:call ( runUntilDone )
			
	end
		
	local LrmOzSetup = require 'LrmOzSetup'
	
	LrmOzSetup.setupCredentials()

	if WFPlatformInfo.isiOS then
		local LriCatUserModel = require "LriCatUserModel"
		LriCatUserModel.migrateUserDocStoreToNewLocation()
	end
	
end

--==============================================================================

return LrmApp
