mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-02-05 20:45:49 +01:00
add vibrate permission; get RelayReceiver notified on boot so can set
initial timer.
This commit is contained in:
parent
83cb8550dc
commit
1529319a60
2 changed files with 21 additions and 17 deletions
|
@ -28,6 +28,8 @@
|
|||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
|
||||
<uses-permission android:name="android.permission.VIBRATE" />
|
||||
|
||||
<uses-sdk android:minSdkVersion="3" android:targetSdkVersion="4" />
|
||||
|
||||
|
@ -85,12 +87,13 @@
|
|||
>
|
||||
</activity>
|
||||
|
||||
<receiver android:name="RelayReceiver"
|
||||
/>
|
||||
<receiver android:name="RelayReceiver">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.RECEIVE__BOOT_COMPLETED"/>
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
|
||||
<activity android:name="DispatchNotify"
|
||||
>
|
||||
</activity>
|
||||
<activity android:name="DispatchNotify" />
|
||||
|
||||
<!-- downloading dicts -->
|
||||
<activity android:name=".DictImportActivity"
|
||||
|
|
|
@ -47,18 +47,19 @@ public class RelayReceiver extends BroadcastReceiver {
|
|||
@Override
|
||||
public void onReceive( Context context, Intent intent )
|
||||
{
|
||||
// Utils.logf( "RelayReceiver::onReceive()" );
|
||||
// if ( XWConstants.s_showProxyToast ) {
|
||||
// Toast.makeText(context, "RelayReceiver: fired",
|
||||
// Toast.LENGTH_SHORT).show();
|
||||
// }
|
||||
|
||||
// Do the actual background work. Could do it here, but only
|
||||
// if we're sure to finish in 10 seconds and if it'll always
|
||||
// result in posting a notification. Some scenarios
|
||||
|
||||
Intent service = new Intent( context, RelayService.class );
|
||||
context.startService( service );
|
||||
if ( null != intent && null != intent.getAction()
|
||||
&& intent.getAction().equals( Intent.ACTION_BOOT_COMPLETED ) ) {
|
||||
Utils.logf( "launching timer on boot" );
|
||||
RestartTimer( context );
|
||||
} else {
|
||||
// Utils.logf( "RelayReceiver::onReceive()" );
|
||||
// if ( XWConstants.s_showProxyToast ) {
|
||||
// Toast.makeText(context, "RelayReceiver: fired",
|
||||
// Toast.LENGTH_SHORT).show();
|
||||
// }
|
||||
Intent service = new Intent( context, RelayService.class );
|
||||
context.startService( service );
|
||||
}
|
||||
}
|
||||
|
||||
public static void RestartTimer( Context context )
|
||||
|
|
Loading…
Add table
Reference in a new issue