Create BootReceiver for Exchange for proper self-management

Change-Id: I95e9e632de91d7f0e2505bf8879e1c164861f58c
This commit is contained in:
Marc Blank 2009-08-28 10:33:18 -07:00
parent bd4fe2db84
commit 53cb37c3ef
3 changed files with 39 additions and 1 deletions

View File

@ -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"

View 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));
}
}

View File

@ -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() {