update to 9.4.9

This commit is contained in:
xaxtix 2023-02-28 23:33:54 +04:00
parent 8bb3438f62
commit 1ac56c671e
16 changed files with 108 additions and 101 deletions

View file

@ -719,6 +719,7 @@ JNIEXPORT jlong JNICALL Java_org_telegram_messenger_voip_NativeInstance_makeNati
}, },
.platformContext = platformContext, .platformContext = platformContext,
}; };
descriptor.version = v;
for (int i = 0, size = env->GetArrayLength(endpoints); i < size; i++) { for (int i = 0, size = env->GetArrayLength(endpoints); i < size; i++) {
JavaObject endpointObject(env, env->GetObjectArrayElement(endpoints, i)); JavaObject endpointObject(env, env->GetObjectArrayElement(endpoints, i));

View file

@ -1893,9 +1893,6 @@ public class AndroidUtilities {
result = new ArrayList<>(); result = new ArrayList<>();
} }
File file = new File(path.substring(0, idx)); File file = new File(path.substring(0, idx));
if (!file.canWrite()) {
continue;
}
for (int i = 0; i < result.size(); i++) { for (int i = 0; i < result.size(); i++) {
if (result.get(i).getPath().equals(file.getPath())) { if (result.get(i).getPath().equals(file.getPath())) {
continue; continue;
@ -1930,7 +1927,7 @@ public class AndroidUtilities {
file = dirs[0]; file = dirs[0];
if (!TextUtils.isEmpty(SharedConfig.storageCacheDir)) { if (!TextUtils.isEmpty(SharedConfig.storageCacheDir)) {
for (int a = 0; a < dirs.length; a++) { for (int a = 0; a < dirs.length; a++) {
if (dirs[a] != null && dirs[a].getAbsolutePath().startsWith(SharedConfig.storageCacheDir) && dirs[a].canWrite()) { if (dirs[a] != null && dirs[a].getAbsolutePath().startsWith(SharedConfig.storageCacheDir)) {
file = dirs[a]; file = dirs[a];
break; break;
} }

View file

@ -24,8 +24,8 @@ public class BuildVars {
public static boolean USE_CLOUD_STRINGS = true; public static boolean USE_CLOUD_STRINGS = true;
public static boolean CHECK_UPDATES = true; public static boolean CHECK_UPDATES = true;
public static boolean NO_SCOPED_STORAGE = Build.VERSION.SDK_INT <= 29; public static boolean NO_SCOPED_STORAGE = Build.VERSION.SDK_INT <= 29;
public static int BUILD_VERSION = 3161; public static int BUILD_VERSION = 3164;
public static String BUILD_VERSION_STRING = "9.4.8"; public static String BUILD_VERSION_STRING = "9.4.9";
public static int APP_ID = 4; public static int APP_ID = 4;
public static String APP_HASH = "014b35b6184100b085b0d0572f9b5103"; public static String APP_HASH = "014b35b6184100b085b0d0572f9b5103";

View file

@ -2216,7 +2216,7 @@ public class ImageLoader {
if (dirs != null) { if (dirs != null) {
for (int a = 0, N = dirs.size(); a < N; a++) { for (int a = 0, N = dirs.size(); a < N; a++) {
File dir = dirs.get(a); File dir = dirs.get(a);
if (dir.getAbsolutePath().startsWith(SharedConfig.storageCacheDir) && dir.canWrite()) { if (dir.getAbsolutePath().startsWith(SharedConfig.storageCacheDir)) {
path = dir; path = dir;
break; break;
} }
@ -2250,7 +2250,7 @@ public class ImageLoader {
ArrayList<File> dirs = AndroidUtilities.getDataDirs(); ArrayList<File> dirs = AndroidUtilities.getDataDirs();
for (int a = 0, N = dirs.size(); a < N; a++) { for (int a = 0, N = dirs.size(); a < N; a++) {
File dir = dirs.get(a); File dir = dirs.get(a);
if (dir != null && !TextUtils.isEmpty(SharedConfig.storageCacheDir) && dir.getAbsolutePath().startsWith(SharedConfig.storageCacheDir) && dir.canWrite()) { if (dir != null && !TextUtils.isEmpty(SharedConfig.storageCacheDir) && dir.getAbsolutePath().startsWith(SharedConfig.storageCacheDir)) {
path = dir; path = dir;
telegramPath = new File(path, "Telegram"); telegramPath = new File(path, "Telegram");
telegramPath.mkdirs(); telegramPath.mkdirs();

View file

@ -40,7 +40,7 @@ public class LanguageDetector {
if (onFail != null) { if (onFail != null) {
onFail.run(e); onFail.run(e);
} }
FileLog.e(e); FileLog.e(e, false);
} }
} catch (Exception e) { } catch (Exception e) {
if (onFail != null) { if (onFail != null) {
@ -51,7 +51,7 @@ public class LanguageDetector {
if (onFail != null) { if (onFail != null) {
onFail.run(null); onFail.run(null);
} }
FileLog.e(t); FileLog.e(t, false);
} }
} }
} }

View file

@ -2001,6 +2001,7 @@ public class MediaController implements AudioManager.OnAudioFocusChangeListener,
} }
public boolean seekToProgress(MessageObject messageObject, float progress) { public boolean seekToProgress(MessageObject messageObject, float progress) {
final MessageObject playingMessageObject = this.playingMessageObject;
if (audioPlayer == null && videoPlayer == null || messageObject == null || playingMessageObject == null || !isSamePlayingMessage(messageObject)) { if (audioPlayer == null && videoPlayer == null || messageObject == null || playingMessageObject == null || !isSamePlayingMessage(messageObject)) {
return false; return false;
} }

View file

@ -8385,7 +8385,10 @@ public class MessagesStorage extends BaseController {
public void getMessages(long dialogId, long mergeDialogId, boolean loadInfo, int count, int max_id, int offset_date, int minDate, int classGuid, int load_type, boolean scheduled, int replyMessageId, int loadIndex, boolean processMessages, boolean isTopic) { public void getMessages(long dialogId, long mergeDialogId, boolean loadInfo, int count, int max_id, int offset_date, int minDate, int classGuid, int load_type, boolean scheduled, int replyMessageId, int loadIndex, boolean processMessages, boolean isTopic) {
storageQueue.postRunnable(() -> { storageQueue.postRunnable(() -> {
getMessagesInternal(dialogId, mergeDialogId, count, max_id, offset_date, minDate, classGuid, load_type, scheduled, replyMessageId, loadIndex, processMessages, isTopic).run(); Runnable processMessagesRunnable = getMessagesInternal(dialogId, mergeDialogId, count, max_id, offset_date, minDate, classGuid, load_type, scheduled, replyMessageId, loadIndex, processMessages, isTopic);
Utilities.stageQueue.postRunnable(() -> {
processMessagesRunnable.run();
});
}); });
} }

View file

@ -3791,7 +3791,7 @@ public class NotificationsController extends BaseController {
} }
} }
intent.putExtra("currentAccount", currentAccount); intent.putExtra("currentAccount", currentAccount);
PendingIntent contentIntent = PendingIntent.getActivity(ApplicationLoader.applicationContext, 0, intent, PendingIntent.FLAG_MUTABLE | PendingIntent.FLAG_ONE_SHOT); PendingIntent contentIntent = PendingIntent.getActivity(ApplicationLoader.applicationContext, 0, intent, PendingIntent.FLAG_IMMUTABLE | PendingIntent.FLAG_ONE_SHOT);
mBuilder.setContentTitle(name) mBuilder.setContentTitle(name)
.setSmallIcon(R.drawable.notification) .setSmallIcon(R.drawable.notification)
@ -3812,10 +3812,14 @@ public class NotificationsController extends BaseController {
mBuilder.addPerson("tel:+" + user.phone); mBuilder.addPerson("tel:+" + user.phone);
} }
try {
Intent dismissIntent = new Intent(ApplicationLoader.applicationContext, NotificationDismissReceiver.class); Intent dismissIntent = new Intent(ApplicationLoader.applicationContext, NotificationDismissReceiver.class);
dismissIntent.putExtra("messageDate", lastMessageObject.messageOwner.date); dismissIntent.putExtra("messageDate", lastMessageObject.messageOwner.date);
dismissIntent.putExtra("currentAccount", currentAccount); dismissIntent.putExtra("currentAccount", currentAccount);
mBuilder.setDeleteIntent(PendingIntent.getBroadcast(ApplicationLoader.applicationContext, 1, dismissIntent, PendingIntent.FLAG_MUTABLE | PendingIntent.FLAG_UPDATE_CURRENT)); mBuilder.setDeleteIntent(PendingIntent.getBroadcast(ApplicationLoader.applicationContext, 1, dismissIntent, PendingIntent.FLAG_MUTABLE | PendingIntent.FLAG_UPDATE_CURRENT));
} catch (Throwable e) {
FileLog.e(e);
}
if (photoPath != null) { if (photoPath != null) {
BitmapDrawable img = ImageLoader.getInstance().getImageFromMemory(photoPath, null, "50_50"); BitmapDrawable img = ImageLoader.getInstance().getImageFromMemory(photoPath, null, "50_50");
@ -3959,10 +3963,7 @@ public class NotificationsController extends BaseController {
showExtraNotifications(mBuilder, detailText, dialog_id, topicId, chatName, vibrationPattern, ledColor, sound, configImportance, isDefault, isInApp, notifyDisabled, chatType); showExtraNotifications(mBuilder, detailText, dialog_id, topicId, chatName, vibrationPattern, ledColor, sound, configImportance, isDefault, isInApp, notifyDisabled, chatType);
scheduleNotificationRepeat(); scheduleNotificationRepeat();
} catch (Exception e) { } catch (Exception e) {
// ignore xiaomi issues FileLog.e(e);
// Remote stack trace
// To many PendingIntent's
FileLog.e(e, !(e instanceof SecurityException));
} }
} }
@ -4544,7 +4545,7 @@ public class NotificationsController extends BaseController {
intent.putExtra("topicId", topicId); intent.putExtra("topicId", topicId);
} }
intent.putExtra("currentAccount", currentAccount); intent.putExtra("currentAccount", currentAccount);
PendingIntent contentIntent = PendingIntent.getActivity(ApplicationLoader.applicationContext, 0, intent, PendingIntent.FLAG_MUTABLE | PendingIntent.FLAG_ONE_SHOT); PendingIntent contentIntent = PendingIntent.getActivity(ApplicationLoader.applicationContext, 0, intent, PendingIntent.FLAG_IMMUTABLE | PendingIntent.FLAG_ONE_SHOT);
NotificationCompat.WearableExtender wearableExtender = new NotificationCompat.WearableExtender(); NotificationCompat.WearableExtender wearableExtender = new NotificationCompat.WearableExtender();
if (wearReplyAction != null) { if (wearReplyAction != null) {
@ -4601,11 +4602,15 @@ public class NotificationsController extends BaseController {
.setSortKey(String.valueOf(Long.MAX_VALUE - date)) .setSortKey(String.valueOf(Long.MAX_VALUE - date))
.setCategory(NotificationCompat.CATEGORY_MESSAGE); .setCategory(NotificationCompat.CATEGORY_MESSAGE);
try {
Intent dismissIntent = new Intent(ApplicationLoader.applicationContext, NotificationDismissReceiver.class); Intent dismissIntent = new Intent(ApplicationLoader.applicationContext, NotificationDismissReceiver.class);
dismissIntent.putExtra("messageDate", maxDate); dismissIntent.putExtra("messageDate", maxDate);
dismissIntent.putExtra("dialogId", dialogId); dismissIntent.putExtra("dialogId", dialogId);
dismissIntent.putExtra("currentAccount", currentAccount); dismissIntent.putExtra("currentAccount", currentAccount);
builder.setDeleteIntent(PendingIntent.getBroadcast(ApplicationLoader.applicationContext, internalId, dismissIntent, PendingIntent.FLAG_MUTABLE | PendingIntent.FLAG_UPDATE_CURRENT)); builder.setDeleteIntent(PendingIntent.getBroadcast(ApplicationLoader.applicationContext, internalId, dismissIntent, PendingIntent.FLAG_MUTABLE | PendingIntent.FLAG_UPDATE_CURRENT));
} catch (Exception e) {
FileLog.e(e);
}
if (useSummaryNotification) { if (useSummaryNotification) {
builder.setGroup(notificationGroup); builder.setGroup(notificationGroup);

View file

@ -1501,4 +1501,8 @@ public class SharedConfig {
public static boolean deviceIsHigh() { public static boolean deviceIsHigh() {
return getDevicePerformanceClass() >= PERFORMANCE_CLASS_HIGH; return getDevicePerformanceClass() >= PERFORMANCE_CLASS_HIGH;
} }
public static boolean deviceIsAverage() {
return getDevicePerformanceClass() <= PERFORMANCE_CLASS_AVERAGE;
}
} }

View file

@ -14,6 +14,7 @@ import org.telegram.messenger.AndroidUtilities;
import org.telegram.messenger.BuildVars; import org.telegram.messenger.BuildVars;
import org.telegram.messenger.FileLog; import org.telegram.messenger.FileLog;
import org.telegram.messenger.MediaController; import org.telegram.messenger.MediaController;
import org.telegram.messenger.SharedConfig;
import org.telegram.messenger.Utilities; import org.telegram.messenger.Utilities;
import org.telegram.messenger.VideoEditedInfo; import org.telegram.messenger.VideoEditedInfo;
@ -994,8 +995,12 @@ public class MediaCodecVideoConvertor {
final int dstHeight, boolean external) { final int dstHeight, boolean external) {
final float kernelSize = Utilities.clamp((float) (Math.max(srcWidth, srcHeight) / (float) Math.max(dstHeight, dstWidth)) * 0.8f, 2f, 1f); final float kernelSize = Utilities.clamp((float) (Math.max(srcWidth, srcHeight) / (float) Math.max(dstHeight, dstWidth)) * 0.8f, 2f, 1f);
final int kernelRadius = (int) kernelSize; int kernelRadius = (int) kernelSize;
if (kernelRadius > 1 && SharedConfig.deviceIsAverage()) {
kernelRadius = 1;
}
FileLog.d("source size " + srcWidth + "x" + srcHeight + " dest size " + dstWidth + dstHeight + " kernelRadius " + kernelRadius); FileLog.d("source size " + srcWidth + "x" + srcHeight + " dest size " + dstWidth + dstHeight + " kernelRadius " + kernelRadius);
if (external) { if (external) {
return "#extension GL_OES_EGL_image_external : require\n" + return "#extension GL_OES_EGL_image_external : require\n" +
"precision mediump float;\n" + "precision mediump float;\n" +

View file

@ -7046,7 +7046,7 @@ public class Theme {
SharedPreferences preferences = MessagesController.getGlobalMainSettings(); SharedPreferences preferences = MessagesController.getGlobalMainSettings();
SharedPreferences.Editor editor = preferences.edit(); SharedPreferences.Editor editor = preferences.edit();
editor.putString("theme", themeInfo.getKey()); editor.putString("theme", themeInfo.getKey());
editor.apply(); editor.commit();
} }
String[] wallpaperLink = new String[1]; String[] wallpaperLink = new String[1];
if (themeInfo.assetName != null) { if (themeInfo.assetName != null) {
@ -7131,7 +7131,7 @@ public class Theme {
SharedPreferences preferences = MessagesController.getGlobalMainSettings(); SharedPreferences preferences = MessagesController.getGlobalMainSettings();
SharedPreferences.Editor editor = preferences.edit(); SharedPreferences.Editor editor = preferences.edit();
editor.remove("theme"); editor.remove("theme");
editor.apply(); editor.commit();
} }
currentColorsNoAccent.clear(); currentColorsNoAccent.clear();
themedWallpaperFileOffset = 0; themedWallpaperFileOffset = 0;

View file

@ -365,7 +365,7 @@ public class CacheControlActivity extends BaseFragment implements NotificationCe
if (!TextUtils.isEmpty(SharedConfig.storageCacheDir)) { if (!TextUtils.isEmpty(SharedConfig.storageCacheDir)) {
for (int a = 0, N = storageDirs.size(); a < N; a++) { for (int a = 0, N = storageDirs.size(); a < N; a++) {
File file = storageDirs.get(a); File file = storageDirs.get(a);
if (file.getAbsolutePath().startsWith(SharedConfig.storageCacheDir) && file.canWrite()) { if (file.getAbsolutePath().startsWith(SharedConfig.storageCacheDir)) {
path = file; path = file;
break; break;
} }

View file

@ -24,24 +24,19 @@ import androidx.annotation.Nullable;
import com.google.android.exoplayer2.C; import com.google.android.exoplayer2.C;
import com.google.android.exoplayer2.DefaultLoadControl; import com.google.android.exoplayer2.DefaultLoadControl;
import com.google.android.exoplayer2.DefaultRenderersFactory; import com.google.android.exoplayer2.DefaultRenderersFactory;
import com.google.android.exoplayer2.ExoPlaybackException;
import com.google.android.exoplayer2.ExoPlayer; import com.google.android.exoplayer2.ExoPlayer;
import com.google.android.exoplayer2.MediaItem; import com.google.android.exoplayer2.MediaItem;
import com.google.android.exoplayer2.PlaybackException; import com.google.android.exoplayer2.PlaybackException;
import com.google.android.exoplayer2.PlaybackParameters; import com.google.android.exoplayer2.PlaybackParameters;
import com.google.android.exoplayer2.Player; import com.google.android.exoplayer2.Player;
import com.google.android.exoplayer2.Renderer;
import com.google.android.exoplayer2.SimpleExoPlayer;
import com.google.android.exoplayer2.analytics.AnalyticsListener; import com.google.android.exoplayer2.analytics.AnalyticsListener;
import com.google.android.exoplayer2.audio.AudioAttributes; import com.google.android.exoplayer2.audio.AudioAttributes;
import com.google.android.exoplayer2.audio.AudioCapabilities; import com.google.android.exoplayer2.audio.AudioCapabilities;
import com.google.android.exoplayer2.audio.AudioProcessor; import com.google.android.exoplayer2.audio.AudioProcessor;
import com.google.android.exoplayer2.audio.AudioRendererEventListener;
import com.google.android.exoplayer2.audio.AudioSink; import com.google.android.exoplayer2.audio.AudioSink;
import com.google.android.exoplayer2.audio.DefaultAudioSink; import com.google.android.exoplayer2.audio.DefaultAudioSink;
import com.google.android.exoplayer2.audio.TeeAudioProcessor; import com.google.android.exoplayer2.audio.TeeAudioProcessor;
import com.google.android.exoplayer2.mediacodec.MediaCodecRenderer; import com.google.android.exoplayer2.mediacodec.MediaCodecRenderer;
import com.google.android.exoplayer2.mediacodec.MediaCodecSelector;
import com.google.android.exoplayer2.source.LoopingMediaSource; import com.google.android.exoplayer2.source.LoopingMediaSource;
import com.google.android.exoplayer2.source.MediaSource; import com.google.android.exoplayer2.source.MediaSource;
import com.google.android.exoplayer2.source.ProgressiveMediaSource; import com.google.android.exoplayer2.source.ProgressiveMediaSource;
@ -52,7 +47,6 @@ import com.google.android.exoplayer2.trackselection.DefaultTrackSelector;
import com.google.android.exoplayer2.trackselection.MappingTrackSelector; import com.google.android.exoplayer2.trackselection.MappingTrackSelector;
import com.google.android.exoplayer2.upstream.DataSource; import com.google.android.exoplayer2.upstream.DataSource;
import com.google.android.exoplayer2.upstream.DefaultAllocator; import com.google.android.exoplayer2.upstream.DefaultAllocator;
import com.google.android.exoplayer2.upstream.DefaultBandwidthMeter;
import com.google.android.exoplayer2.video.SurfaceNotValidException; import com.google.android.exoplayer2.video.SurfaceNotValidException;
import com.google.android.exoplayer2.video.VideoListener; import com.google.android.exoplayer2.video.VideoListener;
import com.google.android.exoplayer2.video.VideoSize; import com.google.android.exoplayer2.video.VideoSize;
@ -64,7 +58,6 @@ import org.telegram.messenger.NotificationCenter;
import org.telegram.messenger.secretmedia.ExtendedDefaultDataSourceFactory; import org.telegram.messenger.secretmedia.ExtendedDefaultDataSourceFactory;
import java.nio.ByteBuffer; import java.nio.ByteBuffer;
import java.util.ArrayList;
@SuppressLint("NewApi") @SuppressLint("NewApi")
public class VideoPlayer implements Player.Listener, VideoListener, AnalyticsListener, NotificationCenter.NotificationCenterDelegate { public class VideoPlayer implements Player.Listener, VideoListener, AnalyticsListener, NotificationCenter.NotificationCenterDelegate {

View file

@ -206,7 +206,7 @@ public class DefaultThemesPreviewCell extends LinearLayout {
pos[0] += dayNightCell.getImageView().getMeasuredWidth() / 2; pos[0] += dayNightCell.getImageView().getMeasuredWidth() / 2;
pos[1] += dayNightCell.getImageView().getMeasuredHeight() / 2 + AndroidUtilities.dp(3); pos[1] += dayNightCell.getImageView().getMeasuredHeight() / 2 + AndroidUtilities.dp(3);
Runnable then = () -> AndroidUtilities.runOnUIThread(() -> { NotificationCenter.getGlobalInstance().postNotificationName(NotificationCenter.needSetDayNightTheme, themeInfo, false, pos, -1, toDark, dayNightCell.getImageView(), dayNightCell);
updateDayNightMode(); updateDayNightMode();
updateSelectedPosition(); updateSelectedPosition();
@ -264,8 +264,6 @@ public class DefaultThemesPreviewCell extends LinearLayout {
} else { } else {
dayNightCell.setTextAndIcon(LocaleController.getString("SettingsSwitchToDayMode", R.string.SettingsSwitchToDayMode), darkThemeDrawable, true); dayNightCell.setTextAndIcon(LocaleController.getString("SettingsSwitchToDayMode", R.string.SettingsSwitchToDayMode), darkThemeDrawable, true);
} }
});
NotificationCenter.getGlobalInstance().postNotificationName(NotificationCenter.needSetDayNightTheme, themeInfo, false, pos, -1, toDark, dayNightCell.getImageView(), dayNightCell, then);
} }
}); });

View file

@ -980,7 +980,7 @@ public class LNavigation extends FrameLayout implements INavigationLayout, Float
rebuildFragments(REBUILD_FLAG_REBUILD_LAST); rebuildFragments(REBUILD_FLAG_REBUILD_LAST);
} }
fragment.setParentLayout(this); fragment.setParentLayout(this);
if (position == -1 || position >= fragmentStack.size()) { if (position < 0 || position >= fragmentStack.size()) {
BaseFragment lastFragment = getLastFragment(); BaseFragment lastFragment = getLastFragment();
if (lastFragment != null) { if (lastFragment != null) {
lastFragment.setPaused(true); lastFragment.setPaused(true);

View file

@ -13,12 +13,12 @@
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true # org.gradle.parallel=true
#Sat Mar 12 05:53:50 MSK 2016 #Sat Mar 12 05:53:50 MSK 2016
APP_VERSION_NAME=9.4.8 APP_VERSION_NAME=9.4.9
APP_VERSION_CODE=3161 APP_VERSION_CODE=3164
APP_PACKAGE=org.telegram.messenger APP_PACKAGE=org.telegram.messenger
RELEASE_KEY_PASSWORD=android RELEASE_KEY_PASSWORD=TelegramAndroidPswd
RELEASE_KEY_ALIAS=androidkey RELEASE_KEY_ALIAS=tmessages
RELEASE_STORE_PASSWORD=android RELEASE_STORE_PASSWORD=TelegramAndroidPswd
org.gradle.jvmargs=-Xmx4096M -XX:MaxPermSize=4096m org.gradle.jvmargs=-Xmx4096M -XX:MaxPermSize=4096m
org.gradle.daemon=true org.gradle.daemon=true
org.gradle.parallel=true org.gradle.parallel=true