Page MenuHomePhabricator

[native] Add wrapper functions for getting and setting device id in cpp
ClosedPublic

Authored by inka on Oct 11 2022, 12:38 AM.
Tags
None
Referenced Files
F3368568: D5339.diff
Mon, Nov 25, 8:16 PM
Unknown Object (File)
Sun, Nov 24, 2:46 PM
Unknown Object (File)
Sun, Nov 24, 12:36 PM
Unknown Object (File)
Sun, Nov 24, 12:36 PM
Unknown Object (File)
Sun, Nov 24, 12:36 PM
Unknown Object (File)
Fri, Nov 22, 5:56 AM
Unknown Object (File)
Wed, Nov 20, 1:49 AM
Unknown Object (File)
Tue, Nov 5, 11:04 AM

Details

Summary

We need to be able to call getting and setting device id from cpp. In D5316 it has been decided (by setting setMetadata etc. functions to be private) that we'll have wrapper functions for all metadata entries to keep the code clean.

Test Plan

Add in AppDelegate.mm to didFinishLaunchingWithOptions the following lines:

comm::DatabaseManager::getQueryExecutor().setDeviceID(":)))))");
comm::Logger::log(comm::DatabaseManager::getQueryExecutor().getDeviceID());

And see that ":)))))" gets logged to the console. I also checked by setting breakpoints before and after these lines that in the SQLite Metadata table for the simulator there appears device_id entry with :))))) in the data column.

Diff Detail

Repository
rCOMM Comm
Branch
inka/deviceID_rs
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

Add this-> to class member calls

inka requested review of this revision.Oct 11 2022, 12:49 AM
marcin added a reviewer: tomek.
marcin added inline comments.
native/cpp/CommonCpp/DatabaseManagers/SQLiteQueryExecutor.h
66 ↗(On Diff #17479)

I assume it is ok not to have a method to clear device_id since we will just overwrite it with new one once the current gets outdated.

native/cpp/CommonCpp/DatabaseManagers/SQLiteQueryExecutor.h
66 ↗(On Diff #17479)

That's the idea for now

This revision is now accepted and ready to land.Oct 12 2022, 3:05 AM