The image kills the touch screen

Well, I was programming and testing stuff and accidentally created an image that literally destroys the touch screen.

PImage img;
boolean draw=true;

void setup(){
    img=new PImage(min(width,height),min(width,height));
    img.loadPixels();
    for(int i=0;i<img.pixels.length;i++){
      if((i%img.width+i/img.width)%2==0)
      img.pixels[i]=color(255);
      else
      img.pixels[i]=color(0);
    }
    img.updatePixels();
}

void draw(){
  background(200);
  
  imageMode(CENTER);
  if(draw)
  image(img,width/2,height/2);
  
  fill(0);
  textSize(40);
  textAlign(CENTER,CENTER);
  text(touches.length,width*0.5f,height*0.2f);
  
  fill(0,0,255,100);
  noStroke();
  for(int i=0;i<touches.length;i++){
    ellipse(touches[i].x,touches[i].y,100,100);
  }
}


void keyPressed(){
  draw=!draw;
}

It’s basically just a checkered pattern of white and black pixels. But when I display it on the screen, the sensor stops working, not the program itself but the phone sensor.

I’m wondering why this is happening? Or maybe I’m the only one with this problem?

I’m using xiaomi redmi 7, android 10, miui 11.

With a Samsung tablet I see a large gray band in the center of a portrait oriented screen with a zero (0) printed top center. Touches on the screen give a transient purple dot and the zero turns to a one (1). It seems to work reliably over a few minutes of repeated testing. Is that what you intended it to do?

It seems to be working fine for you. My screen just stops working. I can’t even open the notification bar or exit the app. The screen doesn’t show taps and it prints (0).