update to 9.4.6
This commit is contained in:
parent
810bc4ae67
commit
116092e32d
@ -301,7 +301,7 @@ public:
|
||||
return webrtc::DtlsSrtpTransport::SendRtpPacket(packet, options, flags);
|
||||
}
|
||||
|
||||
void ProcessRtpPacket(webrtc::RtpPacketReceived const &packet, bool isUnresolved) {
|
||||
void ProcessRtpPacket(webrtc::RtpPacketReceived const &packet, bool isUnresolved) override {
|
||||
_processRtpPacket(packet, isUnresolved);
|
||||
}
|
||||
|
||||
|
@ -37,7 +37,6 @@ std::unique_ptr<webrtc::VideoEncoderFactory> AndroidInterface::makeVideoEncoderF
|
||||
webrtc::ScopedJavaLocalRef<jclass> factory_class = webrtc::GetClass(env, "org/webrtc/DefaultVideoEncoderFactory");
|
||||
jmethodID factory_constructor = env->GetMethodID(factory_class.obj(), "<init>", "(Lorg/webrtc/EglBase$Context;ZZ)V");
|
||||
webrtc::ScopedJavaLocalRef<jobject> factory_object(env, env->NewObject(factory_class.obj(), factory_constructor, eglContext, false, true));
|
||||
|
||||
return webrtc::JavaToNativeVideoEncoderFactory(env, factory_object.obj());
|
||||
}
|
||||
|
||||
|
@ -879,6 +879,7 @@ public:
|
||||
"WebRTC-DataChannel-Dcsctp/Enabled/"
|
||||
"WebRTC-Audio-MinimizeResamplingOnMobile/Enabled/"
|
||||
"WebRTC-Audio-iOS-Holding/Enabled/"
|
||||
"WebRTC-IceFieldTrials/skip_relay_to_non_relay_connections:true/"
|
||||
);
|
||||
}
|
||||
|
||||
@ -2146,7 +2147,11 @@ InstanceV2Impl::InstanceV2Impl(Descriptor &&descriptor) {
|
||||
if (descriptor.config.logPath.data.size() != 0) {
|
||||
_logSink = std::make_unique<LogSinkImpl>(descriptor.config.logPath);
|
||||
}
|
||||
#ifdef DEBUG
|
||||
rtc::LogMessage::LogToDebug(rtc::LS_VERBOSE);
|
||||
#else
|
||||
rtc::LogMessage::LogToDebug(rtc::LS_INFO);
|
||||
#endif
|
||||
rtc::LogMessage::SetLogToStderr(false);
|
||||
if (_logSink) {
|
||||
rtc::LogMessage::AddLogToStream(_logSink.get(), rtc::LS_INFO);
|
||||
|
@ -364,7 +364,17 @@ cricket::Connection* ReflectorPort::CreateConnection(const cricket::Candidate& r
|
||||
if (!SupportsProtocol(remote_candidate.protocol())) {
|
||||
return nullptr;
|
||||
}
|
||||
if (remote_candidate.address().port() != serverId_) {
|
||||
|
||||
auto remoteHostname = remote_candidate.address().hostname();
|
||||
if (remoteHostname.empty()) {
|
||||
return nullptr;
|
||||
}
|
||||
std::ostringstream ipFormat;
|
||||
ipFormat << "reflector-" << (uint32_t)serverId_ << "-";
|
||||
if (!absl::StartsWith(remoteHostname, ipFormat.str()) || !absl::EndsWith(remoteHostname, ".reflector")) {
|
||||
return nullptr;
|
||||
}
|
||||
if (remote_candidate.address().port() != server_address_.address.port()) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@ -424,9 +434,44 @@ int ReflectorPort::SendTo(const void* data,
|
||||
const rtc::PacketOptions& options,
|
||||
bool payload) {
|
||||
rtc::CopyOnWriteBuffer targetPeerTag;
|
||||
uint32_t ipAddress = addr.ip();
|
||||
|
||||
auto syntheticHostname = addr.hostname();
|
||||
|
||||
uint32_t resolvedPeerTag = 0;
|
||||
auto resolvedPeerTagIt = resolved_peer_tags_by_hostname_.find(syntheticHostname);
|
||||
if (resolvedPeerTagIt != resolved_peer_tags_by_hostname_.end()) {
|
||||
resolvedPeerTag = resolvedPeerTagIt->second;
|
||||
} else {
|
||||
std::ostringstream prefixFormat;
|
||||
prefixFormat << "reflector-" << (uint32_t)serverId_ << "-";
|
||||
std::string suffixFormat = ".reflector";
|
||||
if (!absl::StartsWith(syntheticHostname, prefixFormat.str()) || !absl::EndsWith(syntheticHostname, suffixFormat)) {
|
||||
RTC_LOG(LS_ERROR) << ToString()
|
||||
<< ": Discarding SendTo request with destination "
|
||||
<< addr.ToString();
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
auto startPosition = prefixFormat.str().size();
|
||||
auto tagString = syntheticHostname.substr(startPosition, syntheticHostname.size() - suffixFormat.size() - startPosition);
|
||||
|
||||
std::stringstream tagStringStream(tagString);
|
||||
tagStringStream >> resolvedPeerTag;
|
||||
|
||||
if (resolvedPeerTag == 0) {
|
||||
RTC_LOG(LS_ERROR) << ToString()
|
||||
<< ": Discarding SendTo request with destination "
|
||||
<< addr.ToString() << " (could not parse peer tag)";
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
resolved_peer_tags_by_hostname_.insert(std::make_pair(syntheticHostname, resolvedPeerTag));
|
||||
}
|
||||
|
||||
targetPeerTag.AppendData(peer_tag_.data(), peer_tag_.size() - 4);
|
||||
targetPeerTag.AppendData((uint8_t *)&ipAddress, 4);
|
||||
targetPeerTag.AppendData((uint8_t *)&resolvedPeerTag, 4);
|
||||
|
||||
rtc::ByteBufferWriter bufferWriter;
|
||||
bufferWriter.WriteBytes((const char *)targetPeerTag.data(), targetPeerTag.size());
|
||||
@ -505,7 +550,13 @@ bool ReflectorPort::HandleIncomingPacket(rtc::AsyncPacketSocket* socket,
|
||||
if (state_ != STATE_READY) {
|
||||
state_ = STATE_READY;
|
||||
|
||||
rtc::SocketAddress candidateAddress(randomTag_, serverId_);
|
||||
RTC_LOG(LS_INFO)
|
||||
<< ToString()
|
||||
<< ": REFLECTOR " << server_address_.address.ToString() << " is now ready";
|
||||
|
||||
std::ostringstream ipFormat;
|
||||
ipFormat << "reflector-" << (uint32_t)serverId_ << "-" << randomTag_ << ".reflector";
|
||||
rtc::SocketAddress candidateAddress(ipFormat.str(), server_address_.address.port());
|
||||
|
||||
// For relayed candidate, Base is the candidate itself.
|
||||
AddAddress(candidateAddress, // Candidate address.
|
||||
@ -545,7 +596,10 @@ bool ReflectorPort::HandleIncomingPacket(rtc::AsyncPacketSocket* socket,
|
||||
<< ToString()
|
||||
<< ": Received data packet with invalid size tag";
|
||||
} else {
|
||||
rtc::SocketAddress candidateAddress(senderTag, serverId_);
|
||||
std::ostringstream ipFormat;
|
||||
ipFormat << "reflector-" << (uint32_t)serverId_ << "-" << senderTag << ".reflector";
|
||||
rtc::SocketAddress candidateAddress(ipFormat.str(), server_address_.address.port());
|
||||
candidateAddress.SetResolvedIP(server_address_.address.ipaddr());
|
||||
|
||||
DispatchPacket(data + 16 + 4 + 4, dataSize, candidateAddress, cricket::ProtocolType::PROTO_UDP, packet_time_us);
|
||||
}
|
||||
|
@ -210,6 +210,8 @@ private:
|
||||
cricket::ProtocolAddress server_address_;
|
||||
uint8_t serverId_ = 0;
|
||||
|
||||
std::map<std::string, uint32_t> resolved_peer_tags_by_hostname_;
|
||||
|
||||
cricket::RelayCredentials credentials_;
|
||||
AttemptedServerSet attempted_server_addresses_;
|
||||
|
||||
|
@ -24,8 +24,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 = 3152;
|
||||
public static String BUILD_VERSION_STRING = "9.4.5";
|
||||
public static int BUILD_VERSION = 3155;
|
||||
public static String BUILD_VERSION_STRING = "9.4.6";
|
||||
public static int APP_ID = 4;
|
||||
public static String APP_HASH = "014b35b6184100b085b0d0572f9b5103";
|
||||
|
||||
|
@ -8,6 +8,7 @@
|
||||
|
||||
package org.telegram.messenger;
|
||||
|
||||
import org.telegram.messenger.utils.ImmutableByteArrayOutputStream;
|
||||
import org.telegram.tgnet.ConnectionsManager;
|
||||
import org.telegram.tgnet.NativeByteBuffer;
|
||||
import org.telegram.tgnet.TLObject;
|
||||
@ -35,6 +36,7 @@ public class FileLoadOperation {
|
||||
long streamOffset;
|
||||
|
||||
public static volatile DispatchQueue filesQueue = new DispatchQueue("writeFileQueue");
|
||||
public static ImmutableByteArrayOutputStream filesQueueByteBuffer;
|
||||
private boolean forceSmallChunk;
|
||||
|
||||
public void setStream(FileLoadOperationStream stream, boolean streamPriority, long streamOffset) {
|
||||
@ -518,18 +520,28 @@ public class FileLoadOperation {
|
||||
filesQueue.postRunnable(() -> {
|
||||
long time = System.currentTimeMillis();
|
||||
try {
|
||||
if (filePartsStream == null) {
|
||||
return;
|
||||
}
|
||||
int countFinal = rangesFinal.size();
|
||||
int bufferSize = 4 + 8 * 2 * countFinal;
|
||||
if (filesQueueByteBuffer == null) {
|
||||
filesQueueByteBuffer = new ImmutableByteArrayOutputStream(bufferSize);
|
||||
} else {
|
||||
filesQueueByteBuffer.reset();
|
||||
}
|
||||
filesQueueByteBuffer.writeInt(countFinal);
|
||||
for (int a = 0; a < countFinal; a++) {
|
||||
Range rangeFinal = rangesFinal.get(a);
|
||||
filesQueueByteBuffer.writeLong(rangeFinal.start);
|
||||
filesQueueByteBuffer.writeLong(rangeFinal.end);
|
||||
}
|
||||
synchronized (FileLoadOperation.this) {
|
||||
if (filePartsStream == null) {
|
||||
return;
|
||||
}
|
||||
filePartsStream.seek(0);
|
||||
int countFinal = rangesFinal.size();
|
||||
filePartsStream.writeInt(countFinal);
|
||||
for (int a = 0; a < countFinal; a++) {
|
||||
Range rangeFinal = rangesFinal.get(a);
|
||||
filePartsStream.writeLong(rangeFinal.start);
|
||||
filePartsStream.writeLong(rangeFinal.end);
|
||||
}
|
||||
filePartsStream.write(filesQueueByteBuffer.buf, 0, bufferSize);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
if (AndroidUtilities.isENOSPC(e)) {
|
||||
|
@ -259,9 +259,9 @@ public class FileUploadOperation {
|
||||
started = true;
|
||||
if (stream == null) {
|
||||
File cacheFile = new File(uploadingFilePath);
|
||||
if (AndroidUtilities.isInternalUri(Uri.fromFile(cacheFile))) {
|
||||
throw new FileLog.IgnoreSentException("trying to upload internal file");
|
||||
}
|
||||
// if (AndroidUtilities.isInternalUri(Uri.fromFile(cacheFile))) {
|
||||
// throw new FileLog.IgnoreSentException("trying to upload internal file");
|
||||
// }
|
||||
stream = new RandomAccessFile(cacheFile, "r");
|
||||
boolean isInternalFile = false;
|
||||
try {
|
||||
|
@ -30,11 +30,18 @@ public class LiteMode {
|
||||
public static final int FLAG_AUTOPLAY_VIDEOS = 1024;
|
||||
public static final int FLAG_AUTOPLAY_GIFS = 2048;
|
||||
|
||||
public static final int ENABLED = (
|
||||
FLAGS_ANIMATED_STICKERS |
|
||||
FLAGS_ANIMATED_EMOJI |
|
||||
FLAGS_CHAT |
|
||||
FLAG_CALLS_ANIMATIONS
|
||||
);
|
||||
|
||||
public static final int PRESET_LOW = 0;
|
||||
public static final int PRESET_MEDIUM = (
|
||||
FLAG_ANIMATED_STICKERS_CHAT |
|
||||
FLAG_ANIMATED_EMOJI_CHAT |
|
||||
FLAG_CHAT_FORUM_TWOCOLUMN |
|
||||
FLAGS_ANIMATED_STICKERS |
|
||||
FLAGS_ANIMATED_EMOJI |
|
||||
FLAGS_CHAT |
|
||||
FLAG_CALLS_ANIMATIONS |
|
||||
FLAG_AUTOPLAY_VIDEOS |
|
||||
FLAG_AUTOPLAY_GIFS
|
||||
@ -111,6 +118,14 @@ public class LiteMode {
|
||||
|
||||
final SharedPreferences preferences = MessagesController.getGlobalMainSettings();
|
||||
if (!preferences.contains("lite_mode")) {
|
||||
if (preferences.contains("light_mode")) {
|
||||
boolean prevLiteModeEnabled = (preferences.getInt("light_mode", SharedConfig.getDevicePerformanceClass() == SharedConfig.PERFORMANCE_CLASS_LOW ? 1 : 0) & 1) > 0;
|
||||
if (prevLiteModeEnabled) {
|
||||
defaultValue = PRESET_LOW;
|
||||
} else {
|
||||
defaultValue = PRESET_HIGH;
|
||||
}
|
||||
}
|
||||
// migrate settings
|
||||
if (preferences.contains("loopStickers")) {
|
||||
boolean loopStickers = preferences.getBoolean("loopStickers", true);
|
||||
|
@ -3647,8 +3647,6 @@ public class MediaController implements AudioManager.OnAudioFocusChangeListener,
|
||||
AndroidUtilities.runOnUIThread(() -> {
|
||||
recordStartRunnable = null;
|
||||
NotificationCenter.getInstance(currentAccount).postNotificationName(NotificationCenter.recordStartError, guid);
|
||||
NotificationCenter.getInstance(recordingCurrentAccount).postNotificationName(NotificationCenter.audioDidSent, recordingGuid, null, null);
|
||||
|
||||
});
|
||||
return;
|
||||
}
|
||||
@ -3657,7 +3655,6 @@ public class MediaController implements AudioManager.OnAudioFocusChangeListener,
|
||||
AndroidUtilities.runOnUIThread(() -> {
|
||||
recordStartRunnable = null;
|
||||
NotificationCenter.getInstance(currentAccount).postNotificationName(NotificationCenter.recordStarted, guid, true);
|
||||
NotificationCenter.getInstance(recordingCurrentAccount).postNotificationName(NotificationCenter.audioDidSent, recordingGuid, null, null);
|
||||
});
|
||||
}, paused ? 500 : 50);
|
||||
}
|
||||
|
@ -2360,6 +2360,7 @@ public class MessageObject {
|
||||
messageOwner.peer_id.channel_id = chat.id;
|
||||
messageOwner.unread = false;
|
||||
MediaController mediaController = MediaController.getInstance();
|
||||
isOutOwnerCached = null;
|
||||
|
||||
if (message instanceof TLRPC.TL_messageEmpty) {
|
||||
message = null;
|
||||
@ -5608,7 +5609,7 @@ public class MessageObject {
|
||||
return messageOwner.out;
|
||||
}
|
||||
|
||||
Boolean isOutOwnerCached;
|
||||
public Boolean isOutOwnerCached;
|
||||
public boolean isOutOwner() {
|
||||
if (preview) {
|
||||
return true;
|
||||
|
@ -945,7 +945,7 @@ public class SharedConfig {
|
||||
}
|
||||
|
||||
public static void toggleAutoplayVideo() {
|
||||
LiteMode.toggleFlag(LiteMode.FLAG_AUTOPLAY_VIDEOS, !isAutoplayVideo());
|
||||
LiteMode.toggleFlag(LiteMode.FLAG_AUTOPLAY_VIDEOS);
|
||||
}
|
||||
|
||||
public static boolean isSecretMapPreviewSet() {
|
||||
|
@ -16,11 +16,9 @@ import org.telegram.ui.Components.RLottieDrawable;
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
import java.io.RandomAccessFile;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
@ -224,7 +222,7 @@ public class BitmapsCache {
|
||||
}
|
||||
sharedTools.allocate(h, w);
|
||||
Bitmap[] bitmap = sharedTools.bitmap;
|
||||
ByteArrayOutputStream[] byteArrayOutputStream = sharedTools.byteArrayOutputStream;
|
||||
ImmutableByteArrayOutputStream[] byteArrayOutputStream = sharedTools.byteArrayOutputStream;
|
||||
CountDownLatch[] countDownLatch = new CountDownLatch[N];
|
||||
|
||||
ArrayList<FrameOffset> frameOffsets = new ArrayList<>();
|
||||
@ -587,82 +585,6 @@ public class BitmapsCache {
|
||||
Bitmap getFirstFrame(Bitmap bitmap);
|
||||
}
|
||||
|
||||
public static class ByteArrayOutputStream extends OutputStream {
|
||||
|
||||
protected byte buf[];
|
||||
|
||||
protected int count;
|
||||
|
||||
public ByteArrayOutputStream() {
|
||||
this(32);
|
||||
}
|
||||
|
||||
public ByteArrayOutputStream(int size) {
|
||||
buf = new byte[size];
|
||||
}
|
||||
|
||||
private void ensureCapacity(int minCapacity) {
|
||||
if (minCapacity - buf.length > 0) {
|
||||
grow(minCapacity);
|
||||
}
|
||||
}
|
||||
|
||||
private static final int MAX_ARRAY_SIZE = Integer.MAX_VALUE - 8;
|
||||
|
||||
private void grow(int minCapacity) {
|
||||
int oldCapacity = buf.length;
|
||||
int newCapacity = oldCapacity << 1;
|
||||
if (newCapacity - minCapacity < 0)
|
||||
newCapacity = minCapacity;
|
||||
if (newCapacity - MAX_ARRAY_SIZE > 0)
|
||||
newCapacity = hugeCapacity(minCapacity);
|
||||
buf = Arrays.copyOf(buf, newCapacity);
|
||||
}
|
||||
|
||||
private static int hugeCapacity(int minCapacity) {
|
||||
if (minCapacity < 0) // overflow
|
||||
throw new OutOfMemoryError();
|
||||
return (minCapacity > MAX_ARRAY_SIZE) ?
|
||||
Integer.MAX_VALUE :
|
||||
MAX_ARRAY_SIZE;
|
||||
}
|
||||
|
||||
public synchronized void write(int b) {
|
||||
ensureCapacity(count + 1);
|
||||
buf[count] = (byte) b;
|
||||
count += 1;
|
||||
}
|
||||
|
||||
public void writeInt(int value) {
|
||||
ensureCapacity(count + 4);
|
||||
buf[count] = (byte) (value >>> 24);
|
||||
buf[count + 1] = (byte) (value >>> 16);
|
||||
buf[count + 2] = (byte) (value >>> 8);
|
||||
buf[count + 3] = (byte) (value);
|
||||
count += 4;
|
||||
}
|
||||
|
||||
public synchronized void write(byte b[], int off, int len) {
|
||||
if ((off < 0) || (off > b.length) || (len < 0) ||
|
||||
((off + len) - b.length > 0)) {
|
||||
throw new IndexOutOfBoundsException();
|
||||
}
|
||||
ensureCapacity(count + len);
|
||||
System.arraycopy(b, off, buf, count, len);
|
||||
count += len;
|
||||
}
|
||||
|
||||
public synchronized void writeTo(OutputStream out) throws IOException {
|
||||
out.write(buf, 0, count);
|
||||
}
|
||||
|
||||
public synchronized void reset() {
|
||||
count = 0;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
public static class Metadata {
|
||||
public int frame;
|
||||
}
|
||||
@ -674,7 +596,7 @@ public class BitmapsCache {
|
||||
}
|
||||
|
||||
private static class CacheGeneratorSharedTools {
|
||||
ByteArrayOutputStream[] byteArrayOutputStream = new ByteArrayOutputStream[N];
|
||||
ImmutableByteArrayOutputStream[] byteArrayOutputStream = new ImmutableByteArrayOutputStream[N];
|
||||
private Bitmap[] bitmap = new Bitmap[N];
|
||||
|
||||
private int lastSize;
|
||||
@ -701,7 +623,7 @@ public class BitmapsCache {
|
||||
bitmap[i] = Bitmap.createBitmap(w, h, Bitmap.Config.ARGB_8888);
|
||||
}
|
||||
if (byteArrayOutputStream[i] == null) {
|
||||
byteArrayOutputStream[i] = new ByteArrayOutputStream(w * h * 2);
|
||||
byteArrayOutputStream[i] = new ImmutableByteArrayOutputStream(w * h * 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,93 @@
|
||||
package org.telegram.messenger.utils;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
import java.util.Arrays;
|
||||
|
||||
public class ImmutableByteArrayOutputStream extends OutputStream {
|
||||
|
||||
public byte buf[];
|
||||
|
||||
protected int count;
|
||||
|
||||
public ImmutableByteArrayOutputStream() {
|
||||
this(32);
|
||||
}
|
||||
|
||||
public ImmutableByteArrayOutputStream(int size) {
|
||||
buf = new byte[size];
|
||||
}
|
||||
|
||||
private void ensureCapacity(int minCapacity) {
|
||||
if (minCapacity - buf.length > 0) {
|
||||
grow(minCapacity);
|
||||
}
|
||||
}
|
||||
|
||||
private static final int MAX_ARRAY_SIZE = Integer.MAX_VALUE - 8;
|
||||
|
||||
private void grow(int minCapacity) {
|
||||
int oldCapacity = buf.length;
|
||||
int newCapacity = oldCapacity << 1;
|
||||
if (newCapacity - minCapacity < 0)
|
||||
newCapacity = minCapacity;
|
||||
if (newCapacity - MAX_ARRAY_SIZE > 0)
|
||||
newCapacity = hugeCapacity(minCapacity);
|
||||
buf = Arrays.copyOf(buf, newCapacity);
|
||||
}
|
||||
|
||||
private static int hugeCapacity(int minCapacity) {
|
||||
if (minCapacity < 0) // overflow
|
||||
throw new OutOfMemoryError();
|
||||
return (minCapacity > MAX_ARRAY_SIZE) ?
|
||||
Integer.MAX_VALUE :
|
||||
MAX_ARRAY_SIZE;
|
||||
}
|
||||
|
||||
public synchronized void write(int b) {
|
||||
ensureCapacity(count + 1);
|
||||
buf[count] = (byte) b;
|
||||
count += 1;
|
||||
}
|
||||
|
||||
public void writeInt(int value) {
|
||||
ensureCapacity(count + 4);
|
||||
buf[count] = (byte) (value >>> 24);
|
||||
buf[count + 1] = (byte) (value >>> 16);
|
||||
buf[count + 2] = (byte) (value >>> 8);
|
||||
buf[count + 3] = (byte) (value);
|
||||
count += 4;
|
||||
}
|
||||
|
||||
public void writeLong(long value) {
|
||||
ensureCapacity(count + 8);
|
||||
buf[count] = (byte) (value >>> 56);
|
||||
buf[count + 1] = (byte) (value >>> 48);
|
||||
buf[count + 2] = (byte) (value >>> 40);
|
||||
buf[count + 3] = (byte) (value >>> 32);
|
||||
buf[count + 4] = (byte) (value >>> 24);
|
||||
buf[count + 5] = (byte) (value >>> 16);
|
||||
buf[count + 6] = (byte) (value >>> 8);
|
||||
buf[count + 7] = (byte) (value);
|
||||
count += 8;
|
||||
}
|
||||
|
||||
public synchronized void write(byte b[], int off, int len) {
|
||||
if ((off < 0) || (off > b.length) || (len < 0) ||
|
||||
((off + len) - b.length > 0)) {
|
||||
throw new IndexOutOfBoundsException();
|
||||
}
|
||||
ensureCapacity(count + len);
|
||||
System.arraycopy(b, off, buf, count, len);
|
||||
count += len;
|
||||
}
|
||||
|
||||
public synchronized void writeTo(OutputStream out) throws IOException {
|
||||
out.write(buf, 0, count);
|
||||
}
|
||||
|
||||
public synchronized void reset() {
|
||||
count = 0;
|
||||
}
|
||||
|
||||
}
|
@ -4055,7 +4055,7 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate
|
||||
if (!loadDocumentFromImageReceiver) {
|
||||
TLRPC.PhotoSize photo = document == null ? FileLoader.getClosestPhotoSizeWithSize(currentMessageObject.photoThumbs, AndroidUtilities.getPhotoSize()) : null;
|
||||
if (canDownload == 2 || canDownload == 1 && currentMessageObject.isVideo()) {
|
||||
if (document != null && !currentMessageObject.shouldEncryptPhotoOrVideo() && currentMessageObject.canStreamVideo()) {
|
||||
if (canDownload != 2 && document != null && !currentMessageObject.shouldEncryptPhotoOrVideo() && currentMessageObject.canStreamVideo()) {
|
||||
FileLoader.getInstance(currentAccount).loadFile(document, currentMessageObject, FileLoader.PRIORITY_NORMAL, 0);
|
||||
}
|
||||
} else if (canDownload != 0) {
|
||||
@ -4113,6 +4113,7 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate
|
||||
if (messageObject.checkLayout() || currentPosition != null && lastHeight != AndroidUtilities.displaySize.y) {
|
||||
currentMessageObject = null;
|
||||
}
|
||||
messageObject.isOutOwnerCached = null;
|
||||
boolean widthChanged = lastWidth != getParentWidth();
|
||||
lastHeight = AndroidUtilities.displaySize.y;
|
||||
lastWidth = getParentWidth();
|
||||
|
@ -16726,6 +16726,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
||||
obj.messageOwner = newMsgObj;
|
||||
if (fwdHeader != null && newMsgObj.fwd_from != null && !TextUtils.isEmpty(newMsgObj.fwd_from.from_name)) {
|
||||
obj.messageOwner.fwd_from = fwdHeader;
|
||||
obj.isOutOwnerCached = null;
|
||||
}
|
||||
obj.generateThumbs(true);
|
||||
obj.setType();
|
||||
|
@ -856,6 +856,9 @@ public class ChatUsersActivity extends BaseFragment implements NotificationCente
|
||||
fragment.setDelegate(new GroupCreateActivity.ContactsAddActivityDelegate() {
|
||||
@Override
|
||||
public void didSelectUsers(ArrayList<TLRPC.User> users, int fwdCount) {
|
||||
if (fragment.getParentActivity() == null) {
|
||||
return;
|
||||
}
|
||||
final int count = users.size();
|
||||
final int[] processed = new int[1];
|
||||
final ArrayList<TLRPC.User> userRestrictedPrivacy = new ArrayList<>();
|
||||
@ -879,7 +882,7 @@ public class ChatUsersActivity extends BaseFragment implements NotificationCente
|
||||
title = LocaleController.getString("InviteToGroupErrorTitleSomeUsers", R.string.InviteToGroupErrorTitleSomeUsers);
|
||||
description = LocaleController.getString("InviteToGroupErrorMessageMultipleSome", R.string.InviteToGroupErrorMessageMultipleSome);
|
||||
}
|
||||
new AlertDialog.Builder(fragment.getContext())
|
||||
new AlertDialog.Builder(fragment.getParentActivity())
|
||||
.setTitle(title)
|
||||
.setMessage(description)
|
||||
.setPositiveButton(LocaleController.getString("OK", R.string.OK), null)
|
||||
|
@ -592,7 +592,6 @@ public class InstantCameraView extends FrameLayout implements NotificationCenter
|
||||
}
|
||||
MediaController.getInstance().pauseMessage(MediaController.getInstance().getPlayingMessageObject());
|
||||
|
||||
FileLoader.getDirectory(FileLoader.MEDIA_DIR_DOCUMENT).mkdirs();
|
||||
cameraFile = new File(FileLoader.getDirectory(FileLoader.MEDIA_DIR_DOCUMENT), System.currentTimeMillis() + "_" + SharedConfig.getLastLocalId() + ".mp4") {
|
||||
@Override
|
||||
public boolean delete() {
|
||||
|
@ -376,10 +376,10 @@ public class PipVideoOverlay {
|
||||
|
||||
private void onDismissedInternal() {
|
||||
try {
|
||||
if (controlsView.getParent() != null) {
|
||||
if (contentView != null && contentView.getParent() != null) {
|
||||
windowManager.removeViewImmediate(contentView);
|
||||
}
|
||||
} catch (IllegalArgumentException ignored) {}
|
||||
} catch (Exception ignored) {}
|
||||
|
||||
if (photoViewerWebView != null) {
|
||||
photoViewerWebView.showControls();
|
||||
|
@ -499,7 +499,7 @@ public class DataSettingsActivity extends BaseFragment {
|
||||
} else if (position == autoplayVideoRow) {
|
||||
SharedConfig.toggleAutoplayVideo();
|
||||
if (view instanceof TextCheckCell) {
|
||||
((TextCheckCell) view).setChecked(SharedConfig.isAutoplayGifs());
|
||||
((TextCheckCell) view).setChecked(SharedConfig.isAutoplayVideo());
|
||||
}
|
||||
} else if (position == clearDraftsRow) {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity());
|
||||
|
@ -1130,13 +1130,23 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter.
|
||||
|
||||
@Override
|
||||
public void onNestedScroll(View target, int dxConsumed, int dyConsumed, int dxUnconsumed, int dyUnconsumed, int type, int[] consumed) {
|
||||
if (target == listView && sharedMediaLayoutAttached) {
|
||||
RecyclerListView innerListView = sharedMediaLayout.getCurrentListView();
|
||||
int top = sharedMediaLayout.getTop();
|
||||
if (top == 0) {
|
||||
consumed[1] = dyUnconsumed;
|
||||
innerListView.scrollBy(0, dyUnconsumed);
|
||||
try {
|
||||
if (target == listView && sharedMediaLayoutAttached) {
|
||||
RecyclerListView innerListView = sharedMediaLayout.getCurrentListView();
|
||||
int top = sharedMediaLayout.getTop();
|
||||
if (top == 0) {
|
||||
consumed[1] = dyUnconsumed;
|
||||
innerListView.scrollBy(0, dyUnconsumed);
|
||||
}
|
||||
}
|
||||
} catch (Throwable e) {
|
||||
FileLog.e(e);
|
||||
AndroidUtilities.runOnUIThread(() -> {
|
||||
RecyclerListView innerListView = sharedMediaLayout.getCurrentListView();
|
||||
if (innerListView != null && innerListView.getAdapter() != null) {
|
||||
innerListView.getAdapter().notifyDataSetChanged();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@ -4975,6 +4985,9 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter.
|
||||
break;
|
||||
case PHONE_OPTION_TELEGRAM_CALL:
|
||||
case PHONE_OPTION_TELEGRAM_VIDEO_CALL:
|
||||
if (getParentActivity() == null) {
|
||||
return;
|
||||
}
|
||||
VoIPHelper.startCall(user, action == PHONE_OPTION_TELEGRAM_VIDEO_CALL, userInfo != null && userInfo.video_calls_available, getParentActivity(), userInfo, getAccountInstance());
|
||||
break;
|
||||
}
|
||||
|
@ -1159,9 +1159,11 @@ public class ThemeActivity extends BaseFragment implements NotificationCenter.No
|
||||
((TextCheckCell) view).setChecked(SharedConfig.chatBlurEnabled());
|
||||
}
|
||||
} else if (position == lightModeRow) {
|
||||
LiteMode.setAllFlags(LiteMode.getValue() == LiteMode.PRESET_LOW ? LiteMode.PRESET_HIGH : LiteMode.PRESET_LOW);
|
||||
boolean liteModeEnabled = (LiteMode.getValue() & LiteMode.ENABLED) == 0;
|
||||
int newFlags = (liteModeEnabled ? LiteMode.ENABLED : 0) | (LiteMode.getValue() & ~LiteMode.ENABLED);
|
||||
LiteMode.setAllFlags(newFlags);
|
||||
if (view instanceof TextCheckCell) {
|
||||
((TextCheckCell) view).setChecked(LiteMode.getValue() == LiteMode.PRESET_LOW);
|
||||
((TextCheckCell) view).setChecked((LiteMode.getValue() & LiteMode.ENABLED) == 0);
|
||||
}
|
||||
} else if (position == nightThemeRow) {
|
||||
if (LocaleController.isRTL && x <= AndroidUtilities.dp(76) || !LocaleController.isRTL && x >= view.getMeasuredWidth() - AndroidUtilities.dp(76)) {
|
||||
@ -2254,7 +2256,7 @@ public class ThemeActivity extends BaseFragment implements NotificationCenter.No
|
||||
} else if (position == chatBlurRow) {
|
||||
textCheckCell.setTextAndCheck(LocaleController.getString("BlurInChat", R.string.BlurInChat), SharedConfig.chatBlurEnabled(), true);
|
||||
} else if (position == lightModeRow) {
|
||||
textCheckCell.setTextAndCheck(LocaleController.getString("LightMode", R.string.LightMode), LiteMode.getValue() == LiteMode.PRESET_LOW, true);
|
||||
textCheckCell.setTextAndCheck(LocaleController.getString("LightMode", R.string.LightMode), (LiteMode.getValue() & LiteMode.ENABLED) == 0, true);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -21,6 +21,7 @@ import android.os.Process;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import org.telegram.messenger.FileLog;
|
||||
import org.webrtc.ContextUtils;
|
||||
import org.webrtc.Logging;
|
||||
import org.webrtc.ThreadUtils;
|
||||
@ -334,21 +335,30 @@ public class WebRtcAudioTrack {
|
||||
}
|
||||
|
||||
private boolean stopPlayout() {
|
||||
threadChecker.checkIsOnValidThread();
|
||||
Logging.d(TAG, "stopPlayout");
|
||||
assertTrue(audioThread != null);
|
||||
logUnderrunCount();
|
||||
audioThread.stopThread();
|
||||
try {
|
||||
threadChecker.checkIsOnValidThread();
|
||||
Logging.d(TAG, "stopPlayout");
|
||||
assertTrue(audioThread != null);
|
||||
logUnderrunCount();
|
||||
audioThread.stopThread();
|
||||
|
||||
Logging.d(TAG, "Stopping the AudioTrackThread...");
|
||||
audioThread.interrupt();
|
||||
if (!ThreadUtils.joinUninterruptibly(audioThread, AUDIO_TRACK_THREAD_JOIN_TIMEOUT_MS)) {
|
||||
Logging.e(TAG, "Join of AudioTrackThread timed out.");
|
||||
WebRtcAudioUtils.logAudioState(TAG);
|
||||
Logging.d(TAG, "Stopping the AudioTrackThread...");
|
||||
audioThread.interrupt();
|
||||
if (!ThreadUtils.joinUninterruptibly(audioThread, AUDIO_TRACK_THREAD_JOIN_TIMEOUT_MS)) {
|
||||
Logging.e(TAG, "Join of AudioTrackThread timed out.");
|
||||
WebRtcAudioUtils.logAudioState(TAG);
|
||||
}
|
||||
Logging.d(TAG, "AudioTrackThread has now been stopped.");
|
||||
} catch (Throwable e) {
|
||||
FileLog.e(e);
|
||||
} finally {
|
||||
audioThread = null;
|
||||
}
|
||||
try {
|
||||
releaseAudioResources();
|
||||
} catch (Throwable e) {
|
||||
FileLog.e(e);
|
||||
}
|
||||
Logging.d(TAG, "AudioTrackThread has now been stopped.");
|
||||
audioThread = null;
|
||||
releaseAudioResources();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -13,8 +13,8 @@
|
||||
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
|
||||
# org.gradle.parallel=true
|
||||
#Sat Mar 12 05:53:50 MSK 2016
|
||||
APP_VERSION_NAME=9.4.5
|
||||
APP_VERSION_CODE=3152
|
||||
APP_VERSION_NAME=9.4.6
|
||||
APP_VERSION_CODE=3155
|
||||
APP_PACKAGE=org.telegram.messenger
|
||||
RELEASE_KEY_PASSWORD=android
|
||||
RELEASE_KEY_ALIAS=androidkey
|
||||
|
Loading…
Reference in New Issue
Block a user