Class MAMAliasActivity
-
- 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 MAMAliasActivity extends AliasActivity implements HookedActivity
Managed version of android.app.AliasActivity.
-
-
Field Summary
-
Constructor Summary
Constructors Constructor Description MAMAliasActivity()
-
Method Summary
Modifier and Type Method Description voidonMAMCreate(@Nullable() Bundle savedInstanceState)MAM version of onCreate. voidonMAMStart()MAM version of onStart. voidonMAMResume()MAM version of onResume. voidonMAMPause()MAM version of onPause. voidonMAMPostCreate(Bundle savedInstanceState)MAM version of onPostCreate. voidonMAMPostResume()MAM version of onPostResume. voidonMAMStop()MAM version of onStop. voidonMAMDestroy()MAM version of onDestroy. voidonMAMNewIntent(Intent intent)MAM version of onNewIntent. final voidonSaveInstanceState(Bundle outState)voidonMAMSaveInstanceState(@NonNull() Bundle outState)MAM version of onSaveInstanceState. voidonMAMUserLeaveHint()MAM version of onUserLeaveHint. booleanonPictureInPictureRequested()booleanonMAMPictureInPictureRequested()MAM version of onPictureInPictureRequested. voidstartActivityForResult(Intent intent, int requestCode)voidstartActivityForResult(Intent intent, int requestCode, Bundle options)voidstartActivities(Array<Intent> intents, Bundle options)voidstartActivityFromFragment(Fragment fragment, Intent intent, int requestCode)voidstartActivityFromFragment(Fragment fragment, Intent intent, int requestCode, Bundle options)booleanstartActivityIfNeeded(Intent intent, int requestCode)booleanstartActivityIfNeeded(Intent intent, int requestCode, Bundle options)voidonMAMActivityResult(int requestCode, int resultCode, Intent data)MAM version of onActivityResult. booleanonCreateThumbnail(Bitmap outBitmap, Canvas canvas)final voidonProvideAssistContent(AssistContent content)voidonMAMProvideAssistContent(AssistContent content)MAM version of onProvideAssistContent. final voidonMAMRawProvideAssistContent(Object content)MAM version of onProvideAssistContent. final booleanonSearchRequested(SearchEvent event)booleanonMAMSearchRequested(SearchEvent event)MAM version of onSearchRequested. final booleanonMAMRawSearchRequested(Object event)MAM version of onSearchRequested. UrionProvideReferrer()UrionMAMProvideReferrer()MAM version on onProviderReferrer. voidonStateNotSaved()voidonMAMStateNotSaved()MAM Version of onStateNotSaved. final booleanonPrepareOptionsMenu(Menu menu)booleanonMAMPrepareOptionsMenu(Menu menu)MAM version of onPrepareOptionsMenu. ViewonCreateView(View parent, String name, Context context, AttributeSet attrs)ViewonMAMCreateView(View parent, String name, Context context, AttributeSet attrs)MAM version of onCreateView. voidonMAMIdentitySwitchRequired(@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. voidonMAMIdentitySwitchRequired(@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. static voiddefaultOnMAMIdentitySwitchRequired(@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. static voiddefaultOnMAMIdentitySwitchRequired(@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. final voidswitchMAMIdentity(@Nullable() String newIdentity, @NonNull() EnumSet<IdentitySwitchOption> options)Set new identity. final voidswitchMAMIdentityOID(@Nullable() String newOid, @NonNull() EnumSet<IdentitySwitchOption> options)Set new identity. voidonSwitchMAMIdentityComplete(@NonNull() MAMIdentitySwitchResult result)Called by MAM to notify the app that the identity switch for this Activity has completed. voidregisterActivityLifecycleCallbacks(@NonNull() Application.ActivityLifecycleCallbacks callback)voidunregisterActivityLifecycleCallbacks(@NonNull() Application.ActivityLifecycleCallbacks callback)-
Methods inherited from class com.microsoft.intune.mam.client.app.HookedActivity
switchMAMIdentity, switchMAMIdentityOID -
Methods inherited from class android.app.Activity
addContentView, clearOverrideActivityTransition, closeContextMenu, closeOptionsMenu, createPendingResult, dismissDialog, dismissKeyboardShortcutsHelper, dispatchGenericMotionEvent, dispatchKeyEvent, dispatchKeyShortcutEvent, dispatchPopulateAccessibilityEvent, dispatchTouchEvent, dispatchTrackballEvent, dump, enterPictureInPictureMode, enterPictureInPictureMode, findViewById, finish, finishActivity, finishActivityFromChild, finishAffinity, finishAfterTransition, finishAndRemoveTask, finishFromChild, getActionBar, getApplication, getCaller, getCallingActivity, getCallingPackage, getChangingConfigurations, getComponentName, getContentScene, getContentTransitionManager, getCurrentCaller, getCurrentFocus, getFragmentManager, getInitialCaller, getIntent, getLastNonConfigurationInstance, getLaunchedFromPackage, getLaunchedFromUid, getLayoutInflater, getLoaderManager, getLocalClassName, getMaxNumPictureInPictureActions, getMediaController, getMenuInflater, getOnBackInvokedDispatcher, getParent, getParentActivityIntent, getPreferences, getReferrer, getRequestedOrientation, getSearchEvent, getSplashScreen, getSystemService, getTaskId, getTitle, getTitleColor, getVoiceInteractor, getVolumeControlStream, getWindow, getWindowManager, hasWindowFocus, invalidateOptionsMenu, isActivityTransitionRunning, isChangingConfigurations, isChild, isDestroyed, isFinishing, isImmersive, isInMultiWindowMode, isInPictureInPictureMode, isLaunchedFromBubble, isLocalVoiceInteractionSupported, isTaskRoot, isVoiceInteraction, isVoiceInteractionRoot, managedQuery, moveTaskToBack, navigateUpTo, navigateUpToFromChild, onActionModeFinished, onActionModeStarted, onActivityReenter, onAttachFragment, onAttachedToWindow, onBackPressed, onConfigurationChanged, onContentChanged, onContextItemSelected, onContextMenuClosed, onCreateContextMenu, onCreateDescription, onCreateNavigateUpTaskStack, onCreateOptionsMenu, onCreatePanelMenu, onCreatePanelView, onDetachedFromWindow, onEnterAnimationComplete, onGenericMotionEvent, onGetDirectActions, onKeyDown, onKeyLongPress, onKeyMultiple, onKeyShortcut, onKeyUp, onLocalVoiceInteractionStarted, onLocalVoiceInteractionStopped, onLowMemory, onMenuItemSelected, onMenuOpened, onMultiWindowModeChanged, onNavigateUp, onNavigateUpFromChild, onOptionsItemSelected, onOptionsMenuClosed, onPanelClosed, onPerformDirectAction, onPictureInPictureModeChanged, onPictureInPictureUiStateChanged, onPrepareNavigateUpTaskStack, onPreparePanel, onProvideAssistData, onProvideKeyboardShortcuts, onRequestPermissionsResult, onRetainNonConfigurationInstance, onSearchRequested, onTopResumedActivityChanged, onTouchEvent, onTrackballEvent, onTrimMemory, onUserInteraction, onVisibleBehindCanceled, onWindowAttributesChanged, onWindowFocusChanged, onWindowStartingActionMode, openContextMenu, openOptionsMenu, overrideActivityTransition, overridePendingTransition, postponeEnterTransition, recreate, registerComponentCallbacks, registerForContextMenu, registerScreenCaptureCallback, releaseInstance, removeDialog, reportFullyDrawn, requestDragAndDropPermissions, requestFullscreenMode, requestOpenInBrowserEducation, requestPermissions, requestShowKeyboardShortcuts, requestVisibleBehind, requestWindowFeature, requireViewById, runOnUiThread, setActionBar, setAllowCrossUidActivitySwitchFromBelow, setContentTransitionManager, setContentView, setDefaultKeyMode, setEnterSharedElementCallback, setExitSharedElementCallback, setFeatureDrawable, setFeatureDrawableAlpha, setFeatureDrawableResource, setFeatureDrawableUri, setFinishOnTouchOutside, setImmersive, setInheritShowWhenLocked, setIntent, setLocusContext, setMediaController, setPictureInPictureParams, setProgress, setProgressBarIndeterminate, setProgressBarIndeterminateVisibility, setProgressBarVisibility, setRecentsScreenshotEnabled, setRequestedOrientation, setResult, setSecondaryProgress, setShouldDockBigOverlays, setShowWhenLocked, setTaskDescription, setTheme, setTitle, setTitleColor, setTranslucent, setTurnScreenOn, setVisible, setVolumeControlStream, setVrModeEnabled, shouldDockBigOverlays, shouldShowRequestPermissionRationale, shouldUpRecreateTask, showAssist, showDialog, showDialog, showLockTaskEscapeMessage, startActionMode, startActivities, startActivity, startActivityFromChild, startIntentSender, startIntentSenderForResult, startIntentSenderFromChild, startLocalVoiceInteraction, startLockTask, startManagingCursor, startNextMatchingActivity, startPostponedEnterTransition, startSearch, stopLocalVoiceInteraction, stopLockTask, stopManagingCursor, takeKeyEvents, triggerSearch, unregisterComponentCallbacks, unregisterForContextMenu, unregisterScreenCaptureCallback -
Methods inherited from class android.view.ContextThemeWrapper
applyOverrideConfiguration, getAssets, getResources, getTheme -
Methods inherited from class android.view.Window.Callback
onPointerCaptureChanged -
Methods inherited from class android.content.ContextWrapper
bindIsolatedService, bindService, bindServiceAsUser, checkCallingOrSelfPermission, checkCallingOrSelfUriPermission, checkCallingOrSelfUriPermissions, checkCallingPermission, checkCallingUriPermission, checkCallingUriPermissions, checkContentUriPermissionFull, checkPermission, checkSelfPermission, checkUriPermission, checkUriPermissions, clearWallpaper, createAttributionContext, createConfigurationContext, createContext, createContextForSplit, createDeviceContext, createDeviceProtectedStorageContext, createDisplayContext, createPackageContext, createWindowContext, databaseList, deleteDatabase, deleteFile, deleteSharedPreferences, enforceCallingOrSelfPermission, enforceCallingOrSelfUriPermission, enforceCallingPermission, enforceCallingUriPermission, enforcePermission, enforceUriPermission, fileList, getApplicationContext, getApplicationInfo, getAttributionSource, getAttributionTag, getBaseContext, getCacheDir, getClassLoader, getCodeCacheDir, getContentResolver, getDataDir, getDatabasePath, getDeviceId, getDir, getDisplay, getExternalCacheDir, getExternalCacheDirs, getExternalFilesDir, getExternalFilesDirs, getExternalMediaDirs, getFileStreamPath, getFilesDir, getMainExecutor, getMainLooper, getNoBackupFilesDir, getObbDir, getObbDirs, getOpPackageName, getPackageCodePath, getPackageManager, getPackageName, getPackageResourcePath, getParams, getSharedPreferences, getSystemServiceName, getWallpaper, getWallpaperDesiredMinimumHeight, getWallpaperDesiredMinimumWidth, grantUriPermission, isDeviceProtectedStorage, isRestricted, isUiContext, moveDatabaseFrom, moveSharedPreferencesFrom, openFileInput, openFileOutput, openOrCreateDatabase, peekWallpaper, registerDeviceIdChangeListener, registerReceiver, removeStickyBroadcast, removeStickyBroadcastAsUser, revokeSelfPermissionsOnKill, revokeUriPermission, sendBroadcast, sendBroadcastAsUser, sendOrderedBroadcast, sendOrderedBroadcastAsUser, sendStickyBroadcast, sendStickyBroadcastAsUser, sendStickyOrderedBroadcast, sendStickyOrderedBroadcastAsUser, setWallpaper, startForegroundService, startInstrumentation, startService, stopService, unbindService, unregisterDeviceIdChangeListener, unregisterReceiver, updateServiceGroup -
Methods inherited from class android.content.Context
getColor, getColorStateList, getDrawable, getString, getSystemService, getText, obtainStyledAttributes, revokeSelfPermissionOnKill, sendBroadcastWithMultiplePermissions -
Methods inherited from class com.microsoft.intune.mam.client.app.MAMActivityBlockingListener
onMAMCompanyPortalRequired, onMAMCompanyPortalRequired -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
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.
-
onMAMPostResume
void onMAMPostResume()
MAM version of onPostResume.
-
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
-
onSaveInstanceState
final void onSaveInstanceState(Bundle outState)
-
onMAMSaveInstanceState
void onMAMSaveInstanceState(@NonNull() Bundle outState)
MAM version of onSaveInstanceState.
- Parameters:
outState- Out state.
-
onMAMUserLeaveHint
void onMAMUserLeaveHint()
MAM version of onUserLeaveHint.
-
onPictureInPictureRequested
@RequiresApi(api = Build.VERSION_CODES.R) boolean onPictureInPictureRequested()
-
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.
-
startActivityForResult
void startActivityForResult(Intent intent, int requestCode)
-
startActivityForResult
void startActivityForResult(Intent intent, int requestCode, Bundle options)
-
startActivities
void startActivities(Array<Intent> intents, Bundle options)
-
startActivityFromFragment
void startActivityFromFragment(Fragment fragment, Intent intent, int requestCode)
-
startActivityFromFragment
void startActivityFromFragment(Fragment fragment, Intent intent, int requestCode, Bundle options)
-
startActivityIfNeeded
boolean startActivityIfNeeded(Intent intent, int requestCode)
-
startActivityIfNeeded
boolean startActivityIfNeeded(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.
-
onCreateThumbnail
boolean onCreateThumbnail(Bitmap outBitmap, Canvas canvas)
-
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.
-
onPrepareOptionsMenu
final boolean onPrepareOptionsMenu(Menu menu)
-
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- parentname- namecontext- contextattrs- 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 toreason- reason identity is being switchedcallback- 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 tooid- AAD OID of the identity being switched toreason- reason identity is being switchedcallback- 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 toreason- 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.
-
switchMAMIdentity
@Deprecated() final void switchMAMIdentity(@Nullable() String newIdentity, @NonNull() EnumSet<IdentitySwitchOption> options)
Set new identity.
- Parameters:
newIdentity- New identityoptions- Identity switch options.
-
switchMAMIdentityOID
final void switchMAMIdentityOID(@Nullable() String newOid, @NonNull() EnumSet<IdentitySwitchOption> options)
Set new identity.
- Parameters:
newOid- AAD OID of the new identity.options- Identity switch options.
-
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)
-
-
-
-