Loading services/core/java/com/android/server/location/contexthub/ContextHubClientBroker.java +13 −5 Original line number Diff line number Diff line Loading @@ -209,6 +209,12 @@ public class ContextHubClientBroker extends IContextHubClient.Stub */ private AtomicBoolean mIsPendingIntentCancelled = new AtomicBoolean(false); /** * True if a permissions query has been issued and is being processed. Used to prevent too many * queries from being issued by a single client at once. */ private AtomicBoolean mIsPermQueryIssued = new AtomicBoolean(false); /* * True if the application creating the client has the ACCESS_CONTEXT_HUB permission. */ Loading Loading @@ -240,11 +246,11 @@ public class ContextHubClientBroker extends IContextHubClient.Stub private final IContextHubTransactionCallback mQueryPermsCallback = new IContextHubTransactionCallback.Stub() { @Override public void onTransactionComplete(int result) { } public void onTransactionComplete(int result) {} @Override public void onQueryResponse(int result, List<NanoAppState> nanoAppStateList) { mIsPermQueryIssued.set(false); if (result != ContextHubTransaction.RESULT_SUCCESS && nanoAppStateList != null) { Log.e(TAG, "Permissions query failed, but still received nanoapp state"); } else if (nanoAppStateList != null) { Loading Loading @@ -656,10 +662,12 @@ public class ContextHubClientBroker extends IContextHubClient.Stub * communicated with in the past. */ private void checkNanoappPermsAsync() { if (!mIsPermQueryIssued.getAndSet(true)) { ContextHubServiceTransaction transaction = mTransactionManager.createQueryTransaction( mAttachedContextHubInfo.getId(), mQueryPermsCallback, mPackage); mTransactionManager.addTransaction(transaction); } } private int updateNanoAppAuthState( long nanoAppId, List<String> nanoappPermissions, boolean gracePeriodExpired) { Loading Loading
services/core/java/com/android/server/location/contexthub/ContextHubClientBroker.java +13 −5 Original line number Diff line number Diff line Loading @@ -209,6 +209,12 @@ public class ContextHubClientBroker extends IContextHubClient.Stub */ private AtomicBoolean mIsPendingIntentCancelled = new AtomicBoolean(false); /** * True if a permissions query has been issued and is being processed. Used to prevent too many * queries from being issued by a single client at once. */ private AtomicBoolean mIsPermQueryIssued = new AtomicBoolean(false); /* * True if the application creating the client has the ACCESS_CONTEXT_HUB permission. */ Loading Loading @@ -240,11 +246,11 @@ public class ContextHubClientBroker extends IContextHubClient.Stub private final IContextHubTransactionCallback mQueryPermsCallback = new IContextHubTransactionCallback.Stub() { @Override public void onTransactionComplete(int result) { } public void onTransactionComplete(int result) {} @Override public void onQueryResponse(int result, List<NanoAppState> nanoAppStateList) { mIsPermQueryIssued.set(false); if (result != ContextHubTransaction.RESULT_SUCCESS && nanoAppStateList != null) { Log.e(TAG, "Permissions query failed, but still received nanoapp state"); } else if (nanoAppStateList != null) { Loading Loading @@ -656,10 +662,12 @@ public class ContextHubClientBroker extends IContextHubClient.Stub * communicated with in the past. */ private void checkNanoappPermsAsync() { if (!mIsPermQueryIssued.getAndSet(true)) { ContextHubServiceTransaction transaction = mTransactionManager.createQueryTransaction( mAttachedContextHubInfo.getId(), mQueryPermsCallback, mPackage); mTransactionManager.addTransaction(transaction); } } private int updateNanoAppAuthState( long nanoAppId, List<String> nanoappPermissions, boolean gracePeriodExpired) { Loading