Android Question Widget with API 26

Cebuvi

Active Member
Licensed User
Longtime User
Hello

I have verified that with API 26 the widgets of my application do not update and stop responding.

Will this be solved with the new version of B4A?

Thanks.

César
 

Cebuvi

Active Member
Licensed User
Longtime User
Thanks for the quick reply.

I checked it when my phone was updated to Android Oreo. Now I will test with an ADL and send you the logs.
 
Upvote 0

DavideV

Active Member
Licensed User
Longtime User
...i have the same problem on nexus 5x oreo 8,1.
widgets work fine with target sdk 25 while crash with ANR when target sdk is set to 26
 
Upvote 0

Cebuvi

Active Member
Licensed User
Longtime User
Hi,

This is the text of the log after several clicks to update and open the app.

Background start not allowed: service Intent { flg=0x10000000 cmp=com.tempusumbra.solarwidget/.solarw4x2 bnds=[528,943][912,1072] (has extras) } to com.tempusumbra.solarwidget/.solarw4x2 from pid=-1 uid=10081 pkg=com.tempusumbra.solarwidget
mixer(0xe7303c40) throttle end: throttle time(4)
Error while writing data to HAL: -32
uid=1041(audioserver) FastMixer identical 70 lines
Error while writing data to HAL: -32
Couldn't load memtrack module
failed to get memory consumption info: -1
Background start not allowed: service Intent { flg=0x10000000 cmp=com.tempusumbra.solarwidget/.solarw4x2 bnds=[528,943][912,1072] (has extras) } to com.tempusumbra.solarwidget/.solarw4x2 from pid=-1 uid=10081 pkg=com.tempusumbra.solarwidget
Error while writing data to HAL: -32
uid=1041(audioserver) FastMixer identical 30 lines
Error while writing data to HAL: -32
OmtpVvmCarrierCfgHlpr - OmtpEvent:CONFIG_STATUS_SMS_TIME_OUT
RetryPolicy - discarding deferred status: configuration_state=4
VvmTaskExecutor - no more tasks, stopping service if no task are added in 5000 millis
VvmTaskReceiver - task received
VvmTaskReceiver - TaskExecutor already running
Task.createTask - create task:com.android.voicemail.impl.ActivationTask
RetryPolicy - retry #3 for com.android.voicemail.impl.ActivationTask@566291e queued, executing in 5000
VvmTaskExecutor - com.android.voicemail.impl.ActivationTask@566291e added
VvmTaskExecutor - minimal wait time:5000
VvmTaskExecutor - sleep for 5000 millis
Error while writing data to HAL: -32
uid=1041(audioserver) FastMixer identical 38 lines
Error while writing data to HAL: -32
VvmTaskExecutor - executing task com.android.voicemail.impl.ActivationTask@566291e
PreOMigrationHandler - ComponentInfo{com.android.phone/com.android.services.telephony.TelephonyConnectionService}, [e2f7d48dd2b5ca523e7313cf4ba0f6ea830b6281], UserHandle{0} already migrated
Couldn't load memtrack module
failed to get memory consumption info: -1
VvmActivationTask - VVM content provider configured - vvm_type_cvvm
OmtpVvmCarrierCfgHlpr - OmtpEvent:CONFIG_ACTIVATING
TelephonyMangerCompat.setVisualVoicemailSmsFilterSettings - using TelephonyManager
TelephonyMangerCompat.sendVisualVoicemailSms - using TelephonyManager
type=1400 audit(0.0:1086): avc: denied { lock } for path="/data/user_de/0/com.android.providers.telephony/databases/telephony.db" dev="sdb3" ino=81796 scontext=u:r:radio:s0 tcontext=u:eek:bject_r:system_data_file:s0 tclass=file permissive=1
newsms
sender:(N/A)
receiver:122
Background start not allowed: service Intent { flg=0x10000000 cmp=com.tempusumbra.solarwidget/.solarw4x2 bnds=[1232,624][1352,744] (has extras) } to com.tempusumbra.solarwidget/.solarw4x2 from pid=-1 uid=10081 pkg=com.tempusumbra.solarwidget
Error while writing data to HAL: -32
index:1/1
txt:'FQKf.Σ:etΔ#W'
binder thread pool (1 threads) starved for 4800 ms
Error while writing data to HAL: -32
uid=1041(audioserver) FastMixer identical 19 lines
Error while writing data to HAL: -32
type=1400 audit(0.0:1087): avc: denied { read } for path="socket:[8647]" dev="sockfs" ino=8647 scontext=u:r:logd:s0 tcontext=u:r:init:s0 tclass=unix_stream_socket permissive=1

