Share via


AppOpsManager.ModeForeground フィールド

定義

注意事項

This constant will be removed in the future version. Use Android.App.AppOpsManagerMode enum directly instead of this field.

"アプリがフォアグラウンドにある場合にのみ許可する" を意味する特別なモード。

[Android.Runtime.Register("MODE_FOREGROUND", ApiSince=29)]
[System.Obsolete("This constant will be removed in the future version. Use Android.App.AppOpsManagerMode enum directly instead of this field.", true)]
public const Android.App.AppOpsManagerMode ModeForeground = 4;
[<Android.Runtime.Register("MODE_FOREGROUND", ApiSince=29)>]
[<System.Obsolete("This constant will be removed in the future version. Use Android.App.AppOpsManagerMode enum directly instead of this field.", true)>]
val mutable ModeForeground : Android.App.AppOpsManagerMode

フィールド値

Value = 4
属性

注釈

"アプリがフォアグラウンドにある場合にのみ許可する" を意味する特別なモード。 これは、<、#noteOp#startOp、 から#unsafeCheckOp返される b>not</b> です。 代わりに、 #unsafeCheckOp は常に を返し #MODE_ALLOWED (アプリのバックグラウンド状態に応じて、最終的に許可される可能性があるため)#startOp#noteOp、チェック対象のアプリが現在フォアグラウンドにある場合は を返し、それ以外の場合#MODE_IGNOREDは を返します#MODE_ALLOWED

通常、この値が表示される唯一の場所は、 を通じて #unsafeCheckOpRawです。これは、操作の実際の生モードを返します。 チェック対象のアプリの現在の状態を把握できないため (また、いつでも変更される可能性があります)、ここでの結果は、アプリのバックグラウンド状態の変化によって異な#MODE_ALLOWED#MODE_IGNOREDっていることを示すものとしてのみ扱うことができます。 したがって、操作にアクセスするには、常に または #startOp を使用#noteOpして実際のチェックを実行する必要があります。

の Java ドキュメント android.app.AppOpsManager.MODE_FOREGROUND

このページの一部は、によって作成および共有され、に記載されている条件に従って使用される作業に基づく変更です。

適用対象