Suppress unlock notifications on non-FBE devices.

We have a longer-term plan to clean up FBE unlock notifications, but
in the meantime don't confuse users by quickly flashing them on
non-FBE devices.

Bug: 28840764
Change-Id: I696508ef981b6f8f51f22ea24487d87d27d5b6e3
This commit is contained in:
Jeff Sharkey
2016-05-26 09:47:43 -06:00
parent 4815ed4500
commit 4a39936d36

View File

@@ -49,6 +49,7 @@ import android.os.IProgressListener;
import android.os.Parcel;
import android.os.RemoteException;
import android.os.storage.IMountService;
import android.os.storage.StorageManager;
import android.os.ServiceManager;
import android.os.SystemProperties;
import android.os.UserHandle;
@@ -341,6 +342,10 @@ public class LockSettingsService extends ILockSettings.Stub {
private void showEncryptionNotification(UserHandle user, CharSequence title, CharSequence message,
CharSequence detail, PendingIntent intent) {
if (DEBUG) Slog.v(TAG, "showing encryption notification, user: " + user.getIdentifier());
// Suppress all notifications on non-FBE devices for now
if (!StorageManager.isFileEncryptedNativeOrEmulated()) return;
Notification notification = new Notification.Builder(mContext)
.setSmallIcon(com.android.internal.R.drawable.ic_user_secure)
.setWhen(0)