Thanks.
 
Upvote 0

DavideV

Active Member
Licensed User
Longtime User
This is mine:
B4X:
Logger connected to:  LGE Nexus 5X
--------- beginning of main
Bridge logger not enabled.
*** Service (starter) Create ***
LS> language initialized to: it
No Network Security Config specified, using platform default
** Service (starter) Start **
** Service (widgethandler) Create **
** Service (widgethandler) Start **
** Service (widgethandler) Start **
** Service (widgethandler) Start **
Shutting down VM
--------- beginning of crash
FATAL EXCEPTION: main
Process: it.davidev.widget.powerbuttons, PID: 6685
java.lang.RuntimeException: Unable to start receiver it.davidev.widget.powerbuttons.widgethandler$widgethandler_BR: java.lang.IllegalStateException: Not allowed to start service Intent { cmp=it.davidev.widget.powerbuttons/.widgethandler (has extras) }: app is in background uid UidRecord{15550a6 u0a110 RCVR idle change:uncached procs:1 seq(0,0,0)}
    at android.app.ActivityThread.handleReceiver(ActivityThread.java:3194)
    at android.app.ActivityThread.-wrap17(Unknown Source:0)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1672)
    at android.os.Handler.dispatchMessage(Handler.java:106)
    at android.os.Looper.loop(Looper.java:164)
    at android.app.ActivityThread.main(ActivityThread.java:6494)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
Caused by: java.lang.IllegalStateException: Not allowed to start service Intent { cmp=it.davidev.widget.powerbuttons/.widgethandler (has extras) }: app is in background uid UidRecord{15550a6 u0a110 RCVR idle change:uncached procs:1 seq(0,0,0)}
    at android.app.ContextImpl.startServiceCommon(ContextImpl.java:1521)
    at android.app.ContextImpl.startService(ContextImpl.java:1477)
    at android.content.ContextWrapper.startService(ContextWrapper.java:650)
    at android.content.ContextWrapper.startService(ContextWrapper.java:650)
    at it.davidev.widget.powerbuttons.widgethandler$widgethandler_BR.onReceive(widgethandler.java:16)
    at android.app.ActivityThread.handleReceiver(ActivityThread.java:3187)
    ... 8 more
