remove debugging code, resolve some TODOs
This commit is contained in:
@@ -46,9 +46,6 @@ namespace keepass2android
|
|||||||
StatusLogger.UpdateSubMessage(_app.GetResourceString(UiStringKey.DownloadingRemoteFile));
|
StatusLogger.UpdateSubMessage(_app.GetResourceString(UiStringKey.DownloadingRemoteFile));
|
||||||
string hash;
|
string hash;
|
||||||
|
|
||||||
//TODO remove
|
|
||||||
Thread.Sleep(5000);
|
|
||||||
|
|
||||||
MemoryStream remoteData;
|
MemoryStream remoteData;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@@ -68,14 +65,10 @@ namespace keepass2android
|
|||||||
//check if remote file was modified:
|
//check if remote file was modified:
|
||||||
var baseVersionHash = cachingFileStorage.GetBaseVersionHash(ioc);
|
var baseVersionHash = cachingFileStorage.GetBaseVersionHash(ioc);
|
||||||
Kp2aLog.Log("Checking for file change. baseVersionHash = " + baseVersionHash);
|
Kp2aLog.Log("Checking for file change. baseVersionHash = " + baseVersionHash);
|
||||||
if (baseVersionHash != hash ||
|
if (baseVersionHash != hash)
|
||||||
true //TODO remove
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
//remote file is modified
|
//remote file is modified
|
||||||
if (cachingFileStorage.HasLocalChanges(ioc)
|
if (cachingFileStorage.HasLocalChanges(ioc))
|
||||||
|| true //TODO remove
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
//conflict! need to merge
|
//conflict! need to merge
|
||||||
var _saveDb = new SaveDb(_app, new ActionOnOperationFinished(_app,
|
var _saveDb = new SaveDb(_app, new ActionOnOperationFinished(_app,
|
||||||
|
|||||||
@@ -143,17 +143,11 @@ namespace keepass2android
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//TODO remove
|
|
||||||
Thread.Sleep(5000);
|
|
||||||
|
|
||||||
|
|
||||||
bool hasStreamForOrigFile = (_streamForOrigFile != null);
|
bool hasStreamForOrigFile = (_streamForOrigFile != null);
|
||||||
bool hasChangeFast = hasStreamForOrigFile ||
|
bool hasChangeFast = hasStreamForOrigFile ||
|
||||||
fileStorage.CheckForFileChangeFast(ioc, _db.LastFileVersion); //first try to use the fast change detection;
|
fileStorage.CheckForFileChangeFast(ioc, _db.LastFileVersion); //first try to use the fast change detection;
|
||||||
bool hasHashChanged = !requiresSubsequentSync && (
|
bool hasHashChanged = !requiresSubsequentSync && (
|
||||||
//TODO remove
|
|
||||||
true ||
|
|
||||||
hasChangeFast ||
|
hasChangeFast ||
|
||||||
(FileHashChanged(ioc, _db.KpDatabase.HashOfFileOnDisk) ==
|
(FileHashChanged(ioc, _db.KpDatabase.HashOfFileOnDisk) ==
|
||||||
FileHashChange.Changed)); //if that fails, hash the file and compare:
|
FileHashChange.Changed)); //if that fails, hash the file and compare:
|
||||||
@@ -278,7 +272,9 @@ namespace keepass2android
|
|||||||
PerformSaveWithoutCheck(fileStorage, ioc);
|
PerformSaveWithoutCheck(fileStorage, ioc);
|
||||||
new Handler(Looper.MainLooper).Post(() =>
|
new Handler(Looper.MainLooper).Post(() =>
|
||||||
{
|
{
|
||||||
|
Kp2aLog.Log("OPR: Starting posted UpdateGlobals");
|
||||||
_db.UpdateGlobals();
|
_db.UpdateGlobals();
|
||||||
|
Kp2aLog.Log("OPR: Finished posted UpdateGlobals");
|
||||||
});
|
});
|
||||||
|
|
||||||
FinishWithSuccess();
|
FinishWithSuccess();
|
||||||
|
|||||||
@@ -726,6 +726,9 @@
|
|||||||
<string name="DbQuicklockedChannel_desc">Notification about the database being locked with QuickUnlock</string>
|
<string name="DbQuicklockedChannel_desc">Notification about the database being locked with QuickUnlock</string>
|
||||||
<string name="EntryChannel_name">Entry notifications</string>
|
<string name="EntryChannel_name">Entry notifications</string>
|
||||||
<string name="EntryChannel_desc">Notification to simplify access to the currently selected entry.</string>
|
<string name="EntryChannel_desc">Notification to simplify access to the currently selected entry.</string>
|
||||||
|
<string name="BackgroundSyncChannel_name">Synchronization operation</string>
|
||||||
|
<string name="BackgroundSyncChannel_desc">Notification to indicate that a synchronization is performed in the background.</string>
|
||||||
|
|
||||||
<string name="CloseDbAfterFailedAttempts">Close database after three failed biometric unlock attempts.</string>
|
<string name="CloseDbAfterFailedAttempts">Close database after three failed biometric unlock attempts.</string>
|
||||||
<string name="WarnFingerprintInvalidated">Warning! Biometric authentication can be invalidated by Android, e.g. after adding a new fingerprint in your device settings. Make sure you always know how to unlock with your master password!</string>
|
<string name="WarnFingerprintInvalidated">Warning! Biometric authentication can be invalidated by Android, e.g. after adding a new fingerprint in your device settings. Make sure you always know how to unlock with your master password!</string>
|
||||||
|
|
||||||
|
|||||||
@@ -100,14 +100,17 @@ namespace keepass2android.services
|
|||||||
{
|
{
|
||||||
if (Build.VERSION.SdkInt >= BuildVersionCodes.O)
|
if (Build.VERSION.SdkInt >= BuildVersionCodes.O)
|
||||||
{
|
{
|
||||||
//TODO
|
var channelName = GetString(Resource.String.BackgroundSyncChannel_name);
|
||||||
var channelName = "Foreground Service Channel";
|
var channelDescription = GetString(Resource.String.BackgroundSyncChannel_desc);
|
||||||
var channelDescription = "Channel for foreground service";
|
|
||||||
var channelImportance = NotificationImportance.Default;
|
var channelImportance = NotificationImportance.Default;
|
||||||
var channel = new NotificationChannel(ChannelId, channelName, channelImportance)
|
var channel = new NotificationChannel(ChannelId, channelName, channelImportance)
|
||||||
{
|
{
|
||||||
Description = channelDescription
|
Description = channelDescription
|
||||||
};
|
};
|
||||||
|
channel.EnableLights(false);
|
||||||
|
channel.EnableVibration(false);
|
||||||
|
channel.SetSound(null, null);
|
||||||
|
channel.SetShowBadge(false);
|
||||||
|
|
||||||
var notificationManager = (NotificationManager)GetSystemService(NotificationService);
|
var notificationManager = (NotificationManager)GetSystemService(NotificationService);
|
||||||
notificationManager.CreateNotificationChannel(channel);
|
notificationManager.CreateNotificationChannel(channel);
|
||||||
|
|||||||
Reference in New Issue
Block a user