1414 * You should have received a copy of the GNU General Public License
1515 * along with PCAPdroid. If not, see <http://www.gnu.org/licenses/>.
1616 *
17- * Copyright 2020-21 - Emanuele Faranda
17+ * Copyright 2020-26 - Emanuele Faranda
1818 */
1919
2020package com .emanuelef .remote_capture ;
2626import android .graphics .drawable .Drawable ;
2727import android .util .ArrayMap ;
2828import android .util .SparseArray ;
29+ import android .util .SparseBooleanArray ;
2930
3031import com .emanuelef .remote_capture .interfaces .DrawableLoader ;
3132import com .emanuelef .remote_capture .model .AppDescriptor ;
@@ -41,6 +42,7 @@ public class AppsResolver {
4142 private static final SparseArray <AppDescriptor > mMappedUids = new SparseArray <>();
4243 private static final ArrayMap <String , AppDescriptor > mMappedPackages = new ArrayMap <>();
4344 private final SparseArray <AppDescriptor > mApps ;
45+ private final SparseBooleanArray mUnresolvedUids = new SparseBooleanArray ();
4446 private final PackageManager mPm ;
4547 private final Context mContext ;
4648 private Method getPackageInfoAsUser ;
@@ -161,7 +163,11 @@ public static AppDescriptor resolveInstalledApp(PackageManager pm, String packag
161163 }
162164
163165 if ((packages == null ) || (packages .length < 1 )) {
164- Log .w (TAG , "could not retrieve package: uid=" + uid );
166+ if (!mUnresolvedUids .get (uid )) {
167+ Log .w (TAG , "could not retrieve package: uid=" + uid );
168+ mUnresolvedUids .put (uid , true );
169+ }
170+
165171 return null ;
166172 }
167173
@@ -239,6 +245,7 @@ public int getUid(String package_name) {
239245
240246 public void clear () {
241247 mApps .clear ();
248+ mUnresolvedUids .clear ();
242249 initVirtualApps ();
243250 }
244251}
0 commit comments