shift-shell/kded/autodetectapn/autodetectapn.h
Devin Lin 0e280a94ca kded/autodetectapn: Add background service to automatically add APN connections
We use the Android APN list here in order to determine the APN settings from SIM information.

Fixes https://invent.kde.org/plasma/plasma-mobile/-/issues/285

Address feedback
2024-02-23 15:35:31 +00:00

31 lines
811 B
C++

// SPDX-FileCopyrightText: 2023 Devin Lin <devin@kde.org>
// SPDX-License-Identifier: GPL-2.0-or-later OR LicenseRef-KDE-Accepted-GPL
#pragma once
#include <kdedmodule.h>
#include <QCoroDBusPendingReply>
#include <ModemManagerQt/GenericTypes>
#include <ModemManagerQt/ModemDevice>
#include <NetworkManagerQt/ModemDevice>
class AutoDetectAPN : public KDEDModule
{
Q_OBJECT
public:
AutoDetectAPN(QObject *parent, const QList<QVariant> &);
struct APNEntry {
QString apn;
QString carrier;
};
std::optional<APNEntry> findAPN(const QString &operatorCode, const QString &gid1, const QString &spn, const QString &imsi) const;
private:
QCoro::Task<void> checkAndAddAutodetectedAPN();
NetworkManager::ModemDevice::Ptr findNMModem(ModemManager::Modem::Ptr mmModem);
};