Loading android/app/src/com/android/bluetooth/gatt/ContextMap.java +11 −12 Original line number Diff line number Diff line Loading @@ -143,7 +143,7 @@ import com.android.bluetooth.btservice.BluetoothProto; private List<App> mApps = new ArrayList<App>(); /** Internal map to keep track of logging information by app name */ HashMap<String, AppScanStats> mAppScanStats = new HashMap<String, AppScanStats>(); HashMap<Integer, AppScanStats> mAppScanStats = new HashMap<Integer, AppScanStats>(); /** Internal list of connected devices **/ Set<Connection> mConnections = new HashSet<Connection>(); Loading @@ -152,17 +152,17 @@ import com.android.bluetooth.btservice.BluetoothProto; * Add an entry to the application context list. */ void add(UUID uuid, WorkSource workSource, C callback, T info, GattService service) { String appName = service.getPackageManager().getNameForUid( Binder.getCallingUid()); int appUid = Binder.getCallingUid(); String appName = service.getPackageManager().getNameForUid(appUid); if (appName == null) { // Assign an app name if one isn't found appName = "Unknown App (UID: " + Binder.getCallingUid() + ")"; appName = "Unknown App (UID: " + appUid + ")"; } synchronized (mApps) { AppScanStats appScanStats = mAppScanStats.get(appName); AppScanStats appScanStats = mAppScanStats.get(appUid); if (appScanStats == null) { appScanStats = new AppScanStats(appName, workSource, this, service); mAppScanStats.put(appName, appScanStats); mAppScanStats.put(appUid, appScanStats); } mApps.add(new App(uuid, callback, info, appName, appScanStats)); appScanStats.isRegistered = true; Loading Loading @@ -333,10 +333,10 @@ import com.android.bluetooth.btservice.BluetoothProto; } /** * Get Logging info by application name * Get Logging info by application UID */ AppScanStats getAppScanStatsByName(String name) { return mAppScanStats.get(name); AppScanStats getAppScanStatsByUid(int uid) { return mAppScanStats.get(uid); } /** Loading Loading @@ -441,11 +441,10 @@ import com.android.bluetooth.btservice.BluetoothProto; void dump(StringBuilder sb) { sb.append(" Entries: " + mAppScanStats.size() + "\n\n"); Iterator<Map.Entry<String, AppScanStats>> it = mAppScanStats.entrySet().iterator(); Iterator<Map.Entry<Integer, AppScanStats>> it = mAppScanStats.entrySet().iterator(); while (it.hasNext()) { Map.Entry<String, AppScanStats> entry = it.next(); Map.Entry<Integer, AppScanStats> entry = it.next(); String name = entry.getKey(); AppScanStats appScanStats = entry.getValue(); appScanStats.dumpToString(sb); } Loading Loading
android/app/src/com/android/bluetooth/gatt/ContextMap.java +11 −12 Original line number Diff line number Diff line Loading @@ -143,7 +143,7 @@ import com.android.bluetooth.btservice.BluetoothProto; private List<App> mApps = new ArrayList<App>(); /** Internal map to keep track of logging information by app name */ HashMap<String, AppScanStats> mAppScanStats = new HashMap<String, AppScanStats>(); HashMap<Integer, AppScanStats> mAppScanStats = new HashMap<Integer, AppScanStats>(); /** Internal list of connected devices **/ Set<Connection> mConnections = new HashSet<Connection>(); Loading @@ -152,17 +152,17 @@ import com.android.bluetooth.btservice.BluetoothProto; * Add an entry to the application context list. */ void add(UUID uuid, WorkSource workSource, C callback, T info, GattService service) { String appName = service.getPackageManager().getNameForUid( Binder.getCallingUid()); int appUid = Binder.getCallingUid(); String appName = service.getPackageManager().getNameForUid(appUid); if (appName == null) { // Assign an app name if one isn't found appName = "Unknown App (UID: " + Binder.getCallingUid() + ")"; appName = "Unknown App (UID: " + appUid + ")"; } synchronized (mApps) { AppScanStats appScanStats = mAppScanStats.get(appName); AppScanStats appScanStats = mAppScanStats.get(appUid); if (appScanStats == null) { appScanStats = new AppScanStats(appName, workSource, this, service); mAppScanStats.put(appName, appScanStats); mAppScanStats.put(appUid, appScanStats); } mApps.add(new App(uuid, callback, info, appName, appScanStats)); appScanStats.isRegistered = true; Loading Loading @@ -333,10 +333,10 @@ import com.android.bluetooth.btservice.BluetoothProto; } /** * Get Logging info by application name * Get Logging info by application UID */ AppScanStats getAppScanStatsByName(String name) { return mAppScanStats.get(name); AppScanStats getAppScanStatsByUid(int uid) { return mAppScanStats.get(uid); } /** Loading Loading @@ -441,11 +441,10 @@ import com.android.bluetooth.btservice.BluetoothProto; void dump(StringBuilder sb) { sb.append(" Entries: " + mAppScanStats.size() + "\n\n"); Iterator<Map.Entry<String, AppScanStats>> it = mAppScanStats.entrySet().iterator(); Iterator<Map.Entry<Integer, AppScanStats>> it = mAppScanStats.entrySet().iterator(); while (it.hasNext()) { Map.Entry<String, AppScanStats> entry = it.next(); Map.Entry<Integer, AppScanStats> entry = it.next(); String name = entry.getKey(); AppScanStats appScanStats = entry.getValue(); appScanStats.dumpToString(sb); } Loading