wifidirectplugin 0.0.4 → 0.0.5

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.
@@ -3,6 +3,7 @@ package com.ht.plugins.wifidirect;
3
3
  import android.content.Context;
4
4
  import android.content.IntentFilter;
5
5
  import android.content.BroadcastReceiver;
6
+ import android.content.pm.PackageManager;
6
7
  import android.net.wifi.p2p.WifiP2pDevice;
7
8
  import android.net.wifi.p2p.WifiP2pManager;
8
9
  import android.net.wifi.p2p.WifiP2pConfig;
@@ -30,8 +31,9 @@ public class WifiDirectPlugin extends Plugin {
30
31
  @Override
31
32
  public void load() {
32
33
  // WifiP2pManager 초기화
33
- if (!manager.isP2pSupported()) {
34
- call.reject("WiFi P2P not supported on this device");
34
+ boolean isP2pSupported = getContext().getPackageManager().hasSystemFeature(PackageManager.FEATURE_WIFI_DIRECT);
35
+ if (!isP2pSupported) {
36
+ Logger.error("WifiDirectPlugin WiFi P2P not supported on this device");
35
37
  return;
36
38
  }
37
39
  Logger.info("WifiDirectPlugin loaded");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wifidirectplugin",
3
- "version": "0.0.4",
3
+ "version": "0.0.5",
4
4
  "description": "HT-Installer Wifi Direct Plugin",
5
5
  "main": "dist/plugin.cjs.js",
6
6
  "module": "dist/esm/index.js",