protected static int[] arrayRemove(int[] a, int b) { if (Sonet.arrayContains(a, b)) { int[] c = new int[a.length - 1]; int i = 0; for (int d : a) { if (d != b) { c[i++] = d; } } return c; } else { return a; } }
protected static int[] arrayAdd(int[] a, int b) { if (!Sonet.arrayContains(a, b)) { int cLen = a.length; int[] c = new int[cLen]; for (int i = 0; i < cLen; i++) { c[i] = a[i]; } a = new int[cLen + 1]; for (int i = 0; i < cLen; i++) { a[i] = c[i]; } a[cLen] = b; } return a; }
protected static int[] getWidgets(Context context, AppWidgetManager awm) { int[] widgets = new int[0]; Class[] clazzes = new Class[] { SonetWidget_2x2.class, SonetWidget_2x3.class, SonetWidget_2x4.class, SonetWidget_4x2.class, SonetWidget_4x3.class, SonetWidget_4x4.class }; for (Class clazz : clazzes) { widgets = Sonet.arrayCat( widgets, awm.getAppWidgetIds(new ComponentName(context, getPackageClass(context, clazz)))); } return widgets; }
public static Uri getContentUri(Context context) { return Uri.parse("content://" + Sonet.getAuthority(context) + "/status_images"); }
public static Uri getContentUri(Context context) { return Uri.parse("content://" + Sonet.getAuthority(context) + "/notifications"); }
public static Uri getContentUri(Context context) { return Uri.parse("content://" + Sonet.getAuthority(context) + "/accounts_styles"); }
public static Uri getDistinctContentUri(Context context) { return Uri.parse("content://" + Sonet.getAuthority(context) + "/distinct_widgets_settings"); }
public static Uri getContentUri(Context context) { return Uri.parse("content://" + Sonet.getAuthority(context) + "/widget_accounts_view"); }