Update to 4.2.1

This commit is contained in:
DrKLO 2017-07-24 00:06:13 +03:00
parent 7fcd94d5c9
commit c92ecf973c
4 changed files with 35 additions and 29 deletions

View file

@ -90,7 +90,7 @@ android {
} }
} }
defaultConfig.versionCode = 1040 defaultConfig.versionCode = 1043
sourceSets.debug { sourceSets.debug {
manifest.srcFile 'config/debug/AndroidManifest.xml' manifest.srcFile 'config/debug/AndroidManifest.xml'
@ -162,7 +162,7 @@ android {
defaultConfig { defaultConfig {
minSdkVersion 16 minSdkVersion 16
targetSdkVersion 25 targetSdkVersion 25
versionName "4.2.0" versionName 4.2.1
externalNativeBuild { externalNativeBuild {
ndkBuild { ndkBuild {

View file

@ -11,7 +11,7 @@ package org.telegram.messenger;
public class BuildVars { public class BuildVars {
public static boolean DEBUG_VERSION = false; public static boolean DEBUG_VERSION = false;
public static boolean DEBUG_PRIVATE_VERSION = false; public static boolean DEBUG_PRIVATE_VERSION = false;
public static int BUILD_VERSION = 1042; public static int BUILD_VERSION = 1043;
public static String BUILD_VERSION_STRING = "4.2"; public static String BUILD_VERSION_STRING = "4.2";
public static int APP_ID = 0; //obtain your own APP_ID at https://core.telegram.org/api/obtaining_api_id public static int APP_ID = 0; //obtain your own APP_ID at https://core.telegram.org/api/obtaining_api_id
public static String APP_HASH = ""; //obtain your own APP_HASH at https://core.telegram.org/api/obtaining_api_id public static String APP_HASH = ""; //obtain your own APP_HASH at https://core.telegram.org/api/obtaining_api_id

View file

@ -581,16 +581,17 @@ public class FileLoadOperation {
RequestInfo delayedRequestInfo = delayedRequestInfos.get(a); RequestInfo delayedRequestInfo = delayedRequestInfos.get(a);
if (downloadedBytes == delayedRequestInfo.offset) { if (downloadedBytes == delayedRequestInfo.offset) {
delayedRequestInfos.remove(a); delayedRequestInfos.remove(a);
processRequestResult(delayedRequestInfo, null); if (!processRequestResult(delayedRequestInfo, null)) {
if (delayedRequestInfo.response != null) { if (delayedRequestInfo.response != null) {
delayedRequestInfo.response.disableFree = false; delayedRequestInfo.response.disableFree = false;
delayedRequestInfo.response.freeResources(); delayedRequestInfo.response.freeResources();
} else if (delayedRequestInfo.responseWeb != null) { } else if (delayedRequestInfo.responseWeb != null) {
delayedRequestInfo.responseWeb.disableFree = false; delayedRequestInfo.responseWeb.disableFree = false;
delayedRequestInfo.responseWeb.freeResources(); delayedRequestInfo.responseWeb.freeResources();
} else if (delayedRequestInfo.responseCdn != null) { } else if (delayedRequestInfo.responseCdn != null) {
delayedRequestInfo.responseCdn.disableFree = false; delayedRequestInfo.responseCdn.disableFree = false;
delayedRequestInfo.responseCdn.freeResources(); delayedRequestInfo.responseCdn.freeResources();
}
} }
break; break;
} }
@ -600,16 +601,16 @@ public class FileLoadOperation {
}, null, null, 0, datacenter_id, ConnectionsManager.ConnectionTypeGeneric, true); }, null, null, 0, datacenter_id, ConnectionsManager.ConnectionTypeGeneric, true);
} }
private void processRequestResult(RequestInfo requestInfo, TLRPC.TL_error error) { private boolean processRequestResult(RequestInfo requestInfo, TLRPC.TL_error error) {
if (state != stateDownloading) { if (state != stateDownloading) {
return; return false;
} }
requestInfos.remove(requestInfo); requestInfos.remove(requestInfo);
if (error == null) { if (error == null) {
try { try {
if (downloadedBytes != requestInfo.offset) { if (downloadedBytes != requestInfo.offset) {
delayRequestInfo(requestInfo); delayRequestInfo(requestInfo);
return; return false;
} }
NativeByteBuffer bytes; NativeByteBuffer bytes;
if (requestInfo.response != null) { if (requestInfo.response != null) {
@ -623,7 +624,7 @@ public class FileLoadOperation {
} }
if (bytes == null || bytes.limit() == 0) { if (bytes == null || bytes.limit() == 0) {
onFinishLoadingFile(true); onFinishLoadingFile(true);
return; return false;
} }
int currentBytesSize = bytes.limit(); int currentBytesSize = bytes.limit();
if (isCdn) { if (isCdn) {
@ -633,7 +634,7 @@ public class FileLoadOperation {
if (hash == null) { if (hash == null) {
delayRequestInfo(requestInfo); delayRequestInfo(requestInfo);
requestFileOffsets(fileOffset); requestFileOffsets(fileOffset);
return; return true;
} }
} }
@ -694,7 +695,7 @@ public class FileLoadOperation {
} }
onFail(false, 0); onFail(false, 0);
cacheFileTemp.delete(); cacheFileTemp.delete();
return; return false;
} }
lastCheckedCdnPart = cdnCheckPart; lastCheckedCdnPart = cdnCheckPart;
} }
@ -711,16 +712,17 @@ public class FileLoadOperation {
RequestInfo delayedRequestInfo = delayedRequestInfos.get(a); RequestInfo delayedRequestInfo = delayedRequestInfos.get(a);
if (downloadedBytes == delayedRequestInfo.offset) { if (downloadedBytes == delayedRequestInfo.offset) {
delayedRequestInfos.remove(a); delayedRequestInfos.remove(a);
processRequestResult(delayedRequestInfo, null); if (!processRequestResult(delayedRequestInfo, null)) {
if (delayedRequestInfo.response != null) { if (delayedRequestInfo.response != null) {
delayedRequestInfo.response.disableFree = false; delayedRequestInfo.response.disableFree = false;
delayedRequestInfo.response.freeResources(); delayedRequestInfo.response.freeResources();
} else if (delayedRequestInfo.responseWeb != null) { } else if (delayedRequestInfo.responseWeb != null) {
delayedRequestInfo.responseWeb.disableFree = false; delayedRequestInfo.responseWeb.disableFree = false;
delayedRequestInfo.responseWeb.freeResources(); delayedRequestInfo.responseWeb.freeResources();
} else if (delayedRequestInfo.responseCdn != null) { } else if (delayedRequestInfo.responseCdn != null) {
delayedRequestInfo.responseCdn.disableFree = false; delayedRequestInfo.responseCdn.disableFree = false;
delayedRequestInfo.responseCdn.freeResources(); delayedRequestInfo.responseCdn.freeResources();
}
} }
break; break;
} }
@ -775,6 +777,7 @@ public class FileLoadOperation {
onFail(false, 0); onFail(false, 0);
} }
} }
return false;
} }
private void onFail(boolean thread, final int reason) { private void onFail(boolean thread, final int reason) {

View file

@ -740,6 +740,9 @@ public class PhotoPaintView extends FrameLayout implements EntityView.EntityView
private void removeEntity(EntityView entityView) { private void removeEntity(EntityView entityView) {
if (entityView == currentEntityView) { if (entityView == currentEntityView) {
currentEntityView.deselect(); currentEntityView.deselect();
if (editingText) {
closeTextEnter(false);
}
currentEntityView = null; currentEntityView = null;
updateSettingsButton(); updateSettingsButton();
} }