Skip to content

Commit

Permalink
fix: check encryption feature flag before initializing disk encrypt menu
Browse files Browse the repository at this point in the history
Add encryption feature flag check using config_utils::enableEncrypt()
before registering disk encryption menu scene to prevent unnecessary
menu initialization when encryption is disabled.

Log:

Bug: https://pms.uniontech.com/bug-view-295323.html
  • Loading branch information
Johnson-zs authored and deepin-bot[bot] committed Dec 16, 2024
1 parent e8ffea5 commit 2129f01
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include "plugin_diskencryptentry.h"
#include "menu/diskencryptmenuscene.h"
#include "events/eventshandler.h"
#include "utils/encryptutils.h"

#include <dfm-base/dfm_menu_defines.h>

Expand All @@ -28,6 +29,8 @@ void DiskEncryptEntry::initialize()

bool DiskEncryptEntry::start()
{
if (!config_utils::enableEncrypt())
return true;
dpfSlotChannel->push(kMenuPluginName, "slot_MenuScene_RegisterScene",
DiskEncryptMenuCreator::name(), new DiskEncryptMenuCreator);

Expand Down

0 comments on commit 2129f01

Please sign in to comment.