kopia lustrzana https://github.com/ryukoposting/Signal-Android
Add internal setting to clear keep longer logs.
rodzic
6101048f07
commit
ab031d3dad
|
@ -19,6 +19,7 @@ import org.thoughtcrime.securesms.components.settings.DSLSettingsFragment
|
|||
import org.thoughtcrime.securesms.components.settings.DSLSettingsText
|
||||
import org.thoughtcrime.securesms.components.settings.configure
|
||||
import org.thoughtcrime.securesms.database.LocalMetricsDatabase
|
||||
import org.thoughtcrime.securesms.database.LogDatabase
|
||||
import org.thoughtcrime.securesms.database.SignalDatabase
|
||||
import org.thoughtcrime.securesms.dependencies.ApplicationDependencies
|
||||
import org.thoughtcrime.securesms.jobmanager.JobTracker
|
||||
|
@ -112,6 +113,13 @@ class InternalSettingsFragment : DSLSettingsFragment(R.string.preferences__inter
|
|||
}
|
||||
)
|
||||
|
||||
clickPref(
|
||||
title = DSLSettingsText.from(R.string.preferences__internal_clear_keep_longer_logs),
|
||||
onClick = {
|
||||
clearKeepLongerLogs()
|
||||
}
|
||||
)
|
||||
|
||||
dividerPref()
|
||||
|
||||
sectionHeaderPref(R.string.preferences__internal_payments)
|
||||
|
@ -590,4 +598,12 @@ class InternalSettingsFragment : DSLSettingsFragment(R.string.preferences__inter
|
|||
}
|
||||
.show()
|
||||
}
|
||||
|
||||
private fun clearKeepLongerLogs() {
|
||||
SimpleTask.run({
|
||||
LogDatabase.getInstance(requireActivity().application).clearKeepLonger()
|
||||
}) {
|
||||
Toast.makeText(requireContext(), "Cleared keep longer logs", Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,6 +8,7 @@ import net.zetetic.database.sqlcipher.SQLiteDatabase
|
|||
import net.zetetic.database.sqlcipher.SQLiteOpenHelper
|
||||
import org.signal.core.util.CursorUtil
|
||||
import org.signal.core.util.SqlUtil
|
||||
import org.signal.core.util.delete
|
||||
import org.signal.core.util.getTableRowCount
|
||||
import org.signal.core.util.logging.Log
|
||||
import org.thoughtcrime.securesms.crypto.DatabaseSecret
|
||||
|
@ -218,6 +219,12 @@ class LogDatabase private constructor(
|
|||
}
|
||||
}
|
||||
|
||||
fun clearKeepLonger() {
|
||||
writableDatabase.delete(TABLE_NAME)
|
||||
.where("$KEEP_LONGER = ?", 1)
|
||||
.run()
|
||||
}
|
||||
|
||||
private fun buildValues(log: LogEntry): ContentValues {
|
||||
return ContentValues().apply {
|
||||
put(CREATED_AT, log.createdAt)
|
||||
|
|
|
@ -2659,6 +2659,7 @@
|
|||
<string name="preferences__internal_user_details_description" translatable="false">Show a button in conversation settings that lets you see more information about a user.</string>
|
||||
<string name="preferences__internal_shake_to_report" translatable="false">Shake to Report</string>
|
||||
<string name="preferences__internal_shake_to_report_description" translatable="false">Shake your phone to easily submit and share a debug log.</string>
|
||||
<string name="preferences__internal_clear_keep_longer_logs" translatable="false">Clear keep longer logs</string>
|
||||
<string name="preferences__internal_storage_service" translatable="false">Storage service</string>
|
||||
<string name="preferences__internal_disable_storage_service" translatable="false">Disable syncing</string>
|
||||
<string name="preferences__internal_disable_storage_service_description" translatable="false">Prevent syncing any data to/from storage service.</string>
|
||||
|
|
Ładowanie…
Reference in New Issue