Skip to content

Commit

Permalink
Merge pull request #386 from JemyCheung/master
Browse files Browse the repository at this point in the history
v7.6.3
  • Loading branch information
bachue authored Jun 8, 2020
2 parents 920c01a + 53a0cab commit 5674a4a
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 13 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#Changelog

# 7.6.3
* 新增表单上传日志打点

# 7.6.2
* 修复序列化异常
* 更正打点日志字段
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ https://github.com/qiniudemo/qiniu-lab-android
| 7.0.7 | Android 2.2+ | android-async-http 1.4.8 |

### 注意
* 推荐使用最新版:7.6.2,7.6.2使用okhttp4.2.2
* 推荐使用最新版:7.6.3,7.6.3使用okhttp4.2.2
* 7.4.3是在7.5.2版本上降低okhttp版本,其他功能不变
* 从 7.3.13 开始,不在强制依赖 `happy-dns-android`,默认不再提供 `httpDns`,可以调用 `Configuration.Builder#dns(com.qiniu.android.http.Dns)`方法设置外部 `Dns`,自定义 `Dns` 要求实现 `com.qiniu.android.http.Dns` 接口。
* 从7.5.0开始增加了DNS预取和缓存策略,减少dns解析错误
Expand All @@ -41,6 +41,8 @@ https://github.com/qiniudemo/qiniu-lab-android

## 使用方法
UploadManager 可以创建一次,一直使用。
7.6.2调用AndroidNetwork.getMobileDbm可以获取网络信号强度
需要Manifest.permission.ACCESS_FINE_LOCATION和Manifest.permission.ACCESS_COARSE_LOCATION权限
```java
import com.qiniu.android.storage.UploadManager;
...
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@ public final class TestConfig {
// TODO: 2020-05-09 bad token for testPutBytesWithFixedZoneUseBackupDomains
//华东上传凭证
public static final String bucket_z0 = "sdk-z0";
public static final String token_z0 = "bjtWBQXrcxgo7HWwlC_bgHg81j352_GhgBGZPeOW:6DI77dUwjkGlcX1Ad1weNvdopX8=:eyJzY29wZSI6InRlc3QiLCJkZWFkbGluZSI6MTU5MDkzOTk1Mn0=";
public static final String token_z0 = "bjtWBQXrcxgo7HWwlC_bgHg81j352_GhgBGZPeOW:MLccAwMXUHBNVwpgywQ20wYkS8I=:eyJzY29wZSI6InNkay16MCIsImRlYWRsaW5lIjoxNTkzNDk5NTE3fQ==";
//华北上传凭证
public static final String bucket_z1 = "sdk-z1";
public static final String token_z1 = "bjtWBQXrcxgo7HWwlC_bgHg81j352_GhgBGZPeOW:z8zw-b9HlKXFvTw6puxT2YnywsQ=:eyJzY29wZSI6InNkay16MSIsImRlYWRsaW5lIjoxNTkwOTM5OTUyfQ==";
public static final String token_z1 = "bjtWBQXrcxgo7HWwlC_bgHg81j352_GhgBGZPeOW:iC0aCzDNRvbm84Y8eNqQcf91YYY=:eyJzY29wZSI6InNkay16MSIsImRlYWRsaW5lIjoxNTkzNDk5NTE3fQ==";
//华南上传凭证
public static final String bucket_z2 = "sdk-z2";
public static final String token_z2 = "bjtWBQXrcxgo7HWwlC_bgHg81j352_GhgBGZPeOW:ACLWaLPp9YSFV157gsw01qQUdus=:eyJzY29wZSI6InNkay16MiIsImRlYWRsaW5lIjoxNTkwOTM5OTUyfQ==";
public static final String token_z2 = "bjtWBQXrcxgo7HWwlC_bgHg81j352_GhgBGZPeOW:593xYJbCtm53J-Sn0YmPaMV84zk=:eyJzY29wZSI6InNkay16MiIsImRlYWRsaW5lIjoxNTkzNDk5NTE3fQ==";
//北美上传凭证
public static final String bucket_na0 = "sdk-na0";
public static final String token_na0 = "bjtWBQXrcxgo7HWwlC_bgHg81j352_GhgBGZPeOW:9DArLr1Rh6XtMSJvQBr-c7Kqj48=:eyJzY29wZSI6InNkay1uYTAiLCJkZWFkbGluZSI6MTU5MDkzOTk1Mn0=";
public static final String token_na0 = "bjtWBQXrcxgo7HWwlC_bgHg81j352_GhgBGZPeOW:0AwL9XyCCT3nF2KE_NnwdRVAu64=:eyJzY29wZSI6InNkay1uYTAiLCJkZWFkbGluZSI6MTU5MzQ5OTUxN30=";
public static final String ak = "bjtWBQXrcxgo7HWwlC_bgHg81j352_GhgBGZPeOW";

//dns prefetch token
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,9 +172,6 @@ public void test4M() throws Throwable {
template(4 * 1024, 0.5);
}

public void test8M1K() throws Throwable {
template(8 * 1024 + 1, 0.8);
}

public void testLastModify() throws IOException {
File f = File.createTempFile("qiniutest", "b");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@


public final class Constants {
public static final String VERSION = "7.6.2";
public static final String VERSION = "7.6.3";

public static final String UTF_8 = "utf-8";
}
Original file line number Diff line number Diff line change
Expand Up @@ -176,12 +176,12 @@ public void run() {
//query请求发生在第一次,第二次query从本地zoneinfo拿,response为null
LogHandler logHandler = UploadInfoElementCollector.getUplogHandler(UploadInfo.getReqInfo());
logHandler.send("up_type", "uc_query");

final WarpHandler completionHandler = warpHandler(complete, data != null ? data.length : 0);
Zone z = config.zone;
z.preQuery(logHandler, token, new Zone.QueryHandler() {
@Override
public void onSuccess() {
FormUploader.upload(client, config, data, key, decodedToken, complete, options);
FormUploader.upload(client, config, data, key, decodedToken, completionHandler, options);
}

@Override
Expand Down Expand Up @@ -245,12 +245,12 @@ public void run() {
@Override
public void onSuccess() {
long size = file.length();
final WarpHandler completionHandler = warpHandler(complete, file != null ? file.length() : 0);
if (size <= config.putThreshold) {
FormUploader.upload(client, config, file, key, decodedToken, complete, options);
FormUploader.upload(client, config, file, key, decodedToken, completionHandler, options);
return;
}
String recorderKey = config.keyGen.gen(key, file);
final WarpHandler completionHandler = warpHandler(complete, file != null ? file.length() : 0);
if (multithreads == 1) {
ResumeUploader uploader = new ResumeUploader(client, config, file, key,
decodedToken, completionHandler, options, recorderKey);
Expand Down

0 comments on commit 5674a4a

Please sign in to comment.