Skip to content

Commit

Permalink
[core] Moved nfc_manager_request_mode() to internal header. JB#48413
Browse files Browse the repository at this point in the history
It's still exported from nfcd in order to maintain plugin ABI but
removed from the public headers.

At some point it was used by the settings plugin to enable/disable NFC.
These days there's nfc_manager_set_enabled() for that.
  • Loading branch information
monich committed Jan 3, 2021
1 parent 88ce091 commit 12f631c
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 11 deletions.
9 changes: 2 additions & 7 deletions core/include/nfc_manager.h
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2018-2019 Jolla Ltd.
* Copyright (C) 2018-2019 Slava Monich <slava.monich@jolla.com>
* Copyright (C) 2018-2021 Jolla Ltd.
* Copyright (C) 2018-2021 Slava Monich <slava.monich@jolla.com>
*
* You may use this file under the terms of BSD license as follows:
*
Expand Down Expand Up @@ -113,11 +113,6 @@ nfc_manager_request_power(
NfcManager* manager,
gboolean on);

void
nfc_manager_request_mode(
NfcManager* manager,
NFC_MODE mode);

gulong
nfc_manager_add_adapter_added_handler(
NfcManager* manager,
Expand Down
5 changes: 3 additions & 2 deletions core/src/nfc_manager.c
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2018-2020 Jolla Ltd.
* Copyright (C) 2018-2020 Slava Monich <slava.monich@jolla.com>
* Copyright (C) 2018-2021 Jolla Ltd.
* Copyright (C) 2018-2021 Slava Monich <slava.monich@jolla.com>
*
* You may use this file under the terms of BSD license as follows:
*
Expand Down Expand Up @@ -33,6 +33,7 @@
#define GLIB_DISABLE_DEPRECATION_WARNINGS

#include "internal/nfc_manager_i.h"
#include "nfc_manager_p.h"
#include "nfc_adapter_p.h"
#include "nfc_plugins.h"
#include "nfc_log.h"
Expand Down
53 changes: 53 additions & 0 deletions core/src/nfc_manager_p.h
@@ -0,0 +1,53 @@
/*
* Copyright (C) 2021 Jolla Ltd.
* Copyright (C) 2021 Slava Monich <slava.monich@jolla.com>
*
* You may use this file under the terms of BSD license as follows:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the names of the copyright holders nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/

#ifndef NFC_MANAGER_PRIVATE_H
#define NFC_MANAGER_PRIVATE_H

#include "nfc_types_p.h"

#include <nfc_manager.h>

void
nfc_manager_request_mode(
NfcManager* manager,
NFC_MODE mode); /* It used to be public and stays exported */

#endif /* NFC_MANAGER_PRIVATE_H */

/*
* Local Variables:
* mode: C
* c-basic-offset: 4
* indent-tabs-mode: nil
* End:
*/
5 changes: 3 additions & 2 deletions unit/core_manager/test_core_manager.c
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2018-2019 Jolla Ltd.
* Copyright (C) 2018-2019 Slava Monich <slava.monich@jolla.com>
* Copyright (C) 2018-2021 Jolla Ltd.
* Copyright (C) 2018-2021 Slava Monich <slava.monich@jolla.com>
*
* You may use this file under the terms of BSD license as follows:
*
Expand Down Expand Up @@ -33,6 +33,7 @@
#include "test_common.h"

#include "internal/nfc_manager_i.h"
#include "nfc_manager_p.h"
#include "nfc_adapter_impl.h"

#include <gutil_log.h>
Expand Down

0 comments on commit 12f631c

Please sign in to comment.