Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android Lancher Shortcut does not work a second time, after Timer has run up #536

Closed
Watson15683 opened this issue Feb 25, 2021 · 5 comments
Labels
always-fresh Issues that will never become stale bug Something isn't working good first issue Good for newcomers priority/medium

Comments

@Watson15683
Copy link
Contributor

Description

The Android Shortcuts for Presets do work when they are started again, when timer has run up.

Screenshots

This is what i mean by "Android Luncher Shortcut"
screenshot

To Reproduce

  1. make a Preset "A"
  2. create luncher shortcut with "A"
  3. start playing "A" via the luncher shortcut
  4. set Timer to "1 min"
  5. wait till timer runs up, and "A" stops playing
  6. close the App "Noice" via the "home-button"
  7. try to open Preset "A" again via the luncher shortcut ==> only the app opens, preset "A" does not start playing

Situation where i did not like the App behavoir

  1. I have a Preset as a Shortcut on my Android Luncher.
  2. I went to bed with a "45 min" timer and my preset "rain".
  3. In the morning i woke up and unlocked my phone, the "set Timer Menu of Noice" was still open and i set the timer to "10 min" and wanted to start my "rain" preset via the shortcut on the android luncher.
  4. So i closed the App "Noice".
  5. Then i tried to start my preset "rain" via the shortcut on my Android Luncher. ==> Problem: The App "Noice" opened but the Preset was not started.

Others

  • Device: Samsung Galaxy M21
  • Android Version: Android 10
  • One UI Core-Version: 2.5
  • App Version: 0.15.0 (F-Droid)

Note

  • this is my very first bug report, please don't be to hard on my if a broke some Programmers Codex :-)
  • I really like your app it is just so awsome, and really adds value to my life

wish you all the best form Germany :-)

@Watson15683 Watson15683 added the bug Something isn't working label Feb 25, 2021
@ashutoshgngwr ashutoshgngwr added always-fresh Issues that will never become stale good first issue Good for newcomers priority/medium labels Feb 25, 2021
@ashutoshgngwr
Copy link
Member

I am able to reproduce it. I'll investigate it further when I have more time. You can expect it to be fixed in the next release, but I don't know when it'll be. In the meantime, I found that the preset is played if you close Noice using the home screen button and tap on the shortcut again (doesn't play for the first time but works fine the second time).

@Watson15683
Copy link
Contributor Author

Thank you for your answer.
For me the whole "luncher-sortcut-input-system" seems to be broken after the process I described.
I can not convience the App to play the Preset "A" (or any other Preset) via the shortcut again, not matter what i do.

More about the "Broken State"

what i tried to make the shortcut work again

  1. closing the app via the "home-button" and opening it again via the luncher shortcut (repeatedly for at least 5 Times)

  2. closing the app via the "home-button" and opening the App via the "Normal App Icon" and then closing the app via the "home-button" and then opening it again via the luncher shortcut (repeatedly for at least 5 Times)

  3. changing to another Menupoint within the app "Noice" and then trying the above 1. or 2.

  4. playing another "singel sound" or another "Preset" and then trying the above 1. or 2.

None of the above worked for me.

The only way the remedy the luncher sortcut for me is to close the App "Noice" via the Android App manager. (swing the app to the top of the screen). Then the lancher shortcut works again.

The Problem occures only when...

  • The App was started via the shortcut for the first time, after it has been closed via the android app manager. (When the App was started via the "Normal App Icon" i could not reproduce the Problem, even after trying multuple times to let the timer run down and opening "A" via the shortcut)
  • The Sound was started via a lunchershortcut, when a sound or preset is started via a butten within the app the Problem does not occure.

What I think the Problem might be

The Problem seems to be that after having played a Sound that was started via a "luncher shortcut" the app seems to go into a state where it does not accept "luncher shortcut-input" anymore.

I hope i could help you :-)

@ashutoshgngwr
Copy link
Member

@Watson15683 I'll look into it. Thanks for your input! It'll certainly speed up the process.

@Watson15683
Copy link
Contributor Author

And the Problem has noting to do with the "Timer-funtion".