Starting remote logger. Port: 58577
HWUI GL Pipeline
*** Service (starter) Create ***
LS> language initialized to: it
No Network Security Config specified, using platform default
** Service (starter) Start **
QUALCOMM build                   : 8e59954, I0be83d0d26
Build Date                       : 09/22/17
OpenGL ES Shader Compiler Version: EV031.21.02.00
Local Branch                     : O17A
Remote Branch                    :
Remote Branch                    :
Reconstruct Branch               :
Loading /vendor/lib64/hw/gralloc.msm8992.so from current namespace instead of sphal namespace.
PFP: 0x00000000, ME: 0x00000000
** Activity (main) Create, isFirst = true **
android::hardware::configstore::V1_0::ISurfaceFlingerConfigs::hasWideColorDisplay retrieved: 0
Initialized EGL, version 1.4
Swap behavior 2
** Activity (main) Resume **
LS> Root present: 0
Loading /vendor/lib64/hw/android.hardware.graphics.mapper@2.0-impl.so from current namespace instead of sphal namespace.
Loading /vendor/lib64/hw/gralloc.msm8992.so from current namespace instead of sphal namespace.
RootAvailable ended
Main> RootCheck result: 0
Deoptimizing void anywheresoftware.b4a.objects.ViewWrapper.innerInitialize(anywheresoftware.b4a.BA, java.lang.String, boolean) due to JIT inline cache
After accept
Do partial code cache collection, code=30KB, data=29KB
After code cache collection, code=27KB, data=27KB
Increasing code cache capacity to 128KB
** Activity (main) Pause, UserClosed = true **
--------- beginning of system
Cancelling event due to no window focus: KeyEvent { action=ACTION_UP, keyCode=KEYCODE_BACK, scanCode=0, metaState=0, flags=0x68, repeatCount=0, eventTime=830030, downTime=829964, deviceId=-1, source=0x101 }
uid=10110(it.davidev.widget.powerbuttons) identical 4 lines
Cancelling event due to no window focus: KeyEvent { action=ACTION_UP, keyCode=KEYCODE_BACK, scanCode=0, metaState=0, flags=0x68, repeatCount=0, eventTime=830030, downTime=829964, deviceId=-1, source=0x101 }
Log reader error: java.io.InterruptedIOException: read interrupted
-1 received
writer error
java.lang.InterruptedException
    at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.reportInterruptAfterWait(AbstractQueuedSynchronizer.java:2034)
    at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2068)
    at java.util.concurrent.ArrayBlockingQueue.take(ArrayBlockingQueue.java:387)
    at anywheresoftware.b4a.remotelogger.Connector$Writer.run(Connector.java:160)
    at java.lang.Thread.run(Thread.java:764)
java.io.IOException: shutdown failed: ENOTCONN (Transport endpoint is not connected)
    at java.net.PlainSocketImpl.socketShutdown(PlainSocketImpl.java:267)
    at java.net.AbstractPlainSocketImpl.shutdownInput(AbstractPlainSocketImpl.java:582)
    at java.net.Socket.shutdownInput(Socket.java:1565)
    at anywheresoftware.b4a.remotelogger.Connector.mainLoop(Connector.java:105)
    at anywheresoftware.b4a.remotelogger.Connector.run(Connector.java:53)
    at java.lang.Thread.run(Thread.java:764)
Caused by: android.system.ErrnoException: shutdown failed: ENOTCONN (Transport endpoint is not connected)
    at libcore.io.Linux.shutdown(Native Method)
    at libcore.io.ForwardingOs.shutdown(ForwardingOs.java:178)
    at java.net.PlainSocketImpl.socketShutdown(PlainSocketImpl.java:265)
    ... 5 more
Starting remote logger. Port: 58577
After accept
 
Upvote 0

DavideV

Active Member
Licensed User
Longtime User
This is another widget, same problem:

B4X:
Logger connected to:  LGE Nexus 5X
--------- beginning of main
Shutting down VM
--------- beginning of crash
FATAL EXCEPTION: main
Process: it.davidev.widget.smileysbattery, PID: 7313
java.lang.RuntimeException: Unable to start receiver it.davidev.widget.smileysbattery.smileyswidget2x1$smileyswidget2x1_BR: java.lang.IllegalStateException: Not allowed to start service Intent { cmp=it.davidev.widget.smileysbattery/.smileyswidget2x1 (has extras) }: app is in background uid UidRecord{98f5acf u0a95 RCVR idle change:uncached procs:1 seq(0,0,0)}
    at android.app.ActivityThread.handleReceiver(ActivityThread.java:3194)
    at android.app.ActivityThread.-wrap17(Unknown Source:0)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1672)
    at android.os.Handler.dispatchMessage(Handler.java:106)
    at android.os.Looper.loop(Looper.java:164)
    at android.app.ActivityThread.main(ActivityThread.java:6494)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
Caused by: java.lang.IllegalStateException: Not allowed to start service Intent { cmp=it.davidev.widget.smileysbattery/.smileyswidget2x1 (has extras) }: app is in background uid UidRecord{98f5acf u0a95 RCVR idle change:uncached procs:1 seq(0,0,0)}
    at android.app.ContextImpl.startServiceCommon(ContextImpl.java:1521)
    at android.app.ContextImpl.startService(ContextImpl.java:1477)
    at android.content.ContextWrapper.startService(ContextWrapper.java:650)
    at android.content.ContextWrapper.startService(ContextWrapper.java:650)
    at it.davidev.widget.smileysbattery.smileyswidget2x1$smileyswidget2x1_BR.onReceive(smileyswidget2x1.java:16)
    at android.app.ActivityThread.handleReceiver(ActivityThread.java:3187)
    ... 8 more
