Merge "Fix NetworkScoreService#getActiveScorer." into rvc-dev

This commit is contained in:
Varun Anand
2020-03-19 21:21:20 +00:00
committed by Android (Google) Code Review

View File

@@ -760,13 +760,12 @@ public class NetworkScoreService extends INetworkScoreService.Stub {
@Override @Override
public String getActiveScorerPackage() { public String getActiveScorerPackage() {
enforceSystemOrHasScoreNetworks(); enforceSystemOrHasScoreNetworks();
synchronized (mServiceConnectionLock) { NetworkScorerAppData appData = mNetworkScorerAppManager.getActiveScorer();
if (mServiceConnection != null) { if (appData == null) {
return mServiceConnection.getPackageName();
}
}
return null; return null;
} }
return appData.getRecommendationServicePackageName();
}
/** /**
* Returns metadata about the active scorer or <code>null</code> if there is no active scorer. * Returns metadata about the active scorer or <code>null</code> if there is no active scorer.
@@ -775,13 +774,7 @@ public class NetworkScoreService extends INetworkScoreService.Stub {
public NetworkScorerAppData getActiveScorer() { public NetworkScorerAppData getActiveScorer() {
// Only the system can access this data. // Only the system can access this data.
enforceSystemOnly(); enforceSystemOnly();
synchronized (mServiceConnectionLock) { return mNetworkScorerAppManager.getActiveScorer();
if (mServiceConnection != null) {
return mServiceConnection.getAppData();
}
}
return null;
} }
/** /**