Loading core/java/android/net/NetworkScorerAppManager.java +0 −10 Original line number Diff line number Diff line Loading @@ -226,16 +226,6 @@ public class NetworkScorerAppManager { return false; } /** Determine whether the application with the given UID is the enabled scorer. */ @Deprecated // Use NetworkScoreManager.isCallerActiveScorer() public boolean isCallerActiveScorer(int callingUid) { NetworkScorerAppData defaultApp = getActiveScorer(); if (defaultApp == null) { return false; } return callingUid == defaultApp.packageUid; } private boolean isNetworkRecommendationsDisabled() { final ContentResolver cr = mContext.getContentResolver(); // A value of 1 indicates enabled. Loading core/tests/coretests/src/android/net/NetworkScorerAppManagerTest.java +0 −19 Original line number Diff line number Diff line Loading @@ -169,25 +169,6 @@ public class NetworkScorerAppManagerTest extends InstrumentationTestCase { assertNull(activeScorer); } public void testIsCallerActiveScorer_providerNotAvailable() throws Exception { ContentResolver cr = mTargetContext.getContentResolver(); Settings.Global.putInt(cr, Settings.Global.NETWORK_RECOMMENDATIONS_ENABLED, 1); assertFalse(mNetworkScorerAppManager.isCallerActiveScorer(924)); } public void testIsCallerActiveScorer_providerAvailable() throws Exception { setNetworkRecommendationPackageNames("package1"); mockScoreNetworksGranted("package1"); mockRecommendationServiceAvailable("package1", 924 /* packageUid */); ContentResolver cr = mTargetContext.getContentResolver(); Settings.Global.putInt(cr, Settings.Global.NETWORK_RECOMMENDATIONS_ENABLED, 1); assertTrue(mNetworkScorerAppManager.isCallerActiveScorer(924)); assertFalse(mNetworkScorerAppManager.isCallerActiveScorer(925)); } private void setNetworkRecommendationPackageNames(String... names) { if (names == null) { names = new String[0]; Loading Loading
core/java/android/net/NetworkScorerAppManager.java +0 −10 Original line number Diff line number Diff line Loading @@ -226,16 +226,6 @@ public class NetworkScorerAppManager { return false; } /** Determine whether the application with the given UID is the enabled scorer. */ @Deprecated // Use NetworkScoreManager.isCallerActiveScorer() public boolean isCallerActiveScorer(int callingUid) { NetworkScorerAppData defaultApp = getActiveScorer(); if (defaultApp == null) { return false; } return callingUid == defaultApp.packageUid; } private boolean isNetworkRecommendationsDisabled() { final ContentResolver cr = mContext.getContentResolver(); // A value of 1 indicates enabled. Loading
core/tests/coretests/src/android/net/NetworkScorerAppManagerTest.java +0 −19 Original line number Diff line number Diff line Loading @@ -169,25 +169,6 @@ public class NetworkScorerAppManagerTest extends InstrumentationTestCase { assertNull(activeScorer); } public void testIsCallerActiveScorer_providerNotAvailable() throws Exception { ContentResolver cr = mTargetContext.getContentResolver(); Settings.Global.putInt(cr, Settings.Global.NETWORK_RECOMMENDATIONS_ENABLED, 1); assertFalse(mNetworkScorerAppManager.isCallerActiveScorer(924)); } public void testIsCallerActiveScorer_providerAvailable() throws Exception { setNetworkRecommendationPackageNames("package1"); mockScoreNetworksGranted("package1"); mockRecommendationServiceAvailable("package1", 924 /* packageUid */); ContentResolver cr = mTargetContext.getContentResolver(); Settings.Global.putInt(cr, Settings.Global.NETWORK_RECOMMENDATIONS_ENABLED, 1); assertTrue(mNetworkScorerAppManager.isCallerActiveScorer(924)); assertFalse(mNetworkScorerAppManager.isCallerActiveScorer(925)); } private void setNetworkRecommendationPackageNames(String... names) { if (names == null) { names = new String[0]; Loading