Shutting down VM
FATAL EXCEPTION: main
Process: it.davidev.widget.smileysbattery, PID: 7436
java.lang.RuntimeException: Unable to start receiver it.davidev.widget.smileysbattery.smileyswidget2x1$smileyswidget2x1_BR: java.lang.IllegalStateException: Not allowed to start service Intent { cmp=it.davidev.widget.smileysbattery/.smileyswidget2x1 (has extras) }: app is in background uid UidRecord{7bd83c7 u0a95 RCVR idle change:idle|uncached procs:1 seq(0,0,0)}
    at android.app.ActivityThread.handleReceiver(ActivityThread.java:3194)
    at android.app.ActivityThread.-wrap17(Unknown Source:0)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1672)
    at android.os.Handler.dispatchMessage(Handler.java:106)
    at android.os.Looper.loop(Looper.java:164)
    at android.app.ActivityThread.main(ActivityThread.java:6494)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
Caused by: java.lang.IllegalStateException: Not allowed to start service Intent { cmp=it.davidev.widget.smileysbattery/.smileyswidget2x1 (has extras) }: app is in background uid UidRecord{7bd83c7 u0a95 RCVR idle change:idle|uncached procs:1 seq(0,0,0)}
    at android.app.ContextImpl.startServiceCommon(ContextImpl.java:1521)
    at android.app.ContextImpl.startService(ContextImpl.java:1477)
    at android.content.ContextWrapper.startService(ContextWrapper.java:650)
    at android.content.ContextWrapper.startService(ContextWrapper.java:650)
    at it.davidev.widget.smileysbattery.smileyswidget2x1$smileyswidget2x1_BR.onReceive(smileyswidget2x1.java:16)
    at android.app.ActivityThread.handleReceiver(ActivityThread.java:3187)
    ... 8 more
Starting remote logger. Port: 13412
*** Service (starter) Create ***
** Service (starter) Start **
** Service (smileyswidget2x1) Create **
SBW> language initialized to: it
** Service (smileyswidget2x1) Start **
After accept
 
Upvote 0

Star-Dust

Expert
Licensed User
Longtime User
I have the same problem too.
Already in the past the starter service created problems with Android 7 and later the DropBox library.

Now they start only once as soon as I install the App and then it does not start anymore.
If the App is started in the background, it does not even enter the widget
 
Last edited:
Upvote 0

Star-Dust

Expert
Licensed User
Longtime User
This is a simple example.

The widget starts only if the App is started or in backgroumd.
If you kill the App and call the widget nothing happens anymore
 

Attachments

  • widget8.zip
    11.2 KB · Views: 350
Upvote 0

Star-Dust

Expert
Licensed User
Longtime User
Is it possible now with B4A7.30 to request some permission to unlock the widget?
Many Google users who use our Apps send us continuous reports.
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
I guess no; you need to wait for V8 to be released and use this Version then.
 
Upvote 0

Star-Dust

Expert
Licensed User
Longtime User
:(
 
Upvote 0

Star-Dust

Expert
Licensed User
Longtime User
Yes, it works. But I have already published with the Target version 26. Google sent me a message at the time of publication that I can not relegate the target version.

Only I had not tried the widget with Android 8, but with previous versions. Only yesterday I did a test on an updated device
 
Upvote 0

Star-Dust

Expert
Licensed User
Longtime User
I realize that I was wrong not to try it in all its functions
 
Upvote 0

Star-Dust

Expert
Licensed User
Longtime User
Hi Erel,
both my widgets seems working correctly after compiling them with B4A V8 and following this tutorial
Thanks!
After compiling with B4A 8.0 it now works without making any changes to the original code.

I suppose it does not require any change from the old tutorials
 
Upvote 0
Top