Skip to content

Commit e15dd79

Browse files
authored
Merge pull request #234 from jwfing/master
一些小的修改
2 parents c9571fe + 032d9aa commit e15dd79

File tree

28 files changed

+858
-89
lines changed

28 files changed

+858
-89
lines changed

CHANGELOG.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,19 @@ Following is change logs for recently release versions, you can refer to [releas
55
> Warning:
66
> DONOT upgrade java-websocket to 1.15.0(or above), bcz it doesn't work on Android 5.1 or earlier version.
77
8+
## 8.2.16 release
9+
10+
#### Break changes
11+
- None
12+
13+
#### New features
14+
- add new module mixpush-honor: Honor notification supporting by vendor.
15+
- enable CACHE_THEN_NETWORK policy for query#find.
16+
17+
#### Optimization and fixed bugs
18+
- change Gson type adapter for some classes, avoid to use internal tools;
19+
- other optimizations.
20+
821
## 8.2.15 release
922

1023
#### Break changes
@@ -14,7 +27,7 @@ Following is change logs for recently release versions, you can refer to [releas
1427
- None
1528

1629
#### Optimization and fixed bugs
17-
- fixed: revert java-websocket version to 1.14.1, for websocketclient crashed on part of old android versions(before 6.0);
30+
- fixed: revert java-websocket version to 1.4.1, for websocketclient crashed on part of old android versions(before 6.0);
1831

1932

2033
## 8.2.14 release

android-sdk/build.gradle

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ buildscript {
66
google()
77
jcenter()
88
maven {url 'http://developer.huawei.com/repo/'}
9+
maven { url 'https://developer.hihonor.com/repo/' }
910
mavenLocal()
1011
}
1112
dependencies {
@@ -25,12 +26,13 @@ allprojects {
2526
google()
2627
jcenter()
2728
maven {url 'http://developer.huawei.com/repo/'}
29+
maven { url 'https://developer.hihonor.com/repo/' }
2830
mavenLocal()
2931
}
3032
}
3133

3234
ext {
33-
sdkVersion = "8.2.15"
35+
sdkVersion = "8.2.16"
3436
supportLibVersion = "26.1.0"
3537
converterVersion = "2.1.0"
3638
rxandroidVersion = "2.1.1"

android-sdk/gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ org.gradle.jvmargs=-Xmx1536m
1515
# This option should only be used with decoupled projects. More details, visit
1616
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
1717
# org.gradle.parallel=true
18-
VERSION_NAME=8.2.15
18+
VERSION_NAME=8.2.16
1919
VERSION_CODE=2695
2020
GROUP=cn.leancloud
2121

android-sdk/mixpush-android/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ dependencies {
7272
implementation project(':mixpush-oppo')
7373
implementation project(':mixpush-vivo')
7474
implementation project(':mixpush-xiaomi')
75+
implementation project(':mixpush-honor')
7576

7677
implementation("cn.leancloud:realtime-core:${rootProject.ext.sdkVersion}")
7778

android-sdk/mixpush-android/src/main/java/cn/leancloud/LCMixPushManager.java

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,72 @@ public static void registerXiaomiPush(Context context, String miAppId, String mi
104104
isInternationalVendor, customizedReceiver);
105105
}
106106

107+
/**
108+
* 注册荣耀推送
109+
* @param application 应用上下文
110+
*/
111+
public static void registerHonorPush(Context application) {
112+
cn.leancloud.honor.LCMixPushManager.registerHonorPush(application);
113+
}
114+
115+
/**
116+
* 注册荣耀推送
117+
* @param application 应用上下文
118+
* @param profile 推送配置
119+
*/
120+
public static void registerHonorPush(Context application, String profile) {
121+
cn.leancloud.honor.LCMixPushManager.registerHonorPush(application, profile);
122+
}
123+
124+
/**
125+
* 打开通知栏状态
126+
* @param callback 回调函数
127+
*/
128+
public static void turnOnHonorPush(LCCallback<Void> callback) {
129+
cn.leancloud.honor.LCMixPushManager.turnOnHonorPush(callback);
130+
}
131+
132+
/**
133+
* 关闭通知栏状态
134+
* @param callback 回调函数
135+
*/
136+
public static void turnOffHonorPush(LCCallback<Void> callback) {
137+
cn.leancloud.honor.LCMixPushManager.turnOffHonorPush(callback);
138+
}
139+
140+
/**
141+
* 校验当前系统是否支持 Honor PUSH
142+
* @return true or false.
143+
*/
144+
public static boolean isSupportHonorPush() {
145+
return cn.leancloud.honor.LCMixPushManager.isSupportHonorPush();
146+
}
147+
148+
/**
149+
* 查询应用是否允许显示通知栏消息,可以通过 getHonorPushStatus 查询当前应用通知栏状态。
150+
* @param callback 回调函数
151+
*/
152+
public static void getHonorPushStatus(LCCallback<Boolean> callback) {
153+
cn.leancloud.honor.LCMixPushManager.getHonorPushStatus(callback);
154+
}
155+
156+
/**
157+
* 获取 PushToken
158+
* @param callback 回调函数
159+
*/
160+
public static void getHonorPushToken(LCCallback<String> callback) {
161+
cn.leancloud.honor.LCMixPushManager.getHonorPushToken(callback);
162+
}
163+
164+
/**
165+
* 注销 PushToken
166+
* 用户拒绝接受您应用的使用协议和隐私声明后,可以调用deletePushToken方法注销PushToken,注销成功后,客户端将不再接收到消息。
167+
* @param callback 回调函数
168+
*/
169+
public static void deleteHonorPushToken(LCCallback<Void> callback) {
170+
cn.leancloud.honor.LCMixPushManager.deleteHonorPushToken(callback);
171+
}
172+
107173
/**
108174
* 初始化方法,建议在 Application onCreate 里面调用
109175
*

android-sdk/mixpush-hms/src/main/java/cn/leancloud/LCHMSMessageService.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
public class LCHMSMessageService extends HmsMessageService {
1717
static final LCLogger LOGGER = LogUtil.getLogger(LCHMSMessageService.class);
1818

19-
static final String MIXPUSH_PRIFILE = "deviceProfile";
19+
static final String MIXPUSH_PROFILE = "deviceProfile";
2020
static final String VENDOR = "HMS";
2121

2222
public LCHMSMessageService() {
@@ -104,7 +104,7 @@ public static void updateAVInstallation(String hwToken) {
104104
if (!hwToken.equals(installation.getString(LCInstallation.REGISTRATION_ID))) {
105105
installation.put(LCInstallation.REGISTRATION_ID, hwToken);
106106
}
107-
String localProfile = installation.getString(MIXPUSH_PRIFILE);
107+
String localProfile = installation.getString(MIXPUSH_PROFILE);
108108
if (null == localProfile) {
109109
localProfile = "";
110110
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/build
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
plugins {
2+
id 'com.android.library'
3+
}
4+
5+
android {
6+
compileSdkVersion 29
7+
buildToolsVersion "29.0.3"
8+
9+
defaultConfig {
10+
minSdkVersion 19
11+
targetSdkVersion 29
12+
13+
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
14+
consumerProguardFiles "consumer-rules.pro"
15+
}
16+
17+
buildTypes {
18+
release {
19+
minifyEnabled false
20+
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
21+
}
22+
}
23+
24+
tasks.withType(Javadoc) {
25+
failOnError false
26+
options.addStringOption('Xdoclint:none', '-quiet')
27+
options.addStringOption('encoding', 'UTF-8')
28+
options.addStringOption('charSet', 'UTF-8')
29+
}
30+
31+
compileOptions {
32+
sourceCompatibility JavaVersion.VERSION_1_8
33+
targetCompatibility JavaVersion.VERSION_1_8
34+
}
35+
}
36+
37+
android.libraryVariants.all { variant ->
38+
def javadoc = task("generate${variant.name}Javadoc", type: Javadoc) {
39+
description "Generates Javadoc for $variant.name."
40+
def compileTask = variant.hasProperty('javaCompileProvider')? variant.javaCompileProvider.get() : variant.javaCompile
41+
source = compileTask.source
42+
ext.androidJar = "${android.sdkDirectory}/platforms/${android.compileSdkVersion}/android.jar"
43+
options.links("http://docs.oracle.com/javase/8/docs/api/");
44+
options.links("http://d.android.com/reference/");
45+
exclude '**/BuildConfig.java'
46+
exclude '**/R.java'
47+
failOnError false
48+
}
49+
def name = variant.buildType.name
50+
def task = project.tasks.create "jar${name.capitalize()}", Jar
51+
def compileTask = variant.hasProperty('javaCompileProvider')? variant.javaCompileProvider.get() : variant.javaCompile
52+
task.dependsOn compileTask
53+
task.dependsOn javadoc
54+
task.from compileTask.destinationDir
55+
task.exclude '**/BuildConfig.class'
56+
task.exclude '**/R.class'
57+
task.exclude '**/R$*.class'
58+
artifacts.add('archives', task)
59+
}
60+
61+
dependencies {
62+
implementation project(':realtime-android')
63+
implementation project(':storage-android')
64+
65+
implementation("cn.leancloud:realtime-core:${rootProject.ext.sdkVersion}")
66+
67+
implementation 'com.hihonor.mcs:push:7.0.39.303'
68+
69+
testImplementation 'junit:junit:4.13.2'
70+
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
71+
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
72+
}
73+
74+
apply from: '../maven_push.gradle'

android-sdk/mixpush-honor/consumer-rules.pro

Whitespace-only changes.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
POM_NAME=mixpush-honor android Library
2+
POM_ARTIFACT_ID=mixpush-honor
3+
POM_PACKAGING=aar

0 commit comments

Comments
 (0)