mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-08 05:24:39 +01:00
start stuff when package replaced
And: Don't start the foreground service with its user-visible notification, as that's too obtrusive and the ACL_CONNECTED stuff seems to work well enough. Launching timers on a new install is mostly for my own dev use, but won't hurt user experience either.
This commit is contained in:
parent
d8d0065e90
commit
5467941d45
2 changed files with 13 additions and 6 deletions
|
@ -115,6 +115,7 @@
|
|||
<receiver android:name="OnBootReceiver">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.BOOT_COMPLETED"/>
|
||||
<action android:name="android.intent.action.MY_PACKAGE_REPLACED" />
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
<receiver android:name="RelayReceiver"/>
|
||||
|
|
|
@ -30,12 +30,18 @@ public class OnBootReceiver extends BroadcastReceiver {
|
|||
@Override
|
||||
public void onReceive( Context context, Intent intent )
|
||||
{
|
||||
if ( null != intent
|
||||
&& null != intent.getAction()
|
||||
&& intent.getAction().equals( Intent.ACTION_BOOT_COMPLETED ) ) {
|
||||
Log.d( TAG, "got ACTION_BOOT_COMPLETED" );
|
||||
startTimers( context );
|
||||
BTService.onAppToBackground( context );
|
||||
if ( null != intent ) {
|
||||
String action = intent.getAction();
|
||||
Log.d( TAG, "got %s", action );
|
||||
switch( action ) {
|
||||
case Intent.ACTION_BOOT_COMPLETED:
|
||||
case Intent.ACTION_MY_PACKAGE_REPLACED:
|
||||
startTimers( context );
|
||||
// Let's not put up the foreground service notification on
|
||||
// boot. Too likely to annoy.
|
||||
// BTService.onAppToBackground( context );
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue