Commit 2b81b7f0 authored by DrKLO's avatar DrKLO

update to 2.9.1

parent 2b8304eb
...@@ -3,7 +3,7 @@ buildscript { ...@@ -3,7 +3,7 @@ buildscript {
mavenCentral() mavenCentral()
} }
dependencies { dependencies {
classpath 'com.android.tools.build:gradle:1.1.3' classpath 'com.android.tools.build:gradle:1.2.3'
} }
} }
apply plugin: 'com.android.application' apply plugin: 'com.android.application'
...@@ -81,7 +81,7 @@ android { ...@@ -81,7 +81,7 @@ android {
defaultConfig { defaultConfig {
minSdkVersion 8 minSdkVersion 8
targetSdkVersion 22 targetSdkVersion 22
versionCode 521 versionCode 541
versionName "2.8.1" versionName "2.9.1"
} }
} }
This diff is collapsed.
This diff is collapsed.
...@@ -123,6 +123,18 @@ ...@@ -123,6 +123,18 @@
android:windowSoftInputMode="adjustResize|stateHidden"> android:windowSoftInputMode="adjustResize|stateHidden">
</activity> </activity>
<receiver android:name="org.telegram.android.AutoMessageHeardReceiver">
<intent-filter>
<action android:name="org.telegram.messenger.ACTION_MESSAGE_HEARD"/>
</intent-filter>
</receiver>
<receiver android:name="org.telegram.android.AutoMessageReplyReceiver">
<intent-filter>
<action android:name="org.telegram.messenger.ACTION_MESSAGE_REPLY"/>
</intent-filter>
</receiver>
<receiver android:name="org.telegram.android.SmsListener"> <receiver android:name="org.telegram.android.SmsListener">
<intent-filter> <intent-filter>
<action android:name="android.provider.Telephony.SMS_RECEIVED" /> <action android:name="android.provider.Telephony.SMS_RECEIVED" />
...@@ -168,6 +180,8 @@ ...@@ -168,6 +180,8 @@
<meta-data android:name="com.sec.android.multiwindow.MINIMUM_SIZE_W" android:value="632dp" /> <meta-data android:name="com.sec.android.multiwindow.MINIMUM_SIZE_W" android:value="632dp" />
<meta-data android:name="com.sec.android.multiwindow.MINIMUM_SIZE_H" android:value="598dp" /> <meta-data android:name="com.sec.android.multiwindow.MINIMUM_SIZE_H" android:value="598dp" />
<meta-data android:name="com.google.android.gms.car.application" android:resource="@xml/automotive_app_desc" />
</application> </application>
</manifest> </manifest>
...@@ -27,11 +27,11 @@ package org.telegram.PhoneFormat; ...@@ -27,11 +27,11 @@ package org.telegram.PhoneFormat;
import java.util.ArrayList; import java.util.ArrayList;
public class CallingCodeInfo { public class CallingCodeInfo {
public ArrayList<String> countries = new ArrayList<String>(); public ArrayList<String> countries = new ArrayList<>();
public String callingCode = ""; public String callingCode = "";
public ArrayList<String> trunkPrefixes = new ArrayList<String>(); public ArrayList<String> trunkPrefixes = new ArrayList<>();
public ArrayList<String> intlPrefixes = new ArrayList<String>(); public ArrayList<String> intlPrefixes = new ArrayList<>();
public ArrayList<RuleSet> ruleSets = new ArrayList<RuleSet>(); public ArrayList<RuleSet> ruleSets = new ArrayList<>();
//public ArrayList formatStrings; //public ArrayList formatStrings;
String matchingAccessCode(String str) { String matchingAccessCode(String str) {
...@@ -107,14 +107,14 @@ public class CallingCodeInfo { ...@@ -107,14 +107,14 @@ public class CallingCodeInfo {
for (RuleSet set : ruleSets) { for (RuleSet set : ruleSets) {
boolean valid = set.isValid(str, intlPrefix, trunkPrefix, true); boolean valid = set.isValid(str, intlPrefix, trunkPrefix, true);
if (valid) { if (valid) {
return valid; return true;
} }
} }
for (RuleSet set : ruleSets) { for (RuleSet set : ruleSets) {
boolean valid = set.isValid(str, intlPrefix, trunkPrefix, false); boolean valid = set.isValid(str, intlPrefix, trunkPrefix, false);
if (valid) { if (valid) {
return valid; return true;
} }
} }
......
/*
* This is the source code of Telegram for Android v. 2.x.x.
* It is licensed under GNU GPL v. 2 or later.
* You should have received a copy of the license in this archive (see LICENSE).
*
* Copyright Nikolai Kudashov, 2013-2015.
*/
package org.telegram.android;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
public class AutoMessageHeardReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
long dialog_id = intent.getLongExtra("dialog_id", 0);
int max_id = intent.getIntExtra("max_id", 0);
if (dialog_id == 0 || max_id == 0) {
return;
}
MessagesController.getInstance().markDialogAsRead(dialog_id, max_id, max_id, 0, 0, true, false);
}
}
/*
* This is the source code of Telegram for Android v. 2.x.x.
* It is licensed under GNU GPL v. 2 or later.
* You should have received a copy of the license in this archive (see LICENSE).
*
* Copyright Nikolai Kudashov, 2013-2014.
*/
package org.telegram.android;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.RemoteInput;
public class AutoMessageReplyReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
Bundle remoteInput = RemoteInput.getResultsFromIntent(intent);
if (remoteInput == null) {
return;
}
CharSequence text = remoteInput.getCharSequence(NotificationsController.EXTRA_VOICE_REPLY);
if (text == null || text.length() == 0) {
return;
}
long dialog_id = intent.getLongExtra("dialog_id", 0);
int max_id = intent.getIntExtra("max_id", 0);
if (dialog_id == 0 || max_id == 0) {
return;
}
SendMessagesHelper.getInstance().sendMessage(text.toString(), dialog_id, null, null, true);
MessagesController.getInstance().markDialogAsRead(dialog_id, max_id, max_id, 0, 0, true, false);
}
}
...@@ -221,7 +221,7 @@ public class Emoji { ...@@ -221,7 +221,7 @@ public class Emoji {
private static void loadEmoji(final int page) { private static void loadEmoji(final int page) {
try { try {
float scale = 1.0f; float scale;
int imageResize = 1; int imageResize = 1;
if (AndroidUtilities.density <= 1.0f) { if (AndroidUtilities.density <= 1.0f) {
scale = 2.0f; scale = 2.0f;
...@@ -257,7 +257,7 @@ public class Emoji { ...@@ -257,7 +257,7 @@ public class Emoji {
imageFile = ApplicationLoader.applicationContext.getFileStreamPath(imageName); imageFile = ApplicationLoader.applicationContext.getFileStreamPath(imageName);
if (!imageFile.exists()) { if (!imageFile.exists()) {
InputStream is = ApplicationLoader.applicationContext.getAssets().open("emoji/" + imageName); InputStream is = ApplicationLoader.applicationContext.getAssets().open("emoji/" + imageName);
Utilities.copyFile(is, imageFile); AndroidUtilities.copyFile(is, imageFile);
is.close(); is.close();
} }
...@@ -276,7 +276,7 @@ public class Emoji { ...@@ -276,7 +276,7 @@ public class Emoji {
imageFile = ApplicationLoader.applicationContext.getFileStreamPath(imageName); imageFile = ApplicationLoader.applicationContext.getFileStreamPath(imageName);
if (!imageFile.exists()) { if (!imageFile.exists()) {
InputStream is = ApplicationLoader.applicationContext.getAssets().open("emoji/" + imageName); InputStream is = ApplicationLoader.applicationContext.getAssets().open("emoji/" + imageName);
Utilities.copyFile(is, imageFile); AndroidUtilities.copyFile(is, imageFile);
is.close(); is.close();
} }
......
...@@ -23,7 +23,6 @@ import org.telegram.messenger.ConnectionsManager; ...@@ -23,7 +23,6 @@ import org.telegram.messenger.ConnectionsManager;
import org.telegram.messenger.FileLog; import org.telegram.messenger.FileLog;
import org.telegram.messenger.R; import org.telegram.messenger.R;
import org.telegram.messenger.TLRPC; import org.telegram.messenger.TLRPC;
import org.telegram.messenger.Utilities;
import org.telegram.messenger.ApplicationLoader; import org.telegram.messenger.ApplicationLoader;
import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParser;
...@@ -359,7 +358,7 @@ public class LocaleController { ...@@ -359,7 +358,7 @@ public class LocaleController {
} }
File finalFile = new File(ApplicationLoader.applicationContext.getFilesDir(), languageCode + ".xml"); File finalFile = new File(ApplicationLoader.applicationContext.getFilesDir(), languageCode + ".xml");
if (!Utilities.copyFile(file, finalFile)) { if (!AndroidUtilities.copyFile(file, finalFile)) {
return false; return false;
} }
...@@ -494,7 +493,6 @@ public class LocaleController { ...@@ -494,7 +493,6 @@ public class LocaleController {
try { try {
if (stream != null) { if (stream != null) {
stream.close(); stream.close();
stream = null;
} }
} catch (Exception e) { } catch (Exception e) {
FileLog.e("tmessages", e); FileLog.e("tmessages", e);
...@@ -512,7 +510,7 @@ public class LocaleController { ...@@ -512,7 +510,7 @@ public class LocaleController {
return; return;
} }
try { try {
Locale newLocale = null; Locale newLocale;
if (localeInfo.shortName != null) { if (localeInfo.shortName != null) {
String[] args = localeInfo.shortName.split("_"); String[] args = localeInfo.shortName.split("_");
if (args.length == 1) { if (args.length == 1) {
...@@ -682,6 +680,7 @@ public class LocaleController { ...@@ -682,6 +680,7 @@ public class LocaleController {
} }
public static String formatDate(long date) { public static String formatDate(long date) {
try {
Calendar rightNow = Calendar.getInstance(); Calendar rightNow = Calendar.getInstance();
int day = rightNow.get(Calendar.DAY_OF_YEAR); int day = rightNow.get(Calendar.DAY_OF_YEAR);
int year = rightNow.get(Calendar.YEAR); int year = rightNow.get(Calendar.YEAR);
...@@ -698,9 +697,14 @@ public class LocaleController { ...@@ -698,9 +697,14 @@ public class LocaleController {
} else { } else {
return formatterYear.format(new Date(date * 1000)); return formatterYear.format(new Date(date * 1000));
} }
} catch (Exception e) {
FileLog.e("tmessages", e);
}
return "LOC_ERR";
} }
public static String formatDateOnline(long date) { public static String formatDateOnline(long date) {
try {
Calendar rightNow = Calendar.getInstance(); Calendar rightNow = Calendar.getInstance();
int day = rightNow.get(Calendar.DAY_OF_YEAR); int day = rightNow.get(Calendar.DAY_OF_YEAR);
int year = rightNow.get(Calendar.YEAR); int year = rightNow.get(Calendar.YEAR);
...@@ -719,13 +723,17 @@ public class LocaleController { ...@@ -719,13 +723,17 @@ public class LocaleController {
String format = LocaleController.formatString("formatDateAtTime", R.string.formatDateAtTime, formatterYear.format(new Date(date * 1000)), formatterDay.format(new Date(date * 1000))); String format = LocaleController.formatString("formatDateAtTime", R.string.formatDateAtTime, formatterYear.format(new Date(date * 1000)), formatterDay.format(new Date(date * 1000)));
return String.format("%s %s", LocaleController.getString("LastSeenDate", R.string.LastSeenDate), format); return String.format("%s %s", LocaleController.getString("LastSeenDate", R.string.LastSeenDate), format);
} }
} catch (Exception e) {
FileLog.e("tmessages", e);
}
return "LOC_ERR";
} }
private FastDateFormat createFormatter(Locale locale, String format, String defaultFormat) { private FastDateFormat createFormatter(Locale locale, String format, String defaultFormat) {
if (format == null || format.length() == 0) { if (format == null || format.length() == 0) {
format = defaultFormat; format = defaultFormat;
} }
FastDateFormat formatter = null; FastDateFormat formatter;
try { try {
formatter = FastDateFormat.getInstance(format, locale); formatter = FastDateFormat.getInstance(format, locale);
} catch (Exception e) { } catch (Exception e) {
...@@ -758,6 +766,7 @@ public class LocaleController { ...@@ -758,6 +766,7 @@ public class LocaleController {
} }
public static String stringForMessageListDate(long date) { public static String stringForMessageListDate(long date) {
try {
Calendar rightNow = Calendar.getInstance(); Calendar rightNow = Calendar.getInstance();
int day = rightNow.get(Calendar.DAY_OF_YEAR); int day = rightNow.get(Calendar.DAY_OF_YEAR);
int year = rightNow.get(Calendar.YEAR); int year = rightNow.get(Calendar.YEAR);
...@@ -777,6 +786,10 @@ public class LocaleController { ...@@ -777,6 +786,10 @@ public class LocaleController {
return formatterMonth.format(new Date(date * 1000)); return formatterMonth.format(new Date(date * 1000));
} }
} }
} catch (Exception e) {
FileLog.e("tmessages", e);
}
return "LOC_ERR";
} }
public static String formatUserStatus(TLRPC.User user) { public static String formatUserStatus(TLRPC.User user) {
......
...@@ -107,7 +107,6 @@ public class LruCache { ...@@ -107,7 +107,6 @@ public class LruCache {
if (previous != null) { if (previous != null) {
entryRemoved(false, key, previous, value); entryRemoved(false, key, previous, value);
ImageLoader.getInstance().callGC();
} }
trimToSize(maxSize, key); trimToSize(maxSize, key);
...@@ -148,7 +147,6 @@ public class LruCache { ...@@ -148,7 +147,6 @@ public class LruCache {
entryRemoved(true, key, value, null); entryRemoved(true, key, value, null);
} }
ImageLoader.getInstance().callGC();
} }
} }
...@@ -183,7 +181,6 @@ public class LruCache { ...@@ -183,7 +181,6 @@ public class LruCache {
} }
entryRemoved(false, key, previous, null); entryRemoved(false, key, previous, null);
ImageLoader.getInstance().callGC();
} }
return previous; return previous;
......
...@@ -25,6 +25,7 @@ import org.telegram.messenger.TLRPC; ...@@ -25,6 +25,7 @@ import org.telegram.messenger.TLRPC;
import org.telegram.messenger.R; import org.telegram.messenger.R;
import org.telegram.messenger.UserConfig; import org.telegram.messenger.UserConfig;
import org.telegram.ui.Components.URLSpanNoUnderline; import org.telegram.ui.Components.URLSpanNoUnderline;
import org.telegram.ui.Components.URLSpanNoUnderlineBold;
import java.util.AbstractMap; import java.util.AbstractMap;
import java.util.ArrayList; import java.util.ArrayList;
...@@ -48,10 +49,11 @@ public class MessageObject { ...@@ -48,10 +49,11 @@ public class MessageObject {
public int contentType; public int contentType;
public String dateKey; public String dateKey;
public String monthKey; public String monthKey;
public boolean deleted = false; public boolean deleted;
public float audioProgress; public float audioProgress;
public int audioProgressSec; public int audioProgressSec;
public ArrayList<TLRPC.PhotoSize> photoThumbs; public ArrayList<TLRPC.PhotoSize> photoThumbs;
public VideoEditedInfo videoEditedInfo;
public static TextPaint textPaint; public static TextPaint textPaint;
public int lastLineWidth; public int lastLineWidth;
...@@ -147,7 +149,7 @@ public class MessageObject { ...@@ -147,7 +149,7 @@ public class MessageObject {
if (whoUser != null && fromUser != null) { if (whoUser != null && fromUser != null) {
if (whoUser.id == fromUser.id) { if (whoUser.id == fromUser.id) {
if (isOut()) { if (isOut()) {
messageText = LocaleController.getString("ActionAddUserSelf", R.string.ActionAddUserSelf).replace("un1", LocaleController.getString("FromYou", R.string.FromYou)); messageText = LocaleController.getString("ActionAddUserSelfYou", R.string.ActionAddUserSelfYou);
} else { } else {
messageText = replaceWithLink(LocaleController.getString("ActionAddUserSelf", R.string.ActionAddUserSelf), "un1", fromUser); messageText = replaceWithLink(LocaleController.getString("ActionAddUserSelf", R.string.ActionAddUserSelf), "un1", fromUser);
} }
...@@ -331,6 +333,9 @@ public class MessageObject { ...@@ -331,6 +333,9 @@ public class MessageObject {
if (message instanceof TLRPC.TL_message || message instanceof TLRPC.TL_messageForwarded_old2) { if (message instanceof TLRPC.TL_message || message instanceof TLRPC.TL_messageForwarded_old2) {
if (isMediaEmpty()) { if (isMediaEmpty()) {
contentType = type = 0; contentType = type = 0;
if (messageText.length() == 0) {
messageText = "Empty message";
}
} else if (message.media instanceof TLRPC.TL_messageMediaPhoto) { } else if (message.media instanceof TLRPC.TL_messageMediaPhoto) {
contentType = type = 1; contentType = type = 1;
} else if (message.media instanceof TLRPC.TL_messageMediaGeo || message.media instanceof TLRPC.TL_messageMediaVenue) { } else if (message.media instanceof TLRPC.TL_messageMediaGeo || message.media instanceof TLRPC.TL_messageMediaVenue) {
...@@ -351,9 +356,6 @@ public class MessageObject { ...@@ -351,9 +356,6 @@ public class MessageObject {
type = 8; type = 8;
} else if (message.media.document.mime_type.equals("image/webp") && isSticker()) { } else if (message.media.document.mime_type.equals("image/webp") && isSticker()) {
type = 13; type = 13;
if (messageOwner.media.document.thumb != null && messageOwner.media.document.thumb.location != null) {
messageOwner.media.document.thumb.location.ext = "webp";
}
} else { } else {
type = 9; type = 9;
} }
...@@ -393,6 +395,11 @@ public class MessageObject { ...@@ -393,6 +395,11 @@ public class MessageObject {
monthKey = String.format("%d_%02d", dateYear, dateMonth); monthKey = String.format("%d_%02d", dateYear, dateMonth);
} }
if (messageOwner.message != null && messageOwner.id < 0 && messageOwner.message.length() > 6 && messageOwner.media instanceof TLRPC.TL_messageMediaVideo) {
videoEditedInfo = new VideoEditedInfo();
videoEditedInfo.parseString(messageOwner.message);
}
generateCaption(); generateCaption();
if (generateLayout) { if (generateLayout) {
generateLayout(); generateLayout();
...@@ -458,7 +465,7 @@ public class MessageObject { ...@@ -458,7 +465,7 @@ public class MessageObject {
if (messageOwner.media.webpage.photo != null) { if (messageOwner.media.webpage.photo != null) {
if (!update || photoThumbs == null) { if (!update || photoThumbs == null) {
photoThumbs = new ArrayList<>(messageOwner.media.webpage.photo.sizes); photoThumbs = new ArrayList<>(messageOwner.media.webpage.photo.sizes);
} else if (photoThumbs != null && !photoThumbs.isEmpty()) { } else if (!photoThumbs.isEmpty()) {
for (TLRPC.PhotoSize photoObject : photoThumbs) { for (TLRPC.PhotoSize photoObject : photoThumbs) {
for (TLRPC.PhotoSize size : messageOwner.media.webpage.photo.sizes) { for (TLRPC.PhotoSize size : messageOwner.media.webpage.photo.sizes) {
if (size instanceof TLRPC.TL_photoSizeEmpty) { if (size instanceof TLRPC.TL_photoSizeEmpty) {
...@@ -479,7 +486,7 @@ public class MessageObject { ...@@ -479,7 +486,7 @@ public class MessageObject {
public CharSequence replaceWithLink(CharSequence source, String param, TLRPC.User user) { public CharSequence replaceWithLink(CharSequence source, String param, TLRPC.User user) {
String name = ContactsController.formatName(user.first_name, user.last_name); String name = ContactsController.formatName(user.first_name, user.last_name);
int start = TextUtils.indexOf(source, param); int start = TextUtils.indexOf(source, param);
URLSpanNoUnderline span = new URLSpanNoUnderline("" + user.id); URLSpanNoUnderlineBold span = new URLSpanNoUnderlineBold("" + user.id);
SpannableStringBuilder builder = new SpannableStringBuilder(TextUtils.replace(source, new String[]{param}, new String[]{name})); SpannableStringBuilder builder = new SpannableStringBuilder(TextUtils.replace(source, new String[]{param}, new String[]{name}));
builder.setSpan(span, start, start + name.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); builder.setSpan(span, start, start + name.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
return builder; return builder;
...@@ -664,7 +671,7 @@ public class MessageObject { ...@@ -664,7 +671,7 @@ public class MessageObject {
} }
} }
StaticLayout textLayout = null; StaticLayout textLayout;
try { try {
textLayout = new StaticLayout(messageText, textPaint, maxWidth, Layout.Alignment.ALIGN_NORMAL, 1.0f, 0.0f, false); textLayout = new StaticLayout(messageText, textPaint, maxWidth, Layout.Alignment.ALIGN_NORMAL, 1.0f, 0.0f, false);
...@@ -783,7 +790,6 @@ public class MessageObject { ...@@ -783,7 +790,6 @@ public class MessageObject {
if (a == blocksCount - 1) { if (a == blocksCount - 1) {
lastLineWidth = lastLineWidthWithLeft; lastLineWidth = lastLineWidthWithLeft;
} }
linesMaxWidth = linesMaxWidthWithLeft;
} else if (a == blocksCount - 1) { } else if (a == blocksCount - 1) {
lastLineWidth = linesMaxWidth; lastLineWidth = linesMaxWidth;
} }
...@@ -939,6 +945,20 @@ public class MessageObject { ...@@ -939,6 +945,20 @@ public class MessageObject {
return false; return false;
} }
public static TLRPC.InputStickerSet getInputStickerSet(TLRPC.Message message) {
if (message.media != null && message.media.document != null) {
for (TLRPC.DocumentAttribute attribute : message.media.document.attributes) {
if (attribute instanceof TLRPC.TL_documentAttributeSticker) {
if (attribute.stickerset instanceof TLRPC.TL_inputStickerSetEmpty) {
return null;
}
return attribute.stickerset;
}
}
}
return null;
}
public String getStrickerChar() { public String getStrickerChar() {
if (messageOwner.media != null && messageOwner.media.document != null) { if (messageOwner.media != null && messageOwner.media.document != null) {
for (TLRPC.DocumentAttribute attribute : messageOwner.media.document.attributes) { for (TLRPC.DocumentAttribute attribute : messageOwner.media.document.attributes) {
...@@ -991,8 +1011,8 @@ public class MessageObject { ...@@ -991,8 +1011,8 @@ public class MessageObject {
} }
return photoHeight + AndroidUtilities.dp(14); return photoHeight + AndroidUtilities.dp(14);
} else { } else {
int photoHeight = 0; int photoHeight;
int photoWidth = 0; int photoWidth;
if (AndroidUtilities.isTablet()) { if (AndroidUtilities.isTablet()) {
photoWidth = (int) (AndroidUtilities.getMinTabletSide() * 0.7f); photoWidth = (int) (AndroidUtilities.getMinTabletSide() * 0.7f);
...@@ -1010,35 +1030,22 @@ public class MessageObject { ...@@ -1010,35 +1030,22 @@ public class MessageObject {
if (currentPhotoObject != null) { if (currentPhotoObject != null) {
float scale = (float) currentPhotoObject.w / (float) photoWidth; float scale = (float) currentPhotoObject.w / (float) photoWidth;
int w = (int) (currentPhotoObject.w / scale);
int h = (int) (currentPhotoObject.h / scale); int h = (int) (currentPhotoObject.h / scale);
if (w == 0) {
w = AndroidUtilities.dp(100);
}
if (h == 0) { if (h == 0) {
h = AndroidUtilities.dp(100); h = AndroidUtilities.dp(100);
} }
if (h > photoHeight) { if (h > photoHeight) {
float scale2 = h;
h = photoHeight; h = photoHeight;
scale2 /= h;
w = (int) (w / scale2);
} else if (h < AndroidUtilities.dp(120)) { } else if (h < AndroidUtilities.dp(120)) {
h = AndroidUtilities.dp(120); h = AndroidUtilities.dp(120);
float hScale = (float) currentPhotoObject.h / h;
if (currentPhotoObject.w / hScale < photoWidth) {
w = (int) (currentPhotoObject.w / hScale);
}
} }
if (isSecretPhoto()) { if (isSecretPhoto()) {
if (AndroidUtilities.isTablet()) { if (AndroidUtilities.isTablet()) {
w = h = (int) (AndroidUtilities.getMinTabletSide() * 0.5f); h = (int) (AndroidUtilities.getMinTabletSide() * 0.5f);
} else { } else {
w = h = (int) (Math.min(AndroidUtilities.displaySize.x, AndroidUtilities.displaySize.y) * 0.5f); h = (int) (Math.min(AndroidUtilities.displaySize.x, AndroidUtilities.displaySize.y) * 0.5f);
} }
} }
photoWidth = w;
photoHeight = h; photoHeight = h;
} }
return photoHeight + AndroidUtilities.dp(14); return photoHeight + AndroidUtilities.dp(14);
...@@ -1049,6 +1056,10 @@ public class MessageObject { ...@@ -1049,6 +1056,10 @@ public class MessageObject {
return isStickerMessage(messageOwner); return isStickerMessage(messageOwner);
} }
public TLRPC.InputStickerSet getInputStickerSet() {
return getInputStickerSet(messageOwner);
}
public boolean isForwarded() { public boolean isForwarded() {
return (messageOwner.flags & TLRPC.MESSAGE_FLAG_FWD) != 0; return (messageOwner.flags & TLRPC.MESSAGE_FLAG_FWD) != 0;
} }
......
...@@ -8,6 +8,10 @@ ...@@ -8,6 +8,10 @@
package org.telegram.android; package org.telegram.android;
import org.telegram.messenger.ApplicationLoader;
import org.telegram.messenger.BuildVars;
import org.telegram.messenger.FileLog;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
...@@ -51,7 +55,6 @@ public class NotificationCenter { ...@@ -51,7 +55,6 @@ public class NotificationCenter {
public static final int didSetPasscode = totalEvents++; public static final int didSetPasscode = totalEvents++;
public static final int didSetTwoStepPassword = totalEvents++; public static final int didSetTwoStepPassword = totalEvents++;
public static final int screenStateChanged = totalEvents++; public static final int screenStateChanged = totalEvents++;
public static final int appSwitchedToForeground = totalEvents++;
public static final int didLoadedReplyMessages = totalEvents++; public static final int didLoadedReplyMessages = totalEvents++;
public static final int newSessionReceived = totalEvents++; public static final int newSessionReceived = totalEvents++;
public static final int didReceivedWebpages = totalEvents++; public static final int didReceivedWebpages = totalEvents++;
...@@ -94,14 +97,31 @@ public class NotificationCenter { ...@@ -94,14 +97,31 @@ public class NotificationCenter {
public static final int audioDidStarted = totalEvents++; public static final int audioDidStarted = totalEvents++;
public static final int audioRouteChanged = totalEvents++; public static final int audioRouteChanged = totalEvents++;
final private HashMap<Integer, ArrayList<Object>> observers = new HashMap<>(); private HashMap<Integer, ArrayList<Object>> observers = new HashMap<>();
private HashMap<Integer, Object> removeAfterBroadcast = new HashMap<>();
final private HashMap<Integer, Object> removeAfterBroadcast = new HashMap<>(); private HashMap<Integer, Object> addAfterBroadcast = new HashMap<>();
final private HashMap<Integer, Object> addAfterBroadcast = new HashMap<>(); private ArrayList<DelayedPost> delayedPosts = new ArrayList<>(10);
private int broadcasting = 0; private int broadcasting = 0;
private boolean animationInProgress;
public interface NotificationCenterDelegate {
void didReceivedNotification(int id, Object... args);
}
private class DelayedPost {
private DelayedPost(int id, Object[] args) {
this.id = id;
this.args = args;
}
private int id;
private Object[] args;
}
private static volatile NotificationCenter Instance = null; private static volatile NotificationCenter Instance = null;
public static NotificationCenter getInstance() { public static NotificationCenter getInstance() {
NotificationCenter localInstance = Instance; NotificationCenter localInstance = Instance;
if (localInstance == null) { if (localInstance == null) {
...@@ -115,17 +135,43 @@ public class NotificationCenter { ...@@ -115,17 +135,43 @@ public class NotificationCenter {
return localInstance; return localInstance;
} }
public interface NotificationCenterDelegate { public void setAnimationInProgress(boolean value) {
void didReceivedNotification(int id, Object... args); animationInProgress = value;
if (!animationInProgress && !delayedPosts.isEmpty()) {
for (DelayedPost delayedPost : delayedPosts) {
postNotificationNameInternal(delayedPost.id, true, delayedPost.args);
}
delayedPosts.clear();
}
} }
public void postNotificationName(int id, Object... args) { public void postNotificationName(int id, Object... args) {
synchronized (observers) { boolean allowDuringAnimation = false;
if (id == dialogsNeedReload || id == closeChats || id == messagesDidLoaded || id == mediaCountDidLoaded || id == mediaDidLoaded) {
allowDuringAnimation = true;
}
postNotificationNameInternal(id, allowDuringAnimation, args);
}
public void postNotificationNameInternal(int id, boolean allowDuringAnimation, Object... args) {
if (BuildVars.DEBUG_VERSION) {
if (Thread.currentThread() != ApplicationLoader.applicationHandler.getLooper().getThread()) {
throw new RuntimeException("postNotificationName allowed only from MAIN thread");
}
}
if (!allowDuringAnimation && animationInProgress) {
DelayedPost delayedPost = new DelayedPost(id, args);
delayedPosts.add(delayedPost);
if (BuildVars.DEBUG_VERSION) {
FileLog.e("tmessages", "delay post notification " + id + " with args count = " + args.length);
}
return;
}
broadcasting++; broadcasting++;
ArrayList<Object> objects = observers.get(id); ArrayList<Object> objects = observers.get(id);
if (objects != null) { if (objects != null) {
for (Object obj : objects) { for (Object obj : objects) {
((NotificationCenterDelegate)obj).didReceivedNotification(id, args); ((NotificationCenterDelegate) obj).didReceivedNotification(id, args);
} }
} }
broadcasting--; broadcasting--;
...@@ -144,10 +190,13 @@ public class NotificationCenter { ...@@ -144,10 +190,13 @@ public class NotificationCenter {
} }
} }
} }
}
public void addObserver(Object observer, int id) { public void addObserver(Object observer, int id) {
synchronized (observers) { if (BuildVars.DEBUG_VERSION) {
if (Thread.currentThread() != ApplicationLoader.applicationHandler.getLooper().getThread()) {
throw new RuntimeException("addObserver allowed only from MAIN thread");
}
}
if (broadcasting != 0) { if (broadcasting != 0) {
addAfterBroadcast.put(id, observer); addAfterBroadcast.put(id, observer);
return; return;
...@@ -161,10 +210,13 @@ public class NotificationCenter { ...@@ -161,10 +210,13 @@ public class NotificationCenter {
} }
objects.add(observer); objects.add(observer);
} }
}
public void removeObserver(Object observer, int id) { public void removeObserver(Object observer, int id) {
synchronized (observers) { if (BuildVars.DEBUG_VERSION) {
if (Thread.currentThread() != ApplicationLoader.applicationHandler.getLooper().getThread()) {
throw new RuntimeException("removeObserver allowed only from MAIN thread");
}
}
if (broadcasting != 0) { if (broadcasting != 0) {
removeAfterBroadcast.put(id, observer); removeAfterBroadcast.put(id, observer);
return; return;
...@@ -177,5 +229,4 @@ public class NotificationCenter { ...@@ -177,5 +229,4 @@ public class NotificationCenter {
} }
} }
} }
}
} }
...@@ -17,6 +17,7 @@ import org.telegram.messenger.FileLog; ...@@ -17,6 +17,7 @@ import org.telegram.messenger.FileLog;
import org.telegram.messenger.ApplicationLoader; import org.telegram.messenger.ApplicationLoader;
public class ScreenReceiver extends BroadcastReceiver { public class ScreenReceiver extends BroadcastReceiver {
@Override @Override
public void onReceive(Context context, Intent intent) { public void onReceive(Context context, Intent intent) {
if (intent.getAction().equals(Intent.ACTION_SCREEN_OFF)) { if (intent.getAction().equals(Intent.ACTION_SCREEN_OFF)) {
......
...@@ -44,12 +44,17 @@ public class SmsListener extends BroadcastReceiver { ...@@ -44,12 +44,17 @@ public class SmsListener extends BroadcastReceiver {
try { try {
Pattern pattern = Pattern.compile("[0-9]+"); Pattern pattern = Pattern.compile("[0-9]+");
Matcher matcher = pattern.matcher(wholeString); final Matcher matcher = pattern.matcher(wholeString);
if (matcher.find()) { if (matcher.find()) {
String str = matcher.group(0); String str = matcher.group(0);
if (str.length() >= 3) { if (str.length() >= 3) {
AndroidUtilities.runOnUIThread(new Runnable() {
@Override
public void run() {
NotificationCenter.getInstance().postNotificationName(NotificationCenter.didReceiveSmsCode, matcher.group(0)); NotificationCenter.getInstance().postNotificationName(NotificationCenter.didReceiveSmsCode, matcher.group(0));
} }
});
}
} }
} catch (Throwable e) { } catch (Throwable e) {
FileLog.e("tmessages", e); FileLog.e("tmessages", e);
......
/*
* This is the source code of Telegram for Android v. 2.x.x.
* It is licensed under GNU GPL v. 2 or later.
* You should have received a copy of the license in this archive (see LICENSE).
*
* Copyright Nikolai Kudashov, 2013-2014.
*/
package org.telegram.android;
import java.util.Locale;
public class VideoEditedInfo {
public long startTime;
public long endTime;
public int rotationValue;
public int originalWidth;
public int originalHeight;
public int resultWidth;
public int resultHeight;
public int bitrate;
public String originalPath;
public String getString() {
return String.format(Locale.US, "-1_%d_%d_%d_%d_%d_%d_%d_%d_%s", startTime, endTime, rotationValue, originalWidth, originalHeight, bitrate, resultWidth, resultHeight, originalPath);
}
public void parseString(String string) {
if (string.length() < 6) {
return;
}
String args[] = string.split("_");
if (args.length >= 10) {
startTime = Long.parseLong(args[1]);
endTime = Long.parseLong(args[2]);
rotationValue = Integer.parseInt(args[3]);
originalWidth = Integer.parseInt(args[4]);
originalHeight = Integer.parseInt(args[5]);
bitrate = Integer.parseInt(args[6]);
resultWidth = Integer.parseInt(args[7]);
resultHeight = Integer.parseInt(args[8]);
for (int a = 9; a < args.length; a++) {
if (originalPath == null) {
originalPath = args[a];
} else {
originalPath += "_" + args[a];
}
}
}
}
}
...@@ -58,6 +58,8 @@ import android.view.accessibility.AccessibilityEvent; ...@@ -58,6 +58,8 @@ import android.view.accessibility.AccessibilityEvent;
import android.view.accessibility.AccessibilityManager; import android.view.accessibility.AccessibilityManager;
import android.view.animation.Interpolator; import android.view.animation.Interpolator;
import org.telegram.android.AndroidUtilities;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
......
/* /*
* This is the source code of Telegram for Android v. 1.3.x. * This is the source code of Telegram for Android v. 2.x.x.
* It is licensed under GNU GPL v. 2 or later. * It is licensed under GNU GPL v. 2 or later.
* You should have received a copy of the license in this archive (see LICENSE). * You should have received a copy of the license in this archive (see LICENSE).
* *
* Copyright Nikolai Kudashov, 2013-2014. * Copyright Nikolai Kudashov, 2013-2015.
*/ */
package org.telegram.messenger; package org.telegram.messenger;
......
/* /*
* This is the source code of Telegram for Android v. 1.3.2. * This is the source code of Telegram for Android v. 2.x.x.
* It is licensed under GNU GPL v. 2 or later. * It is licensed under GNU GPL v. 2 or later.
* You should have received a copy of the license in this archive (see LICENSE). * You should have received a copy of the license in this archive (see LICENSE).
* *
* Copyright Nikolai Kudashov, 2013. * Copyright Nikolai Kudashov, 2013-2015.
*/ */
package org.telegram.messenger; package org.telegram.messenger;
......
/* /*
* This is the source code of Telegram for Android v. 1.3.2. * This is the source code of Telegram for Android v. 2.x.x.
* It is licensed under GNU GPL v. 2 or later. * It is licensed under GNU GPL v. 2 or later.
* You should have received a copy of the license in this archive (see LICENSE). * You should have received a copy of the license in this archive (see LICENSE).
* *
* Copyright Nikolai Kudashov, 2013. * Copyright Nikolai Kudashov, 2013-2015.
*/ */
package org.telegram.messenger; package org.telegram.messenger;
...@@ -157,6 +157,7 @@ public class ApplicationLoader extends Application { ...@@ -157,6 +157,7 @@ public class ApplicationLoader extends Application {
} }
UserConfig.loadConfig(); UserConfig.loadConfig();
MessagesController.getInstance();
if (UserConfig.getCurrentUser() != null) { if (UserConfig.getCurrentUser() != null) {
MessagesController.getInstance().putUser(UserConfig.getCurrentUser(), true); MessagesController.getInstance().putUser(UserConfig.getCurrentUser(), true);
ConnectionsManager.getInstance().applyCountryPortNumber(UserConfig.getCurrentUser().phone); ConnectionsManager.getInstance().applyCountryPortNumber(UserConfig.getCurrentUser().phone);
......
/* /*
* This is the source code of Telegram for Android v. 1.3.x. * This is the source code of Telegram for Android v. 2.x.x.
* It is licensed under GNU GPL v. 2 or later. * It is licensed under GNU GPL v. 2 or later.
* You should have received a copy of the license in this archive (see LICENSE). * You should have received a copy of the license in this archive (see LICENSE).
* *
* Copyright Nikolai Kudashov, 2013-2014. * Copyright Nikolai Kudashov, 2013-2015.
*/ */
package org.telegram.messenger; package org.telegram.messenger;
...@@ -37,12 +37,12 @@ public class BuffersStorage { ...@@ -37,12 +37,12 @@ public class BuffersStorage {
public BuffersStorage(boolean threadSafe) { public BuffersStorage(boolean threadSafe) {
isThreadSafe = threadSafe; isThreadSafe = threadSafe;
freeBuffers128 = new ArrayList<ByteBufferDesc>(); freeBuffers128 = new ArrayList<>();
freeBuffers1024 = new ArrayList<ByteBufferDesc>(); freeBuffers1024 = new ArrayList<>();
freeBuffers4096 = new ArrayList<ByteBufferDesc>(); freeBuffers4096 = new ArrayList<>();
freeBuffers16384 = new ArrayList<ByteBufferDesc>(); freeBuffers16384 = new ArrayList<>();
freeBuffers32768 = new ArrayList<ByteBufferDesc>(); freeBuffers32768 = new ArrayList<>();
freeBuffersBig = new ArrayList<ByteBufferDesc>(); freeBuffersBig = new ArrayList<>();
for (int a = 0; a < 5; a++) { for (int a = 0; a < 5; a++) {
freeBuffers128.add(new ByteBufferDesc(128)); freeBuffers128.add(new ByteBufferDesc(128));
......
...@@ -10,7 +10,7 @@ package org.telegram.messenger; ...@@ -10,7 +10,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 int BUILD_VERSION = 521; public static int BUILD_VERSION = 541;
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
public static String HOCKEY_APP_HASH = "your-hockeyapp-api-key-here"; public static String HOCKEY_APP_HASH = "your-hockeyapp-api-key-here";
......
/* /*
* This is the source code of Telegram for Android v. 2.x * This is the source code of Telegram for Android v. 2.x.x.
* It is licensed under GNU GPL v. 2 or later. * It is licensed under GNU GPL v. 2 or later.
* You should have received a copy of the license in this archive (see LICENSE). * You should have received a copy of the license in this archive (see LICENSE).
* *
......
/* /*
* This is the source code of Telegram for Android v. 1.3.x. * This is the source code of Telegram for Android v. 2.x.x.
* It is licensed under GNU GPL v. 2 or later. * It is licensed under GNU GPL v. 2 or later.
* You should have received a copy of the license in this archive (see LICENSE). * You should have received a copy of the license in this archive (see LICENSE).
* *
* Copyright Nikolai Kudashov, 2013-2014. * Copyright Nikolai Kudashov, 2013-2015.
*/ */
package org.telegram.messenger; package org.telegram.messenger;
......
/* /*
* This is the source code of Telegram for Android v. 1.4.x. * This is the source code of Telegram for Android v. 2.x.x.
* It is licensed under GNU GPL v. 2 or later. * It is licensed under GNU GPL v. 2 or later.
* You should have received a copy of the license in this archive (see LICENSE). * You should have received a copy of the license in this archive (see LICENSE).
* *
* Copyright Nikolai Kudashov, 2013-2014. * Copyright Nikolai Kudashov, 2013-2015.
*/ */
package org.telegram.messenger; package org.telegram.messenger;
......
/* /*
* This is the source code of Telegram for Android v. 1.3.2. * This is the source code of Telegram for Android v. 2.x.x.
* It is licensed under GNU GPL v. 2 or later. * It is licensed under GNU GPL v. 2 or later.
* You should have received a copy of the license in this archive (see LICENSE). * You should have received a copy of the license in this archive (see LICENSE).
* *
* Copyright Nikolai Kudashov, 2013. * Copyright Nikolai Kudashov, 2013-2015.
*/ */
package org.telegram.messenger; package org.telegram.messenger;
......
/* /*
* This is the source code of Telegram for Android v. 1.3.2. * This is the source code of Telegram for Android v. 2.x.x.
* It is licensed under GNU GPL v. 2 or later. * It is licensed under GNU GPL v. 2 or later.
* You should have received a copy of the license in this archive (see LICENSE). * You should have received a copy of the license in this archive (see LICENSE).
* *
* Copyright Nikolai Kudashov, 2013. * Copyright Nikolai Kudashov, 2013-2015.
*/ */
package org.telegram.messenger; package org.telegram.messenger;
......
/* /*
* This is the source code of Telegram for Android v. 1.3.2. * This is the source code of Telegram for Android v. 2.x.x.
* It is licensed under GNU GPL v. 2 or later. * It is licensed under GNU GPL v. 2 or later.
* You should have received a copy of the license in this archive (see LICENSE). * You should have received a copy of the license in this archive (see LICENSE).
* *
* Copyright Nikolai Kudashov, 2013. * Copyright Nikolai Kudashov, 2013-2015.
*/ */
package org.telegram.messenger; package org.telegram.messenger;
...@@ -60,7 +60,7 @@ public class FileLoadOperation { ...@@ -60,7 +60,7 @@ public class FileLoadOperation {
void didChangedLoadProgress(FileLoadOperation operation, float progress); void didChangedLoadProgress(FileLoadOperation operation, float progress);
} }
public FileLoadOperation(TLRPC.FileLocation photoLocation, int size) { public FileLoadOperation(TLRPC.FileLocation photoLocation, String extension, int size) {
if (photoLocation instanceof TLRPC.TL_fileEncryptedLocation) { if (photoLocation instanceof TLRPC.TL_fileEncryptedLocation) {
location = new TLRPC.TL_inputEncryptedFileLocation(); location = new TLRPC.TL_inputEncryptedFileLocation();
location.id = photoLocation.volume_id; location.id = photoLocation.volume_id;
...@@ -79,10 +79,7 @@ public class FileLoadOperation { ...@@ -79,10 +79,7 @@ public class FileLoadOperation {
datacenter_id = photoLocation.dc_id; datacenter_id = photoLocation.dc_id;
} }
totalBytesCount = size; totalBytesCount = size;
ext = photoLocation.ext; ext = extension != null ? extension : "jpg";
if (ext == null) {
ext = "jpg";
}
} }
public FileLoadOperation(TLRPC.Video videoLocation) { public FileLoadOperation(TLRPC.Video videoLocation) {
...@@ -140,7 +137,7 @@ public class FileLoadOperation { ...@@ -140,7 +137,7 @@ public class FileLoadOperation {
} }
totalBytesCount = documentLocation.size; totalBytesCount = documentLocation.size;
ext = FileLoader.getDocumentFileName(documentLocation); ext = FileLoader.getDocumentFileName(documentLocation);
int idx = -1; int idx;
if (ext == null || (idx = ext.lastIndexOf(".")) == -1) { if (ext == null || (idx = ext.lastIndexOf(".")) == -1) {
ext = ""; ext = "";
} else { } else {
...@@ -179,8 +176,8 @@ public class FileLoadOperation { ...@@ -179,8 +176,8 @@ public class FileLoadOperation {
return; return;
} }
Long mediaId = null; Long mediaId = null;
String fileNameFinal = null; String fileNameFinal;
String fileNameTemp = null; String fileNameTemp;
String fileNameIv = null; String fileNameIv = null;
if (location.volume_id != 0 && location.local_id != 0) { if (location.volume_id != 0 && location.local_id != 0) {
fileNameTemp = location.volume_id + "_" + location.local_id + "_temp." + ext; fileNameTemp = location.volume_id + "_" + location.local_id + "_temp." + ext;
...@@ -219,7 +216,6 @@ public class FileLoadOperation { ...@@ -219,7 +216,6 @@ public class FileLoadOperation {
cacheFileFinal = new File(storePath, fileNameFinal); cacheFileFinal = new File(storePath, fileNameFinal);
boolean exist = cacheFileFinal.exists(); boolean exist = cacheFileFinal.exists();
if (exist && totalBytesCount != 0 && totalBytesCount != cacheFileFinal.length()) { if (exist && totalBytesCount != 0 && totalBytesCount != cacheFileFinal.length()) {
exist = false;
cacheFileFinal.delete(); cacheFileFinal.delete();
} }
...@@ -388,7 +384,6 @@ public class FileLoadOperation { ...@@ -388,7 +384,6 @@ public class FileLoadOperation {
processRequestResult(delayedRequestInfo, null); processRequestResult(delayedRequestInfo, null);
delayedRequestInfo.response.disableFree = false; delayedRequestInfo.response.disableFree = false;
delayedRequestInfo.response.freeResources(); delayedRequestInfo.response.freeResources();
delayedRequestInfo = null;
break; break;
} }
} }
......
/* /*
* This is the source code of Telegram for Android v. 1.3.2. * This is the source code of Telegram for Android v. 2.x.x.
* It is licensed under GNU GPL v. 2 or later. * It is licensed under GNU GPL v. 2 or later.
* You should have received a copy of the license in this archive (see LICENSE). * You should have received a copy of the license in this archive (see LICENSE).
* *
* Copyright Nikolai Kudashov, 2013. * Copyright Nikolai Kudashov, 2013-2015.
*/ */
package org.telegram.messenger; package org.telegram.messenger;
import android.net.Uri;
import android.util.Log; import android.util.Log;
import org.telegram.android.time.FastDateFormat; import org.telegram.android.time.FastDateFormat;
...@@ -16,7 +15,6 @@ import org.telegram.android.time.FastDateFormat; ...@@ -16,7 +15,6 @@ import org.telegram.android.time.FastDateFormat;
import java.io.File; import java.io.File;
import java.io.FileOutputStream; import java.io.FileOutputStream;
import java.io.OutputStreamWriter; import java.io.OutputStreamWriter;
import java.util.ArrayList;
import java.util.Locale; import java.util.Locale;
public class FileLog { public class FileLog {
...@@ -50,14 +48,8 @@ public class FileLog { ...@@ -50,14 +48,8 @@ public class FileLog {
return; return;
} }
File dir = new File(sdCard.getAbsolutePath() + "/logs"); File dir = new File(sdCard.getAbsolutePath() + "/logs");
if (dir == null) {
return;
}
dir.mkdirs(); dir.mkdirs();
currentFile = new File(dir, dateFormat.format(System.currentTimeMillis()) + ".txt"); currentFile = new File(dir, dateFormat.format(System.currentTimeMillis()) + ".txt");
if (currentFile == null) {
return;
}
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
...@@ -181,7 +173,6 @@ public class FileLog { ...@@ -181,7 +173,6 @@ public class FileLog {
} }
public static void cleanupLogs() { public static void cleanupLogs() {
ArrayList<Uri> uris = new ArrayList<>();
File sdCard = ApplicationLoader.applicationContext.getExternalFilesDir(null); File sdCard = ApplicationLoader.applicationContext.getExternalFilesDir(null);
File dir = new File (sdCard.getAbsolutePath() + "/logs"); File dir = new File (sdCard.getAbsolutePath() + "/logs");
File[] files = dir.listFiles(); File[] files = dir.listFiles();
......
...@@ -294,7 +294,7 @@ public class ChatActivityAdapter { ...@@ -294,7 +294,7 @@ public class ChatActivityAdapter {
} }
} }
); );
showAlertDialog(builder); showDialog(builder.create());
} }
}); });
} }
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment