mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-24 07:58:34 +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">
|
<receiver android:name="OnBootReceiver">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.BOOT_COMPLETED"/>
|
<action android:name="android.intent.action.BOOT_COMPLETED"/>
|
||||||
|
<action android:name="android.intent.action.MY_PACKAGE_REPLACED" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</receiver>
|
</receiver>
|
||||||
<receiver android:name="RelayReceiver"/>
|
<receiver android:name="RelayReceiver"/>
|
||||||
|
|
|
@ -30,12 +30,18 @@ public class OnBootReceiver extends BroadcastReceiver {
|
||||||
@Override
|
@Override
|
||||||
public void onReceive( Context context, Intent intent )
|
public void onReceive( Context context, Intent intent )
|
||||||
{
|
{
|
||||||
if ( null != intent
|
if ( null != intent ) {
|
||||||
&& null != intent.getAction()
|
String action = intent.getAction();
|
||||||
&& intent.getAction().equals( Intent.ACTION_BOOT_COMPLETED ) ) {
|
Log.d( TAG, "got %s", action );
|
||||||
Log.d( TAG, "got ACTION_BOOT_COMPLETED" );
|
switch( action ) {
|
||||||
|
case Intent.ACTION_BOOT_COMPLETED:
|
||||||
|
case Intent.ACTION_MY_PACKAGE_REPLACED:
|
||||||
startTimers( context );
|
startTimers( context );
|
||||||
BTService.onAppToBackground( context );
|
// Let's not put up the foreground service notification on
|
||||||
|
// boot. Too likely to annoy.
|
||||||
|
// BTService.onAppToBackground( context );
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue