lib/src/main/java/com/ibm/mobilefirstplatform/clientsdk/android/analytics/internal/BMSAnalytics.java
private static void setUserIdentity(final String user, boolean isInitialCtx) {
        if (!isInitialCtx && !BMSAnalytics.hasUserContext) {
            // log it to file:
            logger.error("Cannot set user identity with anonymous user collection enabled.");
            return;
        }

        // Create metadata object to log
        JSONObject metadata = new JSONObject();

        DEFAULT_USER_ID=user;
        String hashedUserID = UUID.nameUUIDFromBytes(user.getBytes()).toString();

        try {
            if (isInitialCtx) {
                metadata.put(CATEGORY, INITIAL_CTX_CATEGORY);
            } else {
                metadata.put(CATEGORY, USER_SWITCH_CATEGORY);
            }
            if (BMSAnalytics.collectLocation  ) {
                if(locationService.getInitLocationRequests() ){
                    metadata.put(LONGITUDE_KEY, locationService.getLongitude());
                    metadata.put(LATITUDE_KEY, locationService.getLatitude());
                }
            }

            metadata.put(TIMESTAMP_KEY, (new Date()).getTime());
            metadata.put(APP_SESSION_ID_KEY, MFPAnalyticsActivityLifecycleListener.getAppSessionID());
            metadata.put(USER_ID_KEY, hashedUserID);
        } catch (JSONException e) {
            logger.debug("JSONException encountered logging change in user context: " + e.getMessage());
        }

        MFPInAppFeedBackListner.setUserIdentity(user);
        log(metadata);
    }
private static void setUserIdentity(final String user, boolean isInitialCtx) {
        if (!isInitialCtx && !BMSAnalytics.hasUserContext) {
            // log it to file:
            logger.error("Cannot set user identity with anonymous user collection enabled.");
            return;
        }

        // Create metadata object to log
        JSONObject metadata = new JSONObject();

        DEFAULT_USER_ID=user;
        String hashedUserID = UUID.nameUUIDFromBytes(user.getBytes()).toString();

        try {
            if (isInitialCtx) {
                metadata.put(CATEGORY, INITIAL_CTX_CATEGORY);
            } else {
                metadata.put(CATEGORY, USER_SWITCH_CATEGORY);
            }
            if (BMSAnalytics.collectLocation  ) {
                if(locationService.getInitLocationRequests() ){
                    metadata.put(LONGITUDE_KEY, locationService.getLongitude());
                    metadata.put(LATITUDE_KEY, locationService.getLatitude());
                }
            }

            metadata.put(TIMESTAMP_KEY, (new Date()).getTime());
            metadata.put(APP_SESSION_ID_KEY, MFPAnalyticsActivityLifecycleListener.getAppSessionID());
            metadata.put(USER_ID_KEY, hashedUserID);
        } catch (JSONException e) {
            logger.debug("JSONException encountered logging change in user context: " + e.getMessage());
        }

        MFPInAppFeedBackListner.setUserIdentity(user);
        log(metadata);
    }
private static void setUserIdentity ( final String user , boolean isInitialCtx ) { if ( ! isInitialCtx && ! BMSAnalytics . hasUserContext ) { // log it to file: logger . error ( "Cannot set user identity with anonymous user collection enabled." ) ; return ; } // Create metadata object to log JSONObject metadata = new JSONObject ( ) ; DEFAULT_USER_ID = user ; String hashedUserID = UUID . nameUUIDFromBytes ( user . getBytes ( ) ) . toString ( ) ; try { if ( isInitialCtx ) { metadata . put ( CATEGORY , INITIAL_CTX_CATEGORY ) ; } else { metadata . put ( CATEGORY , USER_SWITCH_CATEGORY ) ; } if ( BMSAnalytics . collectLocation ) { if ( locationService . getInitLocationRequests ( ) ) { metadata . put ( LONGITUDE_KEY , locationService . getLongitude ( ) ) ; metadata . put ( LATITUDE_KEY , locationService . getLatitude ( ) ) ; } } metadata . put ( TIMESTAMP_KEY , ( new Date ( ) ) . getTime ( ) ) ; metadata . put ( APP_SESSION_ID_KEY , MFPAnalyticsActivityLifecycleListener . getAppSessionID ( ) ) ; metadata . put ( USER_ID_KEY , hashedUserID ) ; } catch ( JSONException e ) { logger . debug ( "JSONException encountered logging change in user context: " + e . getMessage ( ) ) ; } MFPInAppFeedBackListner . setUserIdentity ( user ) ; log ( metadata ) ; }
Specify current application user.  This value will be hashed to ensure privacy.
If your application does not have user context, then nothing will happen.

@param user User User id for current app user.
@param isInitialCtx True if it's a user in the initial context (i.e. when app first starts)
Specify current application user . This value will be hashed to ensure privacy . If your application does not have user context then nothing will happen .