package org.mtransit.android.receiver;

import org.mtransit.android.commons.MTLog;
import org.mtransit.android.commons.PackageManagerUtils;
import org.mtransit.android.data.DataSourceManager;
import org.mtransit.android.data.DataSourceProvider;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.pm.ProviderInfo;

public class ModulesReceiver extends BroadcastReceiver implements MTLog.Loggable {

	private static final String TAG = ModulesReceiver.class.getSimpleName();

	@Override
	public String getLogTag() {
		return TAG;
	}

	@Override
	public void onReceive(Context context, Intent intent) {
		String pkg = intent.getData().getSchemeSpecificPart();
		if (DataSourceProvider.isSet()) {
			if (DataSourceProvider.isProvider(context, pkg)) {
				DataSourceProvider.resetIfNecessary(context);
			}
		} else {
			ProviderInfo[] providers = PackageManagerUtils.findContentProvidersWithMetaData(context, pkg);
			if (providers != null) {
				String agencyProviderMetaData = DataSourceProvider.getAgencyProviderMetaData(context);
				for (ProviderInfo provider : providers) {
					if (provider.metaData != null) {
						if (agencyProviderMetaData.equals(provider.metaData.getString(agencyProviderMetaData))) {
							DataSourceManager.ping(context, provider.authority);
						}
					}
				}
			}
		}
	}

}

@@ -867,16 +867,206 @@
 ntext);%0A
+%09%09%09%7D else if (Intent.ACTION_PACKAGE_FULLY_REMOVED.equals(intent.getAction()) %7C%7C Intent.ACTION_PACKAGE_REMOVED.equals(intent.getAction())) %7B%0A%09%09%09%09DataSourceProvider.resetIfNecessary(context);%0A
 %09%09%09%7D%0A%09%09%7D

Check if UI reset required when unidentified pkg is removed.