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

Commit 05864160 authored by Christopher Tate's avatar Christopher Tate Committed by android-build-merger
Browse files

Merge "Turn down the preliminary foreground service API" into oc-dev am: 00ed0bac

am: 663de998

Change-Id: I1c70471deaa3991945d2950d1c6e0f5bc90805b4
parents 7a066985 663de998
Loading
Loading
Loading
Loading
+0 −2
Original line number Original line Diff line number Diff line
@@ -5604,7 +5604,6 @@ package android.app {
    method public boolean removeAutomaticZenRule(java.lang.String);
    method public boolean removeAutomaticZenRule(java.lang.String);
    method public final void setInterruptionFilter(int);
    method public final void setInterruptionFilter(int);
    method public void setNotificationPolicy(android.app.NotificationManager.Policy);
    method public void setNotificationPolicy(android.app.NotificationManager.Policy);
    method public deprecated android.content.ComponentName startServiceInForeground(android.content.Intent, int, android.app.Notification);
    method public boolean updateAutomaticZenRule(java.lang.String, android.app.AutomaticZenRule);
    method public boolean updateAutomaticZenRule(java.lang.String, android.app.AutomaticZenRule);
    field public static final java.lang.String ACTION_INTERRUPTION_FILTER_CHANGED = "android.app.action.INTERRUPTION_FILTER_CHANGED";
    field public static final java.lang.String ACTION_INTERRUPTION_FILTER_CHANGED = "android.app.action.INTERRUPTION_FILTER_CHANGED";
    field public static final java.lang.String ACTION_NOTIFICATION_POLICY_ACCESS_GRANTED_CHANGED = "android.app.action.NOTIFICATION_POLICY_ACCESS_GRANTED_CHANGED";
    field public static final java.lang.String ACTION_NOTIFICATION_POLICY_ACCESS_GRANTED_CHANGED = "android.app.action.NOTIFICATION_POLICY_ACCESS_GRANTED_CHANGED";
@@ -40910,7 +40909,6 @@ package android.test.mock {
    method public void startIntentSender(android.content.IntentSender, android.content.Intent, int, int, int) throws android.content.IntentSender.SendIntentException;
    method public void startIntentSender(android.content.IntentSender, android.content.Intent, int, int, int) throws android.content.IntentSender.SendIntentException;
    method public void startIntentSender(android.content.IntentSender, android.content.Intent, int, int, int, android.os.Bundle) throws android.content.IntentSender.SendIntentException;
    method public void startIntentSender(android.content.IntentSender, android.content.Intent, int, int, int, android.os.Bundle) throws android.content.IntentSender.SendIntentException;
    method public android.content.ComponentName startService(android.content.Intent);
    method public android.content.ComponentName startService(android.content.Intent);
    method public android.content.ComponentName startServiceInForeground(android.content.Intent, int, android.app.Notification);
    method public boolean stopService(android.content.Intent);
    method public boolean stopService(android.content.Intent);
    method public void unbindService(android.content.ServiceConnection);
    method public void unbindService(android.content.ServiceConnection);
    method public void unregisterReceiver(android.content.BroadcastReceiver);
    method public void unregisterReceiver(android.content.BroadcastReceiver);
+0 −2
Original line number Original line Diff line number Diff line
@@ -5806,7 +5806,6 @@ package android.app {
    method public boolean removeAutomaticZenRule(java.lang.String);
    method public boolean removeAutomaticZenRule(java.lang.String);
    method public final void setInterruptionFilter(int);
    method public final void setInterruptionFilter(int);
    method public void setNotificationPolicy(android.app.NotificationManager.Policy);
    method public void setNotificationPolicy(android.app.NotificationManager.Policy);
    method public deprecated android.content.ComponentName startServiceInForeground(android.content.Intent, int, android.app.Notification);
    method public boolean updateAutomaticZenRule(java.lang.String, android.app.AutomaticZenRule);
    method public boolean updateAutomaticZenRule(java.lang.String, android.app.AutomaticZenRule);
    field public static final java.lang.String ACTION_INTERRUPTION_FILTER_CHANGED = "android.app.action.INTERRUPTION_FILTER_CHANGED";
    field public static final java.lang.String ACTION_INTERRUPTION_FILTER_CHANGED = "android.app.action.INTERRUPTION_FILTER_CHANGED";
    field public static final java.lang.String ACTION_NOTIFICATION_POLICY_ACCESS_GRANTED_CHANGED = "android.app.action.NOTIFICATION_POLICY_ACCESS_GRANTED_CHANGED";
    field public static final java.lang.String ACTION_NOTIFICATION_POLICY_ACCESS_GRANTED_CHANGED = "android.app.action.NOTIFICATION_POLICY_ACCESS_GRANTED_CHANGED";
@@ -44466,7 +44465,6 @@ package android.test.mock {
    method public void startIntentSender(android.content.IntentSender, android.content.Intent, int, int, int) throws android.content.IntentSender.SendIntentException;
    method public void startIntentSender(android.content.IntentSender, android.content.Intent, int, int, int) throws android.content.IntentSender.SendIntentException;
    method public void startIntentSender(android.content.IntentSender, android.content.Intent, int, int, int, android.os.Bundle) throws android.content.IntentSender.SendIntentException;
    method public void startIntentSender(android.content.IntentSender, android.content.Intent, int, int, int, android.os.Bundle) throws android.content.IntentSender.SendIntentException;
    method public android.content.ComponentName startService(android.content.Intent);
    method public android.content.ComponentName startService(android.content.Intent);
    method public android.content.ComponentName startServiceInForeground(android.content.Intent, int, android.app.Notification);
    method public boolean stopService(android.content.Intent);
    method public boolean stopService(android.content.Intent);
    method public void unbindService(android.content.ServiceConnection);
    method public void unbindService(android.content.ServiceConnection);
    method public void unregisterReceiver(android.content.BroadcastReceiver);
    method public void unregisterReceiver(android.content.BroadcastReceiver);
+0 −2
Original line number Original line Diff line number Diff line
@@ -5618,7 +5618,6 @@ package android.app {
    method public boolean removeAutomaticZenRule(java.lang.String);
    method public boolean removeAutomaticZenRule(java.lang.String);
    method public final void setInterruptionFilter(int);
    method public final void setInterruptionFilter(int);
    method public void setNotificationPolicy(android.app.NotificationManager.Policy);
    method public void setNotificationPolicy(android.app.NotificationManager.Policy);
    method public deprecated android.content.ComponentName startServiceInForeground(android.content.Intent, int, android.app.Notification);
    method public boolean updateAutomaticZenRule(java.lang.String, android.app.AutomaticZenRule);
    method public boolean updateAutomaticZenRule(java.lang.String, android.app.AutomaticZenRule);
    field public static final java.lang.String ACTION_INTERRUPTION_FILTER_CHANGED = "android.app.action.INTERRUPTION_FILTER_CHANGED";
    field public static final java.lang.String ACTION_INTERRUPTION_FILTER_CHANGED = "android.app.action.INTERRUPTION_FILTER_CHANGED";
    field public static final java.lang.String ACTION_NOTIFICATION_POLICY_ACCESS_GRANTED_CHANGED = "android.app.action.NOTIFICATION_POLICY_ACCESS_GRANTED_CHANGED";
    field public static final java.lang.String ACTION_NOTIFICATION_POLICY_ACCESS_GRANTED_CHANGED = "android.app.action.NOTIFICATION_POLICY_ACCESS_GRANTED_CHANGED";
@@ -41121,7 +41120,6 @@ package android.test.mock {
    method public void startIntentSender(android.content.IntentSender, android.content.Intent, int, int, int) throws android.content.IntentSender.SendIntentException;
    method public void startIntentSender(android.content.IntentSender, android.content.Intent, int, int, int) throws android.content.IntentSender.SendIntentException;
    method public void startIntentSender(android.content.IntentSender, android.content.Intent, int, int, int, android.os.Bundle) throws android.content.IntentSender.SendIntentException;
    method public void startIntentSender(android.content.IntentSender, android.content.Intent, int, int, int, android.os.Bundle) throws android.content.IntentSender.SendIntentException;
    method public android.content.ComponentName startService(android.content.Intent);
    method public android.content.ComponentName startService(android.content.Intent);
    method public android.content.ComponentName startServiceInForeground(android.content.Intent, int, android.app.Notification);
    method public boolean stopService(android.content.Intent);
    method public boolean stopService(android.content.Intent);
    method public void unbindService(android.content.ServiceConnection);
    method public void unbindService(android.content.ServiceConnection);
    method public void unregisterReceiver(android.content.BroadcastReceiver);
    method public void unregisterReceiver(android.content.BroadcastReceiver);
+7 −22
Original line number Original line Diff line number Diff line
@@ -1446,21 +1446,13 @@ class ContextImpl extends Context {
    @Override
    @Override
    public ComponentName startService(Intent service) {
    public ComponentName startService(Intent service) {
        warnIfCallingFromSystemProcess();
        warnIfCallingFromSystemProcess();
        return startServiceCommon(service, -1, null, false, mUser);
        return startServiceCommon(service, false, mUser);
    }
    }


    @Override
    @Override
    public ComponentName startForegroundService(Intent service) {
    public ComponentName startForegroundService(Intent service) {
        warnIfCallingFromSystemProcess();
        warnIfCallingFromSystemProcess();
        return startServiceCommon(service, -1, null, true, mUser);
        return startServiceCommon(service, true, mUser);
    }

    // STOPSHIP: remove when NotificationManager.startServiceInForeground() is retired
    @Override
    public ComponentName startServiceInForeground(Intent service,
            int id, Notification notification) {
        warnIfCallingFromSystemProcess();
        return startServiceCommon(service, id, notification, false, mUser);
    }
    }


    @Override
    @Override
@@ -1471,29 +1463,22 @@ class ContextImpl extends Context {


    @Override
    @Override
    public ComponentName startServiceAsUser(Intent service, UserHandle user) {
    public ComponentName startServiceAsUser(Intent service, UserHandle user) {
        return startServiceCommon(service, -1, null, false, user);
        return startServiceCommon(service, false, user);
    }
    }


    @Override
    @Override
    public ComponentName startForegroundServiceAsUser(Intent service, UserHandle user) {
    public ComponentName startForegroundServiceAsUser(Intent service, UserHandle user) {
        return startServiceCommon(service, -1, null, true, user);
        return startServiceCommon(service, true, user);
    }
    }


    // STOPSHIP: remove when NotificationManager.startServiceInForeground() is retired
    private ComponentName startServiceCommon(Intent service, boolean requireForeground,
    @Override
            UserHandle user) {
    public ComponentName startServiceInForegroundAsUser(Intent service,
            int id, Notification notification, UserHandle user) {
        return startServiceCommon(service, id, notification, false, user);
    }

    private ComponentName startServiceCommon(Intent service, int id, Notification notification,
            boolean requireForeground, UserHandle user) {
        try {
        try {
            validateServiceIntent(service);
            validateServiceIntent(service);
            service.prepareToLeaveProcess(this);
            service.prepareToLeaveProcess(this);
            ComponentName cn = ActivityManager.getService().startService(
            ComponentName cn = ActivityManager.getService().startService(
                mMainThread.getApplicationThread(), service, service.resolveTypeIfNeeded(
                mMainThread.getApplicationThread(), service, service.resolveTypeIfNeeded(
                            getContentResolver()), id, notification, requireForeground,
                            getContentResolver()), requireForeground,
                            getOpPackageName(), user.getIdentifier());
                            getOpPackageName(), user.getIdentifier());
            if (cn != null) {
            if (cn != null) {
                if (cn.getPackageName().equals("!")) {
                if (cn.getPackageName().equals("!")) {
+1 −2
Original line number Original line Diff line number Diff line
@@ -129,8 +129,7 @@ interface IActivityManager {
    void finishSubActivity(in IBinder token, in String resultWho, int requestCode);
    void finishSubActivity(in IBinder token, in String resultWho, int requestCode);
    PendingIntent getRunningServiceControlPanel(in ComponentName service);
    PendingIntent getRunningServiceControlPanel(in ComponentName service);
    ComponentName startService(in IApplicationThread caller, in Intent service,
    ComponentName startService(in IApplicationThread caller, in Intent service,
            in String resolvedType, int id, in Notification notification,
            in String resolvedType, boolean requireForeground, in String callingPackage, int userId);
            boolean requireForeground, in String callingPackage, int userId);
    int stopService(in IApplicationThread caller, in Intent service,
    int stopService(in IApplicationThread caller, in Intent service,
            in String resolvedType, int userId);
            in String resolvedType, int userId);
    int bindService(in IApplicationThread caller, in IBinder token, in Intent service,
    int bindService(in IApplicationThread caller, in IBinder token, in Intent service,
Loading