Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions branchs/live-event-bus-x/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 28
compileSdkVersion 34
defaultConfig {
applicationId "com.jeremyliao.livedatabus"
minSdkVersion 14
targetSdkVersion 28
targetSdkVersion 34
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
Expand Down
4 changes: 3 additions & 1 deletion branchs/live-event-bus-x/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name="com.jeremyliao.lebapp.LiveEventBusDemo">
<activity
android:name="com.jeremyliao.lebapp.LiveEventBusDemo"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
Expand Down
4 changes: 2 additions & 2 deletions branchs/live-event-bus-x/lebx-processor-gson/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ plugins {
}

android {
compileSdkVersion 27
compileSdkVersion 34

defaultConfig {
minSdkVersion 14
targetSdkVersion 27
targetSdkVersion 34
versionCode 1
versionName "1.0"
}
Expand Down
4 changes: 2 additions & 2 deletions branchs/live-event-bus-x/liveeventbus-x/build.gradle
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
apply plugin: 'com.android.library'

android {
compileSdkVersion 28
compileSdkVersion 34

defaultConfig {
minSdkVersion 14
targetSdkVersion 28
targetSdkVersion 34
versionCode 1
versionName "1.0"
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.jeremyliao.liveeventbus.core;

import android.app.Application;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.Build;
Expand Down Expand Up @@ -95,6 +96,7 @@ public synchronized <T> Observable<T> with(String key, Class<T> type) {
* first of all, call config to get the Config instance
* then, call the method of Config to config LiveEventBus
* call this method in Application.onCreate
*
* @return Config
*/
public Config config() {
Expand Down Expand Up @@ -124,7 +126,11 @@ void registerReceiver() {
if (application != null) {
IntentFilter intentFilter = new IntentFilter();
intentFilter.addAction(IpcConst.ACTION);
application.registerReceiver(receiver, intentFilter);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) {
application.registerReceiver(receiver, intentFilter, Context.RECEIVER_EXPORTED);
} else {
application.registerReceiver(receiver, intentFilter);
}
isRegisterReceiver = true;
}
}
Expand Down
4 changes: 2 additions & 2 deletions live-event-bus/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 27
compileSdkVersion 34
defaultConfig {
applicationId "com.jeremyliao.livedatabus"
minSdkVersion 14
targetSdkVersion 27
targetSdkVersion 34
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
Expand Down
4 changes: 3 additions & 1 deletion live-event-bus/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".activity.PostDelayActivity" />
<activity android:name=".LiveEventBusDemo">
<activity
android:name=".LiveEventBusDemo"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

Expand Down
4 changes: 2 additions & 2 deletions live-event-bus/leb-processor-gson/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ plugins {
}

android {
compileSdkVersion 27
compileSdkVersion 34

defaultConfig {
minSdkVersion 14
targetSdkVersion 27
targetSdkVersion 34
versionCode 1
versionName "1.0"
}
Expand Down
4 changes: 2 additions & 2 deletions live-event-bus/liveeventbus/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ apply plugin: 'com.android.library'


android {
compileSdkVersion 27
compileSdkVersion 34

defaultConfig {
minSdkVersion 14
targetSdkVersion 27
targetSdkVersion 34
versionCode 1
versionName "1.0"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import android.arch.lifecycle.LifecycleOwner;
import android.arch.lifecycle.LiveData;
import android.arch.lifecycle.Observer;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.Build;
Expand Down Expand Up @@ -94,6 +95,7 @@ public synchronized <T> Observable<T> with(String key, Class<T> type) {
* first of all, call config to get the Config instance
* then, call the method of Config to config LiveEventBus
* call this method in Application.onCreate
*
* @return Config
*/
public Config config() {
Expand Down Expand Up @@ -123,7 +125,11 @@ void registerReceiver() {
if (application != null) {
IntentFilter intentFilter = new IntentFilter();
intentFilter.addAction(IpcConst.ACTION);
application.registerReceiver(receiver, intentFilter);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) {
application.registerReceiver(receiver, intentFilter, Context.RECEIVER_EXPORTED);
} else {
application.registerReceiver(receiver, intentFilter);
}
isRegisterReceiver = true;
}
}
Expand Down