Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit dc0a5b1f authored by Juan Yescas's avatar Juan Yescas
Browse files

Consume consecutive delimiters at beginning of refilled buffer

This change makes sure that the consecutive delimiters at the
beginning of the just refilled buffer are consumed.

Previously, if there were consecutive delimiters at the beginning
of the just refilled buffer, they were not being consumed and were
causing parsing errors. This was also causing fatal exceptions.

```
04-22 12:37:53.077   607   707 E AndroidRuntime: *** FATAL EXCEPTION IN SYSTEM PROCESS: CachedAppOptimizerThread
04-22 12:37:53.077   607   707 E AndroidRuntime: java.lang.NumberFormatException: invalid long: READ
04-22 12:37:53.077   607   707 E AndroidRuntime: 	at com.android.internal.util.ProcFileReader.invalidLong(ProcFileReader.java:238)
04-22 12:37:53.077   607   707 E AndroidRuntime: 	at com.android.internal.util.ProcFileReader.parseAndConsumeLong(ProcFileReader.java:220)
04-22 12:37:53.077   607   707 E AndroidRuntime: 	at com.android.internal.util.ProcFileReader.nextLong(ProcFileReader.java:183)
04-22 12:37:53.077   607   707 E AndroidRuntime: 	at com.android.internal.util.ProcFileReader.nextLong(ProcFileReader.java:172)
04-22 12:37:53.077   607   707 E AndroidRuntime: 	at com.android.internal.util.ProcFileReader.nextInt(ProcFileReader.java:246)
04-22 12:37:53.077   607   707 E AndroidRuntime: 	at com.android.internal.os.ProcLocksReader.handleBlockingFileLocks(ProcLocksReader.java:111)
04-22 12:37:53.077   607   707 E AndroidRuntime: 	at com.android.server.am.CachedAppOptimizer$FreezeHandler.handleMessage(CachedAppOptimizer.java:2267)
04-22 12:37:53.077   607   707 E AndroidRuntime: 	at android.os.Handler.dispatchMessage(Handler.java:107)
04-22 12
```

Bug: 336208153
Bug: 338416108
Bug: 331988929
Test: atest --host-unit-test-only -c  ProcFileReaderTest
Change-Id: I12813fa204d53d53687ffe6e8e3c0a85595b7e25
parent 2949179f
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment