Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Krishna Vemulavada
/
vera_2.1_app
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
9832c508
authored
Oct 01, 2019
by
Chayaa852
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Socket related changes
parent
84d408af
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
2 deletions
app/src/main/AndroidManifest.xml
app/src/main/java/com/vsoft/vera/ui/ChatActivity.java
app/src/main/AndroidManifest.xml
View file @
9832c508
...
...
@@ -8,6 +8,7 @@
<uses-permission
android:name=
"android.permission.WRITE_EXTERNAL_STORAGE"
/>
<uses-permission
android:name=
"android.permission.READ_EXTERNAL_STORAGE"
/>
<uses-permission
android:name=
"android.permission.RECORD_AUDIO"
/>
<uses-permission
android:name=
"android.permission.WAKE_LOCK"
/>
<uses-feature
android:name=
"android.hardware.camera"
...
...
app/src/main/java/com/vsoft/vera/ui/ChatActivity.java
View file @
9832c508
...
...
@@ -19,6 +19,7 @@ import android.os.Bundle;
import
android.os.Environment
;
import
android.os.Handler
;
import
android.os.Message
;
import
android.os.PowerManager
;
import
android.provider.MediaStore
;
import
android.speech.tts.TextToSpeech
;
import
android.speech.tts.UtteranceProgressListener
;
...
...
@@ -115,7 +116,7 @@ import static com.vsoft.vera.db.DBManager.DATABASE_NAME;
*/
public
class
ChatActivity
extends
AppCompatActivity
implements
OnDSListener
,
OnDSPermissionsListener
{
private
static
final
String
TAG
=
"ChatActivity"
;
private
static
final
String
TAG
=
ChatActivity
.
class
.
getName
();
//
"ChatActivity";
private
static
String
NEW_MESSAGE
=
"new message"
;
private
static
String
AUTHENTICATED
=
"authenticated"
;
private
static
String
UNAUTHORIZED
=
"unauthorized"
;
...
...
@@ -180,7 +181,7 @@ public class ChatActivity extends AppCompatActivity implements OnDSListener, OnD
private
static
final
String
HTTPS
=
"https://"
;
private
static
final
String
HTTP
=
"http://"
;
private
LinearLayout
mainLayt
;
private
PowerManager
.
WakeLock
wl
;
@Override
public
void
onCreate
(
Bundle
savedInstanceState
)
{
...
...
@@ -197,6 +198,14 @@ public class ChatActivity extends AppCompatActivity implements OnDSListener, OnD
}
});
PowerManager
pm
=
(
PowerManager
)
getApplicationContext
().
getSystemService
(
Context
.
POWER_SERVICE
);
this
.
wl
=
pm
.
newWakeLock
(
PowerManager
.
PARTIAL_WAKE_LOCK
|
PowerManager
.
ON_AFTER_RELEASE
,
TAG
);
wl
.
acquire
();
mLoggedInUserSysId
=
PrefManager
.
getSharedPref
(
this
,
PrefManager
.
PREFERENCE_USER_SYS_ID
);
mLoggedInUsername
=
PrefManager
.
getSharedPref
(
this
,
PrefManager
.
PREFERENCE_USER_FIRST_NAME
);
userSysId
=
PrefManager
.
getSharedPref
(
this
,
PrefManager
.
PREFERENCE_USER_SYS_ID
);
...
...
@@ -1334,6 +1343,7 @@ public class ChatActivity extends AppCompatActivity implements OnDSListener, OnD
mSocket
.
off
(
AUTHENTICATED
,
authenticated
);
mSocket
.
off
(
UNAUTHORIZED
,
unAuthorized
);
}
wl
.
release
();
if
(
speaker
!=
null
)
{
speaker
.
destroy
();
...
...
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