Classify call chips by SystemUI structure
This commit is contained in:
+3
-15
@@ -6,7 +6,6 @@ import android.content.pm.PackageManager;
|
||||
import android.telecom.TelecomManager;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.TextView;
|
||||
|
||||
import java.util.ArrayDeque;
|
||||
import java.util.Locale;
|
||||
@@ -33,13 +32,9 @@ public final class StatusChipCallSupport {
|
||||
View view = queue.removeFirst();
|
||||
String className = view.getClass().getName().toLowerCase(Locale.ROOT);
|
||||
String idName = ViewIdNames.idName(view).toLowerCase(Locale.ROOT);
|
||||
if (className.contains("call") || idName.contains("call")) {
|
||||
return true;
|
||||
}
|
||||
if (containsCallToken(view.getContentDescription())) {
|
||||
return true;
|
||||
}
|
||||
if (view instanceof TextView textView && containsCallToken(textView.getText())) {
|
||||
if (className.contains("ongoingcall")
|
||||
|| className.contains("ongoing_call")
|
||||
|| idName.contains("ongoing_call")) {
|
||||
return true;
|
||||
}
|
||||
if (view instanceof ViewGroup childGroup) {
|
||||
@@ -66,11 +61,4 @@ public final class StatusChipCallSupport {
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean containsCallToken(CharSequence value) {
|
||||
if (value == null || value.length() == 0) {
|
||||
return false;
|
||||
}
|
||||
String text = value.toString().toLowerCase(Locale.ROOT);
|
||||
return text.contains("call") || text.contains("phone");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user