to reproduce much shorter

  1. make a Preset "A" and a Preset "B"
  2. create luncher shortcut with "A" and a luncher shortcut with "B"
  3. close the app "Noice" in the Android App Manager (swipe the app to the top of the screen)
  4. start playing "A" via the luncher shortcut
  5. close the App "Noice" via the "home-button"
  6. try to open Preset "B" via the luncher shortcut ==> only the app opens, but "B" will not start playing

=> now the shortcus open the app, but do not have any other affect on the app (They don't stop the sound playing or start a diffrent Preset)

That's it now I am finished xD

@ashutoshgngwr
Copy link
Member

This isn't fixed. After f39fe35, adding new launcher shortcuts throw null pointer exceptions.

E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.github.ashutoshgngwr.noice.debug, PID: 4518
    java.lang.NullPointerException: intent's action must be set
        at com.android.internal.util.Preconditions.checkNotNull(Preconditions.java:128)
        at android.content.pm.ShortcutInfo$Builder.setIntents(ShortcutInfo.java:1158)
        at androidx.core.content.pm.ShortcutInfoCompat.toShortcutInfo(ShortcutInfoCompat.java:81)
        at androidx.core.content.pm.ShortcutManagerCompat.requestPinShortcut(ShortcutManagerCompat.java:115)
        at com.github.ashutoshgngwr.noice.fragment.PresetFragment$ViewHolder.createShortcut(PresetFragment.kt:169)
        at com.github.ashutoshgngwr.noice.fragment.PresetFragment$ViewHolder.access$createShortcut(PresetFragment.kt:123)
        at com.github.ashutoshgngwr.noice.fragment.PresetFragment$ViewHolder$onMenuItemClickListener$1.onMenuItemClick(PresetFragment.kt:137)
        at androidx.appcompat.widget.PopupMenu$1.onMenuItemSelected(PopupMenu.java:113)
        at androidx.appcompat.view.menu.MenuBuilder.dispatchMenuItemSelected(MenuBuilder.java:834)
        at androidx.appcompat.view.menu.MenuItemImpl.invoke(MenuItemImpl.java:158)
        at androidx.appcompat.view.menu.MenuBuilder.performItemAction(MenuBuilder.java:985)
        at androidx.appcompat.view.menu.MenuPopup.onItemClick(MenuPopup.java:128)
        at android.widget.AdapterView.performItemClick(AdapterView.java:318)
        at android.widget.AbsListView.performItemClick(AbsListView.java:1159)
        at android.widget.AbsListView$PerformClick.run(AbsListView.java:3136)
        at android.widget.AbsListView.onTouchUp(AbsListView.java:4064)
        at android.widget.AbsListView.onTouchEvent(AbsListView.java:3822)
        at androidx.appcompat.widget.DropDownListView.onTouchEvent(DropDownListView.java:217)
        at androidx.appcompat.widget.MenuPopupWindow$MenuDropDownListView.onTouchEvent(MenuPopupWindow.java:138)
        at android.view.View.dispatchTouchEvent(View.java:12513)
        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3024)
        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2705)
        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3030)
        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2719)
        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3030)
        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2719)
        at android.widget.PopupWindow$PopupDecorView.dispatchTouchEvent(PopupWindow.java:2407)
        at android.view.View.dispatchPointerEvent(View.java:12752)
        at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:5106)
        at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:4909)
        at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4426)
        at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4479)
        at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4445)
        at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:4585)
        at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4453)
        at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:4642)
        at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4426)
        at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4479)
        at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4445)
        at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4453)
        at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4426)
        at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:7092)
        at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:7061)
        at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:7022)
        at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:7195)
        at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:186)
        at android.os.MessageQueue.nativePollOnce(Native Method)
        at android.os.MessageQueue.next(MessageQueue.java:326)
        at android.os.Looper.loop(Looper.java:160)
        at android.app.ActivityThread.main(ActivityThread.java:6669)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
always-fresh Issues that will never become stale bug Something isn't working good first issue Good for newcomers priority/medium
Projects
None yet
Development

No branches or pull requests

2 participants