diff --git a/liblog/Android.mk b/liblog/Android.mk
index 4ab5006..a183db8 100644
--- a/liblog/Android.mk
+++ b/liblog/Android.mk
@@ -22,7 +22,7 @@
 #       's/^\([0-9]*\)[ \t]*liblog[ \t].*/-DLIBLOG_LOG_TAG=\1/p' \
 #       $(LOCAL_PATH)/event.logtags)
 # so make sure we do not regret hard-coding it as follows:
-liblog_cflags := -DLIBLOG_LOG_TAG=1005 -DSNET_EVENT_LOG_TAG=1397638484
+liblog_cflags := -DLIBLOG_LOG_TAG=1005
 
 liblog_host_sources := logd_write.c log_event_write.c fake_log_device.c event.logtags
 liblog_target_sources := logd_write.c log_event_write.c event_tag_map.c log_time.cpp log_is_loggable.c
diff --git a/liblog/logd_write.c b/liblog/logd_write.c
index ec86e6b..5406c50 100644
--- a/liblog/logd_write.c
+++ b/liblog/logd_write.c
@@ -221,48 +221,50 @@
             return -EPERM;
         }
     } else if (log_id == LOG_ID_EVENTS) {
+        static atomic_uintptr_t map;
+        int ret;
+        const char *tag;
+        EventTagMap *m, *f;
+
         if (vec[0].iov_len < 4) {
             return -EINVAL;
         }
-        if (((uint32_t *)vec[0].iov_base)[0] != htole32(SNET_EVENT_LOG_TAG)) {
-            static atomic_uintptr_t map;
-            int ret;
-            const char *tag = NULL;
-            EventTagMap *m, *f = NULL;
 
-            m = (EventTagMap *)atomic_load(&map);
+        tag = NULL;
+        f = NULL;
+        m = (EventTagMap *)atomic_load(&map);
+
+        if (!m) {
+            ret = trylock();
+            m = (EventTagMap *)atomic_load(&map); /* trylock flush cache */
             if (!m) {
-                ret = trylock();
-                m = (EventTagMap *)atomic_load(&map); /* trylock flush cache */
-                if (!m) {
-                    m = android_openEventTagMap(EVENT_TAG_MAP_FILE);
-                    if (ret) { /* trylock failed, local copy, mark for close */
-                        f = m;
-                    } else {
-                        if (!m) { /* One chance to open map file */
-                            m = (EventTagMap *)(uintptr_t)-1LL;
-                        }
-                        atomic_store(&map, (uintptr_t)m);
+                m = android_openEventTagMap(EVENT_TAG_MAP_FILE);
+                if (ret) { /* trylock failed, use local copy, mark for close */
+                    f = m;
+                } else {
+                    if (!m) { /* One chance to open map file */
+                        m = (EventTagMap *)(uintptr_t)-1LL;
                     }
-                }
-                if (!ret) { /* trylock succeeded, unlock */
-                    unlock();
+                    atomic_store(&map, (uintptr_t)m);
                 }
             }
-            if (m && (m != (EventTagMap *)(uintptr_t)-1LL)) {
-                tag = android_lookupEventTag(
+            if (!ret) { /* trylock succeeded, unlock */
+                unlock();
+            }
+        }
+        if (m && (m != (EventTagMap *)(uintptr_t)-1LL)) {
+            tag = android_lookupEventTag(
                                     m,
                                     htole32(((uint32_t *)vec[0].iov_base)[0]));
-            }
-            ret = __android_log_is_loggable(ANDROID_LOG_INFO,
-                                            tag,
-                                            ANDROID_LOG_VERBOSE);
-            if (f) { /* local copy marked for close */
-                android_closeEventTagMap(f);
-            }
-            if (!ret) {
-                return -EPERM;
-            }
+        }
+        ret = __android_log_is_loggable(ANDROID_LOG_INFO,
+                                        tag,
+                                        ANDROID_LOG_VERBOSE);
+        if (f) { /* local copy marked for close */
+            android_closeEventTagMap(f);
+        }
+        if (!ret) {
+            return -EPERM;
         }
     } else {
         /* Validate the incoming tag, tag content can not split across iovec */
