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

Commit 92c2b520 authored by chelseahao's avatar chelseahao Committed by Chelsea Hao
Browse files

Catch NoSuchMethodError as `isAutoOnSupported` is tagged as `FlaggedApi`.

Test: Manual
Bug: 346716614
Flag: NA
Change-Id: I40a9f4b33385510036337be334b3a81834537eab
parent 89595fde
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -97,6 +97,10 @@ constructor(
                // Server could throw TimeoutException, InterruptedException or ExecutionException
                Log.e(TAG, "Error calling isAutoOnSupported", e)
                false
            } catch (e: NoSuchMethodError) {
                // TODO(b/346716614): Remove this when the flag is cleaned up.
                Log.e(TAG, "Non-existed api isAutoOnSupported", e)
                false
            }
        }

@@ -109,6 +113,9 @@ constructor(
                // Server could throw IllegalStateException, TimeoutException, InterruptedException
                // or ExecutionException
                Log.e(TAG, "Error calling setAutoOnEnabled", e)
            } catch (e: NoSuchMethodError) {
                // TODO(b/346716614): Remove this when the flag is cleaned up.
                Log.e(TAG, "Non-existed api setAutoOn", e)
            }
        }
    }
@@ -122,6 +129,10 @@ constructor(
                // or ExecutionException
                Log.e(TAG, "Error calling isAutoOnEnabled", e)
                false
            } catch (e: NoSuchMethodError) {
                // TODO(b/346716614): Remove this when the flag is cleaned up.
                Log.e(TAG, "Non-existed api isAutoOnEnabled", e)
                false
            }
        }