[**Added in Android UpsideDownCakePrivacySandbox**](https://developer.android.com/preview)  
Summary: [Methods](https://developer.android.com/design-for-safety/privacy-sandbox/reference/adservices/signals/ProtectedSignalsManager#pubmethods) \| [Inherited Methods](https://developer.android.com/design-for-safety/privacy-sandbox/reference/adservices/signals/ProtectedSignalsManager#inhmethods)  

# ProtectedSignalsManager


`
public


class
ProtectedSignalsManager
`


`

extends `[Object](https://developer.android.com/reference/java/lang/Object)`


`

`


`

|---|----------------------------------------------------|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.adservices.signals.ProtectedSignalsManager |

<br />

*** ** * ** ***

ProtectedSignalsManager provides APIs for apps and ad-SDKs to manage their protected signals.

## Summary

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          ### Public methods                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           ||
|-----------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` static `[ProtectedSignalsManager](https://developer.android.com/design-for-safety/privacy-sandbox/reference/adservices/signals/ProtectedSignalsManager) | ` `[get](https://developer.android.com/design-for-safety/privacy-sandbox/reference/adservices/signals/ProtectedSignalsManager#get(android.content.Context))`(`[Context](https://developer.android.com/reference/android/content/Context)` context) ` Factory method for creating an instance of ProtectedSignalsManager.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| ` void`                                                                                                                                                   | ` `[updateSignals](https://developer.android.com/design-for-safety/privacy-sandbox/reference/adservices/signals/ProtectedSignalsManager#updateSignals(android.adservices.signals.UpdateSignalsRequest,%20java.util.concurrent.Executor,%20android.os.OutcomeReceiver<java.lang.Object,java.lang.Exception>))`(`[UpdateSignalsRequest](https://developer.android.com/design-for-safety/privacy-sandbox/reference/adservices/signals/UpdateSignalsRequest)` updateSignalsRequest, `[Executor](https://developer.android.com/reference/java/util/concurrent/Executor)` executor, `[OutcomeReceiver](https://developer.android.com/reference/android/os/OutcomeReceiver)`<`[Object](https://developer.android.com/reference/java/lang/Object)`, `[Exception](https://developer.android.com/reference/java/lang/Exception)`> receiver) ` The updateSignals API will retrieve a JSON from the URI that describes which signals to add or remove. |

| ### Inherited methods |
|-----------------------|---|
| From class ` `[java.lang.Object](https://developer.android.com/reference/java/lang/Object)` ` |--------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` `[Object](https://developer.android.com/reference/java/lang/Object)          | ` `[clone](https://developer.android.com/reference/java/lang/Object#clone())`() ` Creates and returns a copy of this object.                                                                                                                                                        | | ` boolean`                                                                     | ` `[equals](https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object))`(`[Object](https://developer.android.com/reference/java/lang/Object)` obj) ` Indicates whether some other object is "equal to" this one.                                             | | ` void`                                                                        | ` `[finalize](https://developer.android.com/reference/java/lang/Object#finalize())`() ` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.                                                            | | ` final `[Class](https://developer.android.com/reference/java/lang/Class)`<?>` | ` `[getClass](https://developer.android.com/reference/java/lang/Object#getClass())`() ` Returns the runtime class of this `Object`.                                                                                                                                                 | | ` int`                                                                         | ` `[hashCode](https://developer.android.com/reference/java/lang/Object#hashCode())`() ` Returns a hash code value for the object.                                                                                                                                                   | | ` final void`                                                                  | ` `[notify](https://developer.android.com/reference/java/lang/Object#notify())`() ` Wakes up a single thread that is waiting on this object's monitor.                                                                                                                              | | ` final void`                                                                  | ` `[notifyAll](https://developer.android.com/reference/java/lang/Object#notifyAll())`() ` Wakes up all threads that are waiting on this object's monitor.                                                                                                                           | | ` `[String](https://developer.android.com/reference/java/lang/String)          | ` `[toString](https://developer.android.com/reference/java/lang/Object#toString())`() ` Returns a string representation of the object.                                                                                                                                              | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait(long,%20int))`(long timeoutMillis, int nanos) ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed. | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait(long))`(long timeoutMillis) ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.                   | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait())`() ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*.                                                                                             | ||

## Public methods

### get

[**Added in Android UpsideDownCakePrivacySandbox**](https://developer.android.com/preview)  

```
public static ProtectedSignalsManager get (Context context)
```

Factory method for creating an instance of ProtectedSignalsManager.

<br />

|                                                                   Parameters                                                                    ||
|-----------|--------------------------------------------------------------------------------------------------------------------------------------|
| `context` | `Context`: The [Context](https://developer.android.com/reference/android/content/Context) to use This value cannot be `null`. <br /> |

|                                                                                                                                                                     Returns                                                                                                                                                                     ||
|-------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [ProtectedSignalsManager](https://developer.android.com/design-for-safety/privacy-sandbox/reference/adservices/signals/ProtectedSignalsManager) | A [ProtectedSignalsManager](https://developer.android.com/design-for-safety/privacy-sandbox/reference/adservices/signals/ProtectedSignalsManager) instance This value cannot be `null`. <br /> |

### updateSignals

[**Added in Android UpsideDownCakePrivacySandbox**](https://developer.android.com/preview)  

```
public void updateSignals (UpdateSignalsRequest updateSignalsRequest, 
                Executor executor, 
                OutcomeReceiver<Object, Exception> receiver)
```

The updateSignals API will retrieve a JSON from the URI that describes which signals to add
or remove. This API also allows registering the encoder endpoint. The endpoint is used to
download an encoding logic, which enables encoding the signals.

The top level keys for the JSON must correspond to one of 5 commands:

"put" - Adds a new signal, overwriting any existing signals with the same key. The value
for this is a JSON object where the keys are base 64 strings corresponding to the key to put
for and the values are base 64 string corresponding to the value to put.

"append" - Appends a new signal/signals to a time series of signals, removing the oldest
signals to make room for the new ones if the size of the series exceeds the given maximum.
The value for this is a JSON object where the keys are base 64 strings corresponding to the
key to append to and the values are objects with two fields: "values" and "maxSignals" .
"values" is a list of base 64 strings corresponding to signal values to append to the time
series. "maxSignals" is the maximum number of values that are allowed in this timeseries. If
the current number of signals associated with the key exceeds maxSignals the oldest signals
will be removed. Note that you can append to a key added by put. Not that appending more than
the maximum number of values will cause a failure.

"put_if_not_present" - Adds a new signal only if there are no existing signals with the
same key. The value for this is a JSON object where the keys are base 64 strings
corresponding to the key to put for and the values are base 64 string corresponding to the
value to put.

"remove" - Removes the signal for a key. The value of this is a list of base 64 strings
corresponding to the keys of signals that should be deleted.

"update_encoder" - Provides an action to update the endpoint, and a URI which can be used
to retrieve an encoding logic. The sub-key for providing an update action is "action" and the
values currently supported are:

1. "REGISTER" : Registers the encoder endpoint if provided for the first time or overwrites the existing one with the newly provided endpoint. Providing the "endpoint" is required for the "REGISTER" action.

The sub-key for providing an encoder endpoint is "endpoint" and the value is the URI
string for the endpoint.

Key may only be operated on by one command per JSON. If two command attempt to operate on
the same key, this method will through an [IllegalArgumentException](https://developer.android.com/reference/java/lang/IllegalArgumentException)

This call fails with an [SecurityException](https://developer.android.com/reference/java/lang/SecurityException) if

1. the `ownerPackageName` is not calling app's package name and/or
2. the buyer is not authorized to use the API.

This call fails with an [IllegalArgumentException](https://developer.android.com/reference/java/lang/IllegalArgumentException) if

1. The JSON retrieved from the server is not valid.
2. The provided URI is invalid.

This call fails with [LimitExceededException](https://developer.android.com/reference/android/os/LimitExceededException) if the calling package exceeds the
allowed rate limits and is throttled.

This call fails with an [IllegalStateException](https://developer.android.com/reference/java/lang/IllegalStateException) if an internal service error is
encountered.

<br />


Requires [AdServicesPermissions.ACCESS_ADSERVICES_CUSTOM_AUDIENCE](https://developer.android.com/design-for-safety/privacy-sandbox/reference/adservices/common/AdServicesPermissions#ACCESS_ADSERVICES_CUSTOM_AUDIENCE)

<br />

|                                                                                                                                                                                                                                                                                                        Parameters                                                                                                                                                                                                                                                                                                        ||
|------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `updateSignalsRequest` | `UpdateSignalsRequest`: This value cannot be `null`. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| `executor`             | `Executor`: This value cannot be `null`. Callback and listener events are dispatched through this [Executor](https://developer.android.com/reference/java/util/concurrent/Executor), providing an easy way to control which thread is used. To dispatch events through the main thread of your application, you can use [Context.getMainExecutor()](https://developer.android.com/reference/android/content/Context#getMainExecutor()). Otherwise, provide an [Executor](https://developer.android.com/reference/java/util/concurrent/Executor) that dispatches to an appropriate thread. <br /> |
| `receiver`             | `OutcomeReceiver`: This value cannot be `null`. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |