)]}'
{
  "commit": "2d87f453d94b1bc065a42217eecaa84ca8c9a14c",
  "tree": "c65fb4de901d26f9285d3e2e2ac4fa33c3bccfcd",
  "parents": [
    "9a64ba2602677e1ec3e0edc94e754d393983362e"
  ],
  "author": {
    "name": "Bernardo Rufino",
    "email": "brufino@google.com",
    "time": "Fri Jun 22 11:47:49 2018 +0100"
  },
  "committer": {
    "name": "Bernardo Rufino",
    "email": "brufino@google.com",
    "time": "Mon Jul 30 17:04:02 2018 +0100"
  },
  "message": "[KV] State machine to linear task w/ RemoteCall\n\nThis is the first CL of key-value backup refactor.\n\n* Method execute() that executed the state machine states is now empty\n  and run() is created with the initial version of the linear task. It\u0027s\n  basically composed of begin + loop + end. Although it still has the notion\n  of state, it\u0027s more restricted than before (with private methods returning\n  the next state). This is intentional to avoid making this CL too heavy to\n  review and to avoid too much behavioral changes here. In the next CLs I\n  intend to remove BackupState.\n\n* Introduction of RemoteCall, which encapsulates an outbound call that\n  leaves the system_server, with time-out and cancellation built-in.\n  Agent calls are now triggered using this. As a result there is no more\n  operationComplete() method either.\n\n* Cancellation now is cleaner. We don\u0027t need a step lock anymore, only a\n  (volatile) boolean that is checked in every queue iteration. If asked\n  to cancel during an ongoing agent call we rely on RemoteCall.cancel()\n  to return control of the task thread to us. We wait for the cancel\n  acknowledgement to preserve the contract of no more transport calls.\n\n* PFTBT instantiation moved from the constructor to the run() method,\n  which makes more sense.\n\n* No need for mFinished, mBackupData \u003d\u003d null bookkeeping since time-outs,\n  cancellation and legitimate agent responses won\u0027t step into one another\n  anymore.\n\n* Ternary (mQueue.isEmpty) ? BackupState.FINAL : BackupState.RUNNING_QUEUE gone\n  because we check this in the beginning of invokeNextAgent() and now we\n  don\u0027t pay the state-machine tick price associated with the handler.\n\n* PerformBackupTask call sites now call static method start(), that\n  spins up a new dedicated thread for the task. This new thread is\n  assigned the same (process) priority as the backup thread\n  (THREAD_PRIORITY_BACKGROUND).\n\nWork left for future CLs:\n\n* RemoteCall spins up a new thread for kicking off the call, this is for\n  system agents that are executed inline. Old PBT also executed in the same\n  thread (backup handler thread), so maintaining this to keep this CL at\n  a reasonable size.\n\nTest: atest PerformBackupTaskTest\nTest: atest RunFrameworksServicesRoboTests\nTest: atest frameworks/base/services/tests/servicestests/src/com/android/server/backup\nTest: atest CtsBackupTestCases\nTest: atest CtsBackupHostTestCases\nTest: atest GtsBackupTestCases\nTest: atest GtsBackupHostTestCases\nTest: adb shell bmgr backupnow \u003ckv_packages\u003e\nTest: 1. adb shell bmgr backup \u003cp1\u003e \u003cp2\u003e\n      2. adb shell bmgr run\n      A) 3. Cancel while sending \u003cp1\u003e data to transport\n         4. Verify \u003cp1\u003e is backed-up and not pending\n\t    Verify \u003cp2\u003e is not backed-up and is pending\n      B) 3. Cancel while waiting for \u003cp1\u003e agent\n         4. Verify \u003cp1\u003e is not backed-up and is pending\n\t    Verify \u003cp2\u003e is not backed-up and is pending\n\nChange-Id: Ia456c4e807de95d662c9e923245be07e8996f58a\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "1f82b01fa6ad3c7a21537b00714b726743364797",
      "old_mode": 33188,
      "old_path": "Android.bp",
      "new_id": "9d852677a9c52431f0bf1d68375c713b1c5bfe92",
      "new_mode": 33188,
      "new_path": "Android.bp"
    },
    {
      "type": "modify",
      "old_id": "3aeef148b4e7f9ed81f3c7d8098d478b6fc6ae2d",
      "old_mode": 33188,
      "old_path": "core/java/android/app/IBackupAgent.aidl",
      "new_id": "4517446c3068f5ead4fb9db4781f8a3a66379407",
      "new_mode": 33188,
      "new_path": "core/java/android/app/IBackupAgent.aidl"
    },
    {
      "type": "modify",
      "old_id": "ec2cf0cf0daee0bee980d2b0f61948ba8824b616",
      "old_mode": 33188,
      "old_path": "core/java/android/app/backup/BackupAgent.java",
      "new_id": "097dd9c00aca11fbdbb3792321365713502cce8d",
      "new_mode": 33188,
      "new_path": "core/java/android/app/backup/BackupAgent.java"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "9582a58fa594b0fab3015d19f9e6728a1551edb8",
      "new_mode": 33188,
      "new_path": "core/java/android/app/backup/IBackupCallback.aidl"
    },
    {
      "type": "modify",
      "old_id": "ae2a36bdc12eb398777548d1693da4e969495ed6",
      "old_mode": 33188,
      "old_path": "services/backup/java/com/android/server/backup/KeyValueAdbBackupEngine.java",
      "new_id": "30ec8ab711b65443c52c2bbf17124610acbb503e",
      "new_mode": 33188,
      "new_path": "services/backup/java/com/android/server/backup/KeyValueAdbBackupEngine.java"
    },
    {
      "type": "modify",
      "old_id": "69f08ae49a2edc1c0f66a72d7d4823bc5cfd45dc",
      "old_mode": 33188,
      "old_path": "services/backup/java/com/android/server/backup/internal/BackupHandler.java",
      "new_id": "66b6b37b8b4f2a2ca7e6e8e6b6d0f1b9e214438c",
      "new_mode": 33188,
      "new_path": "services/backup/java/com/android/server/backup/internal/BackupHandler.java"
    },
    {
      "type": "modify",
      "old_id": "937b16768c5aea865e8269c2a545f07bc8e58094",
      "old_mode": 33188,
      "old_path": "services/backup/java/com/android/server/backup/internal/BackupState.java",
      "new_id": "320b55525ea4dc8c4858ea6669d669185a953a3f",
      "new_mode": 33188,
      "new_path": "services/backup/java/com/android/server/backup/internal/BackupState.java"
    },
    {
      "type": "modify",
      "old_id": "551b80f72e70d28a22f92bde336165b11c2d75d5",
      "old_mode": 33188,
      "old_path": "services/backup/java/com/android/server/backup/internal/PerformBackupTask.java",
      "new_id": "c5df82ed2e79e66abf141e0f66eabef2cc377dba",
      "new_mode": 33188,
      "new_path": "services/backup/java/com/android/server/backup/internal/PerformBackupTask.java"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "1445cc3065b8a2dcb30872d3522e21a8d3aa88e2",
      "new_mode": 33188,
      "new_path": "services/backup/java/com/android/server/backup/remote/FutureBackupCallback.java"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "ac848113f08ff1dc3a566af74b513299c0eb202d",
      "new_mode": 33188,
      "new_path": "services/backup/java/com/android/server/backup/remote/RemoteCall.java"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "d2671ff83604ddbd34955b1acfe9205f91f5d165",
      "new_mode": 33188,
      "new_path": "services/backup/java/com/android/server/backup/remote/RemoteCallable.java"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "7f4f4696395e09c1ce28605b75039b1052ef3936",
      "new_mode": 33188,
      "new_path": "services/backup/java/com/android/server/backup/remote/RemoteResult.java"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "28d85a694d4b94bdcc5108dea1e7d742d3e09cb9",
      "new_mode": 33188,
      "new_path": "services/backup/java/com/android/server/backup/remote/ServiceBackupCallback.java"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "dd0a58d5e98e3989a536e288f68fb5d6217e791d",
      "new_mode": 33188,
      "new_path": "services/robotests/src/com/android/server/backup/KeyValueBackupJobTest.java"
    },
    {
      "type": "modify",
      "old_id": "8fab19793914db1704f64042e7b03b9b453894aa",
      "old_mode": 33188,
      "old_path": "services/robotests/src/com/android/server/backup/PerformBackupTaskTest.java",
      "new_id": "1f6ac8d00ba108e62faf5c47009818f0e3fe6b82",
      "new_mode": 33188,
      "new_path": "services/robotests/src/com/android/server/backup/PerformBackupTaskTest.java"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "aec207d2fea65544254cb8567bd4c1e96427c0db",
      "new_mode": 33188,
      "new_path": "services/robotests/src/com/android/server/backup/remote/FutureBackupCallbackTest.java"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "55db6160481ad5ad2e04178f080103a9738bef36",
      "new_mode": 33188,
      "new_path": "services/robotests/src/com/android/server/backup/remote/RemoteCallTest.java"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "f1c4f27bc38e8f35baaafbf9d2125c827ae54395",
      "new_mode": 33188,
      "new_path": "services/robotests/src/com/android/server/backup/remote/RemoteResultTest.java"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "e0d3c0c09eb8b00f088cd5a29ecfd1ffcec102bc",
      "new_mode": 33188,
      "new_path": "services/robotests/src/com/android/server/backup/remote/ServiceBackupCallbackTest.java"
    },
    {
      "type": "modify",
      "old_id": "23d4ba494396aecca8fa1f907c1ff1e91b20fed0",
      "old_mode": 33188,
      "old_path": "services/robotests/src/com/android/server/backup/testing/BackupManagerServiceTestUtils.java",
      "new_id": "084f27f94fbf8fd0b8a4ea7b904d9e6015ce79d6",
      "new_mode": 33188,
      "new_path": "services/robotests/src/com/android/server/backup/testing/BackupManagerServiceTestUtils.java"
    },
    {
      "type": "modify",
      "old_id": "b657dd0186bf52f3e68f4bf4ac66628b3f0cd653",
      "old_mode": 33188,
      "old_path": "services/robotests/src/com/android/server/backup/testing/TestUtils.java",
      "new_id": "134cfd8e16adcf650a6bb80664bd371c1944eab7",
      "new_mode": 33188,
      "new_path": "services/robotests/src/com/android/server/backup/testing/TestUtils.java"
    }
  ]
}
