update to 8.9.3

This commit is contained in:
xaxtix 2022-08-14 22:44:20 +04:00
parent 172335d189
commit 43fe75b46b
9 changed files with 41 additions and 23 deletions

View file

@ -20,8 +20,8 @@ public class BuildVars {
public static boolean USE_CLOUD_STRINGS = true;
public static boolean CHECK_UPDATES = true;
public static boolean NO_SCOPED_STORAGE = Build.VERSION.SDK_INT <= 29;
public static int BUILD_VERSION = 2756;
public static String BUILD_VERSION_STRING = "8.9.2";
public static int BUILD_VERSION = 2757;
public static String BUILD_VERSION_STRING = "8.9.3";
public static int APP_ID = 4;
public static String APP_HASH = "014b35b6184100b085b0d0572f9b5103";

View file

@ -39,7 +39,12 @@ public class GoogleLocationProvider implements ILocationServiceProvider {
@Override
public void getLastLocation(Consumer<Location> callback) {
locationProviderClient.getLastLocation().addOnCompleteListener(task -> callback.accept(task.getResult()));
locationProviderClient.getLastLocation().addOnCompleteListener(task -> {
if (task.getException() != null) {
return;
}
callback.accept(task.getResult());
});
}
@Override

View file

@ -6682,7 +6682,7 @@ public class MediaDataController extends BaseController {
}
});
String aliasFinal = alias;
if (allowAnimated) {
if (allowAnimated && SharedConfig.suggestAnimatedEmoji) {
fillWithAnimatedEmoji(result, null, () -> {
if (sync != null) {
callback.run(result, aliasFinal);

View file

@ -3883,6 +3883,7 @@ public class MessagesController extends BaseController implements NotificationCe
TLRPC.TL_updateReadChannelInbox update = new TLRPC.TL_updateReadChannelInbox();
update.channel_id = dialog.peer.channel_id;
update.max_id = dialog.read_inbox_max_id;
update.still_unread_count = dialog.unread_count;
arrayList.add(update);
} else {
TLRPC.TL_updateReadHistoryInbox update = new TLRPC.TL_updateReadHistoryInbox();
@ -4026,6 +4027,7 @@ public class MessagesController extends BaseController implements NotificationCe
TLRPC.TL_updateReadChannelInbox update = new TLRPC.TL_updateReadChannelInbox();
update.channel_id = chatId;
update.max_id = res.full_chat.read_inbox_max_id;
update.still_unread_count = res.full_chat.unread_count;
arrayList.add(update);
processUpdateArray(arrayList, null, null, false, 0);
}

View file

@ -5755,7 +5755,7 @@ public class MessagesStorage extends BaseController {
int messageId = inbox.get(key);
boolean canCountByMessageId = true;
if (stillUnreadMessagesCount != null && stillUnreadMessagesCount.get(key, -1) != -1) {
if (stillUnreadMessagesCount != null && stillUnreadMessagesCount.get(key, -2) != -2) {
SQLiteCursor checkHolesCursor = database.queryFinalized(String.format(Locale.US, "SELECT start, end FROM messages_holes WHERE uid = %d AND end > %d", key, messageId));
while (checkHolesCursor.next()) {
canCountByMessageId = false;
@ -5771,8 +5771,8 @@ public class MessagesStorage extends BaseController {
}
cursor.dispose();
} else {
int unread = stillUnreadMessagesCount.get(key);
if (unread > 0) {
int unread = stillUnreadMessagesCount.get(key, -1);
if (unread >= 0) {
dialogsToUpdate.put(key, unread);
}
}

View file

@ -305,6 +305,7 @@ public class PushListenerController {
TLRPC.TL_updateReadChannelInbox update = new TLRPC.TL_updateReadChannelInbox();
update.channel_id = channel_id;
update.max_id = max_id;
update.still_unread_count = -1;
updates.add(update);
} else {
TLRPC.TL_updateReadHistoryInbox update = new TLRPC.TL_updateReadHistoryInbox();

View file

@ -22,7 +22,6 @@ import android.graphics.Shader;
import android.graphics.drawable.Animatable;
import android.graphics.drawable.BitmapDrawable;
import android.os.Build;
import android.util.Log;
import android.view.View;
import org.telegram.messenger.AndroidUtilities;
@ -34,7 +33,6 @@ import org.telegram.messenger.ImageLocation;
import org.telegram.messenger.ImageReceiver;
import org.telegram.messenger.utils.BitmapsCache;
import org.telegram.tgnet.TLRPC;
import org.telegram.ui.ActionBar.Theme;
import java.io.File;
import java.util.ArrayList;
@ -971,6 +969,8 @@ public class AnimatedFileDrawable extends BitmapDrawable implements Animatable,
long cacheGenerateTimestamp;
Bitmap generatingCacheBitmap;
long cacheGenerateNativePtr;
int tryCount;
int lastMetadata;
@Override
public void prepareForGenerateCache() {
@ -994,9 +994,16 @@ public class AnimatedFileDrawable extends BitmapDrawable implements Animatable,
generatingCacheBitmap = Bitmap.createBitmap(metaData[0], metaData[1], Bitmap.Config.ARGB_8888);
}
getVideoFrame(cacheGenerateNativePtr, generatingCacheBitmap, metaData, generatingCacheBitmap.getRowBytes(), false, startTime, endTime);
if (cacheGenerateTimestamp != 0 && metaData[3] == 0 || cacheGenerateTimestamp > metaData[3]) {
if (cacheGenerateTimestamp != 0 && (metaData[3] == 0 || cacheGenerateTimestamp > metaData[3])) {
return 0;
}
if (lastMetadata == metaData[3]) {
tryCount++;
if (tryCount > 5) {
return 0;
}
}
lastMetadata = metaData[3];
bitmap.eraseColor(Color.TRANSPARENT);
canvas.save();
float s = (float) renderingWidth / generatingCacheBitmap.getWidth();

View file

@ -20,7 +20,6 @@ import android.os.Handler;
import android.os.Looper;
import android.os.SystemClock;
import android.text.TextUtils;
import android.util.Log;
import android.view.HapticFeedbackConstants;
import android.view.View;
@ -34,7 +33,6 @@ import org.telegram.messenger.ImageReceiver;
import org.telegram.messenger.R;
import org.telegram.messenger.Utilities;
import org.telegram.messenger.utils.BitmapsCache;
import org.telegram.ui.ActionBar.Theme;
import java.io.File;
import java.io.FileInputStream;
@ -892,7 +890,7 @@ public class RLottieDrawable extends BitmapDrawable implements Animatable, Bitma
return false;
}
if (generatingCache) {
// return false;
return false;
}
if (!newColorUpdates.isEmpty()) {
pendingColorUpdates.putAll(newColorUpdates);

View file

@ -32,17 +32,22 @@ public class HuaweiLocationProvider implements ILocationServiceProvider {
@Override
public ILocationRequest onCreateLocationRequest() {
return new GoogleLocationRequest(LocationRequest.create());
return new HuaweiLocationRequest(LocationRequest.create());
}
@Override
public void getLastLocation(Consumer<Location> callback) {
locationProviderClient.getLastLocation().addOnCompleteListener(task -> callback.accept(task.getResult()));
locationProviderClient.getLastLocation().addOnCompleteListener(task -> {
if (task.getException() != null) {
return;
}
callback.accept(task.getResult());
});
}
@Override
public void requestLocationUpdates(ILocationRequest request, ILocationListener locationListener) {
locationProviderClient.requestLocationUpdates(((GoogleLocationRequest) request).request, new LocationCallback() {
locationProviderClient.requestLocationUpdates(((HuaweiLocationRequest) request).request, new LocationCallback() {
@Override
public void onLocationResult(@NonNull LocationResult locationResult) {
locationListener.onLocationChanged(locationResult.getLastLocation());
@ -62,7 +67,7 @@ public class HuaweiLocationProvider implements ILocationServiceProvider {
@Override
public void checkLocationSettings(ILocationRequest request, Consumer<Integer> callback) {
LocationSettingsRequest.Builder builder = new LocationSettingsRequest.Builder().addLocationRequest(((GoogleLocationRequest) request).request);
LocationSettingsRequest.Builder builder = new LocationSettingsRequest.Builder().addLocationRequest(((HuaweiLocationRequest) request).request);
settingsClient.checkLocationSettings(builder.build()).addOnCompleteListener(task -> {
try {
@ -83,7 +88,7 @@ public class HuaweiLocationProvider implements ILocationServiceProvider {
@Override
public IMapApiClient onCreateLocationServicesAPI(Context context, IAPIConnectionCallbacks connectionCallbacks, IAPIOnConnectionFailedListener failedListener) {
return new GoogleApiClientImpl(new HuaweiApiClient.Builder(ApplicationLoader.applicationContext)
return new HuaweiApiClientImpl(new HuaweiApiClient.Builder(ApplicationLoader.applicationContext)
.addConnectionCallbacks(new HuaweiApiClient.ConnectionCallbacks() {
@Override
public void onConnected() {
@ -101,13 +106,13 @@ public class HuaweiLocationProvider implements ILocationServiceProvider {
@Override
public boolean checkServices() {
return PushListenerController.GooglePushListenerServiceProvider.INSTANCE.hasServices();
return HuaweiPushListenerProvider.INSTANCE.hasServices();
}
public final static class GoogleLocationRequest implements ILocationRequest {
public final static class HuaweiLocationRequest implements ILocationRequest {
private LocationRequest request;
private GoogleLocationRequest(LocationRequest request) {
private HuaweiLocationRequest(LocationRequest request) {
this.request = request;
}
@ -143,10 +148,10 @@ public class HuaweiLocationProvider implements ILocationServiceProvider {
}
}
public final static class GoogleApiClientImpl implements IMapApiClient {
public final static class HuaweiApiClientImpl implements IMapApiClient {
private HuaweiApiClient apiClient;
private GoogleApiClientImpl(HuaweiApiClient apiClient) {
private HuaweiApiClientImpl(HuaweiApiClient apiClient) {
this.apiClient = apiClient;
}