Code Monkey home page Code Monkey logo

venom's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

venom's Issues

In Android 14 system throws an exception for Venom Service

In Android 14 on init of Venom Service system throws an exception:
java.lang.RuntimeException: Unable to create service com.github.venom.service.VenomService: android.app.MissingForegroundServiceTypeException: Starting FGS without a type ... targetSDK=34

https://developer.android.com/about/versions/14/changes/fgs-types-required
If your app targets Android 14, it must specify appropriate foreground service types.

Like in example

      <service
          android:name=".MyMediaPlaybackService"
          android:foregroundServiceType="mediaPlayback"
          android:exported="false">
      </service>

I created a pull request with a fix #51

Possible to kill process but not auto restart?

This would an ideal tool for our QA team for testing events that happen after the process has been destroyed. Things like handling push notifications that trigger a cold start for instance.

When I kill process, it auto restarts. Is there a way to block the restart part of it?

Update README.md to match current release

And showcase the new kill vs restart feature.

  • notification screenshot (and gif)
  • code snippet for the configuration
  • detail effects of both actions

Do you need some help to update those elements?

Using venom results in "App keeps stopping" dialog

I keep getting a "RollerToaster keeps stopping" dialog even though my app is closed. I also don't see venom in the notication tray. I believe I hit the "cancel" button in the notifaction tray.

Now like every minute or so I get this dialog, so I looked in logout. I have this same stacktrace over and over and over.

2022-01-26 22:46:51.785 17245-17245/com.rollertoaster.app.free E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.rollertoaster.app.free, PID: 17245
    java.lang.RuntimeException: Unable to create application com.rollertoaster.app.MyApplication: android.app.ForegroundServiceStartNotAllowedException: startForegroundService() not allowed due to mAllowStartForeground false: service com.rollertoaster.app.free/com.github.venom.service.VenomService
        at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6730)
        at android.app.ActivityThread.access$1500(ActivityThread.java:247)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2053)
        at android.os.Handler.dispatchMessage(Handler.java:106)
        at android.os.Looper.loopOnce(Looper.java:201)
        at android.os.Looper.loop(Looper.java:288)
        at android.app.ActivityThread.main(ActivityThread.java:7839)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)
     Caused by: android.app.ForegroundServiceStartNotAllowedException: startForegroundService() not allowed due to mAllowStartForeground false: service com.rollertoaster.app.free/com.github.venom.service.VenomService
        at android.app.ForegroundServiceStartNotAllowedException$1.createFromParcel(ForegroundServiceStartNotAllowedException.java:54)
        at android.app.ForegroundServiceStartNotAllowedException$1.createFromParcel(ForegroundServiceStartNotAllowedException.java:50)
        at android.os.Parcel.readParcelable(Parcel.java:3333)
        at android.os.Parcel.createExceptionOrNull(Parcel.java:2420)
        at android.os.Parcel.createException(Parcel.java:2409)
        at android.os.Parcel.readException(Parcel.java:2392)
        at android.os.Parcel.readException(Parcel.java:2334)
        at android.app.IActivityManager$Stub$Proxy.startService(IActivityManager.java:5971)
        at android.app.ContextImpl.startServiceCommon(ContextImpl.java:1847)
        at android.app.ContextImpl.startForegroundService(ContextImpl.java:1823)
        at android.content.ContextWrapper.startForegroundService(ContextWrapper.java:779)
        at androidx.core.content.ContextCompat$Api26Impl.startForegroundService(ContextCompat.java:931)
        at androidx.core.content.ContextCompat.startForegroundService(ContextCompat.java:703)
        at com.github.venom.service.ServiceDelegate.startService(ServiceDelegate.kt:12)
        at com.github.venom.Venom.start(Venom.kt:61)
        at com.github.venom.Venom.initialize(Venom.kt:52)
        at com.github.venom.Venom.initialize$default(Venom.kt:49)
        at com.github.venom.Venom.initialize(Unknown Source:2)
        at com.rollertoaster.app.MyApplication.onCreate(MyApplication.java:388)
        at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1211)
        at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6725)
        at android.app.ActivityThread.access$1500(ActivityThread.java:247) 
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2053) 
        at android.os.Handler.dispatchMessage(Handler.java:106) 
        at android.os.Looper.loopOnce(Looper.java:201) 
        at android.os.Looper.loop(Looper.java:288) 
        at android.app.ActivityThread.main(ActivityThread.java:7839) 
        at java.lang.reflect.Method.invoke(Native Method) 
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003) 
     Caused by: android.os.RemoteException: Remote stack trace:
        at com.android.server.am.ActiveServices.startServiceLocked(ActiveServices.java:691)
        at com.android.server.am.ActiveServices.startServiceLocked(ActiveServices.java:616)
        at com.android.server.am.ActivityManagerService.startService(ActivityManagerService.java:11850)
        at android.app.IActivityManager$Stub.onTransact(IActivityManager.java:2519)
        at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:2498)
        ```

Can we do anything about it?

Expose isActive state

Venom uses its own SharedPreferences file to store its active state: VenomPreferenceManager.kt.
Unfortunately this state is private and leads to some issues.
For instance, suppose my app is bundled with a dedicated debug panel where you can toggle features.
There is currently no way (other than hardcoding the same SharedPreferences file name and key) to sync with Venom internal state.
Disabling Venom with the cancel notification action will not change the host setting, and vice-versa. Which means that, when the app is later re-started, my host will try to start Venom again.
It would be great to allow the host to get, or even set this internal state. Maybe setActive/isActive isn't the right wording for that.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.