code: private void namespaceSharedPreferences() {
      SharedPreferences newSharedPreferences = Utils.getSegmentSharedPreferences(application, tag);
      BooleanPreference namespaceSharedPreferences =
          new BooleanPreference(newSharedPreferences, "namespaceSharedPreferences", true);
  
      if (namespaceSharedPreferences.get()) {
        SharedPreferences legacySharedPreferences =
            application.getSharedPreferences("analytics-android", Context.MODE_PRIVATE);
        Utils.copySharedPreferences(legacySharedPreferences, newSharedPreferences);
        namespaceSharedPreferences.set(false);
      }
    }
docs: Previously (until version 4.1.7) shared preferences were not namespaced by a tag. This meant
  that all analytics instances shared the same shared preferences. This migration checks if the
  namespaced shared preferences instance contains {@code namespaceSharedPreferences: true}. If it
  does, the migration is already run and does not need to be run again. If it doesn't, it copies
  the legacy shared preferences mapping into the namespaced shared preferences, and sets
  namespaceSharedPreferences to false.