Home
last modified time | relevance | path

Searched refs:prefs (Results 1 – 25 of 48) sorted by relevance

12

/system/update_engine/cros/
Dexcluder_chromeos.cc40 auto* prefs = SystemState::Get()->prefs(); in Exclude() local
41 auto key = prefs->CreateSubKey({kExclusionPrefsSubDir, name}); in Exclude()
42 return prefs->SetString(key, ""); in Exclude()
46 auto* prefs = SystemState::Get()->prefs(); in IsExcluded() local
47 auto key = prefs->CreateSubKey({kExclusionPrefsSubDir, name}); in IsExcluded()
48 return prefs->Exists(key); in IsExcluded()
52 auto* prefs = SystemState::Get()->prefs(); in Reset() local
55 if (!prefs->GetSubKeys(kExclusionPrefsSubDir, &keys)) in Reset()
58 if (!(ret &= prefs->Delete(key))) in Reset()
Dpayload_state_unittest.cc118 auto* prefs = FakeSystemState::Get()->mock_prefs(); in TEST_F() local
119 EXPECT_CALL(*prefs, SetInt64(_, _)).Times(AnyNumber()); in TEST_F()
120 EXPECT_CALL(*prefs, SetInt64(kPrefsPayloadAttemptNumber, 0)) in TEST_F()
122 EXPECT_CALL(*prefs, SetInt64(kPrefsFullPayloadAttemptNumber, 0)) in TEST_F()
124 EXPECT_CALL(*prefs, SetInt64(kPrefsBackoffExpiryTime, 0)).Times(AtLeast(1)); in TEST_F()
125 EXPECT_CALL(*prefs, SetInt64(kPrefsCurrentUrlIndex, 0)).Times(AtLeast(1)); in TEST_F()
126 EXPECT_CALL(*prefs, SetInt64(kPrefsCurrentUrlFailureCount, 0)) in TEST_F()
128 EXPECT_CALL(*prefs, SetInt64(kPrefsUpdateTimestampStart, _)) in TEST_F()
130 EXPECT_CALL(*prefs, SetInt64(kPrefsUpdateDurationUptime, _)) in TEST_F()
132 EXPECT_CALL(*prefs, SetInt64(kCurrentBytesDownloadedFromHttps, 0)) in TEST_F()
[all …]
Dcommon_service.cc224 if (!SystemState::Get()->prefs()->SetString(kPrefsOmahaCohortHint, in SetCohortHint()
238 const auto* prefs = SystemState::Get()->prefs(); in GetCohortHint() local
240 if (prefs->Exists(kPrefsOmahaCohortHint) && in GetCohortHint()
241 !prefs->GetString(kPrefsOmahaCohortHint, out_cohort_hint)) { in GetCohortHint()
250 if (!SystemState::Get()->prefs()->SetBoolean(kPrefsP2PEnabled, in_enabled)) { in SetP2PUpdatePermission()
263 const auto* prefs = SystemState::Get()->prefs(); in GetP2PUpdatePermission() local
265 if (prefs->Exists(kPrefsP2PEnabled) && in GetP2PUpdatePermission()
266 !prefs->GetBoolean(kPrefsP2PEnabled, &p2p_pref)) { in GetP2PUpdatePermission()
291 if (!SystemState::Get()->prefs()->SetBoolean( in SetUpdateOverCellularPermission()
321 auto* prefs = SystemState::Get()->prefs(); in SetUpdateOverCellularTarget() local
[all …]
Domaha_request_builder_xml.cc174 auto* prefs = SystemState::Get()->prefs(); in GetAppBody() local
176 if (!prefs->GetString(kPrefsPreviousVersion, &prev_version)) { in GetAppBody()
189 LOG_IF(WARNING, !prefs->SetString(kPrefsPreviousVersion, "")) in GetAppBody()
231 const auto* prefs = SystemState::Get()->prefs(); in GetCohortArg() local
232 if (!prefs->Exists(prefs_key)) in GetCohortArg()
234 if (!prefs->GetString(prefs_key, &cohort_value) || cohort_value.empty()) in GetCohortArg()
313 const auto* prefs = SystemState::Get()->prefs(); in GetApp() local
315 prefs->CreateSubKey({kDlcPrefsSubDir, dlc_id, kPrefsOmahaCohort}); in GetApp()
317 prefs->CreateSubKey({kDlcPrefsSubDir, dlc_id, kPrefsOmahaCohortName}); in GetApp()
319 prefs->CreateSubKey({kDlcPrefsSubDir, dlc_id, kPrefsOmahaCohortHint}); in GetApp()
Domaha_request_action.cc360 if (SystemState::Get()->prefs()->GetInt64(key, &last_ping) && in CalculatePingDays()
410 auto* prefs = SystemState::Get()->prefs(); in GetInstallDate() local
413 if (prefs->GetInt64(kPrefsInstallDateDays, &stored_value)) { in GetInstallDate()
420 prefs->Delete(kPrefsInstallDateDays); in GetInstallDate()
483 auto* prefs = SystemState::Get()->prefs(); in StorePingReply() local
486 prefs->CreateSubKey({kDlcPrefsSubDir, dlc_id, kPrefsPingActive}); in StorePingReply()
487 if (!prefs->SetInt64(active_key, kPingInactiveValue)) in StorePingReply()
492 prefs->CreateSubKey({kDlcPrefsSubDir, dlc_id, kPrefsPingLastRollcall}); in StorePingReply()
493 if (!prefs->SetString(last_rollcall_key, parser_data.daystart.elapsed_days)) in StorePingReply()
501 prefs->CreateSubKey({kDlcPrefsSubDir, dlc_id, kPrefsPingLastActive}); in StorePingReply()
[all …]
Dreal_system_state.cc90 Prefs* prefs; in Initialize() local
91 prefs_.reset(prefs = new Prefs()); in Initialize()
92 if (!prefs->Init(non_volatile_path.Append(kPrefsSubDirectory))) { in Initialize()
104 powerwash_safe_prefs_.reset(prefs = new Prefs()); in Initialize()
105 if (!prefs->Init( in Initialize()
Domaha_request_action_unittest.cc1691 NiceMock<MockPrefs> prefs; in TEST_F() local
1692 FakeSystemState::Get()->set_prefs(&prefs); in TEST_F()
1698 EXPECT_CALL(prefs, GetString(kPrefsPreviousVersion, _)) in TEST_F()
1702 EXPECT_CALL(prefs, SetString(kPrefsPreviousVersion, _)).Times(0); in TEST_F()
1920 NiceMock<MockPrefs> prefs; in PingTest() local
1921 FakeSystemState::Get()->set_prefs(&prefs); in PingTest()
1922 EXPECT_CALL(prefs, GetInt64(kPrefsMetricsCheckLastReportingTime, _)) in PingTest()
1924 EXPECT_CALL(prefs, SetInt64(_, _)).Times(AnyNumber()); in PingTest()
1930 EXPECT_CALL(prefs, GetInt64(kPrefsInstallDateDays, _)) in PingTest()
1932 EXPECT_CALL(prefs, GetInt64(kPrefsLastActivePingDay, _)) in PingTest()
[all …]
Dfake_system_state.h86 inline PrefsInterface* prefs() override { return prefs_; } in prefs() function
145 inline void set_prefs(PrefsInterface* prefs) { in set_prefs() argument
146 prefs_ = prefs ? prefs : &mock_prefs_; in set_prefs()
Ddownload_action_chromeos_unittest.cc159 MockPrefs prefs; in TestWithData() local
164 &prefs, in TestWithData()
273 MockPrefs prefs; in TEST() local
278 &prefs, in TEST()
365 MockPrefs prefs; in TestTerminateEarly() local
367 &prefs, in TestTerminateEarly()
476 MockPrefs prefs; in TEST() local
478 std::make_unique<DownloadAction>(&prefs, in TEST()
557 MockPrefs prefs; in StartDownload() local
560 &prefs, in StartDownload()
Domaha_response_handler_action.cc117 SystemState::Get()->prefs(), update_check_response_hash); in PerformAction()
123 !DeltaPerformer::ResetUpdateProgress(SystemState::Get()->prefs(), in PerformAction()
127 !SystemState::Get()->prefs()->SetString( in PerformAction()
148 SystemState::Get()->prefs()->SetString(current_channel_key, in PerformAction()
Dupdate_attempter_unittest.cc2293 EXPECT_FALSE(FakeSystemState::Get()->prefs()->Exists(last_active_key)); in TEST_F()
2296 EXPECT_FALSE(FakeSystemState::Get()->prefs()->Exists(last_rollcall_key)); in TEST_F()
2322 MemoryPrefs prefs; in TEST_F() local
2323 FakeSystemState::Get()->set_prefs(&prefs); in TEST_F()
2335 FakeSystemState::Get()->prefs()->SetString(active_key, "z2yz"); in TEST_F()
2336 FakeSystemState::Get()->prefs()->SetString(last_active_key, "z2yz"); in TEST_F()
2337 FakeSystemState::Get()->prefs()->SetString(last_rollcall_key, "z2yz"); in TEST_F()
2367 FakeSystemState::Get()->prefs()->SetInt64(active_key, 1); in TEST_F()
2368 FakeSystemState::Get()->prefs()->SetInt64(last_active_key, 78); in TEST_F()
2369 FakeSystemState::Get()->prefs()->SetInt64(last_rollcall_key, 99); in TEST_F()
[all …]
/system/update_engine/
Dmetrics_utils.h53 int64_t GetPersistedValue(const std::string& key, PrefsInterface* prefs);
56 void SetNumReboots(int64_t num_reboots, PrefsInterface* prefs);
60 PrefsInterface* prefs);
63 void SetSystemUpdatedMarker(ClockInterface* clock, PrefsInterface* prefs);
68 PrefsInterface* prefs);
73 PrefsInterface* prefs);
81 PrefsInterface* prefs,
Ddownload_action_android_unittest.cc62 MockPrefs prefs; in TEST_F() local
63 EXPECT_CALL(prefs, GetInt64(kPrefsUpdateStatePayloadIndex, _)) in TEST_F()
65 EXPECT_CALL(prefs, GetInt64(kPrefsManifestMetadataSize, _)) in TEST_F()
67 EXPECT_CALL(prefs, GetInt64(kPrefsManifestSignatureSize, _)) in TEST_F()
69 EXPECT_CALL(prefs, GetInt64(kPrefsUpdateStateNextDataOffset, _)) in TEST_F()
71 EXPECT_CALL(prefs, GetString(kPrefsManifestBytes, _)) in TEST_F()
88 &prefs, &boot_control, nullptr, http_fetcher, false /* interactive */); in TEST_F()
126 MockPrefs prefs; in TEST_F() local
127 EXPECT_CALL(prefs, GetInt64(kPrefsUpdateStatePayloadIndex, _)) in TEST_F()
129 EXPECT_CALL(prefs, GetInt64(kPrefsManifestMetadataSize, _)) in TEST_F()
[all …]
Dmetrics_utils.cc297 int64_t GetPersistedValue(const std::string& key, PrefsInterface* prefs) { in GetPersistedValue() argument
298 CHECK(prefs); in GetPersistedValue()
299 if (!prefs->Exists(key)) in GetPersistedValue()
303 if (!prefs->GetInt64(key, &stored_value)) in GetPersistedValue()
315 void SetNumReboots(int64_t num_reboots, PrefsInterface* prefs) { in SetNumReboots() argument
316 CHECK(prefs); in SetNumReboots()
317 prefs->SetInt64(kPrefsNumReboots, num_reboots); in SetNumReboots()
323 PrefsInterface* prefs) { in SetPayloadAttemptNumber() argument
324 CHECK(prefs); in SetPayloadAttemptNumber()
325 prefs->SetInt64(kPrefsPayloadAttemptNumber, payload_attempt_number); in SetPayloadAttemptNumber()
[all …]
Dcertificate_checker.cc60 CertificateChecker::CertificateChecker(PrefsInterface* prefs, in CertificateChecker() argument
62 : prefs_(prefs), openssl_wrapper_(openssl_wrapper) {} in CertificateChecker()
/system/update_engine/aosp/
Ddaemon_state_android.cc54 Prefs* prefs = new Prefs(); in Initialize() local
55 prefs_.reset(prefs); in Initialize()
56 if (!prefs->Init(non_volatile_path.Append(kPrefsSubDirectory))) { in Initialize()
Dsideload_main.cc142 MemoryPrefs prefs; in ApplyUpdatePayload() local
158 &prefs, in ApplyUpdatePayload()
/system/update_engine/update_manager/
Dreal_updater_provider.cc307 SystemState::Get()->prefs()->AddObserver(key, this); in BooleanPrefVariable()
311 SystemState::Get()->prefs()->RemoveObserver(key_, this); in ~BooleanPrefVariable()
319 auto* prefs = SystemState::Get()->prefs(); in OnPrefSet() local
320 if (prefs->Exists(key_) && !prefs->GetBoolean(key_, &result)) in OnPrefSet()
447 auto* prefs = SystemState::Get()->prefs(); in GetValue() local
449 if (prefs->Exists(key) && prefs->GetInt64(key, &result)) { in GetValue()
453 prefs->Delete(key); in GetValue()
/system/update_engine/payload_consumer/
Ddelta_performer.cc791 PrefsInterface* prefs, in PreparePartitionsForUpdate() argument
799 prefs->GetString(kPrefsDynamicPartitionMetadataUpdated, &last_hash)); in PreparePartitionsForUpdate()
810 ResetUpdateProgress(prefs, false); in PreparePartitionsForUpdate()
824 TEST_AND_RETURN_FALSE(prefs->SetString(kPrefsDynamicPartitionMetadataUpdated, in PreparePartitionsForUpdate()
1325 bool DeltaPerformer::CanResumeUpdate(PrefsInterface* prefs, in CanResumeUpdate() argument
1328 if (!(prefs->GetInt64(kPrefsUpdateStateNextOperation, &next_operation) && in CanResumeUpdate()
1333 if (!(prefs->GetString(kPrefsUpdateCheckResponseHash, &interrupted_hash) && in CanResumeUpdate()
1341 if (prefs->GetInt64(kPrefsResumedUpdateFailures, &resumed_update_failures) && in CanResumeUpdate()
1347 if (!(prefs->GetInt64(kPrefsUpdateStateNextDataOffset, &next_data_offset) && in CanResumeUpdate()
1352 if (!(prefs->GetString(kPrefsUpdateStateSHA256Context, &sha256_context) && in CanResumeUpdate()
[all …]
Ddelta_performer.h68 DeltaPerformer(PrefsInterface* prefs, in DeltaPerformer() argument
75 : prefs_(prefs), in DeltaPerformer()
139 static bool CanResumeUpdate(PrefsInterface* prefs,
149 PrefsInterface* prefs,
198 PrefsInterface* prefs,
Ddelta_performer_integration_test.cc140 FakePrefs prefs; in RunManifestValidation() local
143 DeltaPerformer performer{&prefs, in RunManifestValidation()
723 NiceMock<MockPrefs> prefs; in ApplyDeltaFile() local
724 ON_CALL(prefs, SetInt64(kPrefsManifestMetadataSize, -1)) in ApplyDeltaFile()
726 ON_CALL(prefs, SetInt64(kPrefsUpdateCheckResponseHash, -1)) in ApplyDeltaFile()
728 ON_CALL(prefs, GetString(kPrefsUpdateCheckResponseHash, _)) in ApplyDeltaFile()
730 ON_CALL(prefs, GetString(kPrefsDynamicPartitionMetadataUpdated, _)) in ApplyDeltaFile()
737 EXPECT_CALL(prefs, SetString(_, IsEmpty())).WillRepeatedly(Return(true)); in ApplyDeltaFile()
738 EXPECT_CALL(prefs, SetInt64(_, -1)).WillRepeatedly(Return(true)); in ApplyDeltaFile()
739 EXPECT_CALL(prefs, SetInt64(_, 0)).WillRepeatedly(Return(true)); in ApplyDeltaFile()
[all …]
Ddelta_performer_fuzzer.cc48 MemoryPrefs prefs; in FuzzDeltaPerformer() local
75 DeltaPerformer performer(&prefs, in FuzzDeltaPerformer()
/system/update_engine/common/
Ddynamic_partition_control_stub.cc66 PrefsInterface* prefs, in GetCleanupPreviousUpdateAction() argument
71 bool DynamicPartitionControlStub::ResetUpdate(PrefsInterface* prefs) { in ResetUpdate() argument
Ddynamic_partition_control_stub.h48 PrefsInterface* prefs,
50 bool ResetUpdate(PrefsInterface* prefs) override;
Ddynamic_partition_control_interface.h124 PrefsInterface* prefs,
138 virtual bool ResetUpdate(PrefsInterface* prefs) = 0;

12