Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 74bfc010 authored by Nishith  Khanna's avatar Nishith Khanna
Browse files

fix password getting deleted when using browser's password manager

parent 2857e5a9
Loading
Loading
Loading
Loading
Loading
+55 −0
Original line number Diff line number Diff line
From 40b628d878533c97427cc70e65f5eb43aa77fad1 Mon Sep 17 00:00:00 2001
From: Ioana Pandele <ioanap@chromium.org>
Date: Thu, 9 Jan 2025 02:29:04 -0800
Subject: Check USE_LOGIN_DATABASE_AS_BACKEND before removing the db

Bug: 388451842
Change-Id: Ic2f8e4f7d35b1c849480aae0a9327d8e08994d6b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6157381
Reviewed-by: Vasilii Sukhanov <vasilii@chromium.org>
Commit-Queue: Ioana Pandele <ioanap@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1404059}
---
 .../android/password_manager_android_util.cc                | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/chrome/browser/password_manager/android/password_manager_android_util.cc b/chrome/browser/password_manager/android/password_manager_android_util.cc
index 1ef8939bfc79a..e590a13bd38fb 100644
--- a/chrome/browser/password_manager/android/password_manager_android_util.cc
+++ b/chrome/browser/password_manager/android/password_manager_android_util.cc
@@ -247,6 +247,7 @@ void MaybeActivateSplitStoresAndLocalUpm(
   }
 }
 
+#if !BUILDFLAG(USE_LOGIN_DATABASE_AS_BACKEND)
 // Called on startup from `MaybeDeactivateSplitStoresAndLocalUpm` to delete the
 // login data files for users migrated to UPM. Must only be called if the value
 // of the state pref `PasswordsUseUPMLocalAndSeparateStores` is `On` and there
@@ -286,6 +287,7 @@ void MaybeDeleteLoginDataFiles(PrefService* prefs,
   }
   base::DeleteFile(account_db_journal_path);
 }
+#endif  // !BUILDFLAG(USE_LOGIN_DATABASE_AS_BACKEND)
 
 // Must only be called if the state pref is kOn or kOffAndMigrationPending, to
 // set it to kOff if the user downgraded GmsCore. Any passwords saved to GmsCore
@@ -318,13 +320,15 @@ void MaybeDeactivateSplitStoresAndLocalUpm(
                         HasMinGmsVersion() ? ActivationError::kNone
                                            : ActivationError::kOutdatedGmsCore);
   if (HasMinGmsVersion()) {
-    // GmsCore was not downgraded, no need to deactivate.
+#if !BUILDFLAG(USE_LOGIN_DATABASE_AS_BACKEND)
     if (GetSplitStoresAndLocalUpmPrefValue(pref_service) == kOn &&
         base::FeatureList::IsEnabled(
             password_manager::features::
                 kClearLoginDatabaseForAllMigratedUPMUsers)) {
       MaybeDeleteLoginDataFiles(pref_service, login_db_directory);
     }
+#endif  // !BUILDFLAG(USE_LOGIN_DATABASE_AS_BACKEND)
+    // GmsCore was not downgraded, no need to deactivate.
     return;
   }
 
-- 
2.48.1
+1 −0
Original line number Diff line number Diff line
@@ -59,3 +59,4 @@ ungoogledchromium-Disable-Gaia.patch
Disable-support-for-RAR-files-inspection.patch
Browser-Fix-open-in-browser-text.patch
Browser-Enable-external-intent-requests.patch
Check-USELOGINDATABASEASBACKEND-before-removing-the-db.patch