internal override IEnumerator ValidatePermissionIsGranted(OSPermission permissionFlags) { // USB provider does not require any permissions to be granted _lastPermissionCheckedIsGranted = true; yield break; }
private void OnOSPermissionFailure(OSPermission permission) { _messageText.SetLocaleKey( LocaleConstants.BOSE_AR_UNITY_SDK_PERMISSION_FAILURE_MESSAGE, permission.GetLocaleKey()); Show(); }
private void OnOSPermissionRequired(OSPermission permission) { _requiredPermission = permission; _messageText.text = string.Empty; _headerText.text = string.Format(REQUIRED_PERMISSION_TITLE_FORMAT, permission); _warningText.text = _wearableControl.GetPermissionRequiredText(permission); Show(); }
public void RequestPermission(OSPermission permission) { const string RequestLocationPermissionMethod = "WearableRequestPermission"; if (_wearablePlugin != null) { _wearablePlugin.Call(RequestLocationPermissionMethod, (int)permission); } }
public bool GetPermissionGranted(OSPermission permission) { const string GetPermissionGrantedMethod = "WearableGetPermissionGranted"; if (_wearablePlugin != null) { return(_wearablePlugin.Call <bool>(GetPermissionGrantedMethod, (int)permission)); } return(false); }
public bool CheckPermissionInternal(OSPermission permission) { switch (permission) { case OSPermission.Location: return(AndroidPlugin.GetPermissionGranted(permission)); default: return(true); } }
public bool CheckPermissionInternal(OSPermission permission) { switch (permission) { case OSPermission.Bluetooth: return(WearableCheckBluetoothPermission()); default: return(true); } }
public void RequestPermissionInternal(OSPermission permission) { switch (permission) { case OSPermission.Location: AndroidPlugin.RequestPermission(permission); break; default: break; } }
public void RequestPermissionInternal(OSPermission permission) { switch (permission) { case OSPermission.Bluetooth: WearableRequestBluetoothPermission(); break; default: break; } }
/// <summary> /// Returns the appropriate locale key for <param name="permission"></param> /// </summary> /// <param name="permission"></param> /// <returns></returns> public static string GetLocaleKey(this OSPermission permission) { switch (permission) { case OSPermission.Bluetooth: return(LocaleConstants.BOSE_AR_UNITY_SDK_BLUETOOTH); case OSPermission.Location: return(LocaleConstants.BOSE_AR_UNITY_SDK_LOCATION); default: throw new ArgumentOutOfRangeException("permission", permission, null); } }
/// <summary> /// Returns the proper text description of a permission prompt. /// </summary> /// <param name="permission"></param> /// <returns></returns> internal virtual string GetPermissionRequiredText(OSPermission permission) { switch (permission) { case OSPermission.Bluetooth: return(WearableConstants.BLUETOOTH_PERMISSION_MESSAGE); case OSPermission.Location: return(string.Format(WearableConstants.GENERAL_PERMISSION_MESSAGE_FORMAT, permission)); default: throw new ArgumentOutOfRangeException("permission", permission, null); } }
internal override IEnumerator ValidatePermissionIsGranted(OSPermission permission) { yield return(Wait.ForEndOfFrame); yield return(Wait.ForEndOfFrame); if (!CheckPermissionInternal(permission)) { _lastPermissionRequestedForUser = permission; _lastPermissionCheckedIsGranted = false; OnConnectionStatusChanged(ConnectionStatus.PermissionRequired); } else { _lastPermissionRequestedForUser = null; _lastPermissionCheckedIsGranted = true; } }
/// <summary> /// Returns the appropriate <see cref="OSPermissionFlags"/> for the passed individual <see cref="OSPermission"/> /// <paramref name="permission"/>. /// </summary> /// <param name="permission"></param> /// <returns></returns> internal static OSPermissionFlags GetOSPermissionFlag(OSPermission permission) { OSPermissionFlags flag; switch (permission) { case OSPermission.Bluetooth: flag = OSPermissionFlags.Bluetooth; break; case OSPermission.Location: flag = OSPermissionFlags.Location; break; default: throw new ArgumentOutOfRangeException("permission", permission, null); } return(flag); }
private void OnOSPermissionRequired(OSPermission permission) { _requiredPermission = permission; _messageText.Clear(); if (permission == OSPermission.Bluetooth) { _headerText.SetLocaleKey(LocaleConstants.CONNECTION_TASK_AUTHORIZATION_REQUIRED_TITLE); _warningText.SetLocaleKey(LocaleConstants.CONNECTION_TASK_AUTHORIZATION_REQUIRED_MESSAGE); _warningIconImage.sprite = _bluetoothWarningSprite; } else { _headerText.SetLocaleKey(LocaleConstants.CONNECTION_TASK_LOCATION_AUTHORIZATION_REQUIRED_TITLE); _warningText.SetLocaleKey(LocaleConstants.CONNECTION_TASK_LOCATION_AUTHORIZATION_REQUIRED_MESSAGE); _warningIconImage.sprite = _generalWarningIcon; } Show(); }
public bool CheckPermissionInternal(OSPermission permission) { return(true); }
private void OnOSPermissionRequired(OSPermission permission) { Hide(); }
private void OnOSPermissionFailure(OSPermission permission) { Hide(); }
/// <summary> /// Returns the proper text description of a permission prompt. /// </summary> /// <param name="permission"></param> /// <returns></returns> internal virtual string GetPermissionRequiredText(OSPermission permission) { return(string.Empty); }
/// <summary> /// Asynchronously requests the <see cref="OSPermission"/> <paramref name="permission"/>. This should /// yield until the user has confirmed or denied the permission or returned to the application. /// </summary> /// <param name="permission"></param> /// <returns></returns> internal abstract IEnumerator RequestPermissionCoroutine(OSPermission permission);
/// <summary> /// <see cref="_lastPermissionCheckedIsGranted"/> is set to true if the user has granted the <see cref="OSPermissionFlags"/> <paramref name="permission"/>, /// otherwise false if the user has not granted the permission. If not granted, /// <see cref="ConnectionStatusChanged"/> will be invoked with <seealso cref="ConnectionStatus.PermissionRequest"/> /// as the passed value. /// </summary> /// <param name="permission"></param> /// <returns></returns> internal abstract IEnumerator ValidatePermissionIsGranted(OSPermission permission);
internal override IEnumerator RequestPermissionCoroutine(OSPermission permission) { // Requesting permissions resolves to a no-op yield break; }
private void OnOSPermissionFailure(OSPermission permission) { _messageText.text = string.Format(PERMISSIONS_FAILURE_MESSAGE_FORMAT, permission.ToString()); Show(); }
public void RequestPermissionInternal(OSPermission permission) { }
internal override IEnumerator RequestPermissionCoroutine(OSPermission permission) { RequestPermissionInternal(permission); yield break; }