Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce Error Prone #31

Merged
merged 3 commits into from
Aug 21, 2024
Merged

Introduce Error Prone #31

merged 3 commits into from
Aug 21, 2024

Conversation

iusmac
Copy link
Owner

@iusmac iusmac commented Aug 21, 2024

No description provided.

iusmac added 3 commits August 19, 2024 17:01
> Task :compileDebugJavaWithJavac
• 1 src/com/github/iusmac/sevensim/scheduler/DaysOfWeek.java:116: warning: [MissingSummary] A summary fragment is required; consider using the value of the @return block as a summary fragment instead.
     * @param dayOfWeek Any of {@link DayOfWeek} values.
       ^
    (see https://google.github.io/styleguide/javaguide.html#s7.2-summary-fragment)
  Did you mean '*Returns {@code true} if the given day of the week is on, {@code false} otherwise.'?

• 2 src/com/github/iusmac/sevensim/scheduler/DaysOfWeek.java:125: warning: [MissingSummary] A summary fragment is required; consider using the value of the @return block as a summary fragment instead.
     * @return The weekly repeat schedule encoded as an integer.
       ^
    (see https://google.github.io/styleguide/javaguide.html#s7.2-summary-fragment)
  Did you mean '*Returns the weekly repeat schedule encoded as an integer.'?

• 3 src/com/github/iusmac/sevensim/scheduler/DaysOfWeek.java:130: warning: [MissingSummary] A summary fragment is required; consider using the value of the @return block as a summary fragment instead.
     * @return {@code true} if at least one day of the week is enabled in the weekly repeat
       ^
    (see https://google.github.io/styleguide/javaguide.html#s7.2-summary-fragment)
  Did you mean '*Returns {@code true} if at least one day of the week is enabled in the weekly repeat'?

• 4 src/com/github/iusmac/sevensim/scheduler/DaysOfWeek.java:136: warning: [MissingSummary] A summary fragment is required; consider using the value of the @return block as a summary fragment instead.
     * @return {@code true} if all days of the week are enabled in this weekly repeat schedule,
       ^
    (see https://google.github.io/styleguide/javaguide.html#s7.2-summary-fragment)
  Did you mean '*Returns {@code true} if all days of the week are enabled in this weekly repeat schedule,'?

• 5 src/com/github/iusmac/sevensim/scheduler/DaysOfWeek.java:142: warning: [MissingSummary] A summary fragment is required; consider using the value of the @return block as a summary fragment instead.
     * @return The total number of days of the week enabled in this weekly repeat schedule.
       ^
    (see https://google.github.io/styleguide/javaguide.html#s7.2-summary-fragment)
  Did you mean '*Returns the total number of days of the week enabled in this weekly repeat schedule.'?

• 6 src/com/github/iusmac/sevensim/scheduler/DaysOfWeek.java:239: warning: [InvalidParam] Parameter name `useLongNames` is unknown. Did you mean useLongName?
     * @param useLongNames If {@code true}, the un-abbreviated day of the week names are used, e.g.
       ^
    (see https://errorprone.info/bugpattern/InvalidParam)
  Did you mean '* @param useLongName If {@code true}, the un-abbreviated day of the week names are used, e.g.'?

• 7 src/com/github/iusmac/sevensim/scheduler/DaysOfWeek.java:322: warning: [MissingSummary] A summary fragment is required; consider using the value of the @return block as a summary fragment instead.
     * @param ldt The date-time to get the corresponding {@link DayOfWeek} value from.
       ^
    (see https://google.github.io/styleguide/javaguide.html#s7.2-summary-fragment)
  Did you mean '*Returns a {@link DayOfWeek} value.'?

• 8 src/com/github/iusmac/sevensim/telephony/Subscription.java:143: warning: [ReferenceEquality] Comparison using reference equality instead of value equality
            && mKeepDisabledAcrossBoots == subToCompare.mKeepDisabledAcrossBoots;
                                        ^
    (see https://errorprone.info/bugpattern/ReferenceEquality)
  Did you mean '&& Objects.equals(mKeepDisabledAcrossBoots, subToCompare.mKeepDisabledAcrossBoots);' or '&& mKeepDisabledAcrossBoots.equals(subToCompare.mKeepDisabledAcrossBoots);'?

• 9 src/com/github/iusmac/sevensim/telephony/Subscription.java:198: warning: [EmptyCatch] Caught exceptions should not be ignored
            } catch (DateTimeParseException ignored) {}
              ^
    (see https://google.github.io/styleguide/javaguide.html#s6.2-caught-exceptions)

• 10 src/com/github/iusmac/sevensim/telephony/Subscription.java:205: warning: [EmptyCatch] Caught exceptions should not be ignored
            } catch (DateTimeParseException ignored) {}
              ^
    (see https://google.github.io/styleguide/javaguide.html#s6.2-caught-exceptions)

• 11 src/com/github/iusmac/sevensim/launcher/QsAppLauncherTileService.java:35: warning: [ParameterName] `/*bundle=*/` does not match formal parameter name `options`; either fix the name or use a regular comment
                        aIntent, PendingIntent.FLAG_IMMUTABLE, /*bundle=*/ null,
                                                                           ^
    (see https://errorprone.info/bugpattern/ParameterName)
  Did you mean 'aIntent, PendingIntent.FLAG_IMMUTABLE, /* options= */ null,' or 'aIntent, PendingIntent.FLAG_IMMUTABLE, /* bundle */ null,'?

• 12 src/com/github/iusmac/sevensim/SevenSimApplication.java:48: warning: [MissingSummary] A summary fragment is required; consider using the value of the @return block as a summary fragment instead.
     * @return {@code true} if the application has been signed with the AOSP platform signature,
       ^
    (see https://google.github.io/styleguide/javaguide.html#s7.2-summary-fragment)
  Did you mean '*Returns {@code true} if the application has been signed with the AOSP platform signature,'?

• 13 src/com/github/iusmac/sevensim/SevenSimApplication.java:56: warning: [MissingSummary] A summary fragment is required; consider using the value of the @return block as a summary fragment instead.
     * @return The string containing the package version.
       ^
    (see https://google.github.io/styleguide/javaguide.html#s7.2-summary-fragment)
  Did you mean '*Returns the string containing the package version.'?

• 14 src/com/github/iusmac/sevensim/SevenSimApplication.java:63: warning: [MissingSummary] A summary fragment is required; consider using the value of the @return block as a summary fragment instead.
     * @return {@code true} if the application is classified by the OS as a "built-in system"
       ^
    (see https://google.github.io/styleguide/javaguide.html#s7.2-summary-fragment)
  Did you mean '*Returns {@code true} if the application is classified by the OS as a "built-in system"'?

• 15 src/com/github/iusmac/sevensim/ApplicationInfo.java:54: warning: [MissingSummary] A summary fragment is required; consider using the value of the @return block as a summary fragment instead.
     * @return The string containing the package version.
       ^
    (see https://google.github.io/styleguide/javaguide.html#s7.2-summary-fragment)
  Did you mean '*Returns the string containing the package version.'?

• 16 src/com/github/iusmac/sevensim/ApplicationInfo.java:66: warning: [MissingSummary] A summary fragment is required; consider using the value of the @return block as a summary fragment instead.
     * @return {@code true} if the application is classified by the OS as a "built-in system"
       ^
    (see https://google.github.io/styleguide/javaguide.html#s7.2-summary-fragment)
  Did you mean '*Returns {@code true} if the application is classified by the OS as a "built-in system"'?

• 17 src/com/github/iusmac/sevensim/ApplicationInfo.java:100: warning: [InvalidParam] Parameter name `context` is unknown.
     * @param context The application context for accessing {@link PackageManager}.
       ^
    (see https://errorprone.info/bugpattern/InvalidParam)
  Did you mean '*'?

• 18 src/com/github/iusmac/sevensim/ApplicationInfo.java:101: warning: [InvalidParam] Parameter name `packageName` is unknown.
     * @param packageName The name of the package to retrieve overall information of.
       ^
    (see https://errorprone.info/bugpattern/InvalidParam)
  Did you mean '*'?

• 19 src/com/github/iusmac/sevensim/NotificationManager.java:96: warning: [EmptyCatch] Caught exceptions should not be ignored
        } catch (SecurityException ignored) {}
          ^
    (see https://google.github.io/styleguide/javaguide.html#s6.2-caught-exceptions)

• 20 src/com/github/iusmac/sevensim/NotificationManager.java:193: warning: [EmptyCatch] Caught exceptions should not be ignored
        } catch (SecurityException ignored) {}
          ^
    (see https://google.github.io/styleguide/javaguide.html#s6.2-caught-exceptions)

• 21 src/com/github/iusmac/sevensim/SystemBroadcastReceiver.java:49: warning: [JavaTimeDefaultTimeZone] LocalDateTime.now() is not allowed because it silently uses the system default time-zone. You must pass an explicit time-zone (e.g., ZoneId.of("America/Los_Angeles")) to this method.
        final LocalDateTime now = LocalDateTime.now();
                                                   ^
    (see https://errorprone.info/bugpattern/JavaTimeDefaultTimeZone)
  Did you mean 'final LocalDateTime now = LocalDateTime.now(ZoneId.systemDefault());'?

• 22 src/com/github/iusmac/sevensim/SystemBroadcastReceiver.java:80: warning: [FallThrough] Execution may fall through from the previous case; add a `// fall through` comment before this line if it was deliberate
                    default:
                    ^
    (see https://errorprone.info/bugpattern/FallThrough)

• 23 src/com/github/iusmac/sevensim/DirectBootAwareBroadcastReceiver.java:44: warning: [JavaTimeDefaultTimeZone] LocalDateTime.now() is not allowed because it silently uses the system default time-zone. You must pass an explicit time-zone (e.g., ZoneId.of("America/Los_Angeles")) to this method.
        final LocalDateTime now = LocalDateTime.now();
                                                   ^
    (see https://errorprone.info/bugpattern/JavaTimeDefaultTimeZone)
  Did you mean 'final LocalDateTime now = LocalDateTime.now(ZoneId.systemDefault());'?

• 24 src/com/github/iusmac/sevensim/SysProp.java:34: warning: [InvalidLink] {@link} cannot be used for HTTP links. Use an <a> tag instead.
     * [3] {@link https://android.googlesource.com/platform/system/sepolicy/+/refs/heads/android-s-beta-4/private/property_contexts#29}
           ^
    (see https://errorprone.info/bugpattern/InvalidLink)
  Did you mean '* [3] <a href="https:'?

• 25 src/com/github/iusmac/sevensim/SysProp.java:32: warning: [UnrecognisedJavadocTag] This Javadoc tag wasn't recognised by the parser. Is it malformed somehow, perhaps with mismatched braces?
     * [1] {@link https://android.googlesource.com/platform/system/sepolicy/+/refs/heads/android-s-beta-4/private/seapp_contexts#140}
           ^
    (see https://errorprone.info/bugpattern/UnrecognisedJavadocTag)

• 26 src/com/github/iusmac/sevensim/SysProp.java:33: warning: [UnrecognisedJavadocTag] This Javadoc tag wasn't recognised by the parser. Is it malformed somehow, perhaps with mismatched braces?
     * [2] {@link https://android.googlesource.com/platform/system/sepolicy/+/refs/heads/android-s-beta-4/private/system_app.te#41}
           ^
    (see https://errorprone.info/bugpattern/UnrecognisedJavadocTag)

• 27 src/com/github/iusmac/sevensim/SysProp.java:34: warning: [UnrecognisedJavadocTag] This Javadoc tag wasn't recognised by the parser. Is it malformed somehow, perhaps with mismatched braces?
     * [3] {@link https://android.googlesource.com/platform/system/sepolicy/+/refs/heads/android-s-beta-4/private/property_contexts#29}
           ^
    (see https://errorprone.info/bugpattern/UnrecognisedJavadocTag)

• 28 src/com/github/iusmac/sevensim/SysProp.java:90: warning: [InvalidParam] Parameter name `val` is unknown. Did you mean value?
     * @param val The value to store in the system property.
       ^
    (see https://errorprone.info/bugpattern/InvalidParam)
  Did you mean '* @param value The value to store in the system property.'?

• 29 src/com/github/iusmac/sevensim/SysProp.java:89: warning: [MissingSummary] A summary line is required on public/protected Javadocs.
     * @see SystemProperties#set(String,String)
       ^
    (see https://google.github.io/styleguide/javaguide.html#s7.2-summary-fragment)

• 30 src/com/github/iusmac/sevensim/SysProp.java:98: warning: [MissingSummary] A summary fragment is required; consider using the value of the @return block as a summary fragment instead.
     * @see SystemProperties#get(String,String)
       ^
    (see https://google.github.io/styleguide/javaguide.html#s7.2-summary-fragment)
  Did you mean '*Returns the value stored in the system property.'?

• 31 src/com/github/iusmac/sevensim/scheduler/SubscriptionSchedulerSummaryBuilder.java:158: warning: [ParameterName] `/*NumberFormat=*/` does not match formal parameter name `nf`; either fix the name or use a regular comment
                    /*NumberFormat=*/ null, style, displayContext);
                                      ^
    (see https://errorprone.info/bugpattern/ParameterName)
  Did you mean '/* nf= */ null, style, displayContext);' or '/* NumberFormat */ null, style, displayContext);'?

• 32 src/com/github/iusmac/sevensim/scheduler/SubscriptionScheduler.java:181: warning: [EmptyCatch] Caught exceptions should not be ignored
                    } catch (InterruptedException ignored) { }
                      ^
    (see https://google.github.io/styleguide/javaguide.html#s6.2-caught-exceptions)

• 33 src/com/github/iusmac/sevensim/scheduler/SubscriptionScheduler.java:408: warning: [JavaTimeDefaultTimeZone] LocalDateTime.now() is not allowed because it silently uses the system default time-zone. You must pass an explicit time-zone (e.g., ZoneId.of("America/Los_Angeles")) to this method.
        final LocalDateTime now = LocalDateTime.now();
                                                   ^
    (see https://errorprone.info/bugpattern/JavaTimeDefaultTimeZone)
  Did you mean 'final LocalDateTime now = LocalDateTime.now(ZoneId.systemDefault());'?

• 34 src/com/github/iusmac/sevensim/telephony/Subscriptions.java:536: warning: [EmptyCatch] Caught exceptions should not be ignored
            } catch (NumberFormatException e) {}
              ^
    (see https://google.github.io/styleguide/javaguide.html#s6.2-caught-exceptions)

• 35 src/com/github/iusmac/sevensim/telephony/SubscriptionController.java:74: warning: [JavaTimeDefaultTimeZone] LocalDateTime.now() is not allowed because it silently uses the system default time-zone. You must pass an explicit time-zone (e.g., ZoneId.of("America/Los_Angeles")) to this method.
        sub.setLastActivatedTime(enabled ? LocalDateTime.now() : LocalDateTime.MIN);
                                                            ^
    (see https://errorprone.info/bugpattern/JavaTimeDefaultTimeZone)
  Did you mean 'sub.setLastActivatedTime(enabled ? LocalDateTime.now(ZoneId.systemDefault()) : LocalDateTime.MIN);'?

• 36 src/com/github/iusmac/sevensim/telephony/SubscriptionController.java:75: warning: [JavaTimeDefaultTimeZone] LocalDateTime.now() is not allowed because it silently uses the system default time-zone. You must pass an explicit time-zone (e.g., ZoneId.of("America/Los_Angeles")) to this method.
        sub.setLastDeactivatedTime(!enabled ? LocalDateTime.now() : LocalDateTime.MIN);
                                                               ^
    (see https://errorprone.info/bugpattern/JavaTimeDefaultTimeZone)
  Did you mean 'sub.setLastDeactivatedTime(!enabled ? LocalDateTime.now(ZoneId.systemDefault()) : LocalDateTime.MIN);'?

• 37 src/com/github/iusmac/sevensim/telephony/TelephonyController.java:149: warning: [JavaTimeDefaultTimeZone] LocalDateTime.now() is not allowed because it silently uses the system default time-zone. You must pass an explicit time-zone (e.g., ZoneId.of("America/Los_Angeles")) to this method.
            sub.setLastActivatedTime(enabled ? LocalDateTime.now() : LocalDateTime.MIN);
                                                                ^
    (see https://errorprone.info/bugpattern/JavaTimeDefaultTimeZone)
  Did you mean 'sub.setLastActivatedTime(enabled ? LocalDateTime.now(ZoneId.systemDefault()) : LocalDateTime.MIN);'?

• 38 src/com/github/iusmac/sevensim/telephony/TelephonyController.java:150: warning: [JavaTimeDefaultTimeZone] LocalDateTime.now() is not allowed because it silently uses the system default time-zone. You must pass an explicit time-zone (e.g., ZoneId.of("America/Los_Angeles")) to this method.
            sub.setLastDeactivatedTime(!enabled ? LocalDateTime.now() : LocalDateTime.MIN);
                                                                   ^
    (see https://errorprone.info/bugpattern/JavaTimeDefaultTimeZone)
  Did you mean 'sub.setLastDeactivatedTime(!enabled ? LocalDateTime.now(ZoneId.systemDefault()) : LocalDateTime.MIN);'?

• 39 src/com/github/iusmac/sevensim/telephony/TelephonyController.java:172: warning: [WaitNotInLoop] Because of spurious wakeups, wait(long) must always be called in a loop
                wait(SET_SIM_POWER_STATE_REQUEST_TIMEOUT_MILLIS);
                    ^
    (see https://errorprone.info/bugpattern/WaitNotInLoop)

• 40 src/com/github/iusmac/sevensim/telephony/TelephonyUtils.java:153: warning: [MissingSummary] A summary fragment is required; consider using the value of the @return block as a summary fragment instead.
     * @param context The context to access content resolver.
       ^
    (see https://google.github.io/styleguide/javaguide.html#s7.2-summary-fragment)
  Did you mean '*Returns {@code true} if the "Airplane mode" is enabled, otherwise {@code false}.'?

• 41 src/com/github/iusmac/sevensim/telephony/TelephonyUtils.java:162: warning: [MissingSummary] A summary fragment is required; consider using the value of the @return block as a summary fragment instead.
     * @return {@code true} if PIN string meets the UICC specs, otherwise {@code false}.
       ^
    (see https://google.github.io/styleguide/javaguide.html#s7.2-summary-fragment)
  Did you mean '*Returns {@code true} if PIN string meets the UICC specs, otherwise {@code false}.'?

• 42 src/com/github/iusmac/sevensim/telephony/PinStorage.java:187: warning: [DefaultCharset] Implicit use of the platform default charset, which can result in differing behaviour between JVM executions or incorrect behavior if the encoding of the data source doesn't match expectations.
            pinEntity.setData(cipher.doFinal(clearPin.getBytes()));
                                                              ^
    (see https://errorprone.info/bugpattern/DefaultCharset)
  Did you mean 'pinEntity.setData(cipher.doFinal(clearPin.getBytes(UTF_8)));' or 'pinEntity.setData(cipher.doFinal(clearPin.getBytes(Charset.defaultCharset())));'?

• 43 src/com/github/iusmac/sevensim/telephony/PinStorage.java:231: warning: [DefaultCharset] Implicit use of the platform default charset, which can result in differing behaviour between JVM executions or incorrect behavior if the encoding of the data source doesn't match expectations.
            pinEntity.setClearPin(new String(cipher.doFinal(pinEntity.getData())));
                                  ^
    (see https://errorprone.info/bugpattern/DefaultCharset)
  Did you mean 'pinEntity.setClearPin(new String(cipher.doFinal(pinEntity.getData()), UTF_8));' or 'pinEntity.setClearPin(new String(cipher.doFinal(pinEntity.getData()), Charset.defaultCharset()));'?

• 44 src/com/github/iusmac/sevensim/telephony/SubscriptionsImplLegacy.java:282: warning: [ProtectedMembersInFinalClass] Make members of final classes package-private: persistSimSubId, persistSimState, persistSimTintColor, persistSimName
    protected void persistSimSubId(final int slotIndex, final int subId) {
                   ^
    (see https://errorprone.info/bugpattern/ProtectedMembersInFinalClass)
  Did you mean 'void persistSimSubId(final int slotIndex, final int subId) {'?

• 45 src/com/github/iusmac/sevensim/telephony/SubscriptionsImplLegacy.java:213: warning: [EmptyCatch] Caught exceptions should not be ignored
            } catch (NumberFormatException e) {}
              ^
    (see https://google.github.io/styleguide/javaguide.html#s6.2-caught-exceptions)

• 46 src/com/github/iusmac/sevensim/telephony/SubscriptionsImplLegacy.java:238: warning: [EmptyCatch] Caught exceptions should not be ignored
            } catch (NumberFormatException e) {}
              ^
    (see https://google.github.io/styleguide/javaguide.html#s6.2-caught-exceptions)

• 47 src/com/github/iusmac/sevensim/telephony/SubscriptionsImplLegacy.java:257: warning: [EmptyCatch] Caught exceptions should not be ignored
            } catch (NumberFormatException e) {}
              ^
    (see https://google.github.io/styleguide/javaguide.html#s6.2-caught-exceptions)

• 48 src/com/github/iusmac/sevensim/scheduler/AlarmReceiver.java:56: warning: [JavaTimeDefaultTimeZone] LocalDateTime.now() is not allowed because it silently uses the system default time-zone. You must pass an explicit time-zone (e.g., ZoneId.of("America/Los_Angeles")) to this method.
        final LocalDateTime now = LocalDateTime.now();
                                                   ^
    (see https://errorprone.info/bugpattern/JavaTimeDefaultTimeZone)
  Did you mean 'final LocalDateTime now = LocalDateTime.now(ZoneId.systemDefault());'?

• 49 src/com/github/iusmac/sevensim/ForegroundService.java:226: warning: [MissingSummary] A summary fragment is required; consider using the value of the @see block as a summary fragment instead.
    /** @see SimPinFeeder */
        ^
    (see https://google.github.io/styleguide/javaguide.html#s7.2-summary-fragment)
  Did you mean '/** See {@link SimPinFeeder}.'?

• 50 src/com/github/iusmac/sevensim/Utils.java:21: warning: [MissingSummary] A summary line is required on public/protected Javadocs.
     * @param context The application context.
       ^
    (see https://google.github.io/styleguide/javaguide.html#s7.2-summary-fragment)

• 51 src/com/github/iusmac/sevensim/UserAuthenticationObserverService.java:260: warning: [ClassCanBeStatic] Inner class is non-static but does not reference enclosing class
    private final class PendingTask {
                  ^
    (see https://errorprone.info/bugpattern/ClassCanBeStatic)
  Did you mean 'private static final class PendingTask {'?

• 52 src/com/github/iusmac/sevensim/RoomTypeConverters.java:31: warning: [EmptyCatch] Caught exceptions should not be ignored
        } catch (DateTimeParseException ignored) {}
          ^
    (see https://google.github.io/styleguide/javaguide.html#s6.2-caught-exceptions)

• 53 src/com/github/iusmac/sevensim/DateTimeUtils.java:40: warning: [EmptyCatch] Caught exceptions should not be ignored
        } catch (DateTimeParseException ignored) { }
          ^
    (see https://google.github.io/styleguide/javaguide.html#s6.2-caught-exceptions)

• 54 src/com/github/iusmac/sevensim/DateTimeUtils.java:45: warning: [MissingSummary] A summary fragment is required; consider using the value of the @return block as a summary fragment instead.
     * @param context The context for detecting the 12-/24-hour format.
       ^
    (see https://google.github.io/styleguide/javaguide.html#s7.2-summary-fragment)
  Did you mean '*Returns the time in pretty format, such as 10:00 AM.'?

• 55 src/com/github/iusmac/sevensim/ui/components/ItemAdapter.java:153: warning: [ReferenceEquality] Comparison using reference equality instead of value equality
                if (t0.itemId == t1.itemId && t0 != t1) {
                                                 ^
    (see https://errorprone.info/bugpattern/ReferenceEquality)
  Did you mean 'if (t0.itemId == t1.itemId && !t0.equals(t1)) {'?

• 56 src/com/github/iusmac/sevensim/ui/components/ItemAdapter.java:209: warning: [InvalidParam] Parameter name `itemHolder` is unknown. Did you mean itemHolders?
     * @param itemHolder the item holder to add or update
       ^
    (see https://errorprone.info/bugpattern/InvalidParam)
  Did you mean '* @param itemHolders the item holder to add or update'?

• 57 src/com/github/iusmac/sevensim/ui/components/ItemAdapter.java:249: warning: [InvalidParam] Parameter name `index` is unknown.
     * @param index The index of the item to be removed.
       ^
    (see https://errorprone.info/bugpattern/InvalidParam)
  Did you mean '*'?

• 58 src/com/github/iusmac/sevensim/ui/components/ItemAdapter.java:302: warning: [MissingSummary] A summary line is required on public/protected Javadocs.
     * @param position The current item position whose position should be re-calculated according to
       ^
    (see https://google.github.io/styleguide/javaguide.html#s7.2-summary-fragment)

• 59 src/com/github/iusmac/sevensim/ui/components/ItemAdapter.java:383: warning: [MissingSummary] A summary fragment is required; consider using the value of the @return block as a summary fragment instead.
         * @return the unique identifier for the view that should be used to represent the item,
           ^
    (see https://google.github.io/styleguide/javaguide.html#s7.2-summary-fragment)
  Did you mean '*Returns the unique identifier for the view that should be used to represent the item,'?

• 60 src/com/github/iusmac/sevensim/ui/components/ItemAdapter.java:456: warning: [EqualsGetClass] Prefer instanceof to getClass when implementing Object#equals.
        public boolean equals(final Object o) {
                       ^
    (see https://errorprone.info/bugpattern/EqualsGetClass)
  Did you mean 'if (!(o instanceof ItemHolder)) return false;'?

• 61 src/com/github/iusmac/sevensim/ui/components/ItemAdapter.java:492: warning: [MissingSummary] A summary fragment is required; consider using the value of the @return block as a summary fragment instead.
         * @return the current {@link ItemHolder} bound to this holder, or {@code null} if unbound
           ^
    (see https://google.github.io/styleguide/javaguide.html#s7.2-summary-fragment)
  Did you mean '*Returns the current {@link ItemHolder} bound to this holder, or {@code null} if unbound.'?

• 62 src/com/github/iusmac/sevensim/ui/components/CollapsingToolbarBaseActivity.java:79: warning: [MissingSummary] A summary fragment is required; consider using the value of the @return block as a summary fragment instead.
     * @return The {@link ViewModel} instance created via {@link #onCreateViewModel()}.
       ^
    (see https://google.github.io/styleguide/javaguide.html#s7.2-summary-fragment)
  Did you mean '*Returns the {@link ViewModel} instance created via {@link #onCreateViewModel()}.'?

• 63 src/com/github/iusmac/sevensim/ui/scheduler/SchedulerViewModel.java:115: warning: [MissingSummary] A summary fragment is required; consider using the value of the @return block as a summary fragment instead.
     * @return An observable human-readable string summarizing the next upcoming schedule for this
       ^
    (see https://google.github.io/styleguide/javaguide.html#s7.2-summary-fragment)
  Did you mean '*Returns an observable human-readable string summarizing the next upcoming schedule for this'?

• 64 src/com/github/iusmac/sevensim/ui/scheduler/SchedulerViewModel.java:123: warning: [MissingSummary] A summary fragment is required; consider using the value of the @return block as a summary fragment instead.
     * @return An observable containing the list of schedules, if any.
       ^
    (see https://google.github.io/styleguide/javaguide.html#s7.2-summary-fragment)
  Did you mean '*Returns an observable containing the list of schedules, if any.'?

• 65 src/com/github/iusmac/sevensim/ui/scheduler/SchedulerViewModel.java:130: warning: [MissingSummary] A summary fragment is required; consider using the value of the @return block as a summary fragment instead.
     * @return An observable containing the most recently added schedule, if any.
       ^
    (see https://google.github.io/styleguide/javaguide.html#s7.2-summary-fragment)
  Did you mean '*Returns an observable containing the most recently added schedule, if any.'?

• 66 src/com/github/iusmac/sevensim/ui/scheduler/SchedulerViewModel.java:137: warning: [MissingSummary] A summary fragment is required; consider using the value of the @return block as a summary fragment instead.
     * @return An observable containing the PIN presence status.
       ^
    (see https://google.github.io/styleguide/javaguide.html#s7.2-summary-fragment)
  Did you mean '*Returns an observable containing the PIN presence status.'?

• 67 src/com/github/iusmac/sevensim/ui/scheduler/SchedulerViewModel.java:148: warning: [MissingSummary] A summary fragment is required; consider using the value of the @return block as a summary fragment instead.
     * @return An observable lock state of the SIM PIN task.
       ^
    (see https://google.github.io/styleguide/javaguide.html#s7.2-summary-fragment)
  Did you mean '*Returns an observable lock state of the SIM PIN task.'?

• 68 src/com/github/iusmac/sevensim/ui/scheduler/SchedulerViewModel.java:155: warning: [MissingSummary] A summary fragment is required; consider using the value of the @return block as a summary fragment instead.
     * @return An observable containing a human-readable PIN error message, if any.
       ^
    (see https://google.github.io/styleguide/javaguide.html#s7.2-summary-fragment)
  Did you mean '*Returns an observable containing a human-readable PIN error message, if any.'?

• 69 src/com/github/iusmac/sevensim/ui/scheduler/SchedulerViewModel.java:323: warning: [JavaTimeDefaultTimeZone] LocalDateTime.now() is not allowed because it silently uses the system default time-zone. You must pass an explicit time-zone (e.g., ZoneId.of("America/Los_Angeles")) to this method.
                    LocalDateTime.now().plusMinutes(1), pinEntities);
                                     ^
    (see https://errorprone.info/bugpattern/JavaTimeDefaultTimeZone)
  Did you mean 'LocalDateTime.now(ZoneId.systemDefault()).plusMinutes(1), pinEntities);'?

• 70 src/com/github/iusmac/sevensim/ui/scheduler/SchedulerViewModel.java:340: warning: [JavaTimeDefaultTimeZone] LocalDateTime.now() is not allowed because it silently uses the system default time-zone. You must pass an explicit time-zone (e.g., ZoneId.of("America/Los_Angeles")) to this method.
                    .buildNextUpcomingSubscriptionScheduleSummary(sub, LocalDateTime.now()))
                                                                                        ^
    (see https://errorprone.info/bugpattern/JavaTimeDefaultTimeZone)
  Did you mean '.buildNextUpcomingSubscriptionScheduleSummary(sub, LocalDateTime.now(ZoneId.systemDefault())))'?

• 71 src/com/github/iusmac/sevensim/ui/scheduler/SchedulerViewModel.java:357: warning: [MissingSummary] A summary fragment is required; consider using the value of the @return block as a summary fragment instead.
     * @return {@code true} if the SIM PIN code has been set, otherwise {@code false}.
       ^
    (see https://google.github.io/styleguide/javaguide.html#s7.2-summary-fragment)
  Did you mean '*Returns {@code true} if the SIM PIN code has been set, otherwise {@code false}.'?

• 72 src/com/github/iusmac/sevensim/ui/scheduler/SchedulerViewModel.java:364: warning: [MissingSummary] A summary fragment is required; consider using the value of the @return block as a summary fragment instead.
     * @return {@code true} if we need to authenticate the user with their credentials for further
       ^
    (see https://google.github.io/styleguide/javaguide.html#s7.2-summary-fragment)
  Did you mean '*Returns {@code true} if we need to authenticate the user with their credentials for further'?

• 73 src/com/github/iusmac/sevensim/ui/scheduler/SchedulerViewModel.java:412: warning: [ClassCanBeStatic] Inner class is non-static but does not reference enclosing class
    final class PinErrorMessage {
          ^
    (see https://errorprone.info/bugpattern/ClassCanBeStatic)
  Did you mean 'static final class PinErrorMessage {'?

• 74 src/com/github/iusmac/sevensim/ui/scheduler/SchedulerViewModel.java:452: warning: [MissingSummary] A summary fragment is required; consider using the value of the @return block as a summary fragment instead.
     * @param assistedFactory An {@link AssistedFactory} to create the {@link SchedulerViewModel}
       ^
    (see https://google.github.io/styleguide/javaguide.html#s7.2-summary-fragment)
  Did you mean '*Returns an instance of the {@link ViewModelProvider}.'?

• 75 src/com/github/iusmac/sevensim/ui/components/toolbar/ToolbarDecorator.java:65: warning: [MissingSummary] A summary fragment is required; consider using the value of the @return block as a summary fragment instead.
     * @return Whether the framework's {@link Toolbar} widget is wrapped by a
       ^
    (see https://google.github.io/styleguide/javaguide.html#s7.2-summary-fragment)
  Did you mean '*Returns whether the framework's {@link Toolbar} widget is wrapped by a'?

• 76 src/com/github/iusmac/sevensim/ui/components/toolbar/ToolbarDecorator.java:127: warning: [MissingSummary] A summary fragment is required; consider using the value of the @return block as a summary fragment instead.
     * @return An Optional containing the title marquee repeat limit, if any.
       ^
    (see https://google.github.io/styleguide/javaguide.html#s7.2-summary-fragment)
  Did you mean '*Returns an Optional containing the title marquee repeat limit, if any.'?

• 77 src/com/github/iusmac/sevensim/ui/components/toolbar/ToolbarDecorator.java:148: warning: [MissingSummary] A summary fragment is required; consider using the value of the @return block as a summary fragment instead.
     * @return An Optional containing the subtitle marquee repeat limit, if any.
       ^
    (see https://google.github.io/styleguide/javaguide.html#s7.2-summary-fragment)
  Did you mean '*Returns an Optional containing the subtitle marquee repeat limit, if any.'?

• 78 src/com/github/iusmac/sevensim/ui/components/toolbar/ToolbarDecorator.java:173: warning: [MissingSummary] A summary line is required on public/protected Javadocs.
     * @param mode The mode for {@link View#setImportantForAccessibility(int)}.
       ^
    (see https://google.github.io/styleguide/javaguide.html#s7.2-summary-fragment)

• 79 src/com/github/iusmac/sevensim/ui/components/toolbar/ToolbarDecorator.java:305: warning: [ParameterName] `/*startValue=*/` does not match formal parameter name `outputMin`; either fix the name or use a regular comment
                    /*startValue=*/ 0,
                                    ^
    (see https://errorprone.info/bugpattern/ParameterName)
  Did you mean '/* outputMin= */ 0,' or '/* startValue */ 0,'?

• 80 src/com/github/iusmac/sevensim/ui/components/toolbar/ToolbarDecorator.java:306: warning: [ParameterName] `/*endValue=*/` does not match formal parameter name `outputMax`; either fix the name or use a regular comment
                    /*endValue=*/ 1,
                                  ^
    (see https://errorprone.info/bugpattern/ParameterName)
  Did you mean '/* outputMax= */ 1,' or '/* endValue */ 1,'?

• 81 src/com/github/iusmac/sevensim/ui/components/toolbar/ToolbarDecorator.java:307: warning: [ParameterName] `/*startFraction=*/` does not match formal parameter name `inputMin`; either fix the name or use a regular comment
                    /*startFraction=*/ fadeThresholdFraction,
                                       ^
    (see https://errorprone.info/bugpattern/ParameterName)
  Did you mean '/* inputMin= */ fadeThresholdFraction,' or '/* startFraction */ fadeThresholdFraction,'?

• 82 src/com/github/iusmac/sevensim/ui/components/toolbar/ToolbarDecorator.java:308: warning: [ParameterName] `/*endFraction=*/` does not match formal parameter name `inputMax`; either fix the name or use a regular comment
                    /*endFraction=*/ 1,
                                     ^
    (see https://errorprone.info/bugpattern/ParameterName)
  Did you mean '/* inputMax= */ 1,' or '/* endFraction */ 1,'?

• 83 src/com/github/iusmac/sevensim/ui/components/toolbar/ToolbarDecorator.java:324: warning: [ParameterName] `/*startValue=*/` does not match formal parameter name `outputMin`; either fix the name or use a regular comment
                    /*startValue=*/ 1,
                                    ^
    (see https://errorprone.info/bugpattern/ParameterName)
  Did you mean '/* outputMin= */ 1,' or '/* startValue */ 1,'?

• 84 src/com/github/iusmac/sevensim/ui/components/toolbar/ToolbarDecorator.java:325: warning: [ParameterName] `/*endValue=*/` does not match formal parameter name `outputMax`; either fix the name or use a regular comment
                    /*endValue=*/ 0,
                                  ^
    (see https://errorprone.info/bugpattern/ParameterName)
  Did you mean '/* outputMax= */ 0,' or '/* endValue */ 0,'?

• 85 src/com/github/iusmac/sevensim/ui/components/toolbar/ToolbarDecorator.java:326: warning: [ParameterName] `/*startFraction=*/` does not match formal parameter name `inputMin`; either fix the name or use a regular comment
                    /*startFraction=*/ fadeStartFraction,
                                       ^
    (see https://errorprone.info/bugpattern/ParameterName)
  Did you mean '/* inputMin= */ fadeStartFraction,' or '/* startFraction */ fadeStartFraction,'?

• 86 src/com/github/iusmac/sevensim/ui/components/toolbar/ToolbarDecorator.java:327: warning: [ParameterName] `/*endFraction=*/` does not match formal parameter name `inputMax; either fix the name or use a regular comment
                    /*endFraction=*/ fadeThresholdFraction,
                                     ^
    (see https://errorprone.info/bugpattern/ParameterName)
  Did you mean '/* inputMax= */ fadeThresholdFraction,' or '/* endFraction */ fadeThresholdFraction,'?

• 87 src/com/github/iusmac/sevensim/ui/scheduler/SchedulerFragment.java:212: warning: [ParameterName] `/*container=*/` does not match formal parameter name `root`; either fix the name or use a regular comment
            inflater.inflate(R.layout.scheduler_fabs, /*container=*/ null, false);
                                                                     ^
    (see https://errorprone.info/bugpattern/ParameterName)
  Did you mean 'inflater.inflate(R.layout.scheduler_fabs, /* root= */ null, false);' or 'inflater.inflate(R.layout.scheduler_fabs, /* container */ null, false);'?

• 88 src/com/github/iusmac/sevensim/ui/scheduler/SchedulerFragment.java:394: warning: [JavaTimeDefaultTimeZone] LocalTime.now() is not allowed because it silently uses the system default time-zone. You must pass an explicit time-zone (e.g., ZoneId.of("America/Los_Angeles")) to this method.
        showTimePicker(LocalTime.now());
                                    ^
    (see https://errorprone.info/bugpattern/JavaTimeDefaultTimeZone)
  Did you mean 'showTimePicker(LocalTime.now(ZoneId.systemDefault()));'?

• 89 src/com/github/iusmac/sevensim/ui/scheduler/SchedulerFragment.java:482: warning: [ParameterName] `/*paylaod=*/` does not match formal parameter name `payload`; either fix the name or use a regular comment
            authenticateAndRunAction(ACTION_AUTH_HANDLE_ON_SCHEDULE_DELETED, /*paylaod=*/ null);
                                                                                          ^
    (see https://errorprone.info/bugpattern/ParameterName)
  Did you mean 'authenticateAndRunAction(ACTION_AUTH_HANDLE_ON_SCHEDULE_DELETED, /* payload= */ null);' or 'authenticateAndRunAction(ACTION_AUTH_HANDLE_ON_SCHEDULE_DELETED, /* paylaod */ null);'?

• 90 src/com/github/iusmac/sevensim/ui/scheduler/SchedulerFragment.java:643: warning: [InvalidParam] Parameter name `extras` is unknown.
     * @param extras The Bundle holding payload data.
       ^
    (see https://errorprone.info/bugpattern/InvalidParam)
  Did you mean '*'?

• 91 src/com/github/iusmac/sevensim/ui/scheduler/SchedulerFragment.java:788: warning: [LogicalAssignment] Assignment where a boolean expression was expected; use == if this assignment wasn't expected or add parentheses for clarity.
            if (mPinPopupMenuVisible = savedInstanceState.getBoolean(SAVED_PIN_POPUP_VISIBLE)) {
                                     ^
    (see https://errorprone.info/bugpattern/LogicalAssignment)
  Did you mean 'if ((mPinPopupMenuVisible = savedInstanceState.getBoolean(SAVED_PIN_POPUP_VISIBLE))) {' or 'if (mPinPopupMenuVisible == savedInstanceState.getBoolean(SAVED_PIN_POPUP_VISIBLE)) {'?

• 92 src/com/github/iusmac/sevensim/ui/UiUtils.java:145: warning: [MissingSummary] A summary fragment is required; consider using the value of the @return block as a summary fragment instead.
     * @param context The {@link Context} to access resources.
       ^
    (see https://google.github.io/styleguide/javaguide.html#s7.2-summary-fragment)
  Did you mean '*Returns a tinted {@link Drawable}, cached instance in most cases.'?

• 93 src/com/github/iusmac/sevensim/ui/UiUtils.java:193: warning: [MissingSummary] A summary fragment is required; consider using the value of the @return block as a summary fragment instead.
     * @param amPmRatio A value between 0 and 1 that is the ratio of the relative size of the am/pm
       ^
    (see https://google.github.io/styleguide/javaguide.html#s7.2-summary-fragment)
  Did you mean '*Returns the format string for 12 hours mode time, not including seconds.'?

• 94 src/com/github/iusmac/sevensim/ui/UiUtils.java:203: warning: [MissingSummary] A summary fragment is required; consider using the value of the @return block as a summary fragment instead.
     * @param amPmRatio A value between 0 and 1 that is the ratio of the relative size of the am/pm
       ^
    (see https://google.github.io/styleguide/javaguide.html#s7.2-summary-fragment)
  Did you mean '*Returns the Format string for 12 hours mode time, not including seconds.'?

• 95 src/com/github/iusmac/sevensim/ui/UiUtils.java:321: warning: [MissingSummary] A summary fragment is required; consider using the value of the @return block as a summary fragment instead.
     * @param context The {@link Context} to access resources.
       ^
    (see https://google.github.io/styleguide/javaguide.html#s7.2-summary-fragment)
  Did you mean '*Returns whether the currently the app is displayed in landscape orientation.'?

• 96 src/com/github/iusmac/sevensim/ui/UiUtils.java:330: warning: [MissingSummary] A summary fragment is required; consider using the value of the @return block as a summary fragment instead.
     * @param context The {@link Context} to access resources.
       ^
    (see https://google.github.io/styleguide/javaguide.html#s7.2-summary-fragment)
  Did you mean '*Returns whether the currently the app is displayed in landscape orientation.'?

• 97 src/com/github/iusmac/sevensim/ui/components/TimePickerDialogFragment.java:89: warning: [JavaTimeDefaultTimeZone] LocalTime.now() is not allowed because it silently uses the system default time-zone. You must pass an explicit time-zone (e.g., ZoneId.of("America/Los_Angeles")) to this method.
            final LocalTime lt = LocalTime.now();
                                              ^
    (see https://errorprone.info/bugpattern/JavaTimeDefaultTimeZone)
  Did you mean 'final LocalTime lt = LocalTime.now(ZoneId.systemDefault());'?

• 98 src/com/github/iusmac/sevensim/ui/sim/SimListViewModel.java:68: warning: [JavaTimeDefaultTimeZone] LocalDateTime.now() is not allowed because it silently uses the system default time-zone. You must pass an explicit time-zone (e.g., ZoneId.of("America/Los_Angeles")) to this method.
        final LocalDateTime now = LocalDateTime.now();
                                                   ^
    (see https://errorprone.info/bugpattern/JavaTimeDefaultTimeZone)
  Did you mean 'final LocalDateTime now = LocalDateTime.now(ZoneId.systemDefault());'?

• 99 src/com/github/iusmac/sevensim/ui/sim/SimListViewModel.java:111: warning: [ClassCanBeStatic] Inner class is non-static but does not reference enclosing class
    final class SimEntry {
          ^
    (see https://errorprone.info/bugpattern/ClassCanBeStatic)
  Did you mean 'static final class SimEntry {'?

• 100 src/com/github/iusmac/sevensim/ui/sim/SimListViewModel.java:137: warning: [MissingSummary] A summary fragment is required; consider using the value of the @return block as a summary fragment instead.
     * @param assistedFactory An {@link AssistedFactory} to create the {@link SimListViewModel}
       ^
    (see https://google.github.io/styleguide/javaguide.html#s7.2-summary-fragment)
  Did you mean '*Returns an instance of the {@link ViewModelProvider}.'?

• 101 src/com/github/iusmac/sevensim/ui/sim/SimListActivity.java:44: warning: [BadImport] Importing nested classes/static methods/static fields with commonly-used names can make code harder to read, because it may not be clear from the context exactly which type is being referred to. Qualifying the name with that of the containing class can make the code clearer. Here we recommend using qualified class: SimListViewModel.
    Factory mSimListViewModelFactory;
    ^
    (see https://errorprone.info/bugpattern/BadImport)
  Did you mean 'SimListViewModel.Factory mSimListViewModelFactory;'?

Signed-off-by: iusmac <[email protected]>
> Task :compileDebugJavaWithJavac
• 1 src/com/github/iusmac/sevensim/scheduler/SubscriptionScheduleEntity.java:104: error: [EqualsHashCode] Classes that override equals should also override hashCode.
    public boolean equals(final Object o) {
                   ^
    (see https://errorprone.info/bugpattern/EqualsHashCode)

• 2 src/com/github/iusmac/sevensim/scheduler/DaysOfWeek.java:71: error: [GuardedBy] Invalid @GuardedBy expression: static member guarded by instance
    private static Locale sDefaultLocaleCache;
                          ^
    (see https://errorprone.info/bugpattern/GuardedBy)

• 3 src/com/github/iusmac/sevensim/scheduler/DaysOfWeek.java:73: error: [GuardedBy] Invalid @GuardedBy expression: static member guarded by instance
    private static String[] sDaysOfWeekNarrowStrings;
                            ^
    (see https://errorprone.info/bugpattern/GuardedBy)

• 4 src/com/github/iusmac/sevensim/scheduler/DaysOfWeek.java:269: error: [GuardedBy] This access should be guarded by 'DaysOfWeek'; instead found: 'this'
        if (sDaysOfWeekNarrowStrings == null || !loc.equals(sDefaultLocaleCache)) {
            ^
    (see https://errorprone.info/bugpattern/GuardedBy)

• 5 src/com/github/iusmac/sevensim/scheduler/DaysOfWeek.java:269: error: [GuardedBy] This access should be guarded by 'DaysOfWeek'; instead found: 'this'
        if (sDaysOfWeekNarrowStrings == null || !loc.equals(sDefaultLocaleCache)) {
                                                            ^
    (see https://errorprone.info/bugpattern/GuardedBy)

• 6 src/com/github/iusmac/sevensim/scheduler/DaysOfWeek.java:270: error: [GuardedBy] This access should be guarded by 'DaysOfWeek'; instead found: 'this'
            sDaysOfWeekNarrowStrings = DateFormatSymbols.getInstance(loc)
            ^
    (see https://errorprone.info/bugpattern/GuardedBy)

• 7 src/com/github/iusmac/sevensim/scheduler/DaysOfWeek.java:272: error: [GuardedBy] This access should be guarded by 'DaysOfWeek'; instead found: 'this'
            sDefaultLocaleCache = loc;
            ^
    (see https://errorprone.info/bugpattern/GuardedBy)

• 8 src/com/github/iusmac/sevensim/scheduler/DaysOfWeek.java:274: error: [GuardedBy] This access should be guarded by 'DaysOfWeek'; instead found: 'this'
        return sDaysOfWeekNarrowStrings[dayOfWeek];
               ^
    (see https://errorprone.info/bugpattern/GuardedBy)

• 9 src/com/github/iusmac/sevensim/telephony/Subscription.java:143: error: [BoxedPrimitiveEquality] Comparison using reference equality instead of value equality. Reference equality of boxed primitive types is usually not useful, as they are value objects, and it is bug-prone, as instances are cached for some values but not others.
            && mKeepDisabledAcrossBoots == subToCompare.mKeepDisabledAcrossBoots;
                                        ^
    (see https://errorprone.info/bugpattern/BoxedPrimitiveEquality)
  Did you mean '&& Objects.equals(mKeepDisabledAcrossBoots, subToCompare.mKeepDisabledAcrossBoots);' or '&& mKeepDisabledAcrossBoots.equals(subToCompare.mKeepDisabledAcrossBoots);'?

• 10 src/com/github/iusmac/sevensim/telephony/TelephonyController.java:369: error: [GuardedBy] This access should be guarded by 'TelephonyController.this', which is not currently held
            final Subscription sub = BundleCompat.getParcelable(mRequestMetadata, KEY_SUBSCRIPTION,
                                                                ^
    (see https://errorprone.info/bugpattern/GuardedBy)

• 11 src/com/github/iusmac/sevensim/telephony/PinStorage.java:55: error: [GuardedBy] Invalid @GuardedBy expression: static member guarded by instance
    private static long sLastKeystoreAuthTimestamp;
                        ^
    (see https://errorprone.info/bugpattern/GuardedBy)

• 12 src/com/github/iusmac/sevensim/telephony/PinStorage.java:381: error: [GuardedBy] This access should be guarded by 'PinStorage'; instead found: 'this'
        final long authTimeout = sLastKeystoreAuthTimestamp == 0 ? 0 : sLastKeystoreAuthTimestamp +
                                 ^
    (see https://errorprone.info/bugpattern/GuardedBy)

• 13 src/com/github/iusmac/sevensim/telephony/PinStorage.java:381: error: [GuardedBy] This access should be guarded by 'PinStorage'; instead found: 'this'
        final long authTimeout = sLastKeystoreAuthTimestamp == 0 ? 0 : sLastKeystoreAuthTimestamp +
                                                                       ^
    (see https://errorprone.info/bugpattern/GuardedBy)

• 14 src/com/github/iusmac/sevensim/telephony/PinStorage.java:394: error: [GuardedBy] This access should be guarded by 'PinStorage'; instead found: 'PinStorage.class'
        sLastKeystoreAuthTimestamp = timestamp;
        ^
    (see https://errorprone.info/bugpattern/GuardedBy)

• 15 src/com/github/iusmac/sevensim/ui/components/ItemAdapter.java:456: error: [EqualsHashCode] Classes that override equals should also override hashCode.
        public boolean equals(final Object o) {
                       ^
    (see https://errorprone.info/bugpattern/EqualsHashCode)

Signed-off-by: iusmac <[email protected]>
@iusmac iusmac merged commit 5ca206f into 14.0-dev Aug 21, 2024
1 check passed
@iusmac iusmac deleted the introduce-errorprone branch August 21, 2024 11:17
iusmac added a commit that referenced this pull request Aug 24, 2024
… request

To reproduce this:
1. Need to unset/disable the PIN code for all SIM cards
2. Assiduously spam the on/off toggle for all SIM cards

The fix consists of two parts:
1. We must separately synchronize the call to setSimState(). The NPE
   happened, because, multiple calls can be performed in parallel (see
   #1 & #30), and since we're only synchronizing the wait()/notifyAll()
   calls, when a requests finishes slightly earlier, it cleans up
   the requests metadata written by the other call.
2. We also want to refrain from handling SIM power state response
   directly inside callback listeners, as it'll likely be executed on
   the main thread, while in some circumstances we can make database
   requests via Room that disallows this and can throw an exception.
   Also, we don't want to do it before the notifyAll() call, since this
   is a potential error-prone issue that can trigger a false-positive
   timeout of the pending request if for some reason it will take too
   long to complete. Instead, we store the request response code in
   globally accessible metadata, then notify the caller and handle the
   response inside the caller's worker thread

#1 D  7SIM.SimListViewModel handleOnSimStateChanged(simEntryId=0,enabled=true).
#2 D  7SIM.TelephonyController setSimState(slotIndex=0,enabled=true,keepDisabledAcrossBoots=false) : In sync block.
#3 V  7SIM.SubscriptionsImplLegacy persistSubscription(sub=Subscription { id=2 slotIndex=0 simState=ENABLED iconTint=-13408298 name=Vodafone (work) lastActivatedTime=2024-08-20T15:38 lastDeactivatedTime=-999999999-01-01T00:00 keepDisabledAcrossBoots=false }).
#4 D  7SIM.SubscriptionsImplLegacy persistSubscriptionState(subId=2,state=ENABLED).
#5 V  7SIM.SubscriptionsImplLegacy addOnSimStatusChangedListener().
#6 V  7SIM.SubscriptionsImplLegacy registerCarrierConfigChangedReceiver().
#7 V  7SIM.SubscriptionsImplLegacy onReceive() : intent=Intent { act=android.telephony.action.SIM_CARD_STATE_CHANGED flg=0x5000010 (has extras) }
#8 V  7SIM.SubscriptionsImplLegacy dispatchOnSimStatusChanged(slotIndex=0,state=11).
#9 V  7SIM.TelephonyController onSimStatusChanged(slotIndex=0,state=11).
#10 D  7SIM.TelephonyController handleOnSetSimPowerStateForSlotFinished(resCode=11) : requestMetadata=Bundle[{last_activated_time=-999999999-01-01T00:00, last_deactivated_time=2024-08-20T15:38, subscription=Subscription { id=2 slotIndex=0 simState=ENABLED iconTint=-13408298 name=Vodafone (work) lastActivatedTime=2024-08-20T15:38 lastDeactivatedTime=-999999999-01-01T00:00 keepDisabledAcrossBoots=false }, keep_disabled_across_boots=true}], requestFailed=false,shouldNotifyAllListeners=true
#11 V  7SIM.SubscriptionsImplLegacy removeOnSimStatusChangedListener().
#12 V  7SIM.SubscriptionsImplLegacy unregisterCarrierConfigChangedReceiver().

#13 D  7SIM.DirectBootAwareBroadcastReceiver onReceive() : intent=Intent { act=android.telephony.action.CARRIER_CONFIG_CHANGED flg=0x15000010 cmp=com.github.iusmac.sevensim/.DirectBootAwareBroadcastReceiver (has extras) }
#14 D  7SIM.ForegroundService onCreate().
#15 D  7SIM.ForegroundService onStartCommand(intent=Intent { act=ACTION_SUBSCRIPTIONS_CHANGED cmp=com.github.iusmac.sevensim/.ForegroundService (has extras) },flags=0,startId=1).
#16 D  7SIM.ForegroundService Worker.execute(taskId=1) Add : mQueueSize=0.
#17 D  7SIM.ForegroundService onStartCommand(intent=Intent { act=ACTION_SYNC_SUBSCRIPTION_ENABLED_STATE cmp=com.github.iusmac.sevensim/.ForegroundService (has extras) },flags=0,startId=2).
#18 D  7SIM.ForegroundService Worker.execute(taskId=1) Start : mQueueSize=1.
#19 D  7SIM.ForegroundService Worker.execute(taskId=2) Add : mQueueSize=1.
#20 D  7SIM.ForegroundService onStartCommand(intent=Intent { act=ACTION_UPDATE_NEXT_WEEKLY_REPEAT_SCHEDULE_PROCESSING_ITER cmp=com.github.iusmac.sevensim/.ForegroundService (has extras) },flags=0,startId=3).
#21 D  7SIM.ForegroundService Worker.execute(taskId=3) Add : mQueueSize=2.
#22 D  7SIM.SubscriptionsImplLegacy syncSubscriptions(dateTime=2024-08-20T15:38:51.853) : Subscription { id=1 slotIndex=1 simState=ENABLED iconTint=-4056997 name=Vodafone lastActivatedTime=-999999999-01-01T00:00 lastDeactivatedTime=-999999999-01-01T00:00 keepDisabledAcrossBoots=false },currentSubState=ENABLED,expectedSubState=UNKNOWN,existsInUsableList=false.
#23 D  7SIM.SubscriptionsImplLegacy persistSubscriptionState(subId=1,state=ENABLED).
#24 D  7SIM.SubscriptionsImplLegacy syncSubscriptions(dateTime=2024-08-20T15:38:51.853) : Subscription { id=2 slotIndex=-1 simState=UNKNOWN iconTint=-16777216 name= lastActivatedTime=2024-08-20T15:38 lastDeactivatedTime=-999999999-01-01T00:00 keepDisabledAcrossBoots=false }.
#25 V  7SIM.SubscriptionsImplLegacy persistSubscription(sub=Subscription { id=2 slotIndex=-1 simState=UNKNOWN iconTint=-16777216 name= lastActivatedTime=-999999999-01-01T00:00 lastDeactivatedTime=-999999999-01-01T00:00 keepDisabledAcrossBoots=false }).
#26 D  7SIM.SubscriptionsImplLegacy persistSubscriptionState(subId=2,state=UNKNOWN).
#27 D  7SIM.ForegroundService Worker.execute(taskId=1) Finish : mQueueSize=2.
#28 D  7SIM.ForegroundService Worker.execute(taskId=2) Start : mQueueSize=2.
#29 D  7SIM.SubscriptionScheduler syncSubscriptionEnabledState(subId=1,compareTime=2024-08-20T15:38:51.853,overrideUserPreference=false) : Subscription { id=1 slotIndex=1 simState=ENABLED iconTint=-4056997 name=Vodafone lastActivatedTime=-999999999-01-01T00:00 lastDeactivatedTime=-999999999-01-01T00:00 keepDisabledAcrossBoots=false },nearestEnableTime=Optional[2024-08-20T14:30],nearestDisableTime=Optional[2024-08-20T18:30],expectedEnabled=false,isInCall=false.
#30 D  7SIM.TelephonyController setSimState(slotIndex=1,enabled=false,keepDisabledAcrossBoots=false) : In sync block.
#31 V  7SIM.SubscriptionsImplLegacy persistSubscription(sub=Subscription { id=1 slotIndex=1 simState=DISABLED iconTint=-4056997 name=Vodafone lastActivatedTime=-999999999-01-01T00:00 lastDeactivatedTime=2024-08-20T15:38 keepDisabledAcrossBoots=false }).
#32 D  7SIM.SubscriptionsImplLegacy persistSubscriptionState(subId=1,state=DISABLED).
#33 V  7SIM.SubscriptionsImplLegacy addOnSimStatusChangedListener().
#34 V  7SIM.SubscriptionsImplLegacy registerCarrierConfigChangedReceiver().

#35 D  7SIM.SimListViewModel handleOnSimStateChanged(simEntryId=1,enabled=false).
#36 D  7SIM.TelephonyController setSimState(slotIndex=1,enabled=false,keepDisabledAcrossBoots=true) : In sync block.
#37 V  7SIM.SubscriptionsImplLegacy onReceive() : intent=Intent { act=android.telephony.action.SIM_CARD_STATE_CHANGED flg=0x5000010 (has extras) }
#38 V  7SIM.SubscriptionsImplLegacy dispatchOnSimStatusChanged(slotIndex=1,state=1).
#39 V  7SIM.TelephonyController onSimStatusChanged(slotIndex=1,state=1).
#40 E  AndroidRuntime Process: com.github.iusmac.sevensim, PID: 2426
#41 E  AndroidRuntime java.lang.RuntimeException: Error receiving broadcast Intent { act=android.telephony.action.SIM_CARD_STATE_CHANGED flg=0x5000010 (has extras) } in com.github.iusmac.sevensim.telephony.Subscriptions$1@a222e8c
#42 E  AndroidRuntime Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'int com.github.iusmac.sevensim.telephony.Subscription.getSlotIndex()' on a null object reference
#43 E  AndroidRuntime      at com.github.iusmac.sevensim.telephony.TelephonyController$SimStatusChangedListener.onSimStatusChanged(TelephonyController.java:372)
#44 E  AndroidRuntime      at com.github.iusmac.sevensim.telephony.Subscriptions.dispatchOnSimStatusChanged(Subscriptions.java:446)
#45 E  AndroidRuntime      at com.github.iusmac.sevensim.telephony.Subscriptions.-$$Nest$mdispatchOnSimStatusChanged(Unknown Source:0)
#46 E  AndroidRuntime      at com.github.iusmac.sevensim.telephony.Subscriptions$1.onReceive(Subscriptions.java:85)
#47 I  am_crash [2426,0,com.github.iusmac.sevensim,550026951,java.lang.NullPointerException,Attempt to invoke virtual method 'int com.github.iusmac.sevensim.telephony.Subscription.getSlotIndex()' on a null object reference,TelephonyController.java,372]

Signed-off-by: iusmac <[email protected]>
iusmac added a commit that referenced this pull request Aug 24, 2024
To reproduce this:
1. Ensure the device is using the legacy radio interface layer (RIL) to
   control SIM cards
2. Toggle the same SIM card multiple times in a row
3. Observe the SIM card forcefully returning to its original state due
   to the synchronization with its schedules

Deep-dive explanation:
When performing the SIM subscription state mutation for the same SIM
card multiple times in a row (#1-12 & #13-24), this will sooner trigger
in parallel the global carrier config changed event listener (#25),
which in turn will run the SIM subscriptions sync process. In this case,
the SIM subscriptions sync process may short-circuit and terminate fast,
or it may force override user's preference applied a moment ago through
the scheduler (#41). This is because the last{Activated/Deactivated}Time
fields used to determine whether to keep the user's preference within
the allowed period or not was reset during the SIM subscriptions sync
process, since the SIM subscription can be temporarily unavailable (#38)
during state transition.

The fix:
This patch fix introduces an atomic flag to block the synchronization of the
internal state of all SIM subscriptions during SIM subscription state
mutations.
Currently, this issue affects heavily only devices using legacy RIL, but
we'll use the flag on the newer RIL too, since there's a call to the
database that may take longer to complete in some circumstances.

#1 D  7SIM.SimListViewModel handleOnSimEnabledStateChanged(simEntryId=1,enabled=false).
#2 D  7SIM.TelephonyController setSimState(slotIndex=1,enabled=false,keepDisabledAcrossBoots=true) : In sync block.
#3 V  7SIM.SubscriptionsImplLegacy persistSubscription(sub=Subscription { id=1 slotIndex=1 simState=DISABLED iconTint=-4056997 name=Vodafone lastActivatedTime=-999999999-01-01T00:00 lastDeactivatedTime=2024-08-23T14:51 keepDisabledAcrossBoots=true }).
#4 D  7SIM.SubscriptionsImplLegacy persistSubscriptionState(subId=1,state=DISABLED).
#5 V  7SIM.SubscriptionsImplLegacy addOnSimStatusChangedListener().
#6 V  7SIM.SubscriptionsImplLegacy registerCarrierConfigChangedReceiver().
#7 V  7SIM.SubscriptionsImplLegacy onReceive() : intent=Intent { act=android.telephony.action.SIM_CARD_STATE_CHANGED flg=0x5000010 (has extras) }
#8 V  7SIM.SubscriptionsImplLegacy dispatchOnSimStatusChanged(slotIndex=1,state=1).
#9 V  7SIM.TelephonyController onSimStatusChanged(slotIndex=1,state=1).
#10 V  7SIM.SubscriptionsImplLegacy removeOnSimStatusChangedListener().
#11 V  7SIM.SubscriptionsImplLegacy unregisterCarrierConfigChangedReceiver().
#12 D  7SIM.TelephonyController handleOnSetSimPowerStateForSlotFinished(resCode=1) : requestMetadata=Bundle[{last_activated_time=-999999999-01-01T00:00, last_deactivated_time=2024-08-23T14:51, subscription=Subscription { id=1 slotIndex=1 simState=DISABLED iconTint=-4056997 name=Vodafone lastActivatedTime=-999999999-01-01T00:00 lastDeactivatedTime=2024-08-23T14:51 keepDisabledAcrossBoots=true }, keep_disabled_across_boots=true}], requestFailed=false,shouldNotifyAllListeners=false

#13 D  7SIM.SimListViewModel handleOnSimEnabledStateChanged(simEntryId=1,enabled=true).
#14 D  7SIM.TelephonyController setSimState(slotIndex=1,enabled=true,keepDisabledAcrossBoots=false) : In sync block.
#15 V  7SIM.SubscriptionsImplLegacy persistSubscription(sub=Subscription { id=1 slotIndex=1 simState=ENABLED iconTint=-4056997 name=Vodafone lastActivatedTime=2024-08-23T14:51 lastDeactivatedTime=-999999999-01-01T00:00 keepDisabledAcrossBoots=false }).
#16 D  7SIM.SubscriptionsImplLegacy persistSubscriptionState(subId=1,state=ENABLED).
#17 V  7SIM.SubscriptionsImplLegacy addOnSimStatusChangedListener().
#18 V  7SIM.SubscriptionsImplLegacy registerCarrierConfigChangedReceiver().
#19 V  7SIM.SubscriptionsImplLegacy onReceive() : intent=Intent { act=android.telephony.action.SIM_CARD_STATE_CHANGED flg=0x5000010 (has extras) }
#20 V  7SIM.SubscriptionsImplLegacy dispatchOnSimStatusChanged(slotIndex=1,state=11).
#21 V  7SIM.TelephonyController onSimStatusChanged(slotIndex=1,state=11).
#22 V  7SIM.SubscriptionsImplLegacy removeOnSimStatusChangedListener().
#23 V  7SIM.SubscriptionsImplLegacy unregisterCarrierConfigChangedReceiver().
#24 D  7SIM.TelephonyController handleOnSetSimPowerStateForSlotFinished(resCode=11) : requestMetadata=Bundle[{last_activated_time=2024-08-23T14:51, last_deactivated_time=-999999999-01-01T00:00, subscription=Subscription { id=1 slotIndex=1 simState=ENABLED iconTint=-4056997 name=Vodafone lastActivatedTime=2024-08-23T14:51 lastDeactivatedTime=-999999999-01-01T00:00 keepDisabledAcrossBoots=false }, keep_disabled_across_boots=false}], requestFailed=false,shouldNotifyAllListeners=true

#25 D  7SIM.DirectBootAwareBroadcastReceiver onReceive() : intent=Intent { act=android.telephony.action.CARRIER_CONFIG_CHANGED flg=0x15000010 cmp=com.github.iusmac.sevensim/.DirectBootAwareBroadcastReceiver (has extras) }
#26 D  7SIM.ForegroundService onCreate().
#27 D  7SIM.ForegroundService onStartCommand(intent=Intent { act=ACTION_SUBSCRIPTIONS_CHANGED cmp=com.github.iusmac.sevensim/.ForegroundService (has extras) },flags=0,startId=1).
#28 D  7SIM.ForegroundService Worker.execute(taskId=1) Add : mQueueSize=0.
#29 D  7SIM.ForegroundService onStartCommand(intent=Intent { act=ACTION_SYNC_SUBSCRIPTION_ENABLED_STATE cmp=com.github.iusmac.sevensim/.ForegroundService (has extras) },flags=0,startId=2).
#30 D  7SIM.ForegroundService Worker.execute(taskId=1) Start : mQueueSize=1.
#31 D  7SIM.ForegroundService Worker.execute(taskId=2) Add : mQueueSize=1.
#32 D  7SIM.ForegroundService onStartCommand(intent=Intent { act=ACTION_UPDATE_NEXT_WEEKLY_REPEAT_SCHEDULE_PROCESSING_ITER cmp=com.github.iusmac.sevensim/.ForegroundService (has extras) },flags=0,startId=3).
#33 D  7SIM.ForegroundService Worker.execute(taskId=3) Add : mQueueSize=2.
#34 D  7SIM.SubscriptionsImplLegacy syncSubscriptions(dateTime=2024-08-23T14:51:08.280) : Subscription { id=2 slotIndex=0 simState=ENABLED iconTint=-13408298 name=Vodafone (work) lastActivatedTime=-999999999-01-01T00:00 lastDeactivatedTime=-999999999-01-01T00:00 keepDisabledAcrossBoots=false },currentSubState=ENABLED,expectedSubState=UNKNOWN,existsInUsableList=false.
#35 D  7SIM.SubscriptionsImplLegacy persistSubscriptionState(subId=2,state=ENABLED).
#36 D  7SIM.SubscriptionsImplLegacy syncSubscriptions(dateTime=2024-08-23T14:51:08.280) : Subscription { id=1 slotIndex=-1 simState=UNKNOWN iconTint=-16777216 name= lastActivatedTime=2024-08-23T14:51 lastDeactivatedTime=-999999999-01-01T00:00 keepDisabledAcrossBoots=false }.
#37 V  7SIM.SubscriptionsImplLegacy persistSubscription(sub=Subscription { id=1 slotIndex=-1 simState=UNKNOWN iconTint=-16777216 name= lastActivatedTime=-999999999-01-01T00:00 lastDeactivatedTime=-999999999-01-01T00:00 keepDisabledAcrossBoots=false }).
#38 D  7SIM.SubscriptionsImplLegacy persistSubscriptionState(subId=1,state=UNKNOWN).
#39 D  7SIM.ForegroundService Worker.execute(taskId=1) Finish : mQueueSize=2.
#40 D  7SIM.ForegroundService Worker.execute(taskId=2) Start : mQueueSize=2.
#41 D  7SIM.SubscriptionScheduler syncSubscriptionEnabledState(subId=2,compareTime=2024-08-23T14:51:08.280,overrideUserPreference=false) : Subscription { id=2 slotIndex=0 simState=ENABLED iconTint=-13408298 name=Vodafone (work) lastActivatedTime=-999999999-01-01T00:00 lastDeactivatedTime=-999999999-01-01T00:00 keepDisabledAcrossBoots=false },nearestEnableTime=Optional.empty,nearestDisableTime=Optional[2024-08-19T08:00],expectedEnabled=false,isInCall=false.
#42 D  7SIM.TelephonyController setSimState(slotIndex=0,enabled=false,keepDisabledAcrossBoots=false) : In sync block.

Signed-off-by: iusmac <[email protected]>

# Please enter the commit message for your changes. Lines starting
# with '#' will be kept; you may remove them yourself if you want to.
# An empty message aborts the commit.
#
# Date:      Fri Aug 23 16:04:50 2024 +0200
#
# interactive rebase in progress; onto 7db7f56
# Last command done (1 command done):
#    edit 42ea1228 fix(telephony): prevent SIM subscriptions sync when altering SIM state
# Next command to do (1 remaining command):
#    exec GIT_AUTHOR_NAME='iusmac' GIT_AUTHOR_EMAIL='[email protected]' GIT_AUTHOR_DATE='Fri Aug 23 16:04:50 2024 +0200' GIT_COMMITTER_NAME='iusmac' GIT_COMMITTER_EMAIL='[email protected]' GIT_COMMITTER_DATE='Fri Aug 23 16:04:50 2024 +0200' git commit --quiet --amend --reset-author --no-edit
# You are currently editing a commit while rebasing branch '14.0-dev' on '7db7f568'.
#
# Changes to be committed:
#	modified:   src/com/github/iusmac/sevensim/telephony/SubscriptionController.java
#	modified:   src/com/github/iusmac/sevensim/telephony/Subscriptions.java
#	modified:   src/com/github/iusmac/sevensim/telephony/TelephonyController.java
#
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant