").text(i))},100))},menuselect:function(t,e){var i=e.item.data("ui-autocomplete-item"),s=this.previous;this.element[0]!==x.ui.safeActiveElement(this.document[0])&&(this.element.trigger("focus"),this.previous=s,this._delay(function(){this.previous=s,this.selectedItem=i})),!1!==this._trigger("select",t,{item:i})&&this._value(i.value),this.term=this._value(),this.close(t),this.selectedItem=i}}),this.liveRegion=x("
",{role:"status","aria-live":"assertive","aria-relevant":"additions"}).appendTo(this.document[0].body),this._addClass(this.liveRegion,null,"ui-helper-hidden-accessible"),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_destroy:function(){clearTimeout(this.searching),this.element.removeAttr("autocomplete"),this.menu.element.remove(),this.liveRegion.remove()},_setOption:function(t,e){this._super(t,e),"source"===t&&this._initSource(),"appendTo"===t&&this.menu.element.appendTo(this._appendTo()),"disabled"===t&&e&&this.xhr&&this.xhr.abort()},_isEventTargetInWidget:function(t){var e=this.menu.element[0];return t.target===this.element[0]||t.target===e||x.contains(e,t.target)},_closeOnClickOutside:function(t){this._isEventTargetInWidget(t)||this.close()},_appendTo:function(){var t=this.options.appendTo;return t=!(t=!(t=t&&(t.jquery||t.nodeType?x(t):this.document.find(t).eq(0)))||!t[0]?this.element.closest(".ui-front, dialog"):t).length?this.document[0].body:t},_initSource:function(){var i,s,n=this;Array.isArray(this.options.source)?(i=this.options.source,this.source=function(t,e){e(x.ui.autocomplete.filter(i,t.term))}):"string"==typeof this.options.source?(s=this.options.source,this.source=function(t,e){n.xhr&&n.xhr.abort(),n.xhr=x.ajax({url:s,data:t,dataType:"json",success:function(t){e(t)},error:function(){e([])}})}):this.source=this.options.source},_searchTimeout:function(s){clearTimeout(this.searching),this.searching=this._delay(function(){var t=this.term===this._value(),e=this.menu.element.is(":visible"),i=s.altKey||s.ctrlKey||s.metaKey||s.shiftKey;t&&(e||i)||(this.selectedItem=null,this.search(null,s))},this.options.delay)},search:function(t,e){return t=null!=t?t:this._value(),this.term=this._value(),t.length
").append(x("").text(e.label)).appendTo(t)},_move:function(t,e){if(this.menu.element.is(":visible"))return this.menu.isFirstItem()&&/^previous/.test(t)||this.menu.isLastItem()&&/^next/.test(t)?(this.isMultiLine||this._value(this.term),void this.menu.blur()):void this.menu[t](e);this.search(null,e)},widget:function(){return this.menu.element},_value:function(){return this.valueMethod.apply(this.element,arguments)},_keyEvent:function(t,e){this.isMultiLine&&!this.menu.element.is(":visible")||(this._move(t,e),e.preventDefault())},_isContentEditable:function(t){if(!t.length)return!1;var e=t.prop("contentEditable");return"inherit"===e?this._isContentEditable(t.parent()):"true"===e}}),x.extend(x.ui.autocomplete,{escapeRegex:function(t){return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")},filter:function(t,e){var i=new RegExp(x.ui.autocomplete.escapeRegex(e),"i");return x.grep(t,function(t){return i.test(t.label||t.value||t)})}}),x.widget("ui.autocomplete",x.ui.autocomplete,{options:{messages:{noResults:"No search results.",results:function(t){return t+(1
").text(e))},100))}});x.ui.autocomplete});
\ No newline at end of file
+!function(t){"use strict";"function"==typeof define&&define.amd?define(["jquery"],t):t(jQuery)}(function(x){"use strict";x.ui=x.ui||{};x.ui.version="1.13.2";var n,i=0,l=Array.prototype.hasOwnProperty,a=Array.prototype.slice;x.cleanData=(n=x.cleanData,function(t){for(var e,i,s=0;null!=(i=t[s]);s++)(e=x._data(i,"events"))&&e.remove&&x(i).triggerHandler("remove");n(t)}),x.widget=function(t,i,e){var s,n,o,l={},a=t.split(".")[0],r=a+"-"+(t=t.split(".")[1]);return e||(e=i,i=x.Widget),Array.isArray(e)&&(e=x.extend.apply(null,[{}].concat(e))),x.expr.pseudos[r.toLowerCase()]=function(t){return!!x.data(t,r)},x[a]=x[a]||{},s=x[a][t],n=x[a][t]=function(t,e){if(!this||!this._createWidget)return new n(t,e);arguments.length&&this._createWidget(t,e)},x.extend(n,s,{version:e.version,_proto:x.extend({},e),_childConstructors:[]}),(o=new i).options=x.widget.extend({},o.options),x.each(e,function(e,s){function n(){return i.prototype[e].apply(this,arguments)}function o(t){return i.prototype[e].apply(this,t)}l[e]="function"==typeof s?function(){var t,e=this._super,i=this._superApply;return this._super=n,this._superApply=o,t=s.apply(this,arguments),this._super=e,this._superApply=i,t}:s}),n.prototype=x.widget.extend(o,{widgetEventPrefix:s&&o.widgetEventPrefix||t},l,{constructor:n,namespace:a,widgetName:t,widgetFullName:r}),s?(x.each(s._childConstructors,function(t,e){var i=e.prototype;x.widget(i.namespace+"."+i.widgetName,n,e._proto)}),delete s._childConstructors):i._childConstructors.push(n),x.widget.bridge(t,n),n},x.widget.extend=function(t){for(var e,i,s=a.call(arguments,1),n=0,o=s.length;n",options:{classes:{},disabled:!1,create:null},_createWidget:function(t,e){e=x(e||this.defaultElement||this)[0],this.element=x(e),this.uuid=i++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=x(),this.hoverable=x(),this.focusable=x(),this.classesElementLookup={},e!==this&&(x.data(e,this.widgetFullName,this),this._on(!0,this.element,{remove:function(t){t.target===e&&this.destroy()}}),this.document=x(e.style?e.ownerDocument:e.document||e),this.window=x(this.document[0].defaultView||this.document[0].parentWindow)),this.options=x.widget.extend({},this.options,this._getCreateOptions(),t),this._create(),this.options.disabled&&this._setOptionDisabled(this.options.disabled),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:function(){return{}},_getCreateEventData:x.noop,_create:x.noop,_init:x.noop,destroy:function(){var i=this;this._destroy(),x.each(this.classesElementLookup,function(t,e){i._removeClass(e,t)}),this.element.off(this.eventNamespace).removeData(this.widgetFullName),this.widget().off(this.eventNamespace).removeAttr("aria-disabled"),this.bindings.off(this.eventNamespace)},_destroy:x.noop,widget:function(){return this.element},option:function(t,e){var i,s,n,o=t;if(0===arguments.length)return x.widget.extend({},this.options);if("string"==typeof t)if(o={},t=(i=t.split(".")).shift(),i.length){for(s=o[t]=x.widget.extend({},this.options[t]),n=0;n "),i=e.children()[0];return x("body").append(e),t=i.offsetWidth,e.css("overflow","scroll"),t===(i=i.offsetWidth)&&(i=e[0].clientWidth),e.remove(),s=t-i},getScrollInfo:function(t){var e=t.isWindow||t.isDocument?"":t.element.css("overflow-x"),i=t.isWindow||t.isDocument?"":t.element.css("overflow-y"),e="scroll"===e||"auto"===e&&t.widthC(E(s),E(n))?o.important="horizontal":o.important="vertical",c.using.call(this,t,o)}),l.offset(x.extend(u,{using:t}))})},x.ui.position={fit:{left:function(t,e){var i=e.within,s=i.isWindow?i.scrollLeft:i.offset.left,n=i.width,o=t.left-e.collisionPosition.marginLeft,l=s-o,a=o+e.collisionWidth-n-s;e.collisionWidth>n?0n?0",delay:300,options:{icons:{submenu:"ui-icon-caret-1-e"},items:"> *",menus:"ul",position:{my:"left top",at:"right top"},role:"menu",blur:null,focus:null,select:null},_create:function(){this.activeMenu=this.element,this.mouseHandled=!1,this.lastMousePosition={x:null,y:null},this.element.uniqueId().attr({role:this.options.role,tabIndex:0}),this._addClass("ui-menu","ui-widget ui-widget-content"),this._on({"mousedown .ui-menu-item":function(t){t.preventDefault(),this._activateItem(t)},"click .ui-menu-item":function(t){var e=x(t.target),i=x(x.ui.safeActiveElement(this.document[0]));!this.mouseHandled&&e.not(".ui-state-disabled").length&&(this.select(t),t.isPropagationStopped()||(this.mouseHandled=!0),e.has(".ui-menu").length?this.expand(t):!this.element.is(":focus")&&i.closest(".ui-menu").length&&(this.element.trigger("focus",[!0]),this.active&&1===this.active.parents(".ui-menu").length&&clearTimeout(this.timer)))},"mouseenter .ui-menu-item":"_activateItem","mousemove .ui-menu-item":"_activateItem",mouseleave:"collapseAll","mouseleave .ui-menu":"collapseAll",focus:function(t,e){var i=this.active||this._menuItems().first();e||this.focus(t,i)},blur:function(t){this._delay(function(){x.contains(this.element[0],x.ui.safeActiveElement(this.document[0]))||this.collapseAll(t)})},keydown:"_keydown"}),this.refresh(),this._on(this.document,{click:function(t){this._closeOnDocumentClick(t)&&this.collapseAll(t,!0),this.mouseHandled=!1}})},_activateItem:function(t){var e,i;this.previousFilter||t.clientX===this.lastMousePosition.x&&t.clientY===this.lastMousePosition.y||(this.lastMousePosition={x:t.clientX,y:t.clientY},e=x(t.target).closest(".ui-menu-item"),i=x(t.currentTarget),e[0]===i[0]&&(i.is(".ui-state-active")||(this._removeClass(i.siblings().children(".ui-state-active"),null,"ui-state-active"),this.focus(t,i))))},_destroy:function(){var t=this.element.find(".ui-menu-item").removeAttr("role aria-disabled").children(".ui-menu-item-wrapper").removeUniqueId().removeAttr("tabIndex role aria-haspopup");this.element.removeAttr("aria-activedescendant").find(".ui-menu").addBack().removeAttr("role aria-labelledby aria-expanded aria-hidden aria-disabled tabIndex").removeUniqueId().show(),t.children().each(function(){var t=x(this);t.data("ui-menu-submenu-caret")&&t.remove()})},_keydown:function(t){var e,i,s,n=!0;switch(t.keyCode){case x.ui.keyCode.PAGE_UP:this.previousPage(t);break;case x.ui.keyCode.PAGE_DOWN:this.nextPage(t);break;case x.ui.keyCode.HOME:this._move("first","first",t);break;case x.ui.keyCode.END:this._move("last","last",t);break;case x.ui.keyCode.UP:this.previous(t);break;case x.ui.keyCode.DOWN:this.next(t);break;case x.ui.keyCode.LEFT:this.collapse(t);break;case x.ui.keyCode.RIGHT:this.active&&!this.active.is(".ui-state-disabled")&&this.expand(t);break;case x.ui.keyCode.ENTER:case x.ui.keyCode.SPACE:this._activate(t);break;case x.ui.keyCode.ESCAPE:this.collapse(t);break;default:e=this.previousFilter||"",s=n=!1,i=96<=t.keyCode&&t.keyCode<=105?(t.keyCode-96).toString():String.fromCharCode(t.keyCode),clearTimeout(this.filterTimer),i===e?s=!0:i=e+i,e=this._filterMenuItems(i),(e=s&&-1!==e.index(this.active.next())?this.active.nextAll(".ui-menu-item"):e).length||(i=String.fromCharCode(t.keyCode),e=this._filterMenuItems(i)),e.length?(this.focus(t,e),this.previousFilter=i,this.filterTimer=this._delay(function(){delete this.previousFilter},1e3)):delete this.previousFilter}n&&t.preventDefault()},_activate:function(t){this.active&&!this.active.is(".ui-state-disabled")&&(this.active.children("[aria-haspopup='true']").length?this.expand(t):this.select(t))},refresh:function(){var t,e,s=this,n=this.options.icons.submenu,i=this.element.find(this.options.menus);this._toggleClass("ui-menu-icons",null,!!this.element.find(".ui-icon").length),e=i.filter(":not(.ui-menu)").hide().attr({role:this.options.role,"aria-hidden":"true","aria-expanded":"false"}).each(function(){var t=x(this),e=t.prev(),i=x("").data("ui-menu-submenu-caret",!0);s._addClass(i,"ui-menu-icon","ui-icon "+n),e.attr("aria-haspopup","true").prepend(i),t.attr("aria-labelledby",e.attr("id"))}),this._addClass(e,"ui-menu","ui-widget ui-widget-content ui-front"),(t=i.add(this.element).find(this.options.items)).not(".ui-menu-item").each(function(){var t=x(this);s._isDivider(t)&&s._addClass(t,"ui-menu-divider","ui-widget-content")}),i=(e=t.not(".ui-menu-item, .ui-menu-divider")).children().not(".ui-menu").uniqueId().attr({tabIndex:-1,role:this._itemRole()}),this._addClass(e,"ui-menu-item")._addClass(i,"ui-menu-item-wrapper"),t.filter(".ui-state-disabled").attr("aria-disabled","true"),this.active&&!x.contains(this.element[0],this.active[0])&&this.blur()},_itemRole:function(){return{menu:"menuitem",listbox:"option"}[this.options.role]},_setOption:function(t,e){var i;"icons"===t&&(i=this.element.find(".ui-menu-icon"),this._removeClass(i,null,this.options.icons.submenu)._addClass(i,null,e.submenu)),this._super(t,e)},_setOptionDisabled:function(t){this._super(t),this.element.attr("aria-disabled",String(t)),this._toggleClass(null,"ui-state-disabled",!!t)},focus:function(t,e){var i;this.blur(t,t&&"focus"===t.type),this._scrollIntoView(e),this.active=e.first(),i=this.active.children(".ui-menu-item-wrapper"),this._addClass(i,null,"ui-state-active"),this.options.role&&this.element.attr("aria-activedescendant",i.attr("id")),i=this.active.parent().closest(".ui-menu-item").children(".ui-menu-item-wrapper"),this._addClass(i,null,"ui-state-active"),t&&"keydown"===t.type?this._close():this.timer=this._delay(function(){this._close()},this.delay),(i=e.children(".ui-menu")).length&&t&&/^mouse/.test(t.type)&&this._startOpening(i),this.activeMenu=e.parent(),this._trigger("focus",t,{item:e})},_scrollIntoView:function(t){var e,i,s;this._hasScroll()&&(i=parseFloat(x.css(this.activeMenu[0],"borderTopWidth"))||0,s=parseFloat(x.css(this.activeMenu[0],"paddingTop"))||0,e=t.offset().top-this.activeMenu.offset().top-i-s,i=this.activeMenu.scrollTop(),s=this.activeMenu.height(),t=t.outerHeight(),e<0?this.activeMenu.scrollTop(i+e):s",options:{appendTo:null,autoFocus:!1,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null,change:null,close:null,focus:null,open:null,response:null,search:null,select:null},requestIndex:0,pending:0,liveRegionTimer:null,_create:function(){var i,s,n,t=this.element[0].nodeName.toLowerCase(),e="textarea"===t,t="input"===t;this.isMultiLine=e||!t&&this._isContentEditable(this.element),this.valueMethod=this.element[e||t?"val":"text"],this.isNewMenu=!0,this._addClass("ui-autocomplete-input"),this.element.attr("autocomplete","off"),this._on(this.element,{keydown:function(t){if(this.element.prop("readOnly"))s=n=i=!0;else{s=n=i=!1;var e=x.ui.keyCode;switch(t.keyCode){case e.PAGE_UP:i=!0,this._move("previousPage",t);break;case e.PAGE_DOWN:i=!0,this._move("nextPage",t);break;case e.UP:i=!0,this._keyEvent("previous",t);break;case e.DOWN:i=!0,this._keyEvent("next",t);break;case e.ENTER:this.menu.active&&(i=!0,t.preventDefault(),this.menu.select(t));break;case e.TAB:this.menu.active&&this.menu.select(t);break;case e.ESCAPE:this.menu.element.is(":visible")&&(this.isMultiLine||this._value(this.term),this.close(t),t.preventDefault());break;default:s=!0,this._searchTimeout(t)}}},keypress:function(t){if(i)return i=!1,void(this.isMultiLine&&!this.menu.element.is(":visible")||t.preventDefault());if(!s){var e=x.ui.keyCode;switch(t.keyCode){case e.PAGE_UP:this._move("previousPage",t);break;case e.PAGE_DOWN:this._move("nextPage",t);break;case e.UP:this._keyEvent("previous",t);break;case e.DOWN:this._keyEvent("next",t)}}},input:function(t){if(n)return n=!1,void t.preventDefault();this._searchTimeout(t)},focus:function(){this.selectedItem=null,this.previous=this._value()},blur:function(t){clearTimeout(this.searching),this.close(t),this._change(t)}}),this._initSource(),this.menu=x("").appendTo(this._appendTo()).menu({role:null}).hide().attr({unselectable:"on"}).menu("instance"),this._addClass(this.menu.element,"ui-autocomplete","ui-front"),this._on(this.menu.element,{mousedown:function(t){t.preventDefault()},menufocus:function(t,e){var i,s;if(this.isNewMenu&&(this.isNewMenu=!1,t.originalEvent&&/^mouse/.test(t.originalEvent.type)))return this.menu.blur(),void this.document.one("mousemove",function(){x(t.target).trigger(t.originalEvent)});s=e.item.data("ui-autocomplete-item"),!1!==this._trigger("focus",t,{item:s})&&t.originalEvent&&/^key/.test(t.originalEvent.type)&&this._value(s.value),(i=e.item.attr("aria-label")||s.value)&&String.prototype.trim.call(i).length&&(clearTimeout(this.liveRegionTimer),this.liveRegionTimer=this._delay(function(){this.liveRegion.html(x("").text(i))},100))},menuselect:function(t,e){var i=e.item.data("ui-autocomplete-item"),s=this.previous;this.element[0]!==x.ui.safeActiveElement(this.document[0])&&(this.element.trigger("focus"),this.previous=s,this._delay(function(){this.previous=s,this.selectedItem=i})),!1!==this._trigger("select",t,{item:i})&&this._value(i.value),this.term=this._value(),this.close(t),this.selectedItem=i}}),this.liveRegion=x("
",{role:"status","aria-live":"assertive","aria-relevant":"additions"}).appendTo(this.document[0].body),this._addClass(this.liveRegion,null,"ui-helper-hidden-accessible"),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_destroy:function(){clearTimeout(this.searching),this.element.removeAttr("autocomplete"),this.menu.element.remove(),this.liveRegion.remove()},_setOption:function(t,e){this._super(t,e),"source"===t&&this._initSource(),"appendTo"===t&&this.menu.element.appendTo(this._appendTo()),"disabled"===t&&e&&this.xhr&&this.xhr.abort()},_isEventTargetInWidget:function(t){var e=this.menu.element[0];return t.target===this.element[0]||t.target===e||x.contains(e,t.target)},_closeOnClickOutside:function(t){this._isEventTargetInWidget(t)||this.close()},_appendTo:function(){var t=this.options.appendTo;return t=!(t=!(t=t&&(t.jquery||t.nodeType?x(t):this.document.find(t).eq(0)))||!t[0]?this.element.closest(".ui-front, dialog"):t).length?this.document[0].body:t},_initSource:function(){var i,s,n=this;Array.isArray(this.options.source)?(i=this.options.source,this.source=function(t,e){e(x.ui.autocomplete.filter(i,t.term))}):"string"==typeof this.options.source?(s=this.options.source,this.source=function(t,e){n.xhr&&n.xhr.abort(),n.xhr=x.ajax({url:s,data:t,dataType:"json",success:function(t){e(t)},error:function(){e([])}})}):this.source=this.options.source},_searchTimeout:function(s){clearTimeout(this.searching),this.searching=this._delay(function(){var t=this.term===this._value(),e=this.menu.element.is(":visible"),i=s.altKey||s.ctrlKey||s.metaKey||s.shiftKey;t&&(e||i)||(this.selectedItem=null,this.search(null,s))},this.options.delay)},search:function(t,e){return t=null!=t?t:this._value(),this.term=this._value(),t.length
").append(x("").text(e.label)).appendTo(t)},_move:function(t,e){if(this.menu.element.is(":visible"))return this.menu.isFirstItem()&&/^previous/.test(t)||this.menu.isLastItem()&&/^next/.test(t)?(this.isMultiLine||this._value(this.term),void this.menu.blur()):void this.menu[t](e);this.search(null,e)},widget:function(){return this.menu.element},_value:function(){return this.valueMethod.apply(this.element,arguments)},_keyEvent:function(t,e){this.isMultiLine&&!this.menu.element.is(":visible")||(this._move(t,e),e.preventDefault())},_isContentEditable:function(t){if(!t.length)return!1;var e=t.prop("contentEditable");return"inherit"===e?this._isContentEditable(t.parent()):"true"===e}}),x.extend(x.ui.autocomplete,{escapeRegex:function(t){return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")},filter:function(t,e){var i=new RegExp(x.ui.autocomplete.escapeRegex(e),"i");return x.grep(t,function(t){return i.test(t.label||t.value||t)})}}),x.widget("ui.autocomplete",x.ui.autocomplete,{options:{messages:{noResults:"No search results.",results:function(t){return t+(1
").text(e))},100))}});x.ui.autocomplete});
\ No newline at end of file
diff --git a/zello-sdk-sample-contacts/libs/zello-sdk.aar b/zello-sdk-sample-contacts/libs/zello-sdk.aar
index 1afa132..7e782e1 100644
Binary files a/zello-sdk-sample-contacts/libs/zello-sdk.aar and b/zello-sdk-sample-contacts/libs/zello-sdk.aar differ
diff --git a/zello-sdk-sample-contacts/src/main/java/com/zello/sdk/sample/contacts/ContactsActivity.java b/zello-sdk-sample-contacts/src/main/java/com/zello/sdk/sample/contacts/ContactsActivity.java
index 1a6b315..49bae1e 100644
--- a/zello-sdk-sample-contacts/src/main/java/com/zello/sdk/sample/contacts/ContactsActivity.java
+++ b/zello-sdk-sample-contacts/src/main/java/com/zello/sdk/sample/contacts/ContactsActivity.java
@@ -200,6 +200,10 @@ public void onBluetoothAccessoryStateChanged(
) {
}
+ @Override
+ public void onForegroundServiceStartFailed(@Nullable Throwable throwable) {
+ }
+
//endregion
@SuppressWarnings("SameParameterValue")
diff --git a/zello-sdk-sample-misc/libs/zello-sdk.aar b/zello-sdk-sample-misc/libs/zello-sdk.aar
index 1afa132..7e782e1 100644
Binary files a/zello-sdk-sample-misc/libs/zello-sdk.aar and b/zello-sdk-sample-misc/libs/zello-sdk.aar differ
diff --git a/zello-sdk-sample-misc/src/main/java/com/zello/sdk/sample/misc/MiscActivity.java b/zello-sdk-sample-misc/src/main/java/com/zello/sdk/sample/misc/MiscActivity.java
index 0de6af3..03e2b22 100644
--- a/zello-sdk-sample-misc/src/main/java/com/zello/sdk/sample/misc/MiscActivity.java
+++ b/zello-sdk-sample-misc/src/main/java/com/zello/sdk/sample/misc/MiscActivity.java
@@ -219,6 +219,10 @@ public void onBluetoothAccessoryStateChanged(
) {
}
+ @Override
+ public void onForegroundServiceStartFailed(@Nullable Throwable throwable) {
+ }
+
//endregion
private void showMenuItem(Menu menu, int itemId, boolean show) {
diff --git a/zello-sdk-sample-ptt/libs/zello-sdk.aar b/zello-sdk-sample-ptt/libs/zello-sdk.aar
index 1afa132..7e782e1 100644
Binary files a/zello-sdk-sample-ptt/libs/zello-sdk.aar and b/zello-sdk-sample-ptt/libs/zello-sdk.aar differ
diff --git a/zello-sdk-sample-ptt/src/main/java/com/zello/sdk/sample/ptt/PttActivity.java b/zello-sdk-sample-ptt/src/main/java/com/zello/sdk/sample/ptt/PttActivity.java
index 9edf57d..bcb8dee 100644
--- a/zello-sdk-sample-ptt/src/main/java/com/zello/sdk/sample/ptt/PttActivity.java
+++ b/zello-sdk-sample-ptt/src/main/java/com/zello/sdk/sample/ptt/PttActivity.java
@@ -256,6 +256,10 @@ public void onBluetoothAccessoryStateChanged(
) {
}
+ @Override
+ public void onForegroundServiceStartFailed(@Nullable Throwable throwable) {
+ }
+
//endregion
private void updateUI() {
diff --git a/zello-sdk-sample-signin/libs/zello-sdk.aar b/zello-sdk-sample-signin/libs/zello-sdk.aar
index 1afa132..7e782e1 100644
Binary files a/zello-sdk-sample-signin/libs/zello-sdk.aar and b/zello-sdk-sample-signin/libs/zello-sdk.aar differ
diff --git a/zello-sdk-sample-signin/src/main/java/com/zello/sdk/sample/signin/SigninActivity.java b/zello-sdk-sample-signin/src/main/java/com/zello/sdk/sample/signin/SigninActivity.java
index aff1c66..b235ac3 100644
--- a/zello-sdk-sample-signin/src/main/java/com/zello/sdk/sample/signin/SigninActivity.java
+++ b/zello-sdk-sample-signin/src/main/java/com/zello/sdk/sample/signin/SigninActivity.java
@@ -143,6 +143,10 @@ public void onBluetoothAccessoryStateChanged(
) {
}
+ @Override
+ public void onForegroundServiceStartFailed(@Nullable Throwable throwable) {
+ }
+
//endregion
private void updateUI() {
diff --git a/zello-sdk-sample/libs/zello-sdk.aar b/zello-sdk-sample/libs/zello-sdk.aar
index 1afa132..7e782e1 100644
Binary files a/zello-sdk-sample/libs/zello-sdk.aar and b/zello-sdk-sample/libs/zello-sdk.aar differ
diff --git a/zello-sdk-sample/src/main/java/com/zello/sdk/sample/TalkActivity.java b/zello-sdk-sample/src/main/java/com/zello/sdk/sample/TalkActivity.java
index 7b538e1..c4319d4 100644
--- a/zello-sdk-sample/src/main/java/com/zello/sdk/sample/TalkActivity.java
+++ b/zello-sdk-sample/src/main/java/com/zello/sdk/sample/TalkActivity.java
@@ -448,6 +448,9 @@ public void onMicrophonePermissionNotGranted() {
}
}
+ @Override
+ public void onForegroundServiceStartFailed(@Nullable Throwable throwable) {}
+
@Override
public void onBluetoothAccessoryStateChanged(
@NonNull BluetoothAccessoryType bluetoothAccessoryType,
diff --git a/zello-sdk.aar b/zello-sdk.aar
index 1afa132..7e782e1 100644
Binary files a/zello-sdk.aar and b/zello-sdk.aar differ
diff --git a/zello-sdk/build.gradle b/zello-sdk/build.gradle
index 4fd45e8..24944a4 100644
--- a/zello-sdk/build.gradle
+++ b/zello-sdk/build.gradle
@@ -149,7 +149,7 @@ android {
buildConfig true
}
- ext.sdkVersion = "5.33.3"
+ ext.sdkVersion = "5.40.1"
defaultConfig {
minSdk 24
diff --git a/zello-sdk/src/main/java/com/zello/sdk/Events.java b/zello-sdk/src/main/java/com/zello/sdk/Events.java
index cfde0e5..7b02cf2 100644
--- a/zello-sdk/src/main/java/com/zello/sdk/Events.java
+++ b/zello-sdk/src/main/java/com/zello/sdk/Events.java
@@ -1,6 +1,7 @@
package com.zello.sdk;
import android.app.Activity;
+import android.content.Context;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
@@ -138,4 +139,28 @@ void onBluetoothAccessoryStateChanged(
@NonNull BluetoothAccessoryType type, @NonNull BluetoothAccessoryState state,
@Nullable String name, @Nullable String description);
+ /**
+ *
+ * Called when an attempt to start the Zello foreground service fails.
+ *
+ *
+ * This method is invoked on the UI thread.
+ *
+ *
+ * It is the responsibility of the app using the SDK to determine if and how to handle this error.
+ * The most likely cause is that the app connecting to Zello was not displaying any UI at the
+ * time when the foreground service was started. In this case, the implementing app may call
+ * {@link Zello#unconfigure()} followed by {@link Zello#configure(Context)}
+ * (or one of its overloads) once its UI is in the foreground to attempt to start the foreground
+ * service again.
+ *
+ *
+ * In Android 14 and above, requirements for foreground services have become stricter. For
+ * the most up-to-date information, please refer to the Android documentation.
+ *
+ *
+ * @param t The exception that caused the failure if available.
+ */
+ void onForegroundServiceStartFailed(@Nullable Throwable t);
+
}
diff --git a/zello-sdk/src/main/java/com/zello/sdk/PermissionError.java b/zello-sdk/src/main/java/com/zello/sdk/PermissionError.java
index b4f99a0..74fbd1f 100644
--- a/zello-sdk/src/main/java/com/zello/sdk/PermissionError.java
+++ b/zello-sdk/src/main/java/com/zello/sdk/PermissionError.java
@@ -12,13 +12,18 @@ public enum PermissionError {
NONE,
/**
- * Unknown perimssion error.
+ * Unknown permission error.
*/
UNKNOWN,
/**
* Microphone permission error.
*/
- MICROPHONE_NOT_GRANTED
+ MICROPHONE_NOT_GRANTED,
+
+ /**
+ * Foreground service cannot start.
+ */
+ FOREGROUND_SERVICE_NOT_ALLOWED
}
diff --git a/zello-sdk/src/main/java/com/zello/sdk/Sdk.java b/zello-sdk/src/main/java/com/zello/sdk/Sdk.java
index e762888..1f3f75e 100644
--- a/zello-sdk/src/main/java/com/zello/sdk/Sdk.java
+++ b/zello-sdk/src/main/java/com/zello/sdk/Sdk.java
@@ -348,6 +348,8 @@ boolean signIn(@Nullable String network, @Nullable String username, @Nullable St
} catch (Throwable t) {
// Caller may not be in the right state to start a service
Log.INSTANCE.e("Failed to start " + connectedPackage + " service", t);
+ handleForegroundServiceException(t);
+ return false;
}
}
return true;
@@ -686,6 +688,7 @@ public void onServiceConnected(@Nullable ComponentName name, @Nullable IBinder s
// Caller may not be in the right state to start a service
String componentPackageName = name != null ? name.getPackageName() : null;
Log.INSTANCE.e("Failed to start " + componentPackageName + " service", t);
+ handleForegroundServiceException(t);
}
}
if (_delayedShowBtAccessoriesNotifications != null) {
@@ -1203,6 +1206,16 @@ private void handlePermissionError(@Nullable Intent intent) {
for (Events event : Zello.getInstance().events) {
event.onMicrophonePermissionNotGranted();
}
+ } else if (error == PermissionError.FOREGROUND_SERVICE_NOT_ALLOWED) {
+ for (Events event : Zello.getInstance().events) {
+ event.onForegroundServiceStartFailed(null);
+ }
+ }
+ }
+
+ private void handleForegroundServiceException(@Nullable Throwable t) {
+ for (Events event : Zello.getInstance().events) {
+ event.onForegroundServiceStartFailed(t);
}
}
@@ -1294,6 +1307,8 @@ private void fireAppStateChanged() {
return PermissionError.MICROPHONE_NOT_GRANTED;
} else if (error == PermissionError.NONE.ordinal()) {
return PermissionError.NONE;
+ } else if (error == PermissionError.FOREGROUND_SERVICE_NOT_ALLOWED.ordinal()) {
+ return PermissionError.FOREGROUND_SERVICE_NOT_ALLOWED;
} else {
return PermissionError.UNKNOWN;
}