2 * ownCloud Android client application
4 * @author David A. Velasco
5 * Copyright (C) 2012 Bartek Przybylski
6 * Copyright (C) 2015 ownCloud Inc.
8 * This program is free software: you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2,
10 * as published by the Free Software Foundation.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
22 package com
.owncloud
.android
.files
;
24 import com
.owncloud
.android
.lib
.common
.utils
.Log_OC
;
25 import com
.owncloud
.android
.services
.observer
.FileObserverService
;
27 import android
.content
.BroadcastReceiver
;
28 import android
.content
.Context
;
29 import android
.content
.Intent
;
33 * App-registered receiver catching the broadcast intent reporting that the system was
36 public class BootupBroadcastReceiver
extends BroadcastReceiver
{
38 private static String TAG
= BootupBroadcastReceiver
.class.getSimpleName();
41 * Receives broadcast intent reporting that the system was just boot up.
43 * Starts {@link FileObserverService} to enable observation of favourite files.
45 * @param context The context where the receiver is running.
46 * @param intent The intent received.
49 public void onReceive(Context context
, Intent intent
) {
50 if (!intent
.getAction().equals(Intent
.ACTION_BOOT_COMPLETED
)) {
51 Log_OC
.wtf(TAG
, "Incorrect action sent " + intent
.getAction());
54 Log_OC
.d(TAG
, "Starting file observer service...");
55 Intent initObservers
= FileObserverService
.makeInitIntent(context
);
56 context
.startService(initObservers
);