Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
apk
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
apk
Commits
4ddfda63
Commit
4ddfda63
authored
Oct 29, 2014
by
DrKLO
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug fixes
parent
5ddd8a09
Changes
11
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
3257 additions
and
23 deletions
+3257
-23
LocaleController.java
.../src/main/java/org/telegram/android/LocaleController.java
+1
-0
MessagesController.java
...rc/main/java/org/telegram/android/MessagesController.java
+9
-7
MessagesStorage.java
...j/src/main/java/org/telegram/android/MessagesStorage.java
+8
-8
DateParser.java
...j/src/main/java/org/telegram/android/time/DateParser.java
+107
-0
DatePrinter.java
.../src/main/java/org/telegram/android/time/DatePrinter.java
+126
-0
FastDateFormat.java
...c/main/java/org/telegram/android/time/FastDateFormat.java
+613
-0
FastDateParser.java
...c/main/java/org/telegram/android/time/FastDateParser.java
+840
-0
FastDatePrinter.java
.../main/java/org/telegram/android/time/FastDatePrinter.java
+1278
-0
FormatCache.java
.../src/main/java/org/telegram/android/time/FormatCache.java
+265
-0
FileLog.java
...gesProj/src/main/java/org/telegram/messenger/FileLog.java
+1
-1
VideoEditorActivity.java
...oj/src/main/java/org/telegram/ui/VideoEditorActivity.java
+9
-7
No files found.
TMessagesProj/src/main/java/org/telegram/android/LocaleController.java
View file @
4ddfda63
...
...
@@ -18,6 +18,7 @@ import android.content.res.Configuration;
import
android.text.format.DateFormat
;
import
android.util.Xml
;
import
org.telegram.android.time.FastDateFormat
;
import
org.telegram.messenger.ConnectionsManager
;
import
org.telegram.messenger.FileLog
;
import
org.telegram.messenger.R
;
...
...
TMessagesProj/src/main/java/org/telegram/android/MessagesController.java
View file @
4ddfda63
...
...
@@ -3886,8 +3886,13 @@ public class MessagesController implements NotificationCenter.NotificationCenter
return
null
;
}
if
(
chat
.
seq_in
!=
layer
.
out_seq_no
&&
chat
.
seq_in
!=
layer
.
out_seq_no
-
2
)
{
/*TLRPC.Message decryptedMessage = processDecryptedObject(chat, message, layer.message);
if (decryptedMessage == null) {
ArrayList
<
TLRPC
.
TL_decryptedMessageHolder
>
arr
=
secretHolesQueue
.
get
(
chat
.
id
);
if
(
arr
==
null
)
{
arr
=
new
ArrayList
<
TLRPC
.
TL_decryptedMessageHolder
>();
secretHolesQueue
.
put
(
chat
.
id
,
arr
);
}
if
(
arr
.
size
()
>=
10
)
{
secretHolesQueue
.
remove
(
chat
.
id
);
final
TLRPC
.
TL_encryptedChatDiscarded
newChat
=
new
TLRPC
.
TL_encryptedChatDiscarded
();
newChat
.
id
=
chat
.
id
;
newChat
.
user_id
=
chat
.
user_id
;
...
...
@@ -3903,12 +3908,9 @@ public class MessagesController implements NotificationCenter.NotificationCenter
}
});
declineSecretChat
(
chat
.
id
);
}*/
ArrayList
<
TLRPC
.
TL_decryptedMessageHolder
>
arr
=
secretHolesQueue
.
get
(
chat
.
id
);
if
(
arr
==
null
)
{
arr
=
new
ArrayList
<
TLRPC
.
TL_decryptedMessageHolder
>();
secretHolesQueue
.
put
(
chat
.
id
,
arr
);
return
null
;
}
TLRPC
.
TL_decryptedMessageHolder
holder
=
new
TLRPC
.
TL_decryptedMessageHolder
();
holder
.
layer
=
layer
;
holder
.
file
=
message
.
file
;
...
...
TMessagesProj/src/main/java/org/telegram/android/MessagesStorage.java
View file @
4ddfda63
...
...
@@ -110,7 +110,7 @@ public class MessagesStorage {
database
.
executeFast
(
"CREATE TABLE download_queue(uid INTEGER, type INTEGER, date INTEGER, data BLOB, PRIMARY KEY (uid, type));"
).
stepThis
().
dispose
();
database
.
executeFast
(
"CREATE TABLE dialog_settings(did INTEGER PRIMARY KEY, flags INTEGER);"
).
stepThis
().
dispose
();
database
.
executeFast
(
"CREATE TABLE messages_seq(mid INTEGER PRIMARY KEY, seq_in INTEGER, seq_out INTEGER);"
).
stepThis
().
dispose
();
database
.
executeFast
(
"CREATE TABLE secret_holes(uid INTEGER, seq_in INTEGER, seq_out INTEGER, data BLOB, PRIMARY KEY (uid, seq_in, seq_out));"
).
stepThis
().
dispose
();
//
database.executeFast("CREATE TABLE secret_holes(uid INTEGER, seq_in INTEGER, seq_out INTEGER, data BLOB, PRIMARY KEY (uid, seq_in, seq_out));").stepThis().dispose();
//database.executeFast("CREATE TABLE attach_data(uid INTEGER, id INTEGER, data BLOB, PRIMARY KEY (uid, id))").stepThis().dispose();
...
...
@@ -142,7 +142,7 @@ public class MessagesStorage {
database
.
executeFast
(
"CREATE INDEX IF NOT EXISTS seq_idx_messages_seq ON messages_seq(seq_in, seq_out);"
).
stepThis
().
dispose
();
database
.
executeFast
(
"PRAGMA user_version =
8
"
).
stepThis
().
dispose
();
database
.
executeFast
(
"PRAGMA user_version =
7
"
).
stepThis
().
dispose
();
}
else
{
try
{
SQLiteCursor
cursor
=
database
.
queryFinalized
(
"SELECT seq, pts, date, qts, lsv, sg, pbytes FROM params WHERE id = 1"
);
...
...
@@ -174,7 +174,7 @@ public class MessagesStorage {
}
int
version
=
database
.
executeInt
(
"PRAGMA user_version"
);
if
(
version
<
8
)
{
if
(
version
<
7
)
{
updateDbToLastVersion
(
version
);
}
}
...
...
@@ -304,11 +304,11 @@ public class MessagesStorage {
database
.
executeFast
(
"PRAGMA user_version = 7"
).
stepThis
().
dispose
();
version
=
7
;
}
if
(
version
==
7
&&
version
<
8
)
{
/*
if (version == 7 && version < 8) {
database.executeFast("CREATE TABLE IF NOT EXISTS secret_holes(uid INTEGER, seq_in INTEGER, seq_out INTEGER, data BLOB, PRIMARY KEY (uid, seq_in, seq_out));").stepThis().dispose();
database.executeFast("PRAGMA user_version = 8").stepThis().dispose();
version = 8;
}
}
*/
}
catch
(
Exception
e
)
{
FileLog
.
e
(
"tmessages"
,
e
);
}
...
...
@@ -671,7 +671,7 @@ public class MessagesStorage {
}
}
else
{
database
.
executeFast
(
"DELETE FROM enc_chats WHERE uid = "
+
high_id
).
stepThis
().
dispose
();
database
.
executeFast
(
"DELETE FROM secret_holes WHERE uid = "
+
high_id
).
stepThis
().
dispose
();
//
database.executeFast("DELETE FROM secret_holes WHERE uid = " + high_id).stepThis().dispose();
}
}
database
.
executeFast
(
"UPDATE dialogs SET unread_count = 0 WHERE did = "
+
did
).
stepThis
().
dispose
();
...
...
@@ -2805,7 +2805,7 @@ public class MessagesStorage {
});
}
public
void
getHoleMessages
()
{
/*
public void getHoleMessages() {
storageQueue.postRunnable(new Runnable() {
@Override
public void run() {
...
...
@@ -2857,7 +2857,7 @@ public class MessagesStorage {
}
}
});
}
}
*/
public
void
setMessageSeq
(
final
int
mid
,
final
int
seq_in
,
final
int
seq_out
)
{
storageQueue
.
postRunnable
(
new
Runnable
()
{
...
...
TMessagesProj/src/main/java/org/telegram/android/time/DateParser.java
0 → 100644
View file @
4ddfda63
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org
.
telegram
.
android
.
time
;
import
java.text.ParseException
;
import
java.text.ParsePosition
;
import
java.util.Date
;
import
java.util.Locale
;
import
java.util.TimeZone
;
/**
* <p>DateParser is the "missing" interface for the parsing methods of
* {@link java.text.DateFormat}.</p>
*
* @since 3.2
*/
public
interface
DateParser
{
/**
* Equivalent to DateFormat.parse(String).
* <p/>
* See {@link java.text.DateFormat#parse(String)} for more information.
*
* @param source A <code>String</code> whose beginning should be parsed.
* @return A <code>Date</code> parsed from the string
* @throws ParseException if the beginning of the specified string cannot be parsed.
*/
Date
parse
(
String
source
)
throws
ParseException
;
/**
* Equivalent to DateFormat.parse(String, ParsePosition).
* <p/>
* See {@link java.text.DateFormat#parse(String, ParsePosition)} for more information.
*
* @param source A <code>String</code>, part of which should be parsed.
* @param pos A <code>ParsePosition</code> object with index and error index information
* as described above.
* @return A <code>Date</code> parsed from the string. In case of error, returns null.
* @throws NullPointerException if text or pos is null.
*/
Date
parse
(
String
source
,
ParsePosition
pos
);
// Accessors
//-----------------------------------------------------------------------
/**
* <p>Get the pattern used by this parser.</p>
*
* @return the pattern, {@link java.text.SimpleDateFormat} compatible
*/
String
getPattern
();
/**
* <p>
* Get the time zone used by this parser.
* </p>
* <p/>
* <p>
* The default {@link TimeZone} used to create a {@link Date} when the {@link TimeZone} is not specified by
* the format pattern.
* </p>
*
* @return the time zone
*/
TimeZone
getTimeZone
();
/**
* <p>Get the locale used by this parser.</p>
*
* @return the locale
*/
Locale
getLocale
();
/**
* Parses text from a string to produce a Date.
*
* @param source A <code>String</code> whose beginning should be parsed.
* @return a <code>java.util.Date</code> object
* @throws ParseException if the beginning of the specified string cannot be parsed.
* @see java.text.DateFormat#parseObject(String)
*/
Object
parseObject
(
String
source
)
throws
ParseException
;
/**
* Parse a date/time string according to the given parse position.
*
* @param source A <code>String</code> whose beginning should be parsed.
* @param pos the parse position
* @return a <code>java.util.Date</code> object
* @see java.text.DateFormat#parseObject(String, ParsePosition)
*/
Object
parseObject
(
String
source
,
ParsePosition
pos
);
}
TMessagesProj/src/main/java/org/telegram/android/time/DatePrinter.java
0 → 100644
View file @
4ddfda63
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org
.
telegram
.
android
.
time
;
import
java.text.FieldPosition
;
import
java.util.Calendar
;
import
java.util.Date
;
import
java.util.Locale
;
import
java.util.TimeZone
;
/**
* <p>DatePrinter is the "missing" interface for the format methods of
* {@link java.text.DateFormat}.</p>
*
* @since 3.2
*/
public
interface
DatePrinter
{
/**
* <p>Formats a millisecond {@code long} value.</p>
*
* @param millis the millisecond value to format
* @return the formatted string
* @since 2.1
*/
String
format
(
long
millis
);
/**
* <p>Formats a {@code Date} object using a {@code GregorianCalendar}.</p>
*
* @param date the date to format
* @return the formatted string
*/
String
format
(
Date
date
);
/**
* <p>Formats a {@code Calendar} object.</p>
*
* @param calendar the calendar to format
* @return the formatted string
*/
String
format
(
Calendar
calendar
);
/**
* <p>Formats a milliseond {@code long} value into the
* supplied {@code StringBuffer}.</p>
*
* @param millis the millisecond value to format
* @param buf the buffer to format into
* @return the specified string buffer
*/
StringBuffer
format
(
long
millis
,
StringBuffer
buf
);
/**
* <p>Formats a {@code Date} object into the
* supplied {@code StringBuffer} using a {@code GregorianCalendar}.</p>
*
* @param date the date to format
* @param buf the buffer to format into
* @return the specified string buffer
*/
StringBuffer
format
(
Date
date
,
StringBuffer
buf
);
/**
* <p>Formats a {@code Calendar} object into the
* supplied {@code StringBuffer}.</p>
*
* @param calendar the calendar to format
* @param buf the buffer to format into
* @return the specified string buffer
*/
StringBuffer
format
(
Calendar
calendar
,
StringBuffer
buf
);
// Accessors
//-----------------------------------------------------------------------
/**
* <p>Gets the pattern used by this printer.</p>
*
* @return the pattern, {@link java.text.SimpleDateFormat} compatible
*/
String
getPattern
();
/**
* <p>Gets the time zone used by this printer.</p>
* <p/>
* <p>This zone is always used for {@code Date} printing. </p>
*
* @return the time zone
*/
TimeZone
getTimeZone
();
/**
* <p>Gets the locale used by this printer.</p>
*
* @return the locale
*/
Locale
getLocale
();
/**
* <p>Formats a {@code Date}, {@code Calendar} or
* {@code Long} (milliseconds) object.</p>
* <p/>
* See {@link java.text.DateFormat#format(Object, StringBuffer, FieldPosition)}
*
* @param obj the object to format
* @param toAppendTo the buffer to append to
* @param pos the position - ignored
* @return the buffer passed in
*/
StringBuffer
format
(
Object
obj
,
StringBuffer
toAppendTo
,
FieldPosition
pos
);
}
TMessagesProj/src/main/java/org/telegram/android/time/FastDateFormat.java
0 → 100644
View file @
4ddfda63
This diff is collapsed.
Click to expand it.
TMessagesProj/src/main/java/org/telegram/android/time/FastDateParser.java
0 → 100644
View file @
4ddfda63
This diff is collapsed.
Click to expand it.
TMessagesProj/src/main/java/org/telegram/android/
FastDateFormat
.java
→
TMessagesProj/src/main/java/org/telegram/android/
time/FastDatePrinter
.java
View file @
4ddfda63
This diff is collapsed.
Click to expand it.
TMessagesProj/src/main/java/org/telegram/android/time/FormatCache.java
0 → 100644
View file @
4ddfda63
This diff is collapsed.
Click to expand it.
TMessagesProj/src/main/java/org/telegram/messenger/FileLog.java
View file @
4ddfda63
...
...
@@ -11,7 +11,7 @@ package org.telegram.messenger;
import
android.net.Uri
;
import
android.util.Log
;
import
org.telegram.android.FastDateFormat
;
import
org.telegram.android.
time.
FastDateFormat
;
import
org.telegram.ui.ApplicationLoader
;
import
java.io.File
;
...
...
TMessagesProj/src/main/java/org/telegram/ui/VideoEditorActivity.java
View file @
4ddfda63
...
...
@@ -89,8 +89,8 @@ public class VideoEditorActivity extends BaseFragment implements TextureView.Sur
private
float
videoDuration
=
0
;
private
long
startTime
=
0
;
private
long
endTime
=
0
;
private
int
audioFramesSize
=
0
;
private
int
videoFramesSize
=
0
;
private
long
audioFramesSize
=
0
;
private
long
videoFramesSize
=
0
;
private
int
estimatedSize
=
0
;
private
long
esimatedDuration
=
0
;
private
long
originalSize
=
0
;
...
...
@@ -292,7 +292,9 @@ public class VideoEditorActivity extends BaseFragment implements TextureView.Sur
name
.
equals
(
"OMX.ST.VFM.H264Enc"
)
||
name
.
equals
(
"OMX.Exynos.avc.enc"
)
||
name
.
equals
(
"OMX.MARVELL.VIDEO.HW.CODA7542ENCODER"
)
||
name
.
equals
(
"OMX.MARVELL.VIDEO.H264ENCODER"
))
{
name
.
equals
(
"OMX.MARVELL.VIDEO.H264ENCODER"
)
||
name
.
equals
(
"OMX.k3.video.encoder.avc"
)
||
//fix this later
name
.
equals
(
"OMX.TI.DUCATI1.VIDEO.H264E"
))
{
//fix this later
compressVideo
.
setVisibility
(
View
.
GONE
);
}
else
{
if
(
MediaController
.
selectColorFormat
(
codecInfo
,
MediaController
.
MIME_TYPE
)
==
0
)
{
...
...
@@ -721,8 +723,8 @@ public class VideoEditorActivity extends BaseFragment implements TextureView.Sur
for
(
Box
box
:
boxes
)
{
TrackBox
trackBox
=
(
TrackBox
)
box
;
int
sampleSizes
=
0
;
int
trackBitrate
=
0
;
long
sampleSizes
=
0
;
long
trackBitrate
=
0
;
try
{
MediaBox
mediaBox
=
trackBox
.
getMediaBox
();
MediaHeaderBox
mediaHeaderBox
=
mediaBox
.
getMediaHeaderBox
();
...
...
@@ -738,7 +740,7 @@ public class VideoEditorActivity extends BaseFragment implements TextureView.Sur
TrackHeaderBox
headerBox
=
trackBox
.
getTrackHeaderBox
();
if
(
headerBox
.
getWidth
()
!=
0
&&
headerBox
.
getHeight
()
!=
0
)
{
trackHeaderBox
=
headerBox
;
bitrate
=
trackBitrate
/
100000
*
100000
;
bitrate
=
(
int
)(
trackBitrate
/
100000
*
100000
)
;
if
(
bitrate
>
900000
)
{
bitrate
=
900000
;
}
...
...
@@ -768,7 +770,7 @@ public class VideoEditorActivity extends BaseFragment implements TextureView.Sur
resultHeight
*=
scale
;
if
(
bitrate
!=
0
)
{
bitrate
*=
Math
.
max
(
0.5f
,
scale
);
videoFramesSize
=
(
int
)(
bitrate
/
8
*
videoDuration
);
videoFramesSize
=
(
long
)(
bitrate
/
8
*
videoDuration
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment