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

Commit b58181e9 authored by Daniel Karlberg's avatar Daniel Karlberg Committed by Giulio Cervera
Browse files

Fixed a leaked partial wakelock in AbstractThreadedSyncAdapter.

This fix ensures that onFinished() is always called in a syncClient
even if the application lacks the READ_SYNC_SETTINGS permission.

Change-Id: I944717e71ceae06a665f8a3b1199b41d73e12da4
parent 8ed0d0d2
Loading
Loading
Loading
Loading
+6 −3
Original line number Original line Diff line number Diff line
@@ -160,10 +160,13 @@ public abstract class AbstractThreadedSyncAdapter {
                    if (mAutoInitialize
                    if (mAutoInitialize
                            && extras != null
                            && extras != null
                            && extras.getBoolean(ContentResolver.SYNC_EXTRAS_INITIALIZE, false)) {
                            && extras.getBoolean(ContentResolver.SYNC_EXTRAS_INITIALIZE, false)) {
                        try {
                            if (ContentResolver.getIsSyncable(account, authority) < 0) {
                            if (ContentResolver.getIsSyncable(account, authority) < 0) {
                                ContentResolver.setIsSyncable(account, authority, 1);
                                ContentResolver.setIsSyncable(account, authority, 1);
                            }
                            }
                        } finally {
                            syncContextClient.onFinished(new SyncResult());
                            syncContextClient.onFinished(new SyncResult());
                        }
                        return;
                        return;
                    }
                    }
                    SyncThread syncThread = new SyncThread(
                    SyncThread syncThread = new SyncThread(