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

Commit 648a0fe7 authored by Alex Salo's avatar Alex Salo Committed by Android (Google) Code Review
Browse files

Merge "Use explicit BOUND_FOREGROUND_SERVICE flag to bind"

parents 205ed15d 2b62927d
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -16,6 +16,9 @@

package com.android.server.attention;

import static android.content.Context.BIND_AUTO_CREATE;
import static android.content.Context.BIND_FOREGROUND_SERVICE;
import static android.content.Context.BIND_INCLUDE_CAPABILITIES;
import static android.provider.DeviceConfig.NAMESPACE_ATTENTION_MANAGER_SERVICE;
import static android.service.attention.AttentionService.ATTENTION_FAILURE_CANCELLED;
import static android.service.attention.AttentionService.ATTENTION_FAILURE_UNKNOWN;
@@ -498,7 +501,6 @@ public class AttentionManagerService extends SystemService {
        }
    }


    private class AttentionServiceConnection implements ServiceConnection {
        @Override
        public void onServiceConnected(ComponentName name, IBinder service) {
@@ -642,7 +644,8 @@ public class AttentionManagerService extends SystemService {
                    mComponentName);
            // Note: no reason to clear the calling identity, we won't have one in a handler.
            mContext.bindServiceAsUser(serviceIntent, mConnection,
                    Context.BIND_AUTO_CREATE, UserHandle.CURRENT);
                    BIND_AUTO_CREATE | BIND_FOREGROUND_SERVICE | BIND_INCLUDE_CAPABILITIES,
                    UserHandle.CURRENT);

        });
    }