Merge change 23116 into eclair
* changes: Create BootReceiver for Exchange for proper self-management
This commit is contained in:
commit
a7927a874b
@ -161,6 +161,12 @@
|
||||
</activity>
|
||||
<receiver android:name="com.android.exchange.EmailSyncAlarmReceiver"/>
|
||||
<receiver android:name="com.android.exchange.MailboxAlarmReceiver"/>
|
||||
<receiver android:name="com.android.exchange.BootReceiver" android:enabled="true">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.BOOT_COMPLETED" />
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
|
||||
<receiver android:name=".service.BootReceiver"
|
||||
android:enabled="false"
|
||||
>
|
||||
@ -174,6 +180,7 @@
|
||||
<action android:name="android.intent.action.DEVICE_STORAGE_OK" />
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
|
||||
<service
|
||||
android:name=".service.MailService"
|
||||
android:enabled="false"
|
||||
|
30
src/com/android/exchange/BootReceiver.java
Normal file
30
src/com/android/exchange/BootReceiver.java
Normal file
@ -0,0 +1,30 @@
|
||||
/*
|
||||
* Copyright (C) 2009 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.exchange;
|
||||
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.util.Log;
|
||||
|
||||
public class BootReceiver extends BroadcastReceiver {
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
Log.d("Exchange", "BootReceiver onReceive");
|
||||
context.startService(new Intent(context, SyncManager.class));
|
||||
}
|
||||
}
|
@ -655,6 +655,7 @@ public class SyncManager extends Service implements Runnable {
|
||||
if (INSTANCE != null) {
|
||||
Log.d(TAG, "onCreate called on running SyncManager");
|
||||
} else {
|
||||
Log.d(TAG, "!!! EAS SyncManager started");
|
||||
INSTANCE = this;
|
||||
try {
|
||||
sDeviceId = getDeviceId();
|
||||
@ -676,7 +677,7 @@ public class SyncManager extends Service implements Runnable {
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
log("!!! SyncManager onDestroy");
|
||||
log("!!! EAS SyncManager destroyed");
|
||||
}
|
||||
|
||||
void maybeStartSyncManagerThread() {
|
||||
|
Loading…
Reference in New Issue
Block a user