Loading src/java/com/android/internal/telephony/satellite/SatelliteOptimizedApplicationsTracker.java +8 −7 Original line number Original line Diff line number Diff line Loading @@ -182,7 +182,7 @@ public class SatelliteOptimizedApplicationsTracker { List<UserInfo> users = mUserManager.getUsers(); List<UserInfo> users = mUserManager.getUsers(); for (UserInfo user : users) { for (UserInfo user : users) { int userId = user.getUserHandle().getIdentifier(); int userId = user.getUserHandle().getIdentifier(); mSatelliteApplications.put(userId, new HashSet<>()); mSatelliteApplications.putIfAbsent(userId, new HashSet<>()); } } // Get a list of installed packages // Get a list of installed packages List<PackageInfo> packages = List<PackageInfo> packages = Loading Loading @@ -213,6 +213,7 @@ public class SatelliteOptimizedApplicationsTracker { try { try { mPackageManager.getPackageUidAsUser( mPackageManager.getPackageUidAsUser( packageName, PackageManager.GET_META_DATA, userId); packageName, PackageManager.GET_META_DATA, userId); mSatelliteApplications.putIfAbsent(userId, new HashSet<>()); mSatelliteApplications.get(userId).add(packageName); mSatelliteApplications.get(userId).add(packageName); } catch (java.lang.Exception e) { } catch (java.lang.Exception e) { // package is not present for current user // package is not present for current user Loading @@ -229,7 +230,8 @@ public class SatelliteOptimizedApplicationsTracker { packageName, PackageManager.GET_META_DATA, userId); packageName, PackageManager.GET_META_DATA, userId); } catch (java.lang.Exception e) { } catch (java.lang.Exception e) { // package is not present for current user // package is not present for current user if (mSatelliteApplications.get(userId).contains(packageName)) { if (mSatelliteApplications.containsKey(userId) && mSatelliteApplications.get(userId).contains(packageName)) { mSatelliteApplications.get(userId).remove(packageName); mSatelliteApplications.get(userId).remove(packageName); } } } } Loading @@ -240,7 +242,6 @@ public class SatelliteOptimizedApplicationsTracker { * Get list of applications that are optimized for low bandwidth satellite data. * Get list of applications that are optimized for low bandwidth satellite data. * * * @param userId is Identifier of user * @param userId is Identifier of user * * @return List of applications package names with data optimized network property. {@link * @return List of applications package names with data optimized network property. {@link * #PROPERTY_SATELLITE_DATA_OPTIMIZED} * #PROPERTY_SATELLITE_DATA_OPTIMIZED} */ */ Loading Loading
src/java/com/android/internal/telephony/satellite/SatelliteOptimizedApplicationsTracker.java +8 −7 Original line number Original line Diff line number Diff line Loading @@ -182,7 +182,7 @@ public class SatelliteOptimizedApplicationsTracker { List<UserInfo> users = mUserManager.getUsers(); List<UserInfo> users = mUserManager.getUsers(); for (UserInfo user : users) { for (UserInfo user : users) { int userId = user.getUserHandle().getIdentifier(); int userId = user.getUserHandle().getIdentifier(); mSatelliteApplications.put(userId, new HashSet<>()); mSatelliteApplications.putIfAbsent(userId, new HashSet<>()); } } // Get a list of installed packages // Get a list of installed packages List<PackageInfo> packages = List<PackageInfo> packages = Loading Loading @@ -213,6 +213,7 @@ public class SatelliteOptimizedApplicationsTracker { try { try { mPackageManager.getPackageUidAsUser( mPackageManager.getPackageUidAsUser( packageName, PackageManager.GET_META_DATA, userId); packageName, PackageManager.GET_META_DATA, userId); mSatelliteApplications.putIfAbsent(userId, new HashSet<>()); mSatelliteApplications.get(userId).add(packageName); mSatelliteApplications.get(userId).add(packageName); } catch (java.lang.Exception e) { } catch (java.lang.Exception e) { // package is not present for current user // package is not present for current user Loading @@ -229,7 +230,8 @@ public class SatelliteOptimizedApplicationsTracker { packageName, PackageManager.GET_META_DATA, userId); packageName, PackageManager.GET_META_DATA, userId); } catch (java.lang.Exception e) { } catch (java.lang.Exception e) { // package is not present for current user // package is not present for current user if (mSatelliteApplications.get(userId).contains(packageName)) { if (mSatelliteApplications.containsKey(userId) && mSatelliteApplications.get(userId).contains(packageName)) { mSatelliteApplications.get(userId).remove(packageName); mSatelliteApplications.get(userId).remove(packageName); } } } } Loading @@ -240,7 +242,6 @@ public class SatelliteOptimizedApplicationsTracker { * Get list of applications that are optimized for low bandwidth satellite data. * Get list of applications that are optimized for low bandwidth satellite data. * * * @param userId is Identifier of user * @param userId is Identifier of user * * @return List of applications package names with data optimized network property. {@link * @return List of applications package names with data optimized network property. {@link * #PROPERTY_SATELLITE_DATA_OPTIMIZED} * #PROPERTY_SATELLITE_DATA_OPTIMIZED} */ */ Loading