Skip to content

Commit cab7cb1

Browse files
committed
Clean up code for testing
1 parent c41b921 commit cab7cb1

File tree

1 file changed

+2
-7
lines changed
  • OneSignalSDK/onesignal/core/src/main/java/com/onesignal/internal

1 file changed

+2
-7
lines changed

OneSignalSDK/onesignal/core/src/main/java/com/onesignal/internal/OneSignalImp.kt

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -247,15 +247,12 @@ internal class OneSignalImp : IOneSignal, IServiceProvider {
247247
startupService = services.getService()
248248
startupService!!.bootstrap()
249249

250-
forceCreateUser = true;
251250
if (forceCreateUser || !identityModelStore!!.model.hasProperty(IdentityConstants.ONESIGNAL_ID)) {
252-
var legacyPlayerId =
251+
val legacyPlayerId =
253252
preferencesService!!.getString(
254253
PreferenceStores.ONESIGNAL,
255254
PreferenceOneSignalKeys.PREFS_LEGACY_PLAYER_ID,
256255
)
257-
// creating a non-null legacyPlayerId
258-
legacyPlayerId = "temp";
259256
if (legacyPlayerId == null) {
260257
Logging.debug("initWithContext: creating new device-scoped user")
261258
createAndSwitchToNewUser()
@@ -272,15 +269,13 @@ internal class OneSignalImp : IOneSignal, IServiceProvider {
272269
// Converting a 4.x SDK to the 5.x SDK. We pull the legacy user sync values to create the subscription model, then enqueue
273270
// a specialized `LoginUserFromSubscriptionOperation`, which will drive fetching/refreshing of the local user
274271
// based on the subscription ID we do have.
275-
var legacyUserSyncString =
272+
val legacyUserSyncString =
276273
preferencesService!!.getString(
277274
PreferenceStores.ONESIGNAL,
278275
PreferenceOneSignalKeys.PREFS_LEGACY_USER_SYNCVALUES,
279276
)
280277
var suppressBackendOperation = false
281278

282-
// creating a non-null legacyUserSyncString
283-
legacyUserSyncString = "{name: test}";
284279
if (legacyUserSyncString != null) {
285280
val legacyUserSyncJSON = JSONObject(legacyUserSyncString)
286281
val notificationTypes = legacyUserSyncJSON.safeInt("notification_types")

0 commit comments

Comments
 (0)