summaryrefslogtreecommitdiffstats
path: root/packages/Keyguard/test/SampleTrustAgent/src
diff options
context:
space:
mode:
authorAdrian Roos <roosa@google.com>2014-07-24 16:00:46 +0200
committerAdrian Roos <roosa@google.com>2014-07-24 21:44:02 +0200
commitc5f95cea2639b698594a85acbde6a5519941d7b1 (patch)
treefa123927e9bbc021bf1ac0b39733d826dd675546 /packages/Keyguard/test/SampleTrustAgent/src
parent866cf65cc3c53f67836c9157d5c661adfdbd25e1 (diff)
downloadframeworks_base-c5f95cea2639b698594a85acbde6a5519941d7b1.zip
frameworks_base-c5f95cea2639b698594a85acbde6a5519941d7b1.tar.gz
frameworks_base-c5f95cea2639b698594a85acbde6a5519941d7b1.tar.bz2
Restart trust agents when updated or when they are dead
ActivityManager restarts the trust agent service for us when it gets killed automatically. This does not apply when its process crashes too often or when its package gets updated however. To catch the update case, the trust agent connection is removed as soon as the package disappears, and then readded when the new package appears. To catch the repeated crashing case, the connection is reset if it hasn't successfully connected for several minutes. Also adds a button to SampleTrustAgent to simulate a crash. Bug: 16137258 Change-Id: I1b18fc7a3025e23e25ca1623b6af658d5430a94b
Diffstat (limited to 'packages/Keyguard/test/SampleTrustAgent/src')
-rw-r--r--packages/Keyguard/test/SampleTrustAgent/src/com/android/trustagent/test/SampleTrustAgentSettings.java3
1 files changed, 3 insertions, 0 deletions
diff --git a/packages/Keyguard/test/SampleTrustAgent/src/com/android/trustagent/test/SampleTrustAgentSettings.java b/packages/Keyguard/test/SampleTrustAgent/src/com/android/trustagent/test/SampleTrustAgentSettings.java
index 8e293fb..6b5f78b 100644
--- a/packages/Keyguard/test/SampleTrustAgent/src/com/android/trustagent/test/SampleTrustAgentSettings.java
+++ b/packages/Keyguard/test/SampleTrustAgent/src/com/android/trustagent/test/SampleTrustAgentSettings.java
@@ -37,6 +37,7 @@ public class SampleTrustAgentSettings extends Activity implements View.OnClickLi
findViewById(R.id.enable_trust).setOnClickListener(this);
findViewById(R.id.revoke_trust).setOnClickListener(this);
+ findViewById(R.id.crash).setOnClickListener(this);
mReportUnlockAttempts = (CheckBox) findViewById(R.id.report_unlock_attempts);
mReportUnlockAttempts.setOnCheckedChangeListener(this);
@@ -56,6 +57,8 @@ public class SampleTrustAgentSettings extends Activity implements View.OnClickLi
null /* extra */);
} else if (id == R.id.revoke_trust) {
SampleTrustAgent.sendRevokeTrust(this);
+ } else if (id == R.id.crash) {
+ throw new RuntimeException("crash");
}
}