Loading src/java/com/android/internal/telephony/RILUtils.java +18 −8 Original line number Diff line number Diff line Loading @@ -349,6 +349,7 @@ import com.android.telephony.Rlog; import java.io.ByteArrayInputStream; import java.io.DataInputStream; import java.io.IOException; import java.lang.reflect.Array; import java.lang.reflect.Field; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; Loading Loading @@ -5183,10 +5184,17 @@ public class RILUtils { // Special handling for arrays StringBuilder sb = new StringBuilder("["); boolean added = false; if (isPrimitiveOrWrapper(o.getClass().getComponentType())) { for (int i = 0; i < Array.getLength(o); i++) { sb.append(convertToString(Array.get(o, i))).append(", "); added = true; } } else { for (Object element : (Object[]) o) { sb.append(convertToString(element)).append(", "); added = true; } } if (added) { // Remove extra , sb.delete(sb.length() - 2, sb.length()); Loading @@ -5200,8 +5208,10 @@ public class RILUtils { int tag = -1; try { tag = (int) o.getClass().getDeclaredMethod("getTag").invoke(o); } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException e) { loge(e.getMessage()); } catch (IllegalAccessException | InvocationTargetException e) { loge(e.toString()); } catch (NoSuchMethodException ignored) { // Ignored since only unions have the getTag method } if (tag != -1) { // Special handling for unions Loading @@ -5211,7 +5221,7 @@ public class RILUtils { method.setAccessible(true); tagName = (String) method.invoke(o, tag); } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException e) { loge(e.getMessage()); loge(e.toString()); } if (tagName != null) { sb.append(tagName); Loading @@ -5224,7 +5234,7 @@ public class RILUtils { val = o.getClass().getDeclaredMethod(getTagMethod).invoke(o); } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException e) { loge(e.getMessage()); loge(e.toString()); } if (val != null) { sb.append(convertToString(val)); Loading @@ -5240,7 +5250,7 @@ public class RILUtils { try { val = field.get(o); } catch (IllegalAccessException e) { loge(e.getMessage()); loge(e.toString()); } if (val == null) continue; sb.append(convertToString(val)).append(", "); Loading Loading
src/java/com/android/internal/telephony/RILUtils.java +18 −8 Original line number Diff line number Diff line Loading @@ -349,6 +349,7 @@ import com.android.telephony.Rlog; import java.io.ByteArrayInputStream; import java.io.DataInputStream; import java.io.IOException; import java.lang.reflect.Array; import java.lang.reflect.Field; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; Loading Loading @@ -5183,10 +5184,17 @@ public class RILUtils { // Special handling for arrays StringBuilder sb = new StringBuilder("["); boolean added = false; if (isPrimitiveOrWrapper(o.getClass().getComponentType())) { for (int i = 0; i < Array.getLength(o); i++) { sb.append(convertToString(Array.get(o, i))).append(", "); added = true; } } else { for (Object element : (Object[]) o) { sb.append(convertToString(element)).append(", "); added = true; } } if (added) { // Remove extra , sb.delete(sb.length() - 2, sb.length()); Loading @@ -5200,8 +5208,10 @@ public class RILUtils { int tag = -1; try { tag = (int) o.getClass().getDeclaredMethod("getTag").invoke(o); } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException e) { loge(e.getMessage()); } catch (IllegalAccessException | InvocationTargetException e) { loge(e.toString()); } catch (NoSuchMethodException ignored) { // Ignored since only unions have the getTag method } if (tag != -1) { // Special handling for unions Loading @@ -5211,7 +5221,7 @@ public class RILUtils { method.setAccessible(true); tagName = (String) method.invoke(o, tag); } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException e) { loge(e.getMessage()); loge(e.toString()); } if (tagName != null) { sb.append(tagName); Loading @@ -5224,7 +5234,7 @@ public class RILUtils { val = o.getClass().getDeclaredMethod(getTagMethod).invoke(o); } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException e) { loge(e.getMessage()); loge(e.toString()); } if (val != null) { sb.append(convertToString(val)); Loading @@ -5240,7 +5250,7 @@ public class RILUtils { try { val = field.get(o); } catch (IllegalAccessException e) { loge(e.getMessage()); loge(e.toString()); } if (val == null) continue; sb.append(convertToString(val)).append(", "); Loading