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

Automatically resume shares on device start #178

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ghost
Copy link

@ghost ghost commented Aug 8, 2021

This commit adds an option to automatically resume active shares on device reboot.
I'm not very experienced with java or android so I hope I didn't screw anything up too badly.
Closes #160

Mae added 2 commits August 8, 2021 19:53
This commit adds an option to automatically resume active shares on device reboot.
Due to access restrictions introduced under android
11(https://developer.android.com/guide/components/foreground-services#access-restrictions)
you need an additional permissions to start recieveing location from a
service that wasn't started by a foreground activity
@licaon-kter
Copy link
Contributor

@bilde2910 any blockers here?

@@ -4,8 +4,11 @@
package="info.varden.hauk">

<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

android:exported="true"
tools:ignore="ExportedReceiver">
<intent-filter>
<action android:name="info.varden.hauk.START_ALONE_THEN_SHARE_VIA" />
<action android:name="info.varden.hauk.START_ALONE_THEN_MAKE_TOAST" />
</intent-filter>
</receiver>

<receiver
Copy link
Contributor

@licaon-kter licaon-kter Jun 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nvm this one

Copy link
Contributor

@licaon-kter licaon-kter Jun 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My local patch was missing the receiver on built hence it was erroring out on reboot, my bad

I'm using this snippet

        <receiver
            android:name=".global.RebootReceiver"
            android:enabled="true"
            android:exported="false">

            <intent-filter android:directBootAware="true">
                <action android:name="android.intent.action.BOOT_COMPLETED" />
                <action android:name="android.intent.action.LOCKED_BOOT_COMPLETED" />
                <action android:name="android.intent.action.QUICKBOOT_POWERON" />
                <action android:name="android.intent.action.REBOOT"/>
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>

        </receiver>

and works fine in my testing on Android 13

@licaon-kter
Copy link
Contributor

between this and #210 and the missing (which?) pieces for targetsdk @bilde2910 maybe you can tag a new release?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Automatically resume location sharing on boot
1 participant