summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrandon Maxwell <maxwelb@google.com>2016-03-04 17:33:59 -0800
committerBrandon Maxwell <maxwelb@google.com>2016-03-10 11:58:22 -0800
commit3cb83e0eb5db07ce4c3feba9a19b8f9f674d357a (patch)
tree2873cd51873a0d9639c2caabc47c8d1362821b8e
parent5d635baea2d0510c5edc9df26681d802bc91c443 (diff)
Fixing missed call notifications for FBE
+ Our new components for creating missed call notifications are not marked as encryption aware so Telecom was always creating the missed call notification. + This CL marks the appropriate components as encryption aware so Telecom can check to see if we support putting up the notification. + Updated logic so missed call notifications only have 'callback' and 'message' actions when not locked. + Misc FBE cleanup + Since the call log is not available when on the File based encryption lock screen, dismissed notifications will not attempt to mark the calls as read; attempting do so causes exceptions. + Updated AOSP Dialer to ensure that we don't store data in device encrypted storage by default. This storage location is always available, regardless of whether we're in the FBE locked state or not. None of our preferences/databases need to be available in this state, so this change causes the Dialer to store data in credential encrypted storage by default. This storage location is only available when the device is unlocked. + Updated AOSP Dialer so it doesn't use device encrypted storage by default. This is because we currently don't want any of the preferences/databases stored by the Dialer to be available when FBE locked. + Updated AOSP Dialer so specific components must mark themselves as encryption aware, rather than having everything aware because the application is marked as such. Bug: 27455726 Change-Id: Ib5d28267116ec007bf9beb57862796235460ddf5
-rw-r--r--AndroidManifest.xml18
-rw-r--r--src/com/android/dialer/calllog/MissedCallNotifier.java38
2 files changed, 31 insertions, 25 deletions
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 06f579515..50cd24a5d 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -68,8 +68,7 @@
android:supportsRtl="true"
android:backupAgent='com.android.dialer.DialerBackupAgent'
android:usesCleartextTraffic="false"
- android:forceDeviceEncrypted="true"
- android:encryptionAware="true">
+ android:forceDeviceEncrypted="false">
<meta-data android:name="com.google.android.backup.api_key"
android:value="AEdPqrEAAAAIBXgtCEKQ6W0PXVnW-ZVia2KmlV2AxsTw3GjAeQ" />
@@ -85,6 +84,7 @@
android:icon="@mipmap/ic_launcher_phone"
android:windowSoftInputMode="stateAlwaysHidden|adjustNothing"
android:resizeableActivity="true"
+ android:encryptionAware="true"
>
<intent-filter>
<action android:name="android.intent.action.DIAL" />
@@ -280,10 +280,12 @@
<service
android:name=".calllog.CallLogNotificationsService"
+ android:encryptionAware="true"
android:exported="false"
/>
- <receiver android:name=".calllog.MissedCallNotificationReceiver">
+ <receiver android:name=".calllog.MissedCallNotificationReceiver"
+ android:encryptionAware="true">
<intent-filter>
<action android:name="android.telecom.action.SHOW_MISSED_CALLS_NOTIFICATION" />
</intent-filter>
@@ -317,11 +319,6 @@
android:resizeableActivity="true">
</activity>
- <!-- BroadcastReceiver for receiving Intents from Notification mechanism. -->
- <receiver android:name="com.android.incallui.NotificationBroadcastReceiver"
- android:encryptionAware="true"
- android:exported="false" />
-
<service android:name="com.android.incallui.InCallServiceImpl"
android:permission="android.permission.BIND_INCALL_SERVICE"
android:encryptionAware="true" >
@@ -333,6 +330,11 @@
</intent-filter>
</service>
+ <!-- BroadcastReceiver for receiving Intents from Notification mechanism. -->
+ <receiver android:name="com.android.incallui.NotificationBroadcastReceiver"
+ android:encryptionAware="true"
+ android:exported="false" />
+
<provider
android:name=".database.FilteredNumberProvider"
android:authorities="com.android.dialer.database.filterednumberprovider"
diff --git a/src/com/android/dialer/calllog/MissedCallNotifier.java b/src/com/android/dialer/calllog/MissedCallNotifier.java
index c422dd58d..98d02d095 100644
--- a/src/com/android/dialer/calllog/MissedCallNotifier.java
+++ b/src/com/android/dialer/calllog/MissedCallNotifier.java
@@ -33,6 +33,7 @@ import com.android.dialer.DialtactsActivity;
import com.android.dialer.R;
import com.android.dialer.calllog.CallLogNotificationsHelper.NewCall;
import com.android.dialer.contactinfo.ContactPhotoLoader;
+import com.android.dialer.compat.UserManagerCompat;
import com.android.dialer.list.ListsFragment;
import com.android.dialer.util.DialerUtils;
import com.android.dialer.util.IntentUtil;
@@ -153,8 +154,8 @@ public class MissedCallNotifier {
// sensitive notification information.
.setPublicVersion(publicBuilder.build());
- // Add additional actions when there is only 1 missed call, like call-back and SMS.
- if (count == 1) {
+ // Add additional actions when there is only 1 missed call and the user isn't locked
+ if (UserManagerCompat.isUserUnlocked(mContext) && count == 1) {
if (!TextUtils.isEmpty(number)
&& !TextUtils.equals(
number, mContext.getString(R.string.handle_restricted))) {
@@ -181,21 +182,24 @@ public class MissedCallNotifier {
AsyncTask.execute(new Runnable() {
@Override
public void run() {
- // Clear the list of new missed calls from the call log.
- ContentValues values = new ContentValues();
- values.put(Calls.NEW, 0);
- values.put(Calls.IS_READ, 1);
- StringBuilder where = new StringBuilder();
- where.append(Calls.NEW);
- where.append(" = 1 AND ");
- where.append(Calls.TYPE);
- where.append(" = ?");
- try {
- mContext.getContentResolver().update(Calls.CONTENT_URI, values,
- where.toString(), new String[]{ Integer.toString(Calls.
- MISSED_TYPE) });
- } catch (IllegalArgumentException e) {
- Log.w(TAG, "ContactsProvider update command failed", e);
+ // Call log is only accessible when unlocked. If that's the case, clear the list of
+ // new missed calls from the call log.
+ if (UserManagerCompat.isUserUnlocked(mContext)) {
+ ContentValues values = new ContentValues();
+ values.put(Calls.NEW, 0);
+ values.put(Calls.IS_READ, 1);
+ StringBuilder where = new StringBuilder();
+ where.append(Calls.NEW);
+ where.append(" = 1 AND ");
+ where.append(Calls.TYPE);
+ where.append(" = ?");
+ try {
+ mContext.getContentResolver().update(Calls.CONTENT_URI, values,
+ where.toString(), new String[]{Integer.toString(Calls.
+ MISSED_TYPE)});
+ } catch (IllegalArgumentException e) {
+ Log.w(TAG, "ContactsProvider update command failed", e);
+ }
}
getNotificationMgr().cancel(NOTIFICATION_TAG, NOTIFICATION_ID);
}