Class MAMListActivity

  • All Implemented Interfaces:
    android.content.ComponentCallbacks , android.content.ComponentCallbacks2 , android.view.KeyEvent.Callback , android.view.LayoutInflater.Factory , android.view.LayoutInflater.Factory2 , android.view.View.OnCreateContextMenuListener , android.view.Window.Callback , com.microsoft.intune.mam.client.app.HookedActivity , com.microsoft.intune.mam.client.app.HookedContextWrapper , com.microsoft.intune.mam.client.app.MAMActivityBlockingListener , com.microsoft.intune.mam.client.app.MAMActivityIdentityRequirementListener , com.microsoft.intune.mam.client.app.MAMActivityIdentitySwitchListener

    
    public abstract class MAMListActivity
    extends ListActivity implements HookedActivity
                        

    Managed version of android.app.ListActivity.

    • Constructor Detail

      • MAMListActivity

        MAMListActivity()
    • Method Detail

      • onMAMCreate

         void onMAMCreate(@Nullable() Bundle savedInstanceState)

        MAM version of onCreate.

        Parameters:
        savedInstanceState - Saved instance state.
      • onMAMStart

         void onMAMStart()

        MAM version of onStart.

      • onMAMResume

         void onMAMResume()

        MAM version of onResume.

      • onMAMPause

         void onMAMPause()

        MAM version of onPause.

      • onMAMPostCreate

         void onMAMPostCreate(Bundle savedInstanceState)

        MAM version of onPostCreate.

        Parameters:
        savedInstanceState - Saved instance state.
      • onMAMStop

         void onMAMStop()

        MAM version of onStop.

      • onMAMDestroy

         void onMAMDestroy()

        MAM version of onDestroy.

      • onMAMNewIntent

         void onMAMNewIntent(Intent intent)

        MAM version of onNewIntent.

        Parameters:
        intent - intent to process
      • onMAMSaveInstanceState

         void onMAMSaveInstanceState(@NonNull() Bundle outState)

        MAM version of onSaveInstanceState.

        Parameters:
        outState - Out state.
      • onMAMPictureInPictureRequested

        @RequiresApi(api = Build.VERSION_CODES.R) boolean onMAMPictureInPictureRequested()

        MAM version of onPictureInPictureRequested.

        Returns:

        true if the activity received this callback regardless of if it acts on it or not. If false, the framework will assume the app hasn't been updated to leverage this callback and will in turn send a legacy callback of onUserLeaveHint() for the app to enter picture-in-picture mode.

      • startActivityFromFragment

         void startActivityFromFragment(Fragment fragment, Intent intent, int requestCode, Bundle options)
      • onMAMActivityResult

         void onMAMActivityResult(int requestCode, int resultCode, Intent data)

        MAM version of onActivityResult.

        Parameters:
        requestCode - Request code.
        resultCode - Result code.
        data - Intent data.
      • onProvideAssistContent

        @RequiresApi(value = Build.VERSION_CODES.M) final void onProvideAssistContent(AssistContent content)
      • onMAMProvideAssistContent

        @RequiresApi(value = Build.VERSION_CODES.M) void onMAMProvideAssistContent(AssistContent content)

        MAM version of onProvideAssistContent.

        Parameters:
        content - content
      • onMAMRawProvideAssistContent

        @RequiresApi(value = Build.VERSION_CODES.M) final void onMAMRawProvideAssistContent(Object content)

        MAM version of onProvideAssistContent.

        Parameters:
        content - AssistContent.
      • onSearchRequested

        @RequiresApi(value = Build.VERSION_CODES.M) final boolean onSearchRequested(SearchEvent event)
      • onMAMSearchRequested

        @RequiresApi(value = Build.VERSION_CODES.M) boolean onMAMSearchRequested(SearchEvent event)

        MAM version of onSearchRequested.

        Parameters:
        event - event
        Returns:

        true if the search request is allowed

      • onMAMRawSearchRequested

        @RequiresApi(value = Build.VERSION_CODES.M) final boolean onMAMRawSearchRequested(Object event)

        MAM version of onSearchRequested.

        Parameters:
        event - SearchEvent.
        Returns:

        false if activity blocks the search.

      • onProvideReferrer

        @RequiresApi(value = Build.VERSION_CODES.M) Uri onProvideReferrer()
      • onMAMProvideReferrer

        @RequiresApi(value = Build.VERSION_CODES.M) Uri onMAMProvideReferrer()

        MAM version on onProviderReferrer.

        Returns:

        URI representing referrer.

      • onStateNotSaved

        @RequiresApi(value = Build.VERSION_CODES.M) void onStateNotSaved()
      • onMAMStateNotSaved

        @RequiresApi(value = Build.VERSION_CODES.M) void onMAMStateNotSaved()

        MAM Version of onStateNotSaved.

      • onMAMPrepareOptionsMenu

         boolean onMAMPrepareOptionsMenu(Menu menu)

        MAM version of onPrepareOptionsMenu.

        Parameters:
        menu - menu
        Returns:

        true to display the menu

      • onCreateView

         View onCreateView(View parent, String name, Context context, AttributeSet attrs)
      • onMAMCreateView

         View onMAMCreateView(View parent, String name, Context context, AttributeSet attrs)

        MAM version of onCreateView. See Android documentation for more info.

        Parameters:
        parent - parent
        name - name
        context - context
        attrs - attrs
        Returns:

        view

      • onMAMIdentitySwitchRequired

        @Deprecated() void onMAMIdentitySwitchRequired(@NonNull() String identity, @NonNull() AppIdentitySwitchReason reason, @NonNull() AppIdentitySwitchResultCallback callback)

        Called by MAM to notify the app that an incoming intent requires an identity switch for this Activity. This can occur during activity creation or when a new intent is sent to an existing activity. The application must call callback.reportIdentitySwitchResult to tell MAM whether the identity switch is allowed. In general, applications should allow identity switches. The default implementation allows all identity switches. When using the build plugin, the default implementation can be accessed by calling MAMctivity.defaultOnMAMIdentitySwitchRequired. The most common case for this method to be called is before onMAMCreate. The application is allowed to show UI to confirm the identity switch, but it must show the UI using a different activity as onMAMCreate will not be called for this activity until the identity switch is allowed. Special care must be taken with single-top activities when a new intent can cause an identity switch. If a new intent causes an identity switch, after the switch is approved by this method, onMAMNewIntent will be called and then recreate() will be called which is necessary to enforce screenshot restrictions from the new policy. It is strongly recommended that the implementation of onMAMNewIntent call setIntent, as otherwise the following recreate may cause the original intent rather than the new intent to be displayed.

        Parameters:
        identity - identity being switched to
        reason - reason identity is being switched
        callback - must be called to notify MAM whether to allow the switch.
      • onMAMIdentitySwitchRequired

         void onMAMIdentitySwitchRequired(@NonNull() String upn, @NonNull() String oid, @NonNull() AppIdentitySwitchReason reason, @NonNull() AppIdentitySwitchResultCallback callback)

        Called by MAM to notify the app that an incoming intent requires an identity switch for this Activity. This can occur during activity creation or when a new intent is sent to an existing activity. The application must call callback.reportIdentitySwitchResult to tell MAM whether the identity switch is allowed. In general, applications should allow identity switches. The default implementation allows all identity switches. When using the build plugin, the default implementation can be accessed by calling MAMctivity.defaultOnMAMIdentitySwitchRequired. The most common case for this method to be called is before onMAMCreate. The application is allowed to show UI to confirm the identity switch, but it must show the UI using a different activity as onMAMCreate will not be called for this activity until the identity switch is allowed. Special care must be taken with single-top activities when a new intent can cause an identity switch. If a new intent causes an identity switch, after the switch is approved by this method, onMAMNewIntent will be called and then recreate() will be called which is necessary to enforce screenshot restrictions from the new policy. It is strongly recommended that the implementation of onMAMNewIntent call setIntent, as otherwise the following recreate may cause the original intent rather than the new intent to be displayed.

        Parameters:
        upn - UPN of the identity being switched to
        oid - AAD OID of the identity being switched to
        reason - reason identity is being switched
        callback - must be called to notify MAM whether to allow the switch.
      • defaultOnMAMIdentitySwitchRequired

        @Deprecated() static void defaultOnMAMIdentitySwitchRequired(@NonNull() Activity activity, @NonNull() String identity, @NonNull() AppIdentitySwitchReason reason, @NonNull() AppIdentitySwitchResultCallback callback)

        Expose default behavior for notifying the app that an incoming intent requires an identity switch for this Activity. The Activity will be checked if it is MAM-integrated and, if so, the default onMAMIdentitySwitchRequired behavior will be called.

        Parameters:
        activity - The activity to perform an identity switch for.
        identity - identity being switched to
        reason - reason identity is being switched.
        callback - must be called to notify MAM whether to allow the switch.
      • defaultOnMAMIdentitySwitchRequired

         static void defaultOnMAMIdentitySwitchRequired(@NonNull() Activity activity, @NonNull() String upn, @NonNull() String oid, @NonNull() AppIdentitySwitchReason reason, @NonNull() AppIdentitySwitchResultCallback callback)

        Expose default behavior for notifying the app that an incoming intent requires an identity switch for this Activity. The Activity will be checked if it is MAM-integrated and, if so, the default onMAMIdentitySwitchRequired behavior will be called.

        Parameters:
        activity - The activity to perform an identity switch for.
        upn - UPN of the identity being switched to.
        oid - AAD OID of the identity being switched to.
        reason - reason identity is being switched.
        callback - must be called to notify MAM whether to allow the switch.
      • onSwitchMAMIdentityComplete

         void onSwitchMAMIdentityComplete(@NonNull() MAMIdentitySwitchResult result)

        Called by MAM to notify the app that the identity switch for this Activity has completed.

        Parameters:
        result - Result of the MAM identity switch.
      • registerActivityLifecycleCallbacks

        @RequiresApi(api = Build.VERSION_CODES.Q) void registerActivityLifecycleCallbacks(@NonNull() Application.ActivityLifecycleCallbacks callback)
      • unregisterActivityLifecycleCallbacks

        @RequiresApi(api = Build.VERSION_CODES.Q) void unregisterActivityLifecycleCallbacks(@NonNull() Application.ActivityLifecycleCallbacks callback)