Skip to content
This repository was archived by the owner on Aug 21, 2018. It is now read-only.

Commit 52bc5bc

Browse files
kylemathiastimecomplexity
authored andcommitted
Add if statment for m_WLANMAC #52 (#55)
1 parent f2b571c commit 52bc5bc

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

app/src/main/java/pbell/offline/ole/org/pbell/FullscreenActivity.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1769,7 +1769,14 @@ public boolean updateActivityOpenedResources(String resource_name, String resour
17691769
manager = new Manager(androidContext, Manager.DEFAULT_OPTIONS);
17701770
activityLog = manager.getDatabase("activitylog");
17711771
WifiManager wm = (WifiManager) getSystemService(Context.WIFI_SERVICE);
1772-
String m_WLANMAC = wm.getConnectionInfo().getMacAddress();
1772+
1773+
//This is for setting the MAC address if it is being run in a android emulator.
1774+
String m_WLANMAC;
1775+
m_WLANMAC = wm.getConnectionInfo().getMacAddress();
1776+
if(m_WLANMAC == null) {
1777+
m_WLANMAC = "mymac";
1778+
}
1779+
17731780
Document retrievedDocument = activityLog.getDocument(m_WLANMAC);
17741781
Map<String, Object> properties = retrievedDocument.getProperties();
17751782
if ((ArrayList<String>) properties.get("female_opened") != null) {

app/src/main/java/pbell/offline/ole/org/pbell/FullscreenLogin.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -612,7 +612,14 @@ public boolean updateActivityLog() {
612612
manager = new Manager(androidContext, Manager.DEFAULT_OPTIONS);
613613
activityLog = manager.getDatabase("activitylog");
614614
WifiManager wm = (WifiManager) getSystemService(Context.WIFI_SERVICE);
615-
String m_WLANMAC = wm.getConnectionInfo().getMacAddress();
615+
616+
//This is for setting the MAC address if it is being run in a android emulator.
617+
String m_WLANMAC;
618+
m_WLANMAC = wm.getConnectionInfo().getMacAddress();
619+
if(m_WLANMAC == null) {
620+
m_WLANMAC = "mymac";
621+
}
622+
616623
Document retrievedDocument = activityLog.getDocument(m_WLANMAC);
617624
if (retrievedDocument != null) {
618625
if (retrievedDocument.getProperties() != null) {

0 commit comments

Comments
 (0)