Since: API level 35
public class

KnoxPushService

extends Object
java.lang.Object
   ↳ com.samsung.android.knox.kpm.KnoxPushService

Class Overview

This class provides knox push service functionality. Knox push service can register device to Knox System Server based on caller package name. After device registration, Knox Partner can use Server to Server Service provided by Knox System Server.

Since
API level 35
KNOX 3.8

Summary

Public Methods
int isRegistered(KnoxPushServiceCallback cb)
Check if the device is registered or not.
boolean isSupported()
Check if the device supports knox push service or not.
int registerDevice(boolean forceRefresh, KnoxPushServiceCallback cb)
Register device to Knox System Server.
int unRegisterDevice(KnoxPushServiceCallback cb)
UnRegister device from Knox System Server.
[Expand]
Inherited Methods
From class java.lang.Object

Public Methods

public int isRegistered (KnoxPushServiceCallback cb)

Since: API level 35

Check if the device is registered or not.

Parameters
cb
KnoxPushServiceCallback instance to get isRegistered result.
Returns
  • KnoxPushServiceResult.ERROR_NONE if successfully requested.
Usage
Used to check device registration status. The registration status result is sent back to the caller with Callback API.

 // A KnoxPushServiceCallback object should be declared to handle result.
 KnoxPushServiceCallback cb = new KnoxPushServiceCallback() {
 // A KnoxPushServiceResult object including result passed with onRegistrationStatus api.
     public void onRegistrationStatus(final KnoxPushServiceResult result) {
         int error = result.getError();
         String reason = result.getReason();
     }
 }
 EnterpriseKnoxManager ekm = EnterpriseKnoxManager.getInstance(context);
 KnoxPushService knoxPushService = ekm.getKnoxPushService();
 
 int requested = knoxPushService.isRegistered(cb);
 
Permission
The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_ENHANCED_ATTESTATION" permission with a protection level of signature.
Since
API level 35
KNOX 3.8
Multiuser Environment
User Scope

public boolean isSupported ()

Since: API level 35

Check if the device supports knox push service or not.

Returns
  • true if supported, false if not supported.
Usage
Used to check the knox push service supported.

 EnterpriseKnoxManager ekm = EnterpriseKnoxManager.getInstance(context);
 KnoxPushService knoxPushService = ekm.getKnoxPushService();
 boolean supported = knoxPushService.isSupported();
 
Since
API level 35
KNOX 3.8
Multiuser Environment
User Scope

public int registerDevice (boolean forceRefresh, KnoxPushServiceCallback cb)

Since: API level 35

Register device to Knox System Server.

Parameters
forceRefresh
Make device communicating with Knox System Server regardless of registration status. false is recommended.
cb
KnoxPushServiceCallback instance to get registration result.
Returns
  • KnoxPushServiceResult.ERROR_NONE if successfully requested.
Usage
Used to register device to Knox System Server. The registartion result is sent back to the caller with Callback API.

 // A KnoxPushServiceCallback object should be declared to handle result.
 KnoxPushServiceCallback cb = new KnoxPushServiceCallback() {
 // A KnoxPushServiceResult object including result passed with onRegistrationFinished api.
     public void onRegistrationFinished(final KnoxPushServiceResult result) {
         int error = result.getError();
         String reason = result.getReason();
         String deviceId = result.getDeviceId();
     }
 }
 EnterpriseKnoxManager ekm = EnterpriseKnoxManager.getInstance(context);
 KnoxPushService knoxPushService = ekm.getKnoxPushService();
 
 int requested = knoxPushService.registerDevice(false, cb);
 
Permission
The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_ENHANCED_ATTESTATION" permission with a protection level of signature.
Since
API level 35
KNOX 3.8
Multiuser Environment
User Scope

public int unRegisterDevice (KnoxPushServiceCallback cb)

Since: API level 35

UnRegister device from Knox System Server.

Parameters
cb
KnoxPushServiceCallback instance to get unregistration result.
Returns
  • KnoxPushServiceResult.ERROR_NONE if successfully requested.
Usage
Used to unregister device from Knox System Server. The unregistration result is sent back to the caller with Callback API.

 // A KnoxPushServiceCallback object should be declared to handle result.
 KnoxPushServiceCallback cb = new KnoxPushServiceCallback() {
 // A KnoxPushServiceResult object including result passed with onUnRegistrationFinished api.
     public void onUnRegistrationFinished(final KnoxPushServiceResult result) {
         int error = result.getError();
         String reason = result.getReason();
     }
 }
 EnterpriseKnoxManager ekm = EnterpriseKnoxManager.getInstance(context);
 KnoxPushService knoxPushService = ekm.getKnoxPushService();
 
 int requested = knoxPushService.unRegisterDevice(cb);
 
Permission
The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_ENHANCED_ATTESTATION" permission with a protection level of signature.
Since
API level 35
KNOX 3.8
Multiuser Environment
User Scope