1 /*
2  * Copyright (C) 2006 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 package android.app;
18 import android.compat.annotation.UnsupportedAppUsage;
19 import android.content.Intent;
20 import android.os.IBinder;
21 
22 /**
23  * {@hide}
24  * @deprecated will be removed soon. See individual methods for alternatives.
25  */
26 @Deprecated
27 public abstract class ActivityManagerNative {
28 
29     @UnsupportedAppUsage
ActivityManagerNative()30     public ActivityManagerNative() {
31     }
32 
33     /**
34      * Cast a Binder object into an activity manager interface, generating
35      * a proxy if needed.
36      *
37      * @deprecated use IActivityManager.Stub.asInterface instead.
38      */
39     @UnsupportedAppUsage
asInterface(IBinder obj)40     static public IActivityManager asInterface(IBinder obj) {
41         return IActivityManager.Stub.asInterface(obj);
42     }
43 
44     /**
45      * Retrieve the system's default/global activity manager.
46      *
47      * @deprecated use ActivityManager.getService instead.
48      */
49     @UnsupportedAppUsage
getDefault()50     static public IActivityManager getDefault() {
51         return ActivityManager.getService();
52     }
53 
54     /**
55      * Convenience for checking whether the system is ready.  For internal use only.
56      *
57      * @deprecated use ActivityManagerInternal.isSystemReady instead.
58      */
59     @UnsupportedAppUsage
isSystemReady()60     static public boolean isSystemReady() {
61         return ActivityManager.isSystemReady();
62     }
63 
64     /**
65      * @deprecated use ActivityManager.broadcastStickyIntent instead.
66      */
67     @UnsupportedAppUsage
broadcastStickyIntent(Intent intent, String permission, int userId)68     static public void broadcastStickyIntent(Intent intent, String permission, int userId) {
69         broadcastStickyIntent(intent, permission, AppOpsManager.OP_NONE, userId);
70     }
71 
72     /**
73      * Convenience for sending a sticky broadcast.  For internal use only.
74      * If you don't care about permission, use null.
75      *
76      * @deprecated use ActivityManager.broadcastStickyIntent instead.
77      */
broadcastStickyIntent(Intent intent, String permission, int appOp, int userId)78     static public void broadcastStickyIntent(Intent intent, String permission, int appOp,
79             int userId) {
80         ActivityManager.broadcastStickyIntent(intent, appOp, userId);
81     }
82 
83     /**
84      * @deprecated use ActivityManager.noteWakeupAlarm instead.
85      */
noteWakeupAlarm(PendingIntent ps, int sourceUid, String sourcePkg, String tag)86     static public void noteWakeupAlarm(PendingIntent ps, int sourceUid, String sourcePkg,
87             String tag) {
88         ActivityManager.noteWakeupAlarm(ps, null, sourceUid, sourcePkg, tag);
89     }
90 
91     /**
92      * @deprecated use ActivityManager.noteAlarmStart instead.
93      */
noteAlarmStart(PendingIntent ps, int sourceUid, String tag)94     static public void noteAlarmStart(PendingIntent ps, int sourceUid, String tag) {
95         ActivityManager.noteAlarmStart(ps, null, sourceUid, tag);
96     }
97 
98     /**
99      * @deprecated use ActivityManager.noteAlarmFinish instead.
100      */
noteAlarmFinish(PendingIntent ps, int sourceUid, String tag)101     static public void noteAlarmFinish(PendingIntent ps, int sourceUid, String tag) {
102         ActivityManager.noteAlarmFinish(ps, null, sourceUid, tag);
103     }
104 }
105