// Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.geocities.com/kpdus/jad.html // Decompiler options: braces fieldsfirst space lnc package com.olio.olios.model.loaders; import android.content.AsyncTaskLoader; import android.content.ContentResolver; import android.content.Context; import android.content.Loader; import com.olio.communication.messages.MessagePayload; import com.olio.util.ALog; // Referenced classes of package com.olio.olios.model.loaders: // AlwaysRun, DataCreator abstract class ContentLoader extends AsyncTaskLoader { public static interface LoaderFactory { public abstract ContentLoader create(Context context); } final AlwaysRun alwaysRun; final ContentResolver contentResolver; final DataCreator creator; private MessagePayload data; final String type; public ContentLoader(Context context, String s, AlwaysRun alwaysrun, DataCreator datacreator) { super(context); contentResolver = context.getContentResolver(); type = s; if (alwaysrun == null) { alwaysrun = new AlwaysRun() { final ContentLoader this$0; public void run(Loader loader) { ALog.d("Loader='%s', Id=%d, Action=ALWAYS_RUN", new Object[] { type, Integer.valueOf(getId()) }); } { this$0 = ContentLoader.this; super(); } }; } alwaysRun = alwaysrun; creator = datacreator; } public void deliverResult(MessagePayload messagepayload) { super.deliverResult(messagepayload); if (!isReset()) { data = messagepayload; if (isStarted()) { super.deliverResult(messagepayload); return; } } } public volatile void deliverResult(Object obj) { deliverResult((MessagePayload)obj); } public abstract MessagePayload loadInBackground(); public volatile Object loadInBackground() { return loadInBackground(); } public void onContentChanged() { ALog.d("Loader='%s', Id=%d, Action=ON_CHANGE", new Object[] { type, Integer.valueOf(getId()) }); alwaysRun.run(this); super.onContentChanged(); } protected void onReset() { ALog.d("Loader='%s', Id=%d, Action=ON_RESET", new Object[] { type, Integer.valueOf(getId()) }); super.onReset(); data = null; } protected void onStartLoading() { ALog.d("Loader='%s', Id=%d, Action=ON_START", new Object[] { type, Integer.valueOf(getId()) }); if (data != null) { deliverResult(data); } if (takeContentChanged() || data == null) { forceLoad(); } } }