DCS/ruiyiweiUX/Assets/Scripts/Services/AndroidAutoStartManager.cs

50 lines
1.1 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using UnityEngine;
/// <summary>
/// 保留兼容API但应用已取消Android开机自启。
/// </summary>
public class AndroidAutoStartManager : MonoBehaviour
{
private static AndroidAutoStartManager _instance;
public static AndroidAutoStartManager Instance
{
get
{
if (_instance == null)
{
GameObject go = new GameObject("AndroidAutoStartManager");
_instance = go.AddComponent<AndroidAutoStartManager>();
DontDestroyOnLoad(go);
}
return _instance;
}
}
public bool HasBootStartPermission()
{
return false;
}
public void SetAutoStartEnabled(bool enabled)
{
Debug.Log("[AutoStart] Android开机自启已在当前版本中禁用");
}
public bool IsAutoStartEnabled()
{
return false;
}
public void OpenAppSettings()
{
Debug.Log("[AutoStart] Android开机自启已禁用无需打开自启设置");
}
public void PrintDiagnosticsInfo()
{
Debug.Log("[AutoStart] Android开机自启已禁用");
}
}