Loading api/system-current.txt +6 −6 Original line number Diff line number Diff line Loading @@ -7458,9 +7458,9 @@ package android.net.wifi { method public void onWifiUsabilityStats(int, boolean, @NonNull android.net.wifi.WifiUsabilityStatsEntry); } public static interface WifiManager.ScoreChangeCallback { method public void onScoreChange(int, int); method public void onTriggerUpdateOfWifiUsabilityStats(int); public static interface WifiManager.ScoreUpdateObserver { method public void notifyScoreUpdate(int, int); method public void triggerUpdateOfWifiUsabilityStats(int); } public static interface WifiManager.SoftApCallback { Loading @@ -7480,9 +7480,9 @@ package android.net.wifi { } public static interface WifiManager.WifiConnectedNetworkScorer { method public void setScoreChangeCallback(@NonNull android.net.wifi.WifiManager.ScoreChangeCallback); method public void start(int); method public void stop(int); method public void onSetScoreUpdateObserver(@NonNull android.net.wifi.WifiManager.ScoreUpdateObserver); method public void onStart(int); method public void onStop(int); } public final class WifiMigration { Loading wifi/java/android/net/wifi/IScoreChangeCallback.aidl→wifi/java/android/net/wifi/IScoreUpdateObserver.aidl +3 −3 Original line number Diff line number Diff line Loading @@ -21,9 +21,9 @@ package android.net.wifi; * * @hide */ oneway interface IScoreChangeCallback oneway interface IScoreUpdateObserver { void onScoreChange(int sessionId, int score); void notifyScoreUpdate(int sessionId, int score); void onTriggerUpdateOfWifiUsabilityStats(int sessionId); void triggerUpdateOfWifiUsabilityStats(int sessionId); } wifi/java/android/net/wifi/IWifiConnectedNetworkScorer.aidl +4 −4 Original line number Diff line number Diff line Loading @@ -16,7 +16,7 @@ package android.net.wifi; import android.net.wifi.IScoreChangeCallback; import android.net.wifi.IScoreUpdateObserver; /** * Interface for Wi-Fi connected network scorer. Loading @@ -25,9 +25,9 @@ import android.net.wifi.IScoreChangeCallback; */ oneway interface IWifiConnectedNetworkScorer { void start(int sessionId); void onStart(int sessionId); void stop(int sessionId); void onStop(int sessionId); void setScoreChangeCallback(IScoreChangeCallback cbImpl); void onSetScoreUpdateObserver(IScoreUpdateObserver observerImpl); } wifi/java/android/net/wifi/WifiManager.java +30 −30 Original line number Diff line number Diff line Loading @@ -5986,22 +5986,22 @@ public class WifiManager { } /** * Callback interface for framework to receive network status changes and trigger of updating * Callback interface for framework to receive network status updates and trigger of updating * {@link WifiUsabilityStatsEntry}. * * @hide */ @SystemApi public interface ScoreChangeCallback { public interface ScoreUpdateObserver { /** * Called by applications to indicate network status. * * @param sessionId The ID to indicate current Wi-Fi network connection obtained from * {@link WifiConnectedNetworkScorer#start(int)}. * {@link WifiConnectedNetworkScorer#onStart(int)}. * @param score The score representing link quality of current Wi-Fi network connection. * Populated by connected network scorer in applications.. */ void onScoreChange(int sessionId, int score); void notifyScoreUpdate(int sessionId, int score); /** * Called by applications to trigger an update of {@link WifiUsabilityStatsEntry}. Loading @@ -6009,36 +6009,36 @@ public class WifiManager { * {@link addOnWifiUsabilityStatsListener(Executor, OnWifiUsabilityStatsListener)}. * * @param sessionId The ID to indicate current Wi-Fi network connection obtained from * {@link WifiConnectedNetworkScorer#start(int)}. * {@link WifiConnectedNetworkScorer#onStart(int)}. */ void onTriggerUpdateOfWifiUsabilityStats(int sessionId); void triggerUpdateOfWifiUsabilityStats(int sessionId); } /** * Callback proxy for {@link ScoreChangeCallback} objects. * Callback proxy for {@link ScoreUpdateObserver} objects. * * @hide */ private class ScoreChangeCallbackProxy implements ScoreChangeCallback { private final IScoreChangeCallback mScoreChangeCallback; private class ScoreUpdateObserverProxy implements ScoreUpdateObserver { private final IScoreUpdateObserver mScoreUpdateObserver; private ScoreChangeCallbackProxy(IScoreChangeCallback callback) { mScoreChangeCallback = callback; private ScoreUpdateObserverProxy(IScoreUpdateObserver observer) { mScoreUpdateObserver = observer; } @Override public void onScoreChange(int sessionId, int score) { public void notifyScoreUpdate(int sessionId, int score) { try { mScoreChangeCallback.onScoreChange(sessionId, score); mScoreUpdateObserver.notifyScoreUpdate(sessionId, score); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } @Override public void onTriggerUpdateOfWifiUsabilityStats(int sessionId) { public void triggerUpdateOfWifiUsabilityStats(int sessionId) { try { mScoreChangeCallback.onTriggerUpdateOfWifiUsabilityStats(sessionId); mScoreUpdateObserver.triggerUpdateOfWifiUsabilityStats(sessionId); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } Loading @@ -6058,21 +6058,21 @@ public class WifiManager { * Called by framework to indicate the start of a network connection. * @param sessionId The ID to indicate current Wi-Fi network connection. */ void start(int sessionId); void onStart(int sessionId); /** * Called by framework to indicate the end of a network connection. * @param sessionId The ID to indicate current Wi-Fi network connection obtained from * {@link WifiConnectedNetworkScorer#start(int)}. * {@link WifiConnectedNetworkScorer#onStart(int)}. */ void stop(int sessionId); void onStop(int sessionId); /** * Framework sets callback for score change events after application sets its scorer. * @param cbImpl The instance for {@link WifiManager#ScoreChangeCallback}. Should be * @param observerImpl The instance for {@link WifiManager#ScoreUpdateObserver}. Should be * implemented and instantiated by framework. */ void setScoreChangeCallback(@NonNull ScoreChangeCallback cbImpl); void onSetScoreUpdateObserver(@NonNull ScoreUpdateObserver observerImpl); } /** Loading @@ -6090,32 +6090,32 @@ public class WifiManager { } @Override public void start(int sessionId) { public void onStart(int sessionId) { if (mVerboseLoggingEnabled) { Log.v(TAG, "WifiConnectedNetworkScorer: " + "start: sessionId=" + sessionId); Log.v(TAG, "WifiConnectedNetworkScorer: " + "onStart: sessionId=" + sessionId); } Binder.clearCallingIdentity(); mExecutor.execute(() -> mScorer.start(sessionId)); mExecutor.execute(() -> mScorer.onStart(sessionId)); } @Override public void stop(int sessionId) { public void onStop(int sessionId) { if (mVerboseLoggingEnabled) { Log.v(TAG, "WifiConnectedNetworkScorer: " + "stop: sessionId=" + sessionId); Log.v(TAG, "WifiConnectedNetworkScorer: " + "onStop: sessionId=" + sessionId); } Binder.clearCallingIdentity(); mExecutor.execute(() -> mScorer.stop(sessionId)); mExecutor.execute(() -> mScorer.onStop(sessionId)); } @Override public void setScoreChangeCallback(IScoreChangeCallback cbImpl) { public void onSetScoreUpdateObserver(IScoreUpdateObserver observerImpl) { if (mVerboseLoggingEnabled) { Log.v(TAG, "WifiConnectedNetworkScorer: " + "setScoreChangeCallback: cbImpl=" + cbImpl); + "onSetScoreUpdateObserver: observerImpl=" + observerImpl); } Binder.clearCallingIdentity(); mExecutor.execute(() -> mScorer.setScoreChangeCallback( new ScoreChangeCallbackProxy(cbImpl))); mExecutor.execute(() -> mScorer.onSetScoreUpdateObserver( new ScoreUpdateObserverProxy(observerImpl))); } } Loading wifi/tests/src/android/net/wifi/WifiManagerTest.java +10 −9 Original line number Diff line number Diff line Loading @@ -2349,23 +2349,24 @@ public class WifiManagerTest { } /** * Verify that Wi-Fi connected scorer receives score change callback after registeration. * Verify that Wi-Fi connected scorer receives score update observer after registeration. */ @Test public void verifyScorerReceiveScoreChangeCallbackAfterRegistration() throws Exception { public void verifyScorerReceiveScoreUpdateObserverAfterRegistration() throws Exception { mExecutor = new SynchronousExecutor(); mWifiManager.setWifiConnectedNetworkScorer(mExecutor, mWifiConnectedNetworkScorer); ArgumentCaptor<IWifiConnectedNetworkScorer.Stub> scorerCaptor = ArgumentCaptor.forClass(IWifiConnectedNetworkScorer.Stub.class); verify(mWifiService).setWifiConnectedNetworkScorer(any(IBinder.class), scorerCaptor.capture()); scorerCaptor.getValue().setScoreChangeCallback(any()); scorerCaptor.getValue().onSetScoreUpdateObserver(any()); mLooper.dispatchAll(); verify(mWifiConnectedNetworkScorer).setScoreChangeCallback(any()); verify(mWifiConnectedNetworkScorer).onSetScoreUpdateObserver(any()); } /** * Verify that Wi-Fi connected scorer receives session ID when start/stop methods are called. * Verify that Wi-Fi connected scorer receives session ID when onStart/onStop methods * are called. */ @Test public void verifyScorerReceiveSessionIdWhenStartStopIsCalled() throws Exception { Loading @@ -2375,11 +2376,11 @@ public class WifiManagerTest { ArgumentCaptor.forClass(IWifiConnectedNetworkScorer.Stub.class); verify(mWifiService).setWifiConnectedNetworkScorer(any(IBinder.class), callbackCaptor.capture()); callbackCaptor.getValue().start(0); callbackCaptor.getValue().stop(10); callbackCaptor.getValue().onStart(0); callbackCaptor.getValue().onStop(10); mLooper.dispatchAll(); verify(mWifiConnectedNetworkScorer).start(0); verify(mWifiConnectedNetworkScorer).stop(10); verify(mWifiConnectedNetworkScorer).onStart(0); verify(mWifiConnectedNetworkScorer).onStop(10); } @Test Loading Loading
api/system-current.txt +6 −6 Original line number Diff line number Diff line Loading @@ -7458,9 +7458,9 @@ package android.net.wifi { method public void onWifiUsabilityStats(int, boolean, @NonNull android.net.wifi.WifiUsabilityStatsEntry); } public static interface WifiManager.ScoreChangeCallback { method public void onScoreChange(int, int); method public void onTriggerUpdateOfWifiUsabilityStats(int); public static interface WifiManager.ScoreUpdateObserver { method public void notifyScoreUpdate(int, int); method public void triggerUpdateOfWifiUsabilityStats(int); } public static interface WifiManager.SoftApCallback { Loading @@ -7480,9 +7480,9 @@ package android.net.wifi { } public static interface WifiManager.WifiConnectedNetworkScorer { method public void setScoreChangeCallback(@NonNull android.net.wifi.WifiManager.ScoreChangeCallback); method public void start(int); method public void stop(int); method public void onSetScoreUpdateObserver(@NonNull android.net.wifi.WifiManager.ScoreUpdateObserver); method public void onStart(int); method public void onStop(int); } public final class WifiMigration { Loading
wifi/java/android/net/wifi/IScoreChangeCallback.aidl→wifi/java/android/net/wifi/IScoreUpdateObserver.aidl +3 −3 Original line number Diff line number Diff line Loading @@ -21,9 +21,9 @@ package android.net.wifi; * * @hide */ oneway interface IScoreChangeCallback oneway interface IScoreUpdateObserver { void onScoreChange(int sessionId, int score); void notifyScoreUpdate(int sessionId, int score); void onTriggerUpdateOfWifiUsabilityStats(int sessionId); void triggerUpdateOfWifiUsabilityStats(int sessionId); }
wifi/java/android/net/wifi/IWifiConnectedNetworkScorer.aidl +4 −4 Original line number Diff line number Diff line Loading @@ -16,7 +16,7 @@ package android.net.wifi; import android.net.wifi.IScoreChangeCallback; import android.net.wifi.IScoreUpdateObserver; /** * Interface for Wi-Fi connected network scorer. Loading @@ -25,9 +25,9 @@ import android.net.wifi.IScoreChangeCallback; */ oneway interface IWifiConnectedNetworkScorer { void start(int sessionId); void onStart(int sessionId); void stop(int sessionId); void onStop(int sessionId); void setScoreChangeCallback(IScoreChangeCallback cbImpl); void onSetScoreUpdateObserver(IScoreUpdateObserver observerImpl); }
wifi/java/android/net/wifi/WifiManager.java +30 −30 Original line number Diff line number Diff line Loading @@ -5986,22 +5986,22 @@ public class WifiManager { } /** * Callback interface for framework to receive network status changes and trigger of updating * Callback interface for framework to receive network status updates and trigger of updating * {@link WifiUsabilityStatsEntry}. * * @hide */ @SystemApi public interface ScoreChangeCallback { public interface ScoreUpdateObserver { /** * Called by applications to indicate network status. * * @param sessionId The ID to indicate current Wi-Fi network connection obtained from * {@link WifiConnectedNetworkScorer#start(int)}. * {@link WifiConnectedNetworkScorer#onStart(int)}. * @param score The score representing link quality of current Wi-Fi network connection. * Populated by connected network scorer in applications.. */ void onScoreChange(int sessionId, int score); void notifyScoreUpdate(int sessionId, int score); /** * Called by applications to trigger an update of {@link WifiUsabilityStatsEntry}. Loading @@ -6009,36 +6009,36 @@ public class WifiManager { * {@link addOnWifiUsabilityStatsListener(Executor, OnWifiUsabilityStatsListener)}. * * @param sessionId The ID to indicate current Wi-Fi network connection obtained from * {@link WifiConnectedNetworkScorer#start(int)}. * {@link WifiConnectedNetworkScorer#onStart(int)}. */ void onTriggerUpdateOfWifiUsabilityStats(int sessionId); void triggerUpdateOfWifiUsabilityStats(int sessionId); } /** * Callback proxy for {@link ScoreChangeCallback} objects. * Callback proxy for {@link ScoreUpdateObserver} objects. * * @hide */ private class ScoreChangeCallbackProxy implements ScoreChangeCallback { private final IScoreChangeCallback mScoreChangeCallback; private class ScoreUpdateObserverProxy implements ScoreUpdateObserver { private final IScoreUpdateObserver mScoreUpdateObserver; private ScoreChangeCallbackProxy(IScoreChangeCallback callback) { mScoreChangeCallback = callback; private ScoreUpdateObserverProxy(IScoreUpdateObserver observer) { mScoreUpdateObserver = observer; } @Override public void onScoreChange(int sessionId, int score) { public void notifyScoreUpdate(int sessionId, int score) { try { mScoreChangeCallback.onScoreChange(sessionId, score); mScoreUpdateObserver.notifyScoreUpdate(sessionId, score); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } @Override public void onTriggerUpdateOfWifiUsabilityStats(int sessionId) { public void triggerUpdateOfWifiUsabilityStats(int sessionId) { try { mScoreChangeCallback.onTriggerUpdateOfWifiUsabilityStats(sessionId); mScoreUpdateObserver.triggerUpdateOfWifiUsabilityStats(sessionId); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } Loading @@ -6058,21 +6058,21 @@ public class WifiManager { * Called by framework to indicate the start of a network connection. * @param sessionId The ID to indicate current Wi-Fi network connection. */ void start(int sessionId); void onStart(int sessionId); /** * Called by framework to indicate the end of a network connection. * @param sessionId The ID to indicate current Wi-Fi network connection obtained from * {@link WifiConnectedNetworkScorer#start(int)}. * {@link WifiConnectedNetworkScorer#onStart(int)}. */ void stop(int sessionId); void onStop(int sessionId); /** * Framework sets callback for score change events after application sets its scorer. * @param cbImpl The instance for {@link WifiManager#ScoreChangeCallback}. Should be * @param observerImpl The instance for {@link WifiManager#ScoreUpdateObserver}. Should be * implemented and instantiated by framework. */ void setScoreChangeCallback(@NonNull ScoreChangeCallback cbImpl); void onSetScoreUpdateObserver(@NonNull ScoreUpdateObserver observerImpl); } /** Loading @@ -6090,32 +6090,32 @@ public class WifiManager { } @Override public void start(int sessionId) { public void onStart(int sessionId) { if (mVerboseLoggingEnabled) { Log.v(TAG, "WifiConnectedNetworkScorer: " + "start: sessionId=" + sessionId); Log.v(TAG, "WifiConnectedNetworkScorer: " + "onStart: sessionId=" + sessionId); } Binder.clearCallingIdentity(); mExecutor.execute(() -> mScorer.start(sessionId)); mExecutor.execute(() -> mScorer.onStart(sessionId)); } @Override public void stop(int sessionId) { public void onStop(int sessionId) { if (mVerboseLoggingEnabled) { Log.v(TAG, "WifiConnectedNetworkScorer: " + "stop: sessionId=" + sessionId); Log.v(TAG, "WifiConnectedNetworkScorer: " + "onStop: sessionId=" + sessionId); } Binder.clearCallingIdentity(); mExecutor.execute(() -> mScorer.stop(sessionId)); mExecutor.execute(() -> mScorer.onStop(sessionId)); } @Override public void setScoreChangeCallback(IScoreChangeCallback cbImpl) { public void onSetScoreUpdateObserver(IScoreUpdateObserver observerImpl) { if (mVerboseLoggingEnabled) { Log.v(TAG, "WifiConnectedNetworkScorer: " + "setScoreChangeCallback: cbImpl=" + cbImpl); + "onSetScoreUpdateObserver: observerImpl=" + observerImpl); } Binder.clearCallingIdentity(); mExecutor.execute(() -> mScorer.setScoreChangeCallback( new ScoreChangeCallbackProxy(cbImpl))); mExecutor.execute(() -> mScorer.onSetScoreUpdateObserver( new ScoreUpdateObserverProxy(observerImpl))); } } Loading
wifi/tests/src/android/net/wifi/WifiManagerTest.java +10 −9 Original line number Diff line number Diff line Loading @@ -2349,23 +2349,24 @@ public class WifiManagerTest { } /** * Verify that Wi-Fi connected scorer receives score change callback after registeration. * Verify that Wi-Fi connected scorer receives score update observer after registeration. */ @Test public void verifyScorerReceiveScoreChangeCallbackAfterRegistration() throws Exception { public void verifyScorerReceiveScoreUpdateObserverAfterRegistration() throws Exception { mExecutor = new SynchronousExecutor(); mWifiManager.setWifiConnectedNetworkScorer(mExecutor, mWifiConnectedNetworkScorer); ArgumentCaptor<IWifiConnectedNetworkScorer.Stub> scorerCaptor = ArgumentCaptor.forClass(IWifiConnectedNetworkScorer.Stub.class); verify(mWifiService).setWifiConnectedNetworkScorer(any(IBinder.class), scorerCaptor.capture()); scorerCaptor.getValue().setScoreChangeCallback(any()); scorerCaptor.getValue().onSetScoreUpdateObserver(any()); mLooper.dispatchAll(); verify(mWifiConnectedNetworkScorer).setScoreChangeCallback(any()); verify(mWifiConnectedNetworkScorer).onSetScoreUpdateObserver(any()); } /** * Verify that Wi-Fi connected scorer receives session ID when start/stop methods are called. * Verify that Wi-Fi connected scorer receives session ID when onStart/onStop methods * are called. */ @Test public void verifyScorerReceiveSessionIdWhenStartStopIsCalled() throws Exception { Loading @@ -2375,11 +2376,11 @@ public class WifiManagerTest { ArgumentCaptor.forClass(IWifiConnectedNetworkScorer.Stub.class); verify(mWifiService).setWifiConnectedNetworkScorer(any(IBinder.class), callbackCaptor.capture()); callbackCaptor.getValue().start(0); callbackCaptor.getValue().stop(10); callbackCaptor.getValue().onStart(0); callbackCaptor.getValue().onStop(10); mLooper.dispatchAll(); verify(mWifiConnectedNetworkScorer).start(0); verify(mWifiConnectedNetworkScorer).stop(10); verify(mWifiConnectedNetworkScorer).onStart(0); verify(mWifiConnectedNetworkScorer).onStop(10); } @Test Loading