Merge "Prevent index out of bounds when using String.substring." into lmp-sprout-dev

This commit is contained in:
Filip Gruszczynski
2014-10-14 20:59:57 +00:00
committed by Android (Google) Code Review

View File

@@ -275,9 +275,10 @@ public class WallpaperManagerService extends IWallpaperManager.Stub {
} else { } else {
mWallpaper.lastDiedTime = SystemClock.uptimeMillis(); mWallpaper.lastDiedTime = SystemClock.uptimeMillis();
} }
final String flattened = name.flattenToString();
EventLog.writeEvent(EventLogTags.WP_WALLPAPER_CRASHED, EventLog.writeEvent(EventLogTags.WP_WALLPAPER_CRASHED,
name.flattenToString().substring(0, flattened.substring(0, Math.min(flattened.length(),
MAX_WALLPAPER_COMPONENT_LOG_LENGTH)); MAX_WALLPAPER_COMPONENT_LOG_LENGTH)));
} }
} }
} }