// 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.data.object.assistant.rule; import android.content.ContentResolver; import android.content.Context; import android.database.ContentObserver; import android.net.Uri; import android.os.Handler; import android.os.Looper; import com.olio.util.ALog; // Referenced classes of package com.olio.data.object.assistant.rule: // Rule public class RuleLoader { private class RulesObserver extends ContentObserver { final RuleLoader this$0; public boolean deliverSelfNotifications() { return false; } public void onChange(boolean flag, Uri uri) { if (uri != null) { ALog.d("RuleLoader: rule loader change called for uri: %s ", new Object[] { uri.toString() }); if (Rule.isRuleType(uri.getQueryParameter("typeName"))) { ALog.d("RuleLoader: rule loader change and it's a rule", new Object[0]); if (loaderCallback != null) { loaderCallback.onLoadComplete(null, Rule.getAllRules(contentResolver)); return; } } } } public RulesObserver(Handler handler) { this$0 = RuleLoader.this; super(handler); } } ContentResolver contentResolver; Context context; private android.content.Loader.OnLoadCompleteListener loaderCallback; ContentObserver rulesObserver; public RuleLoader(Context context1) { context = context1; contentResolver = context1.getContentResolver(); rulesObserver = new RulesObserver(new Handler(Looper.getMainLooper())); } public void registerListener(int i, android.content.Loader.OnLoadCompleteListener onloadcompletelistener) { loaderCallback = onloadcompletelistener; } public void startLoading() { ALog.d("RuleLoader: registering the content observer", new Object[0]); contentResolver.registerContentObserver(Rule.tableUri(), true, rulesObserver); } public void stopLoading() { contentResolver.unregisterContentObserver(rulesObserver); } public void unregisterListener(android.content.Loader.OnLoadCompleteListener onloadcompletelistener) { loaderCallback = null; } }