package com.sentinelshield.mobile.deviceowner

import android.content.Context

internal object DeviceOwnerSecurityEvents {
    private const val PREFERENCES = "device_owner_security_events"
    private const val LAST_EVENT = "last_event"
    private const val LAST_EVENT_AT = "last_event_at"

    fun record(context: Context, event: String) {
        context.getSharedPreferences(PREFERENCES, Context.MODE_PRIVATE)
            .edit()
            .putString(LAST_EVENT, event)
            .putLong(LAST_EVENT_AT, System.currentTimeMillis())
            .apply()
    }
}
