mirror of
https://github.com/FromGram/android.git
synced 2026-11-20 21:51:23 +03:00
update to 12.6.2 (6655)
This commit is contained in:
@@ -184,6 +184,17 @@ public class MediaController implements AudioManager.OnAudioFocusChangeListener,
|
||||
MediaStore.Images.Media.SIZE,
|
||||
MediaStore.Images.ImageColumns.XMP
|
||||
};
|
||||
private static final String[] projectionPhotos2 = {
|
||||
MediaStore.Images.Media._ID,
|
||||
MediaStore.Images.Media.BUCKET_ID,
|
||||
MediaStore.Images.Media.BUCKET_DISPLAY_NAME,
|
||||
MediaStore.Images.Media.DATA,
|
||||
Build.VERSION.SDK_INT > 28 ? MediaStore.Images.Media.DATE_MODIFIED : MediaStore.Images.Media.DATE_TAKEN,
|
||||
MediaStore.Images.Media.ORIENTATION,
|
||||
MediaStore.Images.Media.WIDTH,
|
||||
MediaStore.Images.Media.HEIGHT,
|
||||
MediaStore.Images.Media.SIZE
|
||||
};
|
||||
|
||||
private static final String[] projectionVideo = {
|
||||
MediaStore.Video.Media._ID,
|
||||
@@ -5813,7 +5824,12 @@ public class MediaController implements AudioManager.OnAudioFocusChangeListener,
|
||||
context.checkSelfPermission(Manifest.permission.READ_MEDIA_AUDIO) == PackageManager.PERMISSION_GRANTED
|
||||
)
|
||||
) {
|
||||
cursor = MediaStore.Images.Media.query(context.getContentResolver(), MediaStore.Images.Media.EXTERNAL_CONTENT_URI, projectionPhotos, null, null, (Build.VERSION.SDK_INT > 28 ? MediaStore.Images.Media.DATE_MODIFIED : MediaStore.Images.Media.DATE_TAKEN) + " DESC");
|
||||
try {
|
||||
cursor = MediaStore.Images.Media.query(context.getContentResolver(), MediaStore.Images.Media.EXTERNAL_CONTENT_URI, projectionPhotos, null, null, (Build.VERSION.SDK_INT > 28 ? MediaStore.Images.Media.DATE_MODIFIED : MediaStore.Images.Media.DATE_TAKEN) + " DESC");
|
||||
} catch (Exception e) {
|
||||
FileLog.e(e);
|
||||
cursor = MediaStore.Images.Media.query(context.getContentResolver(), MediaStore.Images.Media.EXTERNAL_CONTENT_URI, projectionPhotos2, null, null, (Build.VERSION.SDK_INT > 28 ? MediaStore.Images.Media.DATE_MODIFIED : MediaStore.Images.Media.DATE_TAKEN) + " DESC");
|
||||
}
|
||||
if (cursor != null) {
|
||||
int imageIdColumn = cursor.getColumnIndex(MediaStore.Images.Media._ID);
|
||||
int bucketIdColumn = cursor.getColumnIndex(MediaStore.Images.Media.BUCKET_ID);
|
||||
@@ -5824,7 +5840,13 @@ public class MediaController implements AudioManager.OnAudioFocusChangeListener,
|
||||
int widthColumn = cursor.getColumnIndex(MediaStore.Images.Media.WIDTH);
|
||||
int heightColumn = cursor.getColumnIndex(MediaStore.Images.Media.HEIGHT);
|
||||
int sizeColumn = cursor.getColumnIndex(MediaStore.Images.Media.SIZE);
|
||||
final int xmpColumn = cursor.getColumnIndex(MediaStore.Images.Media.XMP);
|
||||
int xmpColumn;
|
||||
try {
|
||||
xmpColumn = cursor.getColumnIndex(MediaStore.Images.Media.XMP);
|
||||
} catch (Exception e) {
|
||||
FileLog.e(e);
|
||||
xmpColumn = -1;
|
||||
}
|
||||
|
||||
while (cursor.moveToNext()) {
|
||||
String path = cursor.getString(dataColumn);
|
||||
@@ -5841,9 +5863,13 @@ public class MediaController implements AudioManager.OnAudioFocusChangeListener,
|
||||
int height = cursor.getInt(heightColumn);
|
||||
long size = cursor.getLong(sizeColumn);
|
||||
MotionPhotoDescription motionPhoto = null;
|
||||
try {
|
||||
motionPhoto = XmpMotionPhotoDescriptionParser.parse(new String(cursor.getBlob(xmpColumn)));
|
||||
} catch (Exception e) {}
|
||||
if (xmpColumn >= 0) {
|
||||
try {
|
||||
motionPhoto = XmpMotionPhotoDescriptionParser.parse(new String(cursor.getBlob(xmpColumn)));
|
||||
} catch (Exception e) {
|
||||
FileLog.e(e);
|
||||
}
|
||||
}
|
||||
|
||||
PhotoEntry photoEntry = new PhotoEntry(bucketId, imageId, dateTaken, path, orientation, 0, false, width, height, size);
|
||||
if (motionPhoto != null) {
|
||||
|
||||
@@ -4359,19 +4359,7 @@ public class TLRPC {
|
||||
total_voters = stream.readInt32(exception);
|
||||
}
|
||||
if (hasFlag(flags, FLAG_3)) {
|
||||
int magic = stream.readInt32(exception);
|
||||
if (magic != 0x1cb5c415) {
|
||||
if (exception) {
|
||||
throw new RuntimeException(String.format("wrong Vector magic, got %x", magic));
|
||||
}
|
||||
return;
|
||||
}
|
||||
int count = stream.readInt32(exception);
|
||||
for (int a = 0; a < count; a++) {
|
||||
TL_peerUser user = new TL_peerUser();
|
||||
user.user_id = (long) stream.readInt32(exception);
|
||||
recent_voters.add(user);
|
||||
}
|
||||
recent_voters = VectorLegacy.deserialize_IntUserIdAsPeer(stream, exception);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4386,12 +4374,7 @@ public class TLRPC {
|
||||
stream.writeInt32(total_voters);
|
||||
}
|
||||
if (hasFlag(flags, FLAG_3)) {
|
||||
stream.writeInt32(0x1cb5c415);
|
||||
int count = recent_voters.size();
|
||||
stream.writeInt32(count);
|
||||
for (int a = 0; a < count; a++) {
|
||||
stream.writeInt32((int) (long) recent_voters.get(a).user_id);
|
||||
}
|
||||
VectorLegacy.serialize_PeerAsIntUserId(stream, recent_voters);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4409,24 +4392,10 @@ public class TLRPC {
|
||||
total_voters = stream.readInt32(exception);
|
||||
}
|
||||
if (hasFlag(flags, FLAG_3)) {
|
||||
int magic = stream.readInt32(exception);
|
||||
if (magic != 0x1cb5c415) {
|
||||
if (exception) {
|
||||
throw new RuntimeException(String.format("wrong Vector magic, got %x", magic));
|
||||
}
|
||||
return;
|
||||
}
|
||||
int count = stream.readInt32(exception);
|
||||
for (int a = 0; a < count; a++) {
|
||||
TL_peerUser user = new TL_peerUser();
|
||||
user.user_id = (long) stream.readInt32(exception);
|
||||
recent_voters.add(user);
|
||||
}
|
||||
recent_voters = VectorLegacy.deserialize_IntUserIdAsPeer(stream, exception);
|
||||
}
|
||||
if (hasFlag(flags, FLAG_4)) {
|
||||
solution = stream.readString(exception);
|
||||
}
|
||||
if (hasFlag(flags, FLAG_4)) {
|
||||
solution_entities = Vector.deserialize(stream, MessageEntity::TLdeserialize, exception);
|
||||
}
|
||||
}
|
||||
@@ -4442,17 +4411,10 @@ public class TLRPC {
|
||||
stream.writeInt32(total_voters);
|
||||
}
|
||||
if (hasFlag(flags, FLAG_3)) {
|
||||
stream.writeInt32(0x1cb5c415);
|
||||
int count = recent_voters.size();
|
||||
stream.writeInt32(count);
|
||||
for (int a = 0; a < count; a++) {
|
||||
stream.writeInt32((int) (long) recent_voters.get(a).user_id);
|
||||
}
|
||||
VectorLegacy.serialize_PeerAsIntUserId(stream, recent_voters);
|
||||
}
|
||||
if (hasFlag(flags, FLAG_4)) {
|
||||
stream.writeString(solution);
|
||||
}
|
||||
if (hasFlag(flags, FLAG_4)) {
|
||||
Vector.serialize(stream, solution_entities);
|
||||
}
|
||||
}
|
||||
@@ -4570,24 +4532,10 @@ public class TLRPC {
|
||||
total_voters = stream.readInt32(exception);
|
||||
}
|
||||
if (hasFlag(flags, FLAG_3)) {
|
||||
int magic = stream.readInt32(exception);
|
||||
if (magic != 0x1cb5c415) {
|
||||
if (exception) {
|
||||
throw new RuntimeException(String.format("wrong Vector magic, got %x", magic));
|
||||
}
|
||||
return;
|
||||
}
|
||||
int count = stream.readInt32(exception);
|
||||
for (int a = 0; a < count; a++) {
|
||||
TL_peerUser user = new TL_peerUser();
|
||||
user.user_id = stream.readInt64(exception);
|
||||
recent_voters.add(user);
|
||||
}
|
||||
recent_voters = VectorLegacy.deserialize_LongUserIdAsPeer(stream, exception);
|
||||
}
|
||||
if (hasFlag(flags, FLAG_4)) {
|
||||
solution = stream.readString(exception);
|
||||
}
|
||||
if (hasFlag(flags, FLAG_4)) {
|
||||
solution_entities = Vector.deserialize(stream, MessageEntity::TLdeserialize, exception);
|
||||
}
|
||||
}
|
||||
@@ -4603,17 +4551,10 @@ public class TLRPC {
|
||||
stream.writeInt32(total_voters);
|
||||
}
|
||||
if (hasFlag(flags, FLAG_3)) {
|
||||
stream.writeInt32(0x1cb5c415);
|
||||
int count = recent_voters.size();
|
||||
stream.writeInt32(count);
|
||||
for (int a = 0; a < count; a++) {
|
||||
stream.writeInt64(recent_voters.get(a).user_id);
|
||||
}
|
||||
VectorLegacy.serialize_PeerAsLongUserId(stream, recent_voters);
|
||||
}
|
||||
if (hasFlag(flags, FLAG_4)) {
|
||||
stream.writeString(solution);
|
||||
}
|
||||
if (hasFlag(flags, FLAG_4)) {
|
||||
Vector.serialize(stream, solution_entities);
|
||||
}
|
||||
}
|
||||
@@ -18390,7 +18331,7 @@ public class TLRPC {
|
||||
}
|
||||
}
|
||||
|
||||
public static class TL_codeSettings extends TLObject {
|
||||
public static class TL_codeSettings extends TLObject {
|
||||
public static final int constructor = 0xad253d78;
|
||||
|
||||
public int flags;
|
||||
@@ -18418,21 +18359,7 @@ public class TLRPC {
|
||||
allow_firebase = hasFlag(flags, FLAG_7);
|
||||
unknown_number = hasFlag(flags, FLAG_9);
|
||||
if (hasFlag(flags, FLAG_6)) {
|
||||
int magic = stream.readInt32(exception);
|
||||
if (magic != 0x1cb5c415) {
|
||||
if (exception) {
|
||||
throw new RuntimeException(String.format("wrong Vector magic, got %x", magic));
|
||||
}
|
||||
return;
|
||||
}
|
||||
int count = stream.readInt32(exception);
|
||||
for (int a = 0; a < count; a++) {
|
||||
byte[] object = stream.readByteArray(exception);
|
||||
if (object == null) {
|
||||
return;
|
||||
}
|
||||
logout_tokens.add(object);
|
||||
}
|
||||
logout_tokens = Vector.deserializeByteArray(stream, exception);
|
||||
}
|
||||
if (hasFlag(flags, FLAG_8)) {
|
||||
token = stream.readString(exception);
|
||||
@@ -18450,12 +18377,7 @@ public class TLRPC {
|
||||
flags = setFlag(flags, FLAG_9, unknown_number);
|
||||
stream.writeInt32(flags);
|
||||
if (hasFlag(flags, FLAG_6)) {
|
||||
stream.writeInt32(0x1cb5c415);
|
||||
int count = logout_tokens.size();
|
||||
stream.writeInt32(count);
|
||||
for (int a = 0; a < count; a++) {
|
||||
stream.writeByteArray(logout_tokens.get(a));
|
||||
}
|
||||
Vector.serializeByteArray(stream, logout_tokens);
|
||||
}
|
||||
if (hasFlag(flags, FLAG_8)) {
|
||||
stream.writeString(token);
|
||||
@@ -21199,29 +21121,14 @@ public class TLRPC {
|
||||
|
||||
public void readParams(InputSerializedData stream, boolean exception) {
|
||||
type = SecureValueType.TLdeserialize(stream, stream.readInt32(exception), exception);
|
||||
int magic = stream.readInt32(exception);
|
||||
if (magic != 0x1cb5c415) {
|
||||
if (exception) {
|
||||
throw new RuntimeException(String.format("wrong Vector magic, got %x", magic));
|
||||
}
|
||||
return;
|
||||
}
|
||||
int count = stream.readInt32(exception);
|
||||
for (int a = 0; a < count; a++) {
|
||||
file_hash.add(stream.readByteArray(exception));
|
||||
}
|
||||
file_hash = Vector.deserializeByteArray(stream, exception);
|
||||
text = stream.readString(exception);
|
||||
}
|
||||
|
||||
public void serializeToStream(OutputSerializedData stream) {
|
||||
stream.writeInt32(constructor);
|
||||
type.serializeToStream(stream);
|
||||
stream.writeInt32(0x1cb5c415);
|
||||
int count = file_hash.size();
|
||||
stream.writeInt32(count);
|
||||
for (int a = 0; a < count; a++) {
|
||||
stream.writeByteArray(file_hash.get(a));
|
||||
}
|
||||
Vector.serializeByteArray(stream, file_hash);
|
||||
stream.writeString(text);
|
||||
}
|
||||
}
|
||||
@@ -21322,29 +21229,14 @@ public class TLRPC {
|
||||
|
||||
public void readParams(InputSerializedData stream, boolean exception) {
|
||||
type = SecureValueType.TLdeserialize(stream, stream.readInt32(exception), exception);
|
||||
int magic = stream.readInt32(exception);
|
||||
if (magic != 0x1cb5c415) {
|
||||
if (exception) {
|
||||
throw new RuntimeException(String.format("wrong Vector magic, got %x", magic));
|
||||
}
|
||||
return;
|
||||
}
|
||||
int count = stream.readInt32(exception);
|
||||
for (int a = 0; a < count; a++) {
|
||||
file_hash.add(stream.readByteArray(exception));
|
||||
}
|
||||
file_hash = Vector.deserializeByteArray(stream, exception);
|
||||
text = stream.readString(exception);
|
||||
}
|
||||
|
||||
public void serializeToStream(OutputSerializedData stream) {
|
||||
stream.writeInt32(constructor);
|
||||
type.serializeToStream(stream);
|
||||
stream.writeInt32(0x1cb5c415);
|
||||
int count = file_hash.size();
|
||||
stream.writeInt32(count);
|
||||
for (int a = 0; a < count; a++) {
|
||||
stream.writeByteArray(file_hash.get(a));
|
||||
}
|
||||
Vector.serializeByteArray(stream, file_hash);
|
||||
stream.writeString(text);
|
||||
}
|
||||
}
|
||||
@@ -26212,28 +26104,13 @@ public class TLRPC {
|
||||
|
||||
public void readParams(InputSerializedData stream, boolean exception) {
|
||||
title = stream.readString(exception);
|
||||
int magic = stream.readInt32(exception);
|
||||
if (magic != 0x1cb5c415) {
|
||||
if (exception) {
|
||||
throw new RuntimeException(String.format("wrong Vector magic, got %x", magic));
|
||||
}
|
||||
return;
|
||||
}
|
||||
int count = stream.readInt32(exception);
|
||||
for (int a = 0; a < count; a++) {
|
||||
users.add((long) stream.readInt32(exception));
|
||||
}
|
||||
users = VectorLegacy.deserialize_IntAsLong(stream, exception);
|
||||
}
|
||||
|
||||
public void serializeToStream(OutputSerializedData stream) {
|
||||
stream.writeInt32(constructor);
|
||||
stream.writeString(title);
|
||||
stream.writeInt32(0x1cb5c415);
|
||||
int count = users.size();
|
||||
stream.writeInt32(count);
|
||||
for (int a = 0; a < count; a++) {
|
||||
stream.writeInt32((int) (long) users.get(a));
|
||||
}
|
||||
VectorLegacy.serialize_LongAsInt(stream, users);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26585,27 +26462,12 @@ public class TLRPC {
|
||||
public static final int constructor = 0x488a7337;
|
||||
|
||||
public void readParams(InputSerializedData stream, boolean exception) {
|
||||
int magic = stream.readInt32(exception);
|
||||
if (magic != 0x1cb5c415) {
|
||||
if (exception) {
|
||||
throw new RuntimeException(String.format("wrong Vector magic, got %x", magic));
|
||||
}
|
||||
return;
|
||||
}
|
||||
int count = stream.readInt32(exception);
|
||||
for (int a = 0; a < count; a++) {
|
||||
users.add((long) stream.readInt32(exception));
|
||||
}
|
||||
users = VectorLegacy.deserialize_IntAsLong(stream, exception);
|
||||
}
|
||||
|
||||
public void serializeToStream(OutputSerializedData stream) {
|
||||
stream.writeInt32(constructor);
|
||||
stream.writeInt32(0x1cb5c415);
|
||||
int count = users.size();
|
||||
stream.writeInt32(count);
|
||||
for (int a = 0; a < count; a++) {
|
||||
stream.writeInt32((int) (long) users.get(a));
|
||||
}
|
||||
VectorLegacy.serialize_LongAsInt(stream, users);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26635,28 +26497,13 @@ public class TLRPC {
|
||||
|
||||
public void readParams(InputSerializedData stream, boolean exception) {
|
||||
call = InputGroupCall.TLdeserialize(stream, stream.readInt32(exception), exception);
|
||||
int magic = stream.readInt32(exception);
|
||||
if (magic != 0x1cb5c415) {
|
||||
if (exception) {
|
||||
throw new RuntimeException(String.format("wrong Vector magic, got %x", magic));
|
||||
}
|
||||
return;
|
||||
}
|
||||
int count = stream.readInt32(exception);
|
||||
for (int a = 0; a < count; a++) {
|
||||
users.add((long) stream.readInt32(exception));
|
||||
}
|
||||
users = VectorLegacy.deserialize_IntAsLong(stream, exception);
|
||||
}
|
||||
|
||||
public void serializeToStream(OutputSerializedData stream) {
|
||||
stream.writeInt32(constructor);
|
||||
call.serializeToStream(stream);
|
||||
stream.writeInt32(0x1cb5c415);
|
||||
int count = users.size();
|
||||
stream.writeInt32(count);
|
||||
for (int a = 0; a < count; a++) {
|
||||
stream.writeInt32((int) (long) users.get(a));
|
||||
}
|
||||
VectorLegacy.serialize_LongAsInt(stream, users);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32492,29 +32339,14 @@ public class TLRPC {
|
||||
|
||||
public void readParams(InputSerializedData stream, boolean exception) {
|
||||
peer = Peer.TLdeserialize(stream, stream.readInt32(exception), exception);
|
||||
int magic = stream.readInt32(exception);
|
||||
if (magic != 0x1cb5c415) {
|
||||
if (exception) {
|
||||
throw new RuntimeException(String.format("wrong Vector magic, got %x", magic));
|
||||
}
|
||||
return;
|
||||
}
|
||||
int count = stream.readInt32(exception);
|
||||
for (int a = 0; a < count; a++) {
|
||||
options.add(stream.readByteArray(exception));
|
||||
}
|
||||
options = Vector.deserializeByteArray(stream, exception);
|
||||
date = stream.readInt32(exception);
|
||||
}
|
||||
|
||||
public void serializeToStream(OutputSerializedData stream) {
|
||||
stream.writeInt32(constructor);
|
||||
peer.serializeToStream(stream);
|
||||
stream.writeInt32(0x1cb5c415);
|
||||
int count = options.size();
|
||||
stream.writeInt32(count);
|
||||
for (int a = 0; a < count; a++) {
|
||||
stream.writeByteArray(options.get(a));
|
||||
}
|
||||
Vector.serializeByteArray(stream, options);
|
||||
stream.writeInt32(date);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -168,6 +168,10 @@ public class Vector<T extends TLObject> extends TLObject {
|
||||
serialize(stream, stream::writeByteArray, objects);
|
||||
}
|
||||
|
||||
public static boolean validateSize(int count, int bytesPerItem, int remaining) {
|
||||
return (count >= 0) && (bytesPerItem > 0) && (((long) count) * bytesPerItem <= remaining);
|
||||
}
|
||||
|
||||
private static <T> ArrayList<T> deserialize(InputSerializedData stream, Utilities.CallbackReturn<Boolean, T> read, boolean exception) {
|
||||
final int magic = stream.readInt32(exception);
|
||||
if (magic != Vector.constructor) {
|
||||
@@ -175,7 +179,11 @@ public class Vector<T extends TLObject> extends TLObject {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
final int size = stream.readInt32(exception);
|
||||
final ArrayList<T> result = new ArrayList<>(Math.min(size, 16384));
|
||||
if (!validateSize(size, 1, stream.remaining())) {
|
||||
TLParseException.doThrowOrLog(stream, "VectorWrongSize", magic, exception);
|
||||
return new ArrayList<>();
|
||||
}
|
||||
final ArrayList<T> result = new ArrayList<>(size);
|
||||
for (int i = 0; i < size; ++i) {
|
||||
result.add(read.run(exception));
|
||||
}
|
||||
@@ -201,29 +209,11 @@ public class Vector<T extends TLObject> extends TLObject {
|
||||
}
|
||||
|
||||
final int size = stream.readInt32(exception);
|
||||
if (size < 0) {
|
||||
if (!validateSize(size, 4, stream.remaining())) {
|
||||
TLParseException.doThrowOrLog(stream, "VectorWrongSize", magic, exception);
|
||||
return new ArrayList<>();
|
||||
}
|
||||
|
||||
if (size > 16384) {
|
||||
// do not trust vector size
|
||||
final ArrayList<T> result = new ArrayList<>(128);
|
||||
for (int i = 0; i < size; ++i) {
|
||||
final int constructor = stream.readInt32(exception);
|
||||
T o = deserializer.deserialize(stream, constructor, exception);
|
||||
if (o != null) {
|
||||
result.add(o);
|
||||
} else {
|
||||
TLParseException.doThrowOrLog(stream, "VectorWrongContent", constructor, exception);
|
||||
return new ArrayList<>();
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
final ArrayList<T> result = new ArrayList<>(size);
|
||||
for (int i = 0; i < size; ++i) {
|
||||
T o = deserializer.deserialize(stream, stream.readInt32(exception), exception);
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
package org.telegram.tgnet;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class VectorLegacy {
|
||||
private VectorLegacy() {
|
||||
|
||||
}
|
||||
|
||||
public static ArrayList<Long> deserialize_IntAsLong(InputSerializedData stream, boolean exception) {
|
||||
ArrayList<Integer> res = Vector.deserializeInt(stream, exception);
|
||||
ArrayList<Long> result = new ArrayList<>(res.size());
|
||||
for (int num : res) {
|
||||
result.add((long) num);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public static void serialize_LongAsInt(OutputSerializedData stream, ArrayList<Long> objects) {
|
||||
ArrayList<Integer> ser = new ArrayList<>(objects.size());
|
||||
for (long num : objects) {
|
||||
ser.add((int) num);
|
||||
}
|
||||
Vector.serializeInt(stream, ser);
|
||||
}
|
||||
|
||||
public static ArrayList<TLRPC.Peer> deserialize_IntUserIdAsPeer(InputSerializedData stream, boolean exception) {
|
||||
ArrayList<Integer> userIds = Vector.deserializeInt(stream, exception);
|
||||
final ArrayList<TLRPC.Peer> result = new ArrayList<>(userIds.size());
|
||||
for (int userId: userIds) {
|
||||
TLRPC.TL_peerUser user = new TLRPC.TL_peerUser();
|
||||
user.user_id = userId;
|
||||
result.add(user);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public static void serialize_PeerAsIntUserId(OutputSerializedData stream, ArrayList<TLRPC.Peer> objects) {
|
||||
stream.writeInt32(Vector.constructor);
|
||||
final int count = objects.size();
|
||||
stream.writeInt32(count);
|
||||
for (int a = 0; a < count; a++) {
|
||||
stream.writeInt32((int) objects.get(a).user_id);
|
||||
}
|
||||
}
|
||||
|
||||
public static ArrayList<TLRPC.Peer> deserialize_LongUserIdAsPeer(InputSerializedData stream, boolean exception) {
|
||||
ArrayList<Long> userIds = Vector.deserializeLong(stream, exception);
|
||||
final ArrayList<TLRPC.Peer> result = new ArrayList<>(userIds.size());
|
||||
for (long userId: userIds) {
|
||||
TLRPC.TL_peerUser user = new TLRPC.TL_peerUser();
|
||||
user.user_id = userId;
|
||||
result.add(user);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public static void serialize_PeerAsLongUserId(OutputSerializedData stream, ArrayList<TLRPC.Peer> objects) {
|
||||
stream.writeInt32(Vector.constructor);
|
||||
final int count = objects.size();
|
||||
stream.writeInt32(count);
|
||||
for (int a = 0; a < count; a++) {
|
||||
stream.writeInt64(objects.get(a).user_id);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1045,7 +1045,10 @@ public class AIEditorAlert extends BottomSheetWithRecyclerListView {
|
||||
protected void dispatchDraw(@NonNull Canvas canvas) {
|
||||
super.dispatchDraw(canvas);
|
||||
if (divider) {
|
||||
canvas.drawRect(dp(10), getHeight() - 1, getWidth() - dp(10), getHeight(), Theme.dividerPaint);
|
||||
Paint dividerPaint = Theme.getThemePaint(Theme.key_paint_divider, resourcesProvider);
|
||||
if (dividerPaint == null)
|
||||
dividerPaint = Theme.dividerPaint;
|
||||
canvas.drawRect(dp(10), getHeight() - 1, getWidth() - dp(10), getHeight(), dividerPaint);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2777,19 +2777,20 @@ public class ChatActivityEnterView extends FrameLayout implements
|
||||
aiButton.setOnClickListener(v -> {
|
||||
if (messageEditText == null) return;
|
||||
MessagesController.getGlobalMainSettings().edit().putInt("aihintshown", 3).apply();
|
||||
final long dialogId = parentFragment != null ? parentFragment.getDialogId() : dialog_id;
|
||||
new AIEditorAlert(getContext(), resourcesProvider)
|
||||
.setText(messageEditText.getText())
|
||||
.setOnUse(text -> {
|
||||
messageEditText.setText(text);
|
||||
messageEditText.setSelection(text.length(), text.length());
|
||||
})
|
||||
.setOnSend(parentFragment.getDialogId(), editingMessageObject != null, (text, scheduleDate, scheduleRepeatPeriod, notify) -> {
|
||||
.setOnSend(dialogId, editingMessageObject != null, (text, scheduleDate, scheduleRepeatPeriod, notify) -> {
|
||||
messageEditText.setText(text);
|
||||
if (editingMessageObject != null) {
|
||||
doneEditingMessage();
|
||||
} else {
|
||||
if (isInScheduleMode() && scheduleDate == 0) {
|
||||
AlertsCreator.createScheduleDatePickerDialog(parentActivity, parentFragment.getDialogId(), new AlertsCreator.ScheduleDatePickerDelegate() {
|
||||
AlertsCreator.createScheduleDatePickerDialog(parentActivity, dialogId, new AlertsCreator.ScheduleDatePickerDelegate() {
|
||||
@Override
|
||||
public void didSelectDate(boolean notify, int scheduleDate, int scheduleRepeatPeriod) {
|
||||
final boolean shownDialog = sendMessageInternal(notify, scheduleDate, scheduleRepeatPeriod, 0, true);
|
||||
|
||||
@@ -8,6 +8,7 @@ import static org.telegram.ui.Components.TranslateAlert2.languageName;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.Paint;
|
||||
import android.graphics.PorterDuff;
|
||||
import android.graphics.PorterDuffColorFilter;
|
||||
import android.graphics.drawable.Drawable;
|
||||
@@ -792,10 +793,13 @@ public class TranslateAlert3 extends BottomSheetWithRecyclerListView {
|
||||
|
||||
if (needDivider) {
|
||||
TextView textView = collapsed ? this.shortTextView : this.textView;
|
||||
Paint dividerPaint = Theme.getThemePaint(Theme.key_paint_divider, resourcesProvider);
|
||||
if (dividerPaint == null)
|
||||
dividerPaint = Theme.dividerPaint;
|
||||
if (LocaleController.isRTL) {
|
||||
canvas.drawRect(0, getMeasuredHeight() - 1, textView.getRight(), getMeasuredHeight(), Theme.dividerPaint);
|
||||
canvas.drawRect(0, getMeasuredHeight() - 1, textView.getRight(), getMeasuredHeight(), dividerPaint);
|
||||
} else {
|
||||
canvas.drawRect(textView.getLeft(), getMeasuredHeight() - 1, getMeasuredWidth(), getMeasuredHeight(), Theme.dividerPaint);
|
||||
canvas.drawRect(textView.getLeft(), getMeasuredHeight() - 1, getMeasuredWidth(), getMeasuredHeight(), dividerPaint);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1948,6 +1948,15 @@ public class DialogsActivity extends BaseFragment implements NotificationCenter.
|
||||
poller.checkList( this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean dispatchTouchEvent(MotionEvent ev) {
|
||||
if (ev.getAction() == MotionEvent.ACTION_DOWN && ev.getY() < (getPaddingTop() + scrollYOffset)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return super.dispatchTouchEvent(ev);
|
||||
}
|
||||
|
||||
private boolean drawMovingViewsOverlayed() {
|
||||
return getItemAnimator() != null && getItemAnimator().isRunning();
|
||||
}
|
||||
|
||||
@@ -818,7 +818,6 @@ public class MainTabsActivity extends ViewPagerActivity implements NotificationC
|
||||
ArrayList<ThemeDescription> themeDescriptions = super.getThemeDescriptions();
|
||||
|
||||
ThemeDescription.ThemeDescriptionDelegate cellDelegate = this::blur3_updateColors;
|
||||
themeDescriptions.add(new ThemeDescription(fragmentView, ThemeDescription.FLAG_BACKGROUND, null, null, null, null, Theme.key_windowBackgroundWhite));
|
||||
themeDescriptions.add(new ThemeDescription(null, 0, null, null, null, cellDelegate, Theme.key_windowBackgroundWhite));
|
||||
themeDescriptions.add(new ThemeDescription(null, 0, null, null, null, cellDelegate, Theme.key_dialogBackground));
|
||||
|
||||
|
||||
@@ -318,10 +318,9 @@ public class PrivacyUsersActivity extends BaseFragment implements NotificationCe
|
||||
blockUserDetailRow = -1;
|
||||
deleteAllRow = -1;
|
||||
if (!blockedUsersActivity || getMessagesController().totalBlockedCount >= 0) {
|
||||
blockUserRow = rowCount++;
|
||||
if (currentType == TYPE_BLOCKED) {
|
||||
blockUserDetailRow = rowCount++;
|
||||
} else {
|
||||
blockUserRow = rowCount++;
|
||||
}
|
||||
|
||||
int count;
|
||||
|
||||
@@ -13,6 +13,7 @@ import androidx.core.view.WindowInsetsCompat;
|
||||
import org.telegram.messenger.AndroidUtilities;
|
||||
import org.telegram.ui.ActionBar.ActionBar;
|
||||
import org.telegram.ui.ActionBar.BaseFragment;
|
||||
import org.telegram.ui.ActionBar.Theme;
|
||||
import org.telegram.ui.ActionBar.ThemeDescription;
|
||||
import org.telegram.ui.Components.LayoutHelper;
|
||||
import org.telegram.ui.Components.ViewPagerFixed;
|
||||
@@ -49,6 +50,7 @@ public abstract class ViewPagerActivity extends BaseFragment {
|
||||
|
||||
@Override
|
||||
public View createView(Context context) {
|
||||
hasOwnBackground = true;
|
||||
contentView = createContentView(context);
|
||||
|
||||
viewPager = new ViewPagerFixed(context) {
|
||||
@@ -135,9 +137,14 @@ public abstract class ViewPagerActivity extends BaseFragment {
|
||||
|
||||
FrameLayout container = (FrameLayout) view;
|
||||
container.removeAllViews();
|
||||
AndroidUtilities.removeFromParent(fragment.getFragmentView());
|
||||
|
||||
container.addView(fragment.getFragmentView(), LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, LayoutHelper.MATCH_PARENT));
|
||||
final View fragmentView = fragment.getFragmentView();
|
||||
AndroidUtilities.removeFromParent(fragmentView);
|
||||
if (!fragment.hasOwnBackground() && fragmentView.getBackground() == null) {
|
||||
fragmentView.setBackgroundColor(Theme.getColor(Theme.key_windowBackgroundWhite));
|
||||
}
|
||||
|
||||
container.addView(fragmentView, LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, LayoutHelper.MATCH_PARENT));
|
||||
if (fragment.getActionBar() != null && fragment.getActionBar().shouldAddToContainer()) {
|
||||
AndroidUtilities.removeFromParent(fragment.getActionBar());
|
||||
container.addView(fragment.getActionBar());
|
||||
|
||||
+2
-2
@@ -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_CODE=6653
|
||||
APP_VERSION_NAME=12.6.1
|
||||
APP_VERSION_CODE=6655
|
||||
APP_VERSION_NAME=12.6.2
|
||||
APP_PACKAGE=org.telegram.messenger
|
||||
IS_PRIVATE=false
|
||||
RELEASE_KEY_PASSWORD=android
|
||||
|
||||
Reference in New Issue
Block a user