Skip to content

Commit df7badc

Browse files
committed
Use new logInfo API instead of Deprecated API
1 parent d0b8b7e commit df7badc

42 files changed

Lines changed: 272 additions & 266 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

android/hello_sdl_android/src/main/java/com/sdl/hellosdlandroid/SdlReceiver.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public class SdlReceiver extends SdlBroadcastReceiver {
1313

1414
@Override
1515
public void onSdlEnabled(Context context, Intent intent) {
16-
DebugTool.logInfo("SDL Enabled");
16+
DebugTool.logInfo(TAG, "SDL Enabled");
1717
intent.setClass(context, SdlService.class);
1818

1919
// SdlService needs to be foregrounded in Android O and above

android/sdl_android/src/main/java/com/smartdevicelink/SdlConnection/SdlSession.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -638,7 +638,7 @@ public void onProtocolError(String info, Exception e) {
638638

639639
@Override
640640
public void sendHeartbeat(IHeartbeatMonitor monitor) {
641-
DebugTool.logInfo("Asked to send heartbeat");
641+
DebugTool.logInfo(TAG, "Asked to send heartbeat");
642642
if (_sdlConnection != null)
643643
_sdlConnection.sendHeartbeat(this);
644644
}

android/sdl_android/src/main/java/com/smartdevicelink/SdlConnection/SdlSession2.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ public boolean getIsConnected() {
210210

211211

212212
public void shutdown(String info){
213-
DebugTool.logInfo("Shutdown - " + info);
213+
DebugTool.logInfo(TAG, "Shutdown - " + info);
214214
if(mediaStreamingStatus != null) {
215215
mediaStreamingStatus.clear();
216216
}

android/sdl_android/src/main/java/com/smartdevicelink/encoder/SdlEncoder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ public void drainEncoder(boolean endOfStream) {
208208
if (mH264CodecSpecificData != null) {
209209
mBufferInfo.size = 0;
210210
} else {
211-
DebugTool.logInfo("H264 codec specific data not retrieved yet.");
211+
DebugTool.logInfo(TAG, "H264 codec specific data not retrieved yet.");
212212
}
213213
}
214214

android/sdl_android/src/main/java/com/smartdevicelink/encoder/VirtualDisplayEncoder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ void drainEncoder(boolean endOfStream) {
359359
if (mH264CodecSpecificData != null) {
360360
mVideoBufferInfo.size = 0;
361361
} else {
362-
DebugTool.logInfo("H264 codec specific data not retrieved yet.");
362+
DebugTool.logInfo(TAG, "H264 codec specific data not retrieved yet.");
363363
}
364364
}
365365

android/sdl_android/src/main/java/com/smartdevicelink/managers/SdlManager.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ protected void initialize() {
154154
void checkState() {
155155
if (permissionManager != null && fileManager != null && screenManager != null && (!lockScreenConfig.isEnabled() || lockScreenManager != null)) {
156156
if (permissionManager.getState() == BaseSubManager.READY && fileManager.getState() == BaseSubManager.READY && screenManager.getState() == BaseSubManager.READY && (!lockScreenConfig.isEnabled() || lockScreenManager.getState() == BaseSubManager.READY)) {
157-
DebugTool.logInfo("Starting sdl manager, all sub managers are in ready state");
157+
DebugTool.logInfo(TAG, "Starting sdl manager, all sub managers are in ready state");
158158
transitionToState(BaseSubManager.READY);
159159
handleQueuedNotifications();
160160
notifyDevListener(null);
@@ -165,7 +165,7 @@ void checkState() {
165165
transitionToState(BaseSubManager.ERROR);
166166
notifyDevListener(info);
167167
} else if (permissionManager.getState() == BaseSubManager.SETTING_UP || fileManager.getState() == BaseSubManager.SETTING_UP || screenManager.getState() == BaseSubManager.SETTING_UP || (lockScreenConfig.isEnabled() && lockScreenManager != null && lockScreenManager.getState() == BaseSubManager.SETTING_UP)) {
168-
DebugTool.logInfo("SETTING UP sdl manager, some sub managers are still setting up");
168+
DebugTool.logInfo(TAG, "SETTING UP sdl manager, some sub managers are still setting up");
169169
transitionToState(BaseSubManager.SETTING_UP);
170170
// No need to notify developer here!
171171
} else {
@@ -203,7 +203,7 @@ void retryChangeRegistration() {
203203
@Override
204204
public void run() {
205205
checkLifecycleConfiguration();
206-
DebugTool.logInfo("Retry Change Registration Count: " + changeRegistrationRetry);
206+
DebugTool.logInfo(TAG, "Retry Change Registration Count: " + changeRegistrationRetry);
207207
}
208208
}, 3000);
209209
}

android/sdl_android/src/main/java/com/smartdevicelink/managers/lifecycle/LifecycleManager.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ void initializeProxy() {
9191
//A USB transport config was provided
9292
USBTransportConfig usbTransportConfig = (USBTransportConfig) _transportConfig;
9393
if (usbTransportConfig.getUsbAccessory() == null) {
94-
DebugTool.logInfo("Legacy USB transport config was used, but received null for accessory. Attempting to connect with router service");
94+
DebugTool.logInfo(TAG,"Legacy USB transport config was used, but received null for accessory. Attempting to connect with router service");
9595
//The accessory was null which means it came from a router service
9696
MultiplexTransportConfig multiplexTransportConfig = new MultiplexTransportConfig(usbTransportConfig.getUSBContext(), appConfig.getAppID());
9797
multiplexTransportConfig.setRequiresHighBandwidth(true);

android/sdl_android/src/main/java/com/smartdevicelink/managers/lockscreen/LockScreenDeviceIconManager.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ class LockScreenDeviceIconManager {
2727
private Context context;
2828
private static final String SDL_DEVICE_STATUS_SHARED_PREFS = "sdl.lockScreenIcon";
2929
private static final String STORED_ICON_DIRECTORY_PATH = "sdl/lock_screen_icon/";
30+
private static final String TAG = "LockScreenDeviceIconManager";
3031

3132
interface OnIconRetrievedListener {
3233
void onImageRetrieved(Bitmap icon);
@@ -49,10 +50,10 @@ void retrieveIcon(String iconURL, OnIconRetrievedListener iconRetrievedListener)
4950
Bitmap icon = null;
5051
try {
5152
if (isIconCachedAndValid(iconURL)) {
52-
DebugTool.logInfo("Icon Is Up To Date");
53+
DebugTool.logInfo(TAG, "Icon Is Up To Date");
5354
icon = getFileFromCache(iconURL);
5455
if (icon == null) {
55-
DebugTool.logInfo("Icon from cache was null, attempting to re-download");
56+
DebugTool.logInfo(TAG, "Icon from cache was null, attempting to re-download");
5657
icon = AndroidTools.downloadImage(iconURL);
5758
if (icon != null) {
5859
saveFileToCache(icon, iconURL);
@@ -64,7 +65,7 @@ void retrieveIcon(String iconURL, OnIconRetrievedListener iconRetrievedListener)
6465
iconRetrievedListener.onImageRetrieved(icon);
6566
} else {
6667
// The icon is unknown or expired. Download the image, save it to the cache, and update the archive file
67-
DebugTool.logInfo("Lock Screen Icon Update Needed");
68+
DebugTool.logInfo(TAG, "Lock Screen Icon Update Needed");
6869
icon = AndroidTools.downloadImage(iconURL);
6970
if (icon != null) {
7071
saveFileToCache(icon, iconURL);
@@ -94,15 +95,15 @@ private boolean isIconCachedAndValid(String iconUrl) {
9495
SharedPreferences sharedPref = this.context.getSharedPreferences(SDL_DEVICE_STATUS_SHARED_PREFS, Context.MODE_PRIVATE);
9596
String iconLastUpdatedTime = sharedPref.getString(iconHash, null);
9697
if(iconLastUpdatedTime == null) {
97-
DebugTool.logInfo("No Icon Details Found In Shared Preferences");
98+
DebugTool.logInfo(TAG, "No Icon Details Found In Shared Preferences");
9899
return false;
99100
} else {
100-
DebugTool.logInfo("Icon Details Found");
101+
DebugTool.logInfo(TAG, "Icon Details Found");
101102
long lastUpdatedTime = 0;
102103
try {
103104
lastUpdatedTime = Long.parseLong(iconLastUpdatedTime);
104105
} catch (NumberFormatException e) {
105-
DebugTool.logInfo("Invalid time stamp stored to shared preferences, clearing cache and share preferences");
106+
DebugTool.logInfo(TAG, "Invalid time stamp stored to shared preferences, clearing cache and share preferences");
106107
clearIconDirectory();
107108
sharedPref.edit().clear().commit();
108109
}

0 commit comments

Comments
 (0)