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

Commit 3d7e855d authored by Suchi Amalapurapu's avatar Suchi Amalapurapu
Browse files

Check if rename of current settings file was successful before persisting

new changes to settings.
parent 78059337
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -6376,7 +6376,10 @@ class PackageManagerService extends IPackageManager.Stub {
                if (mBackupSettingsFilename.exists()) {
                    mBackupSettingsFilename.delete();
                }
                mSettingsFilename.renameTo(mBackupSettingsFilename);
                if (!mSettingsFilename.renameTo(mBackupSettingsFilename)) {
                    Log.w(TAG, "Unable to backup package manager settings, current changes will be lost at reboot");
                    return;
                }
            }

            mPastSignatures.clear();