Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 494ce15e authored by Anthony Stange's avatar Anthony Stange Committed by Automerger Merge Worker
Browse files

Merge "Fix potential null package name" into tm-qpr-dev am: 0e12415b

parents d90a8f72 0e12415b
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -322,6 +322,17 @@ public class ContextHubClientBroker extends IContextHubClient.Stub
        } else {
            mPendingIntentRequest = new PendingIntentRequest(pendingIntent, nanoAppId);
        }

        if (packageName == null) {
            String[] packages = mContext.getPackageManager().getPackagesForUid(
                    Binder.getCallingUid());
            if (packages != null && packages.length > 0) {
                packageName = packages[0];
            }
            Log.e(TAG, "createClient: Provided package name null. Using first package name "
                    + packageName);
        }

        mPackage = packageName;
        mAttributionTag = attributionTag;
        mTransactionManager = transactionManager;