diff --git a/Runtime/Android/UnityActivityJavaClass.cs b/Runtime/Android/UnityActivityJavaClass.cs index b241ccb..c698037 100644 --- a/Runtime/Android/UnityActivityJavaClass.cs +++ b/Runtime/Android/UnityActivityJavaClass.cs @@ -7,17 +7,17 @@ namespace LAN.Android { public struct Settings { -#if UNITY_ANDROID && !UNITY_EDITOR +//#if UNITY_ANDROID && !UNITY_EDITOR public static readonly string IGNORE_BATTERY_OPTIMIZATION_SETTINGS = "android.settings.IGNORE_BATTERY_OPTIMIZATION_SETTINGS"; public static readonly string APPLICATION_DETAILS_SETTINGS = "android.settings.APPLICATION_DETAILS_SETTINGS"; public static readonly string LOCATION_SOURCE_SETTINGS = "android.settings.LOCATION_SOURCE_SETTINGS"; public static readonly string MANAGE_OVERLAY_PERMISSION = "android.settings.action.MANAGE_OVERLAY_PERMISSION"; -#endif +//#endif } public static class UnityActivityJavaClass { -#if UNITY_ANDROID && !UNITY_EDITOR +//#if UNITY_ANDROID && !UNITY_EDITOR public static readonly AndroidJavaClass URI_CLASS = new("android.net.Uri"); public static readonly AndroidJavaClass VERSION_INFO_CLASS = new("android.os.Build$VERSION"); public static readonly AndroidJavaClass UNITY_PLAYER_CLASS = new("com.unity3d.player.UnityPlayer"); @@ -75,6 +75,18 @@ public static bool IsDebuggingModeEnabled // Check if developer options are enabled bool status = SETTINGS_GLOBAL_CLASS.CallStatic("getInt", CurrentActivity.Call("getContentResolver"), "adb_enabled", 0) == 1; + Debug.Log($"USB Debugging is {(status ? "enabled" : "disabled")}!"); + return status; + } + } + + public static bool IsDevOptionsEnabled + { + get + { + // Check if developer options are enabled + bool status = SETTINGS_GLOBAL_CLASS.CallStatic("getInt", CurrentActivity.Call("getContentResolver"), "development_settings_enabled", 0) == 1; + Debug.Log($"Developer options are {(status ? "enabled" : "disabled")}!"); return status; } @@ -154,6 +166,6 @@ public static void OpenGPSSetting() Debug.LogWarning("GPS service disabled by user"); } -#endif +//#endif } } \ No newline at end of file diff --git a/package.json b/package.json index b3b4f9f..4f3cfa6 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "com.lan.live-location", - "version": "1.1.0", - "displayName": "Live Location for Mobile", + "version": "1.2.0", + "displayName": "Live Location", "description": "A plugin that allow unity (Android) to run a background service location", "unity": "2020.3", "documentationUrl": "https://github.com/krlan2789/Unity-Background-Location/blob/main/README.md", @@ -18,4 +18,4 @@ "email": "erlank2789@gmail.com", "url": "https://erlankurnia.github.io" } -} +} \ No newline at end of file