Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 690c2ec4 authored by Ricardo Cerqueira's avatar Ricardo Cerqueira Committed by Steve Kondik
Browse files

ReportingService: Fix service startup

Turns out the service wasn't starting at all until someone looked at the data,
so no reports were being sent for CM11...

Change-Id: Ib64ddbed4e0cae9c2f71d6c0c79f8081d6f15301
parent 5c60a492
Loading
Loading
Loading
Loading
+17 −6
Original line number Diff line number Diff line
@@ -1232,12 +1232,6 @@
            </intent-filter>
        </activity>

        <service android:label="ReportingService"
            android:enabled="true"
            android:exported="false"
            android:name=".cmstats.ReportingService">
        </service>

        <!-- Runs in the phone process since it needs access to the Phone object -->
        <activity android:name=".deviceinfo.Status"
                android:label="@string/device_status_activity_title"
@@ -2203,6 +2197,23 @@
            </intent-filter>
        </receiver>

        <!-- Anonymous Statistics -->
        <receiver android:name=".cmstats.ReportingServiceManager"
            android:enabled="true"
            android:exported="false"
            android:label="ReportingServiceManager">
            <intent-filter>
                <action android:name="android.intent.action.BOOT_COMPLETED" />
                <action android:name="android.net.conn.CONNECTIVITY_CHANGE" />
            </intent-filter>
        </receiver>

        <service android:label="ReportingService"
            android:enabled="true"
            android:exported="false"
            android:name=".cmstats.ReportingService">
        </service>

        <!-- Watch for ContactsContract.Profile changes and update the user's photo.  -->
        <receiver android:name=".users.ProfileUpdateReceiver">
            <intent-filter>
+3 −2
Original line number Diff line number Diff line
@@ -89,8 +89,9 @@ public class ReportingServiceManager extends BroadcastReceiver {
            setAlarm(context, 0);
            return;
        }
        long timeLeft = System.currentTimeMillis() - lastSynced;
        if (timeLeft < UPDATE_INTERVAL) {
        long timeElapsed = System.currentTimeMillis() - lastSynced;
        if (timeElapsed < UPDATE_INTERVAL) {
            long timeLeft = UPDATE_INTERVAL - timeElapsed;
            Log.d(ReportingService.TAG, "Waiting for next sync : " + timeLeft / MILLIS_PER_HOUR + " hours");
            return;
        }