-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into android_production
- Loading branch information
Showing
44 changed files
with
1,133 additions
and
172 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
p2psafety-android/p2psafety/src/ua/p2psafety/BootCompletedReceiver.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package ua.p2psafety; | ||
|
||
import android.content.BroadcastReceiver; | ||
import android.content.Context; | ||
import android.content.Intent; | ||
|
||
import ua.p2psafety.services.PowerButtonService; | ||
import ua.p2psafety.services.XmppService; | ||
|
||
/** | ||
* Created by Taras Melon on 14.03.14. | ||
*/ | ||
public class BootCompletedReceiver extends BroadcastReceiver { | ||
|
||
@Override | ||
public void onReceive(Context context, Intent intent) { | ||
context.startService(new Intent(context, PowerButtonService.class)); | ||
context.startService(new Intent(context, XmppService.class)); | ||
} | ||
} |
53 changes: 53 additions & 0 deletions
53
p2psafety-android/p2psafety/src/ua/p2psafety/MyApplication.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
package ua.p2psafety; | ||
|
||
import android.app.Application; | ||
|
||
import com.bugsense.trace.BugSenseHandler; | ||
|
||
import ua.p2psafety.data.Prefs; | ||
import ua.p2psafety.util.Logs; | ||
import ua.p2psafety.util.Utils; | ||
|
||
/** | ||
* Created by Taras Melon on 14.03.14. | ||
*/ | ||
public class MyApplication extends Application { | ||
|
||
private static Logs mLogs; | ||
|
||
@Override | ||
public void onCreate() { | ||
super.onCreate(); | ||
BugSenseHandler.initAndStartSession(this, getString(R.string.bugsense_key)); | ||
|
||
if (Utils.isServerAuthenticated(this)) | ||
{ | ||
if (Utils.isFbAuthenticated(this)) | ||
{ | ||
String uid = Prefs.getUserIdentifier(this); | ||
if (uid != null) | ||
{ | ||
Utils.putUidToBugSense(uid); | ||
} | ||
else | ||
{ | ||
Utils.getFbUserInfo(this); | ||
} | ||
} | ||
else | ||
{ | ||
BugSenseHandler.setUserIdentifier(Prefs.getApiUsername(this)); | ||
} | ||
} | ||
|
||
mLogs = new Logs(this); | ||
|
||
Thread.setDefaultUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler() { | ||
@Override | ||
public void uncaughtException(Thread thread, Throwable ex) { | ||
mLogs.error("UNCAUGHT EXCEPTION!!!", ex); | ||
System.exit(0); | ||
} | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.