Skip to content

Commit

Permalink
Add autofill-survey to password management page
Browse files Browse the repository at this point in the history
  • Loading branch information
CDRussell committed Apr 26, 2024
1 parent 5065e13 commit f934c9f
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,6 @@ import kotlinx.coroutines.withContext

private val formatter = SimpleDateFormat("yyyy-MM-dd", Locale.US)

interface AppDaysUsedRepository {
suspend fun getNumberOfDaysAppUsed(): Long
suspend fun recordAppUsedToday()
suspend fun getNumberOfDaysAppUsedSinceDate(date: Date): Long
suspend fun getLastActiveDay(): String
suspend fun getPreviousActiveDay(): String?
}

class AppDaysUsedDatabaseRepository(private val appDaysUsedDao: AppDaysUsedDao) : AppDaysUsedRepository {

private val singleThreadedDispatcher = Executors.newSingleThreadExecutor().asCoroutineDispatcher()
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
/*
* Copyright (c) 2024 DuckDuckGo
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.duckduckgo.app.usage.app

import java.util.*

/**
* Repository for storing and retrieving the number of days the app has been used
*/
interface AppDaysUsedRepository {

/**
* Get the number of days the app has been used
*/
suspend fun getNumberOfDaysAppUsed(): Long

/**
* Record that the app has been used today
*/
suspend fun recordAppUsedToday()

/**
* Get the number of days the app has been used since a given date
*/
suspend fun getNumberOfDaysAppUsedSinceDate(date: Date): Long

/**
* Get the last day the app was used
*/
suspend fun getLastActiveDay(): String

/**
* Get the previous active day
*/
suspend fun getPreviousActiveDay(): String?
}

0 comments on commit f934c9f

Please sign in to comment.