Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ecb53b39 authored by Steve Kondik's avatar Steve Kondik Committed by Gerrit Code Review
Browse files

Merge "Avoid fetching the ADB notify setting twice." into gingerbread

parents 73726920 00ae10dc
Loading
Loading
Loading
Loading
+8 −8
Original line number Diff line number Diff line
@@ -587,9 +587,8 @@ public class NotificationManagerService extends INotificationManager.Stub
            ContentResolver resolver = mContext.getContentResolver();
            boolean adbEnabled = Settings.Secure.getInt(resolver,
                    Settings.Secure.ADB_ENABLED, 0) != 0;
            boolean notifyEnabled = Settings.Secure.getInt(resolver,
                    Settings.Secure.ADB_NOTIFY, 1) != 0;
            updateAdbNotification(adbEnabled && notifyEnabled && mUsbConnected);
            /* notify setting is checked inside updateAdbNotification() */
            updateAdbNotification(adbEnabled && mUsbConnected);
        }
    }

@@ -1678,12 +1677,13 @@ public class NotificationManagerService extends INotificationManager.Stub
    // security feature that we don't want people customizing the platform
    // to accidentally lose.
    private void updateAdbNotification(boolean adbEnabled) {
        if (adbEnabled) {
        if ("0".equals(SystemProperties.get("persist.adb.notify")) ||
                        Settings.Secure.getInt(mContext.getContentResolver(),
                        Settings.Secure.ADB_NOTIFY, 1) == 0) {
                return;
            adbEnabled = false;
        }

        if (adbEnabled) {
            if (!mAdbNotificationShown) {
                NotificationManager notificationManager = (NotificationManager) mContext
                        .getSystemService(Context.NOTIFICATION_SERVICE);