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

Commit 9802c4c2 authored by Anthony Lee's avatar Anthony Lee Committed by android-build-merger
Browse files

am 6727926a: Added a function to clear accounts for a specified package.

automerge: fe5e5dc1

* commit 'fe5e5dc1':
  Added a function to clear accounts for a specified package.
parents 2f3dab85 fe5e5dc1
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@ import android.os.Bundle;
import android.os.RemoteException;
import android.os.ServiceManager;
import android.telephony.TelephonyManager;
import android.text.TextUtils;
import android.util.Log;

import com.android.internal.telecom.ITelecomService;
@@ -624,6 +625,20 @@ public class TelecomManager {
        }
    }

    /**
     * Remove all Accounts that belong to the specified package from the system.
     * @hide
     */
    public void clearAccountsForPackage(String packageName) {
        try {
            if (isServiceConnected() && !TextUtils.isEmpty(packageName)) {
                getTelecomService().clearAccounts(packageName);
            }
        } catch (RemoteException e) {
            Log.e(TAG, "Error calling ITelecomService#clearAccountsForPackage()", e);
        }
    }

    /**
     * @hide
     */