Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

task(SDK-3215) - Updates Logger implementation to static for HMS module #463

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public boolean createNotification(Context context, final RemoteMessage remoteMes
.getPushNotificationHandler().onMessageReceived(context, messageBundle, HPS.toString());
} catch (Throwable e) {
e.printStackTrace();
Logger.d(LOG_TAG, HMS_LOG_TAG + "Error Creating Notification", e);
Logger.debug(LOG_TAG, HMS_LOG_TAG + "Error Creating Notification", e);
}
}
return isSuccess;
Expand All @@ -68,11 +68,11 @@ public boolean onNewToken(Context context, final String token) {
try {
PushNotificationHandler.getPushNotificationHandler().onNewToken(context, token, PushType.HPS
.getType());
Logger.d(LOG_TAG, HMS_LOG_TAG + "onNewToken: " + token);
Logger.debug(LOG_TAG, HMS_LOG_TAG + "onNewToken: " + token);
isSuccess = true;
} catch (Throwable throwable) {
// do nothing
Logger.d(LOG_TAG, HMS_LOG_TAG + "Error onNewToken: " + token, throwable);
Logger.debug(LOG_TAG, HMS_LOG_TAG + "Error onNewToken: " + token, throwable);
}
return isSuccess;
}
Expand All @@ -91,7 +91,7 @@ public void processPushAmp(final Context context, @NonNull final RemoteMessage m
CleverTapAPI.processPushNotification(context, messageBundle);
}
} catch (Throwable t) {
Logger.d(LOG_TAG, HMS_LOG_TAG + "Error processing push amp", t);
Logger.debug(LOG_TAG, HMS_LOG_TAG + "Error processing push amp", t);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ public class CTHmsMessageService extends HmsMessageService {
@Override
public void onMessageReceived(RemoteMessage remoteMessage) {
super.onMessageReceived(remoteMessage);
Logger.i(LOG_TAG, HMS_LOG_TAG + "onMessageReceived is called");
Logger.info(LOG_TAG, HMS_LOG_TAG + "onMessageReceived is called");
mHandler.createNotification(getApplicationContext(), remoteMessage);
}

@Override
public void onNewToken(String token) {
super.onNewToken(token);
Logger.i(LOG_TAG, HMS_LOG_TAG + "onNewToken is called " + token);
Logger.info(LOG_TAG, HMS_LOG_TAG + "onNewToken is called " + token);
mHandler.onNewToken(getApplicationContext(), token);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ public class HmsNotificationParser implements INotificationParser<RemoteMessage>
public Bundle toBundle(@NonNull final RemoteMessage message) {
try {
Bundle extras = Utils.stringToBundle(message.getData());
Logger.d(LOG_TAG, HMS_LOG_TAG + "Found Valid Notification Message ");
Logger.debug(LOG_TAG, HMS_LOG_TAG + "Found Valid Notification Message ");
return extras;
} catch (Throwable e) {
e.printStackTrace();
Logger.d(LOG_TAG, HMS_LOG_TAG + "Invalid Notification Message ", e);
Logger.debug(LOG_TAG, HMS_LOG_TAG + "Invalid Notification Message ", e);
}
return null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import android.content.Context;
import android.text.TextUtils;
import com.clevertap.android.sdk.CleverTapInstanceConfig;
import com.clevertap.android.sdk.Logger;
import com.huawei.agconnect.AGConnectOptions;
import com.huawei.agconnect.AGConnectOptionsBuilder;
import com.huawei.hms.aaid.HmsInstanceId;
Expand Down Expand Up @@ -46,7 +47,7 @@ public String appId() {
try {
appId = options.getString(APP_ID_KEY);
} catch (Throwable t) {
mConfig.log(LOG_TAG, HMS_LOG_TAG + "HMS availability check failed.");
Logger.verbose(mConfig.getAccountId(), LOG_TAG, HMS_LOG_TAG + "HMS availability check failed.");
}
return appId;
}
Expand All @@ -61,7 +62,7 @@ public boolean isSupported() {
try {
return HuaweiApiAvailability.getInstance().isHuaweiMobileNoticeAvailable(context) == 0;
} catch (Throwable e) {
mConfig.log(LOG_TAG, HMS_LOG_TAG + "HMS is supported check failed.");
Logger.verbose(mConfig.getAccountId(), LOG_TAG, HMS_LOG_TAG + "HMS is supported check failed.");
return false;
}
}
Expand All @@ -75,7 +76,7 @@ public String onNewToken() {
token = HmsInstanceId.getInstance(context).getToken(appId, HCM_SCOPE);
}
} catch (Throwable t) {
mConfig.log(LOG_TAG, HMS_LOG_TAG + "Error requesting HMS token", t);
Logger.verbose(mConfig.getAccountId(), LOG_TAG, HMS_LOG_TAG + "Error requesting HMS token", t);
}
return token;
}
Expand Down
Loading