summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTreehugger Robot <treehugger-gerrit@google.com>2017-03-02 19:43:24 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2017-03-02 19:43:25 +0000
commit09cbe61b526197ddbdbafa826139f584b392ceb9 (patch)
tree3c2b1af79bd6dc7788f98d87cd62222efe02e2ec
parent90aea86f61a8245545a2dd190d1c2f916798e2b1 (diff)
parent653953123539f56902f0a4df431cfd5ca16db560 (diff)
downloadcts-09cbe61b526197ddbdbafa826139f584b392ceb9.tar.gz
Merge "Properly target the LockHoldingService broadcasts."
-rw-r--r--tests/tests/libcorefileio/src/android/cts/LockHoldingService.java10
1 files changed, 8 insertions, 2 deletions
diff --git a/tests/tests/libcorefileio/src/android/cts/LockHoldingService.java b/tests/tests/libcorefileio/src/android/cts/LockHoldingService.java
index 6ac73b0df05..7c0a51dc8d8 100644
--- a/tests/tests/libcorefileio/src/android/cts/LockHoldingService.java
+++ b/tests/tests/libcorefileio/src/android/cts/LockHoldingService.java
@@ -118,7 +118,9 @@ public class LockHoldingService extends Service {
// Acquire the lock based on the information contained in the intent received.
this.fileLock = FileChannelInterProcessLockTest.acquire(lockType);
- Intent responseIntent = new Intent().putExtra(NOTIFICATION_KEY, NOTIFICATION_LOCK_HELD)
+ Intent responseIntent = new Intent()
+ .setPackage("android.libcorefileio.cts")
+ .putExtra(NOTIFICATION_KEY, NOTIFICATION_LOCK_HELD)
.setAction(ACTION_TYPE_FOR_INTENT_COMMUNICATION);
sendBroadcast(responseIntent);
}
@@ -139,6 +141,7 @@ public class LockHoldingService extends Service {
// Signal the lock is now held.
Intent heldIntent = new Intent()
+ .setPackage("android.libcorefileio.cts")
.putExtra(NOTIFICATION_KEY, NOTIFICATION_LOCK_HELD)
.setAction(ACTION_TYPE_FOR_INTENT_COMMUNICATION);
sendBroadcast(heldIntent);
@@ -154,6 +157,7 @@ public class LockHoldingService extends Service {
// Signal the lock is released and some information about timing.
Intent releaseIntent = new Intent()
+ .setPackage("android.libcorefileio.cts")
.putExtra(NOTIFICATION_KEY, NOTIFICATION_LOCK_RELEASED)
.putExtra(LOCK_NOT_YET_RELEASED_TIMESTAMP, lockNotReleasedTimestamp)
.putExtra(LOCK_DEFINITELY_RELEASED_TIMESTAMP, lockReleasedTimestamp)
@@ -170,7 +174,9 @@ public class LockHoldingService extends Service {
} catch (IOException e) {
Log.e(LOG_MESSAGE_TAG, e.getMessage());
}
- Intent intent = new Intent().putExtra(NOTIFICATION_KEY, NOTIFICATION_STOP)
+ Intent intent = new Intent()
+ .setPackage("android.libcorefileio.cts")
+ .putExtra(NOTIFICATION_KEY, NOTIFICATION_STOP)
.setAction(ACTION_TYPE_FOR_INTENT_COMMUNICATION);
sendBroadcast(intent);
}