Home | History | Annotate | Download | only in shortcutmanager
      1 /*
      2  * Copyright (C) 2016 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 package android.content.pm.cts.shortcutmanager;
     17 
     18 import static com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.getIconSize;
     19 
     20 import android.content.pm.ShortcutManager;
     21 import android.test.suitebuilder.annotation.SmallTest;
     22 
     23 import com.android.compatibility.common.util.CddTest;
     24 
     25 @CddTest(requirement="3.8.1/C-4-1")
     26 @SmallTest
     27 public class ShortcutManagerMiscTest extends ShortcutManagerCtsTestsBase {
     28     @Override
     29     protected void setUp() throws Exception {
     30         super.setUp();
     31 
     32     }
     33 
     34     public void testMiscApis() throws Exception {
     35         ShortcutManager manager = getTestContext().getSystemService(ShortcutManager.class);
     36 
     37         assertEquals(5, manager.getMaxShortcutCountPerActivity());
     38 
     39         // during the test, this process always considered to be in the foreground.
     40         assertFalse(manager.isRateLimitingActive());
     41 
     42         final int iconDimension = getIconSize(getInstrumentation());
     43         assertEquals(iconDimension, manager.getIconMaxWidth());
     44         assertEquals(iconDimension, manager.getIconMaxHeight());
     45     }
     46 }
     47