Loading services/core/java/com/android/server/appbinding/AppBindingService.java +22 −20 Original line number Diff line number Diff line Loading @@ -161,7 +161,7 @@ public class AppBindingService extends Binder { if (app.getClass() != appServiceFinderClass) { continue; } serviceConnections.addAll(getBoundConnectionsLocked(userId, app)); serviceConnections.addAll(getConnectionsLocked(userId, app)); } } Loading @@ -181,30 +181,16 @@ public class AppBindingService extends Binder { /** * Get the connection bound to a specific finder or create one if it does not exist. */ private List<AppServiceConnection> getBoundConnectionsLocked(int userId, private List<AppServiceConnection> getConnectionsLocked(int userId, AppServiceFinder app) { Set<String> targetPackages = app.getTargetPackages(userId); List<AppServiceConnection> connections = new ArrayList<>(); for (String targetPackage : targetPackages) { AppServiceConnection conn = findConnectionLock(userId, app, targetPackage); if (conn == null) { final ServiceInfo service = app.findService(userId, mIPackageManager, mConstants, targetPackage); if (service != null) { conn = new AppServiceConnection( mContext, userId, mConstants, mHandler, app, targetPackage, service.getComponentName()); mConnections.add(conn); AppServiceConnection conn = getOrCreateConnectionLocked(userId, app, targetPackage); if (conn != null) { connections.add(conn); } } } return connections; } Loading Loading @@ -480,7 +466,7 @@ public class AppBindingService extends Binder { } @Nullable private AppServiceConnection findConnectionLock( private AppServiceConnection getOrCreateConnectionLocked( int userId, @NonNull AppServiceFinder target, String targetPackage) { for (int i = 0; i < mConnections.size(); i++) { final AppServiceConnection conn = mConnections.get(i); Loading @@ -490,6 +476,22 @@ public class AppBindingService extends Binder { return conn; } } final ServiceInfo service = target.findService(userId, mIPackageManager, mConstants, targetPackage); if (service != null) { final AppServiceConnection conn = new AppServiceConnection( mContext, userId, mConstants, mHandler, target, targetPackage, service.getComponentName()); mConnections.add(conn); return conn; } return null; } Loading Loading
services/core/java/com/android/server/appbinding/AppBindingService.java +22 −20 Original line number Diff line number Diff line Loading @@ -161,7 +161,7 @@ public class AppBindingService extends Binder { if (app.getClass() != appServiceFinderClass) { continue; } serviceConnections.addAll(getBoundConnectionsLocked(userId, app)); serviceConnections.addAll(getConnectionsLocked(userId, app)); } } Loading @@ -181,30 +181,16 @@ public class AppBindingService extends Binder { /** * Get the connection bound to a specific finder or create one if it does not exist. */ private List<AppServiceConnection> getBoundConnectionsLocked(int userId, private List<AppServiceConnection> getConnectionsLocked(int userId, AppServiceFinder app) { Set<String> targetPackages = app.getTargetPackages(userId); List<AppServiceConnection> connections = new ArrayList<>(); for (String targetPackage : targetPackages) { AppServiceConnection conn = findConnectionLock(userId, app, targetPackage); if (conn == null) { final ServiceInfo service = app.findService(userId, mIPackageManager, mConstants, targetPackage); if (service != null) { conn = new AppServiceConnection( mContext, userId, mConstants, mHandler, app, targetPackage, service.getComponentName()); mConnections.add(conn); AppServiceConnection conn = getOrCreateConnectionLocked(userId, app, targetPackage); if (conn != null) { connections.add(conn); } } } return connections; } Loading Loading @@ -480,7 +466,7 @@ public class AppBindingService extends Binder { } @Nullable private AppServiceConnection findConnectionLock( private AppServiceConnection getOrCreateConnectionLocked( int userId, @NonNull AppServiceFinder target, String targetPackage) { for (int i = 0; i < mConnections.size(); i++) { final AppServiceConnection conn = mConnections.get(i); Loading @@ -490,6 +476,22 @@ public class AppBindingService extends Binder { return conn; } } final ServiceInfo service = target.findService(userId, mIPackageManager, mConstants, targetPackage); if (service != null) { final AppServiceConnection conn = new AppServiceConnection( mContext, userId, mConstants, mHandler, target, targetPackage, service.getComponentName()); mConnections.add(conn); return conn; } return null; } Loading