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

Commit 15a30363 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Stay bound to the most current active scorer."

parents 7f41c150 82d72075
Loading
Loading
Loading
Loading
+9 −1
Original line number Original line Diff line number Diff line
@@ -159,15 +159,23 @@ public class NetworkScoreService extends INetworkScoreService.Stub {
                    if (DBG) Log.d(TAG, "No active scorers available.");
                    if (DBG) Log.d(TAG, "No active scorers available.");
                    unbindFromScoringServiceIfNeeded();
                    unbindFromScoringServiceIfNeeded();
                } else if (activeScorer.packageName.equals(scorerPackageName)) {
                } else if (activeScorer.packageName.equals(scorerPackageName)) {
                    // The active scoring service changed in some way.
                    if (DBG) {
                    if (DBG) {
                        Log.d(TAG, "Possible change to the active scorer: "
                        Log.d(TAG, "Possible change to the active scorer: "
                            + activeScorer.packageName);
                            + activeScorer.packageName);
                    }
                    }
                    // The scoring service changed in some way.
                    if (forceUnbind) {
                    if (forceUnbind) {
                        unbindFromScoringServiceIfNeeded();
                        unbindFromScoringServiceIfNeeded();
                    }
                    }
                    bindToScoringServiceIfNeeded(activeScorer);
                    bindToScoringServiceIfNeeded(activeScorer);
                } else {
                    // One of the scoring apps on the device has changed and we may no longer be
                    // bound to the correct scoring app. The logic in bindToScoringServiceIfNeeded()
                    // will sort that out to leave us bound to the most recent active scorer.
                    if (DBG) {
                        Log.d(TAG, "Binding to " + activeScorer.packageName + " if needed.");
                    }
                    bindToScoringServiceIfNeeded(activeScorer);
                }
                }
            }
            }
        }
        }