1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 /* global ExtensionAPI, Services, XPCOMUtils */
9 XPCOMUtils.defineLazyModuleGetters(this, {
10 Services: "resource://gre/modules/Services.jsm",
11 SharedPreferences: "resource://gre/modules/SharedPreferences.jsm",
14 this.sharedPreferences = class extends ExtensionAPI {
18 async setCharPref(name, value) {
19 if (!Services.androidBridge || !Services.androidBridge.isFennec) {
22 SharedPreferences.forApp().setCharPref(name, value);
24 async setBoolPref(name, value) {
25 if (!Services.androidBridge || !Services.androidBridge.isFennec) {
28 SharedPreferences.forApp().setBoolPref(name, value);