SharedContentChangedReceiver extends BroadcastReceiver implements Types { @Override public void onReceive(Context context, Intent intent) { final String appAuthority = MetaDataUtils.getAppAuthority(context); final String appSender = intent.getStringExtra(SENDER_AUTHORITY_KEY); Log.d("SharedProvider", "Received Data Changed Event, SentByAuth [" + appSender + "]"); if (TextUtils.isEmpty(appAuthority) || appAuthority.equalsIgnoreCase(appSender)) { Log.v("SharedProvider", "Skipped DataChange, SentByAuth [" + appSender + "]"); return; } putIntentIntoSharedPreferences(context, intent.getExtras()); } SharedContentChangedReceiver(); static void sendBroadcast(@NonNull Context context, @NonNull Map<String, ?> data); @Override void onReceive(Context context, Intent intent); static final String SENDER_AUTHORITY_KEY; }
@Test public void testOnReceive() throws Exception { }