Home | History | Annotate | Download | only in data
      1 /*
      2  * Copyright (C) 2015 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 com.android.deskclock.data;
     18 
     19 /**
     20  * Data that must be coordinated across all notifications is accessed via this model.
     21  */
     22 final class NotificationModel {
     23 
     24     private boolean mApplicationInForeground;
     25 
     26     /**
     27      * @param inForeground {@code true} to indicate the application is open in the foreground
     28      */
     29     void setApplicationInForeground(boolean inForeground) {
     30         mApplicationInForeground = inForeground;
     31     }
     32 
     33     /**
     34      * @return {@code true} while the application is open in the foreground
     35      */
     36     boolean isApplicationInForeground() {
     37         return mApplicationInForeground;
     38     }
     39 
     40     /**
     41      * @return a value that identifies the stopwatch notification
     42      */
     43     int getStopwatchNotificationId() {
     44         return Integer.MAX_VALUE - 1;
     45     }
     46 
     47     /**
     48      * @return a value that identifies the notification for running/paused timers
     49      */
     50     int getUnexpiredTimerNotificationId() {
     51         return Integer.MAX_VALUE - 2;
     52     }
     53 
     54     /**
     55      * @return a value that identifies the notification for expired timers
     56      */
     57     int getExpiredTimerNotificationId() {
     58         return Integer.MAX_VALUE - 3;
     59     }
     60 }