-
Notifications
You must be signed in to change notification settings - Fork 106
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
Grant SCHEDULE_EXACT_ALARM permission in instrumentation test #551
Conversation
Yes yes I will make new clean branch |
Sorry, this is not the benchmark. The CI should work. |
I wasn't trying to say that it works on my device, I wanted you to know I am trying to make it working on CI |
I think errors about using ALARM are fixed but now time out causing tests to fail. Is the server up and running? |
yes #552 |
After a few hours of searching I found what the problem was. |
context.registerReceiver(receiver, filter, Context.RECEIVER_NOT_EXPORTED) | ||
} else | ||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) | ||
context.registerReceiver(receiver, filter, Context.RECEIVER_EXPORTED) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why must it be exported ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not really sure about what I'm going to say but I think because the instrumentation test app and the library are on different places. It took me while to find out that the broadcasts send by the callbackToActivity
function are not received by the MqttAndroidClient
broadcast receiver. It fixed by this change.
It might work in real app
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm open for any improvement
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will see what can I do
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll fix the noisy commits by myself
@@ -6,6 +6,8 @@ | |||
<!-- Permissions the Application Requires --> | |||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> | |||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> | |||
<uses-permission android:name="android.permission.SCHEDULE_EXACT_ALARM" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess I merged too fast.
This should be only in library
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes that's right
@@ -6,6 +6,8 @@ | |||
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" /> | |||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> | |||
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" /> | |||
<uses-permission android:name="android.permission.SCHEDULE_EXACT_ALARM" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be only in library
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for that
@@ -1,5 +1,8 @@ | |||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"> | |||
|
|||
<uses-permission android:name="android.permission.SCHEDULE_EXACT_ALARM" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Yes, here it is
I wasn't able to run android test on CI
Please approve this pull request CI checks so I can make sure every thing is fine