Exemplo n.º 1
1
 @Override
 public int compare(Intent i1, Intent i2) {
   if (i1 == null && i2 == null) return 0;
   if (i1 == null && i2 != null) return -1;
   if (i1 != null && i2 == null) return 1;
   if (i1.equals(i2)) return 0;
   String action1 = i1.getAction();
   String action2 = i2.getAction();
   if (action1 == null && action2 != null) return -1;
   if (action1 != null && action2 == null) return 1;
   if (action1 != null && action2 != null) {
     if (!action1.equals(action2)) {
       return action1.compareTo(action2);
     }
   }
   Uri data1 = i1.getData();
   Uri data2 = i2.getData();
   if (data1 == null && data2 != null) return -1;
   if (data1 != null && data2 == null) return 1;
   if (data1 != null && data2 != null) {
     if (!data1.equals(data2)) {
       return data1.compareTo(data2);
     }
   }
   ComponentName component1 = i1.getComponent();
   ComponentName component2 = i2.getComponent();
   if (component1 == null && component2 != null) return -1;
   if (component1 != null && component2 == null) return 1;
   if (component1 != null && component2 != null) {
     if (!component1.equals(component2)) {
       return component1.compareTo(component2);
     }
   }
   String package1 = i1.getPackage();
   String package2 = i2.getPackage();
   if (package1 == null && package2 != null) return -1;
   if (package1 != null && package2 == null) return 1;
   if (package1 != null && package2 != null) {
     if (!package1.equals(package2)) {
       return package1.compareTo(package2);
     }
   }
   Set<String> categories1 = i1.getCategories();
   Set<String> categories2 = i2.getCategories();
   if (categories1 == null) return categories2 == null ? 0 : -1;
   if (categories2 == null) return 1;
   if (categories1.size() > categories2.size()) return 1;
   if (categories1.size() < categories2.size()) return -1;
   String[] array1 = categories1.toArray(new String[0]);
   String[] array2 = categories2.toArray(new String[0]);
   Arrays.sort(array1);
   Arrays.sort(array2);
   for (int i = 0; i < array1.length; ++i) {
     int val = array1[i].compareTo(array2[i]);
     if (val != 0) return val;
   }
   return 0;
 }
Exemplo n.º 2
1
 @Override
 public int compare(Intent i1, Intent i2) {
   if (i1 == null && i2 == null) return 0;
   if (i1 == null && i2 != null) return -1;
   if (i1 != null && i2 == null) return 1;
   if (i1.equals(i2)) return 0;
   if (i1.getAction() == null && i2.getAction() != null) return -1;
   if (i1.getAction() != null && i2.getAction() == null) return 1;
   if (i1.getAction() != null && i2.getAction() != null) {
     if (!i1.getAction().equals(i2.getAction())) {
       return i1.getAction().compareTo(i2.getAction());
     }
   }
   if (i1.getData() == null && i2.getData() != null) return -1;
   if (i1.getData() != null && i2.getData() == null) return 1;
   if (i1.getData() != null && i2.getData() != null) {
     if (!i1.getData().equals(i2.getData())) {
       return i1.getData().compareTo(i2.getData());
     }
   }
   if (i1.getComponent() == null && i2.getComponent() != null) return -1;
   if (i1.getComponent() != null && i2.getComponent() == null) return 1;
   if (i1.getComponent() != null && i2.getComponent() != null) {
     if (!i1.getComponent().equals(i2.getComponent())) {
       return i1.getComponent().compareTo(i2.getComponent());
     }
   }
   if (i1.getPackage() == null && i2.getPackage() != null) return -1;
   if (i1.getPackage() != null && i2.getPackage() == null) return 1;
   if (i1.getPackage() != null && i2.getPackage() != null) {
     if (!i1.getPackage().equals(i2.getPackage())) {
       return i1.getPackage().compareTo(i2.getPackage());
     }
   }
   Set<String> categories1 = i1.getCategories();
   Set<String> categories2 = i2.getCategories();
   if (categories1 == null) return categories2 == null ? 0 : -1;
   if (categories2 == null) return 1;
   if (categories1.size() > categories2.size()) return 1;
   if (categories1.size() < categories2.size()) return -1;
   String[] array1 = categories1.toArray(new String[0]);
   String[] array2 = categories2.toArray(new String[0]);
   Arrays.sort(array1);
   Arrays.sort(array2);
   for (int i = 0; i < array1.length; ++i) {
     int val = array1[i].compareTo(array2[i]);
     if (val != 0) return val;
   }
   return 0;
 }
Exemplo n.º 3
0
 protected void onNewIntent(Intent paramIntent)
 {
   super.onNewIntent(paramIntent);
   if (paramIntent != null)
   {
     paramIntent = paramIntent.getStringExtra("nofification_type");
     t.d("!32@/B4Tb64lLpKNhhU94SG29vC9zoVXGkMM", "[oneliang][notificationType]%s", new Object[] { paramIntent });
     if ((paramIntent != null) && (paramIntent.equals("no_reg_notification"))) {
       aMq();
     }
   }
 }