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

Commit 69941ec5 authored by Ricardo Cerqueira's avatar Ricardo Cerqueira
Browse files

PhoneFactory: Block radio init if the device's custom class can't be used

Trap the initialization process in a 10 second error loop. The device
will be normally usable, and have a dead radio. The radio log buffer
will have the full stack dump explaining what went wrong during the
custom class instantiation

Change-Id: Id47d51737a9fb78e6d43a179ba304b1ba03c4219
parent 39d4b1d3
Loading
Loading
Loading
Loading
+6 −2
Original line number Original line Diff line number Diff line
@@ -127,8 +127,12 @@ public class PhoneFactory {
                } catch (Exception e) {
                } catch (Exception e) {
                    // 6 different types of exceptions are thrown here that it's
                    // 6 different types of exceptions are thrown here that it's
                    // easier to just catch Exception as our "error handling" is the same.
                    // easier to just catch Exception as our "error handling" is the same.
                    // Yes, we're blocking the whole thing and making the radio unusable. That's by design.
                    // The log message should make it clear why the radio is broken
                    while (true) {
                        Rlog.e(LOG_TAG, "Unable to construct custom RIL class", e);
                        Rlog.e(LOG_TAG, "Unable to construct custom RIL class", e);
                    sCommandsInterface = new RIL(context, networkMode, cdmaSubscription);
                        try {Thread.sleep(10000);} catch (InterruptedException ie) {}
                    }
                }
                }


                // Instantiate UiccController so that all other classes can just call getInstance()
                // Instantiate UiccController so that all other classes can just call getInstance()