@react-native-ohos/react-native-system-setting 1.8.0-rc.1 → 1.8.0-rc.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. package/harmony/react_native_system_setting/BuildProfile.ets +16 -16
  2. package/harmony/react_native_system_setting/oh-package.json5 +1 -1
  3. package/harmony/react_native_system_setting/src/main/ets/RNSystemSettingTurboModule.ts +19 -12
  4. package/harmony/react_native_system_setting.har +0 -0
  5. package/package.json +1 -1
  6. package/harmony/react_native_system_setting/build/default/cache/default/default@HarCompileArkTS/esmodule/.ts_checker_cache +0 -3265
  7. package/harmony/react_native_system_setting/build/default/cache/default/default@HarCompileArkTS/esmodule/.tsbuildinfo +0 -1
  8. package/harmony/react_native_system_setting/build/default/cache/default/default@HarCompileArkTS/esmodule/.tsbuildinfo.linter +0 -1
  9. package/harmony/react_native_system_setting/build/default/cache/default/default@HarCompileArkTS/esmodule/compileInfo.json +0 -1
  10. package/harmony/react_native_system_setting/build/default/cache/default/default@HarCompileArkTS/esmodule/debug/compiler.cache/modules/Index.ets-2fddbfa85232e8c40c1136f190876ccc.msgpack +0 -0
  11. package/harmony/react_native_system_setting/build/default/cache/default/default@HarCompileArkTS/esmodule/debug/compiler.cache/modules/Logger.ts-8e34cf7fa6426785b8ad5585899ed6b1.msgpack +0 -0
  12. package/harmony/react_native_system_setting/build/default/cache/default/default@HarCompileArkTS/esmodule/debug/compiler.cache/modules/RNSystemSettingPackage.ts-30c76849c83af152019669e58dba3868.msgpack +0 -0
  13. package/harmony/react_native_system_setting/build/default/cache/default/default@HarCompileArkTS/esmodule/debug/compiler.cache/modules/RNSystemSettingTurboModule.ts-7a1b45b73925f478da2aa3d03fb615f7.msgpack +0 -1140
  14. package/harmony/react_native_system_setting/build/default/cache/default/default@HarCompileArkTS/esmodule/debug/compiler.cache/modules/ReactNativeSystemSetting.ts-8877d7ca6db401765ea2eea734a446fa.msgpack +0 -0
  15. package/harmony/react_native_system_setting/build/default/cache/default/default@HarCompileArkTS/esmodule/debug/compiler.cache/modules/index.ets-bee9eb0a0c5d135a91e741ea4b9a65c8.msgpack +0 -0
  16. package/harmony/react_native_system_setting/build/default/cache/default/default@HarCompileArkTS/esmodule/debug/compiler.cache/modules/ts.ts-3cbe49cf5f58ba5b139d5dfafe202b93.msgpack +0 -0
  17. package/harmony/react_native_system_setting/build/default/cache/default/default@HarCompileArkTS/esmodule/debug/compiler.cache/modules/ts.ts-4dbe8955872e62aac8fffa74b038b1db.msgpack +0 -0
  18. package/harmony/react_native_system_setting/build/default/cache/default/default@HarCompileArkTS/esmodule/debug/compiler.cache/modules/ts.ts-9f780c638fd01ebe14b69a7714c4c148.msgpack +0 -0
  19. package/harmony/react_native_system_setting/build/default/cache/default/default@HarCompileArkTS/esmodule/debug/compiler.cache/modules/ts.ts-b18f20d502073e5ca84a0eac4a01ef96.msgpack +0 -0
  20. package/harmony/react_native_system_setting/build/default/cache/default/default@HarCompileArkTS/esmodule/debug/compiler.cache/other/pkgName2SourceRoots.msgpack +0 -1
  21. package/harmony/react_native_system_setting/build/default/cache/default/default@HarCompileArkTS/esmodule/debug/compiler.cache/plugins/plugins.msgpack +0 -0
  22. package/harmony/react_native_system_setting/build/default/cache/default/default@HarCompileArkTS/esmodule/debug/dep_info.json +0 -1
  23. package/harmony/react_native_system_setting/build/default/cache/default/default@PackageHar/BuildProfile.ets +0 -17
  24. package/harmony/react_native_system_setting/build/default/cache/default/default@PackageHar/Index.ets +0 -27
  25. package/harmony/react_native_system_setting/build/default/cache/default/default@PackageHar/ResourceTable.txt +0 -1
  26. package/harmony/react_native_system_setting/build/default/cache/default/default@PackageHar/build-profile.json5 +0 -31
  27. package/harmony/react_native_system_setting/build/default/cache/default/default@PackageHar/consumer-rules.txt +0 -0
  28. package/harmony/react_native_system_setting/build/default/cache/default/default@PackageHar/hvigorfile.ts +0 -6
  29. package/harmony/react_native_system_setting/build/default/cache/default/default@PackageHar/obfuscation-rules.txt +0 -18
  30. package/harmony/react_native_system_setting/build/default/cache/default/default@PackageHar/oh-package-lock.json5 +0 -19
  31. package/harmony/react_native_system_setting/build/default/cache/default/default@PackageHar/oh-package.json5 +0 -1
  32. package/harmony/react_native_system_setting/build/default/cache/default/default@PackageHar/src/main/cpp/CMakeLists.txt +0 -7
  33. package/harmony/react_native_system_setting/build/default/cache/default/default@PackageHar/src/main/cpp/RNSystemSettingPackage.h +0 -76
  34. package/harmony/react_native_system_setting/build/default/cache/default/default@PackageHar/src/main/cpp/ReactNativeSystemSetting.cpp +0 -54
  35. package/harmony/react_native_system_setting/build/default/cache/default/default@PackageHar/src/main/cpp/ReactNativeSystemSetting.h +0 -21
  36. package/harmony/react_native_system_setting/build/default/cache/default/default@PackageHar/src/main/ets/Logger.ts +0 -64
  37. package/harmony/react_native_system_setting/build/default/cache/default/default@PackageHar/src/main/ets/RNSystemSettingPackage.ts +0 -52
  38. package/harmony/react_native_system_setting/build/default/cache/default/default@PackageHar/src/main/ets/RNSystemSettingTurboModule.ts +0 -362
  39. package/harmony/react_native_system_setting/build/default/cache/default/default@PackageHar/src/main/ets/generated/components/ts.ts +0 -5
  40. package/harmony/react_native_system_setting/build/default/cache/default/default@PackageHar/src/main/ets/generated/index.ets +0 -8
  41. package/harmony/react_native_system_setting/build/default/cache/default/default@PackageHar/src/main/ets/generated/ts.ts +0 -9
  42. package/harmony/react_native_system_setting/build/default/cache/default/default@PackageHar/src/main/ets/generated/turboModules/ReactNativeSystemSetting.ts +0 -86
  43. package/harmony/react_native_system_setting/build/default/cache/default/default@PackageHar/src/main/ets/generated/turboModules/ts.ts +0 -8
  44. package/harmony/react_native_system_setting/build/default/cache/default/default@PackageHar/src/main/module.json +0 -28
  45. package/harmony/react_native_system_setting/build/default/cache/default/default@PackageHar/src/main/resources/base/element/string.json +0 -8
  46. package/harmony/react_native_system_setting/build/default/cache/default/default@PackageHar/src/main/resources/en_US/element/string.json +0 -8
  47. package/harmony/react_native_system_setting/build/default/cache/default/default@PackageHar/src/main/resources/zh_CN/element/string.json +0 -8
  48. package/harmony/react_native_system_setting/build/default/cache/default/default@PackageHar/ts.ts +0 -25
  49. package/harmony/react_native_system_setting/build/default/generated/pm/default/oh-package.json5 +0 -1
  50. package/harmony/react_native_system_setting/build/default/generated/r/default/ResourceTable.h +0 -24
  51. package/harmony/react_native_system_setting/build/default/intermediates/loader/default/loader.json +0 -30
  52. package/harmony/react_native_system_setting/build/default/intermediates/merge_profile/default/module.json +0 -25
  53. package/harmony/react_native_system_setting/build/default/intermediates/patch/default/base_native_libs.json +0 -1
  54. package/harmony/react_native_system_setting/build/default/intermediates/process_profile/default/module.json +0 -28
  55. package/harmony/react_native_system_setting/build/default/intermediates/res/default/ResourceTable.txt +0 -1
  56. package/harmony/react_native_system_setting/build/default/intermediates/res/default/ark_module.json +0 -1
  57. package/harmony/react_native_system_setting/build/default/intermediates/res/default/ids_map/id_defined.json +0 -7
  58. package/harmony/react_native_system_setting/build/default/intermediates/res/default/module.json +0 -26
  59. package/harmony/react_native_system_setting/build/default/intermediates/res/default/opt-compression.json +0 -1
  60. package/harmony/react_native_system_setting/build/default/intermediates/res/default/resConfig.json +0 -1
  61. package/harmony/react_native_system_setting/build/default/intermediates/res/default/resources/rawfile/rnoh.profdata +0 -0
  62. package/harmony/react_native_system_setting/build/default/intermediates/res/default/resources.index +0 -0
  63. package/harmony/react_native_system_setting/build/default/outputs/default/react_native_system_setting.har +0 -0
  64. package/harmony/react_native_system_setting/oh-package-lock.json5 +0 -19
@@ -1,362 +0,0 @@
1
- /*
2
- * MIT License
3
- *
4
- * Copyright (C) 2024 Huawei Device Co., Ltd.
5
- *
6
- * Permission is hereby granted, free of charge, to any person obtaining a copy
7
- * of this software and associated documentation files (the "Software"), to deal
8
- * in the Software without restriction, including without limitation the rights
9
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
- * copies of the Software, and to permit persons to whom the Software is
11
- * furnished to do so, subject to the following conditions:
12
- *
13
- * The above copyright notice and this permission notice shall be included in all
14
- * copies or substantial portions of the Software.
15
- *
16
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
- * SOFTWARE.
23
- */
24
-
25
- import { TurboModule, TurboModuleContext } from '@rnoh/react-native-openharmony/ts';
26
- import { TM } from "./generated/ts"
27
- import window from '@ohos.window';
28
- import { access } from '@kit.ConnectivityKit';
29
- import { AbilityLifecycleCallback, common, UIAbility, Want } from '@kit.AbilityKit';
30
- import { BusinessError } from '@kit.BasicServicesKit';
31
- import { audio } from '@kit.AudioKit';
32
- import wifiManager from '@ohos.wifiManager';
33
- import geoLocationManager from '@ohos.geoLocationManager';
34
- import abilityAccessCtrl, { Permissions } from '@ohos.abilityAccessCtrl';
35
-
36
- export class RNSystemSettingTurboModule extends TurboModule implements TM.ReactNativeSystemSetting.Spec {
37
- constructor(protected ctx: TurboModuleContext) {
38
- super(ctx)
39
- this.setWindowClass()
40
- this.reqBluetoothPermissions()
41
- }
42
-
43
- private _windowClass: window.Window | undefined = undefined
44
- private _context: window.Window | undefined = undefined
45
-
46
- private async reqBluetoothPermissions(): Promise<void> {
47
- const permissions: Array<Permissions> = ['ohos.permission.ACCESS_BLUETOOTH'];
48
- let atManager: abilityAccessCtrl.AtManager = abilityAccessCtrl.createAtManager();
49
- atManager.requestPermissionsFromUser(this.ctx.uiAbilityContext, permissions).catch((err: BusinessError) => {
50
- console.error(`Failed to request permissions from user. Code is ${err.code}, message is ${err.message}`);
51
- })
52
- return
53
- }
54
-
55
- private async setWindowClass(): Promise<void> {
56
- let context = this.ctx.uiAbilityContext;
57
- let promise = await window.getLastWindow(context);
58
- this._windowClass = promise
59
- return
60
- }
61
-
62
- private startSettingsAppInfoAbilityExplicit(action: string, complete?: () => void) {
63
- let context = this.ctx.uiAbilityContext;
64
- let want: Want = {
65
- bundleName: 'com.huawei.hmos.settings',
66
- abilityName: 'com.huawei.hmos.settings.MainAbility',
67
- action: 'action.settings',
68
- uri: action
69
- };
70
- context.startAbility(want)
71
- .then(() => {
72
- let applicationContext = context.getApplicationContext();
73
- let callback: AbilityLifecycleCallback = {
74
- onWindowStageCreate: (ability: UIAbility, windowStage: window.WindowStage): void => {
75
- },
76
- onWindowStageActive: (ability: UIAbility, windowStage: window.WindowStage): void => {
77
- },
78
- onWindowStageInactive: (ability: UIAbility, windowStage: window.WindowStage): void => {
79
- },
80
- onWindowStageDestroy: (ability: UIAbility, windowStage: window.WindowStage): void => {
81
- },
82
- onAbilityDestroy: (ability: UIAbility): void => {
83
- applicationContext.off('abilityLifecycle', lis)
84
- },
85
- onAbilityForeground: (ability: UIAbility): void => {
86
- console.log('111')
87
- if (complete) {
88
- complete()
89
- }
90
- console.log('222')
91
- applicationContext.off('abilityLifecycle', lis)
92
- },
93
- onAbilityBackground: (ability: UIAbility): void => {
94
- },
95
- onAbilityContinue: (ability: UIAbility): void => {
96
- },
97
- onAbilityCreate: (ability: UIAbility): void => {
98
- }
99
- }
100
- const lis = applicationContext.on('abilityLifecycle', callback)
101
- })
102
- .catch((err: BusinessError) => {
103
- console.error(`Failed to startAbility. Code: ${err.code}, message: ${err.message}`);
104
- });
105
- }
106
-
107
- getBrightness(): Promise<number> {
108
- // 待实现
109
- return
110
- }
111
-
112
- setBrightness(val: number): Promise<boolean> {
113
- // 待实现
114
- return
115
- }
116
-
117
- setBrightnessForce(val: number): Promise<boolean> {
118
- // 无需实现
119
- return
120
- }
121
-
122
- getAppBrightness(): Promise<number> {
123
- let properties = this._windowClass.getWindowProperties();
124
- if (properties.brightness === -1) {
125
- return Promise.resolve(properties.brightness)
126
- } else {
127
- return Promise.resolve(Math.round(255 * properties.brightness))
128
- }
129
- }
130
-
131
- setAppBrightness(val: number): Promise<boolean> {
132
- if (val === -1) {
133
- this._windowClass.setWindowBrightness(val)
134
- .then(() => {
135
- return Promise.resolve(true)
136
- })
137
- .catch(() => {
138
- return Promise.resolve(false)
139
- })
140
- } else {
141
- const value = val / 255
142
- this._windowClass.setWindowBrightness(Math.round(value * 1000) / 1000)
143
- .then(() => {
144
- return Promise.resolve(true)
145
- })
146
- .catch(() => {
147
- return Promise.resolve(false)
148
- })
149
- }
150
-
151
- return Promise.resolve(false)
152
- }
153
-
154
- grantWriteSettingPremission(): void {
155
- // 待实现
156
- }
157
-
158
- getScreenMode(): Promise<number> {
159
- // 待实现
160
- return
161
- }
162
-
163
- setScreenMode(val: number): Promise<boolean> {
164
- this.startSettingsAppInfoAbilityExplicit('display_settings')
165
- return Promise.resolve(true)
166
- }
167
-
168
- saveBrightness(): Promise<void> {
169
- // js层实现
170
- return
171
- }
172
-
173
- restoreBrightness(): number {
174
- // js层实现
175
- return
176
- }
177
-
178
- getVolume(type: string): Promise<number> {
179
- let groupid = audio.DEFAULT_VOLUME_GROUP_ID;
180
- let audioManager = audio.getAudioManager();
181
- let audioVolumeManager = audioManager.getVolumeManager();
182
- let audioVolumeGroupManager: audio.AudioVolumeGroupManager;
183
- const getVolumeGroupManager = async () => {
184
- audioVolumeGroupManager = await audioVolumeManager.getVolumeGroupManager(groupid);
185
- let promise
186
- if (type === 'music' || type === 'system') {
187
- promise = audioVolumeGroupManager.getVolume(audio.AudioVolumeType.MEDIA)
188
- } else if (type === 'ring' || type === 'notification') {
189
- promise = audioVolumeGroupManager.getVolume(audio.AudioVolumeType.RINGTONE);
190
- } else if (type === 'call') {
191
- promise = audioVolumeGroupManager.getVolume(audio.AudioVolumeType.VOICE_CALL)
192
- } else if (type === 'alarm') {
193
- promise = audioVolumeGroupManager.getVolume(audio.AudioVolumeType.ALARM)
194
- } else {
195
- promise = Promise.reject('Argument must be one of "music,system,ring,notification,call,alarm"')
196
- }
197
- return promise
198
- }
199
- return getVolumeGroupManager();
200
- }
201
-
202
- setVolume(value: number, config: Object): void {
203
- // 待实现
204
- }
205
-
206
- addVolumeListener(): void {
207
- let audioManager = audio.getAudioManager();
208
- let audioVolumeManager = audioManager.getVolumeManager();
209
- audioVolumeManager.on('volumeChange', (volumeEvent: audio.VolumeEvent) => {
210
- if (volumeEvent.volumeType === audio.AudioVolumeType.MEDIA) {
211
- this.ctx.rnInstance.emitDeviceEvent("EventVolume", {
212
- value: Math.round(volumeEvent.volume / 15 * 100) / 100,
213
- system: Math.round(volumeEvent.volume / 15 * 100) / 100,
214
- music: Math.round(volumeEvent.volume / 15 * 100) / 100,
215
- })
216
- } else if (volumeEvent.volumeType === audio.AudioVolumeType.RINGTONE) {
217
- this.ctx.rnInstance.emitDeviceEvent("EventVolume", {
218
- value: Math.round(volumeEvent.volume / 15 * 100) / 100,
219
- ring: Math.round(volumeEvent.volume / 15 * 100) / 100,
220
- notification: Math.round(volumeEvent.volume / 15 * 100) / 100
221
- })
222
- } else if (volumeEvent.volumeType === audio.AudioVolumeType.VOICE_CALL) {
223
- this.ctx.rnInstance.emitDeviceEvent("EventVolume", {
224
- value: Math.round(volumeEvent.volume / 15 * 100) / 100,
225
- call: Math.round(volumeEvent.volume / 15 * 100) / 100
226
- })
227
- } else if (volumeEvent.volumeType === audio.AudioVolumeType.ALARM) {
228
- this.ctx.rnInstance.emitDeviceEvent("EventVolume", {
229
- value: Math.round(volumeEvent.volume / 15 * 100) / 100,
230
- alarm: Math.round(volumeEvent.volume / 15 * 100) / 100
231
- })
232
- }
233
- });
234
- }
235
-
236
- removeVolumeListener(listener: TM.ReactNativeSystemSetting.EmitterSubscription): void {
237
- let audioManager = audio.getAudioManager();
238
- let audioVolumeManager = audioManager.getVolumeManager();
239
- audioVolumeManager.on('volumeChange', (volumeEvent: audio.VolumeEvent) => {
240
- // 暂未支持该接口
241
- });
242
- }
243
-
244
- isWifiEnabled(): Promise<boolean> {
245
- try {
246
- let isWifiActive = wifiManager.isWifiActive();
247
- return Promise.resolve(isWifiActive)
248
- } catch (error) {
249
- console.error("failed:" + JSON.stringify(error));
250
- }
251
- }
252
-
253
-
254
- switchWifiSilence(onComplete: () => void): void {
255
- // 待实现
256
- }
257
-
258
- switchWifi(onComplete: () => void): void {
259
- if (onComplete) {
260
- this.startSettingsAppInfoAbilityExplicit('wifi_entry', onComplete)
261
- } else {
262
- this.startSettingsAppInfoAbilityExplicit('wifi_entry')
263
- }
264
- }
265
-
266
- isLocationEnabled(): Promise<boolean> {
267
- let locationEnabled = geoLocationManager.isLocationEnabled();
268
- return Promise.resolve(locationEnabled)
269
- }
270
-
271
- getLocationMode(): Promise<number> {
272
- throw new Error('Method not implemented.');
273
- }
274
-
275
- switchLocation(onComplete: () => void): void {
276
- if (onComplete) {
277
- this.startSettingsAppInfoAbilityExplicit('location_manager_settings', onComplete)
278
- } else {
279
- this.startSettingsAppInfoAbilityExplicit('location_manager_settings')
280
- }
281
- }
282
-
283
- isBluetoothEnabled(): Promise<boolean> {
284
- try {
285
- return Promise.resolve<boolean>(access.getState() === 0 ? false : true)
286
- } catch (exception) {
287
- return Promise.reject('Failed to get bluetooth enabled. Cause: ' + JSON.stringify(exception))
288
- }
289
- }
290
-
291
- switchBluetooth(onComplete?: () => void): void {
292
- if (onComplete) {
293
- this.startSettingsAppInfoAbilityExplicit('bluetooth_entry', onComplete)
294
- } else {
295
- this.startSettingsAppInfoAbilityExplicit('bluetooth_entry')
296
- }
297
- }
298
-
299
- switchBluetoothSilence(onComplete?: () => void): void {
300
- const bluetoothState = access.getState()
301
- if (bluetoothState === 0 || bluetoothState === 3) {
302
- access.enableBluetooth()
303
- } else if (bluetoothState === 2 || bluetoothState === 1) {
304
- access.disableBluetooth()
305
- }
306
- if (onComplete) {
307
- onComplete()
308
- }
309
- }
310
-
311
- isAirplaneEnabled(): Promise<boolean> {
312
- throw new Error('Method not implemented.');
313
- }
314
-
315
- switchAirplane(onComplete: () => void): void {
316
- if (onComplete) {
317
- this.startSettingsAppInfoAbilityExplicit('mobile_network_entry', onComplete);
318
- } else {
319
- this.startSettingsAppInfoAbilityExplicit('mobile_network_entry');
320
- }
321
- }
322
-
323
- openAppSystemSettings(): void {
324
- this.startSettingsAppInfoAbilityExplicit('application_info_entry');
325
- }
326
-
327
- addBluetoothListener(): void {
328
- access.on('stateChange', e => {
329
- if (e === 0) {
330
- this.ctx.rnInstance.emitDeviceEvent("EventBluetooth", false);
331
- } else if (e === 2) {
332
- this.ctx.rnInstance.emitDeviceEvent("EventBluetooth", true);
333
- }
334
- });
335
- }
336
-
337
- addWifiListener(callback: (wifiEnabled: boolean) => void): Promise<TM.ReactNativeSystemSetting.EmitterSubscription | null> {
338
- throw new Error('Method not implemented.');
339
- }
340
-
341
- addLocationListener(callback: (locationEnabled: boolean) => void): Promise<TM.ReactNativeSystemSetting.EmitterSubscription | null> {
342
- throw new Error('Method not implemented.');
343
- }
344
-
345
- addLocationModeListener(callback: (locationMode: number) => void): Promise<TM.ReactNativeSystemSetting.EmitterSubscription | null> {
346
- throw new Error('Method not implemented.');
347
- }
348
-
349
- addAirplaneListener(callback: (airplaneModeEnabled: boolean) => void): Promise<TM.ReactNativeSystemSetting.EmitterSubscription | null> {
350
- throw new Error('Method not implemented.');
351
- }
352
-
353
- removeListener(type): void {
354
- if (type === 'bluetooth') {
355
- access.off('stateChange');
356
- }
357
- }
358
-
359
- addListener(eventName: string): void {}
360
-
361
- removeListeners(count: number): void {}
362
- }
@@ -1,8 +0,0 @@
1
- /**
2
- * This code was generated by "react-native codegen-harmony"
3
- *
4
- * Do not edit this file as changes may cause incorrect behavior and will be
5
- * lost once the code is regenerated.
6
- */
7
-
8
- export * from "./ts"
@@ -1,9 +0,0 @@
1
- /**
2
- * This code was generated by "react-native codegen-harmony"
3
- *
4
- * Do not edit this file as changes may cause incorrect behavior and will be
5
- * lost once the code is regenerated.
6
- */
7
-
8
- export * as RNC from "./components/ts"
9
- export * as TM from "./turboModules/ts"
@@ -1,86 +0,0 @@
1
- /**
2
- * This code was generated by "react-native codegen-harmony"
3
- *
4
- * Do not edit this file as changes may cause incorrect behavior and will be
5
- * lost once the code is regenerated.
6
- *
7
- * @generatorVersion: 1
8
- */
9
-
10
-
11
- export namespace ReactNativeSystemSetting {
12
- export const NAME = 'ReactNativeSystemSetting' as const
13
-
14
- export type EmitterSubscription = {remove: Object, type: unknown}
15
-
16
- export interface Spec {
17
- getBrightness(): Promise<number>;
18
-
19
- setBrightness(val: number): Promise<boolean>;
20
-
21
- setBrightnessForce(val: number): Promise<boolean>;
22
-
23
- getAppBrightness(): Promise<number>;
24
-
25
- setAppBrightness(val: number): Promise<boolean>;
26
-
27
- grantWriteSettingPremission(): void;
28
-
29
- getScreenMode(): Promise<number>;
30
-
31
- setScreenMode(val: number): Promise<boolean>;
32
-
33
- saveBrightness(): Promise<void>;
34
-
35
- restoreBrightness(): number;
36
-
37
- getVolume(type: unknown): Promise<number>;
38
-
39
- setVolume(value: number, config: Object): void;
40
-
41
- addVolumeListener(): void;
42
-
43
- removeVolumeListener(listener: EmitterSubscription): void;
44
-
45
- isWifiEnabled(): Promise<boolean>;
46
-
47
- switchWifiSilence(onComplete: () => void): void;
48
-
49
- switchWifi(onComplete: () => void): void;
50
-
51
- isLocationEnabled(): Promise<boolean>;
52
-
53
- getLocationMode(): Promise<number>;
54
-
55
- switchLocation(onComplete: () => void): void;
56
-
57
- isBluetoothEnabled(): Promise<boolean>;
58
-
59
- switchBluetooth(onComplete: () => void): void;
60
-
61
- switchBluetoothSilence(onComplete: () => void): void;
62
-
63
- isAirplaneEnabled(): Promise<boolean>;
64
-
65
- switchAirplane(onComplete: () => void): void;
66
-
67
- openAppSystemSettings(): void;
68
-
69
- addBluetoothListener(): void;
70
-
71
- addWifiListener(callback: (wifiEnabled: boolean) => void): Promise<null | EmitterSubscription>;
72
-
73
- addLocationListener(callback: (locationEnabled: boolean) => void): Promise<null | EmitterSubscription>;
74
-
75
- addLocationModeListener(callback: (locationMode: number) => void): Promise<null | EmitterSubscription>;
76
-
77
- addAirplaneListener(callback: (airplaneModeEnabled: boolean) => void): Promise<null | EmitterSubscription>;
78
-
79
- removeListener(type: string): void;
80
-
81
- addListener(eventName: string): void;
82
-
83
- removeListeners(count: number): void;
84
-
85
- }
86
- }
@@ -1,8 +0,0 @@
1
- /**
2
- * This code was generated by "react-native codegen-harmony"
3
- *
4
- * Do not edit this file as changes may cause incorrect behavior and will be
5
- * lost once the code is regenerated.
6
- */
7
-
8
- export * from "./ReactNativeSystemSetting"
@@ -1,28 +0,0 @@
1
- {
2
- "app": {
3
- "bundleName": "com.example.25P1_3",
4
- "debug": true,
5
- "versionCode": 1000000,
6
- "versionName": "1.0.0",
7
- "minAPIVersion": 50000012,
8
- "targetAPIVersion": 50101019,
9
- "apiReleaseType": "Release",
10
- "compileSdkVersion": "5.1.1.212",
11
- "compileSdkType": "HarmonyOS",
12
- "appEnvironments": [],
13
- "bundleType": "app",
14
- "buildMode": "debug"
15
- },
16
- "module": {
17
- "name": "react_native_system_setting",
18
- "type": "har",
19
- "deviceTypes": [
20
- "default"
21
- ],
22
- "packageName": "@react-native-ohos/react-native-system-setting",
23
- "installationFree": false,
24
- "virtualMachine": "ark12.0.2.0",
25
- "compileMode": "esmodule",
26
- "dependencies": []
27
- }
28
- }
@@ -1,8 +0,0 @@
1
- {
2
- "string": [
3
- {
4
- "name": "page_show",
5
- "value": "page from package"
6
- }
7
- ]
8
- }
@@ -1,8 +0,0 @@
1
- {
2
- "string": [
3
- {
4
- "name": "page_show",
5
- "value": "page from package"
6
- }
7
- ]
8
- }
@@ -1,8 +0,0 @@
1
- {
2
- "string": [
3
- {
4
- "name": "page_show",
5
- "value": "page from package"
6
- }
7
- ]
8
- }
@@ -1,25 +0,0 @@
1
- /*
2
- * MIT License
3
- *
4
- * Copyright (C) 2024 Huawei Device Co., Ltd.
5
- *
6
- * Permission is hereby granted, free of charge, to any person obtaining a copy
7
- * of this software and associated documentation files (the "Software"), to deal
8
- * in the Software without restriction, including without limitation the rights
9
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
- * copies of the Software, and to permit persons to whom the Software is
11
- * furnished to do so, subject to the following conditions:
12
- *
13
- * The above copyright notice and this permission notice shall be included in all
14
- * copies or substantial portions of the Software.
15
- *
16
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
- * SOFTWARE.
23
- */
24
-
25
- export * from './src/main/ets/RNSystemSettingPackage'
@@ -1 +0,0 @@
1
- {"name":"@react-native-ohos/react-native-system-setting","version":"1.8.0-rc.1","description":"Please describe the basic information.","main":"Index.ets","author":"","license":"MIT","dependencies":{"@rnoh/react-native-openharmony":"file:../react_native_openharmony"}}
@@ -1,24 +0,0 @@
1
- /*
2
- * Copyright (c) 2023 Huawei Device Co., Ltd.
3
- * Licensed under the Apache License, Version 2.0 (the "License");
4
- * you may not use this file except in compliance with the License.
5
- * You may obtain a copy of the License at
6
- *
7
- * http://www.apache.org/licenses/LICENSE-2.0
8
- *
9
- * Unless required by applicable law or agreed to in writing, software
10
- * distributed under the License is distributed on an "AS IS" BASIS,
11
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- * See the License for the specific language governing permissions and
13
- * limitations under the License.
14
- */
15
-
16
- #ifndef RESOURCE_TABLE_H
17
- #define RESOURCE_TABLE_H
18
-
19
- #include<stdint.h>
20
-
21
- namespace OHOS {
22
- const int32_t STRING_PAGE_SHOW = 0x02000000;
23
- }
24
- #endif
@@ -1,30 +0,0 @@
1
- {
2
- "modulePathMap": {
3
- "entry": "D:\\dev\\rnt77_cmt\\25P1_3\\harmony\\entry",
4
- "react_native_system_setting": "D:\\77republish\\rntpc_react-native-system-setting\\harmony\\react_native_system_setting"
5
- },
6
- "compileMode": "esmodule",
7
- "projectRootPath": "D:\\77republish\\rntpc_react-native-system-setting\\harmony",
8
- "nodeModulesPath": "D:\\77republish\\rntpc_react-native-system-setting\\harmony\\react_native_system_setting\\build\\default\\intermediates\\loader_out\\default\\node_modules",
9
- "byteCodeHarInfo": {},
10
- "declarationEntry": [],
11
- "moduleName": "react_native_system_setting",
12
- "hspNameOhmMap": {},
13
- "harNameOhmMap": {},
14
- "packageManagerType": "ohpm",
15
- "compileEntry": [
16
- "D:\\77republish\\rntpc_react-native-system-setting\\harmony\\react_native_system_setting\\src\\main\\ets\\Logger.ts",
17
- "D:\\77republish\\rntpc_react-native-system-setting\\harmony\\react_native_system_setting\\src\\main\\ets\\RNSystemSettingPackage.ts",
18
- "D:\\77republish\\rntpc_react-native-system-setting\\harmony\\react_native_system_setting\\src\\main\\ets\\RNSystemSettingTurboModule.ts",
19
- "D:\\77republish\\rntpc_react-native-system-setting\\harmony\\react_native_system_setting\\src\\main\\ets\\generated\\index.ets",
20
- "D:\\77republish\\rntpc_react-native-system-setting\\harmony\\react_native_system_setting\\src\\main\\ets\\generated\\ts.ts",
21
- "D:\\77republish\\rntpc_react-native-system-setting\\harmony\\react_native_system_setting\\src\\main\\ets\\generated\\components\\ts.ts",
22
- "D:\\77republish\\rntpc_react-native-system-setting\\harmony\\react_native_system_setting\\src\\main\\ets\\generated\\turboModules\\ReactNativeSystemSetting.ts",
23
- "D:\\77republish\\rntpc_react-native-system-setting\\harmony\\react_native_system_setting\\src\\main\\ets\\generated\\turboModules\\ts.ts"
24
- ],
25
- "otherCompileFiles": [],
26
- "dynamicImportLibInfo": {},
27
- "routerMap": [],
28
- "hspResourcesMap": {},
29
- "updateVersionInfo": {}
30
- }
@@ -1,25 +0,0 @@
1
- {
2
- "app": {
3
- "bundleName": "com.example.25P1_3",
4
- "debug": true,
5
- "versionCode": 1000000,
6
- "versionName": "1.0.0",
7
- "minAPIVersion": 50000012,
8
- "targetAPIVersion": 50101019,
9
- "apiReleaseType": "Release",
10
- "compileSdkVersion": "5.1.1.212",
11
- "compileSdkType": "HarmonyOS",
12
- "appEnvironments": [],
13
- "bundleType": "app",
14
- "buildMode": "debug"
15
- },
16
- "module": {
17
- "name": "react_native_system_setting",
18
- "type": "har",
19
- "deviceTypes": [
20
- "default"
21
- ],
22
- "packageName": "@react-native-ohos/react-native-system-setting",
23
- "installationFree": false
24
- }
25
- }